diff --git a/.gitignore b/.gitignore index 19f666e451bf..14e811f2d511 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ out/ out.json .idea .vscode +bloat* diff --git a/Cargo.lock b/Cargo.lock index a23a5d778ed2..113f04de8135 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -84,13 +84,13 @@ checksum = "e96c81b05c893348760f232c4cc6a6a77fd91cfb09885d4eaad25cd03bd7732e" dependencies = [ "num_enum", "serde", - "strum 0.26.1", + "strum 0.26.2", ] [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-eips", "alloy-network", @@ -122,7 +122,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -133,7 +133,7 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -155,7 +155,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-primitives", "serde", @@ -166,7 +166,7 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-eips", "alloy-json-rpc", @@ -205,7 +205,7 @@ dependencies = [ [[package]] name = "alloy-providers" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-network", "alloy-primitives", @@ -214,17 +214,22 @@ dependencies = [ "alloy-rpc-types", "alloy-transport", "alloy-transport-http", + "async-stream", "async-trait", "auto_impl", + "futures", + "lru", "reqwest", "serde", "thiserror", + "tokio", + "tracing", ] [[package]] name = "alloy-pubsub" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -234,6 +239,7 @@ dependencies = [ "serde", "serde_json", "tokio", + "tokio-stream", "tower", "tracing", ] @@ -263,7 +269,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -271,7 +277,10 @@ dependencies = [ "futures", "pin-project", "reqwest", + "serde", "serde_json", + "tokio", + "tokio-stream", "tower", "tracing", "url", @@ -280,7 +289,7 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -291,7 +300,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -304,7 +313,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-network", "alloy-primitives", @@ -365,10 +374,10 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-json-rpc", - "base64 0.21.7", + "base64 0.22.0", "futures-util", "serde", "serde_json", @@ -382,7 +391,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -395,7 +404,7 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -413,7 +422,7 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=785c667#785c667813a6c76794044b943df58fc6e397734d" +source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -835,6 +844,28 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "async-task" version = "4.7.0" @@ -996,6 +1027,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -1121,7 +1158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "serde", ] @@ -1142,9 +1179,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byte-slice-cast" @@ -1310,10 +1347,11 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.88" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ + "jobserver", "libc", ] @@ -1323,6 +1361,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chisel" version = "0.2.0" @@ -1352,7 +1396,7 @@ dependencies = [ "serde_json", "serial_test", "solang-parser", - "strum 0.26.1", + "strum 0.26.2", "time", "tokio", "tracing", @@ -1363,9 +1407,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1413,9 +1457,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -1423,9 +1467,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1653,9 +1697,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbd12d49ab0eaf8193ba9175e45f56bbc2e4b27d57b8cfe62aa47942a46b9a9" +checksum = "b37dae8c8ded08d5ec72caa1b4204a5344047cd4a2c7387e3d150020abfbc1c9" dependencies = [ "cfg-if", "cpufeatures", @@ -1886,11 +1930,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.2" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" dependencies = [ - "nix 0.27.1", + "nix 0.28.0", "windows-sys 0.52.0", ] @@ -2236,17 +2280,17 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "enr" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +checksum = "2dc3eabaca59dc39ea5ed15062e4abc5bba9723b1cff7a4fea3faae0647f04c0" dependencies = [ + "alloy-rlp", "base64 0.21.7", "bytes", "hex", "k256", "log", "rand 0.8.5", - "rlp", "serde", "sha3", "zeroize", @@ -2275,9 +2319,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -2515,7 +2559,7 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.26.1", + "strum 0.26.2", "syn 2.0.52", "tempfile", "thiserror", @@ -2958,7 +3002,7 @@ dependencies = [ "serde_json", "similar", "solang-parser", - "strum 0.26.1", + "strum 0.26.2", "svm-rs", "tempfile", "thiserror", @@ -3179,7 +3223,7 @@ dependencies = [ "regex", "serde", "strsim 0.10.0", - "strum 0.26.1", + "strum 0.26.2", "tempfile", "tokio", "tracing", @@ -3241,9 +3285,9 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1b77c95e79bff02ddaa38426fc6809a3a438dce0e6a2eb212dac97da7c157b4" +checksum = "7f5a6dffd81de844c96fea0aaf825cd2a9760c4a768ae3f5786d431ef3c57d69" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -3367,7 +3411,6 @@ dependencies = [ "alloy-providers", "alloy-rpc-types", "alloy-sol-types", - "alloy-transport", "auto_impl", "const-hex", "derive_more", @@ -3968,7 +4011,7 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -4068,7 +4111,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.11", "allocator-api2", "serde", ] @@ -4165,9 +4208,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -4324,7 +4367,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "same-file", "walkdir", "winapi-util", @@ -4542,11 +4585,20 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -4667,7 +4719,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.5", + "regex-automata 0.4.6", ] [[package]] @@ -4993,12 +5045,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.4.2", "cfg-if", + "cfg_aliases", "libc", ] @@ -5162,7 +5215,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.52", @@ -5467,7 +5520,7 @@ checksum = "4ccca0f6c17acc81df8e242ed473ec144cbf5c98037e69aa6d144780aad103c8" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.0-rc.1", + "yansi 1.0.0", ] [[package]] @@ -5663,18 +5716,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", @@ -5834,6 +5887,15 @@ dependencies = [ "toml_edit 0.20.7", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5877,7 +5939,7 @@ dependencies = [ "quote", "syn 2.0.52", "version_check", - "yansi 1.0.0-rc.1", + "yansi 1.0.0", ] [[package]] @@ -6151,7 +6213,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -6166,9 +6228,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -6189,9 +6251,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" dependencies = [ "base64 0.21.7", "bytes", @@ -6234,12 +6296,13 @@ dependencies = [ [[package]] name = "revm" -version = "6.1.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d35316fc02d99e42831356c71e882f5d385c77b78f64a44ae82f2f9a4b8b72f" +checksum = "217d21144d329f21d5245b8e6a46e0d6d0a527d9917d7a087f225b161e529169" dependencies = [ "auto_impl", "cfg-if", + "dyn-clone", "revm-interpreter", "revm-precompile", "serde", @@ -6249,7 +6312,7 @@ dependencies = [ [[package]] name = "revm-inspectors" version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=5d560be#5d560be4cf022912f4f53f4e5ea71f81253b3c3d" +source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=ba0b6ab#ba0b6ab695802c752601f17f5c941b62a067ad64" dependencies = [ "alloy-primitives", "alloy-rpc-trace-types", @@ -6259,13 +6322,15 @@ dependencies = [ "colorchoice", "revm", "serde", + "serde_json", + "thiserror", ] [[package]] name = "revm-interpreter" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fa10c2dc1e8f4934bdc763a2c09371bcec29e50c22e55e3eb325ee0cba09064" +checksum = "776848391ed76d5103ca1aa1632cd21b521e2870afb30b63723da862d69efd0f" dependencies = [ "revm-primitives", "serde", @@ -6273,9 +6338,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "4.1.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db828d49d329560a70809d9d1fa0c74695edb49f50c5332db3eb24483076deac" +checksum = "e3fd1856a7cb09197a02669d779e1afb5a627b0888a24814ba2b6a1ad4c3ff8d" dependencies = [ "aurora-engine-modexp", "c-kzg", @@ -6290,9 +6355,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fecd125aad58e135e2ca5771ed6e4e7b1f05fa3a64e0dfb9cc643b7a800a8435" +checksum = "2a4d7d3e793e907dc0797a9d3b43abfdf5226d133855214db9bd27d4cee33ebd" dependencies = [ "alloy-primitives", "auto_impl", @@ -6300,6 +6365,7 @@ dependencies = [ "bitvec", "c-kzg", "cfg-if", + "dyn-clone", "enumn", "hashbrown 0.14.3", "hex", @@ -6909,9 +6975,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -7261,11 +7327,11 @@ dependencies = [ [[package]] name = "strum" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.1", + "strum_macros 0.26.2", ] [[package]] @@ -7283,9 +7349,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", @@ -7413,20 +7479,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -7677,6 +7743,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -8213,9 +8280,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -8223,9 +8290,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -8238,9 +8305,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -8250,9 +8317,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8260,9 +8327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -8273,9 +8340,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "watchexec" @@ -8327,9 +8394,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -8680,9 +8747,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yansi" -version = "1.0.0-rc.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" +checksum = "6c2861d76f58ec8fc95708b9b1e417f7b12fd72ad33c01fa6886707092dea0d3" [[package]] name = "zerocopy" diff --git a/Cargo.toml b/Cargo.toml index f14e8d8911b6..f56a5cfd7847 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,9 +142,9 @@ foundry-compilers = { version = "0.3.9", default-features = false } ## revm # no default features to avoid c-kzg -revm = { version = "6.1", default-features = false } -revm-primitives = { version = "2", default-features = false } -revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "5d560be", features = [ +revm = { version = "7.1", default-features = false } +revm-primitives = { version = "3", default-features = false } +revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "ba0b6ab", features = [ "serde", ] } @@ -159,22 +159,22 @@ ethers-middleware = { version = "2.0.14", default-features = false } ethers-solc = { version = "2.0.14", default-features = false } ## alloy -alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-providers = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } -alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "785c667" } +alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-providers = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } +alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "9ac2c90", default-features = false } alloy-primitives = { version = "0.6.3", features = ["getrandom"] } alloy-dyn-abi = "0.6.3" alloy-json-abi = "0.6.3" @@ -212,3 +212,8 @@ hyper = "0.14" tower = "0.4" tower-http = "0.4" +# [patch.crates-io] +# revm = { path = "../../danipopes/revm/crates/revm" } +# revm-interpreter = { path = "../../danipopes/revm/crates/interpreter" } +# revm-primitives = { path = "../../danipopes/revm/crates/primitives" } +# revm-precompile = { path = "../../danipopes/revm/crates/precompile" } diff --git a/crates/anvil/src/config.rs b/crates/anvil/src/config.rs index be18d2827592..5c61c08248bf 100644 --- a/crates/anvil/src/config.rs +++ b/crates/anvil/src/config.rs @@ -17,7 +17,7 @@ use crate::{ }; use alloy_genesis::Genesis; use alloy_primitives::{hex, utils::Unit, U256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::BlockNumberOrTag; use alloy_signer::{ coins_bip39::{English, Mnemonic}, diff --git a/crates/anvil/src/eth/backend/fork.rs b/crates/anvil/src/eth/backend/fork.rs index 71dadf40e46c..04ea0c70f5f1 100644 --- a/crates/anvil/src/eth/backend/fork.rs +++ b/crates/anvil/src/eth/backend/fork.rs @@ -2,7 +2,7 @@ use crate::eth::{backend::db::Db, error::BlockchainError}; use alloy_primitives::{Address, Bytes, StorageValue, B256, U256, U64}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_trace_types::{ geth::{GethDebugTracingOptions, GethTrace}, parity::LocalizedTransactionTrace as Trace, diff --git a/crates/anvil/src/eth/backend/mem/mod.rs b/crates/anvil/src/eth/backend/mem/mod.rs index 0eba1474d07c..2b0bf292f2aa 100644 --- a/crates/anvil/src/eth/backend/mem/mod.rs +++ b/crates/anvil/src/eth/backend/mem/mod.rs @@ -1257,14 +1257,14 @@ impl Backend { }; let mut is_match: bool = true; if !filter.address.is_empty() && filter.has_topics() { - if !params.filter_address(&log) || !params.filter_topics(&log) { + if !params.filter_address(&log.address) || !params.filter_topics(&log.topics) { is_match = false; } } else if !filter.address.is_empty() { - if !params.filter_address(&log) { + if !params.filter_address(&log.address) { is_match = false; } - } else if filter.has_topics() && !params.filter_topics(&log) { + } else if filter.has_topics() && !params.filter_topics(&log.topics) { is_match = false; } diff --git a/crates/anvil/src/eth/backend/time.rs b/crates/anvil/src/eth/backend/time.rs index f51ff93feac1..ce6900eb48f9 100644 --- a/crates/anvil/src/eth/backend/time.rs +++ b/crates/anvil/src/eth/backend/time.rs @@ -1,16 +1,13 @@ //! Manages the block time use crate::eth::error::BlockchainError; -use chrono::{DateTime, NaiveDateTime, Utc}; +use chrono::{DateTime, Utc}; use parking_lot::RwLock; use std::{sync::Arc, time::Duration}; /// Returns the `Utc` datetime for the given seconds since unix epoch pub fn utc_from_secs(secs: u64) -> DateTime { - DateTime::::from_naive_utc_and_offset( - NaiveDateTime::from_timestamp_opt(secs as i64, 0).unwrap(), - Utc, - ) + DateTime::from_timestamp(secs as i64, 0).unwrap() } /// Manages block time diff --git a/crates/anvil/src/pubsub.rs b/crates/anvil/src/pubsub.rs index ce2f7e2450c4..b0b8b33bbecd 100644 --- a/crates/anvil/src/pubsub.rs +++ b/crates/anvil/src/pubsub.rs @@ -152,23 +152,12 @@ pub fn filter_logs( ) -> Vec { /// Determines whether to add this log fn add_log(block_hash: B256, l: &Log, block: &Block, params: &FilteredParams) -> bool { - let log = AlloyLog { - address: l.address, - topics: l.topics().to_vec(), - data: l.data.data.clone(), - block_hash: None, - block_number: None, - transaction_hash: None, - transaction_index: None, - log_index: None, - removed: false, - }; if params.filter.is_some() { let block_number = block.header.number; if !params.filter_block_range(block_number) || !params.filter_block_hash(block_hash) || - !params.filter_address(&log) || - !params.filter_topics(&log) + !params.filter_address(&l.address) || + !params.filter_topics(l.topics()) { return false; } diff --git a/crates/anvil/tests/it/api.rs b/crates/anvil/tests/it/api.rs index fb3c3742b2e6..216e9581389b 100644 --- a/crates/anvil/tests/it/api.rs +++ b/crates/anvil/tests/it/api.rs @@ -5,7 +5,7 @@ use crate::{ utils::ethers_http_provider, }; use alloy_primitives::{Address as rAddress, B256, U256 as rU256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::{ request::{TransactionInput as CallInput, TransactionRequest as CallRequest}, state::{AccountOverride, StateOverride}, diff --git a/crates/anvil/tests/it/fork.rs b/crates/anvil/tests/it/fork.rs index 8399dc85ad31..a23cc7052ecd 100644 --- a/crates/anvil/tests/it/fork.rs +++ b/crates/anvil/tests/it/fork.rs @@ -5,7 +5,7 @@ use crate::{ utils::{self, ethers_http_provider}, }; use alloy_primitives::{address, U256 as rU256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::{ request::{TransactionInput, TransactionRequest as CallRequest}, BlockNumberOrTag, diff --git a/crates/anvil/tests/it/genesis.rs b/crates/anvil/tests/it/genesis.rs index 9b822aff7207..f5f5fec9cc7d 100644 --- a/crates/anvil/tests/it/genesis.rs +++ b/crates/anvil/tests/it/genesis.rs @@ -4,7 +4,7 @@ use std::str::FromStr; use alloy_genesis::Genesis; use alloy_primitives::{Address, U256, U64}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use anvil::{spawn, NodeConfig}; #[tokio::test(flavor = "multi_thread")] diff --git a/crates/anvil/tests/it/wsapi.rs b/crates/anvil/tests/it/wsapi.rs index 7d31bdbcab75..c2073f5617f7 100644 --- a/crates/anvil/tests/it/wsapi.rs +++ b/crates/anvil/tests/it/wsapi.rs @@ -1,6 +1,6 @@ //! general eth api tests with websocket provider -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use anvil::{spawn, NodeConfig}; use ethers::types::U256; use foundry_common::types::ToAlloy; diff --git a/crates/cast/bin/cmd/run.rs b/crates/cast/bin/cmd/run.rs index a9e074962184..8de966906791 100644 --- a/crates/cast/bin/cmd/run.rs +++ b/crates/cast/bin/cmd/run.rs @@ -1,5 +1,5 @@ use alloy_primitives::U256; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::BlockTransactions; use cast::revm::primitives::EnvWithHandlerCfg; use clap::Parser; diff --git a/crates/cast/src/lib.rs b/crates/cast/src/lib.rs index 8a0e34c946b9..38498786ea18 100644 --- a/crates/cast/src/lib.rs +++ b/crates/cast/src/lib.rs @@ -6,7 +6,7 @@ use alloy_primitives::{ }; use alloy_rlp::Decodable; use base::{Base, NumberWithBase, ToBase}; -use chrono::NaiveDateTime; +use chrono::DateTime; use ethers_core::{ types::{ transaction::eip2718::TypedTransaction, BlockId, BlockNumber, Filter, NameOrAddress, @@ -395,8 +395,7 @@ where pub async fn age>(&self, block: T) -> Result { let timestamp_str = Cast::block_field_as_num(self, block, String::from("timestamp")).await?.to_string(); - let datetime = - NaiveDateTime::from_timestamp_opt(timestamp_str.parse::().unwrap(), 0).unwrap(); + let datetime = DateTime::from_timestamp(timestamp_str.parse::().unwrap(), 0).unwrap(); Ok(datetime.format("%a %b %e %H:%M:%S %Y").to_string()) } diff --git a/crates/cheatcodes/src/evm.rs b/crates/cheatcodes/src/evm.rs index fd45200f0356..601c97ad0046 100644 --- a/crates/cheatcodes/src/evm.rs +++ b/crates/cheatcodes/src/evm.rs @@ -12,7 +12,7 @@ use foundry_evm_core::{ }; use revm::{ primitives::{Account, Bytecode, SpecId, KECCAK_EMPTY}, - EvmContext, + InnerEvmContext, }; use std::{collections::HashMap, path::Path}; @@ -521,7 +521,7 @@ fn read_callers(state: &Cheatcodes, default_sender: &Address) -> Result { /// Ensures the `Account` is loaded and touched. pub(super) fn journaled_account( - ecx: &mut EvmContext, + ecx: &mut InnerEvmContext, addr: Address, ) -> Result<&mut Account> { ecx.load_account(addr)?; diff --git a/crates/cheatcodes/src/evm/fork.rs b/crates/cheatcodes/src/evm/fork.rs index 4b3fdc6b346b..f5402a0d38d2 100644 --- a/crates/cheatcodes/src/evm/fork.rs +++ b/crates/cheatcodes/src/evm/fork.rs @@ -1,6 +1,6 @@ use crate::{Cheatcode, Cheatcodes, CheatsCtxt, DatabaseExt, Result, Vm::*}; use alloy_primitives::{B256, U256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::Filter; use alloy_sol_types::SolValue; use eyre::WrapErr; diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index 3396fc876e21..9b26e77547cf 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -30,7 +30,7 @@ use revm::{ InstructionResult, Interpreter, InterpreterAction, InterpreterResult, }, primitives::{BlockEnv, CreateScheme, TransactTo}, - EvmContext, Inspector, + EvmContext, InnerEvmContext, Inspector, }; use serde_json::Value; use std::{ @@ -228,7 +228,15 @@ impl Cheatcodes { // but only if the backend is in forking mode ecx.db.ensure_cheatcode_access_forking_mode(&caller)?; - apply_dispatch(&decoded, &mut CheatsCtxt { state: self, ecx, caller }) + apply_dispatch( + &decoded, + &mut CheatsCtxt { + state: self, + ecx: &mut ecx.inner, + precompiles: &mut ecx.precompiles, + caller, + }, + ) } /// Determines the address of the contract and marks it as allowed @@ -238,7 +246,7 @@ impl Cheatcodes { /// automatically we need to determine the new address fn allow_cheatcodes_on_create( &self, - ecx: &mut EvmContext, + ecx: &mut InnerEvmContext, inputs: &CreateInputs, ) -> Address { let old_nonce = ecx @@ -302,6 +310,7 @@ impl Inspector for Cheatcodes { } fn step(&mut self, interpreter: &mut Interpreter, ecx: &mut EvmContext) { + let ecx = &mut ecx.inner; self.pc = interpreter.program_counter(); // reset gas if gas metering is turned off @@ -716,6 +725,8 @@ impl Inspector for Cheatcodes { }; } + let ecx = &mut ecx.inner; + if call.contract == HARDHAT_CONSOLE_ADDRESS { return None } @@ -929,6 +940,7 @@ impl Inspector for Cheatcodes { call: &CallInputs, mut outcome: CallOutcome, ) -> CallOutcome { + let ecx = &mut ecx.inner; let cheatcode_call = call.contract == CHEATCODE_ADDRESS || call.contract == HARDHAT_CONSOLE_ADDRESS; @@ -1198,6 +1210,7 @@ impl Inspector for Cheatcodes { ecx: &mut EvmContext, call: &mut CreateInputs, ) -> Option { + let ecx = &mut ecx.inner; let gas = Gas::new(call.gas_limit); // Apply our prank @@ -1338,6 +1351,8 @@ impl Inspector for Cheatcodes { _call: &CreateInputs, mut outcome: CreateOutcome, ) -> CreateOutcome { + let ecx = &mut ecx.inner; + // Clean up pranks if let Some(prank) = &self.prank { if ecx.journaled_state.depth() == prank.depth { @@ -1485,7 +1500,7 @@ fn disallowed_mem_write( /// Returns a `DatabaseError::MissingCreate2Deployer` if the `DEFAULT_CREATE2_DEPLOYER` account is /// not found or if it does not have any associated bytecode. fn apply_create2_deployer( - ecx: &mut EvmContext, + ecx: &mut InnerEvmContext, call: &mut CreateInputs, prank: Option<&Prank>, broadcast: Option<&Broadcast>, @@ -1555,7 +1570,7 @@ fn apply_create2_deployer( fn process_broadcast_create( broadcast_sender: Address, bytecode: Bytes, - ecx: &mut EvmContext, + ecx: &mut InnerEvmContext, call: &mut CreateInputs, ) -> (Bytes, Option
, u64) { call.caller = broadcast_sender; @@ -1581,13 +1596,16 @@ fn process_broadcast_create( // Determines if the gas limit on a given call was manually set in the script and should therefore // not be overwritten by later estimations -fn check_if_fixed_gas_limit(data: &EvmContext, call_gas_limit: u64) -> bool { +fn check_if_fixed_gas_limit( + ecx: &InnerEvmContext, + call_gas_limit: u64, +) -> bool { // If the gas limit was not set in the source code it is set to the estimated gas left at the // time of the call, which should be rather close to configured gas limit. // TODO: Find a way to reliably make this determination. // For example by generating it in the compilation or EVM simulation process - U256::from(data.env.tx.gas_limit) > data.env.block.gas_limit && - U256::from(call_gas_limit) <= data.env.block.gas_limit + U256::from(ecx.env.tx.gas_limit) > ecx.env.block.gas_limit && + U256::from(call_gas_limit) <= ecx.env.block.gas_limit // Transfers in forge scripts seem to be estimated at 2300 by revm leading to "Intrinsic // gas too low" failure when simulated on chain && call_gas_limit > 2300 diff --git a/crates/cheatcodes/src/lib.rs b/crates/cheatcodes/src/lib.rs index a9dda80f92d9..2fa866b1aeac 100644 --- a/crates/cheatcodes/src/lib.rs +++ b/crates/cheatcodes/src/lib.rs @@ -11,11 +11,11 @@ pub extern crate foundry_cheatcodes_spec as spec; extern crate tracing; use alloy_primitives::Address; -use revm::EvmContext; +use foundry_evm_core::backend::DatabaseExt; +use revm::{ContextPrecompiles, InnerEvmContext}; pub use config::CheatsConfig; pub use error::{Error, ErrorKind, Result}; -use foundry_evm_core::backend::DatabaseExt; pub use inspector::{BroadcastableTransaction, BroadcastableTransactions, Cheatcodes, Context}; pub use spec::{CheatcodeDef, Vm}; @@ -57,15 +57,14 @@ pub(crate) trait Cheatcode: CheatcodeDef + DynCheatcode { #[inline] fn apply_traced(&self, ccx: &mut CheatsCtxt) -> Result { - let span = trace_span(self); - let _enter = span.enter(); - trace_call(); + let _span = trace_span_and_call(self); let result = self.apply_full(ccx); trace_return(&result); return result; // Separate and non-generic functions to avoid inline and monomorphization bloat. - fn trace_span(cheat: &dyn DynCheatcode) -> tracing::Span { + #[inline(never)] + fn trace_span_and_call(cheat: &dyn DynCheatcode) -> tracing::span::EnteredSpan { let span = debug_span!(target: "cheatcodes", "apply"); if !span.is_disabled() { if enabled!(tracing::Level::TRACE) { @@ -74,13 +73,12 @@ pub(crate) trait Cheatcode: CheatcodeDef + DynCheatcode { span.record("id", cheat.cheatcode().func.id); } } - span - } - - fn trace_call() { + let entered = span.entered(); trace!(target: "cheatcodes", "applying"); + entered } + #[inline(never)] fn trace_return(result: &Result) { trace!( target: "cheatcodes", @@ -109,18 +107,36 @@ impl DynCheatcode for T { } /// The cheatcode context, used in [`Cheatcode`]. -pub(crate) struct CheatsCtxt<'a, 'b, DB: DatabaseExt> { +pub(crate) struct CheatsCtxt<'cheats, 'evm, DB: DatabaseExt> { /// The cheatcodes inspector state. - pub(crate) state: &'a mut Cheatcodes, + pub(crate) state: &'cheats mut Cheatcodes, /// The EVM data. - pub(crate) ecx: &'b mut EvmContext, + pub(crate) ecx: &'evm mut InnerEvmContext, + /// The precompiles context. + pub(crate) precompiles: &'evm mut ContextPrecompiles, /// The original `msg.sender`. pub(crate) caller: Address, } -impl CheatsCtxt<'_, '_, DB> { +impl<'cheats, 'evm, DB: DatabaseExt> std::ops::Deref for CheatsCtxt<'cheats, 'evm, DB> { + type Target = InnerEvmContext; + + #[inline(always)] + fn deref(&self) -> &Self::Target { + self.ecx + } +} + +impl<'cheats, 'evm, DB: DatabaseExt> std::ops::DerefMut for CheatsCtxt<'cheats, 'evm, DB> { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut *self.ecx + } +} + +impl<'cheats, 'evm, DB: DatabaseExt> CheatsCtxt<'cheats, 'evm, DB> { #[inline] pub(crate) fn is_precompile(&self, address: &Address) -> bool { - self.ecx.precompiles.contains(address) + self.precompiles.contains_key(address) } } diff --git a/crates/common/src/provider/alloy.rs b/crates/common/src/provider/alloy.rs index d51be9f9ac44..7208c7953128 100644 --- a/crates/common/src/provider/alloy.rs +++ b/crates/common/src/provider/alloy.rs @@ -4,9 +4,8 @@ use crate::{ provider::runtime_transport::RuntimeTransportBuilder, ALCHEMY_FREE_TIER_CUPS, REQUEST_TIMEOUT, }; use alloy_primitives::U256; -use alloy_providers::provider::{Provider, TempProvider}; +use alloy_providers::tmp::{Provider, TempProvider}; use alloy_rpc_client::ClientBuilder; -use alloy_transport::BoxTransport; use ethers_middleware::gas_oracle::{GasCategory, GasOracle, Polygon}; use eyre::{Result, WrapErr}; use foundry_common::types::ToAlloy; @@ -18,10 +17,13 @@ use std::{ }; use url::ParseError; -use super::tower::RetryBackoffLayer; +use super::{ + runtime_transport::RuntimeTransport, + tower::{RetryBackoffLayer, RetryBackoffService}, +}; /// Helper type alias for a retry provider -pub type RetryProvider = Provider; +pub type RetryProvider = Provider>; /// Helper type alias for a rpc url pub type RpcUrl = String; @@ -232,7 +234,7 @@ impl ProviderBuilder { let client = ClientBuilder::default().layer(retry_layer).transport(transport, false); // todo: provider polling interval - Ok(Provider::new_with_client(client.boxed())) + Ok(Provider::new_with_client(client)) } } diff --git a/crates/evm/core/Cargo.toml b/crates/evm/core/Cargo.toml index 814a967c9b64..347d0489cfb7 100644 --- a/crates/evm/core/Cargo.toml +++ b/crates/evm/core/Cargo.toml @@ -24,7 +24,6 @@ alloy-genesis.workspace = true alloy-providers.workspace = true alloy-rpc-types.workspace = true alloy-sol-types.workspace = true -alloy-transport.workspace = true revm = { workspace = true, default-features = false, features = [ "std", diff --git a/crates/evm/core/src/backend/cow.rs b/crates/evm/core/src/backend/cow.rs index d8ea27c0dc81..c0ff88ea40a1 100644 --- a/crates/evm/core/src/backend/cow.rs +++ b/crates/evm/core/src/backend/cow.rs @@ -71,7 +71,7 @@ impl<'a> CowBackend<'a> { let res = evm.transact().wrap_err("backend: failed while inspecting")?; - env.env = evm.context.evm.env; + env.env = evm.context.evm.inner.env; Ok(res) } diff --git a/crates/evm/core/src/backend/mod.rs b/crates/evm/core/src/backend/mod.rs index 1ad5ec4816de..f55259f4d1e0 100644 --- a/crates/evm/core/src/backend/mod.rs +++ b/crates/evm/core/src/backend/mod.rs @@ -790,7 +790,7 @@ impl Backend { let res = evm.transact().wrap_err("backend: failed while inspecting")?; - env.env = evm.context.evm.env; + env.env = evm.context.evm.inner.env; Ok(res) } diff --git a/crates/evm/core/src/fork/backend.rs b/crates/evm/core/src/fork/backend.rs index ccf64fd10e76..6613c0f13497 100644 --- a/crates/evm/core/src/fork/backend.rs +++ b/crates/evm/core/src/fork/backend.rs @@ -4,7 +4,7 @@ use crate::{ fork::{cache::FlushJsonBlockCacheDB, BlockchainDb}, }; use alloy_primitives::{keccak256, Address, Bytes, B256, U256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::{Block, BlockId, Transaction}; use eyre::WrapErr; use foundry_common::NON_ARCHIVE_NODE_WARNING; diff --git a/crates/evm/core/src/fork/init.rs b/crates/evm/core/src/fork/init.rs index 84830d5a2b83..abde7cb22dea 100644 --- a/crates/evm/core/src/fork/init.rs +++ b/crates/evm/core/src/fork/init.rs @@ -1,6 +1,6 @@ use crate::utils::apply_chain_and_block_specific_env_changes; use alloy_primitives::{Address, U256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::{Block, BlockNumberOrTag}; use eyre::WrapErr; use foundry_common::NON_ARCHIVE_NODE_WARNING; diff --git a/crates/evm/core/src/fork/multi.rs b/crates/evm/core/src/fork/multi.rs index f84af067c020..4e1cb66e5ff4 100644 --- a/crates/evm/core/src/fork/multi.rs +++ b/crates/evm/core/src/fork/multi.rs @@ -4,9 +4,7 @@ //! concurrently active pairs at once. use crate::fork::{BackendHandler, BlockchainDb, BlockchainDbMeta, CreateFork, SharedBackend}; -use alloy_providers::provider::Provider; -use alloy_transport::BoxTransport; -use foundry_common::provider::alloy::ProviderBuilder; +use foundry_common::provider::alloy::{ProviderBuilder, RetryProvider}; use foundry_config::Config; use futures::{ channel::mpsc::{channel, Receiver, Sender}, @@ -169,7 +167,7 @@ impl MultiFork { } } -type Handler = BackendHandler>>; +type Handler = BackendHandler>; type CreateFuture = Pin> + Send>>; diff --git a/crates/evm/core/src/opts.rs b/crates/evm/core/src/opts.rs index 786252bba73a..89fdcf4e3869 100644 --- a/crates/evm/core/src/opts.rs +++ b/crates/evm/core/src/opts.rs @@ -1,7 +1,7 @@ use super::fork::environment; use crate::fork::CreateFork; use alloy_primitives::{Address, B256, U256}; -use alloy_providers::provider::TempProvider; +use alloy_providers::tmp::TempProvider; use alloy_rpc_types::Block; use eyre::WrapErr; use foundry_common::{ diff --git a/crates/evm/evm/src/inspectors/stack.rs b/crates/evm/evm/src/inspectors/stack.rs index c118bcd3dc10..67fbb3fa7d9f 100644 --- a/crates/evm/evm/src/inspectors/stack.rs +++ b/crates/evm/evm/src/inspectors/stack.rs @@ -370,7 +370,6 @@ impl InspectorStack { record_stack_snapshots: StackSnapshotType::None, record_state_diff: false, exclude_precompile_calls: false, - record_call_return_data: true, record_logs: true, }) }); @@ -443,6 +442,8 @@ impl InspectorStack { gas_limit: u64, value: U256, ) -> (InterpreterResult, Option
) { + let ecx = &mut ecx.inner; + ecx.db.commit(ecx.journaled_state.state.clone()); let nonce = ecx @@ -485,7 +486,7 @@ impl InspectorStack { let res = evm.transact(); // need to reset the env in case it was modified via cheatcodes during execution - ecx.env = evm.context.evm.env; + ecx.env = evm.context.evm.inner.env; res };