-
Notifications
You must be signed in to change notification settings - Fork 20.9k
core: reduce load on txindexer from API #31752
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The error handling for whether the transaction indexer is running is much improved compared to before. SGTM! |
Tested the PR on my node. It's fast! |
With the latest changes. Still apart from some spikes goroutine under control. So IMO it's good to go. I did notice some blocks taking very long in the logs when the script from #31732 (comment) is running as the node is being hammered with requests. So I can imagine why engine API requests might time out if the OP's node is not as powerful.
|
Fixes ethereum#31732. This logic was removed in the recent refactoring in the txindexer to handle history cutoff (ethereum#31393). It was first introduced in this PR: ethereum#28908. I have tested it and it works as an alternative to ethereum#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 ethereum#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>
Context
Fixes #31732.
This logic was removed in the recent refactoring in the txindexer to handle history cutoff (#31393). It was first introduced in this PR: #28908.
I have tested it and it works as an alternative to #31745.
Content
This PR packs 3 changes to the flow of fetching txes from the API:
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.