@@ -31,7 +31,7 @@ use op_rbuilder::{
3131} ;
3232use rand:: { Rng , SeedableRng , rngs:: StdRng } ;
3333use reth_basic_payload_builder:: PayloadConfig ;
34- use reth_chainspec:: MAINNET ;
34+ use reth_chainspec:: { EthChainSpec , MAINNET } ;
3535use reth_db:: { tables, transaction:: DbTxMut } ;
3636use reth_optimism_chainspec:: OpChainSpecBuilder ;
3737use reth_optimism_node:: OpPayloadBuilderAttributes ;
@@ -54,7 +54,6 @@ use reth_transaction_pool::PoolTransaction;
5454use reth_trie:: HashedPostState ;
5555
5656const SEED : u64 = 0x5eed_f1a5_b10c ;
57- const CHAIN_ID : u64 = 8453 ;
5857const BASE_FEE : u64 = 1_000_000_000 ;
5958const BLOCK_GAS_LIMIT : u64 = 30_000_000 ;
6059const MAX_TXS : usize = 200 ;
@@ -107,13 +106,14 @@ struct BenchFixture {
107106impl BenchFixture {
108107 fn new ( ) -> Self {
109108 let chain_spec = Arc :: new (
110- OpChainSpecBuilder :: base_mainnet ( )
109+ OpChainSpecBuilder :: optimism_mainnet ( )
111110 . jovian_activated ( )
112111 . build ( ) ,
113112 ) ;
114- let ( mut signers, mut transactions) = generate_transactions ( SEED ) ;
113+ let chain_id = chain_spec. chain_id ( ) ;
114+ let ( mut signers, mut transactions) = generate_transactions ( SEED , chain_id) ;
115115 let ( warm_signers, mut warm_transactions) =
116- generate_transactions ( SEED ^ 0xa11c_e5e5_cac4_ebad ) ;
116+ generate_transactions ( SEED ^ 0xa11c_e5e5_cac4_ebad , chain_id ) ;
117117 signers. extend ( warm_signers) ;
118118 // Priority fee descends with generation index, so pool ordering preserves the scenario
119119 // layout that the disposition/nonce assertions below rely on.
@@ -380,7 +380,7 @@ fn transaction_disposition(index: usize) -> TransactionDisposition {
380380 }
381381}
382382
383- fn generate_transactions ( seed : u64 ) -> ( Vec < Signer > , Vec < FBPooledTransaction > ) {
383+ fn generate_transactions ( seed : u64 , chain_id : u64 ) -> ( Vec < Signer > , Vec < FBPooledTransaction > ) {
384384 let mut rng = StdRng :: seed_from_u64 ( seed) ;
385385 let mut signers = Vec :: with_capacity ( MAX_TXS ) ;
386386 let mut signer_nonces = Vec :: with_capacity ( MAX_TXS ) ;
@@ -443,7 +443,7 @@ fn generate_transactions(seed: u64) -> (Vec<Signer>, Vec<FBPooledTransaction>) {
443443 )
444444 } ;
445445 let tx = TxEip1559 {
446- chain_id : CHAIN_ID ,
446+ chain_id,
447447 nonce,
448448 gas_limit,
449449 max_fee_per_gas : BASE_FEE as u128 + priority_fee,
0 commit comments