Evermint is a fork of open source Evmos, maintains bug fixes, customization and enable developers to fork and transform to their chain, fully customized naming, in just 2 steps. For research and development purpose.
GNU Lesser General Public License v3.0
3
stars
3
forks
source link
Feature Request: make EVMTxIndexer a mandatory service of Json-RPC #95
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, LastIndexedBlock returns 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.2 by 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.1 by assign a ready flag to the indexer.
Initialized with false
Switch to true when indexed to latest height
(commit) Improve eth_blockNumber by 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.
EVMTxIndexer as a mandatory service of Json-RPC (:8545) will be an advantage.
Disadvantage:
LastIndexedBlock
returns positive number but that block is already pruned and the indexer can not back to work.Steps:
disadvantage no.2
by 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.disadvantage no.1
by assign aready
flag to the indexer.false
true
when indexed to latest heighteth_blockNumber
by using last request indexed block number from indexer instead of using gRPC call then check header.