Skip to content
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

Merged
merged 35 commits into from
May 28, 2021
Merged

EIP-1559 tx pool support #22898

merged 35 commits into from
May 28, 2021

Conversation

zsfelfoldi
Copy link
Contributor

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

@zsfelfoldi zsfelfoldi changed the title EIP-1559 tx pool support EIP-1559 tx pool support (WIP) May 18, 2021
@zsfelfoldi zsfelfoldi force-pushed the eip1559-mempool branch 2 times, most recently from 5cb5e6c to c604a47 Compare May 20, 2021 01:32
@zsfelfoldi zsfelfoldi changed the title EIP-1559 tx pool support (WIP) EIP-1559 tx pool support May 20, 2021
core/tx_list.go Outdated Show resolved Hide resolved
core/tx_list.go Outdated Show resolved Hide resolved
core/tx_pool.go Outdated Show resolved Hide resolved
core/tx_pool_test.go Outdated Show resolved Hide resolved
@@ -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 {
Copy link
Member

@rjl493456442 rjl493456442 May 21, 2021

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.

Copy link
Contributor Author

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.

core/tx_pool.go Outdated Show resolved Hide resolved
core/tx_pool.go Outdated Show resolved Hide resolved
@holiman
Copy link
Contributor

holiman commented May 21, 2021

Rebased + fixed rebase problems

@holiman
Copy link
Contributor

holiman commented May 21, 2021

GasPriceCmp is now unused, and should be removed. GasPriceIntCmp is used by the GPO, but I guess the GPO should use something else, and we should remove that method too.

@holiman
Copy link
Contributor

holiman commented May 25, 2021

This is now running on bootnode-aws-eu-central-1-001

* 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
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jul 5, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jul 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 1, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 11, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 21, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 22, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 23, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 24, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Aug 26, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 2, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 6, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 9, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 12, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 19, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants