diff --git a/trace_decoder/src/core.rs b/trace_decoder/src/core.rs index 984478b11..3193402e2 100644 --- a/trace_decoder/src/core.rs +++ b/trace_decoder/src/core.rs @@ -548,7 +548,6 @@ fn middle( Ok(out) } -#[allow(unused_variables)] /// Performs all the pre-txn execution rules of the targeted network. fn do_pre_execution( block: &BlockMetadata, @@ -559,30 +558,31 @@ fn do_pre_execution( state_trie: &mut StateTrieT, ) -> anyhow::Result<()> { // Ethereum mainnet: EIP-4788 - #[cfg(feature = "eth_mainnet")] - do_beacon_hook( - block.block_timestamp, - storage, - trim_storage, - block.parent_beacon_block_root, - trim_state, - state_trie, - )?; + if cfg!(feature = "eth_mainnet") { + return do_beacon_hook( + block.block_timestamp, + storage, + trim_storage, + block.parent_beacon_block_root, + trim_state, + state_trie, + ); + } - #[cfg(feature = "cdk_erigon")] - do_scalable_hook( - block, - ger_data, - storage, - trim_storage, - trim_state, - state_trie, - )?; + if cfg!(feature = "cdk_erigon") { + return do_scalable_hook( + block, + ger_data, + storage, + trim_storage, + trim_state, + state_trie, + ); + } Ok(()) } -#[cfg(feature = "cdk_erigon")] /// Updates the storage of the Scalable and GER contracts, according to /// . /// @@ -683,7 +683,6 @@ fn do_scalable_hook( Ok(()) } -#[cfg(feature = "eth_mainnet")] /// Updates the storage of the beacon block root contract, /// according to /// diff --git a/zero/src/rpc/native/state.rs b/zero/src/rpc/native/state.rs index 833bb9070..3c37e8cbc 100644 --- a/zero/src/rpc/native/state.rs +++ b/zero/src/rpc/native/state.rs @@ -65,8 +65,9 @@ pub fn process_states_access( ) -> anyhow::Result>> { let mut state_access = HashMap::>::new(); - #[cfg(feature = "eth_mainnet")] - insert_beacon_roots_update(&mut state_access, block)?; + if cfg!(feature = "eth_mainnet") { + insert_beacon_roots_update(&mut state_access, block)?; + } if let Some(w) = block.withdrawals.as_ref() { w.iter().for_each(|w| { @@ -89,7 +90,6 @@ pub fn process_states_access( Ok(state_access) } -#[cfg(feature = "eth_mainnet")] /// Cancun HF specific, see . fn insert_beacon_roots_update( state_access: &mut HashMap>,