Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ members = [
"vortexor",
"vote",
"votor",
"votor-messages",
"watchtower",
"wen-restart",
"zk-keygen",
Expand Down Expand Up @@ -567,6 +568,7 @@ solana-vote = { path = "vote", version = "=2.3.0" }
solana-vote-interface = "=2.2.2"
solana-vote-program = { path = "programs/vote", version = "=2.3.0", default-features = false }
solana-votor = { path = "votor", version = "=2.3.0" }
solana-votor-messages = { path = "votor-messages", version = "=2.3.0" }
solana-wen-restart = { path = "wen-restart", version = "=2.3.0" }
solana-zk-elgamal-proof-program = { path = "programs/zk-elgamal-proof", version = "=2.3.0" }
solana-zk-keygen = { path = "zk-keygen", version = "=2.3.0" }
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ solana-udp-client = { workspace = true }
solana-version = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }
solana-votor-messages = { workspace = true }
spl-memo = { workspace = true, features = ["no-entrypoint"] }
thiserror = { workspace = true }
tiny-bip39 = { workspace = true }
Expand Down
18 changes: 9 additions & 9 deletions cli/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ use {
solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
solana_system_interface::error::SystemError,
solana_transaction::Transaction,
solana_vote::alpenglow::{
bls_message::BLS_KEYPAIR_DERIVE_SEED, instruction::InitializeAccountInstructionData,
state::VoteState as AlpenglowVoteState,
},
solana_vote_program::{
authorized_voters::AuthorizedVoters,
vote_error::VoteError,
Expand All @@ -53,6 +49,10 @@ use {
VOTE_CREDITS_MAXIMUM_PER_SLOT,
},
},
solana_votor_messages::{
bls_message::BLS_KEYPAIR_DERIVE_SEED, instruction::InitializeAccountInstructionData,
state::VoteState as AlpenglowVoteState,
},
std::rc::Rc,
};

Expand Down Expand Up @@ -849,7 +849,7 @@ pub fn process_create_vote_account(

let required_balance = rpc_client
.get_minimum_balance_for_rent_exemption(if is_alpenglow {
solana_vote::alpenglow::state::VoteState::size()
solana_votor_messages::state::VoteState::size()
} else {
VoteState::size_of()
})?
Expand Down Expand Up @@ -887,11 +887,11 @@ pub fn process_create_vote_account(
from_pubkey,
to_pubkey,
lamports,
solana_vote::alpenglow::state::VoteState::size() as u64,
&solana_vote::alpenglow::id(),
solana_votor_messages::state::VoteState::size() as u64,
&solana_votor_messages::id(),
);

let init_ix = solana_vote::alpenglow::instruction::initialize_account(
let init_ix = solana_votor_messages::instruction::initialize_account(
*to_pubkey,
&initialize_account_ixn_meta,
);
Expand Down Expand Up @@ -1374,7 +1374,7 @@ impl VoteStateWrapper {
}

const SOLANA_VOTE_PROGRAM_ID: Pubkey = solana_vote_program::id();
const ALPENGLOW_VOTE_PROGRAM_ID: Pubkey = solana_vote::alpenglow::id();
const ALPENGLOW_VOTE_PROGRAM_ID: Pubkey = solana_votor_messages::id();

pub(crate) fn get_vote_account(
rpc_client: &RpcClient,
Expand Down
5 changes: 4 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ serde_derive = { workspace = true }
slab = { workspace = true }
solana-accounts-db = { workspace = true }
solana-bloom = { workspace = true }
solana-bls-signatures = { workspace = true, features = ["solana-signer-derive"] }
solana-bls-signatures = { workspace = true, features = [
"solana-signer-derive",
] }
solana-builtins-default-costs = { workspace = true }
solana-client = { workspace = true }
solana-compute-budget = { workspace = true }
Expand Down Expand Up @@ -100,6 +102,7 @@ solana-version = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }
solana-votor = { workspace = true }
solana-votor-messages = { workspace = true }
solana-wen-restart = { workspace = true }
strum = { workspace = true, features = ["derive"] }
strum_macros = { workspace = true }
Expand Down
21 changes: 10 additions & 11 deletions core/src/repair/certificate_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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<()>,
}
Expand Down Expand Up @@ -73,8 +72,8 @@ impl CertificateService {
}

fn receive_new_certificates(
certificate_receiver: &Receiver<(CertificateId, CertificateMessage)>,
) -> Result<Vec<(CertificateId, CertificateMessage)>> {
certificate_receiver: &Receiver<(Certificate, CertificateMessage)>,
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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)?)
Expand All @@ -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:?}")
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ use {
transaction::Transaction,
},
solana_timings::ExecuteTimings,
solana_vote::{alpenglow::bls_message::CertificateMessage, vote_transaction::VoteTransaction},
solana_vote::vote_transaction::VoteTransaction,
solana_votor::{
event::{CompletedBlock, VotorEvent, VotorEventReceiver, VotorEventSender},
root_utils,
vote_history::VoteHistory,
vote_history_storage::VoteHistoryStorage,
voting_utils::{BLSOp, GenerateVoteTxResult},
votor::{LeaderWindowNotifier, Votor, VotorConfig},
CertificateId,
},
solana_votor_messages::bls_message::{Certificate, CertificateMessage},
std::{
collections::{HashMap, HashSet},
num::NonZeroUsize,
Expand Down Expand Up @@ -300,7 +300,7 @@ pub struct ReplaySenders {
pub drop_bank_sender: Sender<Vec<BankWithScheduler>>,
pub block_metadata_notifier: Option<BlockMetadataNotifierArc>,
pub dumped_slots_sender: Sender<Vec<(u64, Hash)>>,
pub certificate_sender: Sender<(CertificateId, CertificateMessage)>,
pub certificate_sender: Sender<(Certificate, CertificateMessage)>,
pub votor_event_sender: VotorEventSender,
pub own_vote_sender: BLSVerifiedMessageSender,
}
Expand Down
20 changes: 10 additions & 10 deletions core/src/sigverifier/bls_sigverifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {
solana_runtime::epoch_stakes_service::EpochStakesService,
solana_sdk::clock::Slot,
solana_streamer::packet::PacketBatch,
solana_vote::alpenglow::bls_message::BLSMessage,
solana_votor_messages::bls_message::BLSMessage,
stats::{BLSSigVerifierStats, StatsUpdater},
std::{collections::HashMap, sync::Arc},
};
Expand Down Expand Up @@ -56,7 +56,7 @@ impl SigVerifier for BLSSigVerifier {
let slot = match &message {
BLSMessage::Vote(vote_message) => vote_message.vote.slot(),
BLSMessage::Certificate(certificate_message) => {
certificate_message.certificate.slot
certificate_message.certificate.slot()
}
};

Expand Down Expand Up @@ -148,9 +148,10 @@ mod tests {
},
},
solana_sdk::{hash::Hash, signer::Signer},
solana_vote::alpenglow::{
bls_message::{BLSMessage, CertificateMessage, VoteMessage},
certificate::{Certificate, CertificateType},
solana_votor_messages::{
bls_message::{
BLSMessage, Certificate, CertificateMessage, CertificateType, VoteMessage,
},
vote::Vote,
},
stats::STATS_INTERVAL_DURATION,
Expand Down Expand Up @@ -228,18 +229,17 @@ mod tests {
bitmap.set(3, true);
bitmap.set(5, true);
let vote_rank: usize = 2;

let certificate = Certificate::new(CertificateType::Finalize, Some(4), None);

let messages = vec![
BLSMessage::Vote(VoteMessage {
vote: Vote::new_finalization_vote(5),
signature: Signature::default(),
rank: vote_rank as u16,
}),
BLSMessage::Certificate(CertificateMessage {
certificate: Certificate {
slot: 4,
certificate_type: CertificateType::Finalize,
block_id: None,
},
certificate,
signature: Signature::default(),
bitmap,
}),
Expand Down
Loading