From ca40bc7fbba1d2cae88b2ea7461e2649a05c17a1 Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Sun, 19 Jan 2025 21:24:35 +0200 Subject: [PATCH 1/5] test: Add ValidBlocks and InvalidBlocks blockchain tests Implements the TODO in tests.rs by adding test coverage for ValidBlocks and InvalidBlocks test suites from the Ethereum test cases. This enhances our test coverage by including these important blockchain test cases that verify valid and invalid block processing. The implementation: - Adds a new blockchain_test! macro for running blockchain tests - Creates a new blockchain_tests module - Implements tests for both ValidBlocks and InvalidBlocks test suites --- testing/ef-tests/tests/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testing/ef-tests/tests/tests.rs b/testing/ef-tests/tests/tests.rs index 3aeb917a24c2..7944f9432f79 100644 --- a/testing/ef-tests/tests/tests.rs +++ b/testing/ef-tests/tests/tests.rs @@ -79,3 +79,20 @@ mod general_state_tests { } // TODO: Add ValidBlocks and InvalidBlocks tests + +macro_rules! blockchain_test { + ($test_name:ident, $dir:ident) => { + #[test] + fn $test_name() { + BlockchainTests::new(format!("BlockchainTests/{}", stringify!($dir))).run(); + } + }; +} + +#[allow(missing_docs)] +mod blockchain_tests { + use super::*; + + blockchain_test!(valid_blocks, ValidBlocks); + blockchain_test!(invalid_blocks, InvalidBlocks); +} From 4c4b4887fdd80e1025bf7330084935aba27fcc30 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 24 Jan 2025 11:32:08 +0100 Subject: [PATCH 2/5] touchups --- testing/ef-tests/tests/tests.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/testing/ef-tests/tests/tests.rs b/testing/ef-tests/tests/tests.rs index 7944f9432f79..0069ba30c8d5 100644 --- a/testing/ef-tests/tests/tests.rs +++ b/testing/ef-tests/tests/tests.rs @@ -78,21 +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!("BlockchainTests/{}", stringify!($dir))).run(); + BlockchainTests::new(format!("{}", stringify!($dir))).run(); } }; } -#[allow(missing_docs)] -mod blockchain_tests { - use super::*; - - blockchain_test!(valid_blocks, ValidBlocks); - blockchain_test!(invalid_blocks, InvalidBlocks); -} +blockchain_test!(valid_blocks, ValidBlocks); +blockchain_test!(invalid_blocks, InvalidBlocks); From 97d97133ab0bc9da4d61b7c59d4e7fc34b9099b6 Mon Sep 17 00:00:00 2001 From: joshieDo <93316087+joshieDo@users.noreply.github.com> Date: Fri, 24 Jan 2025 15:53:25 +0000 Subject: [PATCH 3/5] bump ef-tests rev --- .github/workflows/unit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 5fff6721b85b..4a9992c7e0fc 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -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 From 781451efa83caf14c98ce0f54f797abde29dfdb2 Mon Sep 17 00:00:00 2001 From: joshieDo <93316087+joshieDo@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:15:00 +0000 Subject: [PATCH 4/5] skip tests, same as revm --- testing/ef-tests/src/cases/blockchain_test.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/ef-tests/src/cases/blockchain_test.rs b/testing/ef-tests/src/cases/blockchain_test.rs index a3c168cb54de..85e7eb9dc911 100644 --- a/testing/ef-tests/src/cases/blockchain_test.rs +++ b/testing/ef-tests/src/cases/blockchain_test.rs @@ -206,6 +206,18 @@ pub fn should_skip(path: &Path) -> bool { | "loopMul.json" | "CALLBlake2f_MaxRounds.json" | "shiftCombinations.json" + + // Skipped by revm as well: + | "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"]) From 1b100a44127b29d1f536f81c2bde6587b617ab84 Mon Sep 17 00:00:00 2001 From: joshieDo <93316087+joshieDo@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:19:55 +0000 Subject: [PATCH 5/5] skip invalid_blocks --- testing/ef-tests/tests/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/ef-tests/tests/tests.rs b/testing/ef-tests/tests/tests.rs index 0069ba30c8d5..6b626d82c186 100644 --- a/testing/ef-tests/tests/tests.rs +++ b/testing/ef-tests/tests/tests.rs @@ -88,4 +88,4 @@ macro_rules! blockchain_test { } blockchain_test!(valid_blocks, ValidBlocks); -blockchain_test!(invalid_blocks, InvalidBlocks); +// blockchain_test!(invalid_blocks, InvalidBlocks);