-
Notifications
You must be signed in to change notification settings - Fork 47
repair: plumb shred resolver service, and send events from blockstore #428
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
Changes from all commits
354d627
aed9a5e
9b016b5
5c7c2f5
7bc4555
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||||||||||||||||||||||||||||
| //! The shred resolver service listens to events emitted by | ||||||||||||||||||||||||||||||||||||||||
| //! | ||||||||||||||||||||||||||||||||||||||||
| //! Blockstore: | ||||||||||||||||||||||||||||||||||||||||
| //! - FEC set has been ingested or successfully completed | ||||||||||||||||||||||||||||||||||||||||
| //! - A conflicting shred has been ingested | ||||||||||||||||||||||||||||||||||||||||
| //! | ||||||||||||||||||||||||||||||||||||||||
| //! Votor: | ||||||||||||||||||||||||||||||||||||||||
| //! - A block has reached "canonical" status, where canonical | ||||||||||||||||||||||||||||||||||||||||
| //! means that it is the unique block of interest in the slot. | ||||||||||||||||||||||||||||||||||||||||
| //! This is a result of the block or a descendant receiving | ||||||||||||||||||||||||||||||||||||||||
| //! a Notarize, FastFinalizeation, or SlowFinalization certificate | ||||||||||||||||||||||||||||||||||||||||
| //! - An alternate version of a block has been requested in order to | ||||||||||||||||||||||||||||||||||||||||
| //! progress replay or check safe to notar conditions. We must fetch | ||||||||||||||||||||||||||||||||||||||||
| //! these shreds, but it is not yet clear if this is the canonical block. | ||||||||||||||||||||||||||||||||||||||||
| //! | ||||||||||||||||||||||||||||||||||||||||
| //! Using these events it plans how to fetch the correct shreds and resolves | ||||||||||||||||||||||||||||||||||||||||
| //! any incorrect shreds ingested. It interfaces with repair to send out | ||||||||||||||||||||||||||||||||||||||||
| //! the appropriate requests. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| use { | ||||||||||||||||||||||||||||||||||||||||
| super::repair_service::OutstandingShredRepairs, | ||||||||||||||||||||||||||||||||||||||||
| solana_ledger::{blockstore::Blockstore, shred_event::ShredEventReceiver}, | ||||||||||||||||||||||||||||||||||||||||
| std::{ | ||||||||||||||||||||||||||||||||||||||||
| sync::{Arc, RwLock}, | ||||||||||||||||||||||||||||||||||||||||
| thread::{self, JoinHandle}, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| pub struct ShredResolverService { | ||||||||||||||||||||||||||||||||||||||||
| t_listen: JoinHandle<()>, | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| impl ShredResolverService { | ||||||||||||||||||||||||||||||||||||||||
| pub fn new( | ||||||||||||||||||||||||||||||||||||||||
| _blockstore: Arc<Blockstore>, | ||||||||||||||||||||||||||||||||||||||||
| event_receiver: ShredEventReceiver, | ||||||||||||||||||||||||||||||||||||||||
| _outstanding_repairs: Arc<RwLock<OutstandingShredRepairs>>, | ||||||||||||||||||||||||||||||||||||||||
| ) -> Self { | ||||||||||||||||||||||||||||||||||||||||
| let t_listen = thread::spawn(move || loop { | ||||||||||||||||||||||||||||||||||||||||
| let Ok(_events) = event_receiver.recv() else { | ||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to be consistent with the error handling in alpenglow/core/src/block_creation_loop.rs Lines 325 to 343 in b0eb8f0
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah definitely, i'll add proper error handling when i fill in the impl in the next PR |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Self { t_listen } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| pub fn join(self) -> thread::Result<()> { | ||||||||||||||||||||||||||||||||||||||||
| self.t_listen.join() | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
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.
maybe
duplicate_shred_resolver_serviceThere 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.
the idea was that should be a replacement to repair_service.rs so it sends out normal repair as well as duplicate scenarios.
wanted to avoid calling it ag_repair_service 😅
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 can just drag and drop it into repair_service when the time comes then