Skip to content

Commit c2fdc66

Browse files
fix: use float values to avoid lossing presicion on operation
1 parent c5c06c5 commit c2fdc66

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • aggregation_mode/proof_aggregator/src/backend

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,13 @@ impl ProofAggregator {
551551
.await
552552
.map_err(|e| AggregatedProofSubmissionError::GasPriceError(e.to_string()))?;
553553

554-
let new_base_fee = current_gas_price * (1 + base_bump_percentage as u128 / 100);
555-
let new_max_fee = new_base_fee * (1 + max_fee_bump_percentage as u128 / 100);
554+
let new_base_fee = current_gas_price as f64 * (1.0 + base_bump_percentage as f64 / 100.0);
555+
let new_max_fee = new_base_fee as f64 * (1.0 + max_fee_bump_percentage as f64 / 100.0);
556556
let new_priority_fee = priority_fee_wei;
557557

558558
Ok(tx_req
559-
.with_max_fee_per_gas(new_max_fee)
560-
.with_max_priority_fee_per_gas(new_priority_fee))
559+
.with_max_fee_per_gas(new_max_fee as u128)
560+
.with_max_priority_fee_per_gas(new_priority_fee as u128))
561561
}
562562

563563
async fn wait_until_can_submit_aggregated_proof(

0 commit comments

Comments
 (0)