Merge PR #1702: lamborghini distribution & inflation spec upgrade

This commit is contained in:
Rigel
2018-08-08 12:10:21 +02:00
committed by Christopher Goes
parent 45a010bb2f
commit 7fb626f548
22 changed files with 742 additions and 320 deletions
+1 -43
View File
@@ -1,10 +1,6 @@
# End-Block
Two staking activities are intended to be processed in the application end-block.
- inform Tendermint of validator set changes
- process and set atom inflation
# Validator Set Changes
## Validator Set Changes
The Tendermint validator set may be updated by state transitions that run at
the end of every block. The Tendermint validator set may be changed by
@@ -21,41 +17,3 @@ EndBlock() ValidatorSetChanges
return vsc
```
# Inflation
The atom inflation rate is changed once per hour based on the current and
historic bond ratio
```golang
processProvisions():
hrsPerYr = 8766 // as defined by a julian year of 365.25 days
time = BFTTime()
if time > pool.InflationLastTime + ProvisionTimeout
pool.InflationLastTime = time
pool.Inflation = nextInflation(hrsPerYr).Round(1000000000)
provisions = pool.Inflation * (pool.TotalSupply / hrsPerYr)
pool.LooseTokens += provisions
feePool += LooseTokens
setPool(pool)
nextInflation(hrsPerYr rational.Rat):
if pool.TotalSupply > 0
bondedRatio = pool.BondedPool / pool.TotalSupply
else
bondedRation = 0
inflationRateChangePerYear = (1 - bondedRatio / params.GoalBonded) * params.InflationRateChange
inflationRateChange = inflationRateChangePerYear / hrsPerYr
inflation = pool.Inflation + inflationRateChange
if inflation > params.InflationMax then inflation = params.InflationMax
if inflation < params.InflationMin then inflation = params.InflationMin
return inflation
```