From 70b57aa1263a806631ab43aa71a23cce77c6af07 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 | 158 ++++++++++----------------- Cargo.toml | 4 +- Makefile | 4 +- crates/ef-testing/src/models/case.rs | 9 +- crates/ef-testing/tests/tests.rs | 1 + 5 files changed, 73 insertions(+), 103 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b94b1a5d..ca22027e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "0f2135563fb5c609d2b2b87c1e8ce7bc41b0b45430fa9661f457981503dd5bf0" dependencies = [ "memchr", ] @@ -388,15 +388,6 @@ dependencies = [ "rand", ] -[[package]] -name = "array-init" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" -dependencies = [ - "nodrop", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -749,7 +740,7 @@ dependencies = [ [[package]] name = "boa_ast" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "bitflags 2.4.0", "boa_interner", @@ -762,7 +753,7 @@ dependencies = [ [[package]] name = "boa_engine" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "bitflags 2.4.0", "boa_ast", @@ -800,7 +791,7 @@ dependencies = [ [[package]] name = "boa_gc" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "boa_macros", "boa_profiler", @@ -811,7 +802,7 @@ dependencies = [ [[package]] name = "boa_icu_provider" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "icu_collections", "icu_normalizer", @@ -824,7 +815,7 @@ dependencies = [ [[package]] name = "boa_interner" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "boa_gc", "boa_macros", @@ -839,7 +830,7 @@ dependencies = [ [[package]] name = "boa_macros" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "proc-macro2 1.0.67", "quote 1.0.33", @@ -850,7 +841,7 @@ dependencies = [ [[package]] name = "boa_parser" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" dependencies = [ "bitflags 2.4.0", "boa_ast", @@ -870,7 +861,7 @@ dependencies = [ [[package]] name = "boa_profiler" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#9da687496858551c0ded0deaf66076970dde9389" +source = "git+https://github.com/boa-dev/boa#8a780619e455f151023f86369acb21059b8a704f" [[package]] name = "brotli" @@ -1613,9 +1604,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", @@ -1633,9 +1624,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", @@ -2418,9 +2409,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "ecdsa" @@ -2551,9 +2542,9 @@ dependencies = [ [[package]] name = "enr" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" +checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" dependencies = [ "base64 0.21.4", "bytes", @@ -2563,7 +2554,6 @@ dependencies = [ "rand", "rlp", "serde", - "serde-hex", "sha3", "zeroize", ] @@ -2822,7 +2812,7 @@ dependencies = [ [[package]] name = "ethers-core" version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs#4ac0058f50571954596cabbe13a3d57351d9adac" +source = "git+https://github.com/gakonst/ethers-rs#08bcb67c36d9a2869950e51ecf76124c9febe035" dependencies = [ "arrayvec", "bytes", @@ -2863,7 +2853,7 @@ dependencies = [ [[package]] name = "ethers-etherscan" version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs#4ac0058f50571954596cabbe13a3d57351d9adac" +source = "git+https://github.com/gakonst/ethers-rs#08bcb67c36d9a2869950e51ecf76124c9febe035" dependencies = [ "ethers-core 2.0.10 (git+https://github.com/gakonst/ethers-rs)", "reqwest", @@ -2992,7 +2982,7 @@ dependencies = [ [[package]] name = "ethers-solc" version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs#4ac0058f50571954596cabbe13a3d57351d9adac" +source = "git+https://github.com/gakonst/ethers-rs#08bcb67c36d9a2869950e51ecf76124c9febe035" dependencies = [ "cfg-if", "const-hex", @@ -3168,7 +3158,7 @@ dependencies = [ [[package]] name = "foundry-config" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?branch=master#ecf9a10bab059130ef9b90d1b160b6a725a6e21a" +source = "git+https://github.com/foundry-rs/foundry?branch=master#aeefc742064d1d3c6423cc05b453ffb594451921" dependencies = [ "Inflector", "dirs-next", @@ -3348,7 +3338,7 @@ checksum = "6973ce8518068a71d404f428f6a5b563088545546a6bd8f9c0a7f2608149bc8a" dependencies = [ "genco-macros", "relative-path", - "smallvec 1.11.0", + "smallvec", ] [[package]] @@ -3438,7 +3428,7 @@ dependencies = [ "log", "once_cell", "signal-hook", - "smallvec 1.11.0", + "smallvec", "thiserror", "unicode-normalization", ] @@ -3482,7 +3472,7 @@ dependencies = [ "gix-quote", "kstring", "log", - "smallvec 1.11.0", + "smallvec", "thiserror", "unicode-bom", ] @@ -3544,7 +3534,7 @@ dependencies = [ "log", "memchr", "once_cell", - "smallvec 1.11.0", + "smallvec", "thiserror", "unicode-bom", "winnow", @@ -3657,7 +3647,7 @@ dependencies = [ "gix-path", "gix-quote", "gix-trace", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3734,7 +3724,7 @@ dependencies = [ "gix-traverse", "itoa", "memmap2", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3773,7 +3763,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3793,7 +3783,7 @@ dependencies = [ "hex", "itoa", "nom", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3834,7 +3824,7 @@ dependencies = [ "gix-traverse", "memmap2", "parking_lot 0.12.1", - "smallvec 1.11.0", + "smallvec", "thiserror", "uluru", ] @@ -3918,7 +3908,7 @@ dependencies = [ "gix-hash", "gix-revision", "gix-validate", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3948,7 +3938,7 @@ dependencies = [ "gix-hash", "gix-hashtable", "gix-object", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -3997,7 +3987,7 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-revwalk", - "smallvec 1.11.0", + "smallvec", "thiserror", ] @@ -4284,9 +4274,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -4489,7 +4479,7 @@ dependencies = [ "icu_collections", "icu_properties", "icu_provider", - "smallvec 1.11.0", + "smallvec", "utf16_iter", "utf8_iter", "write16", @@ -5178,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", @@ -5213,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", @@ -5254,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", @@ -5507,12 +5497,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "md-5" version = "0.10.5" @@ -5693,12 +5677,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - [[package]] name = "nom" version = "7.1.3" @@ -5986,9 +5964,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.1.3+3.1.2" +version = "300.1.5+3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2c101a165fff9935e34def4669595ab1c7847943c42be86e21503e482be107" +checksum = "559068e4c12950d7dcaa1857a61725c0d38d4fc03ff8e070ab31a75d6e316491" dependencies = [ "cc", ] @@ -6105,7 +6083,7 @@ dependencies = [ "instant", "libc", "redox_syscall 0.2.16", - "smallvec 1.11.0", + "smallvec", "winapi", ] @@ -6118,7 +6096,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.3.5", - "smallvec 1.11.0", + "smallvec", "windows-targets 0.48.5", ] @@ -6319,14 +6297,14 @@ dependencies = [ [[package]] name = "phonenumber" -version = "0.3.2+8.13.9" +version = "0.3.3+8.13.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34749f64ea9d76f10cdc8a859588b57775f59177c7dd91f744d620bd62982d6f" +checksum = "635f3e6288e4f01c049d89332a031bd74f25d64b6fb94703ca966e819488cd06" dependencies = [ "bincode 1.3.3", "either", "fnv", - "itertools 0.10.5", + "itertools 0.11.0", "lazy_static", "nom", "quick-xml", @@ -6334,6 +6312,7 @@ dependencies = [ "regex-cache", "serde", "serde_derive", + "strum 0.24.1", "thiserror", ] @@ -6437,13 +6416,13 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" dependencies = [ "anstyle", "difflib", - "itertools 0.10.5", + "itertools 0.11.0", "predicates-core", ] @@ -7579,7 +7558,7 @@ dependencies = [ "parking_lot 0.11.2", "rustc-hash", "salsa-macros", - "smallvec 1.11.0", + "smallvec", ] [[package]] @@ -7931,17 +7910,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hex" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca37e3e4d1b39afd7ff11ee4e947efae85adfddf4841787bfa47c470e96dc26d" -dependencies = [ - "array-init", - "serde", - "smallvec 0.6.14", -] - [[package]] name = "serde-value" version = "0.7.0" @@ -8178,15 +8146,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - [[package]] name = "smallvec" version = "1.11.0" @@ -8546,6 +8505,9 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] [[package]] name = "strum" @@ -8732,9 +8694,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -9121,7 +9083,7 @@ dependencies = [ "once_cell", "regex", "sharded-slab", - "smallvec 1.11.0", + "smallvec", "thread_local", "tracing", "tracing-core", @@ -9285,9 +9247,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" diff --git a/Cargo.toml b/Cargo.toml index 1a6b1725..ef7a410e 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..c629aa55 100644 --- a/crates/ef-testing/src/models/case.rs +++ b/crates/ef-testing/src/models/case.rs @@ -107,7 +107,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 bf8104c7..e139303b 100644 --- a/crates/ef-testing/tests/tests.rs +++ b/crates/ef-testing/tests/tests.rs @@ -66,4 +66,5 @@ mod blockchain_tests { blockchain_tests!(vm_tests, VMTests); blockchain_tests!(memory_tests, stMemoryTest); blockchain_tests!(init_code_test, stInitCodeTest); + blockchain_tests!(st_bad_opcode, stBadOpcode); }