Sigil documentation
ReferenceRust referencesigil-tower

sigil-tower · tower_committee

Source declarations, signatures and documentation for tower_committee.

Source: sigil/node/sigil-tower/src/tower_committee.rs. SHA-256: cf7e9e000838232daa293ec0163c170cdbc4cdb9a20ee8ebf853bb15a98fd878.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

tower_committee::COMMITTEE_QUORUM

The required supermajority for committee decisions (7 of 11).

pub const COMMITTEE_QUORUM: usize;

Source line: 14.

tower_committee::COMMITTEE_SIZE

Default committee size.

pub const COMMITTEE_SIZE: usize;

Source line: 17.

tower_committee::DEFAULT_TERM_EPOCHS

Default term length in epochs (~30 days at 1 epoch/day).

pub const DEFAULT_TERM_EPOCHS: u64;

Source line: 20.

tower_committee::TowerCommittee

The 11-member Tower Committee.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TowerCommittee {
/// DIDs of the 11 committee members.

pub members: Vec<String>,
/// Epoch at which this committee's term began.

pub term_start_epoch: u64,
/// Length of the committee's term in epochs.

pub term_length_epochs: u64
}

Source line: 24.

tower_committee::TowerCommittee::is_member

Whether the given DID is a member of this committee.

pub fn is_member(&self, did: &str) -> bool;

Source line: 35.

tower_committee::TowerCommittee::is_term_expired

Whether the committee's term has expired given the current epoch.

pub fn is_term_expired(&self, current_epoch: u64) -> bool;

Source line: 40.

tower_committee::PendingDecision

A pending governance decision awaiting votes.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PendingDecision {
/// What kind of decision this is.

pub decision_type: DecisionType,
/// Votes from committee members (DID -> approve/reject).

pub votes: HashMap<String, bool>
}

Source line: 47.

tower_committee::DecisionType

Types of governance decisions the Tower Committee can make.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DecisionType {
    /// Confirm slashing of a validator (DID of the validator to slash).
    SlashValidator(String),
    /// Change a protocol parameter (parameter name, new value).
    ParameterChange(String, String),
}

Source line: 56.

tower_committee::DecisionResult

Result of a completed decision.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DecisionResult {
    /// The decision was approved.
    Approved(DecisionType),
    /// The decision was rejected.
    Rejected(DecisionType),
}

Source line: 65.

tower_committee::TowerCommitteeState

State tracking all pending decisions and the current committee.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TowerCommitteeState {
/// The current Tower Committee.

pub current_committee: TowerCommittee,
/// Pending decisions awaiting votes.

pub pending_decisions: Vec<PendingDecision>
}

Source line: 74.

tower_committee::TowerCommitteeState::new

Create a new state with the given committee and no pending decisions.

pub fn new(committee: TowerCommittee) -> Self;

Source line: 83.

tower_committee::TowerCommitteeState::propose

Propose a new decision for the committee to vote on. Returns the index of the new decision.

pub fn propose(&mut self, decision_type: DecisionType) -> usize;

Source line: 92.

tower_committee::TowerCommitteeState::vote

Cast a vote on a pending decision.

Returns Some(DecisionResult) if the vote caused the decision to be resolved (approved or rejected), or None if more votes are needed.

pub fn vote(
        &mut self,
        decision_id: usize,
        voter_did: &str,
        approve: bool,
    ) -> Result<Option<DecisionResult>, TowerError>;

Source line: 105.

tower_committee::TowerCommitteeState::is_approved

Check if a specific decision has been approved (has >= 7 approvals).

pub fn is_approved(&self, decision_id: usize) -> bool;

Source line: 162.

tower_committee::TowerCommitteeState::pending_count

Number of pending decisions.

pub fn pending_count(&self) -> usize;

Source line: 170.

On this page