diff --git a/Cargo.lock b/Cargo.lock index d5d411c5c5da6..8d5e61e08da0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,15 +30,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.2.16", + "getrandom 0.3.3", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -58,11 +58,11 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-chains" -version = "0.1.69" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28e2652684758b0d9b389d248b209ed9fd9989ef489a550265fe4bb8454fe7eb" +checksum = "7734aecfc58a597dde036e4c5cace2ae43e2f8bf3d406b022a1ef34da178dd49" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "num_enum", "serde", "strum 0.27.1", @@ -70,14 +70,14 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d301f5bcfd37e3aac727c360d8b50c33ddff9169ce0370198dedda36a9927d" +checksum = "785982a9b7b86d3fdf4ca43eb9a82447ccb7188ea78804ce64b6d6d82cc3e202" dependencies = [ - "alloy-eips", - "alloy-primitives", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-trie", "auto_impl", "c-kzg", @@ -86,6 +86,7 @@ dependencies = [ "k256", "once_cell", "rand 0.8.5", + "secp256k1", "serde", "serde_with", "thiserror 2.0.12", @@ -93,34 +94,34 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f4f97a85a45965e0e4f9f5b94bbafaa3e4ee6868bdbcf2e4a9acb4b358038fe" +checksum = "81d0d4b81bd538d023236b5301582c962aa2f2043d1b3a1373ea88fbee82a8e0" dependencies = [ "alloy-consensus", - "alloy-eips", - "alloy-primitives", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.0.3", "serde", ] [[package]] name = "alloy-contract" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39e8b96c9e25dde7222372332489075f7e750e4fd3e81c11eec0939b78b71b8" +checksum = "39564a2dcb9412294c70f6a797ccbf411586f4fe8ab01efb03bb3cabd0b42023" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", - "alloy-json-abi", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "alloy-transport", "futures", "futures-util", @@ -133,10 +134,27 @@ version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb8e762aefd39a397ff485bc86df673465c4ad3ec8819cc60833a8a3ba5cdc87" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "alloy-sol-types 0.8.25", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow 0.7.10", +] + +[[package]] +name = "alloy-dyn-abi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f90b63261b7744642f6075ed17db6de118eecbe9516ea6c6ffd444b80180b75" +dependencies = [ + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", + "alloy-sol-type-parser 1.1.0", + "alloy-sol-types 1.1.0", "arbitrary", "const-hex", "derive_arbitrary", @@ -150,11 +168,11 @@ dependencies = [ [[package]] name = "alloy-eip2124" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675264c957689f0fd75f5993a73123c2cc3b5c235a38f5b9037fe6c826bfb2c0" +checksum = "741bdd7499908b3aa0b159bba11e71c8cddd009a2c2eb7a06e825f1ec87900a5" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", "crc", "serde", @@ -163,22 +181,22 @@ dependencies = [ [[package]] name = "alloy-eip2930" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +checksum = "7b82752a889170df67bbb36d42ca63c531eb16274f0d7299ae2a680facba17bd" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", "serde", ] [[package]] name = "alloy-eip7702" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b15b13d38b366d01e818fe8e710d4d702ef7499eacd44926a06171dd9585d0c" +checksum = "804cefe429015b4244966c006d25bda5545fa9db5990e9c9079faf255052f50a" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", "k256", "serde", @@ -187,16 +205,36 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.13.0" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "609515c1955b33af3d78d26357540f68c5551a90ef58fd53def04f2aa074ec43" +dependencies = [ + "alloy-eip2124", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 1.1.0", + "alloy-rlp", + "alloy-serde 0.14.0", + "auto_impl", + "c-kzg", + "derive_more 2.0.1", + "either", + "serde", + "sha2 0.10.9", +] + +[[package]] +name = "alloy-eips" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b11c382ca8075128d1ae6822b60921cf484c911d9a5831797a01218f98125f" +checksum = "7f29e7fda66a9d3315db883947a21b79f018cf6d873ee51660a93cb712696928" dependencies = [ "alloy-eip2124", "alloy-eip2930", "alloy-eip7702", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.0.3", "auto_impl", "c-kzg", "derive_more 2.0.1", @@ -207,15 +245,15 @@ dependencies = [ [[package]] name = "alloy-evm" -version = "0.3.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71b0b181c956dca015b4c08b36668736013787c9dc9e743fd39a23b8b130c14" +checksum = "de0210f2d5854895b376f7fbbf78f3e33eb4f0e59abc503502cc0ed8d295a837" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-hardforks", - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "auto_impl", "derive_more 2.0.1", "op-alloy-consensus", @@ -226,26 +264,26 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd9e75c5dd40319ebbe807ebe9dfb10c24e4a70d9c7d638e62921d8dd093c8b" +checksum = "cfc71c06880f44758e8c748db17f3e4661240bfa06f665089097e8cdd0583ca4" dependencies = [ - "alloy-eips", - "alloy-primitives", - "alloy-serde", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", + "alloy-serde 1.0.3", "alloy-trie", "serde", ] [[package]] name = "alloy-hardforks" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473ee2ab7f5262b36e8fbc1b5327d5c9d488ab247e31ac739b929dbe2444ae79" +checksum = "c7d3b2243e2adfaea41da41982f91ecab8083fa51b240d0427955d709f65b1b4" dependencies = [ "alloy-chains", "alloy-eip2124", - "alloy-primitives", + "alloy-primitives 1.1.0", "auto_impl", "dyn-clone", ] @@ -256,20 +294,32 @@ version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe6beff64ad0aa6ad1019a3db26fef565aefeb011736150ab73ed3366c3cfd1b" dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", + "alloy-primitives 0.8.25", + "alloy-sol-type-parser 0.8.25", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-abi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0068ae277f5ee3153a95eaea8ff10e188ed8ccde9b7f9926305415a2c0ab2442" +dependencies = [ + "alloy-primitives 1.1.0", + "alloy-sol-type-parser 1.1.0", "serde", "serde_json", ] [[package]] name = "alloy-json-rpc" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcf26d02a72e23d5bc245425ea403c93ba17d254f20f9c23556a249c6c7e143" +checksum = "265ebe8c014bf3f1c7872a208e6fd3a157b93405ec826383492dbe31085197aa" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "serde", "serde_json", "thiserror 2.0.12", @@ -278,21 +328,21 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44dd4429e190f727358571175ebf323db360a303bf4e1731213f510ced1c2e6" +checksum = "1a9d67becc5c6dd5c85e0f4a9cda0a1f4d5805749b8b4da906d96947ef801dd5" dependencies = [ "alloy-consensus", "alloy-consensus-any", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-any", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-signer", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "async-trait", "auto_impl", "derive_more 2.0.1", @@ -304,28 +354,28 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f736e1d1eb1b770dbd32919bdf46d4dcd4617f2eed07947dfb32649962baba" +checksum = "60301cdd4e0b9059ec53a5b34dc93c245947638b95634000f92c5f10acd17fbf" dependencies = [ "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-serde", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", + "alloy-serde 1.0.3", "serde", ] [[package]] name = "alloy-op-evm" -version = "0.3.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324cf0b3b08b4c3354460dee8208384a59245da8b0eaefe9e962d3942d919d58" +checksum = "5ee0165cc5f92d8866c0a21320ee6f089a7e1d0cebbf7008c37a6380a912ebe2" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-evm", "alloy-op-hardforks", - "alloy-primitives", + "alloy-primitives 1.1.0", "auto_impl", "op-alloy-consensus", "op-revm", @@ -334,9 +384,9 @@ dependencies = [ [[package]] name = "alloy-op-hardforks" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217a4efe17c43df77c1f261825350be0be1d907f56eb38a4b258936e33cfd1d8" +checksum = "04a45f2af91a348e5d22dbb3589d821d2e83d2e65b54c14c3f9e8e9c6903fc09" dependencies = [ "alloy-hardforks", "auto_impl", @@ -347,6 +397,33 @@ name = "alloy-primitives" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 2.0.1", + "foldhash", + "hashbrown 0.15.3", + "indexmap 2.9.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a12fe11d0b8118e551c29e1a67ccb6d01cc07ef08086df30f07487146de6fa1" dependencies = [ "alloy-rlp", "arbitrary", @@ -356,7 +433,7 @@ dependencies = [ "derive_arbitrary", "derive_more 2.0.1", "foldhash", - "getrandom 0.2.16", + "getrandom 0.3.3", "hashbrown 0.15.3", "indexmap 2.9.0", "itoa", @@ -365,7 +442,7 @@ dependencies = [ "paste", "proptest", "proptest-derive", - "rand 0.8.5", + "rand 0.9.1", "ruint", "rustc-hash 2.1.1", "serde", @@ -375,17 +452,17 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a557f9e3ec89437b06db3bfc97d20782b1f7cc55b5b602b6a82bf3f64d7efb0e" +checksum = "4af4bd045e414b3b52e929d31a9413bf072dd78cee9b962eb2d9fc5e500c3ccb" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-debug", @@ -393,7 +470,7 @@ dependencies = [ "alloy-rpc-types-trace", "alloy-rpc-types-txpool", "alloy-signer", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "alloy-transport", "alloy-transport-http", "alloy-transport-ipc", @@ -420,12 +497,12 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a261caff6c2ec6fe1d6eb77ba41159024c8387d05e4138804a387d403def55" +checksum = "cfbb328bc2538e10b17570eae25e5ecb2cdb97b729caa115617e124b05e9463e" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-transport", "bimap", "futures", @@ -436,6 +513,7 @@ dependencies = [ "tokio-stream", "tower 0.5.2", "tracing", + "wasmtimer", ] [[package]] @@ -462,12 +540,12 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec6dc89c4c3ef166f9fa436d1831f8142c16cf2e637647c936a6aaaabd8d898" +checksum = "6707200ade3dd821585ec208022a273889f328ee1e76014c9a81820ef6d3c48d" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -490,64 +568,64 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3849f8131a18cc5d7f95f301d68a6af5aa2db28ad8522fb9db1f27b3794e8b68" +checksum = "a891e871830c1ef6e105a08f615fbb178b2edc4c75c203bf47c64dfa21acd849" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-anvil", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-rpc-types-txpool", - "alloy-serde", + "alloy-serde 1.0.3", "serde", ] [[package]] name = "alloy-rpc-types-anvil" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19051fd5e8de7e1f95ec228c9303debd776dcc7caf8d1ece3191f711f5c06541" +checksum = "2f7e3f1efdb3ef6f2e0e09036099933f9d96ff1d3129be4b2e5394550a58b39d" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", "serde", ] [[package]] name = "alloy-rpc-types-any" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd6d480e4e6e456f30eeeb3aef1512aaecb68df2a35d1f78865dbc4d20dc0fd" +checksum = "518c67d8465f885c7524f0fe2cc32861635e9409a6f2efc015e306ca8d73f377" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", ] [[package]] name = "alloy-rpc-types-debug" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805eb9fa07f92f1225253e842b5454b4b3e258813445c1a1c9d8dd0fd90817c1" +checksum = "5cc83d5587cdfcfb3f9cfb83484c319ce1f5eec4da11c357153725785c17433c" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "serde", ] [[package]] name = "alloy-rpc-types-engine" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689521777149dabe210ef122605fb00050e038f2e85b8c9897534739f1a904f8" +checksum = "85872461c13427e7715809871dfff8945df9309169e378a8737c8b0880a72b1b" dependencies = [ "alloy-consensus", - "alloy-eips", - "alloy-primitives", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.0.3", "derive_more 2.0.1", "jsonwebtoken", "rand 0.8.5", @@ -557,18 +635,18 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8b6d55bdaa0c4a08650d4b32f174494cbade56adf6f2fcfa2a4f3490cb5511" +checksum = "117b370f315c7f6c856c51d840fef8728f9738ce46f5f48c2f6a901da454da81" dependencies = [ "alloy-consensus", "alloy-consensus-any", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", - "alloy-sol-types", + "alloy-serde 1.0.3", + "alloy-sol-types 1.1.0", "itertools 0.14.0", "serde", "serde_json", @@ -577,13 +655,13 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6019cd6a89230d765a621a7b1bc8af46a6a9cde2d2e540e6f9ce930e0fb7c6db" +checksum = "356253f9ad65afe964733c6c3677a70041424359bd6340ab5597ff37185c1a82" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", "serde", "serde_json", "thiserror 2.0.12", @@ -591,36 +669,47 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee36e5404642696af511f09991f9f54a11b90e86e55efad868f8f56350eff5b0" +checksum = "d17e23d6d3e3fafaed4e4950c93172ee23ec665f54ca644dbdab418f90d24e46" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", "serde", ] [[package]] name = "alloy-serde" -version = "0.13.0" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4dba6ff08916bc0a9cbba121ce21f67c0b554c39cf174bc7b9df6c651bd3c3b" +dependencies = [ + "alloy-primitives 1.1.0", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1824791912f468a481dedc1db50feef3e85a078f6d743a62db2ee9c2ca674882" +checksum = "fcfe8652fc1500463a9193e90feb4628f243f5758e54abd41fa6310df80d3de9" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "serde", "serde_json", ] [[package]] name = "alloy-signer" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d087fe5aea96a93fbe71be8aaed5c57c3caac303c09e674bc5b1647990d648b" +checksum = "167a38442a3626ef0bf8295422f339b1392f56574c13017f2718bf5bdf878c6a" dependencies = [ - "alloy-dyn-abi", - "alloy-primitives", - "alloy-sol-types", + "alloy-dyn-abi 1.1.0", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "async-trait", "auto_impl", "either", @@ -631,13 +720,13 @@ dependencies = [ [[package]] name = "alloy-signer-aws" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6623e424e692388d0c42071ed997513d7a19d8b83e83732466c0c93aedd486bd" +checksum = "3b1e4c85d2dc9e94bd7829375193bc0406fc296a85120fb942ddf0299567c195" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", "async-trait", "aws-sdk-kms", @@ -649,16 +738,16 @@ dependencies = [ [[package]] name = "alloy-signer-gcp" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53755624ad8fbd12be2dc2e9df31cbab38e4067fa3d4ba02814145535a221f98" +checksum = "c91bd57f930e0c2c56121dc34154f98d11d029170848a5901c6d5a47bc23e117" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", "async-trait", - "gcloud-sdk", + "gcloud-sdk 0.27.1", "k256", "spki", "thiserror 2.0.12", @@ -667,16 +756,16 @@ dependencies = [ [[package]] name = "alloy-signer-ledger" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4224cd9c7b8107b1f7973361e81cf75e20a99835bcdc6ba7ac8ea50a6256e47" +checksum = "173704b2618f1ef66f6eebe5fca507ffb303455ff634a541331140db069e6de4" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "async-trait", "coins-ledger", "futures-util", @@ -687,13 +776,13 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2940353d2425bb75965cd5101075334e6271051e35610f903bf8099a52b0b1a9" +checksum = "92f04bf5386358318a17d189bb56bc1ef00320de4aa9ce939ae8cf76e3178ca0" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", "async-trait", "coins-bip32", @@ -706,13 +795,13 @@ dependencies = [ [[package]] name = "alloy-signer-trezor" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bafd519704c7d9f2c449686e895a7681e5e7172bfef3f2d3ad8d0b4476d6f9d" +checksum = "5970e58fd000f26a5953d864a2c8b5a2672510436f5757830fa7cd93cc490cd8" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", "async-trait", "semver 1.0.26", @@ -727,8 +816,22 @@ version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e10ae8e9a91d328ae954c22542415303919aabe976fe7a92eb06db1b68fd59f2" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 0.8.25", + "alloy-sol-macro-input 0.8.25", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3ef8e0d622453d969ba3cded54cf6800efdc85cb929fe22c5bdf8335666757" +dependencies = [ + "alloy-sol-macro-expander 1.1.0", + "alloy-sol-macro-input 1.1.0", "proc-macro-error2", "proc-macro2", "quote", @@ -741,8 +844,7 @@ version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83ad5da86c127751bc607c174d6c9fe9b85ef0889a9ca0c641735d77d4f98f26" dependencies = [ - "alloy-json-abi", - "alloy-sol-macro-input", + "alloy-sol-macro-input 0.8.25", "const-hex", "heck", "indexmap 2.9.0", @@ -750,7 +852,26 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.101", - "syn-solidity", + "syn-solidity 0.8.25", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e84bd0693c69a8fbe3ec0008465e029c6293494df7cb07580bf4a33eff52e1" +dependencies = [ + "alloy-json-abi 1.1.0", + "alloy-sol-macro-input 1.1.0", + "const-hex", + "heck", + "indexmap 2.9.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.101", + "syn-solidity 1.1.0", "tiny-keccak", ] @@ -760,7 +881,23 @@ version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3d30f0d3f9ba3b7686f3ff1de9ee312647aac705604417a2f40c604f409a9e" dependencies = [ - "alloy-json-abi", + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.101", + "syn-solidity 0.8.25", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3de663412dadf9b64f4f92f507f78deebcc92339d12cf15f88ded65d41c7935" +dependencies = [ + "alloy-json-abi 1.1.0", "const-hex", "dunce", "heck", @@ -769,7 +906,7 @@ dependencies = [ "quote", "serde_json", "syn 2.0.101", - "syn-solidity", + "syn-solidity 1.1.0", ] [[package]] @@ -782,26 +919,50 @@ dependencies = [ "winnow 0.7.10", ] +[[package]] +name = "alloy-sol-type-parser" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251273c5aa1abb590852f795c938730fa641832fc8fa77b5478ed1bf11b6097e" +dependencies = [ + "serde", + "winnow 0.7.10", +] + [[package]] name = "alloy-sol-types" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d43d5e60466a440230c07761aa67671d4719d46f43be8ea6e7ed334d8db4a9ab" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", + "alloy-json-abi 0.8.25", + "alloy-primitives 0.8.25", + "alloy-sol-macro 0.8.25", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5460a975434ae594fe2b91586253c1beb404353b78f0a55bf124abcd79557b15" +dependencies = [ + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", + "alloy-sol-macro 1.1.0", "const-hex", "serde", ] [[package]] name = "alloy-transport" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6818b4c82a474cc01ac9e88ccfcd9f9b7bc893b2f8aea7e890a28dcd55c0a7aa" +checksum = "c4f91badc9371554f9f5e1c4d0731c208fcfb14cfd1583af997425005a962689" dependencies = [ "alloy-json-rpc", + "alloy-primitives 1.1.0", "base64 0.22.1", "derive_more 2.0.1", "futures", @@ -819,9 +980,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc3079a33483afa1b1365a3add3ea3e21c75b10f704870198ba7846627d10f2" +checksum = "1ca577cff7579e39d3b4312dcd68809bd1ca693445cfdcf53f4f466a9b6b3df3" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -834,9 +995,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c6f8e20aa6b748357bed157c14e561a176d0f6cffed7f99ee37758a7d16202" +checksum = "aed6f489a90092929a480cbe30d16a147fa89f859f8d9ef26f60555681503c8b" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -854,9 +1015,9 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.13.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef7a4301e8967c1998f193755fd9429e0ca81730e2e134e30c288c43dbf96f0" +checksum = "30aa80247a43d71bf683294907e74c634be7b4307d02530c856fac7fc4c2566a" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -872,14 +1033,14 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a94854e420f07e962f7807485856cde359ab99ab6413883e15235ad996e8b" +checksum = "983d99aa81f586cef9dae38443245e585840fcf0fc58b09aee0b1f27aed1d500" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", "arrayvec", - "derive_more 1.0.0", + "derive_more 2.0.1", "nybbles", "serde", "smallvec", @@ -1004,28 +1165,28 @@ dependencies = [ "alloy-chains", "alloy-consensus", "alloy-contract", - "alloy-dyn-abi", - "alloy-eips", + "alloy-dyn-abi 1.1.0", + "alloy-eips 1.0.3", "alloy-evm", "alloy-genesis", "alloy-network", "alloy-op-evm", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-pubsub", "alloy-rlp", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-signer", "alloy-signer-local", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "alloy-transport", "alloy-trie", "anvil-core", "anvil-rpc", "anvil-server", "async-trait", - "axum", + "axum 0.7.9", "chrono", "clap", "clap_complete", @@ -1048,6 +1209,7 @@ dependencies = [ "op-revm", "parking_lot", "rand 0.8.5", + "rand 0.9.1", "revm", "revm-inspectors", "serde", @@ -1065,19 +1227,19 @@ name = "anvil-core" version = "1.2.0" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", - "alloy-eips", + "alloy-dyn-abi 1.1.0", + "alloy-eips 1.0.3", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rlp", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "bytes", "foundry-common", "foundry-evm", "op-alloy-consensus", "op-revm", - "rand 0.8.5", + "rand 0.9.1", "revm", "serde", "serde_json", @@ -1098,7 +1260,7 @@ version = "1.2.0" dependencies = [ "anvil-rpc", "async-trait", - "axum", + "axum 0.7.9", "bytes", "clap", "futures", @@ -1621,9 +1783,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b756939cb2f8dc900aa6dcd505e6e2428e9cae7ff7b028c49e3946efa70878" +checksum = "93fcc8f365936c834db5514fc45aee5b1202d677e6b40e48468aaaa8183ca8c7" dependencies = [ "aws-lc-sys", "zeroize", @@ -1631,9 +1793,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa9b6986f250236c27e5a204062434a773a13243d2ffc2955f37bdba4c5c6a1" +checksum = "61b1d86e7705efe1be1b569bab41d4fa1e14e220b60a160f78de2db687add079" dependencies = [ "bindgen", "cc", @@ -1668,9 +1830,9 @@ dependencies = [ [[package]] name = "aws-sdk-kms" -version = "1.67.0" +version = "1.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b650cf9e1e153ab13acd3aa1f73b271dac14e019353ec0b0c176f24a21bad03" +checksum = "2fc85e33344e39319761a1bb4bb11ccd56f44bd763cb02539436c0d6cc6ea13d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1691,9 +1853,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.66.0" +version = "1.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "858007b14d0f1ade2e0124473c2126b24d334dc9486ad12eb7c0ed14757be464" +checksum = "0d4863da26489d1e6da91d7e12b10c17e86c14f94c53f416bd10e0a9c34057ba" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1714,9 +1876,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.67.0" +version = "1.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83abf3ae8bd10a014933cc2383964a12ca5a3ebbe1948ad26b1b808e7d0d1f2" +checksum = "95caa3998d7237789b57b95a8e031f60537adab21fa84c91e35bef9455c652e4" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1737,9 +1899,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.67.0" +version = "1.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e8e9ac4a837859c8f1d747054172e1e55933f02ed34728b0b34dea0591ec84" +checksum = "4939f6f449a37308a78c5a910fd91265479bd2bb11d186f0b8fc114d89ec828d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1814,9 +1976,9 @@ dependencies = [ [[package]] name = "aws-smithy-http-client" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aff1159006441d02e57204bf57a1b890ba68bedb6904ffd2873c1c4c11c546b" +checksum = "7e44697a9bded898dcd0b1cb997430d949b87f4f8940d91023ae9062bf218250" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -1957,7 +2119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.4.5", "base64 0.22.1", "bytes", "futures-util", @@ -1967,7 +2129,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit", + "matchit 0.7.3", "memchr", "mime", "percent-encoding", @@ -1987,6 +2149,32 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" +dependencies = [ + "axum-core 0.5.2", + "bytes", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit 0.8.4", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.4.5" @@ -2008,6 +2196,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.75" @@ -2078,7 +2285,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.12.1", "lazy_static", "lazycell", "log", @@ -2291,11 +2498,10 @@ dependencies = [ [[package]] name = "c-kzg" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7e3c397401eb76228c89561cf22f85f41c95aa799ee9d860de3ea1cbc728fc" +checksum = "7318cfa722931cb5fe0838b98d3ce5621e75f6a6408abc21721d80de9223f2e4" dependencies = [ - "arbitrary", "blst", "cc", "glob", @@ -2318,18 +2524,18 @@ dependencies = [ "alloy-chains", "alloy-consensus", "alloy-contract", - "alloy-dyn-abi", - "alloy-json-abi", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", "alloy-json-rpc", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rlp", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-signer", "alloy-signer-local", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "alloy-transport", "anvil", "aws-sdk-kms", @@ -2351,9 +2557,10 @@ dependencies = [ "foundry-test-utils", "foundry-wallets", "futures", - "gcloud-sdk", + "gcloud-sdk 0.26.4", "itertools 0.14.0", "rand 0.8.5", + "rand 0.9.1", "rayon", "regex", "revm", @@ -2378,9 +2585,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.21" +version = "1.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" dependencies = [ "jobserver", "libc", @@ -2412,9 +2619,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" name = "chisel" version = "1.2.0" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "clap", "dirs", "eyre", @@ -2505,9 +2712,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" dependencies = [ "clap_builder", "clap_derive", @@ -2525,9 +2732,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" dependencies = [ "anstream", "anstyle", @@ -2869,9 +3076,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.2.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" dependencies = [ "crc-catalog", ] @@ -3003,11 +3210,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.6" +version = "3.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c" +checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73" dependencies = [ - "nix 0.29.0", + "nix 0.30.1", "windows-sys 0.59.0", ] @@ -3437,17 +3644,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "enumn" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "env_filter" version = "0.1.3" @@ -3505,9 +3701,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" +checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" [[package]] name = "eth-keystore" @@ -3559,8 +3755,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78329cbf3c326a3ce2694003976c019fe5f407682b1fdc76e89e463826ea511a" dependencies = [ "ahash", - "alloy-dyn-abi", - "alloy-primitives", + "alloy-dyn-abi 0.8.25", + "alloy-primitives 0.8.25", "indexmap 2.9.0", ] @@ -3715,18 +3911,18 @@ name = "forge" version = "1.2.0" dependencies = [ "alloy-chains", - "alloy-dyn-abi", - "alloy-json-abi", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-signer", "alloy-signer-local", "alloy-transport", "anvil", - "axum", + "axum 0.7.9", "chrono", "clap", "clap_complete", @@ -3796,7 +3992,7 @@ dependencies = [ name = "forge-doc" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "derive_more 2.0.1", "eyre", "forge-fmt", @@ -3819,7 +4015,7 @@ dependencies = [ name = "forge-fmt" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "ariadne", "foundry-config", "foundry-solang-parser", @@ -3837,14 +4033,14 @@ version = "1.2.0" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-dyn-abi", - "alloy-eips", - "alloy-json-abi", + "alloy-dyn-abi 1.1.0", + "alloy-eips 1.0.3", + "alloy-json-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "alloy-signer", "clap", "dialoguer", @@ -3881,7 +4077,7 @@ name = "forge-script-sequence" version = "1.2.0" dependencies = [ "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "eyre", "foundry-common", "foundry-compilers", @@ -3896,8 +4092,8 @@ dependencies = [ name = "forge-sol-macro-gen" version = "1.2.0" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", + "alloy-sol-macro-expander 1.1.0", + "alloy-sol-macro-input 1.1.0", "eyre", "foundry-common", "prettyplease", @@ -3911,9 +4107,9 @@ dependencies = [ name = "forge-verify" version = "1.2.0" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rpc-types", "async-trait", @@ -3952,13 +4148,13 @@ dependencies = [ [[package]] name = "foundry-block-explorers" -version = "0.13.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8025385c52416bf14e5bb28d21eb5efe2490dd6fb001a49b87f1825a626b4909" +checksum = "6129df264d2bd245ade4ed21a92f605bfd592dca8fb8e6e1adde1b9bd4288681" dependencies = [ "alloy-chains", - "alloy-json-abi", - "alloy-primitives", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "foundry-compilers", "reqwest", "semver 1.0.26", @@ -3974,18 +4170,18 @@ version = "1.2.0" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-evm", "alloy-genesis", - "alloy-json-abi", + "alloy-json-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rlp", "alloy-rpc-types", "alloy-signer", "alloy-signer-local", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "base64 0.22.1", "dialoguer", "ecdsa", @@ -4005,7 +4201,8 @@ dependencies = [ "p256", "parking_lot", "proptest", - "rand 0.8.5", + "rand 0.9.1", + "rand_chacha 0.9.0", "revm", "revm-inspectors", "semver 1.0.26", @@ -4021,7 +4218,7 @@ dependencies = [ name = "foundry-cheatcodes-spec" version = "1.2.0" dependencies = [ - "alloy-sol-types", + "alloy-sol-types 1.1.0", "foundry-macros", "schemars", "serde", @@ -4033,10 +4230,10 @@ name = "foundry-cli" version = "1.2.0" dependencies = [ "alloy-chains", - "alloy-dyn-abi", - "alloy-eips", - "alloy-json-abi", - "alloy-primitives", + "alloy-dyn-abi 1.1.0", + "alloy-eips 1.0.3", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rlp", "cfg-if", @@ -4077,18 +4274,18 @@ version = "1.2.0" dependencies = [ "alloy-consensus", "alloy-contract", - "alloy-dyn-abi", - "alloy-eips", - "alloy-json-abi", + "alloy-dyn-abi 1.1.0", + "alloy-eips 1.0.3", + "alloy-json-abi 1.1.0", "alloy-json-rpc", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types", - "alloy-serde", - "alloy-sol-types", + "alloy-serde 1.0.3", + "alloy-sol-types 1.1.0", "alloy-transport", "alloy-transport-http", "alloy-transport-ipc", @@ -4096,7 +4293,7 @@ dependencies = [ "anstream", "anstyle", "async-trait", - "axum", + "axum 0.7.9", "chrono", "ciborium", "clap", @@ -4133,11 +4330,11 @@ name = "foundry-common-fmt" version = "1.2.0" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 1.0.3", "chrono", "comfy-table", "foundry-macros", @@ -4150,12 +4347,12 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bb4155f53d4b05642a1398ad105dc04d44b368a7932b85f6ed012af48768b7" +checksum = "3d6154e503612a175a88ff342592f0a44664dda54a508d9443121b62b1701f91" dependencies = [ - "alloy-json-abi", - "alloy-primitives", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "auto_impl", "derive_more 1.0.0", "dirs", @@ -4187,9 +4384,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8239fe85061cdb35b8041ef84918e657099fe26f41b016ab8d2560ae6413183" +checksum = "efca59ffe52914a8ff4ae4e8e97e9fa5d782031d2f5a2d1fb109fa6aac26653d" dependencies = [ "foundry-compilers-artifacts-solc", "foundry-compilers-artifacts-vyper", @@ -4197,12 +4394,12 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-solc" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d5c80fda7c4fde0d2964b329b22d09718838da0c940e5df418f2c1db14fd24" +checksum = "0a3ffc93f94d2c4ae0ff0f7a12cdeaa5fbb043ced0c558cabd05631e32ac508a" dependencies = [ - "alloy-json-abi", - "alloy-primitives", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "foundry-compilers-core", "futures-util", "path-slash", @@ -4220,12 +4417,12 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-vyper" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eaf3cad3dd7bd9eae02736e98f55aaf00ee31fbc0a367613436c2fb01c43914" +checksum = "5f077777aa33f933f9f01e90f9ed78e4a40ed60a6380798b528681ca9519a577" dependencies = [ - "alloy-json-abi", - "alloy-primitives", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "foundry-compilers-artifacts-solc", "foundry-compilers-core", "path-slash", @@ -4235,11 +4432,11 @@ dependencies = [ [[package]] name = "foundry-compilers-core" -version = "0.14.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac5a1aef4083544309765a1a10c310dffde8c9b8bcfda79b7c2bcfde32f3be3" +checksum = "8ff92d5831075077fe64391dcbbe4a1518bce0439f97ab6a940fa1b9c1f3eaa2" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "cfg-if", "dunce", "fs_extra", @@ -4261,7 +4458,7 @@ name = "foundry-config" version = "1.2.0" dependencies = [ "alloy-chains", - "alloy-primitives", + "alloy-primitives 1.1.0", "dirs", "dunce", "eyre", @@ -4297,7 +4494,7 @@ dependencies = [ name = "foundry-debugger" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "crossterm", "eyre", "foundry-common", @@ -4315,11 +4512,11 @@ dependencies = [ name = "foundry-evm" version = "1.2.0" dependencies = [ - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-evm", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "eyre", "foundry-cheatcodes", "foundry-common", @@ -4343,8 +4540,8 @@ dependencies = [ name = "foundry-evm-abi" version = "1.2.0" dependencies = [ - "alloy-primitives", - "alloy-sol-types", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "derive_more 2.0.1", "foundry-common-fmt", "foundry-macros", @@ -4356,16 +4553,16 @@ name = "foundry-evm-core" version = "1.2.0" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-evm", "alloy-genesis", - "alloy-json-abi", + "alloy-json-abi 1.1.0", "alloy-network", "alloy-op-evm", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rpc-types", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "auto_impl", "eyre", "foundry-cheatcodes-spec", @@ -4392,7 +4589,7 @@ dependencies = [ name = "foundry-evm-coverage" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "eyre", "foundry-common", "foundry-compilers", @@ -4407,9 +4604,9 @@ dependencies = [ name = "foundry-evm-fuzz" version = "1.2.0" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "eyre", "foundry-common", "foundry-compilers", @@ -4420,7 +4617,7 @@ dependencies = [ "itertools 0.14.0", "parking_lot", "proptest", - "rand 0.8.5", + "rand 0.9.1", "revm", "serde", "thiserror 2.0.12", @@ -4431,10 +4628,10 @@ dependencies = [ name = "foundry-evm-traces" version = "1.2.0" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", + "alloy-dyn-abi 1.1.0", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", + "alloy-sol-types 1.1.0", "eyre", "foundry-block-explorers", "foundry-common", @@ -4457,11 +4654,12 @@ dependencies = [ [[package]] name = "foundry-fork-db" -version = "0.12.0" -source = "git+https://github.com/foundry-rs/foundry-fork-db?rev=811a61a#811a61a1312d6510447d5511f0e8714024813322" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c99831be91edd8a025fa60443b5404ad407708bc337d2e20440d498b5806fab8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "alloy-rpc-types", "eyre", @@ -4480,7 +4678,7 @@ dependencies = [ name = "foundry-linking" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "foundry-compilers", "semver 1.0.26", "thiserror 2.0.12", @@ -4514,7 +4712,7 @@ dependencies = [ name = "foundry-test-utils" version = "1.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-provider", "eyre", "fd-lock", @@ -4524,7 +4722,7 @@ dependencies = [ "foundry-config", "idna_adapter", "parking_lot", - "rand 0.8.5", + "rand 0.9.1", "regex", "serde_json", "snapbox", @@ -4539,16 +4737,16 @@ name = "foundry-wallets" version = "1.2.0" dependencies = [ "alloy-consensus", - "alloy-dyn-abi", + "alloy-dyn-abi 1.1.0", "alloy-network", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-signer", "alloy-signer-aws", "alloy-signer-gcp", "alloy-signer-ledger", "alloy-signer-local", "alloy-signer-trezor", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "async-trait", "aws-config", "aws-sdk-kms", @@ -4557,7 +4755,7 @@ dependencies = [ "eth-keystore", "eyre", "foundry-config", - "gcloud-sdk", + "gcloud-sdk 0.27.1", "rpassword", "serde", "thiserror 2.0.12", @@ -4727,7 +4925,35 @@ dependencies = [ "serde", "serde_json", "tokio", - "tonic", + "tonic 0.12.3", + "tower 0.5.2", + "tower-layer", + "tower-util", + "tracing", + "url", +] + +[[package]] +name = "gcloud-sdk" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44163d7c0d0bc470caa43766beda779e584034abd6b681319d8f9be2fc194eba" +dependencies = [ + "async-trait", + "bytes", + "chrono", + "futures", + "hyper", + "jsonwebtoken", + "once_cell", + "prost", + "prost-types", + "reqwest", + "secret-vault-value", + "serde", + "serde_json", + "tokio", + "tonic 0.13.1", "tower 0.5.2", "tower-layer", "tower-util", @@ -4774,9 +5000,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", @@ -4945,9 +5171,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.17" +version = "0.10.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c091d2e887e02c3462f52252c5ea61150270c0f2657b642e8d0d6df56c16e642" +checksum = "567f65fec4ef10dfab97ae71f26a27fd4d7fe7b8e3f90c8a58551c41ff3fb65b" dependencies = [ "bstr", "gix-trace", @@ -5430,9 +5656,9 @@ dependencies = [ [[package]] name = "idna_mapping" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5422cc5bc64289a77dbb45e970b86b5e9a04cb500abc7240505aedc1bf40f38" +checksum = "11c13906586a4b339310541a274dd927aff6fcbb5b8e3af90634c4b31681c792" dependencies = [ "unicode-joining-type", ] @@ -5659,9 +5885,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -5737,7 +5963,7 @@ version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", "libc", ] @@ -5902,12 +6128,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] @@ -6047,6 +6273,12 @@ dependencies = [ "hashbrown 0.15.3", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "mac" version = "0.1.1" @@ -6113,6 +6345,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "mdbook" version = "0.4.49" @@ -6318,6 +6556,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.9.0", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -6514,6 +6764,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.101", @@ -6576,15 +6827,15 @@ dependencies = [ [[package]] name = "op-alloy-consensus" -version = "0.12.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917f7a65b83e8f9cf06d5209161babf39f5e5768e226a08ad42c033386248a66" +checksum = "6f318b09e24148f07392c5e011bae047a0043851f9041145df5f3b01e4fedd1e" dependencies = [ "alloy-consensus", - "alloy-eips", - "alloy-primitives", + "alloy-eips 1.0.3", + "alloy-primitives 1.1.0", "alloy-rlp", - "alloy-serde", + "alloy-serde 1.0.3", "derive_more 2.0.1", "serde", "thiserror 2.0.12", @@ -6592,26 +6843,27 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.12.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c087949da266a53e4c24d841a68590126ecfd3631b2fe74dbcd6da45702983" +checksum = "15ede8322c10c21249de4fced204e2af4978972e715afee34b6fe684d73880cf" dependencies = [ "alloy-consensus", - "alloy-eips", + "alloy-eips 1.0.3", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-eth", - "alloy-serde", + "alloy-serde 1.0.3", "derive_more 2.0.1", "op-alloy-consensus", "serde", "serde_json", + "thiserror 2.0.12", ] [[package]] name = "op-revm" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.0.2" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "auto_impl", "once_cell", @@ -7028,7 +7280,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.25", + "zerocopy", ] [[package]] @@ -7323,9 +7575,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" +checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", "cfg_aliases", @@ -7343,12 +7595,13 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbafbbdbb0f638fe3f35f3c56739f77a8a1d070cb25603226c83339b391472b" +checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" dependencies = [ "bytes", - "getrandom 0.3.2", + "getrandom 0.3.3", + "lru-slab", "rand 0.9.1", "ring", "rustc-hash 2.1.1", @@ -7426,6 +7679,7 @@ checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", + "serde", ] [[package]] @@ -7463,7 +7717,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", + "serde", ] [[package]] @@ -7647,8 +7902,8 @@ dependencies = [ [[package]] name = "revm" -version = "21.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "23.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "revm-bytecode", "revm-context", @@ -7665,10 +7920,11 @@ dependencies = [ [[package]] name = "revm-bytecode" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.0.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "bitvec", + "once_cell", "phf", "revm-primitives", "serde", @@ -7676,8 +7932,8 @@ dependencies = [ [[package]] name = "revm-context" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "cfg-if", "derive-where", @@ -7691,12 +7947,13 @@ dependencies = [ [[package]] name = "revm-context-interface" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "alloy-eip2930", "alloy-eip7702", "auto_impl", + "either", "revm-database-interface", "revm-primitives", "revm-state", @@ -7705,11 +7962,10 @@ dependencies = [ [[package]] name = "revm-database" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.0.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ - "alloy-eips", - "auto_impl", + "alloy-eips 0.14.0", "revm-bytecode", "revm-database-interface", "revm-primitives", @@ -7719,8 +7975,8 @@ dependencies = [ [[package]] name = "revm-database-interface" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.0.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "auto_impl", "revm-primitives", @@ -7730,8 +7986,8 @@ dependencies = [ [[package]] name = "revm-handler" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "auto_impl", "revm-bytecode", @@ -7747,8 +8003,8 @@ dependencies = [ [[package]] name = "revm-inspector" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "auto_impl", "revm-context", @@ -7763,14 +8019,14 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.18.1" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32ec21c38a85f83773e6b3cdb7060aae8ac9edb291118fbfd4da7f2a50e620" +checksum = "9f847f5e88a09ac84b36529fbe2fee80b3d8bbf91e9a7ae3ea856c4125d0d232" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "alloy-rpc-types-eth", "alloy-rpc-types-trace", - "alloy-sol-types", + "alloy-sol-types 1.1.0", "anstyle", "colorchoice", "revm", @@ -7781,8 +8037,8 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "17.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "19.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "revm-bytecode", "revm-context-interface", @@ -7792,8 +8048,8 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "18.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "20.1.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "ark-bls12-381", "ark-bn254", @@ -7816,18 +8072,18 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "17.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "19.0.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ - "alloy-primitives", - "enumn", + "alloy-primitives 1.1.0", + "num_enum", "serde", ] [[package]] name = "revm-state" -version = "2.0.0" -source = "git+https://github.com/bluealloy/revm.git?rev=2401c2c3#2401c2c37c515316817048b67f23bd10e77cd9d5" +version = "4.0.0" +source = "git+https://github.com/bluealloy/revm.git?rev=b5808253#b580825320708f0c47d3734ceab03d90c0b11ba1" dependencies = [ "bitflags 2.9.0", "revm-bytecode", @@ -8072,9 +8328,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.2" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7149975849f1abb3832b246010ef62ccc80d3a76169517ada7188252b9cfb437" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "aws-lc-rs", "ring", @@ -8155,15 +8411,6 @@ dependencies = [ "regex", ] -[[package]] -name = "scc" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22b2d775fb28f245817589471dd49c5edf64237f4a19d10ce9a92ff4651a27f4" -dependencies = [ - "sdd", -] - [[package]] name = "schannel" version = "0.1.27" @@ -8221,12 +8468,6 @@ dependencies = [ "sha2 0.10.9", ] -[[package]] -name = "sdd" -version = "3.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "584e070911c7017da6cb2eb0788d09f43d789029b5877d3e5ecc8acf86ceee21" - [[package]] name = "sec1" version = "0.7.3" @@ -8251,6 +8492,7 @@ dependencies = [ "bitcoin_hashes", "rand 0.8.5", "secp256k1-sys", + "serde", ] [[package]] @@ -8550,9 +8792,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" dependencies = [ "libc", "signal-hook-registry", @@ -8694,13 +8936,12 @@ dependencies = [ [[package]] name = "solar-ast" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a583a12e73099d1f54bfe7c8a30d7af5ff3591c61ee51cce91045ee5496d86" +checksum = "7960f42b73c63b78df9e223ea88ca87b7aaef91e3b5084b89d79ec31ad9fc8e3" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "bumpalo", - "derive_more 2.0.1", "either", "num-bigint", "num-rational", @@ -8714,18 +8955,18 @@ dependencies = [ [[package]] name = "solar-config" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12642e7e8490d6855a345b5b9d5e55630bd30f54450a909e28f1385b448baada" +checksum = "00ff62c74517305ddee6fdfa741bac8195826d2820586659341063c991fa4a9e" dependencies = [ "strum 0.27.1", ] [[package]] name = "solar-data-structures" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae8902cc28af53e2ba97c450aff7c59d112a433f9ef98fae808e02e25e6dee6" +checksum = "c3c5934e613b60cfb0b2eadc035bac1fb57641026e4c2fb3683e9580391bd109" dependencies = [ "bumpalo", "index_vec", @@ -8738,9 +8979,9 @@ dependencies = [ [[package]] name = "solar-interface" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded5ec7a5cee351c7a428842d273470180cab259c46f52d502ec3ab5484d0c3a" +checksum = "a614174b9fa673b0a01cc8308d18578f32dd091359786368964bbd19e94e59f7" dependencies = [ "annotate-snippets", "anstream", @@ -8755,7 +8996,6 @@ dependencies = [ "match_cfg", "normalize-path", "rayon", - "scc", "scoped-tls", "solar-config", "solar-data-structures", @@ -8767,9 +9007,9 @@ dependencies = [ [[package]] name = "solar-macros" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2c9ff6e00eeeff12eac9d589f1f20413d3b71b9c0c292d1eefbd34787e0836" +checksum = "ccbdb5d9ecd4127af47279f99475f9fbff6ad3d03afc98ba78e1998bc07c0d46" dependencies = [ "proc-macro2", "quote", @@ -8778,11 +9018,11 @@ dependencies = [ [[package]] name = "solar-parse" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e1bc1d0253b0f7f2c7cd25ed7bc5d5e8cac43e717d002398250e0e66e43278b" +checksum = "7965e27a45ca85135ffd45839f9623131175fb43d2ad3526d32de0946f250f1b" dependencies = [ - "alloy-primitives", + "alloy-primitives 1.1.0", "bitflags 2.9.0", "bumpalo", "itertools 0.14.0", @@ -8799,12 +9039,12 @@ dependencies = [ [[package]] name = "solar-sema" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded4b26fb85a0ae2f3277377236af0884c82f38965a2c51046a53016c8b5f332" +checksum = "c7e695824aaf984aa01493ebd5e7e83ddf84629d4a2667a0adf25cb6b65fa63e" dependencies = [ - "alloy-json-abi", - "alloy-primitives", + "alloy-json-abi 1.1.0", + "alloy-primitives 1.1.0", "bitflags 2.9.0", "bumpalo", "derive_more 2.0.1", @@ -8812,7 +9052,6 @@ dependencies = [ "once_map", "paste", "rayon", - "scc", "serde", "serde_json", "solar-ast", @@ -9138,6 +9377,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "syn-solidity" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d0f0d4760f4c2a0823063b2c70e97aa2ad185f57be195172ccc0e23c4b787c4" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "sync_wrapper" version = "1.0.2" @@ -9176,12 +9427,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix 1.0.7", "windows-sys 0.59.0", @@ -9546,7 +9797,7 @@ checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.7.9", "base64 0.22.1", "bytes", "h2", @@ -9559,7 +9810,6 @@ dependencies = [ "percent-encoding", "pin-project 1.1.10", "prost", - "rustls-native-certs", "rustls-pemfile", "socket2", "tokio", @@ -9571,6 +9821,37 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9" +dependencies = [ + "async-trait", + "axum 0.8.4", + "base64 0.22.1", + "bytes", + "h2", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project 1.1.10", + "prost", + "rustls-native-certs", + "socket2", + "tokio", + "tokio-rustls", + "tokio-stream", + "tower 0.5.2", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "topological-sort" version = "0.2.2" @@ -9605,9 +9886,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", + "indexmap 2.9.0", "pin-project-lite", + "slab", "sync_wrapper", "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -9615,9 +9899,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" +checksum = "0fdb0c213ca27a9f57ab69ddb290fd80d970922355b83ae380b395d3986b8a2e" dependencies = [ "bitflags 2.9.0", "bytes", @@ -9921,9 +10205,9 @@ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-joining-type" -version = "0.7.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8cb47ccb8bc750808755af3071da4a10dcd147b68fc874b7ae4b12543f6f5" +checksum = "d8d00a78170970967fdb83f9d49b92f959ab2bb829186b113e4f4604ad98e180" [[package]] name = "unicode-linebreak" @@ -10038,7 +10322,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", "serde", ] @@ -10810,33 +11094,13 @@ dependencies = [ "is-terminal", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - [[package]] name = "zerocopy" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "zerocopy-derive 0.8.25", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", + "zerocopy-derive", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fcf9b8e7c9a45..f0c082a66b3ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ resolver = "2" version = "1.2.0" edition = "2021" # Remember to update clippy.toml as well -rust-version = "1.85" +rust-version = "1.86" authors = ["Foundry Contributors"] license = "MIT OR Apache-2.0" homepage = "https://github.com/foundry-rs/foundry" @@ -195,63 +195,65 @@ foundry-wallets = { path = "crates/wallets" } foundry-linking = { path = "crates/linking" } # solc & compilation utilities -foundry-block-explorers = { version = "0.13.3", default-features = false } -foundry-compilers = { version = "0.14.0", default-features = false } -foundry-fork-db = "0.12" +foundry-block-explorers = { version = "0.17.0", default-features = false } +foundry-compilers = { version = "0.16.1", default-features = false } +foundry-fork-db = "0.14" solang-parser = { version = "=0.3.7", package = "foundry-solang-parser" } -solar-parse = { version = "=0.1.2", default-features = false } -solar-sema = { version = "=0.1.2", default-features = false } - -## revm -revm = { version = "21.0.0", default-features = false } -revm-inspectors = { version = "0.18.1", features = ["serde"] } -op-revm = { version = "2.0.0", default-features = false } +solar-parse = { version = "=0.1.3", default-features = false } +solar-sema = { version = "=0.1.3", default-features = false } ## alloy -alloy-consensus = { version = "0.13.0", default-features = false } -alloy-contract = { version = "0.13.0", default-features = false } -alloy-eips = { version = "0.13.0", default-features = false } -alloy-genesis = { version = "0.13.0", default-features = false } -alloy-json-rpc = { version = "0.13.0", default-features = false } -alloy-network = { version = "0.13.0", default-features = false } -alloy-provider = { version = "0.13.0", default-features = false } -alloy-pubsub = { version = "0.13.0", default-features = false } -alloy-rpc-client = { version = "0.13.0", default-features = false } -alloy-rpc-types = { version = "0.13.0", default-features = true } -alloy-serde = { version = "0.13.0", default-features = false } -alloy-signer = { version = "0.13.0", default-features = false } -alloy-signer-aws = { version = "0.13.0", default-features = false } -alloy-signer-gcp = { version = "0.13.0", default-features = false } -alloy-signer-ledger = { version = "0.13.0", default-features = false } -alloy-signer-local = { version = "0.13.0", default-features = false } -alloy-signer-trezor = { version = "0.13.0", default-features = false } -alloy-transport = { version = "0.13.0", default-features = false } -alloy-transport-http = { version = "0.13.0", default-features = false } -alloy-transport-ipc = { version = "0.13.0", default-features = false } -alloy-transport-ws = { version = "0.13.0", default-features = false } +alloy-consensus = { version = "1.0.3", default-features = false } +alloy-contract = { version = "1.0.3", default-features = false } +alloy-eips = { version = "1.0.3", default-features = false } +alloy-genesis = { version = "1.0.3", default-features = false } +alloy-json-rpc = { version = "1.0.3", default-features = false } +alloy-network = { version = "1.0.3", default-features = false } +alloy-provider = { version = "1.0.3", default-features = false } +alloy-pubsub = { version = "1.0.3", default-features = false } +alloy-rpc-client = { version = "1.0.3", default-features = false } +alloy-rpc-types = { version = "1.0.3", default-features = true } +alloy-serde = { version = "1.0.3", default-features = false } +alloy-signer = { version = "1.0.3", default-features = false } +alloy-signer-aws = { version = "1.0.3", default-features = false } +alloy-signer-gcp = { version = "1.0.3", default-features = false } +alloy-signer-ledger = { version = "1.0.3", default-features = false } +alloy-signer-local = { version = "1.0.3", default-features = false } +alloy-signer-trezor = { version = "1.0.3", default-features = false } +alloy-transport = { version = "1.0.3", default-features = false } +alloy-transport-http = { version = "1.0.3", default-features = false } +alloy-transport-ipc = { version = "1.0.3", default-features = false } +alloy-transport-ws = { version = "1.0.3", default-features = false } ## alloy-core -alloy-dyn-abi = "0.8.22" -alloy-json-abi = "0.8.22" -alloy-primitives = { version = "0.8.22", features = [ +alloy-dyn-abi = "1.0" +alloy-json-abi = "1.0" +alloy-primitives = { version = "1.0", features = [ "getrandom", "rand", "map-fxhash", "map-foldhash", ] } -alloy-sol-macro-expander = "0.8.22" -alloy-sol-macro-input = "0.8.22" -alloy-sol-types = "0.8.22" +alloy-sol-macro-expander = "1.0" +alloy-sol-macro-input = "1.0" +alloy-sol-types = "1.0" -alloy-chains = "0.1" -alloy-evm = "0.3.2" -alloy-op-evm = "0.3.2" +alloy-chains = "0.2" alloy-rlp = "0.3" -alloy-trie = "0.7.0" +alloy-trie = "0.8.1" ## op-alloy -op-alloy-consensus = "0.12.0" -op-alloy-rpc-types = "0.12.0" +op-alloy-consensus = "0.16.0" +op-alloy-rpc-types = "0.16.0" + +## revm +revm = { version = "23.1.0", default-features = false } +revm-inspectors = { version = "0.22.3", features = ["serde"] } +op-revm = { version = "4.0.2", default-features = false } + +## alloy-evm +alloy-evm = "0.8.1" +alloy-op-evm = "0.8.1" ## cli anstream = "0.6" @@ -298,7 +300,9 @@ mesc = "0.3" num-format = "0.4" parking_lot = "0.12" proptest = "1" -rand = "0.8" +rand = "0.9" +rand_08 = { package = "rand", version = "0.8" } +rand_chacha = "0.9.0" rayon = "1" regex = { version = "1", default-features = false } reqwest = { version = "0.12", default-features = false, features = [ @@ -369,10 +373,14 @@ idna_adapter = "=1.1.0" # alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" } # alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" } +## alloy-evm +# alloy-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "95f6a8a" } +# alloy-op-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "95f6a8a" } + ## revm -revm = { git = "https://github.com/bluealloy/revm.git", rev = "2401c2c3" } -op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "2401c2c3" } +revm = { git = "https://github.com/bluealloy/revm.git", rev = "b5808253" } +op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "b5808253" } # revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", rev = "a625c04" } ## foundry -foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "811a61a" } +# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "811a61a" } diff --git a/clippy.toml b/clippy.toml index 86b7412b14a56..f4a551607f2fe 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,4 +1,4 @@ -msrv = "1.85" +msrv = "1.86" # `bytes::Bytes` is included by default and `alloy_primitives::Bytes` is a wrapper around it, # so it is safe to ignore it as well. diff --git a/crates/anvil/Cargo.toml b/crates/anvil/Cargo.toml index c70d1eb82c592..0b68a0e8c93de 100644 --- a/crates/anvil/Cargo.toml +++ b/crates/anvil/Cargo.toml @@ -90,6 +90,7 @@ yansi.workspace = true tempfile.workspace = true itertools.workspace = true rand.workspace = true +rand_08.workspace = true eyre.workspace = true # cli diff --git a/crates/anvil/core/src/eth/mod.rs b/crates/anvil/core/src/eth/mod.rs index ccc866d090c8e..bca300cac6cd8 100644 --- a/crates/anvil/core/src/eth/mod.rs +++ b/crates/anvil/core/src/eth/mod.rs @@ -35,7 +35,6 @@ pub struct Params { /// Represents ethereum JSON-RPC API #[derive(Clone, Debug, serde::Deserialize)] #[serde(tag = "method", content = "params")] -#[expect(clippy::large_enum_variant)] pub enum EthRequest { #[serde(rename = "web3_clientVersion", with = "empty_params")] Web3ClientVersion(()), diff --git a/crates/anvil/core/src/eth/subscription.rs b/crates/anvil/core/src/eth/subscription.rs index 80aee56b1a001..d0cada75e830b 100644 --- a/crates/anvil/core/src/eth/subscription.rs +++ b/crates/anvil/core/src/eth/subscription.rs @@ -1,6 +1,6 @@ //! Subscription types use alloy_primitives::hex; -use rand::{distributions::Alphanumeric, thread_rng, Rng}; +use rand::{distr::Alphanumeric, rng, Rng}; use std::fmt; /// Unique subscription id @@ -48,7 +48,7 @@ impl HexIdProvider { /// Generates a random hex encoded Id pub fn gen(&self) -> String { let id: String = - (&mut thread_rng()).sample_iter(Alphanumeric).map(char::from).take(self.len).collect(); + (&mut rng()).sample_iter(Alphanumeric).map(char::from).take(self.len).collect(); let out = hex::encode(id); format!("0x{out}") } diff --git a/crates/anvil/core/src/eth/transaction/mod.rs b/crates/anvil/core/src/eth/transaction/mod.rs index 85bba5504d9a0..b9fa0192cd39e 100644 --- a/crates/anvil/core/src/eth/transaction/mod.rs +++ b/crates/anvil/core/src/eth/transaction/mod.rs @@ -11,9 +11,7 @@ use alloy_consensus::{ }; use alloy_eips::eip2718::{Decodable2718, Eip2718Error, Encodable2718}; use alloy_network::{AnyReceiptEnvelope, AnyRpcTransaction, AnyTransactionReceipt, AnyTxEnvelope}; -use alloy_primitives::{ - Address, Bloom, Bytes, Log, PrimitiveSignature, TxHash, TxKind, B256, U256, U64, -}; +use alloy_primitives::{Address, Bloom, Bytes, Log, Signature, TxHash, TxKind, B256, U256, U64}; use alloy_rlp::{length_of_length, Decodable, Encodable, Header}; use alloy_rpc_types::{ request::TransactionRequest, trace::otterscan::OtsReceipt, AccessList, ConversionError, @@ -531,7 +529,8 @@ impl PendingTransaction { authorization_list, input, } = tx.tx(); - OpTransaction::new(TxEnv { + + let mut tx = TxEnv { caller, kind: TxKind::Call(*to), data: input.clone(), @@ -542,10 +541,12 @@ impl PendingTransaction { gas_priority_fee: Some(*max_priority_fee_per_gas), gas_limit: *gas_limit, access_list: access_list.clone(), - authorization_list: authorization_list.clone(), tx_type: 4, ..Default::default() - }) + }; + tx.set_signed_authorization(authorization_list.clone()); + + OpTransaction::new(tx) } TypedTransaction::Deposit(tx) => { let chain_id = tx.chain_id(); @@ -962,14 +963,14 @@ impl TypedTransaction { } /// Returns the Signature of the transaction - pub fn signature(&self) -> PrimitiveSignature { + pub fn signature(&self) -> Signature { match self { Self::Legacy(tx) => *tx.signature(), Self::EIP2930(tx) => *tx.signature(), Self::EIP1559(tx) => *tx.signature(), Self::EIP4844(tx) => *tx.signature(), Self::EIP7702(tx) => *tx.signature(), - Self::Deposit(_) => PrimitiveSignature::from_scalars_and_parity( + Self::Deposit(_) => Signature::from_scalars_and_parity( B256::with_last_byte(1), B256::with_last_byte(1), false, @@ -1521,7 +1522,7 @@ mod tests { chain_id: Some(4), }; - let signature = PrimitiveSignature::from_str("0eb96ca19e8a77102767a41fc85a36afd5c61ccb09911cec5d3e86e193d9c5ae3a456401896b1b6055311536bf00a718568c744d8c1f9df59879e8350220ca182b").unwrap(); + let signature = Signature::from_str("0eb96ca19e8a77102767a41fc85a36afd5c61ccb09911cec5d3e86e193d9c5ae3a456401896b1b6055311536bf00a718568c744d8c1f9df59879e8350220ca182b").unwrap(); let tx = TypedTransaction::Legacy(Signed::new_unchecked( tx, diff --git a/crates/anvil/src/cmd.rs b/crates/anvil/src/cmd.rs index 2968b12739786..320c975548567 100644 --- a/crates/anvil/src/cmd.rs +++ b/crates/anvil/src/cmd.rs @@ -12,7 +12,7 @@ use core::fmt; use foundry_common::shell; use foundry_config::{Chain, Config, FigmentProviders}; use futures::FutureExt; -use rand::{rngs::StdRng, SeedableRng}; +use rand_08::{rngs::StdRng, SeedableRng}; use std::{ future::Future, net::IpAddr, @@ -292,7 +292,7 @@ impl NodeArgs { if let Some(ref mnemonic) = self.mnemonic { gen = gen.phrase(mnemonic); } else if let Some(count) = self.mnemonic_random { - let mut rng = rand::thread_rng(); + let mut rng = rand_08::thread_rng(); let mnemonic = match Mnemonic::::new_with_count(&mut rng, count) { Ok(mnemonic) => mnemonic.to_phrase(), Err(_) => DEFAULT_MNEMONIC.to_string(), diff --git a/crates/anvil/src/config.rs b/crates/anvil/src/config.rs index 097618ecf8afa..668edd7ee972a 100644 --- a/crates/anvil/src/config.rs +++ b/crates/anvil/src/config.rs @@ -43,7 +43,7 @@ use foundry_evm_core::AsEnvMut; use itertools::Itertools; use op_revm::OpTransaction; use parking_lot::RwLock; -use rand::thread_rng; +use rand_08::thread_rng; use revm::{ context::{BlockEnv, CfgEnv, TxEnv}, context_interface::block::BlobExcessGasAndPrice, diff --git a/crates/anvil/src/eth/api.rs b/crates/anvil/src/eth/api.rs index 670ef2d091c08..85a6a2951a80a 100644 --- a/crates/anvil/src/eth/api.rs +++ b/crates/anvil/src/eth/api.rs @@ -41,7 +41,7 @@ use alloy_network::{ }; use alloy_primitives::{ map::{HashMap, HashSet}, - Address, Bytes, PrimitiveSignature as Signature, TxHash, TxKind, B256, B64, U256, U64, + Address, Bytes, Signature, TxHash, TxKind, B256, B64, U256, U64, }; use alloy_provider::utils::{ eip1559_default_estimator, EIP1559_FEE_ESTIMATION_PAST_BLOCKS, diff --git a/crates/anvil/src/eth/backend/executor.rs b/crates/anvil/src/eth/backend/executor.rs index 2a036489fb2ce..ccf689cf674aa 100644 --- a/crates/anvil/src/eth/backend/executor.rs +++ b/crates/anvil/src/eth/backend/executor.rs @@ -7,15 +7,15 @@ use crate::{ error::InvalidTransactionError, pool::transactions::PoolTransaction, }, - // inject_precompiles, + inject_precompiles, mem::inspector::AnvilInspector, PrecompileFactory, }; use alloy_consensus::{ constants::EMPTY_WITHDRAWALS, proofs::calculate_receipt_root, Receipt, ReceiptWithBloom, }; -use alloy_eips::eip7685::EMPTY_REQUESTS_HASH; -use alloy_evm::{eth::EthEvmContext, EthEvm, Evm}; +use alloy_eips::{eip7685::EMPTY_REQUESTS_HASH, eip7840::BlobParams}; +use alloy_evm::{eth::EthEvmContext, precompiles::PrecompilesMap, EthEvm, Evm}; use alloy_op_evm::OpEvm; use alloy_primitives::{Bloom, BloomInput, Log, B256}; use anvil_core::eth::{ @@ -25,14 +25,15 @@ use anvil_core::eth::{ }, }; use foundry_evm::{backend::DatabaseError, traces::CallTraceNode}; -use foundry_evm_core::{either_evm::EitherEvm, evm::FoundryPrecompiles}; -use op_revm::{L1BlockInfo, OpContext}; +use foundry_evm_core::either_evm::EitherEvm; +use op_revm::{precompiles::OpPrecompiles, L1BlockInfo, OpContext}; use revm::{ - context::{Block as RevmBlock, BlockEnv, CfgEnv, Evm as RevmEvm, JournalTr}, + context::{Block as RevmBlock, BlockEnv, CfgEnv, Evm as RevmEvm, JournalTr, LocalContext}, context_interface::result::{EVMError, ExecutionResult, Output}, database::WrapDatabaseRef, - handler::instructions::EthInstructions, + handler::{instructions::EthInstructions, EthPrecompiles}, interpreter::InstructionResult, + precompile::{PrecompileSpecId, Precompiles}, primitives::hardfork::SpecId, Database, DatabaseRef, Inspector, Journal, }; @@ -117,6 +118,7 @@ pub struct TransactionExecutor<'a, Db: ?Sized, V: TransactionValidator> { pub print_traces: bool, /// Precompiles to inject to the EVM. pub precompile_factory: Option>, + pub blob_params: BlobParams, } impl TransactionExecutor<'_, DB, V> { @@ -295,7 +297,7 @@ impl Iterator for &mut TransactionExec let max_blob_gas = self.blob_gas_used.saturating_add( transaction.pending_transaction.transaction.transaction.blob_gas().unwrap_or(0), ); - if max_blob_gas > alloy_eips::eip4844::MAX_DATA_GAS_PER_BLOCK { + if max_blob_gas > self.blob_params.max_blob_gas_per_block() { return Some(TransactionExecutionOutcome::BlobGasExhausted(transaction)) } @@ -324,9 +326,9 @@ impl Iterator for &mut TransactionExec let exec_result = { let mut evm = new_evm_with_inspector(&mut *self.db, &env, &mut inspector); - // if let Some(factory) = &self.precompile_factory { - // inject_precompiles(&mut evm, factory.precompiles()); - // } + if let Some(factory) = &self.precompile_factory { + inject_precompiles(&mut evm, factory.precompiles()); + } trace!(target: "backend", "[{:?}] executing", transaction.hash()); // transact and commit the transaction @@ -418,12 +420,15 @@ pub fn new_evm_with_inspector( db: DB, env: &Env, inspector: I, -) -> EitherEvm +) -> EitherEvm where DB: Database, I: Inspector> + Inspector>, { if env.is_optimism { + // TODO: we currently pin to `OpSpecId::BEDROCK` as it is primarily used in the context of + // testing deposit transactions. We should make this configurable in the future. + let op_cfg = env.evm_env.cfg_env.clone().with_spec(op_revm::OpSpecId::BEDROCK); let op_context = OpContext { journaled_state: { let mut journal = Journal::new(db); @@ -432,44 +437,53 @@ where journal }, block: env.evm_env.block_env.clone(), - cfg: env.evm_env.cfg_env.clone().with_spec(op_revm::OpSpecId::BEDROCK), + cfg: op_cfg.clone(), tx: env.tx.clone(), chain: L1BlockInfo::default(), + local: LocalContext::default(), error: Ok(()), }; - let evm = op_revm::OpEvm(RevmEvm::new_with_inspector( + let op_precompiles = OpPrecompiles::new_with_spec(op_cfg.spec).precompiles(); + let op_evm = op_revm::OpEvm(RevmEvm::new_with_inspector( op_context, inspector, EthInstructions::default(), - FoundryPrecompiles::default(), + PrecompilesMap::from_static(op_precompiles), )); - let op = OpEvm::new(evm, true); + let op = OpEvm::new(op_evm, true); EitherEvm::Op(op) } else { - let evm_context = EthEvmContext { + let spec = env.evm_env.cfg_env.spec; + let eth_context = EthEvmContext { journaled_state: { let mut journal = Journal::new(db); - journal.set_spec_id(env.evm_env.cfg_env.spec); + journal.set_spec_id(spec); journal }, block: env.evm_env.block_env.clone(), cfg: env.evm_env.cfg_env.clone(), tx: env.tx.base.clone(), chain: (), + local: LocalContext::default(), error: Ok(()), }; - let evm = RevmEvm::new_with_inspector( - evm_context, + let eth_precompiles = EthPrecompiles { + precompiles: Precompiles::new(PrecompileSpecId::from_spec_id(spec)), + spec, + } + .precompiles; + let eth_evm = RevmEvm::new_with_inspector( + eth_context, inspector, EthInstructions::default(), - FoundryPrecompiles::new(), + PrecompilesMap::from_static(eth_precompiles), ); - let eth = EthEvm::new(evm, true); + let eth = EthEvm::new(eth_evm, true); EitherEvm::Eth(eth) } @@ -480,7 +494,7 @@ pub fn new_evm_with_inspector_ref<'db, DB, I>( db: &'db DB, env: &Env, inspector: &'db mut I, -) -> EitherEvm, &'db mut I, FoundryPrecompiles> +) -> EitherEvm, &'db mut I, PrecompilesMap> where DB: DatabaseRef + 'db + ?Sized, I: Inspector>> diff --git a/crates/anvil/src/eth/backend/mem/mod.rs b/crates/anvil/src/eth/backend/mem/mod.rs index 35cbe1b19d6d2..f728d53d2e58c 100644 --- a/crates/anvil/src/eth/backend/mem/mod.rs +++ b/crates/anvil/src/eth/backend/mem/mod.rs @@ -26,14 +26,12 @@ use crate::{ sign::build_typed_transaction, util::get_precompiles_for, }, - // inject_precompiles, + inject_precompiles, mem::{ inspector::AnvilInspector, storage::{BlockchainStorage, InMemoryBlockStates, MinedBlockOutcome}, }, - ForkChoice, - NodeConfig, - PrecompileFactory, + ForkChoice, NodeConfig, PrecompileFactory, }; use alloy_chains::NamedChain; use alloy_consensus::{ @@ -48,9 +46,9 @@ use alloy_eips::{ EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, LEGACY_TX_TYPE_ID, }, - eip4844::MAX_BLOBS_PER_BLOCK, + eip7840::BlobParams, }; -use alloy_evm::{eth::EthEvmContext, Database, Evm}; +use alloy_evm::{eth::EthEvmContext, precompiles::PrecompilesMap, Database, Evm}; use alloy_network::{ AnyHeader, AnyRpcBlock, AnyRpcHeader, AnyRpcTransaction, AnyTxEnvelope, AnyTxType, EthereumWallet, UnknownTxEnvelope, UnknownTypedTransaction, @@ -101,7 +99,7 @@ use foundry_evm::{ inspectors::AccessListInspector, traces::TracingInspectorConfig, }; -use foundry_evm_core::{either_evm::EitherEvm, evm::FoundryPrecompiles}; +use foundry_evm_core::either_evm::EitherEvm; use futures::channel::mpsc::{unbounded, UnboundedSender}; use op_alloy_consensus::{TxDeposit, DEPOSIT_TX_TYPE_ID}; use op_revm::{ @@ -779,6 +777,15 @@ impl Backend { self.env.read().is_optimism } + /// Returns [`BlobParams`] corresponding to the current spec. + pub fn blob_params(&self) -> BlobParams { + if self.env.read().evm_env.cfg_env.spec >= SpecId::PRAGUE { + BlobParams::prague() + } else { + BlobParams::cancun() + } + } + /// Returns an error if EIP1559 is not active (pre Berlin) pub fn ensure_eip1559_active(&self) -> Result<(), BlockchainError> { if self.is_eip1559() { @@ -1091,7 +1098,7 @@ impl Backend { ) -> EitherEvm< WrapDatabaseRef<&'db dyn DatabaseRef>, &'db mut I, - FoundryPrecompiles, + PrecompilesMap, > where I: Inspector>>> @@ -1099,11 +1106,13 @@ impl Backend { WrapDatabaseRef<&'db dyn DatabaseRef>: Database, { - new_evm_with_inspector_ref(db, env, inspector) - // TODO(yash): inject precompiles - // if let Some(factory) = &self.precompile_factory { - // inject_precompiles(&mut evm, factory.precompiles()); - // } + let mut evm = new_evm_with_inspector_ref(db, env, inspector); + + if let Some(factory) = &self.precompile_factory { + inject_precompiles(&mut evm, factory.precompiles()); + } + + evm } /// executes the transactions without writing to the underlying database @@ -1189,6 +1198,7 @@ impl Backend { precompile_factory: self.precompile_factory.clone(), odyssey: self.odyssey, optimism: self.is_optimism(), + blob_params: self.blob_params(), }; // create a new pending block @@ -1273,6 +1283,7 @@ impl Backend { odyssey: self.odyssey, precompile_factory: self.precompile_factory.clone(), optimism: self.is_optimism(), + blob_params: self.blob_params(), }; let executed_tx = executor.execute(); @@ -1487,36 +1498,34 @@ impl Backend { let caller = from.unwrap_or_default(); let to = to.as_ref().and_then(TxKind::to); let blob_hashes = blob_versioned_hashes.unwrap_or_default(); - env.tx = OpTransaction { - base: TxEnv { - caller, - gas_limit, - gas_price, - gas_priority_fee: max_priority_fee_per_gas, - max_fee_per_blob_gas: max_fee_per_blob_gas - .or_else(|| { - if !blob_hashes.is_empty() { - env.evm_env.block_env.blob_gasprice() - } else { - Some(0) - } - }) - .unwrap_or_default(), - kind: match to { - Some(addr) => TxKind::Call(*addr), - None => TxKind::Create, - }, - tx_type, - value: value.unwrap_or_default(), - data: input.into_input().unwrap_or_default(), - chain_id: Some(chain_id.unwrap_or(self.env.read().evm_env.cfg_env.chain_id)), - access_list: access_list.unwrap_or_default(), - blob_hashes, - authorization_list: authorization_list.unwrap_or_default(), - ..Default::default() + let mut base = TxEnv { + caller, + gas_limit, + gas_price, + gas_priority_fee: max_priority_fee_per_gas, + max_fee_per_blob_gas: max_fee_per_blob_gas + .or_else(|| { + if !blob_hashes.is_empty() { + env.evm_env.block_env.blob_gasprice() + } else { + Some(0) + } + }) + .unwrap_or_default(), + kind: match to { + Some(addr) => TxKind::Call(*addr), + None => TxKind::Create, }, + tx_type, + value: value.unwrap_or_default(), + data: input.into_input().unwrap_or_default(), + chain_id: Some(chain_id.unwrap_or(self.env.read().evm_env.cfg_env.chain_id)), + access_list: access_list.unwrap_or_default(), + blob_hashes, ..Default::default() }; + base.set_signed_authorization(authorization_list.unwrap_or_default()); + env.tx = OpTransaction { base, ..Default::default() }; if let Some(nonce) = nonce { env.tx.base.nonce = nonce; @@ -1736,7 +1745,7 @@ impl Backend { .map(|tx| AnyTxEnvelope::from(tx.clone())) .collect(); let header = Header { - logs_bloom:logs_bloom(logs.iter()), + logs_bloom: logs_bloom(logs.iter()), transactions_root: calculate_transaction_root(&transactions_envelopes), receipts_root: calculate_receipt_root(&transactions_envelopes), parent_hash: Default::default(), @@ -3173,8 +3182,9 @@ impl TransactionValidator for Backend { } // Ensure the tx does not exceed the max blobs per block. - if blob_count > MAX_BLOBS_PER_BLOCK { - return Err(InvalidTransactionError::TooManyBlobs(blob_count, MAX_BLOBS_PER_BLOCK)) + let max_blob_count = self.blob_params().max_blob_count as usize; + if blob_count > max_blob_count { + return Err(InvalidTransactionError::TooManyBlobs(blob_count, max_blob_count)) } // Check for any blob validation errors if not impersonating. diff --git a/crates/anvil/src/eth/error.rs b/crates/anvil/src/eth/error.rs index f9343d520ecfa..8df6df7476c50 100644 --- a/crates/anvil/src/eth/error.rs +++ b/crates/anvil/src/eth/error.rs @@ -334,7 +334,9 @@ impl From for InvalidTransactionError { InvalidTransaction::Eip4844NotSupported | InvalidTransaction::Eip7702NotSupported | InvalidTransaction::EofCreateShouldHaveToAddress | - InvalidTransaction::EmptyAuthorizationList => Self::Revm(err), + InvalidTransaction::EmptyAuthorizationList | + InvalidTransaction::Eip7873NotSupported | + InvalidTransaction::Eip7873MissingTarget => Self::Revm(err), } } } diff --git a/crates/anvil/src/eth/fees.rs b/crates/anvil/src/eth/fees.rs index bb9272f5f41c4..acec3a29201ac 100644 --- a/crates/anvil/src/eth/fees.rs +++ b/crates/anvil/src/eth/fees.rs @@ -9,7 +9,7 @@ use std::{ use alloy_consensus::Header; use alloy_eips::{ - calc_next_block_base_fee, eip1559::BaseFeeParams, eip4844::MAX_DATA_GAS_PER_BLOCK, + calc_next_block_base_fee, eip1559::BaseFeeParams, eip7691::MAX_BLOBS_PER_BLOCK_ELECTRA, eip7840::BlobParams, }; use alloy_primitives::B256; @@ -266,7 +266,7 @@ impl FeeHistoryService { let blob_gas_used = block.header.blob_gas_used.map(|g| g as f64); item.gas_used_ratio = gas_used / block.header.gas_limit as f64; item.blob_gas_used_ratio = - blob_gas_used.map(|g| g / MAX_DATA_GAS_PER_BLOCK as f64).unwrap_or(0 as f64); + blob_gas_used.map(|g| g / MAX_BLOBS_PER_BLOCK_ELECTRA as f64).unwrap_or(0 as f64); // extract useful tx info (gas_used, effective_reward) let mut transactions: Vec<(_, _)> = receipts diff --git a/crates/anvil/src/eth/otterscan/api.rs b/crates/anvil/src/eth/otterscan/api.rs index 227a8e421a260..129329991c03b 100644 --- a/crates/anvil/src/eth/otterscan/api.rs +++ b/crates/anvil/src/eth/otterscan/api.rs @@ -73,7 +73,7 @@ pub fn batch_build_ots_traces(traces: Vec) -> Vec Vec<(Address, Precompiles)>; + fn precompiles(&self) -> Vec; } -// /// Appends a handler register to `evm` that injects the given `precompiles`. -// /// -// /// This will add an additional handler that extends the default precompiles with the given set -// of /// precompiles. -// pub fn inject_precompiles( -// evm: &mut revm::Evm<'_, I, DB>, -// precompiles: Precompiles, -// ) { -// evm.handler.append_handler_register_box(Box::new(move |handler| { -// let precompiles = precompiles.clone(); -// let prev = handler.pre_execution.load_precompiles.clone(); -// handler.pre_execution.load_precompiles = Arc::new(move || { -// let mut cx = prev(); -// cx.extend(precompiles.iter().cloned().map(|(a, b)| (a, b.into()))); -// cx -// }); -// })); -// } - -// #[cfg(test)] -// mod tests { -// use crate::{evm::inject_precompiles, PrecompileFactory}; -// use alloy_primitives::{address, Address, Bytes}; -// use revm::{ -// precompile::{PrecompileOutput, PrecompileResult, Precompiles}, -// primitives::hardfork::SpecId, -// }; - -// #[test] -// fn build_evm_with_extra_precompiles() { -// const PRECOMPILE_ADDR: Address = address!("0x0000000000000000000000000000000000000071"); - -// fn my_precompile(_bytes: &Bytes, _gas_limit: u64) -> PrecompileResult { -// Ok(PrecompileOutput { bytes: Bytes::new(), gas_used: 0 }) -// } - -// #[derive(Debug)] -// struct CustomPrecompileFactory; - -// impl PrecompileFactory for CustomPrecompileFactory { -// fn precompiles(&self) -> Vec<(Address, Precompile)> { -// vec![(PRECOMPILE_ADDR, Precompile::Standard(my_precompile))] -// } -// } - -// let db = revm::db::EmptyDB::default(); -// let env = Box::::default(); -// let spec = SpecId::default(); -// let handler_cfg = revm::primitives::HandlerCfg::new(spec); -// let inspector = revm::inspectors::NoOpInspector; -// let context = revm::Context::new(revm::EvmContext::new_with_env(db, env), inspector); -// let handler = revm::Handler::new(handler_cfg); -// let mut evm = revm::Evm::new(context, handler); -// assert!(!evm -// .handler -// .pre_execution() -// .load_precompiles() -// .addresses() -// .any(|&addr| addr == PRECOMPILE_ADDR)); - -// inject_precompiles(&mut evm, CustomPrecompileFactory.precompiles()); -// assert!(evm -// .handler -// .pre_execution() -// .load_precompiles() -// .addresses() -// .any(|&addr| addr == PRECOMPILE_ADDR)); - -// let result = evm.transact().unwrap(); -// assert!(result.result.is_success()); -// } -// } +/// Inject precompiles into the EVM dynamically. +pub fn inject_precompiles( + evm: &mut EitherEvm, + precompiles: Vec, +) where + DB: Database, + I: Inspector> + Inspector>, +{ + for p in precompiles { + evm.precompiles_mut() + .apply_precompile(p.address(), |_| Some(DynPrecompile::from(*p.precompile()))); + } +} + +#[cfg(test)] +mod tests { + use std::convert::Infallible; + + use alloy_evm::{eth::EthEvmContext, precompiles::PrecompilesMap, EthEvm, Evm, EvmEnv}; + use alloy_op_evm::OpEvm; + use alloy_primitives::{address, Address, Bytes, TxKind}; + use foundry_evm_core::either_evm::EitherEvm; + use itertools::Itertools; + use op_revm::{precompiles::OpPrecompiles, L1BlockInfo, OpContext, OpSpecId, OpTransaction}; + use revm::{ + context::{CfgEnv, Evm as RevmEvm, JournalTr, LocalContext, TxEnv}, + database::{EmptyDB, EmptyDBTyped}, + handler::{instructions::EthInstructions, EthPrecompiles}, + inspector::NoOpInspector, + interpreter::interpreter::EthInterpreter, + precompile::{ + PrecompileOutput, PrecompileResult, PrecompileSpecId, PrecompileWithAddress, + Precompiles, + }, + primitives::hardfork::SpecId, + Journal, + }; + + use crate::{inject_precompiles, PrecompileFactory}; + + // A precompile activated in the `Prague` spec. + const ETH_PRAGUE_PRECOMPILE: Address = address!("0x0000000000000000000000000000000000000011"); + + // A precompile activated in the `Fjord` spec. + const OP_FROJD_PRECOMPILE: Address = address!("0x0000000000000000000000000000000000000100"); + + // A custom precompile address and payload for testing. + const PRECOMPILE_ADDR: Address = address!("0x0000000000000000000000000000000000000071"); + const PAYLOAD: &[u8] = &[0xde, 0xad, 0xbe, 0xef]; + + #[derive(Debug)] + struct CustomPrecompileFactory; + + impl PrecompileFactory for CustomPrecompileFactory { + fn precompiles(&self) -> Vec { + vec![PrecompileWithAddress::from(( + PRECOMPILE_ADDR, + custom_echo_precompile as fn(&[u8], u64) -> PrecompileResult, + ))] + } + } + + /// Custom precompile that echoes the input data. + /// In this example it uses `0xdeadbeef` as the input data, returning it as output. + fn custom_echo_precompile(input: &[u8], _gas_limit: u64) -> PrecompileResult { + Ok(PrecompileOutput { bytes: Bytes::copy_from_slice(input), gas_used: 0 }) + } + + /// Creates a new EVM instance with the custom precompile factory. + fn create_eth_evm( + spec: SpecId, + ) -> (foundry_evm::Env, EitherEvm, NoOpInspector, PrecompilesMap>) + { + let eth_env = foundry_evm::Env { + evm_env: EvmEnv { block_env: Default::default(), cfg_env: CfgEnv::new_with_spec(spec) }, + tx: TxEnv { + kind: TxKind::Call(PRECOMPILE_ADDR), + data: PAYLOAD.into(), + ..Default::default() + }, + }; + + let eth_evm_context = EthEvmContext { + journaled_state: Journal::new(EmptyDB::default()), + block: eth_env.evm_env.block_env.clone(), + cfg: eth_env.evm_env.cfg_env.clone(), + tx: eth_env.tx.clone(), + chain: (), + local: LocalContext::default(), + error: Ok(()), + }; + + let eth_precompiles = EthPrecompiles { + precompiles: Precompiles::new(PrecompileSpecId::from_spec_id(spec)), + spec, + } + .precompiles; + let eth_evm = EitherEvm::Eth(EthEvm::new( + RevmEvm::new_with_inspector( + eth_evm_context, + NoOpInspector, + EthInstructions::>::default(), + PrecompilesMap::from_static(eth_precompiles), + ), + true, + )); + + (eth_env, eth_evm) + } + + /// Creates a new OP EVM instance with the custom precompile factory. + fn create_op_evm( + spec: SpecId, + op_spec: OpSpecId, + ) -> ( + crate::eth::backend::env::Env, + EitherEvm, NoOpInspector, PrecompilesMap>, + ) { + let op_env = crate::eth::backend::env::Env { + evm_env: EvmEnv { block_env: Default::default(), cfg_env: CfgEnv::new_with_spec(spec) }, + tx: OpTransaction:: { + base: TxEnv { + kind: TxKind::Call(PRECOMPILE_ADDR), + data: PAYLOAD.into(), + ..Default::default() + }, + ..Default::default() + }, + is_optimism: true, + }; + + let op_cfg = op_env.evm_env.cfg_env.clone().with_spec(op_spec); + let op_evm_context = OpContext { + journaled_state: { + let mut journal = Journal::new(EmptyDB::default()); + // Converting SpecId into OpSpecId + journal.set_spec_id(op_env.evm_env.cfg_env.spec); + journal + }, + block: op_env.evm_env.block_env.clone(), + cfg: op_cfg.clone(), + tx: op_env.tx.clone(), + chain: L1BlockInfo::default(), + local: LocalContext::default(), + error: Ok(()), + }; + + let op_precompiles = OpPrecompiles::new_with_spec(op_cfg.spec).precompiles(); + let op_evm = EitherEvm::Op(OpEvm::new( + op_revm::OpEvm(RevmEvm::new_with_inspector( + op_evm_context, + NoOpInspector, + EthInstructions::>::default(), + PrecompilesMap::from_static(op_precompiles), + )), + true, + )); + + (op_env, op_evm) + } + + #[test] + fn build_eth_evm_with_extra_precompiles_default_spec() { + let (env, mut evm) = create_eth_evm(SpecId::default()); + + // Check that the Prague precompile IS present when using the default spec. + assert!(evm.precompiles_mut().addresses().contains(Ð_PRAGUE_PRECOMPILE)); + + assert!(!evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + inject_precompiles(&mut evm, CustomPrecompileFactory.precompiles()); + + assert!(evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + let result = match &mut evm { + EitherEvm::Eth(eth_evm) => eth_evm.transact(env.tx).unwrap(), + _ => unreachable!(), + }; + + assert!(result.result.is_success()); + assert_eq!(result.result.output(), Some(&PAYLOAD.into())); + } + + #[test] + fn build_eth_evm_with_extra_precompiles_london_spec() { + let (env, mut evm) = create_eth_evm(SpecId::LONDON); + + // Check that the Prague precompile IS NOT present when using the London spec. + assert!(!evm.precompiles_mut().addresses().contains(Ð_PRAGUE_PRECOMPILE)); + + assert!(!evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + inject_precompiles(&mut evm, CustomPrecompileFactory.precompiles()); + + assert!(evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + let result = match &mut evm { + EitherEvm::Eth(eth_evm) => eth_evm.transact(env.tx).unwrap(), + _ => unreachable!(), + }; + + assert!(result.result.is_success()); + assert_eq!(result.result.output(), Some(&PAYLOAD.into())); + } + + #[test] + fn build_op_evm_with_extra_precompiles_default_spec() { + let (env, mut evm) = create_op_evm( + SpecId::default(), + // TODO: OpSpecId::ISTHMUS is not yet supported, fails with: `Missing operator fee + // scalar for isthmus L1 Block`. + OpSpecId::HOLOCENE, + ); + + // Check that the Fjord precompile IS present when using the default spec. + assert!(evm.precompiles_mut().addresses().contains(&OP_FROJD_PRECOMPILE)); + + // Check that the Prague precompile is NOT present when using the default spec. + assert!(!evm.precompiles_mut().addresses().contains(Ð_PRAGUE_PRECOMPILE)); + + assert!(!evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + inject_precompiles(&mut evm, CustomPrecompileFactory.precompiles()); + + assert!(evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + let result = match &mut evm { + EitherEvm::Op(op_evm) => op_evm.transact(env.tx).unwrap(), + _ => unreachable!(), + }; + + assert!(result.result.is_success()); + assert_eq!(result.result.output(), Some(&PAYLOAD.into())); + } + + #[test] + fn build_op_evm_with_extra_precompiles_bedrock_spec() { + let (env, mut evm) = create_op_evm(SpecId::default(), OpSpecId::BEDROCK); + + // Check that the Fjord precompile IS NOT present when using the `OpSpecId::BEDROCK` spec. + assert!(!evm.precompiles_mut().addresses().contains(&OP_FROJD_PRECOMPILE)); + + // Check that the Prague precompile IS NOT present when using the `OpSpecId::BEDROCK` spec. + assert!(!evm.precompiles_mut().addresses().contains(Ð_PRAGUE_PRECOMPILE)); + + assert!(!evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + inject_precompiles(&mut evm, CustomPrecompileFactory.precompiles()); + + assert!(evm.precompiles_mut().addresses().contains(&PRECOMPILE_ADDR)); + + let result = match &mut evm { + EitherEvm::Op(op_evm) => op_evm.transact(env.tx).unwrap(), + _ => unreachable!(), + }; + + assert!(result.result.is_success()); + assert_eq!(result.result.output(), Some(&PAYLOAD.into())); + } +} diff --git a/crates/anvil/src/lib.rs b/crates/anvil/src/lib.rs index b48ad1197569a..77e072e0aa1f2 100644 --- a/crates/anvil/src/lib.rs +++ b/crates/anvil/src/lib.rs @@ -53,8 +53,7 @@ pub use hardfork::{EthereumHardfork, OptimismHardfork}; pub mod eth; /// Evm related abstractions mod evm; -// pub use evm::{inject_precompiles, PrecompileFactory}; -pub use evm::PrecompileFactory; +pub use evm::{inject_precompiles, PrecompileFactory}; /// support for polling filters pub mod filter; diff --git a/crates/anvil/tests/it/anvil_api.rs b/crates/anvil/tests/it/anvil_api.rs index 68d4550d6bbd6..ce337714587b9 100644 --- a/crates/anvil/tests/it/anvil_api.rs +++ b/crates/anvil/tests/it/anvil_api.rs @@ -180,7 +180,7 @@ async fn can_impersonate_contract() { let res = provider.send_transaction(tx.clone()).await; res.unwrap_err(); - let greeting = greeter_contract.greet().call().await.unwrap()._0; + let greeting = greeter_contract.greet().call().await.unwrap(); assert_eq!("Hello World!", greeting); api.anvil_impersonate_account(impersonate).await.unwrap(); @@ -195,7 +195,7 @@ async fn can_impersonate_contract() { let res = provider.send_transaction(tx).await; res.unwrap_err(); - let greeting = greeter_contract.greet().call().await.unwrap()._0; + let greeting = greeter_contract.greet().call().await.unwrap(); assert_eq!("Hello World!", greeting); } @@ -430,12 +430,11 @@ async fn test_can_set_storage_bsc_fork() { let busd_contract = BUSD::new(busd_addr, &provider); - let BUSD::balanceOfReturn { _0 } = busd_contract + let balance = busd_contract .balanceOf(address!("0x0000000000000000000000000000000000000000")) .call() .await .unwrap(); - let balance = _0; assert_eq!(balance, U256::from(12345u64)); } @@ -625,20 +624,16 @@ async fn test_fork_revert_call_latest_block_timestamp() { let multicall_contract = Multicall::new(address!("0xeefba1e63905ef1d7acba5a8513c70307c1ce441"), &provider); - let Multicall::getCurrentBlockTimestampReturn { timestamp } = - multicall_contract.getCurrentBlockTimestamp().call().await.unwrap(); + let timestamp = multicall_contract.getCurrentBlockTimestamp().call().await.unwrap(); assert_eq!(timestamp, U256::from(latest_block.header.timestamp)); - let Multicall::getCurrentBlockDifficultyReturn { difficulty } = - multicall_contract.getCurrentBlockDifficulty().call().await.unwrap(); + let difficulty = multicall_contract.getCurrentBlockDifficulty().call().await.unwrap(); assert_eq!(difficulty, U256::from(latest_block.header.difficulty)); - let Multicall::getCurrentBlockGasLimitReturn { gaslimit } = - multicall_contract.getCurrentBlockGasLimit().call().await.unwrap(); + let gaslimit = multicall_contract.getCurrentBlockGasLimit().call().await.unwrap(); assert_eq!(gaslimit, U256::from(latest_block.header.gas_limit)); - let Multicall::getCurrentBlockCoinbaseReturn { coinbase } = - multicall_contract.getCurrentBlockCoinbase().call().await.unwrap(); + let coinbase = multicall_contract.getCurrentBlockCoinbase().call().await.unwrap(); assert_eq!(coinbase, latest_block.header.beneficiary); } @@ -754,7 +749,7 @@ async fn test_reorg() { .await .unwrap(); api.anvil_reorg(ReorgOptions { depth: 3, tx_block_pairs: vec![] }).await.unwrap(); - let value = storage.getValue().call().await.unwrap()._0; + let value = storage.getValue().call().await.unwrap(); assert_eq!("initial value".to_string(), value); api.mine_one().await; diff --git a/crates/anvil/tests/it/api.rs b/crates/anvil/tests/it/api.rs index d1b9238813d14..ce807eed6aa88 100644 --- a/crates/anvil/tests/it/api.rs +++ b/crates/anvil/tests/it/api.rs @@ -243,7 +243,7 @@ async fn can_call_on_pending_block() { let block_number = BlockNumberOrTag::Number(anvil_block_number as u64); let block = api.block_by_number(block_number).await.unwrap().unwrap(); - let Multicall::getCurrentBlockTimestampReturn { timestamp: ret_timestamp, .. } = contract + let ret_timestamp = contract .getCurrentBlockTimestamp() .block(BlockId::number(anvil_block_number as u64)) .call() @@ -251,7 +251,7 @@ async fn can_call_on_pending_block() { .unwrap(); assert_eq!(block.header.timestamp, ret_timestamp.to::()); - let Multicall::getCurrentBlockGasLimitReturn { gaslimit: ret_gas_limit, .. } = contract + let ret_gas_limit = contract .getCurrentBlockGasLimit() .block(BlockId::number(anvil_block_number as u64)) .call() @@ -259,7 +259,7 @@ async fn can_call_on_pending_block() { .unwrap(); assert_eq!(block.header.gas_limit, ret_gas_limit.to::()); - let Multicall::getCurrentBlockCoinbaseReturn { coinbase: ret_coinbase, .. } = contract + let ret_coinbase = contract .getCurrentBlockCoinbase() .block(BlockId::number(anvil_block_number as u64)) .call() @@ -296,8 +296,7 @@ async fn can_call_with_undersized_max_fee_per_gas() { .from(wallet.address()) .call() .await - .unwrap() - ._0; + .unwrap(); assert_eq!(last_sender, Address::ZERO); } @@ -323,8 +322,7 @@ async fn can_call_with_state_override() { let balance = U256::from(42u64); let mut overrides = AddressHashMap::default(); overrides.insert(account, AccountOverride { balance: Some(balance), ..Default::default() }); - let result = - multicall_contract.getEthBalance(account).state(overrides).call().await.unwrap().balance; + let result = multicall_contract.getEthBalance(account).state(overrides).call().await.unwrap(); assert_eq!(result, balance); // Test the `state_diff` account override @@ -341,16 +339,16 @@ async fn can_call_with_state_override() { ); let last_sender = - simple_storage_contract.lastSender().state(HashMap::default()).call().await.unwrap()._0; + simple_storage_contract.lastSender().state(HashMap::default()).call().await.unwrap(); // No `sender` set without override assert_eq!(last_sender, Address::ZERO); let last_sender = - simple_storage_contract.lastSender().state(overrides.clone()).call().await.unwrap()._0; + simple_storage_contract.lastSender().state(overrides.clone()).call().await.unwrap(); // `sender` *is* set with override assert_eq!(last_sender, account); - let value = simple_storage_contract.getValue().state(overrides).call().await.unwrap()._0; + let value = simple_storage_contract.getValue().state(overrides).call().await.unwrap(); // `value` *is not* changed with state-diff assert_eq!(value, init_value); @@ -368,11 +366,11 @@ async fn can_call_with_state_override() { ); let last_sender = - simple_storage_contract.lastSender().state(overrides.clone()).call().await.unwrap()._0; + simple_storage_contract.lastSender().state(overrides.clone()).call().await.unwrap(); // `sender` *is* set with override assert_eq!(last_sender, account); - let value = simple_storage_contract.getValue().state(overrides).call().await.unwrap()._0; + let value = simple_storage_contract.getValue().state(overrides).call().await.unwrap(); // `value` *is* changed with state assert_eq!(value, ""); } diff --git a/crates/anvil/tests/it/eip4844.rs b/crates/anvil/tests/it/eip4844.rs index 09e58e37d51e0..633c8a01bdef0 100644 --- a/crates/anvil/tests/it/eip4844.rs +++ b/crates/anvil/tests/it/eip4844.rs @@ -1,7 +1,7 @@ use crate::utils::{http_provider, http_provider_with_signer}; use alloy_consensus::{SidecarBuilder, SimpleCoder, Transaction}; use alloy_eips::{ - eip4844::{BLOB_TX_MIN_BLOB_GASPRICE, DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK}, + eip4844::{BLOB_TX_MIN_BLOB_GASPRICE, DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK_DENCUN}, Typed2718, }; use alloy_network::{EthereumWallet, ReceiptResponse, TransactionBuilder, TransactionBuilder4844}; @@ -81,7 +81,7 @@ async fn can_send_multiple_blobs_in_one_tx() { let receipt = provider.send_transaction(tx).await.unwrap().get_receipt().await.unwrap(); - assert_eq!(receipt.blob_gas_used, Some(MAX_DATA_GAS_PER_BLOCK)); + assert_eq!(receipt.blob_gas_used, Some(MAX_DATA_GAS_PER_BLOCK_DENCUN)); assert_eq!(receipt.blob_gas_price, Some(0x1)); // 1 wei } diff --git a/crates/anvil/tests/it/fork.rs b/crates/anvil/tests/it/fork.rs index a0bc8aa05cff1..595c44ce0d0c6 100644 --- a/crates/anvil/tests/it/fork.rs +++ b/crates/anvil/tests/it/fork.rs @@ -478,12 +478,12 @@ async fn can_deploy_greeter_on_fork() { let greeter_contract = Greeter::deploy(&provider, "Hello World!".to_string()).await.unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); let greeter_contract = Greeter::deploy(&provider, "Hello World!".to_string()).await.unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -691,7 +691,7 @@ async fn test_fork_nft_set_approve_all() { let nouns = ERC721::new(nouns_addr, provider.clone()); let real_owner = nouns.ownerOf(token_id).call().await.unwrap(); - assert_eq!(real_owner._0, owner); + assert_eq!(real_owner, owner); let approval = nouns.setApprovalForAll(nouns_addr, true); let tx = TransactionRequest::default() .from(owner) @@ -704,13 +704,13 @@ async fn test_fork_nft_set_approve_all() { assert!(status); // transfer: impersonate real owner and transfer nft - api.anvil_impersonate_account(real_owner._0).await.unwrap(); + api.anvil_impersonate_account(real_owner).await.unwrap(); - api.anvil_set_balance(real_owner._0, U256::from(10000e18 as u64)).await.unwrap(); + api.anvil_set_balance(real_owner, U256::from(10000e18 as u64)).await.unwrap(); - let call = nouns.transferFrom(real_owner._0, signer, token_id); + let call = nouns.transferFrom(real_owner, signer, token_id); let tx = TransactionRequest::default() - .from(real_owner._0) + .from(real_owner) .to(nouns_addr) .with_input(call.calldata().to_owned()); let tx = WithOtherFields::new(tx); @@ -719,7 +719,7 @@ async fn test_fork_nft_set_approve_all() { assert!(status); let real_owner = nouns.ownerOf(token_id).call().await.unwrap(); - assert_eq!(real_owner._0, wallet.address()); + assert_eq!(real_owner, wallet.address()); } // @@ -1115,11 +1115,11 @@ async fn can_override_fork_chain_id() { Greeter::deploy(provider.clone(), "Hello World!".to_string()).await.unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); let greeter_contract = Greeter::deploy(provider.clone(), "Hello World!".to_string()).await.unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); let provider = handle.http_provider(); let chain_id = provider.get_chain_id().await.unwrap(); diff --git a/crates/anvil/tests/it/otterscan.rs b/crates/anvil/tests/it/otterscan.rs index eede93be15705..3809e3183e1a7 100644 --- a/crates/anvil/tests/it/otterscan.rs +++ b/crates/anvil/tests/it/otterscan.rs @@ -233,7 +233,7 @@ async fn test_call_ots_trace_transaction() { depth: 0, from: sender, to: contract_address, - value: U256::from(1337), + value: Some(U256::from(1337)), input: Contract::runCall::SELECTOR.into(), output: Bytes::new(), }, @@ -242,7 +242,7 @@ async fn test_call_ots_trace_transaction() { depth: 1, from: contract_address, to: contract_address, - value: U256::ZERO, + value: Some(U256::ZERO), input: Contract::do_staticcallCall::SELECTOR.into(), output: true.abi_encode().into(), }, @@ -251,7 +251,7 @@ async fn test_call_ots_trace_transaction() { depth: 1, from: contract_address, to: contract_address, - value: U256::ZERO, + value: Some(U256::ZERO), input: Contract::do_callCall::SELECTOR.into(), output: Bytes::new(), }, @@ -260,7 +260,7 @@ async fn test_call_ots_trace_transaction() { depth: 2, from: contract_address, to: sender, - value: U256::from(1337), + value: Some(U256::from(1337)), input: Bytes::new(), output: Bytes::new(), }, @@ -269,7 +269,7 @@ async fn test_call_ots_trace_transaction() { depth: 2, from: contract_address, to: contract_address, - value: U256::ZERO, + value: Some(U256::ZERO), input: Contract::do_delegatecallCall::SELECTOR.into(), output: Bytes::new(), }, diff --git a/crates/anvil/tests/it/pubsub.rs b/crates/anvil/tests/it/pubsub.rs index 44051401f2a78..04515d83aa02b 100644 --- a/crates/anvil/tests/it/pubsub.rs +++ b/crates/anvil/tests/it/pubsub.rs @@ -49,7 +49,7 @@ async fn test_sub_logs_legacy() { let contract = EmitLogs::new(contract_addr, provider.clone()); let val = contract.getValue().call().await.unwrap(); - assert_eq!(val._0, msg); + assert_eq!(val, msg); // subscribe to events from the contract let filter = Filter::new().address(contract.address().to_owned()); @@ -89,7 +89,7 @@ async fn test_sub_logs() { let contract = EmitLogs::new(contract_addr, provider.clone()); let val = contract.getValue().call().await.unwrap(); - assert_eq!(val._0, msg); + assert_eq!(val, msg); // subscribe to events from the contract let filter = Filter::new().address(contract.address().to_owned()); diff --git a/crates/anvil/tests/it/state.rs b/crates/anvil/tests/it/state.rs index 95bdddf57f566..fdb4c8b128679 100644 --- a/crates/anvil/tests/it/state.rs +++ b/crates/anvil/tests/it/state.rs @@ -149,12 +149,12 @@ async fn can_preserve_historical_states_between_dump_and_load() { let greeter = Greeter::new(*address, provider); let greeting_at_init = - greeter.greet().block(BlockId::number(deploy_blk_num)).call().await.unwrap()._0; + greeter.greet().block(BlockId::number(deploy_blk_num)).call().await.unwrap(); assert_eq!(greeting_at_init, "Hello"); let greeting_after_change = - greeter.greet().block(BlockId::number(change_greeting_blk_num)).call().await.unwrap()._0; + greeter.greet().block(BlockId::number(change_greeting_blk_num)).call().await.unwrap(); assert_eq!(greeting_after_change, "World!"); } diff --git a/crates/anvil/tests/it/transaction.rs b/crates/anvil/tests/it/transaction.rs index d01bfa02aa3af..43fd3498c5c9b 100644 --- a/crates/anvil/tests/it/transaction.rs +++ b/crates/anvil/tests/it/transaction.rs @@ -314,7 +314,7 @@ async fn can_deploy_greeter_http() { let greeting = alloy_greeter.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -351,7 +351,7 @@ async fn can_deploy_and_mine_manually() { let address = receipt.contract_address.unwrap(); let greeter_contract = Greeter::new(address, provider); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); let set_greeting = greeter_contract.setGreeting("Another Message".to_string()); let tx = set_greeting.send().await.unwrap(); @@ -361,7 +361,7 @@ async fn can_deploy_and_mine_manually() { let _tx = tx.get_receipt().await.unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Another Message", greeting._0); + assert_eq!("Another Message", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -410,7 +410,7 @@ async fn can_call_greeter_historic() { let greeter_contract = Greeter::new(greeter_addr, provider.clone()); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); let block_number = provider.get_block_number().await.unwrap(); @@ -424,7 +424,7 @@ async fn can_call_greeter_historic() { .unwrap(); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Another Message", greeting._0); + assert_eq!("Another Message", greeting); // min api.mine_one().await; @@ -432,7 +432,7 @@ async fn can_call_greeter_historic() { // returns previous state let greeting = greeter_contract.greet().block(BlockId::Number(block_number.into())).call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -452,7 +452,7 @@ async fn can_deploy_greeter_ws() { let greeter_contract = Greeter::new(greeter_addr, provider.clone()); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -479,41 +479,31 @@ async fn get_blocktimestamp_works() { let contract = Multicall::deploy(provider.clone()).await.unwrap(); - let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap().timestamp; + let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap(); assert!(timestamp > U256::from(1)); let latest_block = api.block_by_number(alloy_rpc_types::BlockNumberOrTag::Latest).await.unwrap().unwrap(); - let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap().timestamp; + let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap(); assert_eq!(timestamp.to::(), latest_block.header.timestamp); // repeat call same result - let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap().timestamp; + let timestamp = contract.getCurrentBlockTimestamp().call().await.unwrap(); assert_eq!(timestamp.to::(), latest_block.header.timestamp); // mock timestamp let next_timestamp = timestamp.to::() + 1337; api.evm_set_next_block_timestamp(next_timestamp).unwrap(); - let timestamp = contract - .getCurrentBlockTimestamp() - .block(BlockId::pending()) - .call() - .await - .unwrap() - .timestamp; + let timestamp = + contract.getCurrentBlockTimestamp().block(BlockId::pending()).call().await.unwrap(); assert_eq!(timestamp, U256::from(next_timestamp)); // repeat call same result - let timestamp = contract - .getCurrentBlockTimestamp() - .block(BlockId::pending()) - .call() - .await - .unwrap() - .timestamp; + let timestamp = + contract.getCurrentBlockTimestamp().block(BlockId::pending()).call().await.unwrap(); assert_eq!(timestamp, U256::from(next_timestamp)); } @@ -535,7 +525,7 @@ async fn call_past_state() { let deployed_block = provider.get_block_number().await.unwrap(); let value = contract.getValue().call().await.unwrap(); - assert_eq!(value._0, "initial value"); + assert_eq!(value, "initial value"); let gas_price = api.gas_price(); let set_tx = contract.setValue("hi".to_string()).gas_price(gas_price + 1); @@ -544,16 +534,16 @@ async fn call_past_state() { // assert new value let value = contract.getValue().call().await.unwrap(); - assert_eq!(value._0, "hi"); + assert_eq!(value, "hi"); // assert previous value let value = contract.getValue().block(BlockId::Number(deployed_block.into())).call().await.unwrap(); - assert_eq!(value._0, "initial value"); + assert_eq!(value, "initial value"); let hash = provider.get_block(BlockId::Number(1.into())).await.unwrap().unwrap().header.hash; let value = contract.getValue().block(BlockId::Hash(hash.into())).call().await.unwrap(); - assert_eq!(value._0, "initial value"); + assert_eq!(value, "initial value"); } #[tokio::test(flavor = "multi_thread")] @@ -723,7 +713,7 @@ async fn can_listen_full_pending_transaction() { api.anvil_set_auto_mine(false).await.unwrap(); let provider = alloy_provider::ProviderBuilder::new() - .on_ws(WsConnect::new(handle.ws_endpoint())) + .connect_ws(WsConnect::new(handle.ws_endpoint())) .await .unwrap(); @@ -1191,7 +1181,7 @@ async fn can_call_with_high_gas_limit() { let greeter_contract = Greeter::deploy(provider, "Hello World!".to_string()).await.unwrap(); let greeting = greeter_contract.greet().gas(60_000_000).call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } #[tokio::test(flavor = "multi_thread")] @@ -1230,7 +1220,7 @@ async fn test_reject_eip1559_pre_london() { let greeter_contract = Greeter::new(greeter_contract_addr, provider); let greeting = greeter_contract.greet().call().await.unwrap(); - assert_eq!("Hello World!", greeting._0); + assert_eq!("Hello World!", greeting); } // https://github.com/foundry-rs/foundry/issues/6931 diff --git a/crates/cast/Cargo.toml b/crates/cast/Cargo.toml index 23315bfa30f2b..1a9039d7508b6 100644 --- a/crates/cast/Cargo.toml +++ b/crates/cast/Cargo.toml @@ -58,6 +58,7 @@ eyre.workspace = true futures.workspace = true revm.workspace = true rand.workspace = true +rand_08.workspace = true rayon.workspace = true serde_json.workspace = true serde.workspace = true diff --git a/crates/cast/src/args.rs b/crates/cast/src/args.rs index 89b19eef406d8..36c8d4c89989d 100644 --- a/crates/cast/src/args.rs +++ b/crates/cast/src/args.rs @@ -215,20 +215,19 @@ pub async fn run_command(args: CastArgs) -> Result<()> { } CastSubcommand::DecodeEvent { sig, data } => { let decoded_event = if let Some(event_sig) = sig { - get_event(event_sig.as_str())?.decode_log_parts(None, &hex::decode(data)?, false)? + let event = get_event(event_sig.as_str())?; + event.decode_log_parts(core::iter::once(event.selector()), &hex::decode(data)?)? } else { let data = data.strip_prefix("0x").unwrap_or(data.as_str()); let selector = data.get(..64).unwrap_or_default(); + let selector = selector.parse()?; let identified_event = - SignaturesIdentifier::new(false)?.identify_event(selector.parse()?).await; + SignaturesIdentifier::new(false)?.identify_event(selector).await; if let Some(event) = identified_event { let _ = sh_println!("{}", event.signature()); let data = data.get(64..).unwrap_or_default(); - get_event(event.signature().as_str())?.decode_log_parts( - None, - &hex::decode(data)?, - false, - )? + get_event(event.signature().as_str())? + .decode_log_parts(core::iter::once(selector), &hex::decode(data)?)? } else { eyre::bail!("No matching event signature found for selector `{selector}`") } diff --git a/crates/cast/src/cmd/create2.rs b/crates/cast/src/cmd/create2.rs index 6cb21d1e80c77..3cab2caf0c8c9 100644 --- a/crates/cast/src/cmd/create2.rs +++ b/crates/cast/src/cmd/create2.rs @@ -184,7 +184,7 @@ impl Create2Args { if !no_random { let mut rng = match seed { Some(seed) => StdRng::from_seed(seed.0), - None => StdRng::from_entropy(), + None => StdRng::from_os_rng(), }; rng.fill_bytes(remaining); } diff --git a/crates/cast/src/cmd/send.rs b/crates/cast/src/cmd/send.rs index 7686e70a38a91..4109639db4aab 100644 --- a/crates/cast/src/cmd/send.rs +++ b/crates/cast/src/cmd/send.rs @@ -183,7 +183,7 @@ impl SendTxArgs { let wallet = EthereumWallet::from(signer); let provider = ProviderBuilder::<_, _, AnyNetwork>::default() .wallet(wallet) - .on_provider(&provider); + .connect_provider(&provider); cast_send(provider, tx, cast_async, confirmations, timeout).await } diff --git a/crates/cast/src/cmd/wallet/mod.rs b/crates/cast/src/cmd/wallet/mod.rs index 532de5eea0a37..49f421b2207fa 100644 --- a/crates/cast/src/cmd/wallet/mod.rs +++ b/crates/cast/src/cmd/wallet/mod.rs @@ -1,6 +1,6 @@ use alloy_chains::Chain; use alloy_dyn_abi::TypedData; -use alloy_primitives::{hex, Address, PrimitiveSignature as Signature, B256, U256}; +use alloy_primitives::{hex, Address, Signature, B256, U256}; use alloy_provider::Provider; use alloy_rpc_types::Authorization; use alloy_signer::{ @@ -17,7 +17,7 @@ use foundry_cli::{opts::RpcOpts, utils, utils::LoadConfig}; use foundry_common::{fs, sh_println, shell}; use foundry_config::Config; use foundry_wallets::{RawWalletOpts, WalletOpts, WalletSigner}; -use rand::thread_rng; +use rand_08::thread_rng; use serde_json::json; use std::path::Path; use yansi::Paint; diff --git a/crates/cast/src/cmd/wallet/vanity.rs b/crates/cast/src/cmd/wallet/vanity.rs index 2137feb42b31d..1c80e3165e858 100644 --- a/crates/cast/src/cmd/wallet/vanity.rs +++ b/crates/cast/src/cmd/wallet/vanity.rs @@ -221,7 +221,7 @@ pub fn wallet_generator() -> iter::Map, impl Fn(()) -> Generate /// Generates a random K-256 signing key and derives its Ethereum address. pub fn generate_wallet() -> GeneratedWallet { - let key = SigningKey::random(&mut rand::thread_rng()); + let key = SigningKey::random(&mut rand_08::thread_rng()); let address = secret_key_to_address(&key); (key, address) } diff --git a/crates/cast/src/lib.rs b/crates/cast/src/lib.rs index 7ad227e0c8ab9..104c3e9ee44cc 100644 --- a/crates/cast/src/lib.rs +++ b/crates/cast/src/lib.rs @@ -159,7 +159,7 @@ impl> Cast

{ if let Some(func) = func { // decode args into tokens - decoded = match func.abi_decode_output(res.as_ref(), false) { + decoded = match func.abi_decode_output(res.as_ref()) { Ok(decoded) => decoded, Err(err) => { // ensure the address is a contract @@ -1099,8 +1099,7 @@ impl> Cast

{ .balanceOf(owner) .block(block.unwrap_or_default()) .call() - .await? - ._0) + .await?) } } diff --git a/crates/cast/tests/cli/main.rs b/crates/cast/tests/cli/main.rs index 2d2dd5db9e4f3..a3de06e049659 100644 --- a/crates/cast/tests/cli/main.rs +++ b/crates/cast/tests/cli/main.rs @@ -55,7 +55,7 @@ Options: -j, --threads Number of threads to use. Specifying 0 defaults to the number of logical cores - [aliases: jobs] + [aliases: --jobs] -V, --version Print version @@ -2405,7 +2405,7 @@ forgetest_async!(cast_run_impersonated_tx, |_prj, cmd| { let http_endpoint = handle.http_endpoint(); - let provider = ProviderBuilder::new().on_http(http_endpoint.parse().unwrap()); + let provider = ProviderBuilder::new().connect_http(http_endpoint.parse().unwrap()); // send impersonated tx let tx = TransactionRequest::default() diff --git a/crates/cheatcodes/Cargo.toml b/crates/cheatcodes/Cargo.toml index c5a784c338dec..97eedfcc44200 100644 --- a/crates/cheatcodes/Cargo.toml +++ b/crates/cheatcodes/Cargo.toml @@ -53,6 +53,7 @@ memchr = "2.7" p256 = "0.13" ecdsa = "0.16" rand.workspace = true +rand_chacha.workspace = true revm.workspace = true revm-inspectors.workspace = true semver.workspace = true diff --git a/crates/cheatcodes/src/crypto.rs b/crates/cheatcodes/src/crypto.rs index 8ef7e96aeff3b..be6829ee3110b 100644 --- a/crates/cheatcodes/src/crypto.rs +++ b/crates/cheatcodes/src/crypto.rs @@ -217,7 +217,7 @@ fn create_wallet(private_key: &U256, label: Option<&str>, state: &mut Cheatcodes .abi_encode()) } -fn encode_full_sig(sig: alloy_primitives::PrimitiveSignature) -> Vec { +fn encode_full_sig(sig: alloy_primitives::Signature) -> Vec { // Retrieve v, r and s from signature. let v = U256::from(sig.v() as u64 + 27); let r = B256::from(sig.r()); @@ -225,7 +225,7 @@ fn encode_full_sig(sig: alloy_primitives::PrimitiveSignature) -> Vec { (v, r, s).abi_encode() } -fn encode_compact_sig(sig: alloy_primitives::PrimitiveSignature) -> Vec { +fn encode_compact_sig(sig: alloy_primitives::Signature) -> Vec { // Implement EIP-2098 compact signature. let r = B256::from(sig.r()); let mut vs = sig.s(); @@ -233,7 +233,7 @@ fn encode_compact_sig(sig: alloy_primitives::PrimitiveSignature) -> Vec { (r, vs).abi_encode() } -fn sign(private_key: &U256, digest: &B256) -> Result { +fn sign(private_key: &U256, digest: &B256) -> Result { // The `ecrecover` precompile does not use EIP-155. No chain ID is needed. let wallet = parse_wallet(private_key)?; let sig = wallet.sign_hash_sync(digest)?; @@ -245,7 +245,7 @@ fn sign_with_wallet( state: &mut Cheatcodes, signer: Option

, digest: &B256, -) -> Result { +) -> Result { if state.wallets().is_empty() { bail!("no wallets available"); } diff --git a/crates/cheatcodes/src/evm.rs b/crates/cheatcodes/src/evm.rs index 456c4337e4bff..573ba31f939e7 100644 --- a/crates/cheatcodes/src/evm.rs +++ b/crates/cheatcodes/src/evm.rs @@ -191,7 +191,7 @@ impl Cheatcode for loadCall { if ccx.state.has_arbitrary_storage(&target) { // If storage slot is untouched and load from a target with arbitrary storage, // then set random value for current slot. - let rand_value = ccx.state.rng().gen(); + let rand_value = ccx.state.rng().random(); ccx.state.arbitrary_storage.as_mut().unwrap().save( ccx.ecx, target, @@ -203,7 +203,7 @@ impl Cheatcode for loadCall { // If storage slot is untouched and load from a target that copies storage from // a source address with arbitrary storage, then copy existing arbitrary value. // If no arbitrary value generated yet, then the random one is saved and set. - let rand_value = ccx.state.rng().gen(); + let rand_value = ccx.state.rng().random(); val.data = ccx.state.arbitrary_storage.as_mut().unwrap().copy( ccx.ecx, target, diff --git a/crates/cheatcodes/src/evm/mapping.rs b/crates/cheatcodes/src/evm/mapping.rs index 569d0e0cb7724..29c12d6d3113c 100644 --- a/crates/cheatcodes/src/evm/mapping.rs +++ b/crates/cheatcodes/src/evm/mapping.rs @@ -7,10 +7,7 @@ use alloy_primitives::{ use alloy_sol_types::SolValue; use revm::{ bytecode::opcode, - interpreter::{ - interpreter_types::{Jumps, MemoryTr}, - Interpreter, - }, + interpreter::{interpreter_types::Jumps, Interpreter}, }; /// Recorded mapping slots. diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index e940300b43b25..1dc9025a3a4c4 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -46,11 +46,12 @@ use foundry_evm_traces::{TracingInspector, TracingInspectorConfig}; use foundry_wallets::multi_wallet::MultiWallet; use itertools::Itertools; use proptest::test_runner::{RngAlgorithm, TestRng, TestRunner}; -use rand::Rng; +use rand::{Rng, SeedableRng}; +use rand_chacha::ChaChaRng; use revm::{ self, bytecode::{opcode as op, EOF_MAGIC_BYTES}, - context::{result::EVMError, BlockEnv, JournalTr}, + context::{result::EVMError, BlockEnv, JournalTr, LocalContext, TransactionType}, context_interface::{transaction::SignedAuthorization, CreateScheme}, handler::FrameResult, interpreter::{ @@ -95,10 +96,10 @@ pub trait CheatcodesExecutor { ccx: &mut CheatsCtxt, ) -> Result> { with_evm(self, ccx, |evm| { - evm.inner.data.ctx.journaled_state.depth += 1; + evm.inner.ctx.journaled_state.depth += 1; // Handle EOF bytecode - let frame = if evm.inner.data.ctx.cfg.spec.is_enabled_in(SpecId::OSAKA) && + let frame = if evm.inner.ctx.cfg.spec.is_enabled_in(SpecId::OSAKA) && inputs.scheme == CreateScheme::Create && inputs.init_code.starts_with(&EOF_MAGIC_BYTES) { @@ -117,7 +118,7 @@ pub trait CheatcodesExecutor { FrameResult::Create(create) | FrameResult::EOFCreate(create) => create, }; - evm.inner.data.ctx.journaled_state.depth -= 1; + evm.inner.ctx.journaled_state.depth -= 1; Ok(outcome) }) @@ -156,6 +157,7 @@ where inner: ccx.ecx.journaled_state.inner.clone(), database: &mut *ccx.ecx.journaled_state.database as &mut dyn DatabaseExt, }, + local: LocalContext::default(), chain: (), error, }; @@ -164,11 +166,11 @@ where let res = f(&mut evm)?; - ccx.ecx.journaled_state.inner = evm.inner.data.ctx.journaled_state.inner; - ccx.ecx.block = evm.inner.data.ctx.block; - ccx.ecx.tx = evm.inner.data.ctx.tx; - ccx.ecx.cfg = evm.inner.data.ctx.cfg; - ccx.ecx.error = evm.inner.data.ctx.error; + ccx.ecx.journaled_state.inner = evm.inner.ctx.journaled_state.inner; + ccx.ecx.block = evm.inner.ctx.block; + ccx.ecx.tx = evm.inner.ctx.tx; + ccx.ecx.cfg = evm.inner.ctx.cfg; + ccx.ecx.error = evm.inner.ctx.error; Ok(res) } @@ -499,6 +501,9 @@ pub struct Cheatcodes { /// strategies. test_runner: Option, + /// Temp Rng since proptest hasn't been updated to rand 0.9 + rng: Option, + /// Ignored traces. pub ignored_traces: IgnoredTraces, @@ -563,6 +568,7 @@ impl Cheatcodes { arbitrary_storage: Default::default(), deprecated: Default::default(), wallets: Default::default(), + rng: Default::default(), } } @@ -591,7 +597,7 @@ impl Cheatcodes { executor: &mut dyn CheatcodesExecutor, ) -> Result { // decode the cheatcode call - let decoded = Vm::VmCalls::abi_decode(&call.input, false).map_err(|e| { + let decoded = Vm::VmCalls::abi_decode(&call.input.bytes(ecx)).map_err(|e| { if let alloy_sol_types::Error::UnknownSelector { name: _, selector } = e { let msg = format!( "unknown cheatcode with selector {selector}; \ @@ -629,6 +635,21 @@ impl Cheatcodes { } } + /// Apply EIP-2930 access list. + /// + /// If the transaction type is [TransactionType::Legacy] we need to upgrade it to + /// [TransactionType::Eip2930] in order to use access lists. Other transaction types support + /// access lists themselves. + fn apply_accesslist(&mut self, ecx: Ecx) { + if let Some(access_list) = &self.access_list { + ecx.tx.access_list = access_list.clone(); + + if ecx.tx.tx_type == TransactionType::Legacy as u8 { + ecx.tx.tx_type = TransactionType::Eip2930 as u8; + } + } + } + /// Called when there was a revert. /// /// Cleanup any previously applied cheatcodes that altered the state in such a way that revm's @@ -709,10 +730,8 @@ impl Cheatcodes { } } - // Apply EIP-2930 access lists. - if let Some(access_list) = &self.access_list { - ecx.tx.access_list = access_list.clone() - } + // Apply EIP-2930 access list + self.apply_accesslist(ecx); // Apply our broadcast if let Some(broadcast) = &self.broadcast { @@ -992,7 +1011,7 @@ impl Cheatcodes { // The calldata is at most, as big as this call's input, and if calldata.len() <= call.input.len() && // Both calldata match, taking the length of the assumed smaller one (which will have at least the selector), and - *calldata == call.input[..calldata.len()] && + *calldata == call.input.bytes(ecx)[..calldata.len()] && // The value matches, if provided expected .value.is_none_or(|value| Some(value) == call.transfer_value()) && @@ -1008,19 +1027,25 @@ impl Cheatcodes { // Handle mocked calls if let Some(mocks) = self.mocked_calls.get_mut(&call.bytecode_address) { - let ctx = - MockCallDataContext { calldata: call.input.clone(), value: call.transfer_value() }; - - if let Some(return_data_queue) = match mocks.get_mut(&ctx) { - Some(queue) => Some(queue), - None => mocks - .iter_mut() - .find(|(mock, _)| { - call.input.get(..mock.calldata.len()) == Some(&mock.calldata[..]) && - mock.value.is_none_or(|value| Some(value) == call.transfer_value()) - }) - .map(|(_, v)| v), - } { + let ctx = MockCallDataContext { + calldata: call.input.bytes(ecx), + value: call.transfer_value(), + }; + + if let Some(return_data_queue) = + match mocks.get_mut(&ctx) { + Some(queue) => Some(queue), + None => mocks + .iter_mut() + .find(|(mock, _)| { + call.input.bytes(ecx).get(..mock.calldata.len()) == + Some(&mock.calldata[..]) && + mock.value + .is_none_or(|value| Some(value) == call.transfer_value()) + }) + .map(|(_, v)| v), + } + { if let Some(return_data) = if return_data_queue.len() == 1 { // If the mocked calls stack has a single element in it, don't empty it return_data_queue.front().map(|x| x.to_owned()) @@ -1077,10 +1102,8 @@ impl Cheatcodes { } } - // Apply EIP-2930 access lists. - if let Some(access_list) = &self.access_list { - ecx.tx.access_list = access_list.clone() - } + // Apply EIP-2930 access list + self.apply_accesslist(ecx); // Apply our broadcast if let Some(broadcast) = &self.broadcast { @@ -1113,6 +1136,8 @@ impl Cheatcodes { let is_fixed_gas_limit = check_if_fixed_gas_limit(&ecx, call.gas_limit); + let input = TransactionInput::new(call.input.bytes(ecx)); + let account = ecx.journaled_state.inner.state().get_mut(&broadcast.new_origin).unwrap(); @@ -1120,7 +1145,7 @@ impl Cheatcodes { from: Some(broadcast.new_origin), to: Some(TxKind::from(Some(call.target_address))), value: call.transfer_value(), - input: TransactionInput::new(call.input.clone()), + input, nonce: Some(account.info.nonce), chain_id: Some(ecx.cfg.chain_id), gas: if is_fixed_gas_limit { Some(call.gas_limit) } else { None }, @@ -1222,7 +1247,7 @@ impl Cheatcodes { oldBalance: old_balance, newBalance: U256::ZERO, // updated on call_end value: call.call_value(), - data: call.input.clone(), + data: call.input.bytes(ecx), reverted: false, deployedCode: Bytes::new(), storageAccesses: vec![], // updated on step @@ -1238,7 +1263,12 @@ impl Cheatcodes { } pub fn rng(&mut self) -> &mut impl Rng { - self.test_runner().rng() + // Prop test uses rand 8 whereas alloy-core has been bumped to rand 9 + // self.test_runner().rng() + self.rng.get_or_insert_with(|| match self.config.seed { + Some(seed) => ChaChaRng::from_seed(seed.to_be_bytes::<32>()), + None => ChaChaRng::from_os_rng(), + }) } pub fn test_runner(&mut self) -> &mut TestRunner { @@ -1924,7 +1954,7 @@ impl Cheatcodes { self.should_overwrite_arbitrary_storage(&target_address, key) { if self.has_arbitrary_storage(&target_address) { - let arbitrary_value = self.rng().gen(); + let arbitrary_value = self.rng().random(); self.arbitrary_storage.as_mut().unwrap().save( ecx, target_address, @@ -1932,7 +1962,7 @@ impl Cheatcodes { arbitrary_value, ); } else if self.is_arbitrary_storage_copy(&target_address) { - let arbitrary_value = self.rng().gen(); + let arbitrary_value = self.rng().random(); self.arbitrary_storage.as_mut().unwrap().copy( ecx, target_address, diff --git a/crates/cheatcodes/src/inspector/utils.rs b/crates/cheatcodes/src/inspector/utils.rs index bd71b2b18622f..c82f9023fafd4 100644 --- a/crates/cheatcodes/src/inspector/utils.rs +++ b/crates/cheatcodes/src/inspector/utils.rs @@ -39,6 +39,7 @@ impl CommonCreateInput for &mut CreateInputs { let kind = match scheme { CreateScheme::Create => "create", CreateScheme::Create2 { .. } => "create2", + CreateScheme::Custom { .. } => "custom", }; debug!(target: "cheatcodes", tx=?cheatcode.broadcastable_transactions.back().unwrap(), "broadcastable {kind}"); } diff --git a/crates/cheatcodes/src/test/expect.rs b/crates/cheatcodes/src/test/expect.rs index 73748458c69c9..1917331de54de 100644 --- a/crates/cheatcodes/src/test/expect.rs +++ b/crates/cheatcodes/src/test/expect.rs @@ -140,6 +140,7 @@ impl From for CreateScheme { match scheme { revm::context_interface::CreateScheme::Create => Self::Create, revm::context_interface::CreateScheme::Create2 { .. } => Self::Create2, + _ => unimplemented!("Unsupported create scheme"), } } } diff --git a/crates/cheatcodes/src/test/revert_handlers.rs b/crates/cheatcodes/src/test/revert_handlers.rs index 2dfd4b014fa6f..92026b9a86697 100644 --- a/crates/cheatcodes/src/test/revert_handlers.rs +++ b/crates/cheatcodes/src/test/revert_handlers.rs @@ -23,7 +23,7 @@ static DUMMY_CALL_OUTPUT: Bytes = Bytes::from_static(&[0u8; 8192]); const DUMMY_CREATE_ADDRESS: Address = address!("0x0000000000000000000000000000000000000001"); fn stringify(data: &[u8]) -> String { - if let Ok(s) = String::abi_decode(data, true) { + if let Ok(s) = String::abi_decode(data) { return s; } if data.is_ascii() { @@ -240,7 +240,7 @@ fn decode_revert(revert: Vec) -> Vec { revert.get(..4).map(|s| s.try_into().unwrap()), Some(Vm::CheatcodeError::SELECTOR | alloy_sol_types::Revert::SELECTOR) ) { - if let Ok(decoded) = Vec::::abi_decode(&revert[4..], false) { + if let Ok(decoded) = Vec::::abi_decode(&revert[4..]) { return decoded; } } diff --git a/crates/cheatcodes/src/utils.rs b/crates/cheatcodes/src/utils.rs index 97b5c7ecd213a..e8ddcec78aea6 100644 --- a/crates/cheatcodes/src/utils.rs +++ b/crates/cheatcodes/src/utils.rs @@ -116,7 +116,7 @@ impl Cheatcode for randomInt_1Call { impl Cheatcode for randomBoolCall { fn apply(&self, state: &mut Cheatcodes) -> Result { - let rand_bool: bool = state.rng().gen(); + let rand_bool: bool = state.rng().random(); Ok(rand_bool.abi_encode()) } } @@ -287,7 +287,7 @@ fn random_uint(state: &mut Cheatcodes, bits: Option, bounds: Option<(U256, ensure!(min <= max, "min must be less than or equal to max"); // Generate random between range min..=max let exclusive_modulo = max - min; - let mut random_number: U256 = state.rng().gen(); + let mut random_number: U256 = state.rng().random(); if exclusive_modulo != U256::MAX { let inclusive_modulo = exclusive_modulo + U256::from(1); random_number %= inclusive_modulo; diff --git a/crates/common/fmt/src/eof.rs b/crates/common/fmt/src/eof.rs index 692d745ebdd29..a9f47d8083b5e 100644 --- a/crates/common/fmt/src/eof.rs +++ b/crates/common/fmt/src/eof.rs @@ -1,8 +1,6 @@ use alloy_primitives::hex; use comfy_table::{modifiers::UTF8_ROUND_CORNERS, ContentArrangement, Table}; -use revm::bytecode::{ - Eof, -}; +use revm::bytecode::Eof; use std::fmt::{self, Write}; pub fn pretty_eof(eof: &Eof) -> Result { @@ -49,7 +47,7 @@ pub fn pretty_eof(eof: &Eof) -> Result { &idx.to_string(), &type_section.inputs.to_string(), &type_section.outputs.to_string(), - &type_section.max_stack_size.to_string(), + &type_section.max_stack_increase.to_string(), &hex::encode_prefixed(body.code(idx).unwrap_or_default()), ]); } diff --git a/crates/common/src/abi.rs b/crates/common/src/abi.rs index 28824925cacda..cdba532d842dd 100644 --- a/crates/common/src/abi.rs +++ b/crates/common/src/abi.rs @@ -63,11 +63,8 @@ pub fn abi_decode_calldata( calldata = &calldata[4..]; } - let res = if input { - func.abi_decode_input(calldata, false) - } else { - func.abi_decode_output(calldata, false) - }?; + let res = + if input { func.abi_decode_input(calldata) } else { func.abi_decode_output(calldata) }?; // in case the decoding worked but nothing was decoded if res.is_empty() { @@ -219,7 +216,7 @@ mod tests { assert_eq!(event.inputs.len(), 3); // Only the address fields get indexed since total_params > num_indexed_params - let parsed = event.decode_log(&log, false).unwrap(); + let parsed = event.decode_log(&log).unwrap(); assert_eq!(event.inputs.iter().filter(|param| param.indexed).count(), 2); assert_eq!(parsed.indexed[0], DynSolValue::Address(Address::from_word(param0))); @@ -244,7 +241,7 @@ mod tests { // All parameters get indexed since num_indexed_params == total_params assert_eq!(event.inputs.iter().filter(|param| param.indexed).count(), 3); - let parsed = event.decode_log(&log, false).unwrap(); + let parsed = event.decode_log(&log).unwrap(); assert_eq!(parsed.indexed[0], DynSolValue::Address(Address::from_word(param0))); assert_eq!(parsed.indexed[1], DynSolValue::Uint(U256::from_be_bytes([3; 32]), 256)); diff --git a/crates/common/src/constants.rs b/crates/common/src/constants.rs index ab94aad05a84e..b8fcdc7f6fd44 100644 --- a/crates/common/src/constants.rs +++ b/crates/common/src/constants.rs @@ -2,7 +2,7 @@ use alloy_consensus::Typed2718; use alloy_network::AnyTxEnvelope; -use alloy_primitives::{address, Address, PrimitiveSignature, B256}; +use alloy_primitives::{address, Address, Signature, B256}; use std::time::Duration; /// The dev chain-id, inherited from hardhat @@ -62,12 +62,9 @@ pub fn is_impersonated_tx(tx: &AnyTxEnvelope) -> bool { false } -pub fn is_impersonated_sig(sig: &PrimitiveSignature, ty: u8) -> bool { - let impersonated_sig = PrimitiveSignature::from_scalars_and_parity( - B256::with_last_byte(1), - B256::with_last_byte(1), - false, - ); +pub fn is_impersonated_sig(sig: &Signature, ty: u8) -> bool { + let impersonated_sig = + Signature::from_scalars_and_parity(B256::with_last_byte(1), B256::with_last_byte(1), false); if ty != SYSTEM_TRANSACTION_TYPE && sig == &impersonated_sig { return true; } diff --git a/crates/common/src/contracts.rs b/crates/common/src/contracts.rs index f0b30724edf2e..86556f7194402 100644 --- a/crates/common/src/contracts.rs +++ b/crates/common/src/contracts.rs @@ -149,7 +149,7 @@ impl ContractsByArtifact { // Try to decode ctor args with contract abi. if let Some(constructor) = contract.abi.constructor() { let constructor_args = &code[deployed_bytecode.len()..]; - if constructor.abi_decode_input(constructor_args, false).is_ok() { + if constructor.abi_decode_input(constructor_args).is_ok() { // If we can decode args with current abi then remove args from // code to compare. code = &code[..deployed_bytecode.len()] diff --git a/crates/common/src/ens.rs b/crates/common/src/ens.rs index 9d19ac258cd23..6a5d0630cbc27 100644 --- a/crates/common/src/ens.rs +++ b/crates/common/src/ens.rs @@ -116,21 +116,16 @@ pub trait ProviderEnsExt> { &self, node: B256, error_name: &str, - ) -> Result, EnsError>; + ) -> Result, EnsError>; /// Performs a forward lookup of an ENS name to an address. async fn resolve_name(&self, name: &str) -> Result { let node = namehash(name); let resolver = self.get_resolver(node, name).await?; - let addr = resolver - .addr(node) - .call() - .await - .map_err(EnsError::Resolve) - .inspect_err(|e| { + let addr = + resolver.addr(node).call().await.map_err(EnsError::Resolve).inspect_err(|e| { let _ = sh_eprintln!("{e:?}"); - })? - ._0; + })?; Ok(addr) } @@ -139,7 +134,7 @@ pub trait ProviderEnsExt> { let name = reverse_address(address); let node = namehash(&name); let resolver = self.get_resolver(node, &name).await?; - let name = resolver.name(node).call().await.map_err(EnsError::Lookup)?._0; + let name = resolver.name(node).call().await.map_err(EnsError::Lookup)?; Ok(name) } } @@ -154,9 +149,9 @@ where &self, node: B256, error_name: &str, - ) -> Result, EnsError> { + ) -> Result, EnsError> { let registry = EnsRegistry::new(ENS_ADDRESS, self); - let address = registry.resolver(node).call().await.map_err(EnsError::Resolver)?._0; + let address = registry.resolver(node).call().await.map_err(EnsError::Resolver)?; if address == Address::ZERO { return Err(EnsError::ResolverNotFound(error_name.to_string())); } diff --git a/crates/common/src/preprocessor/deps.rs b/crates/common/src/preprocessor/deps.rs index 5fd3fd6ee64b6..1348a1928e60e 100644 --- a/crates/common/src/preprocessor/deps.rs +++ b/crates/common/src/preprocessor/deps.rs @@ -219,14 +219,14 @@ impl<'hir> Visit<'hir> for BytecodeDependencyCollector<'hir> { fn visit_stmt(&mut self, stmt: &'hir Stmt<'hir>) -> ControlFlow { if let StmtKind::Try(stmt_try) = stmt.kind { - if let ExprKind::Call(call_expr, call_args, named_args) = stmt_try.expr.kind { + if let ExprKind::Call(call_expr, call_args, named_args) = &stmt_try.expr.kind { if let Some(dependency) = handle_call_expr( self.src, self.source_map, &stmt_try.expr, call_expr, - &call_args, - &named_args, + call_args, + named_args, true, ) { self.collect_dependency(dependency); @@ -266,7 +266,7 @@ fn handle_call_expr( // `new Counter {value: 333} ( address(this))` // the offset will be used to replace `{value: 333} ( ` with `(` let call_args_offset = if named_args.is_some() && !call_args.is_empty() { - (call_args.span().lo() - ty_new.span.hi()).to_usize() + (call_args.span.lo() - ty_new.span.hi()).to_usize() } else { 0 }; @@ -378,9 +378,6 @@ pub(crate) fn remove_bytecode_dependencies( "_args: encodeArgs{id}(DeployHelper{id}.FoundryPpConstructorArgs", id = dep.referenced_contract.get() )); - if *call_args_offset > 0 { - update.push('('); - } updates.insert((dep.loc.start, dep.loc.end + call_args_offset, update)); updates.insert(( diff --git a/crates/common/src/provider/mod.rs b/crates/common/src/provider/mod.rs index 6c2d561ba0c1f..0603b91f97d2d 100644 --- a/crates/common/src/provider/mod.rs +++ b/crates/common/src/provider/mod.rs @@ -280,7 +280,7 @@ impl ProviderBuilder { } let provider = AlloyProviderBuilder::<_, _, AnyNetwork>::default() - .on_provider(RootProvider::new(client)); + .connect_provider(RootProvider::new(client)); Ok(provider) } @@ -323,7 +323,7 @@ impl ProviderBuilder { let provider = AlloyProviderBuilder::<_, _, AnyNetwork>::default() .with_recommended_fillers() .wallet(wallet) - .on_provider(RootProvider::new(client)); + .connect_provider(RootProvider::new(client)); Ok(provider) } diff --git a/crates/common/src/provider/runtime_transport.rs b/crates/common/src/provider/runtime_transport.rs index d5e98afa57766..f4c5e789dd137 100644 --- a/crates/common/src/provider/runtime_transport.rs +++ b/crates/common/src/provider/runtime_transport.rs @@ -198,11 +198,15 @@ impl RuntimeTransport { /// Connects to a WS transport. async fn connect_ws(&self) -> Result { let auth = self.jwt.as_ref().and_then(|jwt| build_auth(jwt.clone()).ok()); - let ws = WsConnect { url: self.url.to_string(), auth, config: None } + let mut ws = WsConnect::new(self.url.to_string()); + if let Some(auth) = auth { + ws = ws.with_auth(auth); + }; + let service = ws .into_service() .await .map_err(|e| RuntimeTransportError::TransportError(e, self.url.to_string()))?; - Ok(InnerTransport::Ws(ws)) + Ok(InnerTransport::Ws(service)) } /// Connects to an IPC transport. diff --git a/crates/evm/core/src/backend/mod.rs b/crates/evm/core/src/backend/mod.rs index 49716cd38c84a..69cfa8962b3ff 100644 --- a/crates/evm/core/src/backend/mod.rs +++ b/crates/evm/core/src/backend/mod.rs @@ -8,6 +8,7 @@ use crate::{ utils::{configure_tx_env, configure_tx_req_env}, AsEnvMut, Env, EnvMut, InspectorExt, }; +use alloy_consensus::Typed2718; use alloy_evm::Evm; use alloy_genesis::GenesisAccount; use alloy_network::{AnyRpcBlock, AnyTxEnvelope, TransactionResponse}; @@ -884,8 +885,8 @@ impl Backend { for tx in full_block.inner.transactions.txns() { // System transactions such as on L2s don't contain any pricing info so we skip them // otherwise this would cause reverts - if is_known_system_sender(tx.from()) || - tx.transaction_type() == Some(SYSTEM_TRANSACTION_TYPE) + if is_known_system_sender(tx.inner().inner.signer()) || + tx.ty() == SYSTEM_TRANSACTION_TYPE { trace!(tx=?tx.tx_hash(), "skipping system transaction"); continue; @@ -1268,7 +1269,7 @@ impl DatabaseExt for Backend { let fork = self.inner.get_fork_by_id_mut(id)?; commit_transaction( - &tx, + &tx.inner, &mut env.as_env_mut(), journaled_state, fork, @@ -1854,12 +1855,6 @@ pub(crate) fn merge_account_data( merge_journaled_state_data(addr, active_journaled_state, &mut target_fork.journaled_state); } - // need to mock empty journal entries in case the current checkpoint is higher than the existing - // journal entries - while active_journaled_state.journal.len() > target_fork.journaled_state.journal.len() { - target_fork.journaled_state.journal.push(Default::default()); - } - *active_journaled_state = target_fork.journaled_state.clone(); } diff --git a/crates/evm/core/src/decode.rs b/crates/evm/core/src/decode.rs index 7c8a03da3e300..c3dab88f49cd5 100644 --- a/crates/evm/core/src/decode.rs +++ b/crates/evm/core/src/decode.rs @@ -55,7 +55,7 @@ pub fn decode_console_logs(logs: &[Log]) -> Vec { /// This function returns [None] if it is not a DSTest log or the result of a Hardhat /// `console.log`. pub fn decode_console_log(log: &Log) -> Option { - console::ds::ConsoleEvents::decode_log(log, false).ok().map(|decoded| decoded.to_string()) + console::ds::ConsoleEvents::decode_log(log).ok().map(|decoded| decoded.to_string()) } /// Decodes revert data. @@ -151,7 +151,7 @@ impl RevertDecoder { } // Solidity's `Panic(uint256)` and `Vm`'s custom errors. - if let Ok(e) = alloy_sol_types::ContractError::::abi_decode(err, false) { + if let Ok(e) = alloy_sol_types::ContractError::::abi_decode(err) { return Some(e.to_string()); } @@ -163,7 +163,7 @@ impl RevertDecoder { for error in errors { // If we don't decode, don't return an error, try to decode as a string // later. - if let Ok(decoded) = error.abi_decode_input(data, false) { + if let Ok(decoded) = error.abi_decode_input(data) { return Some(format!( "{}({})", error.name, @@ -211,7 +211,7 @@ impl RevertDecoder { /// Helper function that decodes provided error as an ABI encoded or an ASCII string (if not empty). fn decode_as_non_empty_string(err: &[u8]) -> Option { // ABI-encoded `string`. - if let Ok(s) = String::abi_decode(err, true) { + if let Ok(s) = String::abi_decode(err) { if !s.is_empty() { return Some(s); } @@ -272,7 +272,7 @@ mod tests { "0xe17594de" "756688fe00000000000000000000000000000000000000000000000000000000" ); - assert_eq!(decoder.decode(data, None), "ValidationFailed(0x)"); + assert_eq!(decoder.decode(data, None), "custom error 0xe17594de: 756688fe00000000000000000000000000000000000000000000000000000000"); /* abi.encodeWithSelector(ValidationFailed.selector, abi.encodeWithSelector(InvalidNonce.selector)) diff --git a/crates/evm/core/src/either_evm.rs b/crates/evm/core/src/either_evm.rs index 1ee289d88a162..c04a9b1678a61 100644 --- a/crates/evm/core/src/either_evm.rs +++ b/crates/evm/core/src/either_evm.rs @@ -103,8 +103,17 @@ where type Error = EVMError; type HaltReason = OpHaltReason; type Tx = OpTransaction; + type Inspector = I; + type Precompiles = P; type Spec = SpecId; + fn chain_id(&self) -> u64 { + match self { + Self::Eth(evm) => evm.chain_id(), + Self::Op(evm) => evm.chain_id(), + } + } + fn block(&self) -> &BlockEnv { match self { Self::Eth(evm) => evm.block(), @@ -142,6 +151,20 @@ where } } + fn precompiles_mut(&mut self) -> &mut Self::Precompiles { + match self { + Self::Eth(evm) => evm.precompiles_mut(), + Self::Op(evm) => evm.precompiles_mut(), + } + } + + fn inspector_mut(&mut self) -> &mut Self::Inspector { + match self { + Self::Eth(evm) => evm.inspector_mut(), + Self::Op(evm) => evm.inspector_mut(), + } + } + fn enable_inspector(&mut self) { match self { Self::Eth(evm) => evm.enable_inspector(), diff --git a/crates/evm/core/src/evm.rs b/crates/evm/core/src/evm.rs index 0f2e678b2f3ae..b5938c109f040 100644 --- a/crates/evm/core/src/evm.rs +++ b/crates/evm/core/src/evm.rs @@ -4,75 +4,29 @@ use crate::{ backend::DatabaseExt, constants::DEFAULT_CREATE2_DEPLOYER_CODEHASH, Env, InspectorExt, }; use alloy_consensus::constants::KECCAK_EMPTY; -use alloy_evm::{eth::EthEvmContext, Evm, EvmEnv}; +use alloy_evm::{eth::EthEvmContext, precompiles::PrecompilesMap, Evm, EvmEnv}; use alloy_primitives::{Address, Bytes, U256}; use foundry_fork_db::DatabaseError; use revm::{ context::{ result::{EVMError, HaltReason, ResultAndState}, - BlockEnv, CfgEnv, ContextTr, CreateScheme, Evm as RevmEvm, JournalTr, TxEnv, + BlockEnv, CfgEnv, ContextTr, CreateScheme, Evm as RevmEvm, JournalTr, LocalContext, TxEnv, }, handler::{ instructions::EthInstructions, EthFrame, EthPrecompiles, FrameInitOrResult, FrameResult, - Handler, ItemOrResult, MainnetHandler, PrecompileProvider, + Handler, ItemOrResult, MainnetHandler, }, inspector::InspectorHandler, interpreter::{ - interpreter::EthInterpreter, return_ok, CallInputs, CallOutcome, CallScheme, CallValue, - CreateInputs, CreateOutcome, FrameInput, Gas, InputsImpl, InstructionResult, + interpreter::EthInterpreter, return_ok, CallInput, CallInputs, CallOutcome, CallScheme, + CallValue, CreateInputs, CreateOutcome, FrameInput, Gas, InstructionResult, InterpreterResult, }, + precompile::{PrecompileSpecId, Precompiles}, primitives::hardfork::SpecId, Context, ExecuteEvm, Journal, }; -pub struct FoundryPrecompiles { - inner: EthPrecompiles, -} - -impl FoundryPrecompiles { - pub fn new() -> Self { - Self { inner: EthPrecompiles::default() } - } -} - -impl Default for FoundryPrecompiles { - fn default() -> Self { - Self::new() - } -} - -impl PrecompileProvider for FoundryPrecompiles { - type Output = InterpreterResult; - - /// Set the spec for the precompiles. - fn set_spec(&mut self, spec: <::Cfg as revm::context::Cfg>::Spec) -> bool { - PrecompileProvider::::set_spec(&mut self.inner, spec) - } - - /// Run the precompile. - fn run( - &mut self, - context: &mut CTX, - address: &Address, - inputs: &InputsImpl, - is_static: bool, - gas_limit: u64, - ) -> Result, String> { - self.inner.run(context, address, inputs, is_static, gas_limit) - } - - /// Get the warm addresses. - fn warm_addresses(&self) -> Box> { - self.inner.warm_addresses() - } - - /// Check if the address is a precompile. - fn contains(&self, address: &Address) -> bool { - self.inner.contains(address) - } -} - pub fn new_evm_with_inspector<'i, 'db, I: InspectorExt + ?Sized>( db: &'db mut dyn DatabaseExt, env: Env, @@ -88,15 +42,22 @@ pub fn new_evm_with_inspector<'i, 'db, I: InspectorExt + ?Sized>( cfg: env.evm_env.cfg_env, tx: env.tx, chain: (), + local: LocalContext::default(), error: Ok(()), }; + let spec = ctx.cfg.spec; + let precompiles = EthPrecompiles { + precompiles: Precompiles::new(PrecompileSpecId::from_spec_id(spec)), + spec, + } + .precompiles; FoundryEvm { inner: RevmEvm::new_with_inspector( ctx, inspector, EthInstructions::default(), - FoundryPrecompiles::default(), + PrecompilesMap::from_static(precompiles), ), } } @@ -105,12 +66,19 @@ pub fn new_evm_with_existing_context<'a>( ctx: EthEvmContext<&'a mut dyn DatabaseExt>, inspector: &'a mut dyn InspectorExt, ) -> FoundryEvm<'a, &'a mut dyn InspectorExt> { + let spec = ctx.cfg.spec; + let precompiles = EthPrecompiles { + precompiles: Precompiles::new(PrecompileSpecId::from_spec_id(spec)), + spec, + } + .precompiles; + FoundryEvm { inner: RevmEvm::new_with_inspector( ctx, inspector, EthInstructions::default(), - FoundryPrecompiles::default(), + PrecompilesMap::from_static(precompiles), ), } } @@ -127,7 +95,7 @@ fn get_create2_factory_call_inputs( target_address: deployer, scheme: CallScheme::Call, value: CallValue::Transfer(inputs.value), - input: calldata.into(), + input: CallInput::Bytes(calldata.into()), gas_limit: inputs.gas_limit, is_static: false, return_memory_offset: 0..0, @@ -141,7 +109,7 @@ pub struct FoundryEvm<'db, I: InspectorExt> { EthEvmContext<&'db mut dyn DatabaseExt>, I, EthInstructions>, - FoundryPrecompiles, + PrecompilesMap, >, } @@ -164,12 +132,18 @@ impl FoundryEvm<'_, I> { } impl<'db, I: InspectorExt> Evm for FoundryEvm<'db, I> { + type Precompiles = PrecompilesMap; + type Inspector = I; type DB = &'db mut dyn DatabaseExt; type Error = EVMError; type HaltReason = HaltReason; type Spec = SpecId; type Tx = TxEnv; + fn chain_id(&self) -> u64 { + self.inner.ctx.cfg.chain_id + } + fn block(&self) -> &BlockEnv { &self.inner.block } @@ -178,6 +152,14 @@ impl<'db, I: InspectorExt> Evm for FoundryEvm<'db, I> { self.inner.db() } + fn precompiles_mut(&mut self) -> &mut Self::Precompiles { + &mut self.inner.precompiles + } + + fn inspector_mut(&mut self) -> &mut Self::Inspector { + unimplemented!("Inspector is not mutable") + } + fn set_inspector_enabled(&mut self, _enabled: bool) { unimplemented!("FoundryEvm is always inspecting") } @@ -204,7 +186,7 @@ impl<'db, I: InspectorExt> Evm for FoundryEvm<'db, I> { where Self: Sized, { - let Context { block: block_env, cfg: cfg_env, journaled_state, .. } = self.inner.data.ctx; + let Context { block: block_env, cfg: cfg_env, journaled_state, .. } = self.inner.ctx; (journaled_state.database, EvmEnv { block_env, cfg_env }) } @@ -214,13 +196,13 @@ impl<'db, I: InspectorExt> Deref for FoundryEvm<'db, I> { type Target = Context; fn deref(&self) -> &Self::Target { - &self.inner.data.ctx + &self.inner.ctx } } impl DerefMut for FoundryEvm<'_, I> { fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner.data.ctx + &mut self.inner.ctx } } @@ -231,7 +213,7 @@ pub struct FoundryHandler<'db, I: InspectorExt> { EthEvmContext<&'db mut dyn DatabaseExt>, I, EthInstructions>, - FoundryPrecompiles, + PrecompilesMap, >, EVMError, EthFrame< @@ -239,7 +221,7 @@ pub struct FoundryHandler<'db, I: InspectorExt> { EthEvmContext<&'db mut dyn DatabaseExt>, I, EthInstructions>, - FoundryPrecompiles, + PrecompilesMap, >, EVMError, EthInterpreter, @@ -259,7 +241,7 @@ impl<'db, I: InspectorExt> Handler for FoundryHandler<'db, I> { EthEvmContext<&'db mut dyn DatabaseExt>, I, EthInstructions>, - FoundryPrecompiles, + PrecompilesMap, >; type Error = EVMError; type Frame = EthFrame< @@ -267,7 +249,7 @@ impl<'db, I: InspectorExt> Handler for FoundryHandler<'db, I> { EthEvmContext<&'db mut dyn DatabaseExt>, I, EthInstructions>, - FoundryPrecompiles, + PrecompilesMap, >, EVMError, EthInterpreter, @@ -329,14 +311,14 @@ impl InspectorHandler for FoundryHandler<'_, I> { let CreateScheme::Create2 { salt } = inputs.scheme else { return Ok(frame_or_result) }; - if !evm.data.inspector.should_use_create2_factory(&mut evm.data.ctx, inputs) { + if !evm.inspector.should_use_create2_factory(&mut evm.ctx, inputs) { return Ok(frame_or_result) } let gas_limit = inputs.gas_limit; // Get CREATE2 deployer. - let create2_deployer = evm.data.inspector.create2_deployer(); + let create2_deployer = evm.inspector.create2_deployer(); // Generate call inputs for CREATE2 factory. let call_inputs = get_create2_factory_call_inputs(salt, inputs, create2_deployer); @@ -349,7 +331,9 @@ impl InspectorHandler for FoundryHandler<'_, I> { return Ok(ItemOrResult::Result(FrameResult::Call(CallOutcome { result: InterpreterResult { result: InstructionResult::Revert, - output: format!("missing CREATE2 deployer: {create2_deployer}").into(), + output: Bytes::copy_from_slice( + format!("missing CREATE2 deployer: {create2_deployer}").as_bytes(), + ), gas: Gas::new(gas_limit), }, memory_offset: 0..0, diff --git a/crates/evm/core/src/utils.rs b/crates/evm/core/src/utils.rs index fd11ee91654a0..d12ce4d1191de 100644 --- a/crates/evm/core/src/utils.rs +++ b/crates/evm/core/src/utils.rs @@ -1,6 +1,12 @@ use alloy_consensus::BlockHeader; use alloy_json_abi::{Function, JsonAbi}; -use alloy_network::{AnyTxEnvelope, TransactionResponse}; +use alloy_network::{ + eip2718::{ + EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, + LEGACY_TX_TYPE_ID, + }, + AnyTxEnvelope, TransactionResponse, +}; use alloy_primitives::{Address, Selector, TxKind, B256, U256}; use alloy_provider::{network::BlockResponse, Network}; use alloy_rpc_types::{Transaction, TransactionRequest}; @@ -116,11 +122,27 @@ pub fn configure_tx_req_env( chain_id, ref blob_versioned_hashes, ref access_list, - transaction_type: _, + transaction_type, ref authorization_list, sidecar: _, } = *tx; + // If no transaction type is provided, we need to infer it from the other fields. + let tx_type = transaction_type.unwrap_or_else(|| { + if authorization_list.is_some() { + EIP7702_TX_TYPE_ID + } else if blob_versioned_hashes.is_some() { + EIP4844_TX_TYPE_ID + } else if max_fee_per_gas.is_some() || max_priority_fee_per_gas.is_some() { + EIP1559_TX_TYPE_ID + } else if access_list.is_some() { + EIP2930_TX_TYPE_ID + } else { + LEGACY_TX_TYPE_ID + } + }); + env.tx.tx_type = tx_type; + // If no `to` field then set create kind: https://eips.ethereum.org/EIPS/eip-2470#deployment-transaction env.tx.kind = to.unwrap_or(TxKind::Create); // If the transaction is impersonated, we need to set the caller to the from @@ -146,7 +168,7 @@ pub fn configure_tx_req_env( // Type 4, EIP-7702 if let Some(authorization_list) = authorization_list { - env.tx.authorization_list = authorization_list.clone(); + env.tx.set_signed_authorization(authorization_list.clone()); } Ok(()) diff --git a/crates/evm/evm/src/executors/fuzz/mod.rs b/crates/evm/evm/src/executors/fuzz/mod.rs index 3e132c733b1a5..a64b072193587 100644 --- a/crates/evm/evm/src/executors/fuzz/mod.rs +++ b/crates/evm/evm/src/executors/fuzz/mod.rs @@ -207,7 +207,7 @@ impl FuzzedExecutor { } else { result.reason = (!reason.is_empty()).then_some(reason); let args = if let Some(data) = calldata.get(4..) { - func.abi_decode_input(data, false).unwrap_or_default() + func.abi_decode_input(data).unwrap_or_default() } else { vec![] }; diff --git a/crates/evm/evm/src/executors/invariant/mod.rs b/crates/evm/evm/src/executors/invariant/mod.rs index bf49f6c62f2ea..4e2914ae79e04 100644 --- a/crates/evm/evm/src/executors/invariant/mod.rs +++ b/crates/evm/evm/src/executors/invariant/mod.rs @@ -598,27 +598,27 @@ impl<'a> InvariantExecutor<'a> { /// /// targetArtifactSelectors > excludeArtifacts > targetArtifacts pub fn select_contract_artifacts(&mut self, invariant_address: Address) -> Result<()> { - let result = self + let targeted_artifact_selectors = self .executor .call_sol_default(invariant_address, &IInvariantTest::targetArtifactSelectorsCall {}); // Insert them into the executor `targeted_abi`. for IInvariantTest::FuzzArtifactSelector { artifact, selectors } in - result.targetedArtifactSelectors + targeted_artifact_selectors { let identifier = self.validate_selected_contract(artifact, &selectors)?; self.artifact_filters.targeted.entry(identifier).or_default().extend(selectors); } - let selected = self + let targeted_artifacts = self .executor .call_sol_default(invariant_address, &IInvariantTest::targetArtifactsCall {}); - let excluded = self + let excluded_artifacts = self .executor .call_sol_default(invariant_address, &IInvariantTest::excludeArtifactsCall {}); // Insert `excludeArtifacts` into the executor `excluded_abi`. - for contract in excluded.excludedArtifacts { + for contract in excluded_artifacts { let identifier = self.validate_selected_contract(contract, &[])?; if !self.artifact_filters.excluded.contains(&identifier) { @@ -648,7 +648,7 @@ impl<'a> InvariantExecutor<'a> { // Insert `targetArtifacts` into the executor `targeted_abi`, if they have not been seen // before. - for contract in selected.targetedArtifacts { + for contract in targeted_artifacts { let identifier = self.validate_selected_contract(contract, &[])?; if !self.artifact_filters.targeted.contains_key(&identifier) && @@ -690,14 +690,10 @@ impl<'a> InvariantExecutor<'a> { &self, to: Address, ) -> Result<(SenderFilters, FuzzRunIdentifiedContracts)> { - let targeted_senders = self - .executor - .call_sol_default(to, &IInvariantTest::targetSendersCall {}) - .targetedSenders; - let mut excluded_senders = self - .executor - .call_sol_default(to, &IInvariantTest::excludeSendersCall {}) - .excludedSenders; + let targeted_senders = + self.executor.call_sol_default(to, &IInvariantTest::targetSendersCall {}); + let mut excluded_senders = + self.executor.call_sol_default(to, &IInvariantTest::excludeSendersCall {}); // Extend with default excluded addresses - https://github.com/foundry-rs/foundry/issues/4163 excluded_senders.extend([ CHEATCODE_ADDRESS, @@ -708,14 +704,8 @@ impl<'a> InvariantExecutor<'a> { excluded_senders.extend(PRECOMPILES); let sender_filters = SenderFilters::new(targeted_senders, excluded_senders); - let selected = self - .executor - .call_sol_default(to, &IInvariantTest::targetContractsCall {}) - .targetedContracts; - let excluded = self - .executor - .call_sol_default(to, &IInvariantTest::excludeContractsCall {}) - .excludedContracts; + let selected = self.executor.call_sol_default(to, &IInvariantTest::targetContractsCall {}); + let excluded = self.executor.call_sol_default(to, &IInvariantTest::excludeContractsCall {}); let contracts = self .setup_contracts @@ -762,8 +752,7 @@ impl<'a> InvariantExecutor<'a> { ) -> Result<()> { let interfaces = self .executor - .call_sol_default(invariant_address, &IInvariantTest::targetInterfacesCall {}) - .targetedInterfaces; + .call_sol_default(invariant_address, &IInvariantTest::targetInterfacesCall {}); // Since `targetInterfaces` returns a tuple array there is no guarantee // that the addresses are unique this map is used to merge functions of @@ -815,14 +804,14 @@ impl<'a> InvariantExecutor<'a> { // Collect contract functions marked as target for fuzzing campaign. let selectors = self.executor.call_sol_default(address, &IInvariantTest::targetSelectorsCall {}); - for IInvariantTest::FuzzSelector { addr, selectors } in selectors.targetedSelectors { + for IInvariantTest::FuzzSelector { addr, selectors } in selectors { self.add_address_with_functions(addr, &selectors, false, targeted_contracts)?; } // Collect contract functions excluded from fuzzing campaign. - let selectors = + let excluded_selectors = self.executor.call_sol_default(address, &IInvariantTest::excludeSelectorsCall {}); - for IInvariantTest::FuzzSelector { addr, selectors } in selectors.excludedSelectors { + for IInvariantTest::FuzzSelector { addr, selectors } in excluded_selectors { self.add_address_with_functions(addr, &selectors, true, targeted_contracts)?; } diff --git a/crates/evm/evm/src/executors/mod.rs b/crates/evm/evm/src/executors/mod.rs index 6ab4e3202967e..bfd57a4a0ccee 100644 --- a/crates/evm/evm/src/executors/mod.rs +++ b/crates/evm/evm/src/executors/mod.rs @@ -396,7 +396,7 @@ impl Executor { let calldata = Bytes::from(args.abi_encode()); let mut raw = self.call_raw(from, to, calldata, value)?; raw = raw.into_result(rd)?; - Ok(CallResult { decoded_result: C::abi_decode_returns(&raw.result, false)?, raw }) + Ok(CallResult { decoded_result: C::abi_decode_returns(&raw.result)?, raw }) } /// Performs a call to an account on the current state of the VM. @@ -437,7 +437,7 @@ impl Executor { authorization_list: Vec, ) -> eyre::Result { let mut env = self.build_test_env(from, to.into(), calldata, value); - env.tx.authorization_list = authorization_list; + env.tx.set_signed_authorization(authorization_list); env.tx.tx_type = 4; self.call_with_env(env) } @@ -628,7 +628,7 @@ impl Executor { let executor = self.clone_with_backend(backend); let call = executor.call_sol(CALLER, address, &ITest::failedCall {}, U256::ZERO, None); match call { - Ok(CallResult { raw: _, decoded_result: ITest::failedReturn { failed } }) => { + Ok(CallResult { raw: _, decoded_result: failed }) => { trace!(failed, "DSTest::failed()"); !failed } @@ -890,7 +890,7 @@ impl RawCallResult { rd: Option<&RevertDecoder>, ) -> Result { self = self.into_result(rd)?; - let mut result = func.abi_decode_output(&self.result, false)?; + let mut result = func.abi_decode_output(&self.result)?; let decoded_result = if result.len() == 1 { result.pop().unwrap() } else { diff --git a/crates/evm/evm/src/inspectors/chisel_state.rs b/crates/evm/evm/src/inspectors/chisel_state.rs index 33798e7b0c6a4..67ff8255a261e 100644 --- a/crates/evm/evm/src/inspectors/chisel_state.rs +++ b/crates/evm/evm/src/inspectors/chisel_state.rs @@ -39,7 +39,7 @@ where if self.final_pc == interp.bytecode.pc() - 1 { self.state = Some(( interp.stack.data().clone(), - interp.memory.borrow().context_memory().to_vec(), + interp.memory.context_memory().to_vec(), interp.control.instruction_result, )) } diff --git a/crates/evm/evm/src/inspectors/logs.rs b/crates/evm/evm/src/inspectors/logs.rs index d6aed69892b60..32af7bdbce6c8 100644 --- a/crates/evm/evm/src/inspectors/logs.rs +++ b/crates/evm/evm/src/inspectors/logs.rs @@ -25,8 +25,11 @@ pub struct LogCollector { impl LogCollector { #[cold] - fn do_hardhat_log(&mut self, inputs: &CallInputs) -> Option { - if let Err(err) = self.hardhat_log(&inputs.input) { + fn do_hardhat_log(&mut self, context: &mut CTX, inputs: &CallInputs) -> Option + where + CTX: ContextTr, Journal: JournalExt>, + { + if let Err(err) = self.hardhat_log(&inputs.input.bytes(context)) { let result = InstructionResult::Revert; let output = err.abi_encode_revert(); return Some(CallOutcome { @@ -38,7 +41,7 @@ impl LogCollector { } fn hardhat_log(&mut self, data: &[u8]) -> alloy_sol_types::Result<()> { - let decoded = console::hh::ConsoleCalls::abi_decode(data, false)?; + let decoded = console::hh::ConsoleCalls::abi_decode(data)?; self.logs.push(hh_to_ds(&decoded)); Ok(()) } @@ -54,9 +57,9 @@ where self.logs.push(log); } - fn call(&mut self, _context: &mut CTX, inputs: &mut CallInputs) -> Option { + fn call(&mut self, context: &mut CTX, inputs: &mut CallInputs) -> Option { if inputs.target_address == HARDHAT_CONSOLE_ADDRESS { - return self.do_hardhat_log(inputs); + return self.do_hardhat_log(context, inputs); } None } diff --git a/crates/evm/evm/src/inspectors/stack.rs b/crates/evm/evm/src/inspectors/stack.rs index a4bf2930c7fec..de08972d2efa5 100644 --- a/crates/evm/evm/src/inspectors/stack.rs +++ b/crates/evm/evm/src/inspectors/stack.rs @@ -863,10 +863,9 @@ impl Inspector> for InspectorStackRefMut<'_> if let Some(mocks) = cheatcodes.mocked_functions.get(&call.target_address) { // Check if any mock function set for call data or if catch-all mock function set // for selector. - if let Some(target) = mocks - .get(&call.input) - .or_else(|| call.input.get(..4).and_then(|selector| mocks.get(selector))) - { + if let Some(target) = mocks.get(&call.input.bytes(ecx)).or_else(|| { + call.input.bytes(ecx).get(..4).and_then(|selector| mocks.get(selector)) + }) { call.bytecode_address = *target; } } @@ -882,11 +881,12 @@ impl Inspector> for InspectorStackRefMut<'_> match call.scheme { // Isolate CALLs CallScheme::Call | CallScheme::ExtCall => { + let input = call.input.bytes(ecx); let (result, _) = self.transact_inner( ecx, TxKind::Call(call.target_address), call.caller, - call.input.clone(), + input, call.gas_limit, call.value.get(), ); diff --git a/crates/evm/fuzz/src/inspector.rs b/crates/evm/fuzz/src/inspector.rs index 540e3aa86968f..279f0878382ac 100644 --- a/crates/evm/fuzz/src/inspector.rs +++ b/crates/evm/fuzz/src/inspector.rs @@ -2,7 +2,7 @@ use crate::{invariant::RandomCallGenerator, strategies::EvmFuzzState}; use revm::{ context::{ContextTr, Transaction}, inspector::JournalExt, - interpreter::{CallInputs, CallOutcome, CallScheme, Interpreter}, + interpreter::{CallInput, CallInputs, CallOutcome, CallScheme, Interpreter}, Inspector, }; @@ -80,7 +80,7 @@ impl Fuzzer { { // There's only a 30% chance that an override happens. if let Some(tx) = call_generator.next(call.caller, call.target_address) { - *call.input = tx.call_details.calldata.0; + call.input = CallInput::Bytes(tx.call_details.calldata.0.into()); call.caller = tx.sender; call.target_address = tx.call_details.target; diff --git a/crates/evm/fuzz/src/lib.rs b/crates/evm/fuzz/src/lib.rs index 3486dac0b5172..bce67dfe320fa 100644 --- a/crates/evm/fuzz/src/lib.rs +++ b/crates/evm/fuzz/src/lib.rs @@ -79,7 +79,7 @@ impl BaseCounterExample { if let Some((name, abi)) = &contracts.get(&addr) { if let Some(func) = abi.functions().find(|f| f.selector() == bytes[..4]) { // skip the function selector when decoding - if let Ok(args) = func.abi_decode_input(&bytes[4..], false) { + if let Ok(args) = func.abi_decode_input(&bytes[4..]) { return Self { sender: Some(sender), addr: Some(addr), diff --git a/crates/evm/fuzz/src/strategies/int.rs b/crates/evm/fuzz/src/strategies/int.rs index 3732de0617325..53d63ce03f923 100644 --- a/crates/evm/fuzz/src/strategies/int.rs +++ b/crates/evm/fuzz/src/strategies/int.rs @@ -1,10 +1,10 @@ use alloy_dyn_abi::{DynSolType, DynSolValue}; use alloy_primitives::{Sign, I256, U256}; use proptest::{ + prelude::Rng, strategy::{NewTree, Strategy, ValueTree}, test_runner::TestRunner, }; -use rand::Rng; /// Value tree for signed ints (up to int256). pub struct IntValueTree { diff --git a/crates/evm/fuzz/src/strategies/invariants.rs b/crates/evm/fuzz/src/strategies/invariants.rs index 37c0b157c3cc2..3222529099d28 100644 --- a/crates/evm/fuzz/src/strategies/invariants.rs +++ b/crates/evm/fuzz/src/strategies/invariants.rs @@ -34,7 +34,7 @@ pub fn override_call_strat( // Choose a random contract if target selected by lazy strategy is not in fuzz run // identified contracts. This can happen when contract is created in `setUp` call // but is not included in targetContracts. - contracts.values().choose(&mut rand::thread_rng()).unwrap() + contracts.values().choose(&mut rand::rng()).unwrap() }); let fuzzed_functions: Vec<_> = contract.abi_fuzzed_functions().cloned().collect(); any::().prop_map(move |index| index.get(&fuzzed_functions).clone()) diff --git a/crates/evm/fuzz/src/strategies/state.rs b/crates/evm/fuzz/src/strategies/state.rs index 26b66807a7666..80c0c029865d2 100644 --- a/crates/evm/fuzz/src/strategies/state.rs +++ b/crates/evm/fuzz/src/strategies/state.rs @@ -179,7 +179,7 @@ impl FuzzDictionary { if let Some(function) = function { if !function.outputs.is_empty() { // Decode result and collect samples to be used in subsequent fuzz runs. - if let Ok(decoded_result) = function.abi_decode_output(result, false) { + if let Ok(decoded_result) = function.abi_decode_output(result) { self.insert_sample_values(decoded_result, run_depth); } } @@ -195,7 +195,7 @@ impl FuzzDictionary { // Try to decode log with events from contract abi. if let Some(abi) = abi { for event in abi.events() { - if let Ok(decoded_event) = event.decode_log(log, false) { + if let Ok(decoded_event) = event.decode_log(log) { samples.extend(decoded_event.indexed); samples.extend(decoded_event.body); log_decoded = true; diff --git a/crates/evm/fuzz/src/strategies/uint.rs b/crates/evm/fuzz/src/strategies/uint.rs index af133efa00826..4a9dfe955020c 100644 --- a/crates/evm/fuzz/src/strategies/uint.rs +++ b/crates/evm/fuzz/src/strategies/uint.rs @@ -1,10 +1,10 @@ use alloy_dyn_abi::{DynSolType, DynSolValue}; use alloy_primitives::U256; use proptest::{ + prelude::Rng, strategy::{NewTree, Strategy, ValueTree}, test_runner::TestRunner, }; -use rand::Rng; /// Value tree for unsigned ints (up to uint256). pub struct UintValueTree { diff --git a/crates/evm/traces/src/decoder/mod.rs b/crates/evm/traces/src/decoder/mod.rs index 2e22ca7cdc358..483ebc0b90785 100644 --- a/crates/evm/traces/src/decoder/mod.rs +++ b/crates/evm/traces/src/decoder/mod.rs @@ -409,7 +409,7 @@ impl CallTraceDecoder { } if args.is_none() { - if let Ok(v) = func.abi_decode_input(&trace.data[SELECTOR_LEN..], false) { + if let Ok(v) = func.abi_decode_input(&trace.data[SELECTOR_LEN..]) { args = Some(v.iter().map(|value| self.format_value(value)).collect()); } } @@ -445,7 +445,7 @@ impl CallTraceDecoder { } } "sign" | "signP256" => { - let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..], false).ok()?; + let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..]).ok()?; // Redact private key and replace in trace // sign(uint256,bytes32) / signP256(uint256,bytes32) / sign(Wallet,bytes32) @@ -458,7 +458,7 @@ impl CallTraceDecoder { Some(decoded.iter().map(format_token).collect()) } "signDelegation" | "signAndAttachDelegation" => { - let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..], false).ok()?; + let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..]).ok()?; // Redact private key and replace in trace for // signAndAttachDelegation(address implementation, uint256 privateKey) // signDelegation(address implementation, uint256 privateKey) @@ -495,7 +495,7 @@ impl CallTraceDecoder { if self.verbosity >= 5 { None } else { - let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..], false).ok()?; + let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..]).ok()?; let token = if func.name.as_str() == "parseJson" || // `keyExists` is being deprecated in favor of `keyExistsJson`. It will be removed in future versions. func.name.as_str() == "keyExists" || @@ -513,7 +513,7 @@ impl CallTraceDecoder { if self.verbosity >= 5 { None } else { - let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..], false).ok()?; + let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..]).ok()?; let token = if func.name.as_str() == "parseToml" || func.name.as_str() == "keyExistsToml" { @@ -528,7 +528,7 @@ impl CallTraceDecoder { "createFork" | "createSelectFork" | "rpc" => { - let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..], false).ok()?; + let mut decoded = func.abi_decode_input(&data[SELECTOR_LEN..]).ok()?; // Redact RPC URL except if referenced by an alias if !decoded.is_empty() && func.inputs[0].ty == "string" { @@ -561,7 +561,7 @@ impl CallTraceDecoder { } if let Some(values) = - funcs.iter().find_map(|func| func.abi_decode_output(&trace.output, false).ok()) + funcs.iter().find_map(|func| func.abi_decode_output(&trace.output).ok()) { // Functions coming from an external database do not have any outputs specified, // and will lead to returning an empty list of values. @@ -628,7 +628,7 @@ impl CallTraceDecoder { } }; for event in events { - if let Ok(decoded) = event.decode_log(log, false) { + if let Ok(decoded) = event.decode_log(log) { let params = reconstruct_params(event, &decoded); return DecodedCallLog { name: Some(event.name.clone()), diff --git a/crates/evm/traces/src/decoder/precompiles.rs b/crates/evm/traces/src/decoder/precompiles.rs index 508bf1e1c4320..245c70e10ec57 100644 --- a/crates/evm/traces/src/decoder/precompiles.rs +++ b/crates/evm/traces/src/decoder/precompiles.rs @@ -106,13 +106,13 @@ pub(super) fn decode(trace: &CallTrace, _chain_id: u64) -> Option alloy_sol_types::Result> { - let mut decoder = abi::Decoder::new(data, false); + let mut decoder = abi::Decoder::new(data); let b_size = decoder.take_offset()?; let e_size = decoder.take_offset()?; let m_size = decoder.take_offset()?; - let b = decoder.take_slice_unchecked(b_size)?; - let e = decoder.take_slice_unchecked(e_size)?; - let m = decoder.take_slice_unchecked(m_size)?; + let b = decoder.take_slice(b_size)?; + let e = decoder.take_slice(e_size)?; + let m = decoder.take_slice(m_size)?; Ok(vec![ b_size.to_string(), e_size.to_string(), @@ -124,7 +124,7 @@ fn decode_modexp(data: &[u8]) -> alloy_sol_types::Result> { } fn decode_ecpairing(data: &[u8]) -> alloy_sol_types::Result> { - let mut decoder = abi::Decoder::new(data, false); + let mut decoder = abi::Decoder::new(data); let mut values = Vec::new(); // input must be either empty or a multiple of 6 32-byte values let mut tmp = <[&B256; 6]>::default(); @@ -138,14 +138,14 @@ fn decode_ecpairing(data: &[u8]) -> alloy_sol_types::Result> { } fn decode_blake2f<'a>(data: &'a [u8]) -> alloy_sol_types::Result> { - let mut decoder = abi::Decoder::new(data, false); - let rounds = u32::from_be_bytes(decoder.take_slice_unchecked(4)?.try_into().unwrap()); + let mut decoder = abi::Decoder::new(data); + let rounds = u32::from_be_bytes(decoder.take_slice(4)?.try_into().unwrap()); let u64_le_list = |x: &'a [u8]| x.chunks_exact(8).map(|x| u64::from_le_bytes(x.try_into().unwrap())); - let h = u64_le_list(decoder.take_slice_unchecked(64)?); - let m = u64_le_list(decoder.take_slice_unchecked(128)?); - let t = u64_le_list(decoder.take_slice_unchecked(16)?); - let f = decoder.take_slice_unchecked(1)?[0]; + let h = u64_le_list(decoder.take_slice(64)?); + let m = u64_le_list(decoder.take_slice(128)?); + let t = u64_le_list(decoder.take_slice(16)?); + let f = decoder.take_slice(1)?[0]; Ok(vec![ rounds.to_string(), iter_to_string(h), @@ -156,12 +156,12 @@ fn decode_blake2f<'a>(data: &'a [u8]) -> alloy_sol_types::Result> { } fn decode_kzg(data: &[u8]) -> alloy_sol_types::Result> { - let mut decoder = abi::Decoder::new(data, false); + let mut decoder = abi::Decoder::new(data); let versioned_hash = decoder.take_word()?; let z = decoder.take_word()?; let y = decoder.take_word()?; - let commitment = decoder.take_slice_unchecked(48)?; - let proof = decoder.take_slice_unchecked(48)?; + let commitment = decoder.take_slice(48)?; + let proof = decoder.take_slice(48)?; Ok(vec![ versioned_hash.to_string(), z.to_string(), @@ -173,7 +173,7 @@ fn decode_kzg(data: &[u8]) -> alloy_sol_types::Result> { fn abi_decode_call(data: &[u8]) -> alloy_sol_types::Result<(&'static str, T)> { // raw because there are no selectors here - Ok((T::SIGNATURE, T::abi_decode_raw(data, false)?)) + Ok((T::SIGNATURE, T::abi_decode_raw(data)?)) } fn iter_to_string, T: std::fmt::Display>(iter: I) -> String { diff --git a/crates/evm/traces/src/identifier/local.rs b/crates/evm/traces/src/identifier/local.rs index dcd4c31bcaf9f..f0bb8cd9d7d76 100644 --- a/crates/evm/traces/src/identifier/local.rs +++ b/crates/evm/traces/src/identifier/local.rs @@ -59,7 +59,7 @@ impl<'a> LocalTraceIdentifier<'a> { // Try to decode ctor args with contract abi. if let Some(constructor) = contract.abi.constructor() { let constructor_args = ¤t_bytecode[bytecode.len()..]; - if constructor.abi_decode_input(constructor_args, false).is_ok() { + if constructor.abi_decode_input(constructor_args).is_ok() { // If we can decode args with current abi then remove args from // code to compare. current_bytecode = ¤t_bytecode[..bytecode.len()] diff --git a/crates/forge/src/cmd/create.rs b/crates/forge/src/cmd/create.rs index 5cffad23b9141..6768b43829836 100644 --- a/crates/forge/src/cmd/create.rs +++ b/crates/forge/src/cmd/create.rs @@ -184,7 +184,7 @@ impl CreateArgs { let deployer = signer.address(); let provider = ProviderBuilder::<_, _, AnyNetwork>::default() .wallet(EthereumWallet::new(signer)) - .on_provider(provider); + .connect_provider(provider); self.deploy( abi, bin, diff --git a/crates/forge/src/runner.rs b/crates/forge/src/runner.rs index eb8f87221bfed..3e2f65fde7f8e 100644 --- a/crates/forge/src/runner.rs +++ b/crates/forge/src/runner.rs @@ -826,14 +826,10 @@ impl<'a> FunctionRunner<'a> { if self.cr.contract.abi.functions().filter(|func| func.name.is_before_test_setup()).count() == 1 { - for calldata in self - .executor - .call_sol_default( - address, - &ITest::beforeTestSetupCall { testSelector: func.selector() }, - ) - .beforeTestCalldata - { + for calldata in self.executor.call_sol_default( + address, + &ITest::beforeTestSetupCall { testSelector: func.selector() }, + ) { // Apply before test configured calldata. match self.executor.to_mut().transact_raw( self.tcfg.sender, diff --git a/crates/forge/tests/cli/cmd.rs b/crates/forge/tests/cli/cmd.rs index 611fc39056351..3f76a179a0994 100644 --- a/crates/forge/tests/cli/cmd.rs +++ b/crates/forge/tests/cli/cmd.rs @@ -36,7 +36,7 @@ Options: -j, --threads Number of threads to use. Specifying 0 defaults to the number of logical cores - [aliases: jobs] + [aliases: --jobs] -V, --version Print version diff --git a/crates/forge/tests/cli/test_cmd.rs b/crates/forge/tests/cli/test_cmd.rs index 3de6dde23ea8e..6a75e4478bf3d 100644 --- a/crates/forge/tests/cli/test_cmd.rs +++ b/crates/forge/tests/cli/test_cmd.rs @@ -2916,8 +2916,6 @@ Traces: │ └─ ← [Return] 1 ├─ [0] VM::assertEq(1, 1) [staticcall] │ └─ ← [Return] - ├─ storage changes: - │ @ 0: 0 → 1 └─ ← [Stop] Suite result: ok. 1 passed; 0 failed; 0 skipped; [ELAPSED] diff --git a/crates/forge/tests/fixtures/colored_traces.svg b/crates/forge/tests/fixtures/colored_traces.svg index 4b2be87d03df7..e4181676bcc86 100644 --- a/crates/forge/tests/fixtures/colored_traces.svg +++ b/crates/forge/tests/fixtures/colored_traces.svg @@ -1,4 +1,4 @@ - +