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

core/txpool, eth, miner: pre-filter dynamic fees during pending tx retrieval #29005

Merged
merged 3 commits into from
Feb 17, 2024

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Feb 16, 2024

This issue was found by @MariusVanDerWijden!

This PR fixes a number of performance bugs in the transaction pool pending retrieval:

  • In the blob pool, we have done no pre-filtering whatsoever when the miner requested the transactions, rather just shipped everything over. The idea was that all the necessary information is already there for the miner to pick what it needs and throw everything else away. Unfortunately we haven't forwarded the blobFee, so the miner couldn't check if the blob transaction can actually be included without loading the entire thing from disk. This made the miner extremely suboptimal and also caused the memory blowup (fixed on master, but the root cause was unknown). This PR solves it by adding a pre-filtering step into the blob pool. Whilst we could have fixed it too by forwarding the blobFee to the miner in txpool.LazyTransaction, there's no point really to send over all the transactions, most of which will be non-executable anyway.
  • In the legacy txpool, the tracked basefee could have been ever so slightly outdated if a reset operation is lagging behind the chain head's last reset. By passing in the basefee from the miner, this issue is also solved.
  • Again, in the legacy txpool, we've recently introduced the change where the txpool.gasprice and miner.gasprice can move independently from one another. Because of that, the enforceTips flag because useless, as it had no access to the miner's tip any more. This PR also fixes that with the passed parameter.

Benchmarks:

Screenshot 2024-02-16 at 22 58 51 Screenshot 2024-02-16 at 22 59 05 Screenshot 2024-02-16 at 22 58 45

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karalabe karalabe merged commit 593e303 into ethereum:master Feb 17, 2024
3 checks passed
jorgemmsilva pushed a commit to iotaledger/go-ethereum that referenced this pull request Jun 17, 2024
…trieval (ethereum#29005)

* core/txpool, eth, miner: pre-filter dynamic fees during pending tx retrieval

* miner: fix typo

* core/txpool: handle init-error in blobpool without panicing

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants