Feature/known gaps #217
Merged
abdulrabbani00
merged 15 commits from 2022-03-31 18:38:59 +00:00
feature/known-gaps into v1.10.16-statediff-v3
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
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
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#217
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Overview
This PR contains does the following:
known_gapsto the DB -FindAndUpdateGaps.TestKnownGapsUpsertFindAndUpdateGapsthroughout 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 theexpectedDiferrencefrom 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.gethdid not receive blocks 13, 14, 15.gethhave 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.gethdoes allow us to jump from blocks and have these gaps then we might need to consider an implementation.gethsimply errors out and panics when we see we went from block 12 to 16, that's okay too, because whengethrestarts 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+offsetcolumns 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: