Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: update equality checks for replacement transactions to prevent erroneous underpriced errors #1650

Merged
merged 9 commits into from
Nov 24, 2021

Conversation

MicaiahReid
Copy link
Contributor

Fixes bug where replacement transactions with effectiveGasPrice = previousTxGasPrice + (previousTxGasPrice * priceBumpPercent are not viable replacements (essentially a < to a <=). This edge case is actually pretty common because metamasks "Cancel transaction" functionality sets to this exact value.

Updates logic to verify replacement transactions so that maxFeePerGas and maxPriorityFeePerGas are both always checked against the previous transaction if the transactions have those fields. If not, those fields are defaulted to gasPrice. This is in line with geth's implementation.

Adds --miner.priceBump option to make the priceBump requirement configurable.

use maxPriorityFeePerGas, maxFeePerGas, and gasPrice to check if a
transaction is an eligible replacement.

fix bug to include replacement transaction EQUAL to price bump
MicaiahReid and others added 5 commits November 24, 2021 11:09
Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com>
@davidmurdoch davidmurdoch changed the title Fix/replacement transactions fix: update equality checks for replacement transactions to prevent erroneous underpriced errors Nov 24, 2021
@MicaiahReid MicaiahReid merged commit b892c25 into develop Nov 24, 2021
@MicaiahReid MicaiahReid deleted the fix/replacement-transactions branch November 24, 2021 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants