Skip to content

Expose information about the Voter to outside #55

@rphmeier

Description

@rphmeier

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions