go-ethereum/internal/ethapi
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
..
override internal/ethapi: support for beacon root and withdrawals in simulate api (#31304) 2025-03-24 19:08:53 +01:00
testdata core: implement eip-7623 floor data gas (#30946) 2025-01-30 09:07:45 -07:00
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
api_test.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
backend.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
errors.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
logtracer.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
simulate.go core: fail execution if system call fails to execute (#31639) 2025-04-19 13:42:54 +02:00
simulate_test.go internal/ethapi: update default simulation timestamp increment to 12 (#30981) 2025-01-03 20:15:06 +08:00
transaction_args.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
transaction_args_test.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00