diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index fe76e1a4ceb7..b9d3f3fb8e65 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -42,7 +42,7 @@ jobs: partition: 2 total_partitions: 2 - type: scroll - args: -p reth-scroll-state-commitment --locked --features "scroll" + args: --locked --features "scroll" --workspace --exclude ef-tests -E 'package(reth-scroll-*)' partition: 1 total_partitions: 1 - type: book diff --git a/Cargo.lock b/Cargo.lock index 51bc87f1ac3d..b80d6e78dd76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ dependencies = [ [[package]] name = "alloy-eip2930" version = "0.1.0" -source = "git+https://github.com/scroll-tech/alloy-eips?branch=v0.4.2#92b2892d7b5b325c1f2f3e90a5befadbb5e610d4" +source = "git+https://github.com/scroll-tech/alloy-eips?branch=v0.3.2#8d5fc83fc257b09510dc8d76561188218d9c0c32" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -191,7 +191,8 @@ dependencies = [ [[package]] name = "alloy-eip7702" version = "0.4.2" -source = "git+https://github.com/scroll-tech/alloy-eips?branch=v0.4.2#92b2892d7b5b325c1f2f3e90a5befadbb5e610d4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c986539255fb839d1533c128e190e557e52ff652c9ef62939e233a81dd93f7e" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -9226,32 +9227,34 @@ dependencies = [ name = "reth-scroll-consensus" version = "1.1.2" dependencies = [ - "eyre", - "reth-scroll-revm", + "eyre", + "reth-scroll-revm", ] [[package]] name = "reth-scroll-evm" version = "1.1.2" dependencies = [ - "alloy-consensus", - "alloy-eips", - "auto_impl", - "derive_more", - "eyre", - "reth-chainspec", - "reth-consensus", - "reth-ethereum-consensus", - "reth-evm", - "reth-primitives", - "reth-primitives-traits", - "reth-revm", - "reth-scroll-consensus", - "reth-scroll-execution", - "reth-scroll-primitives", - "reth-scroll-revm", - "thiserror 1.0.69", - "tracing", + "alloy-consensus", + "alloy-eips", + "auto_impl", + "derive_more", + "eyre", + "reth-chainspec", + "reth-consensus", + "reth-ethereum-consensus", + "reth-evm", + "reth-primitives", + "reth-primitives-traits", + "reth-revm", + "reth-scroll-chainspec", + "reth-scroll-consensus", + "reth-scroll-execution", + "reth-scroll-forks", + "reth-scroll-primitives", + "reth-scroll-revm", + "thiserror 1.0.69", + "tracing", ] [[package]] @@ -9773,7 +9776,7 @@ dependencies = [ [[package]] name = "revm" version = "18.0.0" -source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/v50#9df25c5085f9ca477944b52bca972a6c920bcc8d" +source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/reth/v50#a740f3d8086395c00fa77fad5474bc4fde5b195d" dependencies = [ "auto_impl", "cfg-if", @@ -9806,7 +9809,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "14.0.0" -source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/v50#9df25c5085f9ca477944b52bca972a6c920bcc8d" +source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/reth/v50#a740f3d8086395c00fa77fad5474bc4fde5b195d" dependencies = [ "cfg-if", "revm-primitives", @@ -9816,7 +9819,7 @@ dependencies = [ [[package]] name = "revm-precompile" version = "15.0.0" -source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/v50#9df25c5085f9ca477944b52bca972a6c920bcc8d" +source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/reth/v50#a740f3d8086395c00fa77fad5474bc4fde5b195d" dependencies = [ "aurora-engine-modexp", "blst", @@ -9835,7 +9838,7 @@ dependencies = [ [[package]] name = "revm-primitives" version = "14.0.0" -source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/v50#9df25c5085f9ca477944b52bca972a6c920bcc8d" +source = "git+https://github.com/scroll-tech/revm.git?branch=scroll-evm-executor/reth/v50#a740f3d8086395c00fa77fad5474bc4fde5b195d" dependencies = [ "alloy-eip2930", "alloy-eip7702", diff --git a/Cargo.toml b/Cargo.toml index e2446dde29c1..532698a2a534 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -413,6 +413,7 @@ reth-rpc-eth-types = { path = "crates/rpc/rpc-eth-types", default-features = fal reth-rpc-layer = { path = "crates/rpc/rpc-layer" } reth-rpc-server-types = { path = "crates/rpc/rpc-server-types" } reth-rpc-types-compat = { path = "crates/rpc/rpc-types-compat" } +reth-scroll-chainspec = { path = "crates/scroll/chainspec" } reth-scroll-consensus = { path = "crates/scroll/consensus" } reth-scroll-evm = { path = "crates/scroll/evm" } reth-scroll-execution = { path = "crates/scroll/execution" } @@ -669,10 +670,9 @@ tracy-client = "0.17.3" #op-alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/op-alloy", rev = "6a042e7681b1" } [patch.crates-io] -revm = { git = "https://github.com/scroll-tech/revm.git", branch = "scroll-evm-executor/v50" } -revm-primitives = { git = "https://github.com/scroll-tech/revm.git", branch = "scroll-evm-executor/v50" } +revm = { git = "https://github.com/scroll-tech/revm.git", branch = "scroll-evm-executor/reth/v50" } +revm-primitives = { git = "https://github.com/scroll-tech/revm.git", branch = "scroll-evm-executor/reth/v50" } ff = { git = "https://github.com/scroll-tech/ff", branch = "feat/sp1" } -alloy-eip2930 = { git = "https://github.com/scroll-tech/alloy-eips", branch = "v0.4.2" } -alloy-eip7702 = { git = "https://github.com/scroll-tech/alloy-eips", branch = "v0.4.2" } +alloy-eip2930 = { git = "https://github.com/scroll-tech/alloy-eips", branch = "v0.3.2" } diff --git a/crates/scroll/chainspec/src/genesis.rs b/crates/scroll/chainspec/src/genesis.rs index ceb646a288ba..9319a68110d5 100644 --- a/crates/scroll/chainspec/src/genesis.rs +++ b/crates/scroll/chainspec/src/genesis.rs @@ -1,6 +1,6 @@ //! Scroll types for genesis data. -use alloy_primitives::Address; +use alloy_primitives::{address, Address}; use alloy_serde::OtherFields; use serde::de::Error; @@ -115,6 +115,31 @@ impl ScrollChainConfig { pub fn extract_from(others: &OtherFields) -> Option { Self::try_from(others).ok() } + + /// Returns the [`ScrollChainConfig`] for Scroll Mainnet. + pub const fn mainnet() -> Self { + Self { + fee_vault_address: Some(address!("5300000000000000000000000000000000000005")), + l1_config: L1Config { + l1_chain_id: 1, + l1_message_queue_address: address!("0d7E906BD9cAFa154b048cFa766Cc1E54E39AF9B"), + scroll_chain_address: address!("a13BAF47339d63B743e7Da8741db5456DAc1E556"), + num_l1_messages_per_block: 10, + }, + } + } + /// Returns the [`ScrollChainConfig`] for Scroll Sepolia. + pub const fn sepolia() -> Self { + Self { + fee_vault_address: Some(address!("5300000000000000000000000000000000000005")), + l1_config: L1Config { + l1_chain_id: 11155111, + l1_message_queue_address: address!("F0B2293F5D834eAe920c6974D50957A1732de763"), + scroll_chain_address: address!("2D567EcE699Eabe5afCd141eDB7A4f2D0D6ce8a0"), + num_l1_messages_per_block: 10, + }, + } + } } impl TryFrom<&OtherFields> for ScrollChainConfig { diff --git a/crates/scroll/chainspec/src/lib.rs b/crates/scroll/chainspec/src/lib.rs index d628af48e0ea..7224af82b707 100644 --- a/crates/scroll/chainspec/src/lib.rs +++ b/crates/scroll/chainspec/src/lib.rs @@ -33,7 +33,7 @@ mod dev; pub use dev::SCROLL_DEV; mod genesis; -pub use genesis::ScrollChainInfo; +pub use genesis::{ScrollChainConfig, ScrollChainInfo}; mod scroll; pub use scroll::SCROLL_MAINNET; diff --git a/crates/scroll/evm/Cargo.toml b/crates/scroll/evm/Cargo.toml index 79dfef9d76e7..28653851c6d6 100644 --- a/crates/scroll/evm/Cargo.toml +++ b/crates/scroll/evm/Cargo.toml @@ -24,6 +24,10 @@ reth-revm.workspace = true # revm revm = { workspace = true, features = ["optional_no_base_fee"] } +# scroll +reth-scroll-chainspec.workspace = true +reth-scroll-forks.workspace = true + # alloy alloy-consensus.workspace = true alloy-eips.workspace = true diff --git a/crates/scroll/evm/src/config.rs b/crates/scroll/evm/src/config.rs index 9fa4ea5e044b..67215d2f5905 100644 --- a/crates/scroll/evm/src/config.rs +++ b/crates/scroll/evm/src/config.rs @@ -1,7 +1,9 @@ -use reth_chainspec::{ChainSpec, Head}; +use reth_chainspec::Head; use reth_evm::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes}; use reth_primitives::{transaction::FillTxEnv, TransactionSigned}; use reth_revm::{inspector_handle_register, Database, Evm, GetInspector, TxEnv}; +use reth_scroll_chainspec::{ScrollChainConfig, ScrollChainSpec}; +use reth_scroll_forks::ScrollHardfork; use revm::{ precompile::{Address, Bytes}, primitives::{ @@ -15,30 +17,27 @@ use std::{convert::Infallible, sync::Arc}; #[derive(Clone, Debug)] pub struct ScrollEvmConfig { /// The chain spec for Scroll. - // TODO (scroll): update to ScrollChainSpec. - chain_spec: Arc, + chain_spec: Arc, + /// Additional Scroll configuration. + scroll_config: ScrollChainConfig, } impl ScrollEvmConfig { /// Returns a new instance of [`ScrollEvmConfig`]. - pub const fn new(chain_spec: Arc) -> Self { - Self { chain_spec } + pub const fn new(chain_spec: Arc, scroll_config: ScrollChainConfig) -> Self { + Self { chain_spec, scroll_config } } /// Returns the spec id at the given head. - pub fn spec_id_at_head(&self, _head: &Head) -> SpecId { - // TODO (scroll): uncomment once the Scroll chain spec is available - // let chain_spec = &self.chain_spec; - // if chain_spec.fork(ScrollHardfork::Euclid).active_at_head(head) { - // SpecId::EUCLID - // } else if chain_spec.fork(ScrollHardfork::Curie).active_at_head(head) { - // SpecId::CURIE - // } else if chain_spec.fork(ScrollHardfork::Bernouilli).active_at_head(head) { - // SpecId::BERNOULLI - // } else { - // SpecId::PRE_BERNOULLI - // } - SpecId::PRE_BERNOULLI + pub fn spec_id_at_head(&self, head: &Head) -> SpecId { + let chain_spec = &self.chain_spec; + if chain_spec.fork(ScrollHardfork::Curie).active_at_head(head) { + SpecId::CURIE + } else if chain_spec.fork(ScrollHardfork::Bernoulli).active_at_head(head) { + SpecId::BERNOULLI + } else { + SpecId::PRE_BERNOULLI + } } } @@ -107,10 +106,9 @@ impl ConfigureEvmEnv for ScrollEvmConfig { fn fill_block_env(&self, block_env: &mut BlockEnv, header: &Self::Header, after_merge: bool) { block_env.number = U256::from(header.number); block_env.coinbase = header.beneficiary; - // TODO (scroll): uncomment once the Scroll chain spec is available - // if let Some(vault_address) = self.chain_spec.fee_vault_address { - // block_env.coinbase = vault_address; - // } + if let Some(vault_address) = self.scroll_config.fee_vault_address { + block_env.coinbase = vault_address; + } block_env.timestamp = U256::from(header.timestamp); if after_merge { block_env.prevrandao = Some(header.mix_hash); @@ -138,11 +136,11 @@ impl ConfigureEvmEnv for ScrollEvmConfig { ..Default::default() }); - let coinbase = attributes.suggested_fee_recipient; - // TODO (scroll): uncomment once the Scroll chain spec is available - // if let Some(vault_address) = self.chain_spec.fee_vault_address { - // block_env.coinbase = vault_address; - // } + let coinbase = if let Some(vault_address) = self.scroll_config.fee_vault_address { + vault_address + } else { + attributes.suggested_fee_recipient + }; let block_env = BlockEnv { number: U256::from(parent.number + 1), @@ -152,9 +150,8 @@ impl ConfigureEvmEnv for ScrollEvmConfig { prevrandao: Some(attributes.prev_randao), gas_limit: U256::from(parent.gas_limit), // calculate basefee based on parent block's gas usage - basefee: U256::ZERO, - // TODO (scroll): uncomment once the Scroll chain spec is available - // self.chain_spec.next_block_base_fee(parent, attributes.timestamp)?, + // TODO(scroll): update with correct block fee calculation for block building. + basefee: U256::from(parent.base_fee_per_gas.unwrap_or_default()), blob_excess_gas_and_price: None, }; @@ -172,21 +169,22 @@ mod tests { use super::*; use alloy_consensus::Header; use reth_chainspec::NamedChain::Scroll; - use revm::primitives::{address, SpecId, B256}; + use reth_scroll_chainspec::ScrollChainSpecBuilder; + use revm::primitives::{SpecId, B256}; #[test] fn test_spec_at_head() { - // TODO (scroll): change this to `ScrollChainSpecBuilder::mainnet()`. - let config = ScrollEvmConfig::new(ChainSpec::default().into()); + let config = ScrollEvmConfig::new( + ScrollChainSpecBuilder::scroll_mainnet().build().into(), + ScrollChainConfig::default(), + ); // prepare all fork heads - let euclid_head = &Head { number: u64::MAX, ..Default::default() }; let curie_head = &Head { number: 7096836, ..Default::default() }; let bernouilli_head = &Head { number: 5220340, ..Default::default() }; let pre_bernouilli_head = &Head { number: 0, ..Default::default() }; // check correct spec id - assert_eq!(config.spec_id_at_head(euclid_head), SpecId::EUCLID); assert_eq!(config.spec_id_at_head(curie_head), SpecId::CURIE); assert_eq!(config.spec_id_at_head(bernouilli_head), SpecId::BERNOULLI); assert_eq!(config.spec_id_at_head(pre_bernouilli_head), SpecId::PRE_BERNOULLI); @@ -194,21 +192,10 @@ mod tests { #[test] fn test_fill_cfg_env() { - // TODO (scroll): change this to `ScrollChainSpecBuilder::mainnet()`. - let config = ScrollEvmConfig::new(ChainSpec::default().into()); - - // euclid header - let mut cfg_env = CfgEnvWithHandlerCfg::new(Default::default(), Default::default()); - let euclid_header = Header { number: u64::MAX, ..Default::default() }; - - // fill cfg env - config.fill_cfg_env(&mut cfg_env, &euclid_header, U256::ZERO); - - // check correct cfg env - assert_eq!(cfg_env.chain_id, Scroll as u64); - assert_eq!(cfg_env.perf_analyse_created_bytecodes, AnalysisKind::Analyse); - assert_eq!(cfg_env.handler_cfg.spec_id, SpecId::EUCLID); - assert!(cfg_env.handler_cfg.is_scroll); + let config = ScrollEvmConfig::new( + ScrollChainSpecBuilder::scroll_mainnet().build().into(), + ScrollChainConfig::default(), + ); // curie let mut cfg_env = CfgEnvWithHandlerCfg::new(Default::default(), Default::default()); @@ -223,7 +210,7 @@ mod tests { assert_eq!(cfg_env.handler_cfg.spec_id, SpecId::CURIE); assert!(cfg_env.handler_cfg.is_scroll); - // bernouilli + // bernoulli let mut cfg_env = CfgEnvWithHandlerCfg::new(Default::default(), Default::default()); let bernouilli_header = Header { number: 5220340, ..Default::default() }; @@ -236,7 +223,7 @@ mod tests { assert_eq!(cfg_env.handler_cfg.spec_id, SpecId::BERNOULLI); assert!(cfg_env.handler_cfg.is_scroll); - // pre-bernouilli + // pre-bernoulli let mut cfg_env = CfgEnvWithHandlerCfg::new(Default::default(), Default::default()); let pre_bernouilli_header = Header { number: 0, ..Default::default() }; @@ -252,8 +239,10 @@ mod tests { #[test] fn test_fill_block_env() { - // TODO (scroll): change this to `ScrollChainSpecBuilder::mainnet()`. - let config = ScrollEvmConfig::new(ChainSpec::default().into()); + let config = ScrollEvmConfig::new( + ScrollChainSpecBuilder::scroll_mainnet().build().into(), + ScrollChainConfig::mainnet(), + ); let mut block_env = BlockEnv::default(); // curie header @@ -271,11 +260,9 @@ mod tests { config.fill_block_env(&mut block_env, &header, true); // verify block env correctly updated - // TODO (scroll): replace with `config.chain_spec.fee_vault_address.unwrap()` - const FEE_VAULT_ADDRESS: Address = address!("5300000000000000000000000000000000000005"); let expected = BlockEnv { number: U256::from(header.number), - coinbase: FEE_VAULT_ADDRESS, + coinbase: config.scroll_config.fee_vault_address.unwrap(), timestamp: U256::from(header.timestamp), prevrandao: Some(header.mix_hash), difficulty: U256::ZERO, @@ -288,8 +275,10 @@ mod tests { #[test] fn test_next_cfg_and_block_env() -> eyre::Result<()> { - // TODO (scroll): change this to `ScrollChainSpecBuilder::mainnet()`. - let config = ScrollEvmConfig::new(ChainSpec::default().into()); + let config = ScrollEvmConfig::new( + ScrollChainSpecBuilder::scroll_mainnet().build().into(), + ScrollChainConfig::mainnet(), + ); // pre curie header let header = Header { @@ -318,18 +307,16 @@ mod tests { assert!(cfg_env.handler_cfg.is_scroll); // verify block env - // TODO (scroll): replace with `config.chain_spec.fee_vault_address.unwrap()` - const FEE_VAULT_ADDRESS: Address = address!("5300000000000000000000000000000000000005"); let expected = BlockEnv { number: U256::from(header.number + 1), - coinbase: FEE_VAULT_ADDRESS, + coinbase: config.scroll_config.fee_vault_address.unwrap(), timestamp: U256::from(attributes.timestamp), prevrandao: Some(attributes.prev_randao), difficulty: U256::ZERO, - // TODO (scroll): update once the Scroll chain spec is available // TODO (scroll): this shouldn't be 0 at curie fork basefee: U256::ZERO, gas_limit: U256::from(header.gas_limit), + blob_excess_gas_and_price: None, ..Default::default() }; assert_eq!(block_env, expected); diff --git a/crates/scroll/evm/src/execute.rs b/crates/scroll/evm/src/execute.rs index 7cacf7b81b54..1eaeb73b2d4b 100644 --- a/crates/scroll/evm/src/execute.rs +++ b/crates/scroll/evm/src/execute.rs @@ -3,7 +3,7 @@ use crate::{ForkError, ScrollBlockExecutionError, ScrollEvmConfig}; use alloy_consensus::{Header, Transaction}; use alloy_eips::{eip2718::Encodable2718, eip7685::Requests}; -use reth_chainspec::{ChainSpec, EthereumHardfork, EthereumHardforks}; +use reth_chainspec::EthereumHardforks; use reth_consensus::ConsensusError; use reth_evm::{ execute::{ @@ -16,8 +16,10 @@ use reth_primitives::{ gas_spent_by_transactions, BlockWithSenders, GotExpected, InvalidTransactionError, Receipt, }; use reth_revm::primitives::{CfgEnvWithHandlerCfg, U256}; +use reth_scroll_chainspec::{ScrollChainConfig, ScrollChainSpec}; use reth_scroll_consensus::apply_curie_hard_fork; use reth_scroll_execution::FinalizeExecution; +use reth_scroll_forks::ScrollHardfork; use revm::{ db::BundleState, primitives::{bytes::BytesMut, BlockEnv, EnvWithHandlerCfg, ResultAndState}, @@ -32,8 +34,7 @@ use std::{ #[derive(Debug)] pub struct ScrollExecutionStrategy { /// Chain specification. - // TODO (scroll): update to the Scroll chain spec - chain_spec: Arc, + chain_spec: Arc, /// Evm configuration. evm_config: EvmConfig, /// Current state for the execution. @@ -42,7 +43,11 @@ pub struct ScrollExecutionStrategy { impl ScrollExecutionStrategy { /// Returns an instance of [`ScrollExecutionStrategy`]. - pub const fn new(chain_spec: Arc, evm_config: EvmConfig, state: State) -> Self { + pub const fn new( + chain_spec: Arc, + evm_config: EvmConfig, + state: State, + ) -> Self { Self { chain_spec, evm_config, state } } } @@ -78,9 +83,7 @@ where block: &BlockWithSenders, _total_difficulty: U256, ) -> Result<(), Self::Error> { - // TODO (scroll): update to the Scroll chain spec - // TODO (scroll): update to the Curie hardfork - if self.chain_spec.fork(EthereumHardfork::Dao).transitions_at_block(block.number) { + if self.chain_spec.fork(ScrollHardfork::Curie).transitions_at_block(block.number) { if let Err(err) = apply_curie_hard_fork(&mut self.state) { tracing::debug!(%err, "failed to apply curie hardfork"); return Err(ForkError::Curie.into()); @@ -227,16 +230,15 @@ where #[derive(Clone, Debug)] pub struct ScrollExecutionStrategyFactory { /// The chain specification for the [`ScrollExecutionStrategy`]. - // TODO (scroll): update to the Scroll chain spec - chain_spec: Arc, + chain_spec: Arc, /// The Evm configuration for the [`ScrollExecutionStrategy`]. evm_config: EvmConfig, } impl ScrollExecutionStrategyFactory { /// Returns a new instance of the [`ScrollExecutionStrategyFactory`]. - pub fn new(chain_spec: Arc) -> Self { - let evm_config = ScrollEvmConfig::new(chain_spec.clone()); + pub fn new(chain_spec: Arc, scroll_config: ScrollChainConfig) -> Self { + let evm_config = ScrollEvmConfig::new(chain_spec.clone(), scroll_config); Self { chain_spec, evm_config } } } @@ -267,10 +269,11 @@ where mod tests { use super::*; use crate::{ScrollEvmConfig, ScrollExecutionStrategy, ScrollExecutionStrategyFactory}; - use reth_chainspec::{ChainSpecBuilder, MIN_TRANSACTION_GAS}; + use reth_chainspec::MIN_TRANSACTION_GAS; use reth_evm::execute::ExecuteOutput; use reth_primitives::{Block, BlockBody, BlockWithSenders, Receipt, TransactionSigned, TxType}; use reth_primitives_traits::transaction::signed::SignedTransaction; + use reth_scroll_chainspec::ScrollChainSpecBuilder; use reth_scroll_consensus::{ BLOB_SCALAR_SLOT, COMMIT_SCALAR_SLOT, CURIE_L1_GAS_PRICE_ORACLE_BYTECODE, CURIE_L1_GAS_PRICE_ORACLE_STORAGE, IS_CURIE_SLOT, L1_BASE_FEE_SLOT, L1_BLOB_BASE_FEE_SLOT, @@ -284,9 +287,9 @@ mod tests { }; fn strategy() -> ScrollExecutionStrategy, ScrollEvmConfig> { - // TODO (scroll): change this to `ScrollChainSpecBuilder::mainnet()`. - let chain_spec = Arc::new(ChainSpecBuilder::mainnet().build()); - let factory = ScrollExecutionStrategyFactory::new(chain_spec); + let chain_spec = Arc::new(ScrollChainSpecBuilder::scroll_mainnet().build()); + let config = ScrollChainConfig::mainnet(); + let factory = ScrollExecutionStrategyFactory::new(chain_spec, config); let db = EmptyDBTyped::::new(); factory.create_strategy(db) @@ -467,9 +470,9 @@ mod tests { (L1_BASE_FEE_SLOT, U256::from(1000)), (OVER_HEAD_SLOT, U256::from(1000)), (SCALAR_SLOT, U256::from(1000)), - (L1_BLOB_BASE_FEE_SLOT, U256::from(1000)), + (L1_BLOB_BASE_FEE_SLOT, U256::from(10000)), (COMMIT_SCALAR_SLOT, U256::from(1000)), - (BLOB_SCALAR_SLOT, U256::from(1000)), + (BLOB_SCALAR_SLOT, U256::from(10000)), (IS_CURIE_SLOT, U256::from(1)), ] .into_iter() @@ -488,9 +491,7 @@ mod tests { tx_type: TxType::Legacy, cumulative_gas_used: MIN_TRANSACTION_GAS, success: true, - // TODO (scroll): set this to the correct value (should be different from - // not_curie_fork) - l1_fee: U256::from(3), + l1_fee: U256::from(9), ..Default::default() }];