-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: introduce StaticFileSegment::BlockMeta
#13226
Conversation
67be940
to
342105c
Compare
69a497a
to
9c241b1
Compare
0aace8c
to
b7b5e83
Compare
CodSpeed Performance ReportMerging #13226 will not alter performanceComparing Summary
|
0e13249
to
900b334
Compare
c2a840a
to
26a65be
Compare
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 think all of this makes sense, this doesn't integrate this yet, so this doesn't take effect, right?
Side-effect: on booting up, it will create an empty block meta static file which won't be used.
can you elaborate on this
@@ -72,6 +72,7 @@ impl Command { | |||
StaticFileSegment::Receipts => { | |||
(table_key::<tables::Receipts>(&key)?, <ReceiptMask<ReceiptTy<N>>>::MASK) | |||
} | |||
StaticFileSegment::BlockMeta => todo!(), |
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.
these should be fine for now I think
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.
done on the follow-up (linked above)
if self.segment.is_block_based() { | ||
if let Some(range) = &mut self.block_range { | ||
if num > range.end - range.start { | ||
self.block_range = None; | ||
} else { | ||
range.end = range.end.saturating_sub(num); | ||
} | ||
}; | ||
} else if let Some(range) = &mut self.tx_range { | ||
if num > range.end - range.start { | ||
self.tx_range = None; | ||
} else { | ||
range.end = range.end.saturating_sub(num); |
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.
these are functially unchanged it appears?
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.
yeah, better to have is_block_based
instead of enumerating all variants imo
@@ -890,8 +902,11 @@ impl<N: NodePrimitives> StaticFileProvider<N> { | |||
); | |||
let mut writer = self.latest_writer(segment)?; | |||
if segment.is_headers() { | |||
// TODO(joshie): is_block_meta |
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.
what's missing here?
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.
done on the followup
Err(ProviderError::UnsupportedProvider) | ||
} | ||
} | ||
|
||
impl<N: FullNodePrimitives<BlockHeader: Value>> OmmersProvider for StaticFileProvider<N> { | ||
fn ommers(&self, _id: BlockHashOrNumber) -> ProviderResult<Option<Vec<Self::Header>>> { | ||
// Required data not present in static_files | ||
fn ommers(&self, id: BlockHashOrNumber) -> ProviderResult<Option<Vec<Self::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.
I see we now have to impl all of these for statics
field1: &F1, | ||
field2: &F2, |
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.
should this perhaps be an iter over additional comlumns?
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.
The number of columns of a static file are statically defined. I think it's okay for now as is and improve on it if necessary
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.
actually, why not
a6347c2
to
2874270
Compare
No longer happening, but: When checking the consistency of a static file segment in a RW env, we fetch a |
7ed1564
to
674a603
Compare
674a603
to
a858853
Compare
a858853
to
2e3afa2
Compare
put on bottom
2e3afa2
to
0a80ff5
Compare
Related to History pre-merge sync#13186 as this data would need to be provided as well.
Adds
StaticFileSegment::BlockMeta
which would contain:BlockBodyIndices
BlockOmmers
BlockWithdrawals
Only introduces the segment, alongside some of the future methods.
Side-effect: on booting up, it will create an empty block meta static file which won't be used.Should have no side effects