-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
e3d9b37
to
a54b538
Compare
99077c4
to
f93a730
Compare
f93a730
to
909be48
Compare
@@ -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(); |
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.
Are we not supposed to increment the block here as we append a new header?
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.
increment is done now outside of this method, just as for append_receipt
and append_transaction
methods:
reth/crates/snapshot/src/segments/headers.rs
Lines 52 to 55 in ee9265b
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.
Similar to #6122
Some changes to
init_genesis
were required to take static files into account when checking the genesis header.