-
Notifications
You must be signed in to change notification settings - Fork 43
Fix evm indexer sync logic #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix evm indexer sync logic #12
Conversation
|
Could you plz check this PR for your node? @achilleas-kal @jennamp |
|
Hey @jeongseup, in the loop of the code snippet you mentioning there is already a |
|
@kakysha Thank you for your feedback. But in our But, at that time, EVM indexer service in our node was not working. Could you please test about that with https://polkachu.com/testnets/injective/snapshots this snapshot? |
|
If it's really working well, this PR isn't needed to fix it. Sorry to bother your team. |
|
I tried restoring from the Polkachu testnet snapshot and I don't see any errors in the log, neither my blockResults on that lines that you changed are never nil @jeongseup. Need more info to reproduce the problem. |
|
@kakysha this is a good suggestion, because It only continues if error explicitly contains a pattern (+ that pattern is from cometbft 0.37.4). The error might be different (yet ephemeral), that will result in My idea of a fix is to treat every error as ephemeral, have single retry, finally always continue. |
|
++ oke you're right, it breaks only the internal loop |
|
Umm.. but anyway working well with the allowGap flag( I didn't know what was the exact problem. However, our backend team have a problem to query about As you already said and pointed out, optimistically it should be skipped(by continue in the code). But our side might be not. I thought the point was the evm indexing stuck was caused by
That's why I suggested this PR. Anyway, now the node is up and running and then Thank you for reviewing this PR. If it was something like bother, I'm sorry to you guys. @kakysha @maxim-inj |

PR(Pull Request) Overview
I'm Jeongseup from Cosmostation. And I found a bug to sync blocks at evm indexer service side in the core.
In core at EVM indexer service side, there is breaking point not sync new blocks. that occur a new node cannot sync and index new evm txs.
As you know, the evm indexer service is subscribing to sync a new block.
the full logic is located at (https://github.com/InjectiveFoundation/injective-core/blob/v1.16.0-beta.4/injective-chain/server/indexer_service.go#L48)
But, in this issue, I just took snippet for understanding easily. Source codes at bottom we can see the bug points I already point out with this mark⚠️ . By that points make our node's evm indexer service stuck at that height.
The thing is when the node used external public snapshot, and the snapshot got nil block or block_result at start sync height, eventually evm indexer service in the node cannot sync new blocks
And then, I just fixed with
continue. However, this progress is not correct way absolutly. Some of node operators like us or other service provider, they really want to index all blocks without expected case. For that, we need to fix this more.Changes
Related Issue
Please reference the Issue number this PR addresses: #11