Document current vote program semantics
And add a new 'staker_id' VoteState member variable to offer a path to work our way out. Update leader scheduler to use staker_id, but continue setting it to 'from_id' for the moment. No functional changes here.
This commit is contained in:
@ -50,6 +50,7 @@ pub enum VoteInstruction {
|
||||
pub struct VoteState {
|
||||
pub votes: VecDeque<Vote>,
|
||||
pub node_id: Pubkey,
|
||||
pub staker_id: Pubkey,
|
||||
}
|
||||
|
||||
pub fn get_max_size() -> usize {
|
||||
@ -61,9 +62,13 @@ pub fn get_max_size() -> usize {
|
||||
}
|
||||
|
||||
impl VoteState {
|
||||
pub fn new(node_id: Pubkey) -> Self {
|
||||
pub fn new(node_id: Pubkey, staker_id: Pubkey) -> Self {
|
||||
let votes = VecDeque::new();
|
||||
Self { votes, node_id }
|
||||
Self {
|
||||
votes,
|
||||
node_id,
|
||||
staker_id,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn deserialize(input: &[u8]) -> Result<Self, ProgramError> {
|
||||
|
Reference in New Issue
Block a user