-
Notifications
You must be signed in to change notification settings - Fork 989
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
[PIBD] Chain Segmenter Validation Test + Block Archive Horizon Change #3665
[PIBD] Chain Segmenter Validation Test + Block Archive Horizon Change #3665
Conversation
…s, validating each segment as it goes
…ncompacted sample data. Also contains method of running test againt live chain data
Top comment updated, ready for review. This mostly adds segmenter tests against live data which should also serve as a reference for how peers would call and validate data from other peers. HOWEVER there is a change to archive thresholds that needs review + thought. Next up would be functionality + further tests that recreate hash set data from read segments. |
// TODO: This can probably be derived from the PMMR we'll eventually be building | ||
// (check if total size is equal to total size at horizon header) | ||
let identifier_iter = | ||
SegmentIdentifier::traversal_iter(bitmap_pmmr_size, target_segment_height); |
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.
Since you just computed count_segments_required, you might as well check that it equals the identifier_iter size (similarly for the other MMRs) ?!
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.
Yes, I was doing that at one point but removed it (led to redundant code since count()
on an iterator consumes it, I'm sure there are other ways but didn't go further). Will add something similar into future tests.
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.
All looks reasonable. See my few in-line comments for minor issues.
Merged, thanks for review! |
Review Version:
croaring::Bitmap
from the read bitmap segments for use in output/rangeproof segment validation.chain::remove_historical_blocks
is greater than the horizon expected by the segmentercroaring::Bitmap
for segment validation.SegmentIdentifier
to determine the number of segments that would need to be requested given the target pmmr size and the desired segment height.---- Old Version of this ----
Snapshot of current explorations into PIBD, note this PR in its current state is more an attempt at understanding and starting to put together tests to exercise the the PIBD segmenter and segment validation. The current goal is to get an entire compressed/pruned hashset 'copied' locally via PIBD functions, and once this is in place (with sufficient unit tests exercising all of the PIBD PMMR work done to date,) we can start thinking about the actual sync process.
Thus far:
chain
crate, a small but 'real' transaction hash set with real transaction data generated via a wallet test (will commit that test separately to grin_wallet). (Yes, I'm adding static binary data to the repository for the purposes of testing PIBD/PMMR segmentation. Never ideal but much better than the nothing we currently have).Next up:
Don't forget: