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
Init sync batch block clean up #6599
Conversation
cc @nisdas |
lastBlk := blocks[len(blocks)-1] | ||
lastRoot := blkRoots[len(blkRoots)-1] | ||
|
||
if err := s.stateGen.SaveState(ctx, lastRoot, postState); err != nil { |
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 dont see how this works, we need to save the post state so that we can process the next batch. Otherwise state gen will have to regenerate the state when processing the next batch.
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.
Ah i see. I thought saving it per boundary would be enough. I'll add this 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.
Added it here. 56ca04d
Going to test this now
Resolve conflicts @terencechain |
Codecov Report
@@ Coverage Diff @@
## master #6599 +/- ##
=======================================
Coverage 62.72% 62.72%
=======================================
Files 380 380
Lines 29882 29882
=======================================
Hits 18744 18744
Misses 8587 8587
Partials 2551 2551 |
Various clean ups to init sync batch block processing:
onBlockBatch
onBlockBatch
does not need to returnpostState
handleEpochBoundary
toonBlockBatch
inside at epoch starts.beaconDB.SaveBlocks
ands.clearInitSyncBlocks()
as they are done ins.updateFinalized
s.stateGen.SaveState
anymore!bytes.Equal(lastRoot[:], cachedHeadRoot)
is checked withins.saveHeadNoDB(ctx, lastBlk, lastRoot)