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

Fix user votes query to take into account only active round validators and their power ratios. #174

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

dusan-maksimovic
Copy link
Contributor

Description

Query user votes used to return user's voted power only as the number of LSM tokens used to vote. This gives inaccurate user's voted power for two reasons:

  1. LSM tokens used to vote could belong to a validator that later dropped out from top N. Votes with such tokens do not contribute to the proposal total power, and should therefore be ignored.
  2. If the validator was slashed, then it's LSMs are worth less than the LSMs of the validators that were not slashed. LSMs from user vote should be multiplied by the validator power ratio (range 0.0 to 1.0) to calculate its ratio to ATOM token.

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Targeted the correct branch
  • Included the necessary unit tests
  • Added/adjusted the necessary interchain tests
  • Added a changelog entry in .changelog
  • Compiled the contracts by using make compile and included content of the artifacts directory into the PR
  • Regenerated front-end schema by using make schema and included generated files into the PR
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

@dusan-maksimovic dusan-maksimovic merged commit d0cc219 into main Nov 20, 2024
5 checks passed
@dusan-maksimovic dusan-maksimovic deleted the dusan/fix-query-user-votes branch November 20, 2024 14:05
dusan-maksimovic added a commit that referenced this pull request Nov 25, 2024
* Migrate Hydro & Tribute contracts to v2.0.1 (#170)

* added migration from v1.1.0 to v2.0.0 for hydro contract

* - modifications of hydro migration code
- added tribute migration
- added unit tests
- fixed tribute build issue

* - don't check if lock's validator is active when migrating votes
- changed version to V2.0.1

* added changelog

* fix user votes query (#174)

* Do not allow short lockups to vote on proposals for longer liquidity deployment (#175)

* Do not allow short lockups to vote on proposals for longer liquidity deployment.

* ignore short lockups instead of returning error in vote()

* renamed proposal's "bid_duration" to "deployment_duration" (#176)

* allow longer locks in pilot rounds (#177)

* prepared V2.0.1 changelog (#178)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants