pub trait ValidatorEntry {
// Required methods
fn public_key(&self) -> &PublicKey;
fn puzzle_hash(&self) -> Bytes32;
fn effective_balance(&self) -> u64;
fn is_slashed(&self) -> bool;
fn activation_epoch(&self) -> u64;
fn exit_epoch(&self) -> u64;
fn is_active_at_epoch(&self, epoch: u64) -> bool;
fn slash_absolute(&mut self, amount_mojos: u64, epoch: u64) -> u64;
fn credit_stake(&mut self, amount_mojos: u64) -> u64;
fn restore_status(&mut self) -> bool;
fn schedule_exit(&mut self, exit_lock_until_epoch: u64);
}Expand description
Per-validator state accessor.
Traces to SPEC §15.1, catalogue rows DSL-131..135.
§Invariants (enforced by DSL-131..135 when those impls land)
slash_absolutesaturates at effective-balance floor — cannot drive balance negative.credit_stakereturns the amount actually credited after any ceiling clamp.restore_statusis idempotent — returnstrueonly when status actually changed.is_active_at_epoch(epoch)is inclusive on activation, exclusive on exit (DSL-134 boundary behaviour).
Required Methods§
Sourcefn public_key(&self) -> &PublicKey
fn public_key(&self) -> &PublicKey
Validator’s BLS G1 public key. Used by all signature verifiers.
Sourcefn puzzle_hash(&self) -> Bytes32
fn puzzle_hash(&self) -> Bytes32
Payout puzzle hash for participation rewards / whistleblower rewards (DSL-025, DSL-141).
Sourcefn effective_balance(&self) -> u64
fn effective_balance(&self) -> u64
Current effective balance in mojos. Drives base-penalty math (DSL-022) and reward/penalty deltas (DSL-081..085).
Sourcefn is_slashed(&self) -> bool
fn is_slashed(&self) -> bool
true if this validator has an outstanding slash (pending or
finalised). Gates duplicate slashing (DSL-026).
Sourcefn activation_epoch(&self) -> u64
fn activation_epoch(&self) -> u64
Epoch the validator became active.
Sourcefn exit_epoch(&self) -> u64
fn exit_epoch(&self) -> u64
Epoch the validator scheduled exit at (or u64::MAX if none).
Sourcefn is_active_at_epoch(&self, epoch: u64) -> bool
fn is_active_at_epoch(&self, epoch: u64) -> bool
Activation-inclusive, exit-exclusive membership check at epoch.
Sourcefn slash_absolute(&mut self, amount_mojos: u64, epoch: u64) -> u64
fn slash_absolute(&mut self, amount_mojos: u64, epoch: u64) -> u64
Debit amount_mojos from the effective balance (saturating).
Returns the amount actually debited. DSL-131.
Sourcefn credit_stake(&mut self, amount_mojos: u64) -> u64
fn credit_stake(&mut self, amount_mojos: u64) -> u64
Undo a prior slash_absolute (sustained appeal / reorg).
Returns the amount actually credited. DSL-132.
Sourcefn restore_status(&mut self) -> bool
fn restore_status(&mut self) -> bool
Clear Slashed flag; restore active state. Idempotent. DSL-133.
Returns true iff state actually changed.
Sourcefn schedule_exit(&mut self, exit_lock_until_epoch: u64)
fn schedule_exit(&mut self, exit_lock_until_epoch: u64)
Schedule the post-finalisation exit lock. DSL-135.