From 6b54ccd9804050b6b9b91faae700f189f957175e Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Wed, 6 Nov 2024 04:15:44 +0100 Subject: [PATCH 01/10] WIP --- Cargo.lock | 551 ++++++++++++++++++++++++------------ crates/node/Cargo.toml | 4 + crates/node/build.rs | 5 + crates/node/src/compiler.rs | 61 ++++ crates/node/src/evm.rs | 10 +- crates/node/src/lib.rs | 1 + 6 files changed, 448 insertions(+), 184 deletions(-) create mode 100644 crates/node/build.rs create mode 100644 crates/node/src/compiler.rs diff --git a/Cargo.lock b/Cargo.lock index e8ae4bc..1af97e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "156bfc5dcd52ef9a5f33381701fa03310317e14c65093a9430d3e3557b08dcd3" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "num_enum", "serde", @@ -135,13 +135,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41ed961a48297c732a5d97ee321aa8bb5009ecadbcb077d8bec90cb54e651629" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", "arbitrary", "auto_impl", "c-kzg", - "derive_more", + "derive_more 1.0.0", "serde", "serde_with", ] @@ -156,7 +156,7 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-provider", "alloy-rpc-types-eth", "alloy-sol-types", @@ -174,7 +174,7 @@ checksum = "eeb750349efda145ca6aada68d0336067f7f364d7d44ef09e2cf000b040c5e99" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-sol-types", ] @@ -186,11 +186,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f95d76a38cae906fd394a5afb0736aaceee5432efe76addfd71048e623e208af" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more", + "derive_more 1.0.0", "itoa", "serde", "serde_json", @@ -203,7 +203,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "arbitrary", "rand", @@ -216,10 +216,10 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "arbitrary", - "derive_more", + "derive_more 1.0.0", "k256", "rand", "serde", @@ -234,12 +234,12 @@ checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", "arbitrary", "c-kzg", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "once_cell", @@ -253,7 +253,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dde15e14944a88bd6a57d325e9a49b75558746fe16aaccc79713ae50a6a9574c" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-serde", "serde", ] @@ -264,7 +264,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c66eec1acdd96b39b995b8f5ee5239bc0c871d62c527ae1ac9fd1d7fecd455" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-sol-type-parser", "serde", "serde_json", @@ -276,7 +276,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af5979e0d5a7bf9c7eb79749121e8256e59021af611322aee56e77e20776b4b3" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-sol-types", "serde", "serde_json", @@ -294,7 +294,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -313,11 +313,33 @@ checksum = "cd15a0990fa8a56d85a42d6a689719aa4eebf5e2f1a5c5354658c0bfc52cac9a" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-serde", "serde", ] +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-primitives" version = "0.8.8" @@ -330,7 +352,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more", + "derive_more 1.0.0", "foldhash", "getrandom", "hashbrown 0.15.0", @@ -362,7 +384,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-eth", @@ -396,7 +418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "222cd9b17b1c5ad48de51a88ffbdb17f17145170288f22662f80ac88739125e6" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-transport", "bimap", "futures", @@ -437,7 +459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b2ab59712c594c9624aaa69e38e4d38f180cb569f1fa46cdaf8c21fd50793e5" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -461,7 +483,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eea9bf1abdd506f985a53533f5ac01296bcd6102c5e139bbc5d40bc468d2c916" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-serde", @@ -475,7 +497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea02c25541fb19eaac4278aa5c41d2d7e0245898887e54a74bfc0f3103e99415" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "serde", "serde_json", ] @@ -486,7 +508,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2382fc63fb0cf3e02818d547b80cb66cc49a31f8803d0c328402b2008bc13650" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-serde", "serde", ] @@ -498,7 +520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45357a642081c8ce235c0ad990c4e9279f5f18a723545076b38cfcc05cc25234" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "serde", "serde_with", @@ -511,7 +533,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5afe3ab1038f90faf56304aa0adf1e6a8c9844615d8f83967f932f3a70390b1" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "serde", ] @@ -523,10 +545,10 @@ checksum = "886d22d41992287a235af2f3af4299b5ced2bcafb81eb835572ad35747476946" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -545,11 +567,11 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", "alloy-sol-types", - "derive_more", + "derive_more 1.0.0", "itertools 0.13.0", "jsonrpsee-types", "serde", @@ -563,7 +585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3246948dfa5f5060a9abe04233d741ea656ef076b12958f3242416ce9f375058" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-serde", "serde", "serde_json", @@ -575,7 +597,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e5fb6c5c401321f802f69dcdb95b932f30f8158f6798793f914baac5995628e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -589,7 +611,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ad066b49c3b1b5f64cdd2399177a19926a6a15db2dbf11e2098de621f9e7480" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -601,7 +623,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028e72eaa9703e4882344983cfe7636ce06d8cce104a78ea62fd19b46659efc4" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "arbitrary", "serde", "serde_json", @@ -613,7 +635,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "592c185d7100258c041afac51877660c7bf6213447999787197db4842f0e938e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "async-trait", "auto_impl", "elliptic-curve", @@ -629,7 +651,7 @@ checksum = "6614f02fc1d5b079b2a4a5320018317b506fd0a6d67c1fd5542a71201724986c" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-signer", "async-trait", "coins-bip32", @@ -706,7 +728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e448d879903624863f608c552d10efb0e0905ddbee98b0049412799911eb062" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-sol-macro", "const-hex", "serde", @@ -771,10 +793,10 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fa8acead43cb238a7b7f47238c71137f4677a0b8d90e7e3be6e6ca59a28194e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "arrayvec", - "derive_more", + "derive_more 1.0.0", "nybbles", "serde", "smallvec", @@ -1840,6 +1862,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "convert_case" version = "0.6.0" @@ -2208,6 +2236,19 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.79", +] + [[package]] name = "derive_more" version = "1.0.0" @@ -2223,7 +2264,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case", + "convert_case 0.6.0", "proc-macro2", "quote", "syn 2.0.79", @@ -2500,7 +2541,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70cbccfccf81d67bff0ab36e591fa536c8a935b078a7b0e58c1d00d418332fc9" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "hex", "serde", "serde_derive", @@ -2513,7 +2554,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfbba28f4f3f32d92c06a64f5bf6c4537b5d4e21f28c689bd2bbaecfea4e0d3e" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "derivative", "ethereum_serde_utils", "itertools 0.13.0", @@ -3441,6 +3482,31 @@ dependencies = [ "serde", ] +[[package]] +name = "inkwell" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b597a7b2cdf279aeef6d7149071e35e4bc87c2cf05a5b7f2d731300bffe587ea" +dependencies = [ + "either", + "inkwell_internals", + "libc", + "llvm-sys", + "once_cell", + "thiserror", +] + +[[package]] +name = "inkwell_internals" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa4d8d74483041a882adaa9a29f633253a66dde85055f0495c121620ac484b2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "inotify" version = "0.9.6" @@ -4003,6 +4069,20 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +[[package]] +name = "llvm-sys" +version = "170.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1ee92492ae76bb6e24495ce15e311ba13ffb58c0140d89ac9910b92477cec8" +dependencies = [ + "anyhow", + "cc", + "lazy_static", + "libc", + "regex-lite", + "semver 1.0.23", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -4495,7 +4575,7 @@ name = "odyssey" version = "0.0.0" dependencies = [ "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-signer-local", "clap", "eyre", @@ -4527,7 +4607,7 @@ dependencies = [ name = "odyssey-node" version = "0.0.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "eyre", "reth-chainspec", "reth-cli", @@ -4544,6 +4624,8 @@ dependencies = [ "reth-revm", "reth-transaction-pool", "revm-precompile", + "revmc", + "revmc-build", "serde_json", "tracing", ] @@ -4553,7 +4635,7 @@ name = "odyssey-wallet" version = "0.0.0" dependencies = [ "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "jsonrpsee", "metrics", @@ -4598,11 +4680,11 @@ checksum = "99d49163f952491820088dd0e66f3a35d63337c3066eceff0a931bf83a8e2101" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", "arbitrary", - "derive_more", + "derive_more 1.0.0", "serde", "serde_with", "spin", @@ -4616,7 +4698,7 @@ checksum = "8e46c2ab105f679f0cbfbc3fb762f3456d4b8556c841e667fc8f3c2226eb6c1e" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-sol-types", "serde", "serde_repr", @@ -4630,7 +4712,7 @@ checksum = "75ff1ea317441b9eb6317b24d13f9088e3b14ef48b15bfb6a125ca404df036d8" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "op-alloy-consensus", "op-alloy-rpc-types", @@ -4644,10 +4726,10 @@ checksum = "6c439457b2a1791325603fc18a94cc175e0b4b1127f11ff8a45071f05d044dcb" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-serde", - "derive_more", + "derive_more 1.0.0", "op-alloy-consensus", "op-alloy-genesis", "serde", @@ -4662,7 +4744,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "alloy-serde", "op-alloy-consensus", @@ -4676,10 +4758,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a42a5ac4e07ed226b6a2aeefaad9b2cc7ec160e372ba626a4214d681a355fc2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "alloy-serde", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "op-alloy-protocol", "serde", @@ -5370,6 +5452,12 @@ dependencies = [ "regex-syntax 0.8.5", ] +[[package]] +name = "regex-lite" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -5454,7 +5542,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "futures-util", "reth-beacon-consensus", @@ -5474,7 +5562,7 @@ dependencies = [ "reth-tokio-util", "reth-transaction-pool", "reth-trie", - "revm-primitives", + "revm-primitives 13.0.0", "tokio", "tokio-stream", "tracing", @@ -5486,7 +5574,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "futures-core", "futures-util", @@ -5511,7 +5599,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "futures", "itertools 0.13.0", @@ -5547,7 +5635,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "aquamarine", "linked_hash_set", "metrics", @@ -5579,7 +5667,7 @@ name = "reth-blockchain-tree-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-consensus", "reth-execution-errors", "reth-primitives", @@ -5593,9 +5681,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", - "derive_more", + "derive_more 1.0.0", "metrics", "parking_lot", "pin-project", @@ -5620,9 +5708,9 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", - "derive_more", + "derive_more 1.0.0", "once_cell", "reth-ethereum-forks", "reth-network-peers", @@ -5652,7 +5740,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "ahash", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "backon", "clap", "comfy-table", @@ -5719,7 +5807,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "cfg-if", "eyre", "libc", @@ -5738,7 +5826,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-trie", "bytes", "modular-bitfield", @@ -5751,7 +5839,7 @@ name = "reth-codecs-derive" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "convert_case", + "convert_case 0.6.0", "proc-macro2", "quote", "syn 2.0.79", @@ -5777,9 +5865,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", - "derive_more", + "derive_more 1.0.0", "reth-primitives", ] @@ -5789,11 +5877,11 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-chainspec", "reth-consensus", "reth-primitives", - "revm-primitives", + "revm-primitives 13.0.0", ] [[package]] @@ -5803,7 +5891,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-provider", "alloy-rpc-types", "alloy-rpc-types-engine", @@ -5825,9 +5913,9 @@ name = "reth-db" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "bytes", - "derive_more", + "derive_more 1.0.0", "eyre", "metrics", "page_size", @@ -5857,9 +5945,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "bytes", - "derive_more", + "derive_more 1.0.0", "metrics", "modular-bitfield", "parity-scale-codec", @@ -5880,7 +5968,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "boyer-moore-magiclen", "eyre", "reth-chainspec", @@ -5907,7 +5995,7 @@ name = "reth-db-models" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "bytes", "modular-bitfield", "reth-codecs", @@ -5920,7 +6008,7 @@ name = "reth-discv4" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "discv5", "enr", @@ -5945,9 +6033,9 @@ name = "reth-discv5" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -5969,7 +6057,7 @@ name = "reth-dns-discovery" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "data-encoding", "enr", "linked_hash_set", @@ -5994,7 +6082,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "futures", "futures-util", @@ -6023,7 +6111,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "aes", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "block-padding", "byteorder", @@ -6053,7 +6141,7 @@ name = "reth-engine-local" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "eyre", "futures-util", @@ -6084,7 +6172,7 @@ name = "reth-engine-primitives" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-execution-types", "reth-payload-primitives", "reth-primitives", @@ -6121,7 +6209,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "futures", "metrics", @@ -6159,7 +6247,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "eyre", "futures", @@ -6177,7 +6265,7 @@ dependencies = [ "reth-revm", "reth-rpc-types-compat", "reth-trie", - "revm-primitives", + "revm-primitives 13.0.0", "serde", "serde_json", "tokio", @@ -6203,10 +6291,10 @@ name = "reth-eth-wire" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "bytes", - "derive_more", + "derive_more 1.0.0", "futures", "pin-project", "reth-chainspec", @@ -6232,10 +6320,10 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-chains", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "bytes", - "derive_more", + "derive_more 1.0.0", "reth-chainspec", "reth-codecs-derive", "reth-primitives", @@ -6260,7 +6348,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-chainspec", "reth-consensus", "reth-consensus-common", @@ -6274,7 +6362,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types-engine", "reth-chain-state", @@ -6293,7 +6381,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-chains", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "auto_impl", "crc", @@ -6320,7 +6408,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", "futures-util", "metrics", @@ -6336,7 +6424,7 @@ dependencies = [ "reth-revm", "reth-storage-errors", "revm", - "revm-primitives", + "revm-primitives 13.0.0", ] [[package]] @@ -6345,14 +6433,14 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "nybbles", "reth-consensus", "reth-prune-types", "reth-storage-errors", - "revm-primitives", + "revm-primitives 13.0.0", ] [[package]] @@ -6361,7 +6449,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-execution-errors", "reth-primitives", "reth-trie", @@ -6376,7 +6464,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "eyre", "futures", "itertools 0.13.0", @@ -6412,7 +6500,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-chain-state", "reth-execution-types", "serde", @@ -6434,7 +6522,7 @@ name = "reth-invalid-block-hooks" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types-debug", "eyre", @@ -6483,7 +6571,7 @@ dependencies = [ "bitflags 2.6.0", "byteorder", "dashmap 6.1.0", - "derive_more", + "derive_more 1.0.0", "indexmap 2.6.0", "parking_lot", "reth-mdbx-sys", @@ -6518,7 +6606,7 @@ name = "reth-net-banlist" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", ] [[package]] @@ -6541,11 +6629,11 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "aquamarine", "auto_impl", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -6591,10 +6679,10 @@ name = "reth-network-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-admin", "auto_impl", - "derive_more", + "derive_more 1.0.0", "enr", "futures", "reth-eth-wire-types", @@ -6615,9 +6703,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", - "derive_more", + "derive_more 1.0.0", "futures", "reth-consensus", "reth-eth-wire-types", @@ -6634,7 +6722,7 @@ name = "reth-network-peers" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "enr", "secp256k1", @@ -6665,7 +6753,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "anyhow", "bincode", - "derive_more", + "derive_more 1.0.0", "lz4_flex", "memmap2", "reth-fs-util", @@ -6703,7 +6791,7 @@ name = "reth-node-builder" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "aquamarine", "eyre", @@ -6768,11 +6856,11 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "clap", "const_format", - "derive_more", + "derive_more 1.0.0", "dirs-next", "eyre", "futures", @@ -6817,7 +6905,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "futures", "humantime", @@ -6878,8 +6966,8 @@ dependencies = [ "alloy-chains", "alloy-consensus", "alloy-genesis", - "alloy-primitives", - "derive_more", + "alloy-primitives 0.8.8", + "derive_more 1.0.0", "once_cell", "op-alloy-rpc-types", "reth-chainspec", @@ -6895,7 +6983,7 @@ name = "reth-optimism-cli" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "clap", "eyre", @@ -6940,7 +7028,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-chainspec", "reth-consensus", "reth-consensus-common", @@ -6958,8 +7046,8 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", - "derive_more", + "alloy-primitives 0.8.8", + "derive_more 1.0.0", "op-alloy-consensus", "reth-chainspec", "reth-consensus", @@ -6974,7 +7062,7 @@ dependencies = [ "reth-prune-types", "reth-revm", "revm", - "revm-primitives", + "revm-primitives 13.0.0", "tracing", ] @@ -6984,7 +7072,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-chains", - "alloy-primitives", + "alloy-primitives 0.8.8", "once_cell", "reth-ethereum-forks", "serde", @@ -6996,7 +7084,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "clap", "eyre", @@ -7036,7 +7124,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types-engine", "op-alloy-rpc-types-engine", @@ -7058,7 +7146,7 @@ dependencies = [ "reth-transaction-pool", "reth-trie", "revm", - "revm-primitives", + "revm-primitives 13.0.0", "sha2 0.10.8", "thiserror", "tracing", @@ -7070,7 +7158,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-primitives", ] @@ -7081,10 +7169,10 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "alloy-rpc-types-eth", - "derive_more", + "derive_more 1.0.0", "jsonrpsee-types", "op-alloy-consensus", "op-alloy-network", @@ -7120,7 +7208,7 @@ name = "reth-payload-builder" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "async-trait", "futures-util", @@ -7140,7 +7228,7 @@ name = "reth-payload-primitives" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "async-trait", "op-alloy-rpc-types-engine", @@ -7176,13 +7264,13 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types", "alloy-serde", "bytes", "c-kzg", - "derive_more", + "derive_more 1.0.0", "k256", "modular-bitfield", "once_cell", @@ -7195,7 +7283,7 @@ dependencies = [ "reth-primitives-traits", "reth-static-file-types", "reth-trie-common", - "revm-primitives", + "revm-primitives 13.0.0", "secp256k1", "serde", "serde_with", @@ -7210,14 +7298,14 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "byteorder", "bytes", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "reth-codecs", - "revm-primitives", + "revm-primitives 13.0.0", "roaring", "serde", "serde_with", @@ -7230,7 +7318,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "auto_impl", "dashmap 6.1.0", @@ -7272,7 +7360,7 @@ name = "reth-prune" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "itertools 0.13.0", "metrics", "rayon", @@ -7298,9 +7386,9 @@ name = "reth-prune-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "bytes", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "reth-codecs", "serde", @@ -7313,7 +7401,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "reth-execution-errors", "reth-primitives", "reth-prune-types", @@ -7333,7 +7421,7 @@ dependencies = [ "alloy-eips", "alloy-genesis", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types", "alloy-rpc-types-admin", @@ -7346,7 +7434,7 @@ dependencies = [ "alloy-signer", "alloy-signer-local", "async-trait", - "derive_more", + "derive_more 1.0.0", "futures", "http", "http-body", @@ -7378,7 +7466,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives", + "revm-primitives 13.0.0", "serde", "serde_json", "thiserror", @@ -7396,7 +7484,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "alloy-rpc-types-admin", "alloy-rpc-types-anvil", @@ -7457,7 +7545,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "async-trait", "jsonrpsee-core", @@ -7492,7 +7580,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "alloy-rpc-types-eth", "alloy-rpc-types-mev", @@ -7519,7 +7607,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives", + "revm-primitives 13.0.0", "tokio", "tracing", ] @@ -7531,12 +7619,12 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types", "alloy-rpc-types-eth", "alloy-serde", "alloy-sol-types", - "derive_more", + "derive_more 1.0.0", "futures", "itertools 0.13.0", "jsonrpsee-core", @@ -7559,7 +7647,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives", + "revm-primitives 13.0.0", "schnellru", "serde", "thiserror", @@ -7586,7 +7674,7 @@ name = "reth-rpc-server-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-engine", "jsonrpsee-core", "jsonrpsee-types", @@ -7604,7 +7692,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-rpc-types", "alloy-rpc-types-engine", @@ -7619,7 +7707,7 @@ name = "reth-stages" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "bincode", "futures-util", "itertools 0.13.0", @@ -7655,7 +7743,7 @@ name = "reth-stages-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "aquamarine", "auto_impl", "futures-util", @@ -7681,7 +7769,7 @@ name = "reth-stages-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "bytes", "modular-bitfield", "reth-codecs", @@ -7694,7 +7782,7 @@ name = "reth-static-file" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "parking_lot", "rayon", "reth-db", @@ -7713,9 +7801,9 @@ name = "reth-static-file-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "clap", - "derive_more", + "derive_more 1.0.0", "serde", "strum", ] @@ -7727,7 +7815,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", "reth-chainspec", "reth-db-api", @@ -7746,9 +7834,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "reth-fs-util", "reth-primitives", ] @@ -7803,7 +7891,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "aquamarine", "auto_impl", @@ -7838,7 +7926,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "auto_impl", "itertools 0.13.0", @@ -7863,16 +7951,16 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", "alloy-trie", "bytes", - "derive_more", + "derive_more 1.0.0", "itertools 0.13.0", "nybbles", "reth-codecs", "reth-primitives-traits", - "revm-primitives", + "revm-primitives 13.0.0", "serde", ] @@ -7881,9 +7969,9 @@ name = "reth-trie-db" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "metrics", "reth-db", "reth-db-api", @@ -7903,9 +7991,9 @@ name = "reth-trie-parallel" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "itertools 0.13.0", "metrics", "rayon", @@ -7929,7 +8017,7 @@ dependencies = [ "auto_impl", "cfg-if", "dyn-clone", - "revm-interpreter", + "revm-interpreter 13.0.0", "revm-precompile", "serde", "serde_json", @@ -7941,7 +8029,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e29c662f7887f3b659d4b0fd234673419a8fcbeaa1ecc29bf7034c0a75cc8ea" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.8", "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-sol-types", @@ -7954,13 +8042,23 @@ dependencies = [ "thiserror", ] +[[package]] +name = "revm-interpreter" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dfd24faa3cbbd96e0976103d1e174d6559b8036730f70415488ee21870d578" +dependencies = [ + "revm-primitives 5.0.0", + "serde", +] + [[package]] name = "revm-interpreter" version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fac2034454f8bc69dc7d3c94cdb1b57559e27f5ef0518771f1787de543d7d6a1" dependencies = [ - "revm-primitives", + "revm-primitives 13.0.0", "serde", ] @@ -7977,13 +8075,31 @@ dependencies = [ "k256", "once_cell", "p256", - "revm-primitives", + "revm-primitives 13.0.0", "ripemd", "secp256k1", "sha2 0.10.8", "substrate-bn", ] +[[package]] +name = "revm-primitives" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "902184a7a781550858d4b96707098da357429f1e4545806fd5b589f455555cf2" +dependencies = [ + "alloy-primitives 0.7.7", + "auto_impl", + "bitflags 2.6.0", + "bitvec", + "cfg-if", + "dyn-clone", + "enumn", + "hashbrown 0.14.5", + "hex", + "serde", +] + [[package]] name = "revm-primitives" version = "13.0.0" @@ -7992,7 +8108,7 @@ checksum = "0d11fa1e195b0bebaf3fb18596f314a13ba3a4cb1fdd16d3465934d812fd921e" dependencies = [ "alloy-eip2930", "alloy-eip7702", - "alloy-primitives", + "alloy-primitives 0.8.8", "auto_impl", "bitflags 2.6.0", "bitvec", @@ -8004,6 +8120,77 @@ dependencies = [ "serde", ] +[[package]] +name = "revmc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91951e23dfb93863e459256d86ee3359a964bb429f57240a375a2e556101a982" +dependencies = [ + "alloy-primitives 0.7.7", + "bitflags 2.6.0", + "bitvec", + "revm-interpreter 6.0.0", + "revm-primitives 5.0.0", + "revmc-backend", + "revmc-builtins", + "revmc-context", + "revmc-llvm", + "rustc-hash 2.0.0", + "tracing", +] + +[[package]] +name = "revmc-backend" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f08e1d1aeb4ce0608334809efdf24a07ca85829f40c1c176b0f3deece1bdfe" +dependencies = [ + "eyre", + "ruint", +] + +[[package]] +name = "revmc-build" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7ef41ac178871af98c273e3b03d51c66866f67b658504f653d98dd86846ebf" + +[[package]] +name = "revmc-builtins" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee90c6d3c8bd05fe75dd2cc1968f3d3cbdea0eddce52ae054393e5fd1617382" +dependencies = [ + "paste", + "revm-interpreter 6.0.0", + "revm-primitives 5.0.0", + "revmc-backend", + "revmc-context", + "tracing", +] + +[[package]] +name = "revmc-context" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcbfa8f2b9b66ee082e259a1266aecf2afab59111b8ca8a513a89497387cd43" +dependencies = [ + "revm-interpreter 6.0.0", + "revm-primitives 5.0.0", +] + +[[package]] +name = "revmc-llvm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9914a8ba4181de23826edcd8150d0108371a197462aeb01f874824392f23a638" +dependencies = [ + "inkwell", + "revmc-backend", + "rustc-hash 2.0.0", + "tracing", +] + [[package]] name = "rfc6979" version = "0.4.0" diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index e946e49..e45f38c 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -31,6 +31,10 @@ alloy-primitives.workspace = true serde_json.workspace = true tracing.workspace = true eyre.workspace = true +revmc = "0.1.0" [lints] workspace = true + +[build-dependencies] +revmc-build = "0.1.0" diff --git a/crates/node/build.rs b/crates/node/build.rs new file mode 100644 index 0000000..3893306 --- /dev/null +++ b/crates/node/build.rs @@ -0,0 +1,5 @@ +#![allow(missing_docs)] + +fn main() { + revmc_build::emit(); +} diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs new file mode 100644 index 0000000..2a4903d --- /dev/null +++ b/crates/node/src/compiler.rs @@ -0,0 +1,61 @@ +use reth_revm::{ + handler::register::EvmHandler, + interpreter::{InterpreterAction, SharedMemory}, + Context as RevmContext, Database, Frame, +}; +use std::sync::Arc; + +pub struct ExternalContext; + +pub fn register_compiler_handler(handler: &mut EvmHandler<'_, ExternalContext, DB>) +where + DB: Database, +{ + let f = handler.execution.execute_frame.clone(); + + handler.execution.execute_frame = Arc::new(move |frame, memory, table, context| { + let Some(action) = execute_frame(frame, memory, context) else { + return f(frame, memory, table, context); + }; + + Ok(action) + }); +} + +fn execute_frame( + frame: &mut Frame, + _memory: &mut SharedMemory, + _context: &mut RevmContext, +) -> Option { + // let library = context.external.get_or_load_library(context.evm.spec_id())?; + let interpreter = frame.interpreter_mut(); + + let _hash = match interpreter.contract.hash { + Some(hash) => hash, + None => unreachable_no_hash(), + }; + + None + + // let f = match library.get_function(hash) { + // Ok(Some(f)) => f, + // Ok(None) => return None, + // // Shouldn't happen. + // Err(err) => { + // unlikely_log_get_function_error(err, &hash); + // return None; + // } + // }; + + // interpreter.shared_memory = + // std::mem::replace(memory, reth_revm::interpreter::EMPTY_SHARED_MEMORY); + // let result = unsafe { f.call_with_interpreter(interpreter, context) }; + // *memory = interpreter.take_memory(); + // Some(result) +} + +#[cold] +#[inline(never)] +const fn unreachable_no_hash() -> ! { + panic!("unreachable: bytecode hash is not set in the interpreter") +} diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 45d6d06..f15c311 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -33,6 +33,8 @@ use reth_revm::{ use revm_precompile::secp256r1; use std::sync::Arc; +use crate::compiler::register_compiler_handler; + /// Custom EVM configuration #[derive(Debug, Clone)] pub struct OdysseyEvmConfig { @@ -221,12 +223,14 @@ impl ConfigureEvmEnv for OdysseyEvmConfig { } impl ConfigureEvm for OdysseyEvmConfig { - type DefaultExternalContext<'a> = (); + type DefaultExternalContext<'a> = crate::compiler::ExternalContext; fn evm(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> { EvmBuilder::default() .with_db(db) .optimism() + .reset_handler_with_external_context(crate::compiler::ExternalContext) + .append_handler_register(register_compiler_handler) // add additional precompiles .append_handler_register(Self::set_precompiles) .build() @@ -247,7 +251,9 @@ impl ConfigureEvm for OdysseyEvmConfig { .build() } - fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> {} + fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { + crate::compiler::ExternalContext + } } /// Determine the revm spec ID from the current block and reth chainspec. diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index c0e4ee6..b408ce2 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -16,5 +16,6 @@ #![warn(unused_crate_dependencies)] pub mod chainspec; +mod compiler; pub mod evm; pub mod node; From 3609a7ff9365b3a9dd843e82af5b4c77d6d738d1 Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Mon, 18 Nov 2024 10:01:37 -0500 Subject: [PATCH 02/10] WIP --- Cargo.lock | 441 +++++++++++++++++------------------- Cargo.toml | 3 + crates/node/Cargo.toml | 1 + crates/node/src/compiler.rs | 49 +++- crates/node/src/evm.rs | 8 +- crates/node/src/lib.rs | 2 +- 6 files changed, 254 insertions(+), 250 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1af97e2..8b3c261 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "156bfc5dcd52ef9a5f33381701fa03310317e14c65093a9430d3e3557b08dcd3" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "num_enum", "serde", @@ -135,13 +135,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41ed961a48297c732a5d97ee321aa8bb5009ecadbcb077d8bec90cb54e651629" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-serde", "arbitrary", "auto_impl", "c-kzg", - "derive_more 1.0.0", + "derive_more", "serde", "serde_with", ] @@ -156,7 +156,7 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-provider", "alloy-rpc-types-eth", "alloy-sol-types", @@ -174,7 +174,7 @@ checksum = "eeb750349efda145ca6aada68d0336067f7f364d7d44ef09e2cf000b040c5e99" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-sol-types", ] @@ -186,11 +186,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f95d76a38cae906fd394a5afb0736aaceee5432efe76addfd71048e623e208af" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more 1.0.0", + "derive_more", "itoa", "serde", "serde_json", @@ -203,23 +203,35 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "arbitrary", "rand", "serde", ] +[[package]] +name = "alloy-eip7702" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea59dc42102bc9a1905dc57901edc6dd48b9f38115df86c7d252acba70d71d04" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "k256", + "serde", +] + [[package]] name = "alloy-eip7702" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ffc577390ce50234e02d841214b3dc0bea6aaaae8e04bbf3cb82e9a45da9eb" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more 1.0.0", + "derive_more", "k256", "rand", "serde", @@ -233,13 +245,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" dependencies = [ "alloy-eip2930", - "alloy-eip7702", - "alloy-primitives 0.8.8", + "alloy-eip7702 0.3.2", + "alloy-primitives", "alloy-rlp", "alloy-serde", "arbitrary", "c-kzg", - "derive_more 1.0.0", + "derive_more", "ethereum_ssz", "ethereum_ssz_derive", "once_cell", @@ -253,7 +265,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dde15e14944a88bd6a57d325e9a49b75558746fe16aaccc79713ae50a6a9574c" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-serde", "serde", ] @@ -264,7 +276,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c66eec1acdd96b39b995b8f5ee5239bc0c871d62c527ae1ac9fd1d7fecd455" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-sol-type-parser", "serde", "serde_json", @@ -276,7 +288,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af5979e0d5a7bf9c7eb79749121e8256e59021af611322aee56e77e20776b4b3" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-sol-types", "serde", "serde_json", @@ -294,7 +306,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -313,33 +325,11 @@ checksum = "cd15a0990fa8a56d85a42d6a689719aa4eebf5e2f1a5c5354658c0bfc52cac9a" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-serde", "serde", ] -[[package]] -name = "alloy-primitives" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more 0.99.18", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", - "serde", - "tiny-keccak", -] - [[package]] name = "alloy-primitives" version = "0.8.8" @@ -352,7 +342,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more 1.0.0", + "derive_more", "foldhash", "getrandom", "hashbrown 0.15.0", @@ -384,7 +374,7 @@ dependencies = [ "alloy-json-rpc", "alloy-network", "alloy-network-primitives", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-eth", @@ -418,7 +408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "222cd9b17b1c5ad48de51a88ffbdb17f17145170288f22662f80ac88739125e6" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-transport", "bimap", "futures", @@ -459,7 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b2ab59712c594c9624aaa69e38e4d38f180cb569f1fa46cdaf8c21fd50793e5" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -483,7 +473,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eea9bf1abdd506f985a53533f5ac01296bcd6102c5e139bbc5d40bc468d2c916" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-serde", @@ -497,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea02c25541fb19eaac4278aa5c41d2d7e0245898887e54a74bfc0f3103e99415" dependencies = [ "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "serde", "serde_json", ] @@ -508,7 +498,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2382fc63fb0cf3e02818d547b80cb66cc49a31f8803d0c328402b2008bc13650" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-serde", "serde", ] @@ -520,7 +510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45357a642081c8ce235c0ad990c4e9279f5f18a723545076b38cfcc05cc25234" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "serde", "serde_with", @@ -533,7 +523,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5afe3ab1038f90faf56304aa0adf1e6a8c9844615d8f83967f932f3a70390b1" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "serde", ] @@ -545,10 +535,10 @@ checksum = "886d22d41992287a235af2f3af4299b5ced2bcafb81eb835572ad35747476946" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more 1.0.0", + "derive_more", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -567,11 +557,11 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-sol-types", - "derive_more 1.0.0", + "derive_more", "itertools 0.13.0", "jsonrpsee-types", "serde", @@ -585,7 +575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3246948dfa5f5060a9abe04233d741ea656ef076b12958f3242416ce9f375058" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-serde", "serde", "serde_json", @@ -597,7 +587,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e5fb6c5c401321f802f69dcdb95b932f30f8158f6798793f914baac5995628e" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -611,7 +601,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ad066b49c3b1b5f64cdd2399177a19926a6a15db2dbf11e2098de621f9e7480" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "serde", @@ -623,7 +613,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028e72eaa9703e4882344983cfe7636ce06d8cce104a78ea62fd19b46659efc4" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "arbitrary", "serde", "serde_json", @@ -635,7 +625,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "592c185d7100258c041afac51877660c7bf6213447999787197db4842f0e938e" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "async-trait", "auto_impl", "elliptic-curve", @@ -651,7 +641,7 @@ checksum = "6614f02fc1d5b079b2a4a5320018317b506fd0a6d67c1fd5542a71201724986c" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-signer", "async-trait", "coins-bip32", @@ -728,7 +718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e448d879903624863f608c552d10efb0e0905ddbee98b0049412799911eb062" dependencies = [ "alloy-json-abi", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-sol-macro", "const-hex", "serde", @@ -793,10 +783,10 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fa8acead43cb238a7b7f47238c71137f4677a0b8d90e7e3be6e6ca59a28194e" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "arrayvec", - "derive_more 1.0.0", + "derive_more", "nybbles", "serde", "smallvec", @@ -1862,12 +1852,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -2236,19 +2220,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version 0.4.1", - "syn 2.0.79", -] - [[package]] name = "derive_more" version = "1.0.0" @@ -2264,7 +2235,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.6.0", + "convert_case", "proc-macro2", "quote", "syn 2.0.79", @@ -2541,7 +2512,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70cbccfccf81d67bff0ab36e591fa536c8a935b078a7b0e58c1d00d418332fc9" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "hex", "serde", "serde_derive", @@ -2554,7 +2525,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfbba28f4f3f32d92c06a64f5bf6c4537b5d4e21f28c689bd2bbaecfea4e0d3e" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "derivative", "ethereum_serde_utils", "itertools 0.13.0", @@ -3484,9 +3455,9 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b597a7b2cdf279aeef6d7149071e35e4bc87c2cf05a5b7f2d731300bffe587ea" +checksum = "40fb405537710d51f6bdbc8471365ddd4cd6d3a3c3ad6e0c8291691031ba94b2" dependencies = [ "either", "inkwell_internals", @@ -3498,9 +3469,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa4d8d74483041a882adaa9a29f633253a66dde85055f0495c121620ac484b2" +checksum = "9dd28cfd4cfba665d47d31c08a6ba637eed16770abca2eccbbc3ca831fef1e44" dependencies = [ "proc-macro2", "quote", @@ -4071,9 +4042,9 @@ checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "llvm-sys" -version = "170.2.0" +version = "180.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1ee92492ae76bb6e24495ce15e311ba13ffb58c0140d89ac9910b92477cec8" +checksum = "778fa5fa02e32728e718f11eec147e6f134137399ab02fd2c13d32476337affa" dependencies = [ "anyhow", "cc", @@ -4575,7 +4546,7 @@ name = "odyssey" version = "0.0.0" dependencies = [ "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-signer-local", "clap", "eyre", @@ -4607,7 +4578,7 @@ dependencies = [ name = "odyssey-node" version = "0.0.0" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "eyre", "reth-chainspec", "reth-cli", @@ -4635,7 +4606,7 @@ name = "odyssey-wallet" version = "0.0.0" dependencies = [ "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "jsonrpsee", "metrics", @@ -4680,11 +4651,11 @@ checksum = "99d49163f952491820088dd0e66f3a35d63337c3066eceff0a931bf83a8e2101" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-serde", "arbitrary", - "derive_more 1.0.0", + "derive_more", "serde", "serde_with", "spin", @@ -4698,7 +4669,7 @@ checksum = "8e46c2ab105f679f0cbfbc3fb762f3456d4b8556c841e667fc8f3c2226eb6c1e" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-sol-types", "serde", "serde_repr", @@ -4712,7 +4683,7 @@ checksum = "75ff1ea317441b9eb6317b24d13f9088e3b14ef48b15bfb6a125ca404df036d8" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "op-alloy-consensus", "op-alloy-rpc-types", @@ -4726,10 +4697,10 @@ checksum = "6c439457b2a1791325603fc18a94cc175e0b4b1127f11ff8a45071f05d044dcb" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more 1.0.0", + "derive_more", "op-alloy-consensus", "op-alloy-genesis", "serde", @@ -4744,7 +4715,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", "op-alloy-consensus", @@ -4758,10 +4729,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a42a5ac4e07ed226b6a2aeefaad9b2cc7ec160e372ba626a4214d681a355fc2" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "alloy-serde", - "derive_more 1.0.0", + "derive_more", "ethereum_ssz", "op-alloy-protocol", "serde", @@ -5542,7 +5513,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "futures-util", "reth-beacon-consensus", @@ -5574,7 +5545,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "futures-core", "futures-util", @@ -5599,7 +5570,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "futures", "itertools 0.13.0", @@ -5635,7 +5606,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "aquamarine", "linked_hash_set", "metrics", @@ -5667,7 +5638,7 @@ name = "reth-blockchain-tree-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-consensus", "reth-execution-errors", "reth-primitives", @@ -5681,9 +5652,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "metrics", "parking_lot", "pin-project", @@ -5708,9 +5679,9 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "once_cell", "reth-ethereum-forks", "reth-network-peers", @@ -5740,7 +5711,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "ahash", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "backon", "clap", "comfy-table", @@ -5807,7 +5778,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "cfg-if", "eyre", "libc", @@ -5826,7 +5797,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-trie", "bytes", "modular-bitfield", @@ -5839,7 +5810,7 @@ name = "reth-codecs-derive" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "convert_case 0.6.0", + "convert_case", "proc-macro2", "quote", "syn 2.0.79", @@ -5865,9 +5836,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "reth-primitives", ] @@ -5877,7 +5848,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-chainspec", "reth-consensus", "reth-primitives", @@ -5891,7 +5862,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-provider", "alloy-rpc-types", "alloy-rpc-types-engine", @@ -5913,9 +5884,9 @@ name = "reth-db" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "bytes", - "derive_more 1.0.0", + "derive_more", "eyre", "metrics", "page_size", @@ -5945,9 +5916,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "bytes", - "derive_more 1.0.0", + "derive_more", "metrics", "modular-bitfield", "parity-scale-codec", @@ -5968,7 +5939,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "boyer-moore-magiclen", "eyre", "reth-chainspec", @@ -5995,7 +5966,7 @@ name = "reth-db-models" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "bytes", "modular-bitfield", "reth-codecs", @@ -6008,7 +5979,7 @@ name = "reth-discv4" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "discv5", "enr", @@ -6033,9 +6004,9 @@ name = "reth-discv5" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "discv5", "enr", "futures", @@ -6057,7 +6028,7 @@ name = "reth-dns-discovery" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "data-encoding", "enr", "linked_hash_set", @@ -6082,7 +6053,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "futures", "futures-util", @@ -6111,7 +6082,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "aes", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "block-padding", "byteorder", @@ -6141,7 +6112,7 @@ name = "reth-engine-local" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "eyre", "futures-util", @@ -6172,7 +6143,7 @@ name = "reth-engine-primitives" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-execution-types", "reth-payload-primitives", "reth-primitives", @@ -6209,7 +6180,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "futures", "metrics", @@ -6247,7 +6218,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "eyre", "futures", @@ -6291,10 +6262,10 @@ name = "reth-eth-wire" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "bytes", - "derive_more 1.0.0", + "derive_more", "futures", "pin-project", "reth-chainspec", @@ -6320,10 +6291,10 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-chains", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "bytes", - "derive_more 1.0.0", + "derive_more", "reth-chainspec", "reth-codecs-derive", "reth-primitives", @@ -6348,7 +6319,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-chainspec", "reth-consensus", "reth-consensus-common", @@ -6362,7 +6333,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types-engine", "reth-chain-state", @@ -6381,7 +6352,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-chains", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "auto_impl", "crc", @@ -6408,7 +6379,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", "futures-util", "metrics", @@ -6433,9 +6404,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "nybbles", "reth-consensus", "reth-prune-types", @@ -6449,7 +6420,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-execution-errors", "reth-primitives", "reth-trie", @@ -6464,7 +6435,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "eyre", "futures", "itertools 0.13.0", @@ -6500,7 +6471,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-chain-state", "reth-execution-types", "serde", @@ -6522,7 +6493,7 @@ name = "reth-invalid-block-hooks" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types-debug", "eyre", @@ -6571,7 +6542,7 @@ dependencies = [ "bitflags 2.6.0", "byteorder", "dashmap 6.1.0", - "derive_more 1.0.0", + "derive_more", "indexmap 2.6.0", "parking_lot", "reth-mdbx-sys", @@ -6606,7 +6577,7 @@ name = "reth-net-banlist" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", ] [[package]] @@ -6629,11 +6600,11 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "aquamarine", "auto_impl", - "derive_more 1.0.0", + "derive_more", "discv5", "enr", "futures", @@ -6679,10 +6650,10 @@ name = "reth-network-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-admin", "auto_impl", - "derive_more 1.0.0", + "derive_more", "enr", "futures", "reth-eth-wire-types", @@ -6703,9 +6674,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "futures", "reth-consensus", "reth-eth-wire-types", @@ -6722,7 +6693,7 @@ name = "reth-network-peers" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "enr", "secp256k1", @@ -6753,7 +6724,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "anyhow", "bincode", - "derive_more 1.0.0", + "derive_more", "lz4_flex", "memmap2", "reth-fs-util", @@ -6791,7 +6762,7 @@ name = "reth-node-builder" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "aquamarine", "eyre", @@ -6856,11 +6827,11 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "clap", "const_format", - "derive_more 1.0.0", + "derive_more", "dirs-next", "eyre", "futures", @@ -6905,7 +6876,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "futures", "humantime", @@ -6966,8 +6937,8 @@ dependencies = [ "alloy-chains", "alloy-consensus", "alloy-genesis", - "alloy-primitives 0.8.8", - "derive_more 1.0.0", + "alloy-primitives", + "derive_more", "once_cell", "op-alloy-rpc-types", "reth-chainspec", @@ -6983,7 +6954,7 @@ name = "reth-optimism-cli" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "clap", "eyre", @@ -7028,7 +6999,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-chainspec", "reth-consensus", "reth-consensus-common", @@ -7046,8 +7017,8 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", - "derive_more 1.0.0", + "alloy-primitives", + "derive_more", "op-alloy-consensus", "reth-chainspec", "reth-consensus", @@ -7072,7 +7043,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-chains", - "alloy-primitives 0.8.8", + "alloy-primitives", "once_cell", "reth-ethereum-forks", "serde", @@ -7084,7 +7055,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "clap", "eyre", @@ -7124,7 +7095,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types-engine", "op-alloy-rpc-types-engine", @@ -7158,7 +7129,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-primitives", ] @@ -7169,10 +7140,10 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "alloy-rpc-types-eth", - "derive_more 1.0.0", + "derive_more", "jsonrpsee-types", "op-alloy-consensus", "op-alloy-network", @@ -7208,7 +7179,7 @@ name = "reth-payload-builder" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "async-trait", "futures-util", @@ -7228,7 +7199,7 @@ name = "reth-payload-primitives" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "async-trait", "op-alloy-rpc-types-engine", @@ -7264,13 +7235,13 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types", "alloy-serde", "bytes", "c-kzg", - "derive_more 1.0.0", + "derive_more", "k256", "modular-bitfield", "once_cell", @@ -7298,11 +7269,11 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "byteorder", "bytes", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "reth-codecs", "revm-primitives 13.0.0", @@ -7318,7 +7289,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "auto_impl", "dashmap 6.1.0", @@ -7360,7 +7331,7 @@ name = "reth-prune" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "itertools 0.13.0", "metrics", "rayon", @@ -7386,9 +7357,9 @@ name = "reth-prune-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "bytes", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "reth-codecs", "serde", @@ -7401,7 +7372,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "reth-execution-errors", "reth-primitives", "reth-prune-types", @@ -7421,7 +7392,7 @@ dependencies = [ "alloy-eips", "alloy-genesis", "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types", "alloy-rpc-types-admin", @@ -7434,7 +7405,7 @@ dependencies = [ "alloy-signer", "alloy-signer-local", "async-trait", - "derive_more 1.0.0", + "derive_more", "futures", "http", "http-body", @@ -7484,7 +7455,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "alloy-rpc-types-admin", "alloy-rpc-types-anvil", @@ -7545,7 +7516,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "async-trait", "jsonrpsee-core", @@ -7580,7 +7551,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "alloy-rpc-types-eth", "alloy-rpc-types-mev", @@ -7619,12 +7590,12 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types", "alloy-rpc-types-eth", "alloy-serde", "alloy-sol-types", - "derive_more 1.0.0", + "derive_more", "futures", "itertools 0.13.0", "jsonrpsee-core", @@ -7674,7 +7645,7 @@ name = "reth-rpc-server-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-engine", "jsonrpsee-core", "jsonrpsee-types", @@ -7692,7 +7663,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-rpc-types", "alloy-rpc-types-engine", @@ -7707,7 +7678,7 @@ name = "reth-stages" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "bincode", "futures-util", "itertools 0.13.0", @@ -7743,7 +7714,7 @@ name = "reth-stages-api" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "aquamarine", "auto_impl", "futures-util", @@ -7769,7 +7740,7 @@ name = "reth-stages-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "bytes", "modular-bitfield", "reth-codecs", @@ -7782,7 +7753,7 @@ name = "reth-static-file" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "parking_lot", "rayon", "reth-db", @@ -7801,9 +7772,9 @@ name = "reth-static-file-types" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "clap", - "derive_more 1.0.0", + "derive_more", "serde", "strum", ] @@ -7815,7 +7786,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "auto_impl", "reth-chainspec", "reth-db-api", @@ -7834,9 +7805,9 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "reth-fs-util", "reth-primitives", ] @@ -7891,7 +7862,7 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "aquamarine", "auto_impl", @@ -7926,7 +7897,7 @@ version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "auto_impl", "itertools 0.13.0", @@ -7951,11 +7922,11 @@ source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce86 dependencies = [ "alloy-consensus", "alloy-genesis", - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", "alloy-trie", "bytes", - "derive_more 1.0.0", + "derive_more", "itertools 0.13.0", "nybbles", "reth-codecs", @@ -7969,9 +7940,9 @@ name = "reth-trie-db" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "metrics", "reth-db", "reth-db-api", @@ -7991,9 +7962,9 @@ name = "reth-trie-parallel" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=e98a050#e98a050dc7ce868d079587d8f417b51d80a36cc8" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "itertools 0.13.0", "metrics", "rayon", @@ -8029,7 +8000,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e29c662f7887f3b659d4b0fd234673419a8fcbeaa1ecc29bf7034c0a75cc8ea" dependencies = [ - "alloy-primitives 0.8.8", + "alloy-primitives", "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-sol-types", @@ -8044,11 +8015,11 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "6.0.0" +version = "10.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dfd24faa3cbbd96e0976103d1e174d6559b8036730f70415488ee21870d578" +checksum = "2e5e14002afae20b5bf1566f22316122f42f57517000e559c55b25bf7a49cba2" dependencies = [ - "revm-primitives 5.0.0", + "revm-primitives 10.0.0", "serde", ] @@ -8084,18 +8055,19 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "5.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902184a7a781550858d4b96707098da357429f1e4545806fd5b589f455555cf2" +checksum = "6f1525851a03aff9a9d6a1d018b414d76252d6802ab54695b27093ecd7e7a101" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-eip2930", + "alloy-eip7702 0.1.1", + "alloy-primitives", "auto_impl", "bitflags 2.6.0", "bitvec", "cfg-if", "dyn-clone", "enumn", - "hashbrown 0.14.5", "hex", "serde", ] @@ -8107,8 +8079,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d11fa1e195b0bebaf3fb18596f314a13ba3a4cb1fdd16d3465934d812fd921e" dependencies = [ "alloy-eip2930", - "alloy-eip7702", - "alloy-primitives 0.8.8", + "alloy-eip7702 0.3.2", + "alloy-primitives", "auto_impl", "bitflags 2.6.0", "bitvec", @@ -8123,14 +8095,13 @@ dependencies = [ [[package]] name = "revmc" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91951e23dfb93863e459256d86ee3359a964bb429f57240a375a2e556101a982" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-primitives", "bitflags 2.6.0", "bitvec", - "revm-interpreter 6.0.0", - "revm-primitives 5.0.0", + "either", + "revm-interpreter 10.0.3", + "revm-primitives 10.0.0", "revmc-backend", "revmc-builtins", "revmc-context", @@ -8142,8 +8113,6 @@ dependencies = [ [[package]] name = "revmc-backend" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f08e1d1aeb4ce0608334809efdf24a07ca85829f40c1c176b0f3deece1bdfe" dependencies = [ "eyre", "ruint", @@ -8158,12 +8127,10 @@ checksum = "8a7ef41ac178871af98c273e3b03d51c66866f67b658504f653d98dd86846ebf" [[package]] name = "revmc-builtins" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee90c6d3c8bd05fe75dd2cc1968f3d3cbdea0eddce52ae054393e5fd1617382" dependencies = [ "paste", - "revm-interpreter 6.0.0", - "revm-primitives 5.0.0", + "revm-interpreter 10.0.3", + "revm-primitives 10.0.0", "revmc-backend", "revmc-context", "tracing", @@ -8172,18 +8139,14 @@ dependencies = [ [[package]] name = "revmc-context" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcbfa8f2b9b66ee082e259a1266aecf2afab59111b8ca8a513a89497387cd43" dependencies = [ - "revm-interpreter 6.0.0", - "revm-primitives 5.0.0", + "revm-interpreter 10.0.3", + "revm-primitives 10.0.0", ] [[package]] name = "revmc-llvm" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9914a8ba4181de23826edcd8150d0108371a197462aeb01f874824392f23a638" dependencies = [ "inkwell", "revmc-backend", diff --git a/Cargo.toml b/Cargo.toml index f802366..85b2f5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -208,3 +208,6 @@ futures = "0.3" # misc-testing rstest = "0.18.2" + +[patch.crates-io] +revmc = { path = "../revmc/crates/revmc" } diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index e45f38c..91a4a65 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -33,6 +33,7 @@ tracing.workspace = true eyre.workspace = true revmc = "0.1.0" + [lints] workspace = true diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 2a4903d..e4b57f8 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -1,11 +1,31 @@ +use alloy_primitives::B256; use reth_revm::{ handler::register::EvmHandler, - interpreter::{InterpreterAction, SharedMemory}, + interpreter::{InterpreterAction, SharedMemory, EMPTY_SHARED_MEMORY}, Context as RevmContext, Database, Frame, }; +use revmc::EvmCompilerFn; use std::sync::Arc; +use std::{ + collections::HashMap, + sync::mpsc::{Receiver, Sender}, +}; + +#[derive(Debug)] +pub struct ExternalContext { + cache: HashMap, +} -pub struct ExternalContext; +impl ExternalContext { + pub fn new() -> Self { + let cache = HashMap::new(); + Self { cache } + } + + pub fn get_compiled_fn(&self, hash: B256) -> Option { + self.cache.get(&hash).cloned() + } +} pub fn register_compiler_handler(handler: &mut EvmHandler<'_, ExternalContext, DB>) where @@ -24,18 +44,18 @@ where fn execute_frame( frame: &mut Frame, - _memory: &mut SharedMemory, - _context: &mut RevmContext, + memory: &mut SharedMemory, + context: &mut RevmContext, ) -> Option { // let library = context.external.get_or_load_library(context.evm.spec_id())?; let interpreter = frame.interpreter_mut(); - let _hash = match interpreter.contract.hash { + let hash = match interpreter.contract.hash { Some(hash) => hash, None => unreachable_no_hash(), }; - None + let f = context.external.get_compiled_fn(hash)?; // let f = match library.get_function(hash) { // Ok(Some(f)) => f, @@ -52,6 +72,11 @@ fn execute_frame( // let result = unsafe { f.call_with_interpreter(interpreter, context) }; // *memory = interpreter.take_memory(); // Some(result) + + interpreter.shared_memory = std::mem::replace(memory, EMPTY_SHARED_MEMORY); + let result = unsafe { f.call_with_interpreter(interpreter, context) }; + *memory = interpreter.take_memory(); + Some(result) } #[cold] @@ -59,3 +84,15 @@ fn execute_frame( const fn unreachable_no_hash() -> ! { panic!("unreachable: bytecode hash is not set in the interpreter") } + +#[cold] +#[inline(never)] +const fn unreachable_misconfigured() -> ! { + panic!("unreachable: AOT EVM is misconfigured") +} + +#[cold] +#[inline(never)] +fn unlikely_log_get_function_error(err: impl std::error::Error, hash: &B256) { + tracing::error!(%err, %hash, "failed getting function from shared library"); +} diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index f15c311..a451f90 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -33,7 +33,7 @@ use reth_revm::{ use revm_precompile::secp256r1; use std::sync::Arc; -use crate::compiler::register_compiler_handler; +use crate::compiler::{self, register_compiler_handler}; /// Custom EVM configuration #[derive(Debug, Clone)] @@ -223,13 +223,13 @@ impl ConfigureEvmEnv for OdysseyEvmConfig { } impl ConfigureEvm for OdysseyEvmConfig { - type DefaultExternalContext<'a> = crate::compiler::ExternalContext; + type DefaultExternalContext<'a> = compiler::ExternalContext; fn evm(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> { EvmBuilder::default() .with_db(db) .optimism() - .reset_handler_with_external_context(crate::compiler::ExternalContext) + .reset_handler_with_external_context(compiler::ExternalContext::new()) .append_handler_register(register_compiler_handler) // add additional precompiles .append_handler_register(Self::set_precompiles) @@ -252,7 +252,7 @@ impl ConfigureEvm for OdysseyEvmConfig { } fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { - crate::compiler::ExternalContext + compiler::ExternalContext::new() } } diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index b408ce2..acd8dc9 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -16,6 +16,6 @@ #![warn(unused_crate_dependencies)] pub mod chainspec; -mod compiler; +pub mod compiler; pub mod evm; pub mod node; From 3824f00ace0876204f701dbdc40146179778f3ad Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Tue, 19 Nov 2024 16:43:46 -0500 Subject: [PATCH 03/10] WIP --- Cargo.lock | 89 ++++++++++--------------------------- crates/node/src/compiler.rs | 1 + 2 files changed, 25 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b3c261..9fabe40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -210,18 +210,6 @@ dependencies = [ "serde", ] -[[package]] -name = "alloy-eip7702" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea59dc42102bc9a1905dc57901edc6dd48b9f38115df86c7d252acba70d71d04" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "k256", - "serde", -] - [[package]] name = "alloy-eip7702" version = "0.3.2" @@ -245,7 +233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b69e06cf9c37be824b9d26d6d101114fdde6af0c87de2828b414c05c4b3daa71" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.3.2", + "alloy-eip7702", "alloy-primitives", "alloy-rlp", "alloy-serde", @@ -5533,7 +5521,7 @@ dependencies = [ "reth-tokio-util", "reth-transaction-pool", "reth-trie", - "revm-primitives 13.0.0", + "revm-primitives", "tokio", "tokio-stream", "tracing", @@ -5852,7 +5840,7 @@ dependencies = [ "reth-chainspec", "reth-consensus", "reth-primitives", - "revm-primitives 13.0.0", + "revm-primitives", ] [[package]] @@ -6236,7 +6224,7 @@ dependencies = [ "reth-revm", "reth-rpc-types-compat", "reth-trie", - "revm-primitives 13.0.0", + "revm-primitives", "serde", "serde_json", "tokio", @@ -6395,7 +6383,7 @@ dependencies = [ "reth-revm", "reth-storage-errors", "revm", - "revm-primitives 13.0.0", + "revm-primitives", ] [[package]] @@ -6411,7 +6399,7 @@ dependencies = [ "reth-consensus", "reth-prune-types", "reth-storage-errors", - "revm-primitives 13.0.0", + "revm-primitives", ] [[package]] @@ -7033,7 +7021,7 @@ dependencies = [ "reth-prune-types", "reth-revm", "revm", - "revm-primitives 13.0.0", + "revm-primitives", "tracing", ] @@ -7117,7 +7105,7 @@ dependencies = [ "reth-transaction-pool", "reth-trie", "revm", - "revm-primitives 13.0.0", + "revm-primitives", "sha2 0.10.8", "thiserror", "tracing", @@ -7254,7 +7242,7 @@ dependencies = [ "reth-primitives-traits", "reth-static-file-types", "reth-trie-common", - "revm-primitives 13.0.0", + "revm-primitives", "secp256k1", "serde", "serde_with", @@ -7276,7 +7264,7 @@ dependencies = [ "derive_more", "modular-bitfield", "reth-codecs", - "revm-primitives 13.0.0", + "revm-primitives", "roaring", "serde", "serde_with", @@ -7437,7 +7425,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives 13.0.0", + "revm-primitives", "serde", "serde_json", "thiserror", @@ -7578,7 +7566,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives 13.0.0", + "revm-primitives", "tokio", "tracing", ] @@ -7618,7 +7606,7 @@ dependencies = [ "reth-trie", "revm", "revm-inspectors", - "revm-primitives 13.0.0", + "revm-primitives", "schnellru", "serde", "thiserror", @@ -7931,7 +7919,7 @@ dependencies = [ "nybbles", "reth-codecs", "reth-primitives-traits", - "revm-primitives 13.0.0", + "revm-primitives", "serde", ] @@ -7988,7 +7976,7 @@ dependencies = [ "auto_impl", "cfg-if", "dyn-clone", - "revm-interpreter 13.0.0", + "revm-interpreter", "revm-precompile", "serde", "serde_json", @@ -8013,23 +8001,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "revm-interpreter" -version = "10.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5e14002afae20b5bf1566f22316122f42f57517000e559c55b25bf7a49cba2" -dependencies = [ - "revm-primitives 10.0.0", - "serde", -] - [[package]] name = "revm-interpreter" version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fac2034454f8bc69dc7d3c94cdb1b57559e27f5ef0518771f1787de543d7d6a1" dependencies = [ - "revm-primitives 13.0.0", + "revm-primitives", "serde", ] @@ -8046,32 +8024,13 @@ dependencies = [ "k256", "once_cell", "p256", - "revm-primitives 13.0.0", + "revm-primitives", "ripemd", "secp256k1", "sha2 0.10.8", "substrate-bn", ] -[[package]] -name = "revm-primitives" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f1525851a03aff9a9d6a1d018b414d76252d6802ab54695b27093ecd7e7a101" -dependencies = [ - "alloy-eip2930", - "alloy-eip7702 0.1.1", - "alloy-primitives", - "auto_impl", - "bitflags 2.6.0", - "bitvec", - "cfg-if", - "dyn-clone", - "enumn", - "hex", - "serde", -] - [[package]] name = "revm-primitives" version = "13.0.0" @@ -8079,7 +8038,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d11fa1e195b0bebaf3fb18596f314a13ba3a4cb1fdd16d3465934d812fd921e" dependencies = [ "alloy-eip2930", - "alloy-eip7702 0.3.2", + "alloy-eip7702", "alloy-primitives", "auto_impl", "bitflags 2.6.0", @@ -8100,8 +8059,8 @@ dependencies = [ "bitflags 2.6.0", "bitvec", "either", - "revm-interpreter 10.0.3", - "revm-primitives 10.0.0", + "revm-interpreter", + "revm-primitives", "revmc-backend", "revmc-builtins", "revmc-context", @@ -8129,8 +8088,8 @@ name = "revmc-builtins" version = "0.1.0" dependencies = [ "paste", - "revm-interpreter 10.0.3", - "revm-primitives 10.0.0", + "revm-interpreter", + "revm-primitives", "revmc-backend", "revmc-context", "tracing", @@ -8140,8 +8099,8 @@ dependencies = [ name = "revmc-context" version = "0.1.0" dependencies = [ - "revm-interpreter 10.0.3", - "revm-primitives 10.0.0", + "revm-interpreter", + "revm-primitives", ] [[package]] diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index e4b57f8..86a13ef 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -74,6 +74,7 @@ fn execute_frame( // Some(result) interpreter.shared_memory = std::mem::replace(memory, EMPTY_SHARED_MEMORY); + let result = unsafe { f.call_with_interpreter(interpreter, context) }; *memory = interpreter.take_memory(); Some(result) From 777066c1270fc101158135859407e1dfd7f9977c Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Wed, 20 Nov 2024 16:48:44 -0500 Subject: [PATCH 04/10] WIP --- crates/node/src/compiler.rs | 70 +++++++++++++++++++++++++++++++------ crates/node/src/evm.rs | 9 +++-- 2 files changed, 66 insertions(+), 13 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 86a13ef..3a1f84e 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -1,29 +1,69 @@ -use alloy_primitives::B256; +use alloy_primitives::{hex, Bytes, B256}; +use core::panic; +use reth_primitives::Bytecode; use reth_revm::{ handler::register::EvmHandler, interpreter::{InterpreterAction, SharedMemory, EMPTY_SHARED_MEMORY}, Context as RevmContext, Database, Frame, }; -use revmc::EvmCompilerFn; -use std::sync::Arc; +use revmc::{primitives::SpecId, EvmCompilerFn, EvmLlvmBackend, OptimizationLevel}; use std::{ collections::HashMap, - sync::mpsc::{Receiver, Sender}, + sync::{ + mpsc::{Receiver, Sender}, + Arc, Mutex, + }, + thread, }; #[derive(Debug)] pub struct ExternalContext { - cache: HashMap, + sender: Sender<(B256, Bytes)>, + // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) + cache: Arc>>, } impl ExternalContext { - pub fn new() -> Self { - let cache = HashMap::new(); - Self { cache } + pub fn new(spec_id: SpecId) -> Self { + let cache = Arc::new(Mutex::new(HashMap::new())); + let (sender, receiver) = std::sync::mpsc::channel(); + + // TODO: graceful shutdown + thread::spawn({ + let cache = cache.clone(); + + move || { + let context = Box::leak(Box::new(revmc::llvm::Context::create())); + // TODO: fail properly here. + let backend = + EvmLlvmBackend::new(context, false, OptimizationLevel::Aggressive).unwrap(); + let mut compiler = revmc::EvmCompiler::new(backend); + + while let Ok((hash, code)) = receiver.recv() { + // Do we have to allocate here? Not sure there's a better option + let name = hex::encode(hash); + dbg!("compiled", &name); + + let result = + unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); + + cache.lock().unwrap().insert(hash, result); + + unsafe { compiler.clear().expect("could not clear") }; + } + } + }); + + Self { sender, cache } } - pub fn get_compiled_fn(&self, hash: B256) -> Option { - self.cache.get(&hash).cloned() + pub fn get_compiled_fn(&self, hash: B256, code: Bytes) -> Option { + let Some(f) = self.cache.lock().unwrap().get(&hash).cloned() else { + self.sender.send((hash, code)).unwrap(); + return None; + }; + + Some(f) } } @@ -35,6 +75,7 @@ where handler.execution.execute_frame = Arc::new(move |frame, memory, table, context| { let Some(action) = execute_frame(frame, memory, context) else { + dbg!("fallback"); return f(frame, memory, table, context); }; @@ -55,7 +96,11 @@ fn execute_frame( None => unreachable_no_hash(), }; - let f = context.external.get_compiled_fn(hash)?; + // should be cheap enough to clone because it's backed by bytes::Bytes + let code = interpreter.contract.bytecode.bytes(); + + // TODO: put rules here for whether or not to compile the function + let f = context.external.get_compiled_fn(hash, code)?; // let f = match library.get_function(hash) { // Ok(Some(f)) => f, @@ -77,6 +122,9 @@ fn execute_frame( let result = unsafe { f.call_with_interpreter(interpreter, context) }; *memory = interpreter.take_memory(); + + dbg!("executed", &hash); + Some(result) } diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index a451f90..090f521 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -229,7 +229,7 @@ impl ConfigureEvm for OdysseyEvmConfig { EvmBuilder::default() .with_db(db) .optimism() - .reset_handler_with_external_context(compiler::ExternalContext::new()) + .reset_handler_with_external_context(self.default_external_context()) .append_handler_register(register_compiler_handler) // add additional precompiles .append_handler_register(Self::set_precompiles) @@ -252,7 +252,12 @@ impl ConfigureEvm for OdysseyEvmConfig { } fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { - compiler::ExternalContext::new() + let Self { chain_spec } = self; + + // TODO: not sure if this is correct, I don't see a call-site for this method + let spec_id = revm_spec(chain_spec, &Head::default()); + + compiler::ExternalContext::new(spec_id) } } From 8600d163054afd5f6fa50e108ce79ae949811383 Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Wed, 20 Nov 2024 17:21:04 -0500 Subject: [PATCH 05/10] Don't mess around with the interpreter's memory --- crates/node/src/compiler.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 3a1f84e..b73103f 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -118,10 +118,7 @@ fn execute_frame( // *memory = interpreter.take_memory(); // Some(result) - interpreter.shared_memory = std::mem::replace(memory, EMPTY_SHARED_MEMORY); - - let result = unsafe { f.call_with_interpreter(interpreter, context) }; - *memory = interpreter.take_memory(); + let result = unsafe { f.call_with_interpreter_and_memory(interpreter, memory, context) }; dbg!("executed", &hash); From 6ecbdf0cb0f58733c79de21042287be3c07b504a Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Sun, 24 Nov 2024 13:17:36 -0500 Subject: [PATCH 06/10] Create a new compiler on every message received --- crates/node/src/compiler.rs | 42 ++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index b73103f..2cf0a04 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -6,7 +6,10 @@ use reth_revm::{ interpreter::{InterpreterAction, SharedMemory, EMPTY_SHARED_MEMORY}, Context as RevmContext, Database, Frame, }; -use revmc::{primitives::SpecId, EvmCompilerFn, EvmLlvmBackend, OptimizationLevel}; +use revmc::{ + llvm::Context as LlvmContext, primitives::SpecId, EvmCompiler, EvmCompilerFn, EvmLlvmBackend, + OptimizationLevel, +}; use std::{ collections::HashMap, sync::{ @@ -20,7 +23,7 @@ use std::{ pub struct ExternalContext { sender: Sender<(B256, Bytes)>, // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) - cache: Arc>>, + cache: Arc>>>, } impl ExternalContext { @@ -33,13 +36,21 @@ impl ExternalContext { let cache = cache.clone(); move || { - let context = Box::leak(Box::new(revmc::llvm::Context::create())); - // TODO: fail properly here. - let backend = - EvmLlvmBackend::new(context, false, OptimizationLevel::Aggressive).unwrap(); - let mut compiler = revmc::EvmCompiler::new(backend); + dbg!("spawned thread"); + // this is wrong, I keep spawning threads. I need to spawn a single llvm context for this to work properly. + // I can do this with a thread-pool once I get it working with a single compiler thread. + + let ctx = LlvmContext::create(); + // let mut compilers = Vec::new(); while let Ok((hash, code)) = receiver.recv() { + cache.lock().unwrap().insert(hash, None); + + // TODO: fail properly here. + let backend = + EvmLlvmBackend::new(&ctx, false, OptimizationLevel::Aggressive).unwrap(); + let mut compiler = Box::leak(Box::new(EvmCompiler::new(backend))); + // Do we have to allocate here? Not sure there's a better option let name = hex::encode(hash); dbg!("compiled", &name); @@ -47,9 +58,9 @@ impl ExternalContext { let result = unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); - cache.lock().unwrap().insert(hash, result); + cache.lock().unwrap().insert(hash, Some(result)); - unsafe { compiler.clear().expect("could not clear") }; + // compilers.push(compiler); } } }); @@ -58,12 +69,13 @@ impl ExternalContext { } pub fn get_compiled_fn(&self, hash: B256, code: Bytes) -> Option { - let Some(f) = self.cache.lock().unwrap().get(&hash).cloned() else { - self.sender.send((hash, code)).unwrap(); - return None; - }; - - Some(f) + match self.cache.lock().unwrap().get(&hash) { + Some(maybe_f) => maybe_f.as_ref().cloned(), + None => { + self.sender.send((hash, code)).unwrap(); + return None; + } + } } } From 22e9290107db1838a4a291af4e21c68f4972067a Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Sun, 24 Nov 2024 20:18:40 -0500 Subject: [PATCH 07/10] Send spec-id with each compilation --- crates/node/src/compiler.rs | 23 +++++++++++++++-------- crates/node/src/evm.rs | 10 +++------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 2cf0a04..f523030 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -21,13 +21,13 @@ use std::{ #[derive(Debug)] pub struct ExternalContext { - sender: Sender<(B256, Bytes)>, + sender: Sender<(SpecId, B256, Bytes)>, // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) cache: Arc>>>, } impl ExternalContext { - pub fn new(spec_id: SpecId) -> Self { + pub fn new() -> Self { let cache = Arc::new(Mutex::new(HashMap::new())); let (sender, receiver) = std::sync::mpsc::channel(); @@ -36,14 +36,14 @@ impl ExternalContext { let cache = cache.clone(); move || { - dbg!("spawned thread"); + dbg!("SPAWNED THREAD"); // this is wrong, I keep spawning threads. I need to spawn a single llvm context for this to work properly. // I can do this with a thread-pool once I get it working with a single compiler thread. let ctx = LlvmContext::create(); // let mut compilers = Vec::new(); - while let Ok((hash, code)) = receiver.recv() { + while let Ok((spec_id, hash, code)) = receiver.recv() { cache.lock().unwrap().insert(hash, None); // TODO: fail properly here. @@ -68,11 +68,16 @@ impl ExternalContext { Self { sender, cache } } - pub fn get_compiled_fn(&self, hash: B256, code: Bytes) -> Option { + pub fn get_compiled_fn( + &self, + spec_id: SpecId, + hash: B256, + code: Bytes, + ) -> Option { match self.cache.lock().unwrap().get(&hash) { Some(maybe_f) => maybe_f.as_ref().cloned(), None => { - self.sender.send((hash, code)).unwrap(); + self.sender.send((spec_id, hash, code)).unwrap(); return None; } } @@ -84,9 +89,10 @@ where DB: Database, { let f = handler.execution.execute_frame.clone(); + let spec_id = handler.cfg.spec_id; handler.execution.execute_frame = Arc::new(move |frame, memory, table, context| { - let Some(action) = execute_frame(frame, memory, context) else { + let Some(action) = execute_frame(spec_id, frame, memory, context) else { dbg!("fallback"); return f(frame, memory, table, context); }; @@ -96,6 +102,7 @@ where } fn execute_frame( + spec_id: SpecId, frame: &mut Frame, memory: &mut SharedMemory, context: &mut RevmContext, @@ -112,7 +119,7 @@ fn execute_frame( let code = interpreter.contract.bytecode.bytes(); // TODO: put rules here for whether or not to compile the function - let f = context.external.get_compiled_fn(hash, code)?; + let f = context.external.get_compiled_fn(spec_id, hash, code)?; // let f = match library.get_function(hash) { // Ok(Some(f)) => f, diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 090f521..2feb2ce 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -43,7 +43,8 @@ pub struct OdysseyEvmConfig { impl OdysseyEvmConfig { /// Creates a new Odyssey EVM configuration with the given chain spec. - pub const fn new(chain_spec: Arc) -> Self { + pub fn new(chain_spec: Arc) -> Self { + dbg!("EVM CONFIG"); Self { chain_spec } } @@ -252,12 +253,7 @@ impl ConfigureEvm for OdysseyEvmConfig { } fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { - let Self { chain_spec } = self; - - // TODO: not sure if this is correct, I don't see a call-site for this method - let spec_id = revm_spec(chain_spec, &Head::default()); - - compiler::ExternalContext::new(spec_id) + compiler::ExternalContext::new() } } From dce624123ddba10c4638e9f23754a12a504d876f Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Sun, 24 Nov 2024 21:14:02 -0500 Subject: [PATCH 08/10] Move the compiler to the Odyssey config I thought that the context was created once per config, but that was not the case. This commit moves the compiler thread initialization to the config initialization and it all seems to work. --- crates/node/src/compiler.rs | 44 ++++------------------------- crates/node/src/evm.rs | 55 +++++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 44 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index f523030..3531368 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -27,44 +27,10 @@ pub struct ExternalContext { } impl ExternalContext { - pub fn new() -> Self { - let cache = Arc::new(Mutex::new(HashMap::new())); - let (sender, receiver) = std::sync::mpsc::channel(); - - // TODO: graceful shutdown - thread::spawn({ - let cache = cache.clone(); - - move || { - dbg!("SPAWNED THREAD"); - // this is wrong, I keep spawning threads. I need to spawn a single llvm context for this to work properly. - // I can do this with a thread-pool once I get it working with a single compiler thread. - - let ctx = LlvmContext::create(); - // let mut compilers = Vec::new(); - - while let Ok((spec_id, hash, code)) = receiver.recv() { - cache.lock().unwrap().insert(hash, None); - - // TODO: fail properly here. - let backend = - EvmLlvmBackend::new(&ctx, false, OptimizationLevel::Aggressive).unwrap(); - let mut compiler = Box::leak(Box::new(EvmCompiler::new(backend))); - - // Do we have to allocate here? Not sure there's a better option - let name = hex::encode(hash); - dbg!("compiled", &name); - - let result = - unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); - - cache.lock().unwrap().insert(hash, Some(result)); - - // compilers.push(compiler); - } - } - }); - + pub fn new( + sender: Sender<(SpecId, alloy_primitives::FixedBytes<32>, Bytes)>, + cache: Arc>>>, + ) -> Self { Self { sender, cache } } @@ -139,7 +105,7 @@ fn execute_frame( let result = unsafe { f.call_with_interpreter_and_memory(interpreter, memory, context) }; - dbg!("executed", &hash); + dbg!("EXECUTED", &hash); Some(result) } diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 2feb2ce..13f0443 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -10,7 +10,7 @@ //! This currently configures the instructions defined in [EIP3074-instructions](https://github.com/paradigmxyz/eip3074-instructions), and the //! precompiles defined by [`revm_precompile`]. -use alloy_primitives::{Address, Bytes, TxKind, U256}; +use alloy_primitives::{hex, Address, Bytes, TxKind, B256, U256}; use reth_chainspec::{ChainSpec, EthereumHardfork, Head}; use reth_node_api::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes}; use reth_optimism_chainspec::OpChainSpec; @@ -31,7 +31,14 @@ use reth_revm::{ ContextPrecompiles, Database, Evm, EvmBuilder, GetInspector, }; use revm_precompile::secp256r1; -use std::sync::Arc; +use revmc::{ + llvm::Context as LlvmContext, EvmCompiler, EvmCompilerFn, EvmLlvmBackend, OptimizationLevel, +}; +use std::{ + collections::HashMap, + sync::{mpsc::Sender, Arc, Mutex}, + thread, +}; use crate::compiler::{self, register_compiler_handler}; @@ -39,13 +46,51 @@ use crate::compiler::{self, register_compiler_handler}; #[derive(Debug, Clone)] pub struct OdysseyEvmConfig { chain_spec: Arc, + sender: Sender<(SpecId, B256, Bytes)>, + // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) + cache: Arc>>>, } impl OdysseyEvmConfig { /// Creates a new Odyssey EVM configuration with the given chain spec. pub fn new(chain_spec: Arc) -> Self { - dbg!("EVM CONFIG"); - Self { chain_spec } + let cache = Arc::new(Mutex::new(HashMap::new())); + let (sender, receiver) = std::sync::mpsc::channel(); + + // TODO: graceful shutdown + thread::spawn({ + let cache = cache.clone(); + + move || { + // this is wrong, I keep spawning threads. I need to spawn a single llvm context for this to work properly. + // I can do this with a thread-pool once I get it working with a single compiler thread. + + let ctx = LlvmContext::create(); + // let mut compilers = Vec::new(); + + while let Ok((spec_id, hash, code)) = receiver.recv() { + cache.lock().unwrap().insert(hash, None); + + // TODO: fail properly here. + let backend = + EvmLlvmBackend::new(&ctx, false, OptimizationLevel::Aggressive).unwrap(); + let mut compiler = Box::leak(Box::new(EvmCompiler::new(backend))); + + // Do we have to allocate here? Not sure there's a better option + let name = hex::encode(hash); + dbg!("compiled", &name); + + let result = + unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); + + cache.lock().unwrap().insert(hash, Some(result)); + + // compilers.push(compiler); + } + } + }); + + Self { chain_spec, cache, sender } } /// Sets the precompiles to the EVM handler @@ -253,7 +298,7 @@ impl ConfigureEvm for OdysseyEvmConfig { } fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { - compiler::ExternalContext::new() + compiler::ExternalContext::new(self.sender.clone(), self.cache.clone()) } } From 14427e71798b286a72a4cdd24f486aa84fe6a66b Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Tue, 26 Nov 2024 11:15:05 -0500 Subject: [PATCH 09/10] Move the compiling logic back to the compiler module --- crates/node/src/compiler.rs | 132 ++++++++++++++++++++++-------------- crates/node/src/evm.rs | 58 ++-------------- 2 files changed, 89 insertions(+), 101 deletions(-) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 3531368..267baa1 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -1,9 +1,10 @@ +/*! The compiler module is responsible for compiling EVM bytecode to machine code using LLVM. */ + use alloy_primitives::{hex, Bytes, B256}; use core::panic; -use reth_primitives::Bytecode; use reth_revm::{ handler::register::EvmHandler, - interpreter::{InterpreterAction, SharedMemory, EMPTY_SHARED_MEMORY}, + interpreter::{InterpreterAction, SharedMemory}, Context as RevmContext, Database, Frame, }; use revmc::{ @@ -12,44 +13,102 @@ use revmc::{ }; use std::{ collections::HashMap, - sync::{ - mpsc::{Receiver, Sender}, - Arc, Mutex, - }, + sync::{mpsc::Sender, Arc, Mutex}, thread, }; +/// The [Compiler] struct is a client for passing functions to the compiler thread. It also contains a cache of compiled functions +#[derive(Debug, Clone)] +pub struct Compiler { + sender: Sender<(SpecId, B256, Bytes)>, + fn_cache: Arc>>>, +} + +impl Default for Compiler { + fn default() -> Self { + Self::new() + } +} + +impl Compiler { + /// Create a new compiler instance. This spawns a new compiler thread and the returned struct contains a [Sender](std::sync::mpsc::Sender) for sending functions to the compiler thread, + /// as well as a cache to compiled functions + pub fn new() -> Self { + let fn_cache = Arc::new(Mutex::new(HashMap::new())); + let (sender, receiver) = std::sync::mpsc::channel(); + + // TODO: graceful shutdown + thread::spawn({ + let fn_cache = fn_cache.clone(); + + move || { + let ctx = LlvmContext::create(); + // let mut compilers = Vec::new(); + + while let Ok((spec_id, hash, code)) = receiver.recv() { + fn_cache.lock().unwrap().insert(hash, None); + + // TODO: fail properly here. + let backend = + EvmLlvmBackend::new(&ctx, false, OptimizationLevel::Aggressive).unwrap(); + let compiler = Box::leak(Box::new(EvmCompiler::new(backend))); + + // Do we have to allocate here? Not sure there's a better option + let name = hex::encode(hash); + dbg!("compiled", &name); + + let result = + unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); + + fn_cache.lock().unwrap().insert(hash, Some(result)); + + // compilers.push(compiler); + } + } + }); + + Self { sender, fn_cache } + } + + // TODO: + // For safety, we should also borrow the EvmCompiler that holds the actual module with code to + // make sure that it's not dropped while before or during the function call. + fn get_compiled_fn(&self, spec_id: SpecId, hash: B256, code: Bytes) -> Option { + match self.fn_cache.lock().unwrap().get(&hash) { + Some(maybe_f) => *maybe_f, + None => { + // TODO: put rules here for whether or not to compile the function + self.sender.send((spec_id, hash, code)).unwrap(); + None + } + } + } +} + +/// The [ExternalContext] struct is a container for the [Compiler] struct. #[derive(Debug)] pub struct ExternalContext { - sender: Sender<(SpecId, B256, Bytes)>, - // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) - cache: Arc>>>, + compiler: Compiler, } impl ExternalContext { - pub fn new( - sender: Sender<(SpecId, alloy_primitives::FixedBytes<32>, Bytes)>, - cache: Arc>>>, - ) -> Self { - Self { sender, cache } + /// Create a new [ExternalContext] instance from a given [Compiler] instance. + pub const fn new(compiler: Compiler) -> Self { + Self { compiler } } + /// Get a compiled function if one exists, otherwise send the bytecode to the compiler to be compiled. pub fn get_compiled_fn( &self, spec_id: SpecId, hash: B256, code: Bytes, ) -> Option { - match self.cache.lock().unwrap().get(&hash) { - Some(maybe_f) => maybe_f.as_ref().cloned(), - None => { - self.sender.send((spec_id, hash, code)).unwrap(); - return None; - } - } + self.compiler.get_compiled_fn(spec_id, hash, code) } } +/// Registers the compiler handler with the EVM handler. pub fn register_compiler_handler(handler: &mut EvmHandler<'_, ExternalContext, DB>) where DB: Database, @@ -78,31 +137,16 @@ fn execute_frame( let hash = match interpreter.contract.hash { Some(hash) => hash, + // TODO: is this an issue with EOF? None => unreachable_no_hash(), }; // should be cheap enough to clone because it's backed by bytes::Bytes let code = interpreter.contract.bytecode.bytes(); - // TODO: put rules here for whether or not to compile the function let f = context.external.get_compiled_fn(spec_id, hash, code)?; - // let f = match library.get_function(hash) { - // Ok(Some(f)) => f, - // Ok(None) => return None, - // // Shouldn't happen. - // Err(err) => { - // unlikely_log_get_function_error(err, &hash); - // return None; - // } - // }; - - // interpreter.shared_memory = - // std::mem::replace(memory, reth_revm::interpreter::EMPTY_SHARED_MEMORY); - // let result = unsafe { f.call_with_interpreter(interpreter, context) }; - // *memory = interpreter.take_memory(); - // Some(result) - + // Safety: as long as the function is still in the cache, this is safe to call let result = unsafe { f.call_with_interpreter_and_memory(interpreter, memory, context) }; dbg!("EXECUTED", &hash); @@ -115,15 +159,3 @@ fn execute_frame( const fn unreachable_no_hash() -> ! { panic!("unreachable: bytecode hash is not set in the interpreter") } - -#[cold] -#[inline(never)] -const fn unreachable_misconfigured() -> ! { - panic!("unreachable: AOT EVM is misconfigured") -} - -#[cold] -#[inline(never)] -fn unlikely_log_get_function_error(err: impl std::error::Error, hash: &B256) { - tracing::error!(%err, %hash, "failed getting function from shared library"); -} diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 13f0443..0bd83fa 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -10,7 +10,7 @@ //! This currently configures the instructions defined in [EIP3074-instructions](https://github.com/paradigmxyz/eip3074-instructions), and the //! precompiles defined by [`revm_precompile`]. -use alloy_primitives::{hex, Address, Bytes, TxKind, B256, U256}; +use alloy_primitives::{Address, Bytes, TxKind, U256}; use reth_chainspec::{ChainSpec, EthereumHardfork, Head}; use reth_node_api::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes}; use reth_optimism_chainspec::OpChainSpec; @@ -31,66 +31,22 @@ use reth_revm::{ ContextPrecompiles, Database, Evm, EvmBuilder, GetInspector, }; use revm_precompile::secp256r1; -use revmc::{ - llvm::Context as LlvmContext, EvmCompiler, EvmCompilerFn, EvmLlvmBackend, OptimizationLevel, -}; -use std::{ - collections::HashMap, - sync::{mpsc::Sender, Arc, Mutex}, - thread, -}; +use std::sync::Arc; -use crate::compiler::{self, register_compiler_handler}; +use crate::compiler::{self, register_compiler_handler, Compiler}; /// Custom EVM configuration #[derive(Debug, Clone)] pub struct OdysseyEvmConfig { chain_spec: Arc, - sender: Sender<(SpecId, B256, Bytes)>, - // TODO: cache shouldn't be here (and should definitely not be wrapped in a mutex) - cache: Arc>>>, + compiler: Compiler, } impl OdysseyEvmConfig { /// Creates a new Odyssey EVM configuration with the given chain spec. pub fn new(chain_spec: Arc) -> Self { - let cache = Arc::new(Mutex::new(HashMap::new())); - let (sender, receiver) = std::sync::mpsc::channel(); - - // TODO: graceful shutdown - thread::spawn({ - let cache = cache.clone(); - - move || { - // this is wrong, I keep spawning threads. I need to spawn a single llvm context for this to work properly. - // I can do this with a thread-pool once I get it working with a single compiler thread. - - let ctx = LlvmContext::create(); - // let mut compilers = Vec::new(); - - while let Ok((spec_id, hash, code)) = receiver.recv() { - cache.lock().unwrap().insert(hash, None); - - // TODO: fail properly here. - let backend = - EvmLlvmBackend::new(&ctx, false, OptimizationLevel::Aggressive).unwrap(); - let mut compiler = Box::leak(Box::new(EvmCompiler::new(backend))); - - // Do we have to allocate here? Not sure there's a better option - let name = hex::encode(hash); - dbg!("compiled", &name); - - let result = - unsafe { compiler.jit(&name, &code, spec_id) }.expect("catastrophe"); - - cache.lock().unwrap().insert(hash, Some(result)); - - // compilers.push(compiler); - } - } - }); - - Self { chain_spec, cache, sender } + let compiler = Compiler::new(); + Self { chain_spec, compiler } } /// Sets the precompiles to the EVM handler @@ -298,7 +254,7 @@ impl ConfigureEvm for OdysseyEvmConfig { } fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> { - compiler::ExternalContext::new(self.sender.clone(), self.cache.clone()) + compiler::ExternalContext::new(self.compiler.clone()) } } From 06c3a118122d3ff9ae8ad2f82aa61d11c83c676d Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Tue, 26 Nov 2024 18:18:23 -0500 Subject: [PATCH 10/10] Add comment --- crates/node/src/compiler.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/node/src/compiler.rs b/crates/node/src/compiler.rs index 267baa1..22ff081 100644 --- a/crates/node/src/compiler.rs +++ b/crates/node/src/compiler.rs @@ -24,6 +24,7 @@ pub struct Compiler { fn_cache: Arc>>>, } +// TODO: probably shouldn't have a default for something that spawns a thread? impl Default for Compiler { fn default() -> Self { Self::new()