From d77c6061da0fb882786dcbd65d1551f41180aef3 Mon Sep 17 00:00:00 2001 From: Poulav Bhowmick Date: Fri, 21 Feb 2025 20:50:15 +0530 Subject: [PATCH] Changed "match" to "if let some" to fix build errors (#14637) Co-authored-by: Matthias Seitz --- crates/engine/tree/src/tree/config.rs | 4 ++-- crates/optimism/chainspec/src/lib.rs | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/crates/engine/tree/src/tree/config.rs b/crates/engine/tree/src/tree/config.rs index e0d2620c1..add3c618f 100644 --- a/crates/engine/tree/src/tree/config.rs +++ b/crates/engine/tree/src/tree/config.rs @@ -54,7 +54,7 @@ pub struct TreeConfig { use_caching_and_prewarming: bool, /// Cross-block cache size in bytes. cross_block_cache_size: u64, - /// Wether the host has enough parallelism to run state root task. + /// Whether the host has enough parallelism to run state root task. has_enough_parallelism: bool, } @@ -224,7 +224,7 @@ impl TreeConfig { self } - /// Wether or not to use state root task + /// Whether or not to use state root task pub(crate) fn use_state_root_task(&self) -> bool { self.has_enough_parallelism && !self.legacy_state_root } diff --git a/crates/optimism/chainspec/src/lib.rs b/crates/optimism/chainspec/src/lib.rs index e96403b57..e0efb6179 100644 --- a/crates/optimism/chainspec/src/lib.rs +++ b/crates/optimism/chainspec/src/lib.rs @@ -437,19 +437,11 @@ pub fn make_op_genesis_header(genesis: &Genesis, hardforks: &ChainHardforks) -> // If Isthmus is active, overwrite the withdrawals root with the storage root of predeploy // `L2ToL1MessagePasser.sol` if hardforks.fork(OpHardfork::Isthmus).active_at_timestamp(header.timestamp) { - match genesis.alloc.get(&ADDRESS_L2_TO_L1_MESSAGE_PASSER) { - Some(predeploy) => { - if let Some(ref storage) = predeploy.storage { - header.withdrawals_root = - Some(storage_root_unhashed(storage.iter().map(|(k, v)| (*k, (*v).into())))) - } + if let Some(predeploy) = genesis.alloc.get(&ADDRESS_L2_TO_L1_MESSAGE_PASSER) { + if let Some(storage) = &predeploy.storage { + header.withdrawals_root = + Some(storage_root_unhashed(storage.iter().map(|(k, v)| (*k, (*v).into())))) } - None => - // todo: log this when no_std tracing available - /*debug!(target: "reth::cli", - "Isthmus active but predeploy L2ToL1MessagePasser.sol not found in genesis alloc" - ),*/ - {} } }