From 10237097eb45a6402bfbc06f6677639410e532b4 Mon Sep 17 00:00:00 2001 From: Victor Graf Date: Tue, 10 Feb 2026 13:35:05 -0800 Subject: [PATCH 1/3] converge on using the "Dev" chainspec instead of AnvilHardhat to avoid inconsistencies. --- crates/chainspec/src/lib.rs | 2 +- crates/host/src/lib.rs | 4 ++-- crates/rpc-proxy/src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/chainspec/src/lib.rs b/crates/chainspec/src/lib.rs index 92449425..df1af47f 100644 --- a/crates/chainspec/src/lib.rs +++ b/crates/chainspec/src/lib.rs @@ -90,7 +90,7 @@ pub static HOODI: LazyLock> = LazyLock::new(|| { /// Use with `anvil` or any node configured with chain ID 31337. pub static DEV: LazyLock> = LazyLock::new(|| { let spec = ChainSpec { - chain: NamedChain::AnvilHardhat.into(), + chain: NamedChain::Dev.into(), forks: EthereumHardfork::devnet().into(), deposit_contract_address: None, base_fee_params: BaseFeeParams::ethereum(), diff --git a/crates/host/src/lib.rs b/crates/host/src/lib.rs index 9189cd9b..9a8b8918 100644 --- a/crates/host/src/lib.rs +++ b/crates/host/src/lib.rs @@ -60,7 +60,7 @@ impl BlockProcessor

{ NamedChain::Mainnet => reth_chainspec::MAINNET.clone(), NamedChain::Sepolia => reth_chainspec::SEPOLIA.clone(), NamedChain::Hoodi => reth_chainspec::HOODI.clone(), - NamedChain::AnvilHardhat => reth_chainspec::DEV.clone(), + NamedChain::Dev => reth_chainspec::DEV.clone(), chain => bail!("unsupported chain: {chain}"), }; @@ -84,7 +84,7 @@ impl BlockProcessor

{ NamedChain::Mainnet => MAINNET_ELF, NamedChain::Sepolia => SEPOLIA_ELF, NamedChain::Hoodi => HOODI_ELF, - NamedChain::AnvilHardhat => DEV_ELF, + NamedChain::Dev => DEV_ELF, chain => bail!("unsupported chain for proving: {chain}"), }; let image_id = compute_image_id(elf).context("failed to compute image id")?; diff --git a/crates/rpc-proxy/src/main.rs b/crates/rpc-proxy/src/main.rs index 84e336f5..672c4089 100644 --- a/crates/rpc-proxy/src/main.rs +++ b/crates/rpc-proxy/src/main.rs @@ -219,7 +219,7 @@ async fn main() -> anyhow::Result<()> { NamedChain::Mainnet => Arc::new(EthEvmConfig::ethereum(MAINNET.clone())), NamedChain::Hoodi => Arc::new(EthEvmConfig::ethereum(HOODI.clone())), NamedChain::Sepolia => Arc::new(EthEvmConfig::ethereum(SEPOLIA.clone())), - NamedChain::AnvilHardhat => Arc::new(EthEvmConfig::ethereum(DEV.clone())), + NamedChain::Dev => Arc::new(EthEvmConfig::ethereum(DEV.clone())), _ => bail!("Unsupported chain: {chain}"), }; info!("EVM config: {}", chain); From c04fa50e4f4f7cf858074766f2f1e654ca051c23 Mon Sep 17 00:00:00 2001 From: Wolfgang Welz Date: Sun, 15 Feb 2026 12:58:22 +0100 Subject: [PATCH 2/3] switch to reth --dev --- crates/chainspec/src/lib.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/crates/chainspec/src/lib.rs b/crates/chainspec/src/lib.rs index df1af47f..919a69ee 100644 --- a/crates/chainspec/src/lib.rs +++ b/crates/chainspec/src/lib.rs @@ -21,7 +21,8 @@ use alloy_genesis::Genesis; use alloy_primitives::{Address, B256, U256, address}; use reth_chainspec::{BaseFeeParams, Chain, DepositContract, EthChainSpec, Hardforks, NamedChain}; use reth_ethereum_forks::{ - EthereumHardfork, EthereumHardforks, ForkCondition, Hardfork, hoodi, mainnet, sepolia, + DEV_HARDFORKS, EthereumHardfork, EthereumHardforks, ForkCondition, Hardfork, hoodi, mainnet, + sepolia, }; use reth_evm::eth::spec::EthExecutorSpec; use reth_primitives_traits::Header; @@ -84,14 +85,20 @@ pub static HOODI: LazyLock> = LazyLock::new(|| { spec.into() }); -/// Development chain specification for local testing with Anvil (chain ID 31337). +/// Development chain specification matching `reth --dev` (chain ID 1337). /// /// All hardforks are activated at genesis (block 0 / timestamp 0). -/// Use with `anvil` or any node configured with chain ID 31337. +/// Use with `reth --dev` or any node configured with chain ID 1337. pub static DEV: LazyLock> = LazyLock::new(|| { let spec = ChainSpec { chain: NamedChain::Dev.into(), - forks: EthereumHardfork::devnet().into(), + forks: EthereumHardfork::VARIANTS + .iter() + .filter_map(|f| { + let c = DEV_HARDFORKS.fork(*f); + (c != ForkCondition::Never).then_some((*f, c)) + }) + .collect(), deposit_contract_address: None, base_fee_params: BaseFeeParams::ethereum(), blob_params: BlobScheduleBlobParams::default(), @@ -249,12 +256,6 @@ mod tests { #[test] fn dev() { - let spec = &DEV; - let reth_spec = &reth_chainspec::DEV; - // Note: reth's DEV_HARDFORKS is outdated (only up to Prague), so we verify our DEV spec - // independently rather than comparing against reth_chainspec::DEV. - assert_eq!(spec.deposit_contract_address, reth_spec.deposit_contract.map(|c| c.address)); - assert_eq!(BaseFeeParamsKind::Constant(spec.base_fee_params), reth_spec.base_fee_params); - assert_eq!(spec.blob_params, reth_spec.blob_params); + assert_eq(&DEV, &reth_chainspec::DEV); } } From 5974151fbd74e9f873295580c4e7d4aebc7921d8 Mon Sep 17 00:00:00 2001 From: Wolfgang Welz Date: Sun, 15 Feb 2026 13:12:17 +0100 Subject: [PATCH 3/3] switch to ChainHardforks --- crates/chainspec/src/lib.rs | 38 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/crates/chainspec/src/lib.rs b/crates/chainspec/src/lib.rs index 919a69ee..62fec81d 100644 --- a/crates/chainspec/src/lib.rs +++ b/crates/chainspec/src/lib.rs @@ -21,14 +21,12 @@ use alloy_genesis::Genesis; use alloy_primitives::{Address, B256, U256, address}; use reth_chainspec::{BaseFeeParams, Chain, DepositContract, EthChainSpec, Hardforks, NamedChain}; use reth_ethereum_forks::{ - DEV_HARDFORKS, EthereumHardfork, EthereumHardforks, ForkCondition, Hardfork, hoodi, mainnet, - sepolia, + ChainHardforks, DEV_HARDFORKS, EthereumHardfork, EthereumHardforks, ForkCondition, Hardfork, + hoodi, mainnet, sepolia, }; use reth_evm::eth::spec::EthExecutorSpec; use reth_primitives_traits::Header; use std::{ - any::Any, - collections::BTreeMap, fmt::{self, Debug, Display}, sync::{Arc, LazyLock}, }; @@ -92,13 +90,7 @@ pub static HOODI: LazyLock> = LazyLock::new(|| { pub static DEV: LazyLock> = LazyLock::new(|| { let spec = ChainSpec { chain: NamedChain::Dev.into(), - forks: EthereumHardfork::VARIANTS - .iter() - .filter_map(|f| { - let c = DEV_HARDFORKS.fork(*f); - (c != ForkCondition::Never).then_some((*f, c)) - }) - .collect(), + forks: DEV_HARDFORKS.clone(), deposit_contract_address: None, base_fee_params: BaseFeeParams::ethereum(), blob_params: BlobScheduleBlobParams::default(), @@ -109,7 +101,7 @@ pub static DEV: LazyLock> = LazyLock::new(|| { #[derive(Clone, Debug)] pub struct ChainSpec { chain: Chain, - forks: BTreeMap, + forks: ChainHardforks, deposit_contract_address: Option

, base_fee_params: BaseFeeParams, blob_params: BlobScheduleBlobParams, @@ -122,28 +114,28 @@ impl Display for ChainSpec { } impl EthereumHardforks for ChainSpec { + #[inline] fn ethereum_fork_activation(&self, fork: EthereumHardfork) -> ForkCondition { - self.forks.get(&fork).cloned().unwrap_or_default() + self.forks.fork(fork) } } impl EthExecutorSpec for ChainSpec { + #[inline] fn deposit_contract_address(&self) -> Option
{ self.deposit_contract_address } } impl Hardforks for ChainSpec { + #[inline] fn fork(&self, fork: H) -> ForkCondition { - if let Some(eth_fork) = (&fork as &dyn Any).downcast_ref::() { - self.ethereum_fork_activation(*eth_fork) - } else { - ForkCondition::Never - } + self.forks.fork(fork) } + #[inline] fn forks_iter(&self) -> impl Iterator { - self.forks.iter().map(|(eth_fork, condition)| (eth_fork as &dyn Hardfork, *condition)) + self.forks.forks_iter() } fn fork_id(&self, _: &Head) -> ForkId { @@ -162,14 +154,17 @@ impl Hardforks for ChainSpec { impl EthChainSpec for ChainSpec { type Header = Header; + #[inline] fn chain(&self) -> Chain { self.chain } + #[inline] fn base_fee_params_at_timestamp(&self, _: u64) -> BaseFeeParams { self.base_fee_params } + #[inline] fn blob_params_at_timestamp(&self, timestamp: u64) -> Option { if let Some(blob_param) = self.blob_params.active_scheduled_params_at_timestamp(timestamp) { Some(*blob_param) @@ -230,10 +225,7 @@ mod tests { fn assert_eq(spec: &ChainSpec, reth_spec: &reth_chainspec::ChainSpec) { assert_eq!(spec.chain, reth_spec.chain); - assert_eq!( - spec.forks.values().cloned().collect::>(), - reth_spec.forks_iter().map(|(_, f)| f).collect::>(), - ); + assert_eq!(spec.forks, reth_spec.hardforks); assert_eq!(spec.deposit_contract_address, reth_spec.deposit_contract.map(|c| c.address)); assert_eq!(BaseFeeParamsKind::Constant(spec.base_fee_params), reth_spec.base_fee_params); assert_eq!(spec.blob_params, reth_spec.blob_params);