penumbra_stake::component::stake

Trait StateWriteExt

Source
pub trait StateWriteExt: StateWrite {
    // Provided methods
    fn put_stake_params(&mut self, params: StakeParameters) { ... }
    fn put_delegation_changes(&mut self, delegation_changes: DelegationChanges) { ... }
    fn push_delegation(&mut self, delegation: Delegate) { ... }
    fn push_undelegation(&mut self, undelegation: Undelegate) { ... }
    fn queue_staking_rewards(
        &mut self,
        staking_reward_queue: Vec<(IdentityKey, FundingStreams, Amount)>,
    ) { ... }
    fn register_consensus_key(
        &mut self,
        identity_key: &IdentityKey,
        consensus_key: &PublicKey,
    ) { ... }
}
Available on crate feature component only.
Expand description

Extension trait providing write access to staking data.

Provided Methods§

Source

fn put_stake_params(&mut self, params: StakeParameters)

Writes the provided stake parameters to the JMT.

Source

fn put_delegation_changes(&mut self, delegation_changes: DelegationChanges)

Delegation changes accumulated over the course of this block, to be persisted at the end of the block for processing at the end of the next epoch.

Source

fn push_delegation(&mut self, delegation: Delegate)

Push an entry in the delegation queue for the current block (object-storage).

Source

fn push_undelegation(&mut self, undelegation: Undelegate)

Push an entry in the undelegation queue for the current block (object-storage).

Source

fn queue_staking_rewards( &mut self, staking_reward_queue: Vec<(IdentityKey, FundingStreams, Amount)>, )

Source

fn register_consensus_key( &mut self, identity_key: &IdentityKey, consensus_key: &PublicKey, )

Register a consensus key in the state, via two verifiable indices:

  1. CometBFT address -> PublicKey
  2. PublicKey -> IdentityKey
§Important note

We do not delete obsolete entries on purpose. This is so that the staking component can do evidence attribution even if a byzantine validator has changed the consensus key that was used at the time of the misbehavior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§