From 186c486df0386778ec9b6955599ac27bfd34d4a7 Mon Sep 17 00:00:00 2001 From: Elias Tazartes Date: Wed, 20 Sep 2023 17:08:54 +0700 Subject: [PATCH] feat: add stBadOpcode --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- Makefile | 4 ++-- crates/ef-testing/src/models/case.rs | 11 ++++++++++- crates/ef-testing/tests/tests.rs | 1 + 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba8e40ae..664486f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5168,7 +5168,7 @@ dependencies = [ [[package]] name = "kakarot-rpc" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=0894457#089445724cfe113e9c8008e34eaa57d539c220a3" +source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=ae5e220#ae5e220ce09a925cad071639b057694678d9a19b" dependencies = [ "anyhow", "async-trait", @@ -5203,7 +5203,7 @@ dependencies = [ [[package]] name = "kakarot-rpc-core" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=0894457#089445724cfe113e9c8008e34eaa57d539c220a3" +source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=ae5e220#ae5e220ce09a925cad071639b057694678d9a19b" dependencies = [ "anyhow", "async-trait", @@ -5244,7 +5244,7 @@ dependencies = [ [[package]] name = "kakarot-test-utils" version = "0.1.0" -source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=0894457#089445724cfe113e9c8008e34eaa57d539c220a3" +source = "git+https://github.com/kkrt-labs/kakarot-rpc.git?rev=ae5e220#ae5e220ce09a925cad071639b057694678d9a19b" dependencies = [ "bytes", "ctor", diff --git a/Cargo.toml b/Cargo.toml index 16791673..2dc258d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,8 @@ revm-primitives = "1.1" reth-rlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v0.1.0-alpha.7" } # Kakarot deps -kakarot-rpc-core = { git = "https://github.com/kkrt-labs/kakarot-rpc.git", rev = "0894457" } -kakarot-test-utils = { git = "https://github.com/kkrt-labs/kakarot-rpc.git", rev = "0894457" } +kakarot-rpc-core = { git = "https://github.com/kkrt-labs/kakarot-rpc.git", rev = "ae5e220" } +kakarot-test-utils = { git = "https://github.com/kkrt-labs/kakarot-rpc.git", rev = "ae5e220" } # Starknet deps katana-core = { git = 'https://github.com/dojoengine/dojo', rev = "b924dac" } diff --git a/Makefile b/Makefile index 43d7f2f9..12e9c387 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,10 @@ KAKAROT_COMMIT := .katana/remote_kakarot_sha .PHONY: $(EF_TESTS_DIR) setup: $(EF_TESTS_DIR) -fetch-dump: +fetch-dump: fetch-kakarot-submodule-commit cargo run --features dump --bin fetch-dump-katana -$(KAKAROT_COMMIT): +fetch-kakarot-submodule-commit: cargo run --features fetch-commit --bin fetch-kakarot-submodule-commit # Runs the Ethereum Foundation tests diff --git a/crates/ef-testing/src/models/case.rs b/crates/ef-testing/src/models/case.rs index 31ff1d2d..9d99d880 100644 --- a/crates/ef-testing/src/models/case.rs +++ b/crates/ef-testing/src/models/case.rs @@ -69,6 +69,8 @@ impl BlockchainTestCase { pub fn should_skip(path: &Path) -> bool { let name = path.file_name().unwrap().to_str().unwrap(); + // Split up matches in exact match and regex otherwise compiler isn't happy + // and tests fail matches!( name, "calldatacopy.json" // ef-tests #20 @@ -107,7 +109,14 @@ impl BlockchainTestCase { | "CallTheContractToCreateEmptyContract.json" // ef-test #115 | "OutOfGasContractCreation.json" // ef-test #116 | "CallContractToCreateContractAndCallItOOG.json" // ef-test #117 - ) + | "undefinedOpcodeFirstByte.json" // ef-tests #121 + | "measureGas.json" // ef-tests #122 + | "badOpcodes.json" // ef-tests #123 + | "operationDiffGas.json" // ef-tests #124 + | "invalidDiffPlaces.json" // ef-tests #125 + | "invalidAddr.json" // ef-tests #126 + ) || matches!(name, name if name.starts_with("opc") && name.ends_with(".json")) + // ef-test #120 } fn test(&self, test_name: &str) -> Result<&BlockchainTest, RunnerError> { diff --git a/crates/ef-testing/tests/tests.rs b/crates/ef-testing/tests/tests.rs index 7afb471e..e3f3ab8d 100644 --- a/crates/ef-testing/tests/tests.rs +++ b/crates/ef-testing/tests/tests.rs @@ -67,4 +67,5 @@ mod blockchain_tests { blockchain_tests!(memory_tests, stMemoryTest); blockchain_tests!(init_code_test, stInitCodeTest); blockchain_tests!(st_log_tests, stLogTests); + blockchain_tests!(st_bad_opcode, stBadOpcode); }