-
Notifications
You must be signed in to change notification settings - Fork 33
refactor: introducing votor-messages crate #328
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 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,8 +7,7 @@ use { | |
| crate::result::{Error, Result}, | ||
| crossbeam_channel::{Receiver, RecvTimeoutError}, | ||
| solana_ledger::blockstore::Blockstore, | ||
| solana_vote::alpenglow::bls_message::CertificateMessage, | ||
| solana_votor::CertificateId, | ||
| solana_votor_messages::bls_message::{Certificate, CertificateMessage}, | ||
| std::{ | ||
| sync::{ | ||
| atomic::{AtomicBool, Ordering}, | ||
|
|
@@ -19,7 +18,7 @@ use { | |
| }, | ||
| }; | ||
|
|
||
| pub(crate) type CertificateReceiver = Receiver<(CertificateId, CertificateMessage)>; | ||
| pub(crate) type CertificateReceiver = Receiver<(Certificate, CertificateMessage)>; | ||
| pub struct CertificateService { | ||
| t_cert_insert: JoinHandle<()>, | ||
| } | ||
|
|
@@ -73,8 +72,8 @@ impl CertificateService { | |
| } | ||
|
|
||
| fn receive_new_certificates( | ||
| certificate_receiver: &Receiver<(CertificateId, CertificateMessage)>, | ||
| ) -> Result<Vec<(CertificateId, CertificateMessage)>> { | ||
| certificate_receiver: &Receiver<(Certificate, CertificateMessage)>, | ||
|
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. Originally we did this because Certificate contains something CertificateId doesn't have. Now you use Certificate, CertificateMessage should have Certificate.
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. That said, it's probably easier to just do #299 |
||
| ) -> Result<Vec<(Certificate, CertificateMessage)>> { | ||
| const RECV_TIMEOUT: Duration = Duration::from_millis(200); | ||
| Ok( | ||
| std::iter::once(certificate_receiver.recv_timeout(RECV_TIMEOUT)?) | ||
|
|
@@ -85,18 +84,18 @@ impl CertificateService { | |
|
|
||
| fn insert_certificate( | ||
| blockstore: &Blockstore, | ||
| cert_id: CertificateId, | ||
| cert_id: Certificate, | ||
| vote_certificate: CertificateMessage, | ||
| ) -> Result<()> { | ||
| match cert_id { | ||
| CertificateId::NotarizeFallback(slot, block_id) => blockstore | ||
| Certificate::NotarizeFallback(slot, block_id) => blockstore | ||
| .insert_new_notarization_fallback_certificate(slot, block_id, vote_certificate)?, | ||
| CertificateId::Skip(slot) => { | ||
| Certificate::Skip(slot) => { | ||
| blockstore.insert_new_skip_certificate(slot, vote_certificate)? | ||
| } | ||
| CertificateId::Finalize(_) | ||
| | CertificateId::FinalizeFast(_, _) | ||
| | CertificateId::Notarize(_, _) => { | ||
| Certificate::Finalize(_) | ||
| | Certificate::FinalizeFast(_, _) | ||
| | Certificate::Notarize(_, _) => { | ||
| panic!("Programmer error, certificate pool should not notify for {cert_id:?}") | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.