From 5de95601f4367dcdaa1abb8c4a153353cc7602f2 Mon Sep 17 00:00:00 2001 From: yutianwu Date: Thu, 4 Jul 2024 20:01:48 +0800 Subject: [PATCH 1/3] fix: fix the hardforks' order --- Cargo.lock | 8 ++++---- Cargo.toml | 10 +++++----- crates/primitives/src/revm/config.rs | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 627c537fa..7b8c0003e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9333,7 +9333,7 @@ dependencies = [ [[package]] name = "revm" version = "10.0.0" -source = "git+https://github.com/bnb-chain/revm?rev=dfca3edd9732372e19dea88462eaece1e74824f1#dfca3edd9732372e19dea88462eaece1e74824f1" +source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" dependencies = [ "auto_impl", "cfg-if", @@ -9365,7 +9365,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "6.0.0" -source = "git+https://github.com/bnb-chain/revm?rev=dfca3edd9732372e19dea88462eaece1e74824f1#dfca3edd9732372e19dea88462eaece1e74824f1" +source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" dependencies = [ "revm-primitives", "serde", @@ -9374,7 +9374,7 @@ dependencies = [ [[package]] name = "revm-precompile" version = "8.0.0" -source = "git+https://github.com/bnb-chain/revm?rev=dfca3edd9732372e19dea88462eaece1e74824f1#dfca3edd9732372e19dea88462eaece1e74824f1" +source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9402,7 +9402,7 @@ dependencies = [ [[package]] name = "revm-primitives" version = "5.0.0" -source = "git+https://github.com/bnb-chain/revm?rev=dfca3edd9732372e19dea88462eaece1e74824f1#dfca3edd9732372e19dea88462eaece1e74824f1" +source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" dependencies = [ "alloy-primitives", "auto_impl", diff --git a/Cargo.toml b/Cargo.toml index a633b07fc..94b658db2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -506,11 +506,11 @@ test-fuzz = "5" iai-callgrind = "0.11" [patch.crates-io] -revm = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } -revm-interpreter = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } -revm-precompile = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } -revm-primitives = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } +revm = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } +revm-interpreter = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } +revm-precompile = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } +revm-primitives = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } alloy-chains = { git = "https://github.com/bnb-chain/alloy-chains-rs.git", rev = "b7c5379cf47345181f8dce350acafb958f47152a" } [patch."https://github.com/bluealloy/revm"] -revm = { git = "https://github.com/bnb-chain/revm", rev = "dfca3edd9732372e19dea88462eaece1e74824f1" } \ No newline at end of file +revm = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } \ No newline at end of file diff --git a/crates/primitives/src/revm/config.rs b/crates/primitives/src/revm/config.rs index 928fd9bcb..4a99eb020 100644 --- a/crates/primitives/src/revm/config.rs +++ b/crates/primitives/src/revm/config.rs @@ -11,10 +11,10 @@ pub fn revm_spec_by_timestamp_after_merge( ) -> revm_primitives::SpecId { #[cfg(feature = "optimism")] if chain_spec.is_optimism() { - return if chain_spec.fork(Hardfork::Haber).active_at_timestamp(timestamp) { - revm_primitives::HABER - } else if chain_spec.fork(Hardfork::Fjord).active_at_timestamp(timestamp) { + return if chain_spec.fork(Hardfork::Fjord).active_at_timestamp(timestamp) { revm_primitives::FJORD + } else if chain_spec.fork(Hardfork::Haber).active_at_timestamp(timestamp) { + revm_primitives::HABER } else if chain_spec.fork(Hardfork::Ecotone).active_at_timestamp(timestamp) { revm_primitives::ECOTONE } else if chain_spec.fork(Hardfork::Canyon).active_at_timestamp(timestamp) { @@ -62,10 +62,10 @@ pub fn revm_spec_by_timestamp_after_merge( pub fn revm_spec(chain_spec: &ChainSpec, block: Head) -> revm_primitives::SpecId { #[cfg(feature = "optimism")] if chain_spec.is_optimism() { - if chain_spec.fork(Hardfork::Haber).active_at_head(&block) { - return revm_primitives::HABER - } else if chain_spec.fork(Hardfork::Fjord).active_at_head(&block) { + if chain_spec.fork(Hardfork::Fjord).active_at_head(&block) { return revm_primitives::FJORD + } else if chain_spec.fork(Hardfork::Haber).active_at_head(&block) { + return revm_primitives::HABER } else if chain_spec.fork(Hardfork::Ecotone).active_at_head(&block) { return revm_primitives::ECOTONE } else if chain_spec.fork(Hardfork::Canyon).active_at_head(&block) { From c97f4b477efe2607066c1d26d2f64ce0f99d8693 Mon Sep 17 00:00:00 2001 From: yutianwu Date: Fri, 5 Jul 2024 10:44:09 +0800 Subject: [PATCH 2/3] adjust order of Fermat hardfork --- crates/ethereum-forks/src/hardfork.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ethereum-forks/src/hardfork.rs b/crates/ethereum-forks/src/hardfork.rs index e8930490f..1d66df0a6 100644 --- a/crates/ethereum-forks/src/hardfork.rs +++ b/crates/ethereum-forks/src/hardfork.rs @@ -97,6 +97,9 @@ pub enum Hardfork { Feynman, /// BSC `FeynmanFix` hardfork FeynmanFix, + /// `Fermat` + #[cfg(all(feature = "optimism", feature = "opbnb"))] + Fermat, /// Canyon: /// . #[cfg(feature = "optimism")] @@ -110,9 +113,6 @@ pub enum Hardfork { /// `PreContractForkBlock` #[cfg(all(feature = "optimism", feature = "opbnb"))] PreContractForkBlock, - /// `Fermat` - #[cfg(all(feature = "optimism", feature = "opbnb"))] - Fermat, // ArbOS20Atlas, /// BSC `Haber` hardfork Haber, From 79aa2ec7e9c90c294939d09ee272df90c85967ae Mon Sep 17 00:00:00 2001 From: yutianwu Date: Mon, 8 Jul 2024 10:18:19 +0800 Subject: [PATCH 3/3] update dependencies --- Cargo.lock | 8 ++++---- Cargo.toml | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b8c0003e..e818a21de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9333,7 +9333,7 @@ dependencies = [ [[package]] name = "revm" version = "10.0.0" -source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" +source = "git+https://github.com/bnb-chain/revm?rev=e4bf75d62e36077fb3904c400332da0376c03383#e4bf75d62e36077fb3904c400332da0376c03383" dependencies = [ "auto_impl", "cfg-if", @@ -9365,7 +9365,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "6.0.0" -source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" +source = "git+https://github.com/bnb-chain/revm?rev=e4bf75d62e36077fb3904c400332da0376c03383#e4bf75d62e36077fb3904c400332da0376c03383" dependencies = [ "revm-primitives", "serde", @@ -9374,7 +9374,7 @@ dependencies = [ [[package]] name = "revm-precompile" version = "8.0.0" -source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" +source = "git+https://github.com/bnb-chain/revm?rev=e4bf75d62e36077fb3904c400332da0376c03383#e4bf75d62e36077fb3904c400332da0376c03383" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9402,7 +9402,7 @@ dependencies = [ [[package]] name = "revm-primitives" version = "5.0.0" -source = "git+https://github.com/yutianwu/revm?rev=8aca0933cee840be9947f7323e26d71e2d33012d#8aca0933cee840be9947f7323e26d71e2d33012d" +source = "git+https://github.com/bnb-chain/revm?rev=e4bf75d62e36077fb3904c400332da0376c03383#e4bf75d62e36077fb3904c400332da0376c03383" dependencies = [ "alloy-primitives", "auto_impl", diff --git a/Cargo.toml b/Cargo.toml index 94b658db2..a7c9ae4c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -506,11 +506,11 @@ test-fuzz = "5" iai-callgrind = "0.11" [patch.crates-io] -revm = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } -revm-interpreter = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } -revm-precompile = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } -revm-primitives = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } +revm = { git = "https://github.com/bnb-chain/revm", rev = "e4bf75d62e36077fb3904c400332da0376c03383" } +revm-interpreter = { git = "https://github.com/bnb-chain/revm", rev = "e4bf75d62e36077fb3904c400332da0376c03383" } +revm-precompile = { git = "https://github.com/bnb-chain/revm", rev = "e4bf75d62e36077fb3904c400332da0376c03383" } +revm-primitives = { git = "https://github.com/bnb-chain/revm", rev = "e4bf75d62e36077fb3904c400332da0376c03383" } alloy-chains = { git = "https://github.com/bnb-chain/alloy-chains-rs.git", rev = "b7c5379cf47345181f8dce350acafb958f47152a" } [patch."https://github.com/bluealloy/revm"] -revm = { git = "https://github.com/yutianwu/revm", rev = "8aca0933cee840be9947f7323e26d71e2d33012d" } \ No newline at end of file +revm = { git = "https://github.com/bnb-chain/revm", rev = "e4bf75d62e36077fb3904c400332da0376c03383" } \ No newline at end of file