-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CANCUN hard fork impelemtation #39
Conversation
…functions for CANCUN hardfork
…cked for blob_gasprice
core/src/utils.rs
Outdated
/// | ||
/// This function panics if `denominator` is zero. | ||
#[inline] | ||
pub fn fake_exponential(factor: u64, numerator: u64, denominator: u64) -> u128 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry about overflow in this function.
The implementation in the EIP is written in Python which uses arbitrary precision integers. The geth implementation uses arbitrary precision integers as well.
The Erigon implementation uses 256-bit integers, but still checks for overflow and returns an error in that case. I think we should follow this example and also use U256
with overflow-checked arithmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I agree, it seems like should be refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually... this function can be removed. As it's for test KZG-precompiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure if it's not needed then please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 12b1dd0
* Extend tests output and refactore tests runner * Refactored CLI for recursive tests and extended information * Set Shanghai spec as default * Extend output for tests * evm-tests: extend state statistics for failed results * evm-tests: extended debug info * Extend gas cost analyzer * Extend tests and fixes for Cancun hard fork * Fix: Apply CREATE storage reset - changed logic. GAS cost for MCOPY - improved calculation * EIP-3607 implementation. DeepCall bug fixes. KZG-boilerplate * KZG precompile * Removev debug info * Fix: tests for EIP-3860 (#41) undefined * ForkSpec string error. Refactored usage as constantn USIZE_MAX * Remove already fixed tests from skipping list * Added KzgInput
* Extend tests output and refactore tests runner * Refactored CLI for recursive tests and extended information * Set Shanghai spec as default * Extend output for tests * evm-tests: extend state statistics for failed results * evm-tests: extended debug info * Extend gas cost analyzer * Extend tests and fixes for Cancun hard fork * Fix: Apply CREATE storage reset - changed logic. GAS cost for MCOPY - improved calculation * EIP-3607 implementation. DeepCall bug fixes. KZG-boilerplate * KZG precompile * EIP-3860 test flow fixes * Fix Shanghai tests * Removev debug info * Separate check_exit_reason func * Remove printing * Added `as_deref` to check_create_exit_reason * Fix: tests for EIP-3860 (#41) undefined * ForkSpec string error. Refactored usage as constantn USIZE_MAX * Remove already fixed tests from skipping list * Refactore blob-hash logic and tests * Added KzgInput * Gas price fix and investigations for blob-transactions * Refactored skipped-match and clippy * Refactored gas price and should-skip logic * Fix tests for KZG-precompiles and SSTORE gas cost * Added print-debug feature * Fix randomness validation * Refactore transactions validation * Extend expected check for call-transaction and empty-create assertion * Edit doc comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this large feature!
core/src/utils.rs
Outdated
/// | ||
/// This function panics if `denominator` is zero. | ||
#[inline] | ||
pub fn fake_exponential(factor: u64, numerator: u64, denominator: u64) -> u128 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure if it's not needed then please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good 👍🏻
## Description ➡️ Added **EVM CANCUN** hard fork support. Based on SputnikVM release [v0.42.0-aurora](https://github.com/aurora-is-near/sputnikvm/releases/tag/v0.42.0-aurora) ➡️ Changed `engine-tests` that related to **CACUN** changes ➡️ Solidity: updated to `0.8.25` which support **CANCUN** Features ➡️ Extended Transactions fields for **CANCUN** hard fork requirements ### Cancun hard fork ➡️ EVM impelentation of Cancun hard fork: aurora-is-near/sputnikvm/pull/39 ### Breaking changes ➡️ Transaction extended according to [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) requirements ### Gas cost Gas cost changed as expected insignificantly. - 2 tests: gas increased to `1 TGas` - 1 test: gas decreased to `1 TGas`
## Description ➡️ Added **EVM CANCUN** hard fork support. Based on SputnikVM release [v0.42.0-aurora](https://github.com/aurora-is-near/sputnikvm/releases/tag/v0.42.0-aurora) ➡️ Changed `engine-tests` that related to **CACUN** changes ➡️ Solidity: updated to `0.8.25` which support **CANCUN** Features ➡️ Extended Transactions fields for **CANCUN** hard fork requirements ### Cancun hard fork ➡️ EVM impelentation of Cancun hard fork: aurora-is-near/sputnikvm/pull/39 ### Breaking changes ➡️ Transaction extended according to [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) requirements ### Gas cost Gas cost changed as expected insignificantly. - 2 tests: gas increased to `1 TGas` - 1 test: gas decreased to `1 TGas`
Description
📚 Deneb/Cancun Ethereum specification: https://eips.ethereum.org/EIPS/eip-7569
This PR includes implementation:
➡️ EIP-1153: Transient storage opcodes
➡️ EIP-4844: Shard Blob Transactions
➡️ EIP-5656: MCOPY - Memory copying instruction
➡️ EIP-6780: SELFDESTRUCT only in same transaction
➡️ EIP-7516: BLOBBASEFEE opcode
Improvements
➡️ Refactored
evm-tests
to 100% ofethereum-jsob-tests
pass for:➡️ Fixed bugs in
evm-tests
➡️ Fixed bugs in
evm
Incudes
EIP-4844
#42 Feat: refactore EIP-4844