-
Notifications
You must be signed in to change notification settings - Fork 5.5k
replay: only vote on blocks with full last fec set #34294
Conversation
388d7bb to
9ddee53
Compare
core/src/replay_stage.rs
Outdated
| Some((bank.parent_slot(), bank.parent_hash())), | ||
| ); | ||
| // If the block does not have at least 64 shreds in the last FEC set, mark | ||
| // it as duplicate, effectively removing it from fork choice. |
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.
| // it as duplicate, effectively removing it from fork choice. | |
| // it as invalid, effectively removing it from fork choice. |
right? could be for reasons other than fuckery
core/src/replay_stage.rs
Outdated
| ); | ||
| // If the block does not have at least 64 shreds in the last FEC set, mark | ||
| // it as duplicate, effectively removing it from fork choice. | ||
| let mut incomplete_last_fec_set = true; |
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.
nit: you are checking for a specific size, so it's not incomplete_last_fec_set, it's last_fec_set_too_small or something along that line?
core/src/replay_stage.rs
Outdated
| bank.slot(), | ||
| u32::try_from(last_shred_index).expect("LAST_SHRED_IN_SLOT should be u32"), | ||
| )) { | ||
| if erasure_meta.total_shreds() >= 64 { |
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.
We should probably get this constant from somewhere else depending on how the other PR is implemented.
| heaviest_subtree_fork_choice | ||
| .mark_fork_invalid_candidate(&(bank.slot(), bank.hash())); | ||
| } | ||
|
|
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.
Add a test somewhere?
9ddee53 to
d94bed5
Compare
|
should be merged after #34330 |
core/src/replay_stage.rs
Outdated
| // If the block does not have at least 64 shreds in the last FEC set, mark | ||
| // it as invalid, effectively removing it from fork choice. |
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.
This definitely needs a feature-gate.
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.
why? there is no bank hash change
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 if 40% of the cluster mark it invalid and the other 60% vote on it?
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.
fair point 😅 - that specific scenario will work but 50/50 will kill us
will add a feature gate
core/src/replay_stage.rs
Outdated
| if let Some(last_shred_index) = slot_meta.last_index { | ||
| if let Ok(Some(erasure_meta)) = blockstore.erasure_meta(ErasureSetId::new( | ||
| bank.slot(), | ||
| u32::try_from(last_shred_index).expect("LAST_SHRED_IN_SLOT should be u32"), |
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.
This does not look right. Are you using this as the fec_set_index?
d94bed5 to
859b748
Compare
859b748 to
4bbb8aa
Compare
Problem
wider retransmitter set for last erasure batch
Summary of Changes
mark slot as invalid in fork choice if size < 64 shreds
Fixes #