sigil-economics · rewards
Source declarations, signatures and documentation for rewards.
Source: sigil/node/sigil-economics/src/rewards.rs. SHA-256: 10143805d37352cd5bec5c00c384d26d794a994dc2e35ca96b1cf9ac528a22e1.
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.
rewards::RewardConfig
Configuration governing block reward computation.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RewardConfig {
/// Base block reward in micro-MINT (before generation decay).
pub base_block_reward: u64,
/// Generation decay factor (0 < beta <= 1). Typically 0.85.
pub generation_decay_beta: f64,
/// Minimum fraction of the validator portion that goes to the human root.
/// Typically 0.51 (51%).
pub min_human_share: f64,
/// Fraction of the base block reward taken by the treasury.
/// Typically 0.15 (15%).
pub treasury_fraction: f64
}Source line: 17.
rewards::RewardDistribution
The fully computed reward distribution for a single block.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RewardDistribution {
/// Block height this distribution applies to.
pub block_height: u64,
/// OAS DID of the block proposer.
pub proposer_did: String,
/// micro-MINT awarded to the proposer (validator operator).
pub proposer_reward: u64,
/// micro-MINT awarded to the human root.
pub human_root_reward: u64,
/// micro-MINT sent to the protocol treasury.
pub treasury_reward: u64,
/// Per-delegator rewards.
pub delegator_rewards: Vec<DelegatorReward>
}Source line: 43.
rewards::DelegatorReward
Reward for a single delegator.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DelegatorReward {
/// OAS DID of the delegator.
pub delegator_did: String,
/// micro-MINT awarded to this delegator.
pub amount: u64
}Source line: 60.
rewards::compute_block_reward
Compute the generation-decayed block reward.
reward = base_block_reward * beta^generation
Result is floored to the nearest micro-MINT.
pub fn compute_block_reward(config: &RewardConfig, generation: u32) -> u64;Source line: 72.
rewards::distribute_rewards
Distribute rewards for a single block.
Steps:
- Compute treasury share from the base reward.
- Compute the generation-decayed reward for the validator portion.
- Ensure the human root receives at least
min_human_shareof the validator portion. - Divide the remainder between proposer (self-stake) and delegators (delegated stake) in proportion to their contributions.
pub fn distribute_rewards(
config: &RewardConfig,
block_height: u64,
proposer: &StakeRecord,
delegations: &[Delegation],
) -> RewardDistribution;Source line: 87.