Skip to content
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

Merged
merged 39 commits into from Jul 20, 2020
Merged

Init sync batch block clean up #6599

merged 39 commits into from Jul 20, 2020

Conversation

terencechain
Copy link
Member

@terencechain terencechain commented Jul 14, 2020

Various clean ups to init sync batch block processing:

  • Fixed the span name onBlockBatch
  • onBlockBatch does not need to return postState
  • moved handleEpochBoundary to onBlockBatch inside at epoch start
  • removed s.beaconDB.SaveBlocks and s.clearInitSyncBlocks() as they are done in s.updateFinalized
  • we don't need to s.stateGen.SaveState anymore
  • !bytes.Equal(lastRoot[:], cachedHeadRoot) is checked within s.saveHeadNoDB(ctx, lastBlk, lastRoot)

@terencechain terencechain self-assigned this Jul 14, 2020
@terencechain terencechain added Ready For Review A pull request ready for code review Cleanup Code health! labels Jul 14, 2020
@terencechain terencechain marked this pull request as ready for review July 14, 2020 22:31
@terencechain terencechain requested a review from a team as a code owner July 14, 2020 22:31
@terencechain
Copy link
Member Author

cc @nisdas

lastBlk := blocks[len(blocks)-1]
lastRoot := blkRoots[len(blkRoots)-1]

if err := s.stateGen.SaveState(ctx, lastRoot, postState); err != nil {
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

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

@nisdas
Copy link
Member

nisdas commented Jul 16, 2020

Resolve conflicts @terencechain

@codecov
Copy link

codecov bot commented Jul 17, 2020

Codecov Report

Merging #6599 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6599   +/-   ##
=======================================
  Coverage   62.72%   62.72%           
=======================================
  Files         380      380           
  Lines       29882    29882           
=======================================
  Hits        18744    18744           
  Misses       8587     8587           
  Partials     2551     2551           

@terencechain terencechain merged commit 0488c98 into master Jul 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the revamp-batch branch July 20, 2020 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Code health! Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants