shentu icon indicating copy to clipboard operation
shentu copied to clipboard

GOV: add VoteWeighted

Open bennyzhe opened this issue 3 years ago • 7 comments

Closes: #432

Description


For contributor use:

  • [ ] Targeted PR against correct branch (see CONTRIBUTING.md)
  • [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • [ ] Code follows the module structure standards.
  • [ ] Wrote unit and integration tests
  • [ ] Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • [ ] Added relevant godoc comments.
  • [ ] Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • [ ] Re-reviewed Files changed in the Github PR explorer

For admin use:

  • [ ] Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • [ ] Reviewers assigned
  • [ ] Squashed all commits, uses message "Merge pull request #XYZ: [title]"

bennyzhe avatar Oct 14 '22 02:10 bennyzhe

Codecov Report

Merging #500 (b600f97) into master (cb63bff) will decrease coverage by 0.55%. The diff coverage is 59.37%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #500      +/-   ##
==========================================
- Coverage   41.39%   40.83%   -0.56%     
==========================================
  Files         124      127       +3     
  Lines       11495    11825     +330     
==========================================
+ Hits         4758     4829      +71     
- Misses       6276     6528     +252     
- Partials      461      468       +7     
Impacted Files Coverage Δ
x/gov/handler.go 42.85% <0.00%> (ø)
x/gov/keeper/tally.go 39.39% <0.00%> (-1.45%) :arrow_down:
x/gov/module.go 0.00% <0.00%> (ø)
x/gov/keeper/msg_server.go 34.83% <100.00%> (+33.57%) :arrow_up:
x/gov/endblocker.go 0.00% <0.00%> (ø)
x/gov/genesis.go 0.00% <0.00%> (ø)
x/gov/keeper/proposal.go 42.28% <0.00%> (+1.14%) :arrow_up:

codecov[bot] avatar Oct 14 '22 02:10 codecov[bot]

just a bit curious why there is no checker to make sure the sum of all the weigh is equivalent to 1 in a single WeightedVote. It seems there is no such checker in cosmos sdk either.

haozhan9 avatar Oct 17 '22 02:10 haozhan9

Shall we consider WeighedVote cast by certifiers in CertifierVotingPeriod? To be specific, it looks like the current implementation as in [email protected] doesn't actually take multiple options except the first one.

haozhan9 avatar Oct 17 '22 03:10 haozhan9

Shall we consider WeighedVote cast by certifiers in CertifierVotingPeriod? To be specific, it looks like the current implementation as in [email protected] doesn't actually take multiple options except the first one.

it seems we are assuming each certifier has same share of voting power when it comes to CertifierVotingPeriod. But we could not stop them from casting WeightedVote for proposals that require CertifierVoting.

haozhan9 avatar Oct 17 '22 03:10 haozhan9

just a bit curious why there is no checker to make sure the sum of all the weigh is equivalent to 1 in a single WeightedVote. It seems there is no such checker in cosmos sdk either.

The sum is checked in ValidateBasic.

bennyzhe avatar Oct 17 '22 03:10 bennyzhe

Shall we consider WeighedVote cast by certifiers in CertifierVotingPeriod? To be specific, it looks like the current implementation as in [email protected] doesn't actually take multiple options except the first one.

I think we should

yoongbok-lee avatar Oct 17 '22 06:10 yoongbok-lee

Shall we consider WeighedVote cast by certifiers in CertifierVotingPeriod? To be specific, it looks like the current implementation as in [email protected] doesn't actually take multiple options except the first one.

I think we should

OK, I will add WeighedVote for certifiers as well.

bennyzhe avatar Oct 17 '22 06:10 bennyzhe

I think this can be merged in now

yoongbok-lee avatar Nov 12 '22 06:11 yoongbok-lee