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

Switch Validator Bonded Tokens to using integers #2327

Closed
rigelrozanski opened this issue Sep 13, 2018 · 2 comments
Closed

Switch Validator Bonded Tokens to using integers #2327

rigelrozanski opened this issue Sep 13, 2018 · 2 comments

Comments

@rigelrozanski
Copy link
Contributor

Once the fee pool is implemented (which is the module which will mainly be uzing non-whole tokens) we will be able to switch the validator bonded tokens from decimal tokens back to whole tokens.

There are funny things which need to be considered if this switch is made (which it seems as though it should be made).

What to do with fractional worth of delegations shares

Once validators are using full atoms once again there is an interesting question of what to do with the fractional (sub)-atoms from during an unbonding.

The worth of delegator shares could all simultaneously be set to fractional worth after a slashing event.

Because the losses per withdraw of this is going to be very very small (aka less than a satoshi for an atom) it's not worth attempting to account for it per delegation (computational/code-complexity overhead not worth it). I'm thinking that any remainder from your withdraw should probably just stay with the validator (increasing the worth of other delegators tokens until it normalizes to the next integer)

seems like a reasonable solution, just a funny thing to have to pay attention to

@rigelrozanski
Copy link
Contributor Author

NOTE Currently we are are burning the fractional atoms on unbonding (which I think is defensive and fine, also considering these are nano atoms)


So here is a possible constraint on this: We currently don't burn fractional atoms on redelegation, which means that validators power can be adjusted to being non-integer. If we did burn fractional atoms on redelegation, then I think we would be good on this situation.

@rigelrozanski
Copy link
Contributor Author

Actually as a part of this issue - all places where fractional atoms are burned or moved should be outlined in the docs!

chillyvee pushed a commit to chillyvee/cosmos-sdk that referenced this issue Mar 1, 2024
* - Update doc to follow Go conventions
- Improve code readability

* update params

* rebase and fix nits

* add GetMinGasPrice UT

* remove unused feetestsuite

* rebase

* update doc

* nits

* nits

* refactor fee tests setup

* remove comments

* Update x/globalfee/ante/antetest/fee_test.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/ante/antetest/fee_test.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/ante/antetest/fee_test.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/ante/antetest/fee_test.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/ante/antetest/fee_test.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/ante/antetest/fee_test.go

* fix GetMinGasPrice to not return nil coins

* min gas price zero coins edge cases

* min gas price zero coins edge cases

* remove debug logs

* udpate comments

* udpate comments

* add comment

* Update x/globalfee/types/params.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* Update x/globalfee/types/params.go

Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com>

* fix: lint

Signed-off-by: Yaru Wang <yaru@informal.systems>

* refactor: global fee zero coins

* refactor: add splitGlobalFees()

* fix: globalfee antehandler

* fix: add test helper func

* update according to PR comments

* test: add test for splitGlobalFees()

* code improvement

* refactor: globalfee antehandler

* refactor: bypass logic

* refactor: fee check logic

* fix: lint

* fix: return err when required fees are not set up

* chore: clean comments

* Sainoe/globalfee coins (cosmos#2378)

* chore(deps): bump github.com/golangci/golangci-lint (cosmos#2319)

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.51.2 to 1.52.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](golangci/golangci-lint@v1.51.2...v1.52.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com>

* chore(deps): bump github.com/docker/docker (cosmos#2365)

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.19+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v20.10.19...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Removed trust node in docs (cosmos#2359)

* update ditrosless image url in Dockerfiles

* nits

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com>

* fix nits

---------

Signed-off-by: Yaru Wang <yaru@informal.systems>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
Co-authored-by: MSalopek <35486649+MSalopek@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <marius.poke@posteo.de>
Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants