Skip to content

Commit c5c06c5

Browse files
change the priority fee value to be a number in wei as it can be represented in u128 entirely
1 parent 2e1dfce commit c5c06c5

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

aggregation_mode/proof_aggregator/src/backend/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct Config {
2525
pub bump_retry_interval_seconds: u64,
2626
pub base_bump_percentage: u64,
2727
pub max_fee_bump_percentage: u64,
28-
pub priority_fee_gwei: u128,
28+
pub priority_fee_wei: u128,
2929
}
3030

3131
impl Config {

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl ProofAggregator {
411411
let retry_interval = Duration::from_secs(self.config.bump_retry_interval_seconds);
412412
let base_bump_percentage = self.config.base_bump_percentage;
413413
let max_fee_bump_percentage = self.config.max_fee_bump_percentage;
414-
let priority_fee_gwei = self.config.priority_fee_gwei;
414+
let priority_fee_wei = self.config.priority_fee_wei;
415415

416416
// Build the transaction request
417417
let mut tx_req = match aggregated_proof {
@@ -450,7 +450,7 @@ impl ProofAggregator {
450450
.apply_gas_fee_bump(
451451
base_bump_percentage,
452452
max_fee_bump_percentage,
453-
priority_fee_gwei,
453+
priority_fee_wei,
454454
tx_req,
455455
)
456456
.await?;
@@ -533,15 +533,15 @@ impl ProofAggregator {
533533
// - Fetch the current network gas price.
534534
// - Apply `base_bump_percentage` to compute a bumped base fee.
535535
// - Apply `max_fee_bump_percentage` on top of the bumped base fee to set `max_fee_per_gas`.
536-
// - Set `max_priority_fee_per_gas` to a fixed value derived from `priority_fee_gwei`.
536+
// - Set `max_priority_fee_per_gas` to a fixed value derived from `priority_fee_wei`.
537537
//
538538
// Fees are recomputed on each retry using the latest gas price (no incremental per-attempt bump).
539539

540540
async fn apply_gas_fee_bump(
541541
&self,
542542
base_bump_percentage: u64,
543543
max_fee_bump_percentage: u64,
544-
priority_fee_gwei: u128,
544+
priority_fee_wei: u128,
545545
tx_req: TransactionRequest,
546546
) -> Result<TransactionRequest, AggregatedProofSubmissionError> {
547547
let provider = self.proof_aggregation_service.provider();
@@ -553,7 +553,7 @@ impl ProofAggregator {
553553

554554
let new_base_fee = current_gas_price * (1 + base_bump_percentage as u128 / 100);
555555
let new_max_fee = new_base_fee * (1 + max_fee_bump_percentage as u128 / 100);
556-
let new_priority_fee = priority_fee_gwei * 1000000000; // Convert to wei
556+
let new_priority_fee = priority_fee_wei;
557557

558558
Ok(tx_req
559559
.with_max_fee_per_gas(new_max_fee)

config-files/config-proof-aggregator-ethereum-package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ max_bump_retries: 5
3232
bump_retry_interval_seconds: 120
3333
base_bump_percentage: 10
3434
max_fee_bump_percentage: 100
35-
priority_fee_gwei: 2
35+
priority_fee_wei: 2000000000
3636

3737
ecdsa:
3838
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ max_bump_retries: 5
3232
bump_retry_interval_seconds: 120
3333
base_bump_percentage: 10
3434
max_fee_bump_percentage: 100
35-
priority_fee_gwei: 2
35+
priority_fee_wei: 2000000000
3636

3737
ecdsa:
3838
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

0 commit comments

Comments
 (0)