diff --git a/Cargo.lock b/Cargo.lock index 7837897..4c21ab3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,7 +124,7 @@ checksum = "e96c81b05c893348760f232c4cc6a6a77fd91cfb09885d4eaad25cd03bd7732e" dependencies = [ "alloy-rlp", "arbitrary", - "num_enum 0.7.2", + "num_enum", "proptest", "serde", "strum 0.26.2", @@ -151,20 +151,20 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" dependencies = [ "alloy-primitives", "alloy-rlp", - "thiserror", + "serde", ] [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" dependencies = [ "alloy-primitives", - "alloy-rpc-types", + "alloy-serde", "serde", ] @@ -232,11 +232,12 @@ dependencies = [ [[package]] name = "alloy-rpc-engine-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-rpc-types", + "alloy-serde", "jsonrpsee-types", "serde", "thiserror", @@ -245,10 +246,11 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" dependencies = [ "alloy-primitives", "alloy-rpc-types", + "alloy-serde", "serde", "serde_json", ] @@ -256,10 +258,11 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=9ac2c90#9ac2c90d58a9994d4b61c879e33c6af2739a2b4f" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" dependencies = [ "alloy-primitives", "alloy-rlp", + "alloy-serde", "arbitrary", "itertools 0.12.1", "jsonrpsee-types", @@ -270,6 +273,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=410850b#410850b305a28297483d819b669b04ba31796359" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + [[package]] name = "alloy-sol-macro" version = "0.6.4" @@ -335,9 +348,9 @@ version = "0.0.0" dependencies = [ "alphanet-node", "clap", - "jemallocator", "reth", "reth-node-optimism", + "tikv-jemallocator", "tracing", ] @@ -347,6 +360,7 @@ version = "0.0.0" dependencies = [ "revm", "revm-interpreter", + "revm-precompile", "revm-primitives", "secp256k1 0.28.2", ] @@ -877,9 +891,9 @@ dependencies = [ [[package]] name = "boa_ast" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73498e9b2f0aa7db74977afa4d594657611e90587abf0dd564c0b55b4a130163" +checksum = "5b6fb81ca0f301f33aff7401e2ffab37dc9e0e4a1cf0ccf6b34f4d9e60aa0682" dependencies = [ "bitflags 2.5.0", "boa_interner", @@ -891,30 +905,35 @@ dependencies = [ [[package]] name = "boa_engine" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16377479d5d6d33896e7acdd1cc698d04a8f72004025bbbddf47558cd29146a6" +checksum = "600e4e4a65b26efcef08a7b1cf2899d3845a32e82e067ee3b75eaf7e413ff31c" dependencies = [ + "arrayvec", "bitflags 2.5.0", "boa_ast", "boa_gc", - "boa_icu_provider", "boa_interner", "boa_macros", "boa_parser", "boa_profiler", - "chrono", + "bytemuck", + "cfg-if", "dashmap", "fast-float", + "hashbrown 0.14.3", "icu_normalizer", "indexmap 2.2.5", - "itertools 0.11.0", + "intrusive-collections", + "itertools 0.12.1", "num-bigint", "num-integer", "num-traits", - "num_enum 0.6.1", + "num_enum", "once_cell", + "paste", "pollster", + "portable-atomic", "rand 0.8.5", "regress", "rustc-hash", @@ -926,39 +945,26 @@ dependencies = [ "tap", "thin-vec", "thiserror", + "time", ] [[package]] name = "boa_gc" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97b44beaef9d4452342d117d94607fdfa8d474280f1ba0fd97853834e3a49b2" +checksum = "c055ef3cd87ea7db014779195bc90c6adfc35de4902e3b2fe587adecbd384578" dependencies = [ "boa_macros", "boa_profiler", + "hashbrown 0.14.3", "thin-vec", ] -[[package]] -name = "boa_icu_provider" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30e52e34e451dd0bfc2c654a9a43ed34b0073dbd4ae3394b40313edda8627aa" -dependencies = [ - "icu_collections", - "icu_normalizer", - "icu_properties", - "icu_provider", - "icu_provider_adapters", - "icu_provider_blob", - "once_cell", -] - [[package]] name = "boa_interner" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e5afa991908cfbe79bd3109b824e473a1dc5f74f31fab91bb44c9e245daa77" +checksum = "0cacc9caf022d92195c827a3e5bf83f96089d4bfaff834b359ac7b6be46e9187" dependencies = [ "boa_gc", "boa_macros", @@ -972,9 +978,9 @@ dependencies = [ [[package]] name = "boa_macros" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005fa0c5bd20805466dda55eb34cd709bb31a2592bb26927b47714eeed6914d8" +checksum = "6be9c93793b60dac381af475b98634d4b451e28336e72218cad9a20176218dbc" dependencies = [ "proc-macro2", "quote", @@ -984,34 +990,28 @@ dependencies = [ [[package]] name = "boa_parser" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e09afb035377a9044443b598187a7d34cd13164617182a4d7c348522ee3f052" +checksum = "9e8592556849f0619ed142ce2b3a19086769314a8d657f93a5765d06dbce4818" dependencies = [ "bitflags 2.5.0", "boa_ast", - "boa_icu_provider", "boa_interner", "boa_macros", "boa_profiler", "fast-float", - "icu_locid", "icu_properties", - "icu_provider", - "icu_provider_macros", "num-bigint", "num-traits", - "once_cell", "regress", "rustc-hash", - "tinystr", ] [[package]] name = "boa_profiler" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190f92dfe48224adc92881c620f08ccf37ff62b91a094bb357fe53bd5e84647" +checksum = "e0d8372f2d5cbac600a260de87877141b42da1e18d2c7a08ccb493a49cbd55c0" [[package]] name = "boyer-moore-magiclen" @@ -1071,6 +1071,20 @@ name = "bytemuck" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] [[package]] name = "byteorder" @@ -1089,9 +1103,9 @@ dependencies = [ [[package]] name = "c-kzg" -version = "0.4.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a4bc5367b6284358d2a6a6a1dc2d92ec4b86034561c3b9d3341909752fd848" +checksum = "3130f3d8717cc02e668a896af24984d5d5d4e8bf12e278e982e0f1bd88a0f9af" dependencies = [ "blst", "cc", @@ -1249,12 +1263,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" -[[package]] -name = "cobs" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" - [[package]] name = "colorchoice" version = "1.0.0" @@ -1273,6 +1281,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "concat-kdf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d72c1252426a83be2092dd5884a5f6e3b8e7180f6891b6263d2c21b92ec8816" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "confy" version = "0.6.1" @@ -1386,12 +1403,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -1954,12 +1965,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -2708,12 +2713,11 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8302d8dfd6044d3ddb3f807a5ef3d7bbca9a574959c6d6e4dc39aa7012d0d5" +checksum = "137d96353afc8544d437e8a99eceb10ab291352699573b0de5b08bda38c78c60" dependencies = [ "displaydoc", - "serde", "yoke", "zerofrom", "zerovec", @@ -2721,29 +2725,48 @@ dependencies = [ [[package]] name = "icu_locid" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3003f85dccfc0e238ff567693248c59153a46f4e6125ba4020b973cef4d1d335" +checksum = "5c0aa2536adc14c07e2a521e95512b75ed8ef832f0fdf9299d4a0a45d2be2a9d" dependencies = [ "displaydoc", "litemap", - "serde", "tinystr", "writeable", "zerovec", ] +[[package]] +name = "icu_locid_transform" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c17d8f6524fdca4471101dd71f0a132eb6382b5d6d7f2970441cb25f6f435a" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545c6c3e8bf9580e2dafee8de6f9ec14826aaf359787789c7724f1f85f47d3dc" + [[package]] name = "icu_normalizer" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652869735c9fb9f5a64ba180ee16f2c848390469c116deef517ecc53f4343598" +checksum = "c183e31ed700f1ecd6b032d104c52fe8b15d028956b73727c97ec176b170e187" dependencies = [ "displaydoc", "icu_collections", + "icu_normalizer_data", "icu_properties", "icu_provider", - "serde", "smallvec", "utf16_iter", "utf8_iter", @@ -2751,75 +2774,59 @@ dependencies = [ "zerovec", ] +[[package]] +name = "icu_normalizer_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22026918a80e6a9a330cb01b60f950e2b4e5284c59528fd0c6150076ef4c8522" + [[package]] name = "icu_properties" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0e1aa26851f16c9e04412a5911c86b7f8768dac8f8d4c5f1c568a7e5d7a434" +checksum = "976e296217453af983efa25f287a4c1da04b9a63bf1ed63719455068e4453eb5" dependencies = [ "displaydoc", "icu_collections", + "icu_locid_transform", + "icu_properties_data", "icu_provider", - "serde", "tinystr", "zerovec", ] +[[package]] +name = "icu_properties_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6a86c0e384532b06b6c104814f9c1b13bcd5b64409001c0d05713a1f3529d99" + [[package]] name = "icu_provider" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc312a7b6148f7dfe098047ae2494d12d4034f48ade58d4f353000db376e305" +checksum = "ba58e782287eb6950247abbf11719f83f5d4e4a5c1f2cd490d30a334bc47c2f4" dependencies = [ "displaydoc", "icu_locid", "icu_provider_macros", - "postcard", - "serde", "stable_deref_trait", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_adapters" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ae1e2bd0c41728b77e7c46e9afdec5e2127d1eedacc684724667d50c126bd3" -dependencies = [ - "icu_locid", - "icu_provider", - "serde", "tinystr", - "yoke", - "zerovec", -] - -[[package]] -name = "icu_provider_blob" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd364c9a01f791a4bc04a74cf2a1d01d9f6926a40fd5ae1c28004e1e70d8338b" -dependencies = [ - "icu_provider", - "postcard", - "serde", "writeable", "yoke", + "zerofrom", "zerovec", ] [[package]] name = "icu_provider_macros" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b728b9421e93eff1d9f8681101b78fa745e0748c95c655c83f337044a7e10" +checksum = "d2abdd3a62551e8337af119c5899e600ca0c88ec8f23a46c60ba216c803dcf1a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.53", ] [[package]] @@ -2988,6 +2995,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "intrusive-collections" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b694dc9f70c3bda874626d2aed13b780f137aab435f4e9814121955cf706122e" +dependencies = [ + "memoffset", +] + [[package]] name = "ipconfig" version = "0.3.2" @@ -3025,15 +3041,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -3049,37 +3056,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" -[[package]] -name = "jemalloc-ctl" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cffc705424a344c054e135d12ee591402f4539245e8bbd64e6c9eaa9458b63c" -dependencies = [ - "jemalloc-sys", - "libc", - "paste", -] - -[[package]] -name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc" -dependencies = [ - "jemalloc-sys", - "libc", -] - [[package]] name = "jobserver" version = "0.1.28" @@ -3496,6 +3472,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "metrics" version = "0.21.1" @@ -3762,34 +3747,13 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", -] - [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.2", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.53", + "num_enum_derive", ] [[package]] @@ -3798,6 +3762,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.53", @@ -3840,10 +3805,6 @@ name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -dependencies = [ - "critical-section", - "portable-atomic", -] [[package]] name = "opaque-debug" @@ -4172,17 +4133,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" -[[package]] -name = "postcard" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" -dependencies = [ - "cobs", - "embedded-io", - "serde", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -4597,11 +4547,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "regress" -version = "0.6.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9ecfa0cb04d0b04dddb99b8ccf4f66bc8dfd23df694b398570bd8ae3a50fb" +checksum = "d06f9a1f7cd8473611ba1a480cf35f9c5cffc2954336ba90a982fdb7e7d7f51e" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.3", "memchr", ] @@ -4664,8 +4614,8 @@ dependencies = [ [[package]] name = "reth" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "alloy-rlp", @@ -4681,7 +4631,6 @@ dependencies = [ "futures", "human_bytes", "itertools 0.12.1", - "jemallocator", "libc", "metrics-process", "proptest", @@ -4707,7 +4656,6 @@ dependencies = [ "reth-node-core", "reth-node-ethereum", "reth-node-optimism", - "reth-optimism-payload-builder", "reth-payload-builder", "reth-payload-validator", "reth-primitives", @@ -4730,6 +4678,7 @@ dependencies = [ "serde_json", "similar-asserts", "tempfile", + "tikv-jemallocator", "tokio", "toml", "tracing", @@ -4737,8 +4686,8 @@ dependencies = [ [[package]] name = "reth-auto-seal-consensus" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "futures-util", "reth-beacon-consensus", @@ -4756,8 +4705,8 @@ dependencies = [ [[package]] name = "reth-basic-payload-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "futures-core", @@ -4779,8 +4728,8 @@ dependencies = [ [[package]] name = "reth-beacon-consensus" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "futures", "metrics", @@ -4808,8 +4757,8 @@ dependencies = [ [[package]] name = "reth-beacon-consensus-core" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-consensus-common", "reth-interfaces", @@ -4818,8 +4767,8 @@ dependencies = [ [[package]] name = "reth-blockchain-tree" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "aquamarine", "linked_hash_set", @@ -4839,8 +4788,8 @@ dependencies = [ [[package]] name = "reth-codecs" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-primitives", "bytes", @@ -4849,8 +4798,8 @@ dependencies = [ [[package]] name = "reth-codecs-derive" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -4860,8 +4809,8 @@ dependencies = [ [[package]] name = "reth-config" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "humantime-serde", "reth-discv4", @@ -4874,8 +4823,8 @@ dependencies = [ [[package]] name = "reth-consensus-common" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-interfaces", "reth-primitives", @@ -4884,8 +4833,8 @@ dependencies = [ [[package]] name = "reth-db" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "arbitrary", "bytes", @@ -4915,8 +4864,8 @@ dependencies = [ [[package]] name = "reth-discv4" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "discv5", @@ -4937,8 +4886,8 @@ dependencies = [ [[package]] name = "reth-dns-discovery" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "data-encoding", @@ -4960,8 +4909,8 @@ dependencies = [ [[package]] name = "reth-downloaders" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "futures", @@ -4985,14 +4934,15 @@ dependencies = [ [[package]] name = "reth-ecies" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "aes 0.8.4", "alloy-rlp", "block-padding", "byteorder", "cipher 0.4.4", + "concat-kdf", "ctr 0.9.2", "digest 0.10.7", "educe", @@ -5016,8 +4966,8 @@ dependencies = [ [[package]] name = "reth-eth-wire" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "alloy-rlp", @@ -5042,8 +4992,8 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "alloy-primitives", @@ -5058,8 +5008,8 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-basic-payload-builder", "reth-payload-builder", @@ -5073,8 +5023,8 @@ dependencies = [ [[package]] name = "reth-etl" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "rayon", "reth-db", @@ -5083,15 +5033,14 @@ dependencies = [ [[package]] name = "reth-interfaces" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "auto_impl", "clap", "futures", "reth-eth-wire", "reth-network-api", - "reth-nippy-jar", "reth-primitives", "reth-rpc-types", "thiserror", @@ -5101,8 +5050,8 @@ dependencies = [ [[package]] name = "reth-ipc" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "async-trait", "bytes", @@ -5121,8 +5070,8 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "bitflags 2.5.0", "byteorder", @@ -5139,8 +5088,8 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "bindgen", "cc", @@ -5149,8 +5098,8 @@ dependencies = [ [[package]] name = "reth-metrics" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "futures", "metrics", @@ -5161,8 +5110,8 @@ dependencies = [ [[package]] name = "reth-metrics-derive" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "once_cell", "proc-macro2", @@ -5173,8 +5122,8 @@ dependencies = [ [[package]] name = "reth-net-common" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "pin-project", "reth-primitives", @@ -5183,8 +5132,8 @@ dependencies = [ [[package]] name = "reth-net-nat" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "igd-next", "pin-project-lite", @@ -5197,8 +5146,8 @@ dependencies = [ [[package]] name = "reth-network" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "aquamarine", @@ -5243,8 +5192,8 @@ dependencies = [ [[package]] name = "reth-network-api" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "reth-discv4", @@ -5258,8 +5207,8 @@ dependencies = [ [[package]] name = "reth-nippy-jar" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "anyhow", "bincode", @@ -5278,8 +5227,8 @@ dependencies = [ [[package]] name = "reth-node-api" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-primitives", "reth-rpc-types", @@ -5291,8 +5240,8 @@ dependencies = [ [[package]] name = "reth-node-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "confy", "eyre", @@ -5324,11 +5273,9 @@ dependencies = [ [[package]] name = "reth-node-core" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ - "alloy-chains", - "alloy-rlp", "clap", "const-str", "derive_more", @@ -5337,7 +5284,6 @@ dependencies = [ "futures", "humantime", "hyper", - "jemalloc-ctl", "metrics", "metrics-exporter-prometheus", "metrics-process", @@ -5347,7 +5293,6 @@ dependencies = [ "procfs", "rand 0.8.5", "reth-auto-seal-consensus", - "reth-basic-payload-builder", "reth-beacon-consensus", "reth-blockchain-tree", "reth-config", @@ -5355,15 +5300,12 @@ dependencies = [ "reth-db", "reth-discv4", "reth-downloaders", - "reth-eth-wire", "reth-interfaces", "reth-metrics", "reth-net-nat", "reth-network", "reth-network-api", "reth-node-api", - "reth-optimism-payload-builder", - "reth-payload-builder", "reth-primitives", "reth-provider", "reth-prune", @@ -5379,12 +5321,12 @@ dependencies = [ "reth-tasks", "reth-tracing", "reth-transaction-pool", - "revm-inspectors", "secp256k1 0.27.0", "serde", "serde_json", "shellexpand", "thiserror", + "tikv-jemalloc-ctl", "tokio", "tracing", "vergen", @@ -5392,8 +5334,8 @@ dependencies = [ [[package]] name = "reth-node-ethereum" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "eyre", "reth-basic-payload-builder", @@ -5412,8 +5354,8 @@ dependencies = [ [[package]] name = "reth-node-optimism" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "clap", "eyre", @@ -5438,24 +5380,29 @@ dependencies = [ [[package]] name = "reth-optimism-payload-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ + "alloy-rlp", "reth-basic-payload-builder", + "reth-node-api", "reth-payload-builder", "reth-primitives", "reth-provider", "reth-revm", + "reth-rpc-types", + "reth-rpc-types-compat", "reth-transaction-pool", "revm", + "sha2", "thiserror", "tracing", ] [[package]] name = "reth-payload-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "futures-util", @@ -5478,8 +5425,8 @@ dependencies = [ [[package]] name = "reth-payload-validator" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-primitives", "reth-rpc-types", @@ -5488,8 +5435,8 @@ dependencies = [ [[package]] name = "reth-primitives" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "alloy-eips", @@ -5504,6 +5451,7 @@ dependencies = [ "cfg-if", "clap", "derive_more", + "enr", "itertools 0.12.1", "modular-bitfield", "nybbles", @@ -5520,6 +5468,7 @@ dependencies = [ "secp256k1 0.27.0", "serde", "serde_json", + "serde_with", "sha2", "strum 0.26.2", "tempfile", @@ -5529,8 +5478,8 @@ dependencies = [ [[package]] name = "reth-provider" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "auto_impl", @@ -5557,8 +5506,8 @@ dependencies = [ [[package]] name = "reth-prune" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "itertools 0.12.1", "metrics", @@ -5577,8 +5526,8 @@ dependencies = [ [[package]] name = "reth-revm" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "reth-consensus-common", "reth-interfaces", @@ -5592,8 +5541,8 @@ dependencies = [ [[package]] name = "reth-rpc" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-dyn-abi", "alloy-primitives", @@ -5602,6 +5551,7 @@ dependencies = [ "async-trait", "bytes", "derive_more", + "dyn-clone", "futures", "http", "http-body", @@ -5609,6 +5559,7 @@ dependencies = [ "jsonrpsee", "jsonwebtoken", "metrics", + "parking_lot 0.12.1", "pin-project", "rand 0.8.5", "reqwest", @@ -5644,8 +5595,8 @@ dependencies = [ [[package]] name = "reth-rpc-api" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "jsonrpsee", "reth-node-api", @@ -5656,8 +5607,8 @@ dependencies = [ [[package]] name = "reth-rpc-builder" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "hyper", "jsonrpsee", @@ -5681,8 +5632,8 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "async-trait", "jsonrpsee-core", @@ -5707,9 +5658,10 @@ dependencies = [ [[package]] name = "reth-rpc-types" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ + "alloy-genesis", "alloy-primitives", "alloy-rlp", "alloy-rpc-engine-types", @@ -5729,8 +5681,8 @@ dependencies = [ [[package]] name = "reth-rpc-types-compat" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "alloy-rpc-types", @@ -5740,8 +5692,8 @@ dependencies = [ [[package]] name = "reth-stages" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "aquamarine", "auto_impl", @@ -5751,6 +5703,7 @@ dependencies = [ "num-traits", "rayon", "reth-codecs", + "reth-config", "reth-db", "reth-etl", "reth-interfaces", @@ -5769,10 +5722,11 @@ dependencies = [ [[package]] name = "reth-static-file" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "clap", + "parking_lot 0.12.1", "rayon", "reth-db", "reth-interfaces", @@ -5786,8 +5740,8 @@ dependencies = [ [[package]] name = "reth-tasks" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "dyn-clone", "futures-util", @@ -5803,8 +5757,8 @@ dependencies = [ [[package]] name = "reth-tokio-util" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "tokio", "tokio-stream", @@ -5812,8 +5766,8 @@ dependencies = [ [[package]] name = "reth-tracing" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "clap", "eyre", @@ -5827,8 +5781,8 @@ dependencies = [ [[package]] name = "reth-transaction-pool" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-rlp", "aquamarine", @@ -5845,7 +5799,6 @@ dependencies = [ "reth-metrics", "reth-primitives", "reth-provider", - "reth-revm", "reth-tasks", "revm", "schnellru", @@ -5859,8 +5812,8 @@ dependencies = [ [[package]] name = "reth-trie" -version = "0.2.0-beta.1" -source = "git+https://github.com/paradigmxyz/reth.git?rev=82b6504#82b6504ef451edd0b466196c2c0b9f0f76ce48d6" +version = "0.2.0-beta.3" +source = "git+https://github.com/paradigmxyz/reth.git?rev=1a42b09#1a42b0929ffeb2b77e23cdfdd276d1a2e3f5820e" dependencies = [ "alloy-chains", "alloy-rlp", @@ -5878,9 +5831,9 @@ dependencies = [ [[package]] name = "revm" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217d21144d329f21d5245b8e6a46e0d6d0a527d9917d7a087f225b161e529169" +checksum = "24fd3ed4b62dc61c647552d8b781811ae25ec74d23309055077e4dfb392444d2" dependencies = [ "auto_impl", "cfg-if", @@ -5894,7 +5847,7 @@ dependencies = [ [[package]] name = "revm-inspectors" version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=1f935e7#1f935e71849466c297a64df0b162e6ffd48da25b" +source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=2b48b65#2b48b65f3880803f51883948c319012da09ecba7" dependencies = [ "alloy-primitives", "alloy-rpc-trace-types", @@ -5911,9 +5864,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776848391ed76d5103ca1aa1632cd21b521e2870afb30b63723da862d69efd0f" +checksum = "9f0a1818f8c876b0d71a0714217c34da7df8a42c0462750768779d55680e4554" dependencies = [ "revm-primitives", "serde", @@ -5921,9 +5874,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3fd1856a7cb09197a02669d779e1afb5a627b0888a24814ba2b6a1ad4c3ff8d" +checksum = "7a9645a70f1df1e5bd7fa8718b9ba486fac9c3f0467aa6b58e7f590d5f6fd0f7" dependencies = [ "aurora-engine-modexp", "c-kzg", @@ -5938,9 +5891,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4d7d3e793e907dc0797a9d3b43abfdf5226d133855214db9bd27d4cee33ebd" +checksum = "323ad597cf75ac9cb1d161be29fcc3562426f0278a1d04741697fca556e1ceea" dependencies = [ "alloy-primitives", "auto_impl", @@ -6228,9 +6181,9 @@ checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "ryu-js" -version = "0.2.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6518fc26bced4d53678a22d6e423e9d8716377def84545fe328236e3af070e7f" +checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" [[package]] name = "schannel" @@ -6958,6 +6911,37 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" +dependencies = [ + "libc", + "paste", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.34" @@ -6966,6 +6950,7 @@ checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "js-sys", "libc", "num-conv", "num_threads", @@ -7002,12 +6987,11 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8faa444297615a4e020acb64146b0603c9c395c03a97c17fd9028816d3b4d63e" +checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" dependencies = [ "displaydoc", - "serde", "zerovec", ] @@ -8042,11 +8026,10 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.9.6" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591691014119b87047ead4dcf3e6adfbf73cb7c38ab6980d4f18a32138f35d46" +checksum = "eff4439ae91fb5c72b8abc12f3f2dbf51bd27e6eadb9f8a5bc8898dddb0e27ea" dependencies = [ - "serde", "yoke", "zerofrom", "zerovec-derive", @@ -8054,9 +8037,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.9.6" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4a1638a1934450809c2266a70362bfc96cd90550c073f5b8a55014d1010157" +checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index dfb1b21..ba5939d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,25 +50,21 @@ alphanet-precompile = { path = "crates/precompile" } tokio = { version = "1.21", default-features = false } # reth -reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "82b6504", features = ["optimism"] } -reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "82b6504" } -reth-node-optimism = { git = "https://github.com/paradigmxyz/reth.git", rev = "82b6504" } -reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "82b6504" } +reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "1a42b09", features = ["optimism"] } +reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "1a42b09" } +reth-node-optimism = { git = "https://github.com/paradigmxyz/reth.git", rev = "1a42b09" } +reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "1a42b09" } # revm -revm = { version = "7.1.0", features = ["std", "secp256k1"], default-features = false } -revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "1f935e7" } -revm-interpreter = { version = "3.3.0", features = ["std"], default-features = false } -revm-precompile = { version = "5.0.0", features = ["std"], default-features = false } -revm-primitives = { version = "3.0.0", features = ["std"], default-features = false } +revm = { version = "7.2.0", features = ["std", "secp256k1"], default-features = false } +revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "2b48b65" } +revm-interpreter = { version = "3.4.0", features = ["std"], default-features = false } +revm-precompile = { version = "5.1.0", features = ["std"], default-features = false } +revm-primitives = { version = "3.1.0", features = ["std"], default-features = false } # misc clap = "4" eyre = "0.6.12" -secp256k1 = { version = "0.28.2", default-features = false, features = [ - "alloc", - "recovery", -] } tracing = "0.1.0" # misc-testing diff --git a/bin/alphanet/Cargo.toml b/bin/alphanet/Cargo.toml index b300394..e05359e 100644 --- a/bin/alphanet/Cargo.toml +++ b/bin/alphanet/Cargo.toml @@ -19,14 +19,14 @@ reth-node-optimism.workspace = true clap = { workspace = true, features = ["derive"] } [target.'cfg(not(windows))'.dependencies] -jemallocator = { version = "0.5", optional = true } +tikv-jemallocator = { version = "0.5", optional = true } [features] default = ["jemalloc"] asm-keccak = [] -jemalloc = ["dep:jemallocator"] -jemalloc-prof = ["jemalloc", "jemallocator?/profiling"] +jemalloc = ["dep:tikv-jemallocator"] +jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"] min-error-logs = ["tracing/release_max_level_error"] min-warn-logs = ["tracing/release_max_level_warn"] diff --git a/bin/alphanet/src/main.rs b/bin/alphanet/src/main.rs index 05a93b8..d3cd585 100644 --- a/bin/alphanet/src/main.rs +++ b/bin/alphanet/src/main.rs @@ -16,7 +16,7 @@ use reth_node_optimism::{args::RollupArgs, OptimismEngineTypes, OptimismNode}; // We use jemalloc for performance reasons. #[cfg(all(feature = "jemalloc", unix))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; fn main() { reth::sigsegv_handler::install(); diff --git a/crates/instructions/Cargo.toml b/crates/instructions/Cargo.toml index 92d7710..42314d8 100644 --- a/crates/instructions/Cargo.toml +++ b/crates/instructions/Cargo.toml @@ -12,8 +12,8 @@ categories.workspace = true [dependencies] revm.workspace = true revm-interpreter.workspace = true +revm-precompile.workspace = true revm-primitives.workspace = true -secp256k1.workspace = true [dev-dependencies] secp256k1 = { version = "0.28.2", default-features = false, features = [ diff --git a/crates/instructions/src/context.rs b/crates/instructions/src/context.rs new file mode 100644 index 0000000..be4072d --- /dev/null +++ b/crates/instructions/src/context.rs @@ -0,0 +1,110 @@ +use std::{cell::RefCell, collections::HashMap, rc::Rc}; + +#[derive(Clone, Default)] +/// Context variables to be used in instructions. The data set here is expected +/// to live for the duration of a single transaction. +/// Similar to TStore for arbitrary data. +pub struct InstructionsContext { + /// Contains the actual variables. Is meant to be accessed both for reads + /// and writes using interior mutability, so that the Instruction and + /// BoxedInstruction signatures are observed. + inner: Rc>>>, +} + +impl InstructionsContext { + /// Sets a value for the given key. + pub fn set(&self, key: &'static str, value: Vec) { + let _ = self.inner.borrow_mut().insert(key, value); + } + + /// Gets the value for the given key, if any. + pub fn get(&self, key: &'static str) -> Option> { + self.inner.borrow().get(&key).cloned() + } + + /// Empties inner state. + pub fn clear(&self) { + self.inner.borrow_mut().clear(); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use revm::{Evm, InMemoryDB}; + use revm_interpreter::Interpreter; + use revm_primitives::{address, AccountInfo, Bytecode, TransactTo, U256}; + use std::sync::Arc; + + #[test] + fn test_set_get() { + let ctx = InstructionsContext::default(); + let key = "my-key"; + let value = vec![0x01, 0x02]; + + ctx.set(key, value.clone()); + + let cloned_ctx = ctx.clone(); + assert_eq!(cloned_ctx.get(key).unwrap(), value); + } + + #[test] + fn test_context_variables_are_available_during_tx() { + let code = Bytecode::new_raw([0xEE, 0xEF, 0x00].into()); + let code_hash = code.hash_slow(); + let to_addr = address!("ffffffffffffffffffffffffffffffffffffffff"); + + // initialize the custom context and make sure it's None for a given key + let custom_context = InstructionsContext::default(); + let key = "my-key"; + assert_eq!(custom_context.get(key), None); + + let to_capture_instructions = custom_context.clone(); + let to_capture_post_execution = custom_context.clone(); + let mut evm = Evm::builder() + .with_db(InMemoryDB::default()) + .modify_db(|db| { + db.insert_account_info(to_addr, AccountInfo::new(U256::ZERO, 0, code_hash, code)) + }) + .modify_tx_env(|tx| tx.transact_to = TransactTo::Call(to_addr)) + .append_handler_register_box(Box::new(move |handler| { + let writer_context = to_capture_instructions.clone(); + let writer_instruction = Box::new( + move |_interp: &mut Interpreter, _host: &mut Evm<'_, (), InMemoryDB>| { + // write into the context variable. + writer_context.set(key, vec![0x01, 0x02]); + }, + ); + let reader_context = to_capture_instructions.clone(); + let reader_instruction = Box::new( + move |_interp: &mut Interpreter, _host: &mut Evm<'_, (), InMemoryDB>| { + // read from context variable and clear. + assert_eq!(reader_context.get(key).unwrap(), vec![0x01, 0x02]); + }, + ); + + let mut table = handler.take_instruction_table(); + table = table.map(|mut table| { + table.insert_boxed(0xEE, writer_instruction); + table.insert_boxed(0xEF, reader_instruction); + table + }); + handler.instruction_table = table; + + let post_execution_context = to_capture_post_execution.clone(); + #[allow(clippy::arc_with_non_send_sync)] + { + handler.post_execution.end = Arc::new(move |_, outcome: _| { + post_execution_context.clear(); + outcome + }); + } + })) + .build(); + + let _result_and_state = evm.transact().unwrap(); + + // ensure the custom context was cleared + assert_eq!(custom_context.get(key), None); + } +} diff --git a/crates/instructions/src/eip3074.rs b/crates/instructions/src/eip3074.rs index cdf865d..e59fb62 100644 --- a/crates/instructions/src/eip3074.rs +++ b/crates/instructions/src/eip3074.rs @@ -1,11 +1,8 @@ -use crate::InstructionWithOpCode; +use crate::{context::InstructionsContext, BoxedInstructionWithOpCode}; use revm::{Database, Evm}; -use revm_interpreter::{gas::memory_gas, next_multiple_of_32, InstructionResult, Interpreter}; +use revm_interpreter::{pop, resize_memory, InstructionResult, Interpreter}; +use revm_precompile::secp256k1::ecrecover; use revm_primitives::{alloy_primitives::B512, keccak256, Address, B256}; -use secp256k1::{ - ecdsa::{RecoverableSignature, RecoveryId}, - Message, Secp256k1, -}; const AUTH_OPCODE: u8 = 0xF6; const AUTHCALL_OPCODE: u8 = 0xF7; @@ -13,34 +10,38 @@ const MAGIC: u8 = 0x04; const WARM_AUTHORITY_GAS: u64 = 100; const COLD_AUTHORITY_GAS: u64 = 2600; const FIXED_FEE_GAS: u64 = 3100; +const AUTHORIZED_VAR_NAME: &str = "authorized"; + +/// eip3074 boxed instructions. +pub fn boxed_instructions<'a, EXT: 'a, DB: Database + 'a>( + context: InstructionsContext, +) -> impl Iterator>> { + let to_capture_for_auth = context.clone(); + let to_capture_for_authcall = context.clone(); + + let boxed_auth_instruction = + Box::new(move |interpreter: &mut Interpreter, evm: &mut Evm<'a, EXT, DB>| { + auth_instruction(interpreter, evm, &to_capture_for_auth); + }); + + let boxed_authcall_instruction = + Box::new(move |interpreter: &mut Interpreter, evm: &mut Evm<'a, EXT, DB>| { + authcall_instruction(interpreter, evm, &to_capture_for_authcall); + }); -/// eip3074 instructions. -pub fn instructions<'a, EXT: 'a, DB: Database + 'a>( -) -> impl Iterator>> { [ - InstructionWithOpCode { opcode: AUTH_OPCODE, instruction: auth_instruction:: }, - InstructionWithOpCode { + BoxedInstructionWithOpCode { + opcode: AUTH_OPCODE, + boxed_instruction: boxed_auth_instruction, + }, + BoxedInstructionWithOpCode { opcode: AUTHCALL_OPCODE, - instruction: authcall_instruction::, + boxed_instruction: boxed_authcall_instruction, }, ] .into_iter() } -// TODO: use ecrecover from revm-precompile::secp256k1. -fn ecrecover(sig: &B512, recid: u8, msg: &B256) -> Result { - let recid = RecoveryId::from_i32(recid as i32).expect("recovery ID is valid"); - let sig = RecoverableSignature::from_compact(sig.as_slice(), recid)?; - - let secp = Secp256k1::new(); - let msg = Message::from_digest(msg.0); - let public = secp.recover_ecdsa(&msg, &sig)?; - - let mut hash = keccak256(&public.serialize_uncompressed()[1..]); - hash[..12].fill(0); - Ok(hash) -} - // keccak256(MAGIC || chainId || nonce || invokerAddress || commit) fn compose_msg(chain_id: u64, nonce: u64, invoker_address: Address, commit: B256) -> B256 { let mut msg = [0u8; 129]; @@ -52,16 +53,14 @@ fn compose_msg(chain_id: u64, nonce: u64, invoker_address: Address, commit: B256 keccak256(msg.as_slice()) } -fn auth_instruction(interp: &mut Interpreter, evm: &mut Evm<'_, EXT, DB>) { +fn auth_instruction( + interp: &mut Interpreter, + evm: &mut Evm<'_, EXT, DB>, + ctx: &InstructionsContext, +) { interp.gas.record_cost(FIXED_FEE_GAS); - // TODO: use pop_ret! from revm-interpreter - if interp.stack.len() < 3 { - interp.instruction_result = InstructionResult::StackUnderflow; - return; - } - // SAFETY: length checked above - let (authority, offset, length) = unsafe { interp.stack.pop3_unsafe() }; + pop!(interp, authority, offset, length); let authority = Address::from_slice(&authority.to_be_bytes::<32>()[12..]); @@ -71,22 +70,9 @@ fn auth_instruction(interp: &mut Interpreter, evm: &mut Evm<' COLD_AUTHORITY_GAS }); // authority state fee - // TODO: use shared_memory_resize! from revm-interpreter let length = length.saturating_to::(); let offset = offset.saturating_to::(); - if length != 0 { - let size = offset.saturating_add(length); - if size > interp.shared_memory.len() { - let rounded_size = next_multiple_of_32(size); - - let words_num = rounded_size / 32; - if !interp.gas.record_memory(memory_gas(words_num)) { - interp.instruction_result = InstructionResult::MemoryLimitOOG; - return; - } - interp.shared_memory.resize(rounded_size); - } - } + resize_memory!(interp, offset, length); // read yParity, r, s and commit from memory using offset and length let y_parity = interp.shared_memory.get_byte(offset); @@ -118,22 +104,24 @@ fn auth_instruction(interp: &mut Interpreter, evm: &mut Evm<' } }; - let result = if Address::from_slice(&signer[12..]) == authority { - // TODO: set authorized context variable to authority - - B256::with_last_byte(1) + let (to_persist_authority, result) = if Address::from_slice(&signer[12..]) == authority { + (&signer[12..], B256::with_last_byte(1)) } else { - // TODO: authorized context variable is reset to unset value - - B256::ZERO + ((&[] as &[u8]), B256::ZERO) }; + ctx.set(AUTHORIZED_VAR_NAME, Vec::from(to_persist_authority)); + if let Err(e) = interp.stack.push_b256(result) { interp.instruction_result = e; } } -fn authcall_instruction(interp: &mut Interpreter, _evm: &mut Evm<'_, EXT, DB>) { +fn authcall_instruction( + interp: &mut Interpreter, + _evm: &mut Evm<'_, EXT, DB>, + _ctx: &InstructionsContext, +) { interp.gas.record_cost(133); } @@ -146,7 +134,7 @@ mod tests { }; use revm_interpreter::{Contract, SharedMemory, Stack}; use revm_primitives::{Account, Bytecode, Bytes, U256}; - use secp256k1::{rand, Context, PublicKey, SecretKey, Signing}; + use secp256k1::{rand, Context, Message, PublicKey, Secp256k1, SecretKey, Signing}; use std::convert::Infallible; fn setup_interpreter() -> Interpreter { @@ -170,11 +158,11 @@ mod tests { fn setup_evm() -> Evm<'static, (), CacheDB>> { Evm::builder() .with_db(InMemoryDB::default()) - .append_handler_register(|handler| { + .append_handler_register_box(Box::new(|handler| { if let Some(ref mut table) = handler.instruction_table { - table.insert(AUTH_OPCODE, auth_instruction); + table.insert_boxed(AUTH_OPCODE, Box::new(move |_interpreter, _handler| {})); } - }) + })) .build() } @@ -223,7 +211,7 @@ mod tests { let mut interpreter = setup_interpreter(); let mut evm = setup_evm(); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &InstructionsContext::default()); assert_eq!(interpreter.instruction_result, InstructionResult::StackUnderflow); // check gas @@ -247,8 +235,9 @@ mod tests { setup_shared_memory(&mut interpreter.shared_memory, y_parity, &r, &s); let mut evm = setup_evm(); + let context = InstructionsContext::default(); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &context); assert_eq!(interpreter.instruction_result, InstructionResult::Continue); let result = interpreter.stack.pop().unwrap(); @@ -258,7 +247,7 @@ mod tests { let expected_gas = FIXED_FEE_GAS + COLD_AUTHORITY_GAS; assert_eq!(expected_gas, interpreter.gas.spend()); - // TODO: check authorized context variable set + assert_eq!(context.get(AUTHORIZED_VAR_NAME).unwrap(), authority.to_vec()); } #[test] @@ -272,7 +261,7 @@ mod tests { let mut evm = setup_evm(); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &InstructionsContext::default()); assert_eq!(interpreter.instruction_result, InstructionResult::Stop); @@ -299,7 +288,7 @@ mod tests { let mut evm = setup_evm(); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &InstructionsContext::default()); assert_eq!(interpreter.instruction_result, InstructionResult::Continue); let result = interpreter.stack.pop().unwrap(); @@ -324,7 +313,7 @@ mod tests { let mut evm = setup_evm(); evm.context.evm.journaled_state.state.insert(authority, Account::default()); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &InstructionsContext::default()); assert_eq!(interpreter.instruction_result, InstructionResult::Continue); let result = interpreter.stack.pop().unwrap(); @@ -352,7 +341,7 @@ mod tests { let mut evm = setup_evm(); - auth_instruction(&mut interpreter, &mut evm); + auth_instruction(&mut interpreter, &mut evm, &InstructionsContext::default()); assert_eq!(interpreter.instruction_result, InstructionResult::Stop); diff --git a/crates/instructions/src/lib.rs b/crates/instructions/src/lib.rs index 45f38e4..600d74e 100644 --- a/crates/instructions/src/lib.rs +++ b/crates/instructions/src/lib.rs @@ -2,16 +2,18 @@ //! //! Custom instructions for Alphanet. -use revm_interpreter::Instruction; +use revm_interpreter::opcode::BoxedInstruction; /// EIP-3074 custom instructions. pub mod eip3074; -/// Association of OpCode and correspondent instruction. -#[derive(Clone, Debug)] -pub struct InstructionWithOpCode { +/// Instructions context. +pub mod context; + +/// Association of OpCode and correspondent boxed instruction. +pub struct BoxedInstructionWithOpCode<'a, H> { /// Opcode. pub opcode: u8, - /// Instruction. - pub instruction: Instruction, + /// Boxed instruction. + pub boxed_instruction: BoxedInstruction<'a, H>, } diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 3295cb6..c682861 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -1,4 +1,4 @@ -use alphanet_instructions::{eip3074, InstructionWithOpCode}; +use alphanet_instructions::{context::InstructionsContext, eip3074, BoxedInstructionWithOpCode}; use alphanet_precompile::{bls12_381, secp256r1}; use reth::{ primitives::{ @@ -32,14 +32,19 @@ where } } -// Inserts the given instructions with opcodes in the instructions table. -fn insert_instructions<'a, I, H>(table: &mut InstructionTables<'a, H>, instructions_with_opcodes: I) -where - I: Iterator>, +// Inserts the given boxed instructions with opcodes in the instructions table. +fn insert_boxed_instructions<'a, I, H>( + table: &mut InstructionTables<'a, H>, + boxed_instructions_with_opcodes: I, +) where + I: Iterator>, H: Host + 'a, { - for instruction_with_opcode in instructions_with_opcodes { - table.insert(instruction_with_opcode.opcode, instruction_with_opcode.instruction); + for boxed_instruction_with_opcode in boxed_instructions_with_opcodes { + table.insert_boxed( + boxed_instruction_with_opcode.opcode, + boxed_instruction_with_opcode.boxed_instruction, + ); } } @@ -78,7 +83,14 @@ impl AlphaNetEvmConfig { DB: Database, { if let Some(ref mut table) = handler.instruction_table { - insert_instructions(table, eip3074::instructions()); + let instructions_context = InstructionsContext::default(); + + insert_boxed_instructions( + table, + eip3074::boxed_instructions(instructions_context.clone()), + ); + + instructions_context.clear(); } } } diff --git a/crates/precompile/src/bls12_381.rs b/crates/precompile/src/bls12_381.rs index c7fa29a..ee902b5 100644 --- a/crates/precompile/src/bls12_381.rs +++ b/crates/precompile/src/bls12_381.rs @@ -4,7 +4,7 @@ use crate::addresses::{ BLS12_MAP_FP_TO_G1_ADDRESS, BLS12_PAIRING_ADDRESS, }; use bls12_381::{G1Affine, G1Projective}; -use revm_precompile::{Precompile, PrecompileWithAddress}; +use revm_precompile::{u64_to_address, Precompile, PrecompileWithAddress}; use revm_primitives::{Bytes, PrecompileError, PrecompileResult, B256}; use std::ops::Add; @@ -35,7 +35,7 @@ pub fn precompiles() -> impl Iterator { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G1ADD precompile. const BLS12_G1ADD: PrecompileWithAddress = - PrecompileWithAddress(crate::u64_to_address(BLS12_G1ADD_ADDRESS), Precompile::Standard(g1_add)); + PrecompileWithAddress(u64_to_address(BLS12_G1ADD_ADDRESS), Precompile::Standard(g1_add)); // Removes zeros with which the precompile inputs are left padded to 64 bytes. fn remove_padding(input: &[u8]) -> Result<[u8; FP_LENGTH], PrecompileError> { @@ -154,7 +154,7 @@ fn g1_add(input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G1MUL precompile. const BLS12_G1MUL: PrecompileWithAddress = - PrecompileWithAddress(crate::u64_to_address(BLS12_G1MUL_ADDRESS), Precompile::Standard(g1_mul)); + PrecompileWithAddress(u64_to_address(BLS12_G1MUL_ADDRESS), Precompile::Standard(g1_mul)); fn g1_mul(_input: &Bytes, gas_limit: u64) -> PrecompileResult { const G1MUL_BASE: u64 = 12000; @@ -167,7 +167,7 @@ fn g1_mul(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G1MULTIEXP precompile. const BLS12_G1MULTIEXP: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(BLS12_G1MULTIEXP_ADDRESS), + u64_to_address(BLS12_G1MULTIEXP_ADDRESS), Precompile::Standard(g1_multiexp), ); @@ -183,7 +183,7 @@ fn g1_multiexp(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G2ADD precompile. const BLS12_G2ADD: PrecompileWithAddress = - PrecompileWithAddress(crate::u64_to_address(BLS12_G2ADD_ADDRESS), Precompile::Standard(g2_add)); + PrecompileWithAddress(u64_to_address(BLS12_G2ADD_ADDRESS), Precompile::Standard(g2_add)); fn g2_add(_input: &Bytes, gas_limit: u64) -> PrecompileResult { const G2ADD_BASE: u64 = 800; @@ -196,7 +196,7 @@ fn g2_add(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G2MUL precompile. const BLS12_G2MUL: PrecompileWithAddress = - PrecompileWithAddress(crate::u64_to_address(BLS12_G2MUL_ADDRESS), Precompile::Standard(g2_mul)); + PrecompileWithAddress(u64_to_address(BLS12_G2MUL_ADDRESS), Precompile::Standard(g2_mul)); fn g2_mul(_input: &Bytes, gas_limit: u64) -> PrecompileResult { const G2MUL_BASE: u64 = 45000; @@ -209,7 +209,7 @@ fn g2_mul(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_G2MULTIEXP precompile. const BLS12_G2MULTIEXP: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(BLS12_G2MULTIEXP_ADDRESS), + u64_to_address(BLS12_G2MULTIEXP_ADDRESS), Precompile::Standard(g2_multiexp), ); @@ -224,10 +224,8 @@ fn g2_multiexp(_input: &Bytes, gas_limit: u64) -> PrecompileResult { } /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_PAIRING precompile. -const BLS12_PAIRING: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(BLS12_PAIRING_ADDRESS), - Precompile::Standard(pairing), -); +const BLS12_PAIRING: PrecompileWithAddress = + PrecompileWithAddress(u64_to_address(BLS12_PAIRING_ADDRESS), Precompile::Standard(pairing)); fn pairing(_input: &Bytes, gas_limit: u64) -> PrecompileResult { // TODO: make gas base depend on input k @@ -241,7 +239,7 @@ fn pairing(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_MAP_FP_TO_G1 precompile. const BLS12_MAP_FP_TO_G1: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(BLS12_MAP_FP_TO_G1_ADDRESS), + u64_to_address(BLS12_MAP_FP_TO_G1_ADDRESS), Precompile::Standard(map_fp_to_g1), ); @@ -257,7 +255,7 @@ fn map_fp_to_g1(_input: &Bytes, gas_limit: u64) -> PrecompileResult { /// [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537#specification) BLS12_MAP_FP2_TO_G2 precompile. const BLS12_MAP_FP2_TO_G2: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(BLS12_MAP_FP2_TO_G2_ADDRESS), + u64_to_address(BLS12_MAP_FP2_TO_G2_ADDRESS), Precompile::Standard(map_fp2_to_g2), ); diff --git a/crates/precompile/src/lib.rs b/crates/precompile/src/lib.rs index bfcda14..6a089b7 100644 --- a/crates/precompile/src/lib.rs +++ b/crates/precompile/src/lib.rs @@ -2,8 +2,6 @@ //! //! Implementations of EVM precompiled contracts for AlphaNet. -use revm_primitives::Address; - /// EIP-7212 secp256r1 precompile. pub mod secp256r1; @@ -11,15 +9,3 @@ pub mod secp256r1; pub mod bls12_381; mod addresses; - -/// Const function for making an address by concatenating the bytes from two given numbers. -/// -/// Note that 32 + 128 = 160 = 20 bytes (the length of an address). This function is used -/// as a convenience for specifying the addresses of the various precompiles. -#[inline] -const fn u64_to_address(x: u64) -> Address { - let x = x.to_be_bytes(); - Address::new([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], - ]) -} diff --git a/crates/precompile/src/secp256r1.rs b/crates/precompile/src/secp256r1.rs index d4fdc16..53276b0 100644 --- a/crates/precompile/src/secp256r1.rs +++ b/crates/precompile/src/secp256r1.rs @@ -1,6 +1,6 @@ use crate::addresses::P256VERIFY_ADDRESS; use p256::ecdsa::{signature::hazmat::PrehashVerifier, Signature, VerifyingKey}; -use revm_precompile::{Precompile, PrecompileWithAddress}; +use revm_precompile::{u64_to_address, Precompile, PrecompileWithAddress}; use revm_primitives::{Bytes, PrecompileError, PrecompileResult, B256}; /// secp256r1 precompiles @@ -9,10 +9,8 @@ pub fn precompiles() -> impl Iterator { } /// [EIP-7212](https://eips.ethereum.org/EIPS/eip-7212#specification) secp256r1 precompile. -const P256VERIFY: PrecompileWithAddress = PrecompileWithAddress( - crate::u64_to_address(P256VERIFY_ADDRESS), - Precompile::Standard(p256_verify), -); +const P256VERIFY: PrecompileWithAddress = + PrecompileWithAddress(u64_to_address(P256VERIFY_ADDRESS), Precompile::Standard(p256_verify)); /// The input is encoded as follows: /// | signed msg hash | r | s | pk x | pk y |