-
Notifications
You must be signed in to change notification settings - Fork 3
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
Eth indexer not require start block env variable #116
Conversation
ppca
commented
Jan 16, 2025
•
edited
Loading
edited
- this will enable the eth indexer to start from block_number = latest_block from rpc call - 15 if the last_processed_block was empty or too far behind.
- Also added 2 metrics: eth sign request count and eth indexed block height
if latest_block - latest_handled_block < MAX_DELAYED_BLOCKS { | ||
latest_handled_block + 1 | ||
} else { | ||
latest_block.saturating_sub(MAX_DELAYED_BLOCKS) + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great optimization!
Due to current rate limit failure rate, there is a small issue. I notice due to frequent rate limit hit, sometimes it can be 5-10 blocks delayed, so there is a small chance of >15 block delayed. If that happens, some block would be skipped.
Therefore, I suggest doing this check only once, when there is no last handled block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll increase the delay to 100 blocks. I also want this fix to help the case where a node goes back online after being offline for a while, in that case we don't want the node to start way back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppca I think we should apply the same logic (use the same function) that is used in the NEAR Indexer. I do not think there is a need to differentiate,