Skip to main content

EffectiveBalanceView

Trait EffectiveBalanceView 

Source
pub trait EffectiveBalanceView {
    // Required methods
    fn get(&self, index: u32) -> u64;
    fn total_active(&self) -> u64;
}
Expand description

Per-validator effective-balance read surface.

Traces to SPEC §15.2, catalogue row DSL-137.

§Consumers

  • SlashingManager::submit_evidence (DSL-022) reads get(idx) per slashable validator to compute base_slash = max(eff_bal * bps / 10_000, eff_bal / 32).
  • Reward math (DSL-081..085) reads get + total_active to derive per-epoch base rewards.

Separate from ValidatorView because some impls (light clients) maintain effective balances in a dedicated index without the full per-validator entry state.

Required Methods§

Source

fn get(&self, index: u32) -> u64

Effective balance of the validator at index, in mojos. Returns 0 when the index is unknown — consistent with the DSL-022 edge case eff_bal = 0 → base_slash = 0.

Source

fn total_active(&self) -> u64

Sum of effective balances of all active validators, in mojos. Used by reward-per-validator derivations.

Implementors§