@@ -564,24 +564,22 @@ impl ProofAggregator {
564564 }
565565 }
566566
567- // Updates the gas fees of a `TransactionRequest` using a fixed bump strategy .
567+ // Updates the gas fees of a `TransactionRequest` using EIP-1559 fee parameters .
568568 // Intended for retrying an on-chain submission after a timeout.
569569 //
570570 // Strategy:
571- // - Fetch the current network gas price.
572- // - Apply `base_bump_percentage` to compute a bumped base fee.
573- // - Apply `max_fee_bump_percentage` on top of the bumped base fee to set `max_fee_per_gas`.
574- // - Set `max_priority_fee_per_gas` to a fixed value derived from `priority_fee_wei`.
571+ // - Fetch the current base fee from the latest block.
572+ // - Set `max_priority_fee_per_gas` to a fixed value from `priority_fee_wei`.
573+ // - Compute `max_fee_per_gas` as: (1 + max_fee_bump_percentage/100) * base_fee + priority_fee.
575574 //
576- // Fees are recomputed on each retry using the latest gas price (no incremental per-attempt bump).
575+ // Fees are recomputed on each retry using the latest base fee (no incremental per-attempt bump).
577576
578577 async fn apply_gas_fee_bump (
579578 & self ,
580579 tx_req : TransactionRequest ,
581580 ) -> Result < TransactionRequest , AggregatedProofSubmissionError > {
582581 let provider = self . proof_aggregation_service . provider ( ) ;
583582
584- let base_bump_percentage = self . config . base_bump_percentage ;
585583 let max_fee_bump_percentage = self . config . max_fee_bump_percentage ;
586584 let priority_fee_wei = self . config . priority_fee_wei ;
587585
@@ -596,8 +594,8 @@ impl ProofAggregator {
596594 . base_fee_per_gas
597595 . ok_or ( AggregatedProofSubmissionError :: BaseFeePerGasMissing ) ?;
598596
599- let new_base_fee = current_base_fee as f64 * ( 1.0 + base_bump_percentage as f64 / 100.0 ) ;
600- let new_max_fee = new_base_fee * ( 1.0 + max_fee_bump_percentage as f64 / 100.0 ) ;
597+ let max_fee_multiplier = 1.0 + max_fee_bump_percentage as f64 / 100.0 ;
598+ let new_max_fee = max_fee_multiplier * current_base_fee as f64 + priority_fee_wei as f64 ;
601599
602600 Ok ( tx_req
603601 . with_max_fee_per_gas ( new_max_fee as u128 )
0 commit comments