-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EIP-1559 tx pool support #22898
EIP-1559 tx pool support #22898
Conversation
5cb5e6c
to
c604a47
Compare
@@ -279,15 +279,23 @@ func (l *txList) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Tran | |||
// If there's an older better transaction, abort | |||
old := l.txs.Get(tx.Nonce()) | |||
if old != nil { | |||
// threshold = oldGP * (100 + priceBump) / 100 | |||
if old.FeeCapCmp(tx) >= 0 || old.TipCmp(tx) >= 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this strategy, we can only replace the transaction with 10% feeCap bump and 10% tip bump. It might hurt the UX to some extent.
For example, if the user already specify a high enough feeCap but a barely enough tip. And he wants to speed up the inclusion, he has to bump the feeCap as well. If the basefee raises up, then the maximum possible payment is increased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed at the 1559 dev channel, right now this replacement condition seems to be the best choice.
Rebased + fixed rebase problems |
|
2b9701f
to
3df30d8
Compare
This is now running on |
* replace GasPriceCmp and GasPriceIntCmp with FeeCapCmp, FeeCapIntCmp, TipCmp, TipIntCmp (and update all usages) * update Cost to use FeeCap instead of GasPrice
* add eip1559 status indicator * add DynamicFeeTx to transaction type check * remove underpriced transactions on minimum miner tip increases * require both a fee cap and tip bump for transaction replacement * use tip as secondary comparison criterion for priceHeap sorting
…transaction validation
…e post-EIP-1559 arm of pool.SetMinMinerFee()
This pull request implements EIP-1559 compatible transaction pool with dual heap eviction ordering.
It is based on #22791
The eviction ordering scheme and the reasoning behind it is described here: https://gist.github.com/zsfelfoldi/9607ad248707a925b701f49787904fd6