Skip to content

Commit

Permalink
make priority fees not grow faster than base fee on resend
Browse files Browse the repository at this point in the history
  • Loading branch information
tomg10 authored Dec 13, 2024
1 parent 3cffdb2 commit d869828
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/node/eth_sender/src/eth_fees_oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ impl GasAdjusterFeesOracle {
(previous_sent_tx.priority_fee_per_gas * 6) / 5 + 1,
);

// same for base_fee_per_gas but 10%
// same for base_fee_per_gas, we theoretically only need to increase it by 10%, but
// we increase it by 20% to have priority_fee not growing faster than base fee
base_fee_per_gas = max(
base_fee_per_gas,
previous_sent_tx.base_fee_per_gas + (previous_sent_tx.base_fee_per_gas / 10) + 1,
(previous_sent_tx.base_fee_per_gas * 6) / 5 + 1,
);
}

Expand Down

0 comments on commit d869828

Please sign in to comment.