Skip to content

Commit a1434ff

Browse files
committed
fee tweaks
1 parent d9f8c5b commit a1434ff

File tree

1 file changed

+6
-5
lines changed
  • aggregation_mode/proof_aggregator/src/backend

1 file changed

+6
-5
lines changed

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,14 @@ impl ProofAggregator {
609609
.get_max_priority_fee_per_gas()
610610
.await
611611
.map_err(|e| AggregatedProofSubmissionError::GasPriceError(e.to_string()))?
612-
as f64;
612+
as u128;
613613

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

619+
// Calculate max fee with cumulative bump per attempt to ensure replacement tx is accepted
619620
let max_fee_multiplier = 1.0 + max_fee_bump_percentage as f64 / 100.0;
620621
let max_fee_per_gas = max_fee_multiplier * current_base_fee + max_priority_fee_per_gas;
621622

@@ -628,7 +629,7 @@ impl ProofAggregator {
628629

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

634635
async fn wait_until_can_submit_aggregated_proof(

0 commit comments

Comments
 (0)