sigil-tower · registry
Source declarations, signatures and documentation for registry.
Source: sigil/node/sigil-tower/src/registry.rs. SHA-256: 7a32975ff883a4e3f931a9889f3a68f6f0fe6f96868eb19f19a250adb47be2a3.
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.
registry::ValidatorRegistry
The Tower validator registry, supporting unbounded validator sets with efficient lookups by status, region, and human root lineage.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ValidatorRegistry {
}Source line: 17.
registry::ValidatorRegistry::new
Create a new empty registry.
pub fn new() -> Self;Source line: 30.
registry::ValidatorRegistry::register
Register a new validator. Returns an error if the DID is already registered.
pub fn register(&mut self, record: ValidatorRecord) -> Result<(), TowerError>;Source line: 40.
registry::ValidatorRegistry::update
Apply a ValidatorUpdate to an existing validator.
pub fn update(&mut self, did: &str, update: ValidatorUpdate) -> Result<(), TowerError>;Source line: 73.
registry::ValidatorRegistry::exit
Exit a validator from the active set, transitioning to Exited status.
pub fn exit(&mut self, did: &str) -> Result<(), TowerError>;Source line: 120.
registry::ValidatorRegistry::get
Look up a validator by DID.
pub fn get(&self, did: &str) -> Option<&ValidatorRecord>;Source line: 159.
registry::ValidatorRegistry::active_validators
Returns all validators with Active status.
pub fn active_validators(&self) -> Vec<&ValidatorRecord>;Source line: 164.
registry::ValidatorRegistry::validators_in_region
Returns all validators in the given geographic region.
pub fn validators_in_region(&self, region: GeographicRegion) -> Vec<&ValidatorRecord>;Source line: 176.
registry::ValidatorRegistry::validators_by_human_root
Returns all validators that share the given human root DID.
pub fn validators_by_human_root(&self, human_root_did: &str) -> Vec<&ValidatorRecord>;Source line: 188.
registry::ValidatorRegistry::total_active_stake
Total staked amount across all active validators.
SECURITY: Uses saturating_add to prevent overflow when summing stakes across many validators. Without this, a large number of high-stake validators could cause the sum to wrap to a small value, which would corrupt the finality threshold calculation and potentially allow justification with insufficient stake.
pub fn total_active_stake(&self) -> u64;Source line: 206.
registry::ValidatorRegistry::active_count
Number of active validators.
pub fn active_count(&self) -> usize;Source line: 213.
registry::ValidatorRegistry::total_count
Total number of validators in the registry (all statuses).
pub fn total_count(&self) -> usize;Source line: 220.