diff --git a/Cargo.lock b/Cargo.lock index c27f4b165..67f7e3a2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,12 +133,12 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "c-kzg", "serde", ] @@ -177,11 +177,11 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "arbitrary", "c-kzg", "derive_more", @@ -211,10 +211,10 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "serde", "serde_json", ] @@ -245,7 +245,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", "serde", @@ -257,13 +257,13 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-json-rpc", "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-signer", "alloy-sol-types", "async-trait", @@ -274,9 +274,9 @@ dependencies = [ [[package]] name = "alloy-node-bindings" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "k256", "serde_json", @@ -316,14 +316,14 @@ dependencies = [ [[package]] name = "alloy-provider" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-json-rpc", "alloy-network", "alloy-primitives", "alloy-rpc-client", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-rpc-types-trace", "alloy-transport", "alloy-transport-http", @@ -366,7 +366,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -386,14 +386,14 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-sol-types", "arbitrary", "itertools 0.12.1", @@ -426,19 +426,19 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "serde", ] [[package]] name = "alloy-rpc-types-beacon" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "alloy-rpc-types-engine", "serde", @@ -448,14 +448,14 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "alloy-rlp", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -468,11 +468,11 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "serde", "serde_json", ] @@ -480,7 +480,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", "serde", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-primitives", "async-trait", @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "alloy-signer-wallet" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-network", "alloy-primitives", "alloy-signer", @@ -588,7 +588,7 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-json-rpc", "base64 0.22.1", @@ -606,7 +606,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=899fc51#899fc51af8b5f4de6df1605ca3ffe8d8d6fa8c69" +source = "git+https://github.com/alloy-rs/alloy?rev=f1d7085#f1d708522e7fe676a3ee86dd198f87182f220927" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -2977,7 +2977,7 @@ dependencies = [ name = "exex-rollup" version = "0.0.0" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-rlp", "alloy-sol-types", "eyre", @@ -6578,8 +6578,8 @@ dependencies = [ name = "reth-codecs" version = "0.2.0-beta.7" dependencies = [ - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "arbitrary", "bytes", @@ -6784,9 +6784,9 @@ dependencies = [ name = "reth-e2e-test-utils" version = "0.2.0-beta.7" dependencies = [ - "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-network", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-signer", "alloy-signer-wallet", "eyre", @@ -6990,6 +6990,7 @@ dependencies = [ name = "reth-evm-ethereum" version = "0.2.0-beta.7" dependencies = [ + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "reth-evm", "reth-interfaces", "reth-primitives", @@ -7540,11 +7541,11 @@ name = "reth-primitives" version = "0.2.0-beta.7" dependencies = [ "alloy-chains", - "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", - "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-primitives", "alloy-rlp", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-trie", "arbitrary", "assert_matches", @@ -7643,6 +7644,7 @@ dependencies = [ name = "reth-revm" version = "0.2.0-beta.7" dependencies = [ + "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "reth-consensus-common", "reth-interfaces", "reth-primitives", @@ -7827,7 +7829,7 @@ name = "reth-rpc-types" version = "0.2.0-beta.7" dependencies = [ "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-rpc-types-anvil", "alloy-rpc-types-beacon", "alloy-rpc-types-engine", @@ -7852,7 +7854,7 @@ name = "reth-rpc-types-compat" version = "0.2.0-beta.7" dependencies = [ "alloy-rlp", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "reth-primitives", "reth-rpc-types", "serde_json", @@ -7959,7 +7961,7 @@ dependencies = [ name = "reth-testing-utils" version = "0.2.0-beta.7" dependencies = [ - "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "reth-primitives", "secp256k1", ] @@ -8093,10 +8095,10 @@ dependencies = [ [[package]] name = "revm-inspectors" version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=c1b5dd0#c1b5dd0d85dd46ef5ec5258aebd24adc041d103a" +source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=a5df8a0#a5df8a041d2c82a58840776be37f935a72803917" dependencies = [ "alloy-primitives", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=899fc51)", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=f1d7085)", "alloy-rpc-types-trace", "alloy-sol-types", "anstyle", diff --git a/Cargo.toml b/Cargo.toml index 0d531f5fc..ead6935d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -282,7 +282,7 @@ reth-testing-utils = { path = "testing/testing-utils" } # revm revm = { version = "8.0.0", features = ["std", "secp256k1"], default-features = false } revm-primitives = { version = "3.1.0", features = ["std"], default-features = false } -revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "c1b5dd0" } +revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "a5df8a0" } # eth alloy-chains = "0.1.15" @@ -291,21 +291,21 @@ alloy-dyn-abi = "0.7.2" alloy-sol-types = "0.7.2" alloy-rlp = "0.3.4" alloy-trie = "0.3.1" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51", default-features = false, features = [ +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085", default-features = false, features = [ "reqwest", ] } -alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "899fc51" } -alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } -alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "899fc51" } +alloy-eips = { git = "https://github.com/alloy-rs/alloy", default-features = false, rev = "f1d7085" } +alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } +alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "f1d7085" } # misc auto_impl = "1" diff --git a/crates/ethereum/evm/Cargo.toml b/crates/ethereum/evm/Cargo.toml index 6fa61e34f..e9f8bc5ad 100644 --- a/crates/ethereum/evm/Cargo.toml +++ b/crates/ethereum/evm/Cargo.toml @@ -24,4 +24,6 @@ revm-primitives.workspace = true tracing.workspace = true [dev-dependencies] -reth-revm = { workspace = true, features = ["test-utils"] } \ No newline at end of file +reth-revm = { workspace = true, features = ["test-utils"] } +alloy-eips.workspace = true + diff --git a/crates/ethereum/evm/src/execute.rs b/crates/ethereum/evm/src/execute.rs index c80e476bc..15702ba75 100644 --- a/crates/ethereum/evm/src/execute.rs +++ b/crates/ethereum/evm/src/execute.rs @@ -443,31 +443,26 @@ where #[cfg(test)] mod tests { use super::*; - use reth_primitives::{ - bytes, - constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS}, - keccak256, Account, Block, Bytes, ChainSpecBuilder, ForkCondition, B256, - }; + use alloy_eips::eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS}; + use reth_primitives::{keccak256, Account, Block, ChainSpecBuilder, ForkCondition, B256}; use reth_revm::{ database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState, }; use std::collections::HashMap; - static BEACON_ROOT_CONTRACT_CODE: Bytes = bytes!("3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500"); - fn create_state_provider_with_beacon_root_contract() -> StateProviderTest { let mut db = StateProviderTest::default(); let beacon_root_contract_account = Account { balance: U256::ZERO, - bytecode_hash: Some(keccak256(BEACON_ROOT_CONTRACT_CODE.clone())), + bytecode_hash: Some(keccak256(BEACON_ROOTS_CODE.clone())), nonce: 1, }; db.insert_account( BEACON_ROOTS_ADDRESS, beacon_root_contract_account, - Some(BEACON_ROOT_CONTRACT_CODE.clone()), + Some(BEACON_ROOTS_CODE.clone()), HashMap::new(), ); diff --git a/crates/primitives/src/constants/mod.rs b/crates/primitives/src/constants/mod.rs index 4fc0aadfe..1df3d0284 100644 --- a/crates/primitives/src/constants/mod.rs +++ b/crates/primitives/src/constants/mod.rs @@ -1,9 +1,6 @@ //! Ethereum protocol-related constants -use crate::{ - revm_primitives::{address, b256}, - Address, B256, U256, -}; +use crate::{revm_primitives::b256, B256, U256}; use std::time::Duration; #[cfg(feature = "optimism")] @@ -197,13 +194,6 @@ pub const BEACON_CONSENSUS_REORG_UNWIND_DEPTH: u64 = 3; /// pub const ALLOWED_FUTURE_BLOCK_TIME_SECONDS: u64 = 15; -/// The address for the beacon roots contract defined in EIP-4788. -pub const BEACON_ROOTS_ADDRESS: Address = address!("000F3df6D732807Ef1319fB7B8bB8522d0Beac02"); - -/// The caller to be used when calling the EIP-4788 beacon roots contract at the beginning of the -/// block. -pub const SYSTEM_ADDRESS: Address = address!("fffffffffffffffffffffffffffffffffffffffe"); - #[cfg(test)] mod tests { use super::*; diff --git a/crates/primitives/src/revm/env.rs b/crates/primitives/src/revm/env.rs index b13a7018f..f2c14bbbd 100644 --- a/crates/primitives/src/revm/env.rs +++ b/crates/primitives/src/revm/env.rs @@ -1,11 +1,11 @@ use crate::{ - constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS}, recover_signer_unchecked, revm_primitives::{BlockEnv, Env, TransactTo, TxEnv}, Address, Bytes, Chain, ChainSpec, Header, Transaction, TransactionSignedEcRecovered, TxKind, B256, U256, }; +use alloy_eips::eip4788::BEACON_ROOTS_ADDRESS; #[cfg(feature = "optimism")] use revm_primitives::OptimismFields; @@ -143,7 +143,7 @@ pub fn tx_env_with_recovered(transaction: &TransactionSignedEcRecovered) -> TxEn /// * if no code exists at `BEACON_ROOTS_ADDRESS`, the call must fail silently pub fn fill_tx_env_with_beacon_root_contract_call(env: &mut Env, parent_beacon_block_root: B256) { env.tx = TxEnv { - caller: SYSTEM_ADDRESS, + caller: alloy_eips::eip4788::SYSTEM_ADDRESS, transact_to: TransactTo::Call(BEACON_ROOTS_ADDRESS), // Explicitly set nonce to None so revm does not do any nonce checks nonce: None, diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 2b621ed76..87d30ca6f 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -22,6 +22,9 @@ reth-trie = { workspace = true, optional = true } # revm revm.workspace = true +# alloy +alloy-eips.workspace = true + # common tracing.workspace = true diff --git a/crates/revm/src/state_change.rs b/crates/revm/src/state_change.rs index d2b0a6b5b..1279e1b96 100644 --- a/crates/revm/src/state_change.rs +++ b/crates/revm/src/state_change.rs @@ -1,8 +1,8 @@ use reth_consensus_common::calc; use reth_interfaces::executor::{BlockExecutionError, BlockValidationError}; use reth_primitives::{ - constants::SYSTEM_ADDRESS, revm::env::fill_tx_env_with_beacon_root_contract_call, Address, - ChainSpec, Header, Withdrawal, B256, U256, + revm::env::fill_tx_env_with_beacon_root_contract_call, Address, ChainSpec, Header, Withdrawal, + B256, U256, }; use revm::{interpreter::Host, Database, DatabaseCommit, Evm}; use std::collections::HashMap; @@ -104,7 +104,7 @@ where } }; - state.remove(&SYSTEM_ADDRESS); + state.remove(&alloy_eips::eip4788::SYSTEM_ADDRESS); state.remove(&evm.block().coinbase); evm.context.evm.db.commit(state);