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: remove locals-tracking from pools (part 2) #30559

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Oct 8, 2024

Replaces #29297, descendant from #27535


This PR removes locals as a concept from transaction pools. Therefore, the pool now acts as very a good simulation/approximation of how our peers' pools behave. What this PR does instead, is implement a locals-tracker, which basically is a little thing which, from time to time, asks the pool "did you forget this transaction?". If it did, the tracker resubmits it.

If the txpool had forgotten it, chances are that the peers had also forgotten it. It will be propagated again.

Doing this change means that we can simplify the pool internals, quite a lot.

The semantics of local

Historically, there has been two features, or usecases, that has been combined into the concept of locals.

  1. "I want my local node to remember this transaction indefinitely, and resubmit to the network occasionally"
  2. "I want this (valid) transaction included to be top-prio for my miner"

This PR splits these features up, let's call it 1: local and 2: prio. The prio is not actually individual transaction, but rather a set of addresses to prioritize.
The attribute local means it will be tracked, and prio means it will be prioritized by miner.

For local: anything transaction received via the RPC is marked as local, and tracked by the tracker.
For prio: any transactions from this sender is included first, when building a block. The existing commandline-flag --txpool.locals sets the set of prio addresses.

…ing of recheck

core/txpool/tracking: add ability to trigger recheck externally
core/txpool: remove local param from api
eth/catalyst: update tests for new API
miner, eth: update tests for changed txpool api
eth/catalyst: remove trace-log-output from tests
core/txpool: fix nits, also store on insert
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.

1 participant