diff --git a/trace_decoder/src/core.rs b/trace_decoder/src/core.rs index 07f5b4143..e7a813ddd 100644 --- a/trace_decoder/src/core.rs +++ b/trace_decoder/src/core.rs @@ -476,7 +476,7 @@ fn middle( || (cfg!(feature = "polygon_pos") // Include P256Verify for Polygon PoS && addr.compat() - == address!("0000000000000000000000000000000000000001")) + == address!("0000000000000000000000000000000000000100")) } if !is_precompile(addr) { @@ -609,7 +609,7 @@ fn do_scalable_hook( .context("missing scalable contract storage trie")?; let scalable_trim = trim_storage.entry(ADDRESS_SCALABLE_L2).or_default(); - let timestamp_slot_key = TrieKey::from_marker_slot(U256::from(TIMESTAMP_STORAGE_POS.1)); + let timestamp_slot_key = TrieKey::from_slot_position(U256::from(TIMESTAMP_STORAGE_POS.1)); let timestamp = scalable_storage .get(×tamp_slot_key) @@ -623,7 +623,7 @@ fn do_scalable_hook( (U256::from(LAST_BLOCK_STORAGE_POS.1), block.block_number), (U256::from(TIMESTAMP_STORAGE_POS.1), timestamp), ] { - let slot = TrieKey::from_marker_slot(ix); + let slot = TrieKey::from_slot_position(ix); scalable_trim.insert(slot); // These values are never 0. @@ -637,7 +637,7 @@ fn do_scalable_hook( let mut arr = [0; 64]; (block.block_number - 1).to_big_endian(&mut arr[0..32]); U256::from(STATE_ROOT_STORAGE_POS.1).to_big_endian(&mut arr[32..64]); - let slot = TrieKey::from_hash(keccak_hash::keccak(&arr)); + let slot = TrieKey::from_hash(keccak_hash::keccak(arr)); scalable_storage.insert(slot, alloy::rlp::encode(prev_block_root_hash.compat()))?; scalable_trim.insert(slot); @@ -663,7 +663,7 @@ fn do_scalable_hook( let mut arr = [0; 64]; arr[0..32].copy_from_slice(&root.0); U256::from(GLOBAL_EXIT_ROOT_STORAGE_POS.1).to_big_endian(&mut arr[32..64]); - let slot = TrieKey::from_hash(keccak_hash::keccak(&arr)); + let slot = TrieKey::from_hash(keccak_hash::keccak(arr)); ger_storage.insert(slot, alloy::rlp::encode(l1blockhash.compat()))?; ger_trim.insert(slot); @@ -717,7 +717,7 @@ fn do_beacon_hook( U256::from_big_endian(parent_beacon_block_root.as_bytes()), ), ] { - let slot = TrieKey::from_marker_slot(ix); + let slot = TrieKey::from_slot_position(ix); beacon_trim.insert(slot); match u.is_zero() { diff --git a/trace_decoder/src/typed_mpt.rs b/trace_decoder/src/typed_mpt.rs index 389b215ea..34b1b9312 100644 --- a/trace_decoder/src/typed_mpt.rs +++ b/trace_decoder/src/typed_mpt.rs @@ -126,9 +126,9 @@ impl TrieKey { pub fn from_address(address: Address) -> Self { Self::from_hash(keccak_hash::keccak(address)) } - pub fn from_marker_slot(slot: U256) -> Self { + pub fn from_slot_position(pos: U256) -> Self { let mut bytes = [0; 32]; - slot.to_big_endian(&mut bytes); + pos.to_big_endian(&mut bytes); Self::from_hash(keccak_hash::keccak(bytes)) } pub fn from_hash(H256(bytes): H256) -> Self { diff --git a/zero/src/rpc/native/state.rs b/zero/src/rpc/native/state.rs index 579c3f5a6..e2d64e4df 100644 --- a/zero/src/rpc/native/state.rs +++ b/zero/src/rpc/native/state.rs @@ -97,7 +97,7 @@ fn insert_beacon_roots_update( ) -> anyhow::Result<()> { use alloy::primitives::U256; use evm_arithmetization::testing_utils::{ - BEACON_ROOTS_CONTRACT_STATE_KEY, HISTORY_BUFFER_LENGTH, + BEACON_ROOTS_CONTRACT_ADDRESS, HISTORY_BUFFER_LENGTH, }; let timestamp = U256::from(block.header.timestamp); @@ -107,7 +107,7 @@ fn insert_beacon_roots_update( (timestamp % chunk).into(), // timestamp_idx ((timestamp % chunk) + chunk).into(), // root_idx ]); - state_access.insert(BEACON_ROOTS_CONTRACT_STATE_KEY.1.into(), keys); + state_access.insert(BEACON_ROOTS_CONTRACT_ADDRESS.0.into(), keys); Ok(()) }