-
Notifications
You must be signed in to change notification settings - Fork 154
fix(l1): use 256 bits for gas price in Legacy and EIP-2930 transactions #4823
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
Merged
Merged
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
2239cce
start adding support for more tests
JereSalo f0a35b0
add more fork variants and dont return error if expected exception do…
JereSalo dccc615
add support for post state hash
JereSalo 1ec79df
comment tests we dont want to run
JereSalo 2455583
improve some comments
JereSalo e770f54
rename network to fork
JereSalo 86c50b5
remove unnecessary checks
JereSalo dbe4eb8
typo
JereSalo 163d91c
remove unnecessary code
JereSalo 5683de0
update gitignore
JereSalo 05a0280
restore mistake i made
JereSalo 934c8b8
vectors targets
JereSalo b31f222
refactor all.rs to make it prettier
JereSalo 21f46c4
add some reasons for skipped tests
JereSalo 219a252
add reasons of skipped tests
JereSalo cd220b9
change comment in createBlobhashTx test
JereSalo 2dbeb13
add comment
JereSalo 965f493
Update tooling/ef_tests/blockchain/tests/all.rs
JereSalo a1b90fb
Update tooling/ef_tests/blockchain/fork.rs
JereSalo 7d454f9
update comment
JereSalo 0821ac7
merge changes from other branch
JereSalo b9f4354
fix skipped tests in stateless execution
JereSalo 7822ca4
add extra skips to sp1
JereSalo 6da2845
add comment
JereSalo 28e7c15
Merge branch 'main' into support_blockchain_tests
JereSalo 4cb5194
let chains lint
JereSalo 7c29b20
initial changes
JereSalo 399b8e5
add a comment
JereSalo c9891d1
uncomment commented test
JereSalo 259dbe5
remove highgaspriceparis from commented tests
JereSalo 822d5ec
merge main
JereSalo 83a34ac
merge other branch
JereSalo a63a566
update comments
JereSalo 1f67670
Merge branch 'main' into skipped_tests_reason
JereSalo 73db0b9
Merge branch 'skipped_tests_reason' into change_gas_price_bits
JereSalo f79848c
remove skipped test of gas price
JereSalo 0ea244e
merge main
JereSalo e6fe454
merge main
JereSalo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,64 @@ | ||
| use ef_tests_blockchain::test_runner::parse_and_execute; | ||
| use ethrex_prover_lib::backend::Backend; | ||
| use std::path::Path; | ||
|
|
||
| // Enable only one of `sp1` or `stateless` at a time. | ||
| #[cfg(all(feature = "sp1", feature = "stateless"))] | ||
| compile_error!("Only one of `sp1` and `stateless` can be enabled at a time."); | ||
|
|
||
| const TEST_FOLDER: &str = "vectors/"; | ||
|
|
||
| #[cfg(not(any(feature = "sp1", feature = "stateless")))] | ||
| const SKIPPED_TESTS: &[&str] = &[ | ||
| "system_contract_deployment", | ||
| "HighGasPriceParis", // Skipped because it sets a gas price higher than u64::MAX, which most clients don't implement and is a virtually impossible scenario | ||
| "dynamicAccountOverwriteEmpty_Paris", // Skipped because the scenario described is virtually impossible | ||
| "create2collisionStorageParis", // Skipped because it's not worth implementing since the scenario of the test is virtually impossible. See https://github.com/lambdaclass/ethrex/issues/1555 | ||
| "RevertInCreateInInitCreate2Paris", // Skipped because it's not worth implementing since the scenario of the test is virtually impossible. See https://github.com/lambdaclass/ethrex/issues/1555 | ||
| "test_tx_gas_larger_than_block_gas_limit", | ||
| "createBlobhashTx", | ||
| "RevertInCreateInInit_Paris", | ||
| // Base skips shared by all runs. | ||
| const SKIPPED_BASE: &[&str] = &[ | ||
| // These tests contain accounts without nonce or code but have storage, which is a virtually impossible scenario. That's why we fail, but that's okay. | ||
| // When creating an account we don't check the storage root but just if it has nonce or code. | ||
| // Fix is on it's way on https://github.com/lambdaclass/ethrex/pull/4813 | ||
JereSalo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "InitCollisionParis", | ||
| "ValueOverflowParis", | ||
| ]; | ||
| // We are skipping test_tx_gas_larger_than_block_gas_limit[fork_Osaka-blockchain_test-exceed_block_gas_limit_True] because of an | ||
| // inconsistency on the expected exception. Exception returned is InvalidBlock(GasUsedMismatch(0x06000000,0x05000000)) while | ||
| // exception expected GAS_ALLOWANCE_EXCEEDED. The thing is gas allowance exception is supposed to be thrown on any transaction | ||
| // execution in case the transaction's gas limit is larger than the block's, which is not the case of this test. | ||
| // This test has a block with "gasLimit": "0x055d4a80", "gasUsed": "0x05000000" and six transactions with "gasLimit": "0x01000000", | ||
| // Apparently each transaction consumes up to its gas limit, which together is larger than the block's. Then when executing validate_gas_used | ||
| // after the block's execution, it throws InvalidBlock(GasUsedMismatch(0x06000000,0x05000000)) on comparing the receipt's cumulative gas used agains the block's gas limit. | ||
| #[cfg(any(feature = "sp1", feature = "stateless"))] | ||
| const SKIPPED_TESTS: &[&str] = &[ | ||
| // We skip most of these for the same reason we skip them in normal runs; since we need to do a normal run before running with the stateless backend | ||
| "system_contract_deployment", | ||
| "test_tx_gas_larger_than_block_gas_limit", | ||
| "HighGasPriceParis", | ||
| "dynamicAccountOverwriteEmpty_Paris", | ||
| "create2collisionStorageParis", | ||
| "RevertInCreateInInitCreate2Paris", | ||
| "createBlobhashTx", | ||
| "create2collisionStorageParis", | ||
| "dynamicAccountOverwriteEmpty_Paris", | ||
| "RevertInCreateInInit_Paris", | ||
| "InitCollisionParis", | ||
| // Skip because they take too long to run, but they pass | ||
| "static_Call50000_sha256", | ||
| "CALLBlake2f_MaxRounds", | ||
| "loopMul", | ||
| // It checks that withdrawal requests and consolidation requests accounts have code, which is always the case, except for this test. | ||
| // The fix is just an if, it's on its way on https://github.com/lambdaclass/ethrex/pull/4731 | ||
| "system_contract_deployment", | ||
| // Skip because it tries to deserialize number > U256::MAX | ||
| "ValueOverflowParis", | ||
| // We skip these two tests because they fail with stateless backend specifically. See https://github.com/lambdaclass/ethrex/issues/4502 | ||
| "test_large_amount", | ||
| "test_multiple_withdrawals_same_address", | ||
| // Skip because it's a "Create" Blob Transaction, which doesn't actually exist. It never reaches the EVM because we can't even parse it as an actual Transaction. | ||
| "createBlobhashTx", | ||
| ]; | ||
|
|
||
| // Extra skips added only for prover backends. | ||
| #[cfg(feature = "sp1")] | ||
| const EXTRA_SKIPS: &[&str] = &[ | ||
| // I believe these tests fail because of how much stress they put into the zkVM, they probably cause an OOM though this should be checked | ||
| "static_Call50000", | ||
| "Return50000", | ||
| "static_Call1MB1024Calldepth", | ||
| ]; | ||
| #[cfg(not(feature = "sp1"))] | ||
| const EXTRA_SKIPS: &[&str] = &[]; | ||
|
|
||
| // Select backend | ||
| #[cfg(feature = "stateless")] | ||
| const BACKEND: Option<Backend> = Some(Backend::Exec); | ||
| #[cfg(feature = "sp1")] | ||
| const BACKEND: Option<Backend> = Some(Backend::SP1); | ||
| #[cfg(not(any(feature = "sp1", feature = "stateless")))] | ||
| fn blockchain_runner(path: &Path) -> datatest_stable::Result<()> { | ||
| parse_and_execute(path, Some(SKIPPED_TESTS), None) | ||
| } | ||
| const BACKEND: Option<Backend> = None; | ||
|
|
||
| // If `sp1` or `stateless` is enabled | ||
| #[cfg(any(feature = "sp1", feature = "stateless"))] | ||
| fn blockchain_runner(path: &Path) -> datatest_stable::Result<()> { | ||
| #[cfg(feature = "stateless")] | ||
| let backend = Some(ethrex_prover_lib::backend::Backend::Exec); | ||
| #[cfg(feature = "sp1")] | ||
| let backend = Some(ethrex_prover_lib::backend::Backend::SP1); | ||
| // Compose the final skip list | ||
| let skips: Vec<&'static str> = SKIPPED_BASE | ||
| .iter() | ||
| .copied() | ||
| .chain(EXTRA_SKIPS.iter().copied()) | ||
| .collect(); | ||
|
|
||
| parse_and_execute(path, Some(SKIPPED_TESTS), backend) | ||
| parse_and_execute(path, Some(&skips), BACKEND) | ||
| } | ||
|
|
||
| datatest_stable::harness!(blockchain_runner, TEST_FOLDER, r".*"); | ||
|
|
||
| #[cfg(any(all(feature = "sp1", feature = "stateless"),))] | ||
| compile_error!("Only one of `sp1` and `stateless` can be enabled at a time."); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.