go-ethereum/eth
Martin HS 7c7b7f6ab1
core/txpool: remove locals-tracking from txpools (#30559)
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 `address`es 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.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-04 17:23:01 +01:00
..
catalyst core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
downloader all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
ethconfig eth/downloader: move SyncMode to package eth/ethconfig (#30847) 2024-12-03 09:30:26 +01:00
fetcher params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
filters eth/filters: ensure API timeoutLoop terminates with event system (#31056) 2025-01-21 13:11:05 +01:00
gasestimator internal/ethapi: add block override to estimateGas (#30695) 2024-12-12 12:39:03 +01:00
gasprice params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
protocols all: nuke total difficulty (#30744) 2025-01-28 18:55:41 +01:00
tracers params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
api_debug.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
api_debug_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
bloombits.go eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
handler.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
handler_eth.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler_eth_test.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
peer.go eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
peerset.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
state_accessor.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync_test.go eth/protocols/eth: prevent hanging dispatch (#30918) 2025-01-06 16:31:53 +01:00