namada icon indicating copy to clipboard operation
namada copied to clipboard

Votes seem to be misreported in the CLI (yay and nay seem to be reversed)

Open phy-chain opened this issue 1 year ago • 4 comments

When I query the proposal 13, I get this result in the CLI :

2024-02-08T21:12:58.009878Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qzlgjda3ne3a8jfawhlg5nujjwv923srfch85mts
2024-02-08T21:12:58.317875Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qr24knyet40h4v4d2uj9y8szk4vvwujy8us9frvs
2024-02-08T21:12:58.449864Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qrmv29rke02g6z6xlsp9c6zs0qp3m84mtg7s94p9
2024-02-08T21:12:58.933870Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qzmylejej6yy079d456nf4e6xtdf0ugcpq77h027
2024-02-08T21:12:59.109859Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qr24knyet40h4v4d2uj9y8szk4vvwujy8us9frvs
2024-02-08T21:12:59.197864Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qzlgjda3ne3a8jfawhlg5nujjwv923srfch85mts
2024-02-08T21:12:59.329870Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qzrw2anptw9cf2eytmqyxzr5x9qg3q7ktuekpszx
2024-02-08T21:12:59.505887Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qppefdpha0rwtf4qsuyvxmnnnvjvgz84yvf2nz0m
2024-02-08T21:12:59.549888Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qzmylejej6yy079d456nf4e6xtdf0ugcpq77h027
2024-02-08T21:12:59.593886Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qrmv29rke02g6z6xlsp9c6zs0qp3m84mtg7s94p9
2024-02-08T21:12:59.769885Z ERROR namada_governance::utils: Duplicate vote for delegator tnam1qrmv29rke02g6z6xlsp9c6zs0qp3m84mtg7s94p9
Proposal Id: 13 
    rejected with 21087092.900000 yay votes, 15905350.100000 nay votes and 0.000000 abstain votes, total voting power: 291294347.508519 threshold was: 97098115.836076

Apart from the error itself for duplicate vote (I dont know where this is coming from), I can see "rejected with..." 21087092.900000 yay votes 15905350.100000 nay votes 0.000000 abstain votes Unless my calculator is failing me, this is a 55%/45% in favor, right ?

phy-chain avatar Feb 08 '24 21:02 phy-chain

It looks to me that the proposal is still active (start epoch: 2, end epoch: 4), so truly no result has actually been determined since the chain is in epoch 2.

However, the logging should definitely reflect this properly.

Also, the yay and nay votes do not look to be reversed and are correct. See https://github.com/anoma/namada/blob/main/crates/governance/src/utils.rs#L209-L230

brentstone avatar Feb 08 '24 22:02 brentstone

@Fraccaman seems concerning that we see the tracing::error logs here, due to https://github.com/anoma/namada/blob/main/crates/sdk/src/rpc.rs#L1012-L1017.

Looks like query_proposal_votes is returning a Vec<Vote> with duplicate entries

brentstone avatar Feb 08 '24 22:02 brentstone

Indeed you're correct, I did not see the source code for that ! it's just an issue of the string formatting then !

Are those "normal" errors ?

phy-chain avatar Feb 08 '24 23:02 phy-chain

Indeed you're correct, I did not see the source code for that ! it's just an issue of the string formatting then !

Are those "normal" errors ?

I opened #2573 to start fixing this. The other errors first seen in the query for duplicate votes should not be occurring and we need to figure out why they do. See my comment above.

brentstone avatar Feb 09 '24 00:02 brentstone

You are totally right, those logs should be there. We opened #2579 to fix this behavior.

Fraccaman avatar Feb 09 '24 11:02 Fraccaman