1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use {
crossbeam_channel::{Receiver, Sender},
solana_clock::{BankId, Slot},
solana_signature::Signature,
solana_vote::vote_parser::ParsedVote,
};
/// Message sent by banking and replay to the solCiProcVotes thread to update its state machine.
///
/// Banking sends VerifiedExecuted(vote) as it builds a block, and solCiProcVotes processes those
/// votes immediately.
///
/// Replay runs sigverify and execution in parallel, and sends Verified and Executed respectively as
/// those stages complete. solCiProcVotes waits until it has received both messages for a given vote
/// before processing it.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ReplayVoteMessage {
/// The vote was sigverified and executed
VerifiedExecuted(ParsedVote),
/// The vote was executed, but sigverify might not have finished yet
Executed {
replay_bank_id: BankId,
replay_slot: Slot,
parsed_vote: ParsedVote,
},
/// The vote was sigverified.
Verified {
replay_bank_id: BankId,
replay_slot: Slot,
verified_signatures: Vec<Signature>,
},
/// The bank is invalid no more votes should be processed.
///
/// This is informative and used to release memory early. If not sent (like
/// in some replay error paths), memory will be released as slots are rooted.
InvalidBank {
replay_bank_id: BankId,
replay_slot: Slot,
},
/// The bank is complete.
///
/// Like InvalidBank this is informative and used to release memory early.
BankComplete {
replay_bank_id: BankId,
replay_slot: Slot,
},
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ReplayVoteSendType {
VerifiedExecuted,
Executed {
replay_bank_id: BankId,
replay_slot: Slot,
},
}
pub type ReplayVoteSender = Sender<ReplayVoteMessage>;
pub type ReplayVoteReceiver = Receiver<ReplayVoteMessage>;