Skip to content

Commit 78af2bf

Browse files
authored
feat(eth-sender): make base fee grow at least as fast as priority fee (#3386)
We have a limit on priority fee, if an eth-sender transaction hits it, we panic. Currently eth-sender transactions may in some very rare situations hit this limits as base_fees may grow slower than priority_fees (it happened today), this change forces base_fee to grow at least as fast as priority fee.
1 parent ea18999 commit 78af2bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/node/eth_sender/src/eth_fees_oracle.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ impl GasAdjusterFeesOracle {
109109
(previous_sent_tx.priority_fee_per_gas * 6) / 5 + 1,
110110
);
111111

112-
// same for base_fee_per_gas but 10%
112+
// same for base_fee_per_gas, we theoretically only need to increase it by 10%, but
113+
// we increase it by 20% to have priority_fee not growing faster than base fee
113114
base_fee_per_gas = max(
114115
base_fee_per_gas,
115-
previous_sent_tx.base_fee_per_gas + (previous_sent_tx.base_fee_per_gas / 10) + 1,
116+
(previous_sent_tx.base_fee_per_gas * 6) / 5 + 1,
116117
);
117118
}
118119

0 commit comments

Comments
 (0)