Skip to content
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

Broadcast AdvertiseBlock to peers when we commit a new block #2712

Closed
Tracked by #2309
teor2345 opened this issue Aug 31, 2021 · 1 comment · Fixed by #2729
Closed
Tracked by #2309

Broadcast AdvertiseBlock to peers when we commit a new block #2712

teor2345 opened this issue Aug 31, 2021 · 1 comment · Fixed by #2729
Assignees

Comments

@teor2345
Copy link
Contributor

teor2345 commented Aug 31, 2021

Motivation

Zebra needs to gossip the hashes of newly committed blocks, once it has reached the chain tip.

Design

Tasks can wait until they are near the tip using SyncStatus::wait_until_close_to_tip:

/// Wait until the synchronization is likely close to the tip.
///
/// Returns an error if communication with the synchronizer is lost.
pub async fn wait_until_close_to_tip(&mut self) -> Result<(), watch::error::RecvError> {

Tasks can await tip changes using ChainTipChange::tip_change and TipAction:

pub async fn tip_change(&mut self) -> Result<TipAction, watch::error::RecvError> {

Both Grow and Reset variants should result in block gossips.

@mpguerra
Copy link
Contributor

mpguerra commented Sep 1, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants