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

stagedsync: polygon sync stage progress updates #10505

Merged
merged 6 commits into from
May 28, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented May 27, 2024

While testing the new polygon sync stage I found several places that needed improvements:

  • for the polygon sync loop the stages.BlockHashes is not necessary since when we call polygonSyncStageService.handleInsertBlocks we perform rawdb.WriteHeader which persists the Block Hash-> Block Number mapping in the HeaderNumber table (which is what the BlockHashes stage does)
  • we weren't updating the stages.Headers, stages.Bodies, stages.BlockHashes progress in polygonSyncStageService.handleUpdateForkChoice and we should since some of the stages after PolygonSyncStage are using these progresses - this is now added in this PR (similar to how it is done in the execution engine)
  • switched to using rawdb.WriteHeadHeaderHash and rawdb.ReadHeadHeaderHash for getting the latest downloaded block instead of previous approach which was to save this info in SyncStageProgress table under PolygonSync_hash key

Copy link
Contributor

@battlmonstr battlmonstr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@battlmonstr battlmonstr merged commit fa34e19 into main May 28, 2024
10 checks passed
@battlmonstr battlmonstr deleted the astrid-sync-stage-fix-stages-progress branch May 28, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants