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 <[email protected]>

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

Co-authored-by: yaruwangway <[email protected]>

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

Co-authored-by: yaruwangway <[email protected]>

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

Co-authored-by: yaruwangway <[email protected]>

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

Co-authored-by: yaruwangway <[email protected]>

* 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 <[email protected]>

* Update x/globalfee/types/params.go

Co-authored-by: yaruwangway <[email protected]>

* fix: lint

Signed-off-by: Yaru Wang <[email protected]>

* 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <[email protected]>
Co-authored-by: Milan Mulji <[email protected]>

* 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] <[email protected]>
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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <[email protected]>
Co-authored-by: Milan Mulji <[email protected]>

* fix nits

---------

Signed-off-by: Yaru Wang <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Simon Noetzlin <[email protected]>
Co-authored-by: MSalopek <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marius Poke <[email protected]>
Co-authored-by: Milan Mulji <[email protected]>
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