Skip to content
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

test: Add ValidBlocks and InvalidBlocks blockchain tests #13969

Merged
merged 6 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: ethereum/tests
ref: 1c23e3c27ac53b794de0844d2d5e19cd2495b9d8
ref: 59781f1c6cce3d6c161751ab3512d79fa75d5597
path: testing/ef-tests/ethereum-tests
submodules: recursive
fetch-depth: 1
Expand Down
12 changes: 12 additions & 0 deletions testing/ef-tests/src/cases/blockchain_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ pub fn should_skip(path: &Path) -> bool {
| "loopMul.json"
| "CALLBlake2f_MaxRounds.json"
| "shiftCombinations.json"

// Skipped by revm as well: <https://github.com/bluealloy/revm/blob/be92e1db21f1c47b34c5a58cfbf019f6b97d7e4b/bins/revme/src/cmd/statetest/runner.rs#L115-L125>
| "RevertInCreateInInit_Paris.json"
| "RevertInCreateInInit.json"
| "dynamicAccountOverwriteEmpty.json"
| "dynamicAccountOverwriteEmpty_Paris.json"
| "RevertInCreateInInitCreate2Paris.json"
| "create2collisionStorage.json"
| "RevertInCreateInInitCreate2.json"
| "create2collisionStorageParis.json"
| "InitCollision.json"
| "InitCollisionParis.json"
)
// Ignore outdated EOF tests that haven't been updated for Cancun yet.
|| path_contains(path_str, &["EIPTests", "stEOF"])
Expand Down
12 changes: 11 additions & 1 deletion testing/ef-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@ mod general_state_tests {
general_state_test!(vm_tests, VMTests);
}

// TODO: Add ValidBlocks and InvalidBlocks tests
macro_rules! blockchain_test {
($test_name:ident, $dir:ident) => {
#[test]
fn $test_name() {
BlockchainTests::new(format!("{}", stringify!($dir))).run();
}
};
}

blockchain_test!(valid_blocks, ValidBlocks);
// blockchain_test!(invalid_blocks, InvalidBlocks);
Loading