Closed kianenigma closed 1 month ago
Some updates:
relay_inflation
helper fn. Once https://github.com/polkadot-fellows/runtimes/pull/381 is merged, I shall merge https://github.com/kianenigma/runtimes/tree/kiz-inflation-with-update here.
I ran some experiments on this in Kusama, and I thought these parameters are the ones that map 1-1 to the current system, but the numbers differ quite a lot with the current daily inflation of Kusama (around 1kKSM):
Jul 19 09:15:35.490 DEBUG runtime::kusama: params: EraPayoutParams { total_staked: 8062597276340684331, total_stakable: 15224588856636910147, ideal_stake: 75%, max_annual_inflation: 10%, min_annual_inflation: 2.5%, falloff: 5%, period_fraction: 0.0317894896950338%, legacy_auction_proportion: Some(17.5%) }
Jul 19 09:15:35.490 INFO runtime::kusama: total-staked = 8062597.276 KSM (8,062,597,276,340,684,331)
Jul 19 09:15:35.490 INFO runtime::kusama: total-issuance = 15224588.856 KSM (15,224,588,856,636,910,147)
Jul 19 09:15:35.490 INFO runtime::kusama: staking-rate = 52.9577340463018619%
Jul 19 09:15:35.490 INFO runtime::kusama: era-duration = 10032000
Jul 19 09:15:35.490 INFO runtime::kusama: min-inflation = 2.5%
Jul 19 09:15:35.490 INFO runtime::kusama: max-inflation = 10%
Jul 19 09:15:35.490 INFO runtime::kusama: falloff = 5%
Jul 19 09:15:35.490 INFO runtime::kusama: useAuctionSlots = true
Jul 19 09:15:35.490 INFO runtime::kusama: idealStake = 75%
Jul 19 09:15:35.490 INFO runtime::kusama: maxStakingRewards = None
Jul 19 09:15:35.490 INFO runtime::kusama: 💰 Inflation ==> staking = 455.307 KSM (455,307,459,857,217) / leftover = 28.674 KSM (28,674,450,711,956)
Need to double check and ensure the code is fully backwards compatible.
Well, I called this simulation more or less in the middle of an era, so the era duration is assumed to be half :)) So the code adds up.
/merge
Enabled auto-merge
in Pull Request
This PR does not alter the inflation of Kusama, but instead make the current parameters of the system fully configurable.
Parameters
The parameters are as follows:
All of the above are exactly the current values in Kusama, and leave everything unchanged, leading to roughly
1kKSM
minted for validators, and around90KSM
for treasury.All of the above can be changed via the
Root
track only.Given that it is hard to come to consensus, I highly advise this PR (and a similar PR to Polkadot) to NOT alter any parameter and leave that to the token holders.
Just to provide one example, if we set
UseAuctionSlots = false
and leave everything else un-changed, the amount minted per era would be:807KSM
for staking238KSM
for treasuryConsideration for UIs
This PR is shipped with a new runtime API that is only added to the Kusama runtime:
Inflation_experimental_inflation_info
. I hope this API is used by the UIs to show the inflation parameters of the network, rather than re-creating the Rust logic in the front-end.