go-ethereum/graphql
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
..
internal/graphiql all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
graphiql.go graphql: upgrade UI to v2 (#27294) 2023-05-22 08:15:05 -04:00
graphql.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
graphql_test.go consensus/beacon: remove TestingTTDBlock (#31153) 2025-02-11 13:44:25 +01:00
schema.go internal/ethapi: remove td field from block (#30386) 2024-10-01 11:36:56 +02:00
service.go graphql: always set content-type to application/json (#28417) 2023-10-27 16:50:59 +02:00