forked from evmos/evmos
-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
enhancementEnhancement / bug-fixes or re-work on old featureEnhancement / bug-fixes or re-work on old featureoptimizeOptimize business or code performanceOptimize business or code performance
Description
EVMTxIndexer as a mandatory service of Json-RPC (:8545) will be an advantage.
- If the node serves Json-RPC, it needed performance and the indexer does help alot.
- If the node does not serve Json-RPC, the indexer is turned off, no extra disk wasted for the indexer. Then when the Json-RPC is turned back to on, the indexer will keep indexing from the last indexed block.
Disadvantage:
- (Bug) If indexed data not available somehow (like turned off Json-RPC for sometime, then turned on, there is a gap between last indexed block to the latest one. So if a query to the JsonRPC service, the tx might not be found during indexing progress.
- Currently, indexer if not able to fetch a block result, it will retry infinity so on a prune-node, there is an edge case that indexer is turned of at the past, the data on db is exists,
LastIndexedBlockreturns positive number but that block is already pruned and the indexer can not back to work.
Steps:
- (commit) Remove option to enable, re-use Json-RPC enable flag.
- Enable from latest indexed block until latest (the same as current behavior, no action needed)
- (commit) Refactor all related Json-RPC endpoints, direct query indexer, remove all the other code logic.
- (commit) Fix the
disadvantage no.2by force assign last indexed block to the node's earliest block returned by Tendermint status and accept that we will give-up about the missing information. - (commit) Fix the
disadvantage no.1by assign areadyflag to the indexer.- Initialized with
false - Switch to
truewhen indexed to latest height
- Initialized with
- (commit) Improve
eth_blockNumberby using last request indexed block number from indexer instead of using gRPC call then check header. - (commit) Json-RPC will wait indexer to be finished before starting service.
- (commit) Apply a threshold to skip retries index block upon start-up to prevent stuck at specific block that also prevent Json-RPC startup.
Metadata
Metadata
Assignees
Labels
enhancementEnhancement / bug-fixes or re-work on old featureEnhancement / bug-fixes or re-work on old featureoptimizeOptimize business or code performanceOptimize business or code performance