-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Right now, the only interaction that Voter
has with the outside is informing the Environment
when it starts a new round, completes one, finalizes a block, or detects an equivocation.
We should add a new type
#[derive(Clone)]
struct VoterState {
inner: Arc<parking_lot::Mutex<Inner>>,
}
impl VoterState {
// information like proposer, round number, what we've done in the round, etc.
pub fn active_rounds(&self) -> Vec<RoundData>;
}
impl Voter {
pub fn voter_state(&self) -> VoterState;
}
The inner
member of VoterState
should be updated by the voter whenever a round is added or dropped.