1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/eth
Sina M 615d29f7c2
core: reduce load on txindexer from API (#31752)
Fixes https://github.com/ethereum/go-ethereum/issues/31732.

This logic was removed in the recent refactoring in the txindexer to
handle history cutoff (#31393). It was first introduced in this PR:
https://github.com/ethereum/go-ethereum/pull/28908.

I have tested it and it works as an alternative to #31745.

This PR packs 3 changes to the flow of fetching txs from the API:

- It caches the indexer tail after each run is over to avoid hitting the
db all the time as was done originally in #28908.

- Changes `backend.GetTransaction`. It doesn't return an error anymore
when tx indexer is in progress. It shifts the responsibility to the
caller to check the progress. The reason is that in most cases we anyway
check the txpool for the tx. If it was indeed a pending tx we can avoid
the indexer progress check.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-05-05 10:07:55 +08:00
..
catalyst beacon/engine: omit empty witness in payload response (#31739) 2025-04-29 13:21:18 +02:00
downloader core, eth/downloader: implement pruning mode sync (#31414) 2025-04-03 15:16:35 +02:00
ethconfig core: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00
fetcher eth/fetcher: define BatchSize as a constant (#31742) 2025-04-30 11:02:11 +08:00
filters core/filtermaps: do not derive full receipts during rendering (#31716) 2025-04-30 15:23:08 +08:00
gasestimator core, eth/gasestimator: introduce MaxGasUsed for estimation (#31735) 2025-05-02 17:43:06 +02:00
gasprice eth/gasprice: fix eth_feeHistory blobGasUsedRatio divide zero (#31663) 2025-04-19 22:02:31 +08:00
protocols core/txpool: add 7702 protection to blobpool (#31526) 2025-04-08 07:46:27 -06:00
tracers core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
api_backend_test.go eth: add tx to locals only if it has a chance of acceptance (#31618) 2025-04-17 21:27:48 +02: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: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00
dropper.go eth: add logic to drop peers randomly when saturated (#31476) 2025-04-14 12:45:27 +02:00
handler.go eth: fix transaction sender cache miss before broadcast (#31657) 2025-04-17 10:33:59 +02:00
handler_eth.go eth: check blob transaction validity on the peer goroutine when received (#31219) 2025-03-01 14:10:38 +01: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: add GetMetadata to transaction pool (#31433) 2025-04-02 15:47:56 +08: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