Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative coin amount during fee allocation #3723

Closed
4 tasks
hleb-albau opened this issue Feb 24, 2019 · 4 comments
Closed
4 tasks

Negative coin amount during fee allocation #3723

hleb-albau opened this issue Feb 24, 2019 · 4 comments
Labels
C:x/distribution distribution module related T:Bug

Comments

@hleb-albau
Copy link
Contributor

Summary of Bug

Error during fee allocation(distr module). At some point, the total sum of allocated token > initial fees. Seems, problems with truncating.

Steps to Reproduce

I reproduced this error on #3722 .


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@hleb-albau hleb-albau changed the title Negative coin amount Negative coin amount during fee allocation Feb 24, 2019
@cwgoes cwgoes added T:Bug critical C:x/distribution distribution module related labels Feb 24, 2019
@cwgoes
Copy link
Contributor

cwgoes commented Feb 24, 2019

Thanks for the report, we'll investigate this.

@cwgoes
Copy link
Contributor

cwgoes commented Feb 25, 2019

The issue here is that we weren't truncating multiplication and division (particularly the latter), so token amounts paid to validators could have been rounded up, resulting in more tokens allocated in total than had been collected in fees and generated by inflation.

I've implemented the appropriate truncation in #3728.

@alexanderbez
Copy link
Contributor

I think #3728 is a more sensible approach here using already existing APIs.

@hleb-albau
Copy link
Contributor Author

hleb-albau commented Feb 26, 2019

#3728 seems a more natural solution.

@cwgoes cwgoes added this to the v0.33.0 (Launch) milestone Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/distribution distribution module related T:Bug
Projects
None yet
Development

No branches or pull requests

3 participants