diff --git a/Cargo.lock b/Cargo.lock index ff22884fad..69f4e30101 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,14 +68,15 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf02dfacfc815214f9b54ff50d54900ba527a68fd73e2c5637ced3460005045" +checksum = "a101d4d016f47f13890a74290fdd17b05dd175191d9337bc600791fb96e4dea8" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", + "alloy-trie", "auto_impl", "c-kzg", "derive_more 1.0.0", @@ -83,35 +84,37 @@ dependencies = [ ] [[package]] -name = "alloy-eip2930" -version = "0.1.0" +name = "alloy-consensus-any" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +checksum = "fa60357dda9a3d0f738f18844bd6d0f4a5924cc5cf00bfad2ff1369897966123" dependencies = [ + "alloy-consensus", + "alloy-eips", "alloy-primitives", "alloy-rlp", - "arbitrary", - "rand", + "alloy-serde", "serde", ] [[package]] -name = "alloy-eip7702" -version = "0.3.2" +name = "alloy-eip2930" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "arbitrary", + "rand", "serde", ] [[package]] name = "alloy-eip7702" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fb9fd842fdf10a524bbf2c4de6942ad869c1c8c3d128a1b09e67ed5f7cedbd" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -124,12 +127,12 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" +checksum = "8b6755b093afef5925f25079dd5a7c8d096398b804ba60cb5275397b06b31689" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.3.2", + "alloy-eip7702", "alloy-primitives", "alloy-rlp", "alloy-serde", @@ -154,29 +157,31 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1050e1d65524c030b17442b6546b564da51fdab7f71bd534b001ba65f2ebb16" +checksum = "4fa077efe0b834bcd89ff4ba547f48fb081e4fdc3673dd7da1b295a2cf2bb7b7" dependencies = [ "alloy-primitives", "alloy-sol-types", "serde", "serde_json", - "thiserror", + "thiserror 2.0.4", "tracing", ] [[package]] name = "alloy-network" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da34a18446a27734473af3d77eb21c5ebbdf97ea8eb65c39c0b50916bc659023" +checksum = "209a1882a08e21aca4aac6e2a674dc6fcf614058ef8cb02947d63782b1899552" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", "alloy-primitives", + "alloy-rpc-types-any", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -184,14 +189,16 @@ dependencies = [ "async-trait", "auto_impl", "futures-utils-wasm", - "thiserror", + "serde", + "serde_json", + "thiserror 2.0.4", ] [[package]] name = "alloy-network-primitives" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a968c063fcfcb937736665c865a71fc2242b68916156f5ffa41fee7b44bb695" +checksum = "c20219d1ad261da7a6331c16367214ee7ded41d001fabbbd656fbf71898b2773" dependencies = [ "alloy-consensus", "alloy-eips", @@ -202,9 +209,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.11" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd58d377699e6cfeab52c4a9d28bdc4ef37e2bd235ff2db525071fe37a2e9af5" +checksum = "9db948902dfbae96a73c2fbf1f7abec62af034ab883e4c777c3fd29702bd6e2c" dependencies = [ "alloy-rlp", "arbitrary", @@ -234,9 +241,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4814d141ede360bb6cd1b4b064f1aab9de391e7c4d0d4d50ac89ea4bc1e25fbd" +checksum = "9eefa6f4c798ad01f9b4202d02cea75f5ec11fa180502f4701e2b47965a8c0bb" dependencies = [ "alloy-chains", "alloy-consensus", @@ -262,7 +269,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror", + "thiserror 2.0.4", "tokio", "tracing", "url", @@ -288,14 +295,14 @@ checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] name = "alloy-rpc-client" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917e5504e4f8f7e39bdc322ff81589ed54c1e462240adaeb58162c2d986a5a2b" +checksum = "ed30bf1041e84cabc5900f52978ca345dd9969f2194a945e6fdec25b0620705c" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -314,13 +321,25 @@ dependencies = [ "wasmtimer", ] +[[package]] +name = "alloy-rpc-types-any" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200661999b6e235d9840be5d60a6e8ae2f0af9eb2a256dd378786744660e36ec" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", +] + [[package]] name = "alloy-rpc-types-eth" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e855b0daccf2320ba415753c3fed422abe9d3ad5d77b2d6cafcc9bcf32fe387f" +checksum = "a0600b8b5e2dc0cab12cbf91b5a885c35871789fb7b3a57b434bd4fced5b7a8b" dependencies = [ "alloy-consensus", + "alloy-consensus-any", "alloy-eips", "alloy-network-primitives", "alloy-primitives", @@ -335,9 +354,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c2661ca6785add8fc37aff8005439c806ffad58254c19939c6f59ac0d6596e" +checksum = "9afa753a97002a33b2ccb707d9f15f31c81b8c1b786c95b73cc62bb1d1fd0c3f" dependencies = [ "alloy-primitives", "serde", @@ -346,16 +365,16 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eca011160d18a7dc6d8cdc1e8dc13e2e86c908f8e41b02aa76e429d6fe7085" +checksum = "9b2cbff01a673936c2efd7e00d4c0e9a4dbbd6d600e2ce298078d33efbb19cd7" dependencies = [ "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", "k256", - "thiserror", + "thiserror 2.0.4", ] [[package]] @@ -369,7 +388,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -385,7 +404,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] @@ -401,7 +420,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", "syn-solidity", ] @@ -430,9 +449,9 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.5.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be77579633ebbc1266ae6fd7694f75c408beb1aeb6865d0b18f22893c265a061" +checksum = "d69d36982b9e46075ae6b792b0f84208c6c2c15ad49f6c500304616ef67b70e0" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -440,7 +459,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 2.0.4", "tokio", "tower 0.5.1", "tracing", @@ -450,9 +469,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.5.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6b358a89b6d107b92d09b61a61fbc04243942182709752c796f4b29402cead" +checksum = "2e02ffd5d93ffc51d72786e607c97de3b60736ca3e636ead0ec1f7dce68ea3fd" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -463,6 +482,22 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-trie" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5fd8fea044cc9a8c8a50bb6f28e31f0385d820f116c5b98f6f4e55d6e5590b" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more 1.0.0", + "nybbles", + "serde", + "smallvec", + "tracing", +] + [[package]] name = "anes" version = "0.1.6" @@ -628,6 +663,9 @@ name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +dependencies = [ + "serde", +] [[package]] name = "async-stream" @@ -648,7 +686,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -659,7 +697,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -708,7 +746,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -987,9 +1025,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -1176,7 +1214,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -1187,7 +1225,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -1207,7 +1245,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", "unicode-xid", ] @@ -1324,7 +1362,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -1356,7 +1394,7 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror", + "thiserror 1.0.63", "uint", ] @@ -1404,7 +1442,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -1429,7 +1467,7 @@ dependencies = [ "serde_json", "strum", "tempfile", - "thiserror", + "thiserror 1.0.63", "tiny-keccak", "unicode-xid", ] @@ -1460,7 +1498,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-tungstenite", "tracing", @@ -1637,7 +1675,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -2499,7 +2537,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -2508,6 +2546,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "nybbles" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95f06be0417d97f81fe4e5c86d7d01b392655a9cac9c19a848aa033e18937b23" +dependencies = [ + "const-hex", + "serde", + "smallvec", +] + [[package]] name = "object" version = "0.36.1" @@ -2577,7 +2626,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -2696,7 +2745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.63", "ucd-trie", ] @@ -2740,7 +2789,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -2769,7 +2818,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -2930,14 +2979,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2970,7 +3019,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -3253,7 +3302,7 @@ name = "revm-primitives" version = "14.0.0" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.4.0", + "alloy-eip7702", "alloy-primitives", "auto_impl", "bitflags 2.6.0", @@ -3296,7 +3345,7 @@ dependencies = [ "serde", "serde_json", "structopt", - "thiserror", + "thiserror 1.0.63", "triehash", "walkdir", ] @@ -3398,7 +3447,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.70", + "syn 2.0.90", "unicode-ident", ] @@ -3758,7 +3807,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -3846,7 +3895,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -3870,6 +3919,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "snowbridge-amcl" @@ -3997,7 +4049,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -4032,9 +4084,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.70" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -4050,7 +4102,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -4143,7 +4195,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", ] [[package]] @@ -4154,7 +4215,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -4255,7 +4327,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -4406,7 +4478,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -4459,7 +4531,7 @@ dependencies = [ "rand", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.63", "url", "utf-8", ] @@ -4641,7 +4713,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -4675,7 +4747,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4688,9 +4760,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasmtimer" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", @@ -4957,7 +5029,7 @@ dependencies = [ "pharos", "rustc_version 0.4.0", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.63", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4989,7 +5061,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] [[package]] @@ -5009,5 +5081,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.90", ] diff --git a/crates/interpreter/src/gas/calc.rs b/crates/interpreter/src/gas/calc.rs index bf80ad0a4d..2e9c0cca9a 100644 --- a/crates/interpreter/src/gas/calc.rs +++ b/crates/interpreter/src/gas/calc.rs @@ -125,9 +125,9 @@ pub const fn verylowcopy_cost(len: u64) -> Option { /// `EXTCODECOPY` opcode cost calculation. #[inline] -pub const fn extcodecopy_cost(spec_id: SpecId, len: u64, load: Eip7702CodeLoad<()>) -> Option { +pub const fn extcodecopy_cost(spec_id: SpecId, len: u64, is_cold: bool) -> Option { let base_gas = if spec_id.is_enabled_in(SpecId::BERLIN) { - warm_cold_cost_with_delegation(load) + warm_cold_cost(is_cold) } else if spec_id.is_enabled_in(SpecId::TANGERINE) { 700 } else { diff --git a/crates/interpreter/src/host.rs b/crates/interpreter/src/host.rs index 231b1a315c..9b6274e64b 100644 --- a/crates/interpreter/src/host.rs +++ b/crates/interpreter/src/host.rs @@ -22,10 +22,10 @@ pub trait Host { fn balance(&mut self, address: Address) -> Option>; /// Get code of `address` and if the account is cold. - fn code(&mut self, address: Address) -> Option>; + fn code(&mut self, address: Address) -> Option>; /// Get code hash of `address` and if the account is cold. - fn code_hash(&mut self, address: Address) -> Option>; + fn code_hash(&mut self, address: Address) -> Option>; /// Get storage value of `address` at `index` and if the account is cold. fn sload(&mut self, address: Address, index: U256) -> Option>; diff --git a/crates/interpreter/src/host/dummy.rs b/crates/interpreter/src/host/dummy.rs index 602fb512da..955d250f47 100644 --- a/crates/interpreter/src/host/dummy.rs +++ b/crates/interpreter/src/host/dummy.rs @@ -4,7 +4,7 @@ use crate::{ }; use std::vec::Vec; -use super::{AccountLoad, Eip7702CodeLoad, StateLoad}; +use super::{AccountLoad, StateLoad}; /// A dummy [Host] implementation. #[derive(Clone, Debug, Default, PartialEq, Eq)] @@ -60,13 +60,13 @@ impl Host for DummyHost { } #[inline] - fn code(&mut self, _address: Address) -> Option> { + fn code(&mut self, _address: Address) -> Option> { Some(Default::default()) } #[inline] - fn code_hash(&mut self, _address: Address) -> Option> { - Some(Eip7702CodeLoad::new_not_delegated(KECCAK_EMPTY, false)) + fn code_hash(&mut self, _address: Address) -> Option> { + Some(StateLoad::new(KECCAK_EMPTY, false)) } #[inline] diff --git a/crates/interpreter/src/instructions/host.rs b/crates/interpreter/src/instructions/host.rs index 612cbac5c1..e708120647 100644 --- a/crates/interpreter/src/instructions/host.rs +++ b/crates/interpreter/src/instructions/host.rs @@ -1,5 +1,5 @@ use crate::{ - gas::{self, warm_cold_cost, warm_cold_cost_with_delegation}, + gas::{self, warm_cold_cost}, interpreter::Interpreter, primitives::{Bytes, Log, LogData, Spec, SpecId::*, B256, U256}, Host, InstructionResult, @@ -46,9 +46,8 @@ pub fn extcodesize(interpreter: &mut Interpreter, interpreter.instruction_result = InstructionResult::FatalExternalError; return; }; - let (code, load) = code.into_components(); if SPEC::enabled(BERLIN) { - gas!(interpreter, warm_cold_cost_with_delegation(load)); + gas!(interpreter, warm_cold_cost(code.is_cold)); } else if SPEC::enabled(TANGERINE) { gas!(interpreter, 700); } else { @@ -66,15 +65,14 @@ pub fn extcodehash(interpreter: &mut Interpreter, interpreter.instruction_result = InstructionResult::FatalExternalError; return; }; - let (code_hash, load) = code_hash.into_components(); if SPEC::enabled(BERLIN) { - gas!(interpreter, warm_cold_cost_with_delegation(load)) + gas!(interpreter, warm_cold_cost(code_hash.is_cold)) } else if SPEC::enabled(ISTANBUL) { gas!(interpreter, 700); } else { gas!(interpreter, 400); } - push_b256!(interpreter, code_hash); + push_b256!(interpreter, *code_hash); } pub fn extcodecopy(interpreter: &mut Interpreter, host: &mut H) { @@ -87,10 +85,9 @@ pub fn extcodecopy(interpreter: &mut Interpreter, }; let len = as_usize_or_fail!(interpreter, len_u256); - let (code, load) = code.into_components(); gas_or_fail!( interpreter, - gas::extcodecopy_cost(SPEC::SPEC_ID, len as u64, load) + gas::extcodecopy_cost(SPEC::SPEC_ID, len as u64, code.is_cold) ); if len == 0 { return; diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index e8c9cab7f9..8be59e52e1 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -27,7 +27,7 @@ alloy-eip2930 = { version = "0.1", default-features = false } alloy-eip7702 = { version = "0.4", default-features = false, features = [ "k256", ] } -alloy-primitives = { version = "0.8.8", default-features = false, features = [ +alloy-primitives = { version = "0.8", default-features = false, features = [ "rlp", "map", ] } diff --git a/crates/primitives/src/eip7702.rs b/crates/primitives/src/eip7702.rs index 9571f086f1..7a1d19764f 100644 --- a/crates/primitives/src/eip7702.rs +++ b/crates/primitives/src/eip7702.rs @@ -6,7 +6,8 @@ pub use authorization_list::{ SignedAuthorization, }; pub use bytecode::{ - Eip7702Bytecode, Eip7702DecodeError, EIP7702_MAGIC, EIP7702_MAGIC_BYTES, EIP7702_VERSION, + Eip7702Bytecode, Eip7702DecodeError, EIP7702_MAGIC, EIP7702_MAGIC_BYTES, EIP7702_MAGIC_HASH, + EIP7702_VERSION, }; // Base cost of updating authorized account. diff --git a/crates/primitives/src/eip7702/bytecode.rs b/crates/primitives/src/eip7702/bytecode.rs index 268f2c4aa6..622188e8ce 100644 --- a/crates/primitives/src/eip7702/bytecode.rs +++ b/crates/primitives/src/eip7702/bytecode.rs @@ -1,6 +1,12 @@ +use alloy_primitives::{b256, B256}; + use crate::{bytes, Address, Bytes}; use core::fmt; +/// Hash of EF01 bytes that is used for EXTCODEHASH when called from legacy bytecode. +pub const EIP7702_MAGIC_HASH: B256 = + b256!("eadcdba66a79ab5dce91622d1d75c8cff5cff0b96944c3bf1072cd08ce018329"); + /// EIP-7702 Version Magic in u16 form. pub const EIP7702_MAGIC: u16 = 0xEF01; diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 137c3f1989..a9963fa4f1 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -32,6 +32,7 @@ pub use constants::*; pub use eip7702::{ Authorization, AuthorizationList, Eip7702Bytecode, Eip7702DecodeError, RecoveredAuthority, RecoveredAuthorization, Signature, SignedAuthorization, EIP7702_MAGIC, EIP7702_MAGIC_BYTES, + EIP7702_MAGIC_HASH, }; pub use env::*; diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 22b0409a61..1b0ab1af50 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -52,9 +52,9 @@ ethers-providers = { version = "2.0", optional = true } ethers-core = { version = "2.0", optional = true } # alloydb -alloy-provider = { version = "0.5.4", optional = true, default-features = false } -alloy-eips = { version = "0.5.4", optional = true, default-features = false } -alloy-transport = { version = "0.5.4", optional = true, default-features = false } +alloy-provider = { version = "0.7", optional = true, default-features = false } +alloy-eips = { version = "0.7", optional = true, default-features = false } +alloy-transport = { version = "0.7", optional = true, default-features = false } [dev-dependencies] alloy-sol-types = { version = "0.8.2", default-features = false, features = [ @@ -66,7 +66,7 @@ criterion = "0.5" indicatif = "0.17" reqwest = { version = "0.12" } rstest = "0.22.0" -alloy-provider = "0.5.3" +alloy-provider = "0.7" [features] default = ["std", "c-kzg", "secp256k1", "portable", "blst"] diff --git a/crates/revm/src/context.rs b/crates/revm/src/context.rs index 14d1b12d9d..b592f3d14f 100644 --- a/crates/revm/src/context.rs +++ b/crates/revm/src/context.rs @@ -8,7 +8,7 @@ pub use context_precompiles::{ }; pub use evm_context::EvmContext; pub use inner_evm_context::InnerEvmContext; -use revm_interpreter::{as_u64_saturated, Eip7702CodeLoad, StateLoad}; +use revm_interpreter::{as_u64_saturated, StateLoad}; use crate::{ db::{Database, EmptyDB}, @@ -145,14 +145,14 @@ impl Host for Context { .ok() } - fn code(&mut self, address: Address) -> Option> { + fn code(&mut self, address: Address) -> Option> { self.evm .code(address) .map_err(|e| self.evm.error = Err(e)) .ok() } - fn code_hash(&mut self, address: Address) -> Option> { + fn code_hash(&mut self, address: Address) -> Option> { self.evm .code_hash(address) .map_err(|e| self.evm.error = Err(e)) diff --git a/crates/revm/src/context/inner_evm_context.rs b/crates/revm/src/context/inner_evm_context.rs index bc2b956efb..cdeda759ae 100644 --- a/crates/revm/src/context/inner_evm_context.rs +++ b/crates/revm/src/context/inner_evm_context.rs @@ -1,15 +1,15 @@ use crate::{ db::Database, interpreter::{ - analysis::to_analysed, gas, return_ok, AccountLoad, Eip7702CodeLoad, InstructionResult, - InterpreterResult, SStoreResult, SelfDestructResult, StateLoad, + analysis::to_analysed, gas, return_ok, AccountLoad, InstructionResult, InterpreterResult, + SStoreResult, SelfDestructResult, StateLoad, }, journaled_state::JournaledState, primitives::{ AccessListItem, Account, Address, AnalysisKind, Bytecode, Bytes, CfgEnv, EVMError, Env, Eof, HashSet, Spec, SpecId::{self, *}, - B256, EOF_MAGIC_BYTES, EOF_MAGIC_HASH, U256, + B256, EIP7702_MAGIC_BYTES, EIP7702_MAGIC_HASH, EOF_MAGIC_BYTES, EOF_MAGIC_HASH, U256, }, JournalCheckpoint, }; @@ -175,45 +175,20 @@ impl InnerEvmContext { /// /// In case of EOF account it will return `EOF_MAGIC` (0xEF00) as code. #[inline] - pub fn code( - &mut self, - address: Address, - ) -> Result, EVMError> { + pub fn code(&mut self, address: Address) -> Result, EVMError> { let a = self.journaled_state.load_code(address, &mut self.db)?; // SAFETY: safe to unwrap as load_code will insert code if it is empty. let code = a.info.code.as_ref().unwrap(); - if code.is_eof() { - return Ok(Eip7702CodeLoad::new_not_delegated( - EOF_MAGIC_BYTES.clone(), - a.is_cold, - )); - } - - if let Bytecode::Eip7702(code) = code { - let address = code.address(); - let is_cold = a.is_cold; - - let delegated_account = self.journaled_state.load_code(address, &mut self.db)?; - // SAFETY: safe to unwrap as load_code will insert code if it is empty. - let delegated_code = delegated_account.info.code.as_ref().unwrap(); - - let bytes = if delegated_code.is_eof() { - EOF_MAGIC_BYTES.clone() - } else { - delegated_code.original_bytes() - }; - - return Ok(Eip7702CodeLoad::new( - StateLoad::new(bytes, is_cold), - delegated_account.is_cold, - )); - } + let code = if code.is_eof() { + EOF_MAGIC_BYTES.clone() + } else if code.is_eip7702() { + EIP7702_MAGIC_BYTES.clone() + } else { + code.original_bytes() + }; - Ok(Eip7702CodeLoad::new_not_delegated( - code.original_bytes(), - a.is_cold, - )) + Ok(StateLoad::new(code, a.is_cold)) } /// Get code hash of address. @@ -221,45 +196,23 @@ impl InnerEvmContext { /// In case of EOF account it will return `EOF_MAGIC_HASH` /// (the hash of `0xEF00`). #[inline] - pub fn code_hash( - &mut self, - address: Address, - ) -> Result, EVMError> { + pub fn code_hash(&mut self, address: Address) -> Result, EVMError> { let acc = self.journaled_state.load_code(address, &mut self.db)?; if acc.is_empty() { - return Ok(Eip7702CodeLoad::new_not_delegated(B256::ZERO, acc.is_cold)); + return Ok(StateLoad::new(B256::ZERO, acc.is_cold)); } // SAFETY: safe to unwrap as load_code will insert code if it is empty. let code = acc.info.code.as_ref().unwrap(); - // If bytecode is EIP-7702 then we need to load the delegated account. - if let Bytecode::Eip7702(code) = code { - let address = code.address(); - let is_cold = acc.is_cold; - - let delegated_account = self.journaled_state.load_code(address, &mut self.db)?; - - let hash = if delegated_account.is_empty() { - B256::ZERO - } else if delegated_account.info.code.as_ref().unwrap().is_eof() { - EOF_MAGIC_HASH - } else { - delegated_account.info.code_hash - }; - - return Ok(Eip7702CodeLoad::new( - StateLoad::new(hash, is_cold), - delegated_account.is_cold, - )); - } - let hash = if code.is_eof() { EOF_MAGIC_HASH + } else if code.is_eip7702() { + EIP7702_MAGIC_HASH } else { acc.info.code_hash }; - Ok(Eip7702CodeLoad::new_not_delegated(hash, acc.is_cold)) + Ok(StateLoad::new(hash, acc.is_cold)) } /// Load storage slot, if storage is not present inside the account then it will be loaded from database. diff --git a/crates/revm/src/db/alloydb.rs b/crates/revm/src/db/alloydb.rs index f03685282f..04ad657790 100644 --- a/crates/revm/src/db/alloydb.rs +++ b/crates/revm/src/db/alloydb.rs @@ -4,7 +4,7 @@ use crate::{ }; use alloy_eips::BlockId; use alloy_provider::{ - network::{BlockResponse, HeaderResponse}, + network::{primitives::HeaderResponse, BlockResponse}, Network, Provider, }; use alloy_transport::{Transport, TransportError}; @@ -129,7 +129,7 @@ impl> DatabaseRef for AlloyD let block = self.block_on( self.provider // SAFETY: We know number <= u64::MAX, so we can safely convert it to u64 - .get_block_by_number(number.into(), false), + .get_block_by_number(number.into(), false.into()), )?; // SAFETY: If the number is given, the block is supposed to be finalized, so unwrapping is safe. Ok(B256::new(*block.unwrap().header().hash()))