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

feat(snapshot, prune): headers #6230

Merged
merged 20 commits into from
Jan 29, 2024
Merged

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jan 25, 2024

Similar to #6122

Some changes to init_genesis were required to take static files into account when checking the genesis header.

@shekhirin shekhirin added C-enhancement New feature or request A-pruning Related to pruning or full node A-static-files Related to static files labels Jan 25, 2024
@shekhirin shekhirin marked this pull request as ready for review January 25, 2024 20:44
@shekhirin shekhirin marked this pull request as draft January 25, 2024 21:10
@shekhirin shekhirin force-pushed the alexey/snapshotter-headers branch 3 times, most recently from e3d9b37 to a54b538 Compare January 25, 2024 21:51
@shekhirin shekhirin marked this pull request as ready for review January 25, 2024 22:19
Base automatically changed from alexey/snapshotter-transactions to joshie/tx-snap-sync January 26, 2024 12:35
Base automatically changed from joshie/tx-snap-sync to feat/static-files January 26, 2024 12:47
@@ -228,8 +218,6 @@ impl<'a> SnapshotProviderRW<'a> {
) -> ProviderResult<BlockNumber> {
debug_assert!(self.writer.user_header().segment() == SnapshotSegment::Headers);

self.writer.user_header_mut().increment_block();
Copy link
Member

Choose a reason for hiding this comment

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

Are we not supposed to increment the block here as we append a new header?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

increment is done now outside of this method, just as for append_receipt and append_transaction methods:

if header_block > 0 {
let _snapshot_block = snapshot_writer.increment_block(SnapshotSegment::Headers)?;
debug_assert_eq!(_snapshot_block, header_block);
}

@joshieDo has some improvements to append_header method in #6273, will re-use these changes once his PR is merged.

@shekhirin shekhirin merged commit d1c3edb into feat/static-files Jan 29, 2024
24 checks passed
@shekhirin shekhirin deleted the alexey/snapshotter-headers branch January 29, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pruning Related to pruning or full node A-static-files Related to static files C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants