broadcast: use block id from snapshot as the CMR for initial blocks#12354
broadcast: use block id from snapshot as the CMR for initial blocks#12354AshwinSekar wants to merge 1 commit intoanza-xyz:masterfrom
Conversation
|
|
||
| let parent_block_id = bank | ||
| .parent_block_id() | ||
| .expect("All banks (including snapshot banks) must have a block id"); |
There was a problem hiding this comment.
I've checked this before, but good to double check that there's no race that can cause this to fail:
If parent_block_id is our leader bank, we've set the block_id here
Leader slots are done sequentially so there's no way that this expect can fail.
If this is a non-leader bank, it must be frozen ( we don't build on non-frozen banks ). Block id is set when frozen here
agave/core/src/replay_stage.rs
Lines 3579 to 3582 in b6abf60
Finally if this was a snapshot bank, SIMD-0333 guarantees that it was set
agave/runtime/src/snapshot_utils.rs
Line 573 in b6abf60
Line 2018 in b6abf60
There was a problem hiding this comment.
when did we start serializing this into the snapshot? Want to make sure there isn't some set of honest validators we could overlap with (e.g. FD or older version) that are producing snapshots without this
Edit: Looks like we just started serializing into snapshot last month.. does that mean 4.1 would be incompatible with 4.0 in some cases?
There was a problem hiding this comment.
There was a problem hiding this comment.
my concern was around some 4.0 produced snapshot not being able to be processed by 4.1 code + this change.
But if I'm understanding, it sounds like we will just populate Default hash in that case and not fail the expect
There was a problem hiding this comment.
yeah sorry, I realized that master is not on 4.2 so you're correct this is problematic if we merge in 4.1.
The snapshot still allows for None in v4.1 for v4.0 compatibility
Line 493 in b6abf60
We can wait to merge this change until after the branch cut
|
I believe |
bw-solana
left a comment
There was a problem hiding this comment.
The test changes look a little gross, but whatever. Seems like we could just write the block ID directly - doesn't seem any worse than directly writing the tick height to max before recursing parents
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12354 +/- ##
=======================================
Coverage 83.2% 83.2%
=======================================
Files 849 849
Lines 322523 322547 +24
=======================================
+ Hits 268495 268519 +24
Misses 54028 54028 🚀 New features to boost your workflow:
|
Problem
When we produce the first block after a snapshot, we might not have the shreds of the parent available to set as the chained merkle root.
Now that SIMD-0333 (#11355) is active on master, all banks will have a block id.
Summary of Changes
Use the parent bank's block id instead.