Skip to content

Commit 996320b

Browse files
committed
fix types
1 parent a1434ff commit 996320b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • aggregation_mode/proof_aggregator/src/backend

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,24 +611,25 @@ impl ProofAggregator {
611611
.map_err(|e| AggregatedProofSubmissionError::GasPriceError(e.to_string()))?
612612
as u128;
613613

614-
// Calculate priority fee: suggested * (1 + (attempt + 1), capped at max
615-
let priority_fee_multiplier = attempt + 1;
614+
// Calculate priority fee: suggested * (attempt + 1), capped at max
615+
let priority_fee_multiplier = (attempt + 1) as u128;
616616
let max_priority_fee_per_gas = (suggested_priority_fee * priority_fee_multiplier)
617617
.min(max_priority_fee_upper_limit);
618618

619619
// Calculate max fee with cumulative bump per attempt to ensure replacement tx is accepted
620620
let max_fee_multiplier = 1.0 + max_fee_bump_percentage as f64 / 100.0;
621-
let max_fee_per_gas = max_fee_multiplier * current_base_fee + max_priority_fee_per_gas;
621+
let max_fee_per_gas =
622+
(max_fee_multiplier * current_base_fee) as u128 + max_priority_fee_per_gas;
622623

623624
info!(
624625
"Base fee: {:.4} Gwei. Applying max_fee_per_gas: {:.4} Gwei and max_priority_fee_per_gas: {:.4} Gwei to tx",
625626
current_base_fee / 1e9,
626-
max_fee_per_gas / 1e9,
627-
max_priority_fee_per_gas / 1e9
627+
max_fee_per_gas as f64 / 1e9,
628+
max_priority_fee_per_gas as f64 / 1e9
628629
);
629630

630631
Ok(tx_req
631-
.with_max_fee_per_gas(max_fee_per_gas as u128)
632+
.with_max_fee_per_gas(max_fee_per_gas)
632633
.with_max_priority_fee_per_gas(max_priority_fee_per_gas))
633634
}
634635

0 commit comments

Comments
 (0)