Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/optimism/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use reth_chainspec::{
};
use reth_ethereum_forks::{ChainHardforks, EthereumHardfork, ForkCondition};
use reth_network_peers::NodeRecord;
use reth_optimism_primitives::ADDRESS_L2_TO_L1_MESSAGE_PASSER;
use reth_optimism_primitives::L2_TO_L1_MESSAGE_PASSER_ADDRESS;
use reth_primitives_traits::{sync::LazyLock, SealedHeader};

/// Chain spec builder for a OP stack chain.
Expand Down Expand Up @@ -499,7 +499,7 @@ 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) &&
let Some(predeploy) = genesis.alloc.get(&ADDRESS_L2_TO_L1_MESSAGE_PASSER) &&
let Some(predeploy) = genesis.alloc.get(&L2_TO_L1_MESSAGE_PASSER_ADDRESS) &&
let Some(storage) = &predeploy.storage
{
header.withdrawals_root =
Expand Down
6 changes: 3 additions & 3 deletions crates/optimism/chainspec/src/superchain/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,23 @@ mod tests {
OP_SEPOLIA_CANYON_TIMESTAMP, OP_SEPOLIA_ECOTONE_TIMESTAMP, OP_SEPOLIA_ISTHMUS_TIMESTAMP,
OP_SEPOLIA_JOVIAN_TIMESTAMP,
};
use reth_optimism_primitives::ADDRESS_L2_TO_L1_MESSAGE_PASSER;
use reth_optimism_primitives::L2_TO_L1_MESSAGE_PASSER_ADDRESS;
use tar_no_std::TarArchiveRef;

#[test]
fn test_read_superchain_genesis() {
let genesis = read_superchain_genesis("unichain", "mainnet").unwrap();
assert_eq!(genesis.config.chain_id, 130);
assert_eq!(genesis.timestamp, 1730748359);
assert!(genesis.alloc.contains_key(&ADDRESS_L2_TO_L1_MESSAGE_PASSER));
assert!(genesis.alloc.contains_key(&L2_TO_L1_MESSAGE_PASSER_ADDRESS));
}

#[test]
fn test_read_superchain_genesis_with_workaround() {
let genesis = read_superchain_genesis("funki", "mainnet").unwrap();
assert_eq!(genesis.config.chain_id, 33979);
assert_eq!(genesis.timestamp, 1721211095);
assert!(genesis.alloc.contains_key(&ADDRESS_L2_TO_L1_MESSAGE_PASSER));
assert!(genesis.alloc.contains_key(&L2_TO_L1_MESSAGE_PASSER_ADDRESS));
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions crates/optimism/consensus/src/validation/isthmus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::OpConsensusError;
use alloy_consensus::BlockHeader;
use alloy_primitives::B256;
use alloy_trie::EMPTY_ROOT_HASH;
use reth_optimism_primitives::ADDRESS_L2_TO_L1_MESSAGE_PASSER;
use reth_optimism_primitives::L2_TO_L1_MESSAGE_PASSER_ADDRESS;
use reth_storage_api::{errors::ProviderResult, StorageRootProvider};
use reth_trie_common::HashedStorage;
use revm::database::BundleState;
Expand Down Expand Up @@ -32,7 +32,7 @@ pub fn withdrawals_root<DB: StorageRootProvider>(
withdrawals_root_prehashed(
state_updates
.state()
.get(&ADDRESS_L2_TO_L1_MESSAGE_PASSER)
.get(&L2_TO_L1_MESSAGE_PASSER_ADDRESS)
.map(|acc| {
HashedStorage::from_plain_storage(
acc.status,
Expand All @@ -52,7 +52,7 @@ pub fn withdrawals_root_prehashed<DB: StorageRootProvider>(
hashed_storage_updates: HashedStorage,
state: DB,
) -> ProviderResult<B256> {
state.storage_root(ADDRESS_L2_TO_L1_MESSAGE_PASSER, hashed_storage_updates)
state.storage_root(L2_TO_L1_MESSAGE_PASSER_ADDRESS, hashed_storage_updates)
}

/// Verifies block header field `withdrawals_root` against storage root of
Expand Down Expand Up @@ -146,7 +146,7 @@ mod test {

#[test]
fn l2tol1_message_passer_no_withdrawals() {
let hashed_address = keccak256(ADDRESS_L2_TO_L1_MESSAGE_PASSER);
let hashed_address = keccak256(L2_TO_L1_MESSAGE_PASSER_ADDRESS);

// create account storage
let init_storage = HashedStorage::from_iter(
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/node/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use reth_node_api::{
use reth_optimism_consensus::isthmus;
use reth_optimism_forks::OpHardforks;
use reth_optimism_payload_builder::{OpExecutionPayloadValidator, OpPayloadTypes};
use reth_optimism_primitives::{OpBlock, ADDRESS_L2_TO_L1_MESSAGE_PASSER};
use reth_optimism_primitives::{OpBlock, L2_TO_L1_MESSAGE_PASSER_ADDRESS};
use reth_primitives_traits::{Block, RecoveredBlock, SealedBlock, SignedTransaction};
use reth_provider::StateProviderFactory;
use reth_trie_common::{HashedPostState, KeyHasher};
Expand Down Expand Up @@ -76,7 +76,7 @@ pub struct OpEngineValidator<P, Tx, ChainSpec> {
impl<P, Tx, ChainSpec> OpEngineValidator<P, Tx, ChainSpec> {
/// Instantiates a new validator.
pub fn new<KH: KeyHasher>(chain_spec: Arc<ChainSpec>, provider: P) -> Self {
let hashed_addr_l2tol1_msg_passer = KH::hash_key(ADDRESS_L2_TO_L1_MESSAGE_PASSER);
let hashed_addr_l2tol1_msg_passer = KH::hash_key(L2_TO_L1_MESSAGE_PASSER_ADDRESS);
Self {
inner: OpExecutionPayloadValidator::new(chain_spec),
provider,
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/payload/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use reth_evm::{
};
use reth_execution_types::ExecutionOutcome;
use reth_optimism_forks::OpHardforks;
use reth_optimism_primitives::{transaction::OpTransaction, ADDRESS_L2_TO_L1_MESSAGE_PASSER};
use reth_optimism_primitives::{transaction::OpTransaction, L2_TO_L1_MESSAGE_PASSER_ADDRESS};
use reth_optimism_txpool::{
estimated_da_size::DataAvailabilitySized,
interop::{is_valid_interop, MaybeInteropTransaction},
Expand Down Expand Up @@ -435,7 +435,7 @@ impl<Txs> OpBuilder<'_, Txs> {
if ctx.chain_spec.is_isthmus_active_at_timestamp(ctx.attributes().timestamp()) {
// force load `L2ToL1MessagePasser.sol` so l2 withdrawals root can be computed even if
// no l2 withdrawals in block
_ = db.load_cache_account(ADDRESS_L2_TO_L1_MESSAGE_PASSER)?;
_ = db.load_cache_account(L2_TO_L1_MESSAGE_PASSER_ADDRESS)?;
}

let ExecutionWitnessRecord { hashed_state, codes, keys, lowest_block_number: _ } =
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ extern crate alloc;

pub mod bedrock;

pub mod predeploys;
pub use predeploys::ADDRESS_L2_TO_L1_MESSAGE_PASSER;
// Re-export predeploys from op-alloy-consensus
pub use op_alloy_consensus::L2_TO_L1_MESSAGE_PASSER_ADDRESS;

pub mod transaction;
pub use transaction::*;
Expand Down
8 changes: 0 additions & 8 deletions crates/optimism/primitives/src/predeploys.rs

This file was deleted.

Loading