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

feat: ForkChoiceSubscriptions for BlockchainProvider && NoopProvidor #10056

Conversation

royvardhan
Copy link
Contributor

Ref 9521

@royvardhan royvardhan requested a review from mattsse August 7, 2024 05:07
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, after looking at this again, I'd like to take one step back and only implement this for BlockChainProvider and Noop.

blockchainprovider then should use these channels to obtain the listeners,

/// The canonical head of the chain.
canonical_head: RwLock<SealedHeader>,
/// The block that the beacon node considers safe.
safe_block: watch::Sender<Option<SealedHeader>>,
/// The block that the beacon node considers finalized.
finalized_block: watch::Sender<Option<SealedHeader>>,

which means we also need to change this type slightly

pub struct ForkChoiceNotifications(broadcast::Receiver<SealedHeader>);

@@ -87,6 +90,17 @@ impl<DB, E> BlockchainTree<DB, E> {
pub fn canon_state_notification_sender(&self) -> CanonStateNotificationSender {
self.canon_state_notification_sender.clone()
}

/// Subscribe to fork choice events.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

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 this pull request may close these issues.

3 participants