Feature/known gaps #217
No reviewers
Labels
No Label
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#217
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/known-gaps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
This PR contains does the following:
known_gaps
to the DB -FindAndUpdateGaps
.TestKnownGapsUpsert
FindAndUpdateGaps
throughout the codebase to check for gaps.Future Cases
processingKey
- A field that can be used to differentiate the block calculation logic between geth nodes. We should be able to calculate theexpectedDiferrence
from theprocessingKey
(perhaps through a mapping).expectedDifference
- Indicates what the difference between blocks should be.Looking good! Added some comments, the main issue I see is with respect to the race conditions we will run into when we have multiple writeLoop workers (how we run it in prod) which you've already noted. But I also very strongly think we should decouple these gap r/w methods from the Indexer interface.
Thank you for the thorough review, a few notes:
lastProcessedBlock
. There is no simple fix in my mind just yet.geth
did not receive blocks 13, 14, 15.geth
have any build-in mechanism that would realize we jumped from block 12 to 16, and request block 13-15? Because if it does, then we do not need to handle this use case.geth
does allow us to jump from blocks and have these gaps then we might need to consider an implementation.geth
simply errors out and panics when we see we went from block 12 to 16, that's okay too, because whengeth
restarts it will see the last processed block was block 12, and we are currently on block 16+n, it will capture 13-16+n in the known gaps table.LGTM just some nitpicky comments, and if we decide to use
mod_block_number
+offset
columns in the DB we'll need to update that here.There is also some linting issue which I think is left over from my previous work, if you can fix that so that the linting CI test passes that'd be great.
:shipit: