@@ -198,13 +198,13 @@ enum ReproposeError {
198198impl SequencerConsensusContext {
199199 pub fn new ( config : ContextConfig , deps : SequencerConsensusContextDeps ) -> Self {
200200 register_metrics ( ) ;
201- let num_validators = config. num_validators ;
202- let l1_da_mode = if config. l1_da_mode {
201+ let num_validators = config. static_config . num_validators ;
202+ let l1_da_mode = if config. static_config . l1_da_mode {
203203 L1DataAvailabilityMode :: Blob
204204 } else {
205205 L1DataAvailabilityMode :: Calldata
206206 } ;
207- let validators = if let Some ( ids) = config. validator_ids . clone ( ) {
207+ let validators = if let Some ( ids) = config. static_config . validator_ids . clone ( ) {
208208 ids. into_iter ( ) . collect ( )
209209 } else {
210210 ( 0 ..num_validators) . map ( |i| ValidatorId :: from ( DEFAULT_VALIDATOR_ID + i) ) . collect ( )
@@ -227,7 +227,8 @@ impl SequencerConsensusContext {
227227 }
228228
229229 async fn start_stream ( & mut self , stream_id : HeightAndRound ) -> StreamSender {
230- let ( proposal_sender, proposal_receiver) = mpsc:: channel ( self . config . proposal_buffer_size ) ;
230+ let ( proposal_sender, proposal_receiver) =
231+ mpsc:: channel ( self . config . static_config . proposal_buffer_size ) ;
231232 self . deps
232233 . outbound_proposal_sender
233234 . send ( ( stream_id, proposal_receiver) )
@@ -318,7 +319,7 @@ impl SequencerConsensusContext {
318319
319320 fn update_l2_gas_price ( & mut self , l2_gas_used : GasAmount ) {
320321 let gas_target = VersionedConstants :: latest_constants ( ) . gas_target ;
321- if let Some ( override_value) = self . config . override_l2_gas_price_fri {
322+ if let Some ( override_value) = self . config . dynamic_config . override_l2_gas_price_fri {
322323 info ! (
323324 "L2 gas price ({}) is not updated, remains on override value of {override_value} \
324325 fri",
@@ -476,30 +477,32 @@ impl ConsensusContext for SequencerConsensusContext {
476477 let ( fin_sender, fin_receiver) = oneshot:: channel ( ) ;
477478 let proposal_id = ProposalId ( self . proposal_id ) ;
478479 self . proposal_id += 1 ;
479- assert ! ( timeout > self . config. build_proposal_margin_millis) ;
480+ assert ! ( timeout > self . config. static_config . build_proposal_margin_millis) ;
480481 let stream_id = HeightAndRound ( proposal_init. height . 0 , proposal_init. round ) ;
481482 let stream_sender = self . start_stream ( stream_id) . await ;
482483
483484 info ! ( ?proposal_init, ?timeout, %proposal_id, "Start building proposal" ) ;
484485 let cancel_token = CancellationToken :: new ( ) ;
485486 let cancel_token_clone = cancel_token. clone ( ) ;
486- let gas_price_params = make_gas_price_params ( & self . config ) ;
487+ let gas_price_params = make_gas_price_params ( & self . config . dynamic_config ) ;
487488 let mut l2_gas_price = self . l2_gas_price ;
488- if let Some ( override_value) = self . config . override_l2_gas_price_fri {
489+ if let Some ( override_value) = self . config . dynamic_config . override_l2_gas_price_fri {
489490 info ! ( "Overriding L2 gas price to {override_value} fri" ) ;
490491 l2_gas_price = GasPrice ( override_value) ;
491492 }
492493
493494 // The following calculations will panic on overflow/negative result.
494- let total_build_proposal_time = timeout - self . config . build_proposal_margin_millis ;
495+ let total_build_proposal_time =
496+ timeout - self . config . static_config . build_proposal_margin_millis ;
495497 let time_now = self . deps . clock . now ( ) ;
496498 let batcher_deadline = time_now + total_build_proposal_time;
497499 let retrospective_block_hash_deadline = time_now
498- + total_build_proposal_time
499- . mul_f32 ( self . config . build_proposal_time_ratio_for_retrospective_block_hash ) ;
500+ + total_build_proposal_time. mul_f32 (
501+ self . config . static_config . build_proposal_time_ratio_for_retrospective_block_hash ,
502+ ) ;
500503
501504 let use_state_sync_block_timestamp =
502- self . config . deployment_mode . use_state_sync_block_timestamp ( ) ;
505+ self . config . static_config . deployment_mode . use_state_sync_block_timestamp ( ) ;
503506
504507 let args = ProposalBuildArguments {
505508 deps : self . deps . clone ( ) ,
@@ -512,13 +515,14 @@ impl ConsensusContext for SequencerConsensusContext {
512515 proposal_id,
513516 cende_write_success,
514517 l2_gas_price,
515- builder_address : self . config . builder_address ,
518+ builder_address : self . config . static_config . builder_address ,
516519 cancel_token,
517520 previous_block_info : self . previous_block_info . clone ( ) ,
518521 proposal_round : self . current_round ,
519522 retrospective_block_hash_deadline,
520523 retrospective_block_hash_retry_interval_millis : self
521524 . config
525+ . static_config
522526 . retrospective_block_hash_retry_interval_millis ,
523527 use_state_sync_block_timestamp,
524528 } ;
@@ -580,11 +584,15 @@ impl ConsensusContext for SequencerConsensusContext {
580584 std:: cmp:: Ordering :: Equal => {
581585 let block_info_validation = BlockInfoValidation {
582586 height : proposal_init. height ,
583- block_timestamp_window_seconds : self . config . block_timestamp_window_seconds ,
587+ block_timestamp_window_seconds : self
588+ . config
589+ . static_config
590+ . block_timestamp_window_seconds ,
584591 previous_block_info : self . previous_block_info . clone ( ) ,
585592 l1_da_mode : self . l1_da_mode ,
586593 l2_gas_price_fri : self
587594 . config
595+ . dynamic_config
588596 . override_l2_gas_price_fri
589597 . map ( GasPrice )
590598 . unwrap_or ( self . l2_gas_price ) ,
@@ -593,7 +601,7 @@ impl ConsensusContext for SequencerConsensusContext {
593601 block_info_validation,
594602 proposal_init. proposer ,
595603 timeout,
596- self . config . validate_proposal_margin_millis ,
604+ self . config . static_config . validate_proposal_margin_millis ,
597605 content_receiver,
598606 fin_sender,
599607 )
@@ -726,15 +734,15 @@ impl ConsensusContext for SequencerConsensusContext {
726734 let now: u64 = self . deps . clock . unix_now ( ) ;
727735 if !( block_number == height
728736 && timestamp. 0 >= last_block_timestamp
729- && timestamp. 0 <= now + self . config . block_timestamp_window_seconds )
737+ && timestamp. 0 <= now + self . config . static_config . block_timestamp_window_seconds )
730738 {
731739 warn ! (
732740 "Invalid block info: expected block number {}, got {}, expected timestamp range \
733741 [{}, {}], got {}",
734742 height,
735743 block_number,
736744 last_block_timestamp,
737- now + self . config. block_timestamp_window_seconds,
745+ now + self . config. static_config . block_timestamp_window_seconds,
738746 timestamp. 0 ,
739747 ) ;
740748 return false ;
@@ -809,16 +817,24 @@ impl ConsensusContext for SequencerConsensusContext {
809817 } ;
810818 let block_info_validation = BlockInfoValidation {
811819 height,
812- block_timestamp_window_seconds : self . config . block_timestamp_window_seconds ,
820+ block_timestamp_window_seconds : self
821+ . config
822+ . static_config
823+ . block_timestamp_window_seconds ,
813824 previous_block_info : self . previous_block_info . clone ( ) ,
814825 l1_da_mode : self . l1_da_mode ,
815- l2_gas_price_fri : self . l2_gas_price ,
826+ l2_gas_price_fri : self
827+ . config
828+ . dynamic_config
829+ . override_l2_gas_price_fri
830+ . map ( GasPrice )
831+ . unwrap_or ( self . l2_gas_price ) ,
816832 } ;
817833 self . validate_current_round_proposal (
818834 block_info_validation,
819835 validator,
820836 timeout,
821- self . config . validate_proposal_margin_millis ,
837+ self . config . static_config . validate_proposal_margin_millis ,
822838 content,
823839 fin_sender,
824840 )
@@ -843,7 +859,7 @@ impl SequencerConsensusContext {
843859
844860 let cancel_token = CancellationToken :: new ( ) ;
845861 let cancel_token_clone = cancel_token. clone ( ) ;
846- let gas_price_params = make_gas_price_params ( & self . config ) ;
862+ let gas_price_params = make_gas_price_params ( & self . config . dynamic_config ) ;
847863 let args = ProposalValidateArguments {
848864 deps : self . deps . clone ( ) ,
849865 block_info_validation,
0 commit comments