-
Notifications
You must be signed in to change notification settings - Fork 1k
FinalityNotification: Directly include stale blocks #9904
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
base: master
Are you sure you want to change the base?
Conversation
The finality notification was already carrying the information about the stale heads. However, most users of the stale heads were expanding these stale heads to all the stale blocks. So, we were iterating the same forks multiple times in the node for each finality notification. Also in a possible future where we start actually pruning headers as well, expanding these forks would fail. So, this pull request is changing the finality notification to directly carry the stale blocks (which were calculated any way already).
/cmd prdoc --audience node_dev --bump major |
…e_dev --bump major'
All GitHub workflows were cancelled due to failure one of the required jobs. |
…ication-stale-blocks' into bkchr-finality-notfication-stale-blocks
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.
nice, LGTM!
finalized: vec![header.hash()], | ||
stale_blocks: stale_blocks | ||
.into_iter() | ||
.map(|h| StaleBlock { hash: h, is_head: false }) |
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.
is_head: false
set for all stale_blocks
here. not familiar with this trigger_finality_stream
function, can it be called with any "head" among stale_blocks
?
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 is test code and the implementation right now doesn't care if this is a head or not.
The finality notification was already carrying the information about the stale heads. However, most users of the stale heads were expanding these stale heads to all the stale blocks. So, we were iterating the same forks multiple times in the node for each finality notification. Also in a possible future where we start actually pruning headers as well, expanding these forks would fail.
So, this pull request is changing the finality notification to directly carry the stale blocks (which were calculated any way already).