Cosmos-sdk: x/mint: Inconsistency between spec and code

Created on 14 Feb 2019  路  9Comments  路  Source: cosmos/cosmos-sdk

x/mint is currently using stakeKeeper's totalPower as base value for inflation.

That means that only bonded tokens are inflated while the doc states that the total supply will be inflated.

https://github.com/cosmos/cosmos-sdk/blob/d66db6a7724a87e466dacdcbe7df5c7ba9c94f26/x/mint/abci_app.go#L15

https://github.com/cosmos/cosmos-sdk/blob/dfd00a661a19df6efe7e0dde96b2fbeb883d1d80/docs/spec/mint/begin_block.md#L33

In a discussion on Riot @adrianbrink pointed out that this clearly reduces the incentive for people to bond their ATOMs and increase the security of the network, which is a very valid point.

CC: @cwgoes @jaekwon @zmanian


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
bug

Most helpful comment

Hey @hendrikhofstadt, this is a great catch. It would be cool to see it land in my HackerOne inbox! Or I can throw in a thank you bonus on the next bug you submit, up to you.

All 9 comments

Specifically, if total supply is 100 atoms, and 50% is bonded and hence inflation is 20% then we will print 10 a year for a total inflation of 10%.

If 10% is bonded and hence inflation is 20% then we will print 2 atoms a year for 2% annual inflation.

The less % of the network is bonded the less the impact of inflation on the overall network will be. This would create a downward pressure on the amount of bonded atoms.

If the inflation is from the total supply of atoms, it would definitely give more incentive for atom holders to bond their atoms when others are not bonding as it will increase their returns.

Just chiming in: Fully agree that annual provisions should be calculated based on total supply to incentivize bonding.

I agree that inflation should be calculated based on total supply, as this aligns to the general understanding of the term "inflation".

Mathematically, we can still just inflate bonded tokens, but then the cap of inflation rate should be far higher than 20%, say 100%. But this looks bad.

Ref: #3634

In this thread @rigelrozanski also confirms that inflation should be calculated on the total supply.

Agree. That's also the way it is in the whitepaper and how it was always communicated.

Thanks @hendrikhofstadt - the original whitepaper copy was a bit vague, but we agree and will change inflation to be relative to total supply.

shucks... great catch folks, this is a bug

Hey @hendrikhofstadt, this is a great catch. It would be cool to see it land in my HackerOne inbox! Or I can throw in a thank you bonus on the next bug you submit, up to you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnmcdowall picture johnmcdowall  路  3Comments

hendrikhofstadt picture hendrikhofstadt  路  3Comments

rigelrozanski picture rigelrozanski  路  3Comments

jackzampolin picture jackzampolin  路  3Comments

rigelrozanski picture rigelrozanski  路  3Comments