mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 17:28:23 +00:00
## Summary This PR introduces a configurable inflation system for validator rewards with an annual target rate and optional treasury allocation. ## Changes ### Inflation Mechanism - **Annual inflation rate runtime parameter**: Set to 5% default - **EraInflationProvider**: Calculates per-era inflation based on total issuance and annual rate - Formula: `per_era_inflation = (total_issuance × annual_rate) / eras_per_year` ### Treasury Allocation - **InflationTreasuryProportion parameter**: Set to 20% default - **ExternalRewardsInflationHandler**: Mints inflation and distributes between: - 80% to rewards account (for validator rewards) - 20% to treasury account - Treasury receives allocation via `mul_floor()`, with remainder going to rewards to ensure no tokens lost to rounding ### Runtime Integration - Configured across all three runtimes: mainnet, testnet, and stagenet - Consistent parameters across all environments ### Testing - Updated all tests to account for 80/20 split between rewards and treasury - Added precision tolerance (±1 unit) for Perbill rounding edge cases --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| runtime-api | ||
| src | ||
| Cargo.toml | ||