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

Governance Proposal voting #1683

Closed
sabau opened this issue Dec 3, 2018 · 21 comments · Fixed by #1728
Closed

Governance Proposal voting #1683

sabau opened this issue Dec 3, 2018 · 21 comments · Fixed by #1728
Assignees

Comments

@sabau
Copy link
Contributor

sabau commented Dec 3, 2018

UI Version: 0.X.X

Description:

Problem

After double voting on a proposal I get an error message saying that my action is already in the cache and I'm prevented to act on this proposal and on others too.

Steps

  • Create a proposal
  • Deposit (I did it 1 + 2 + 40) 43 Steak then the Vote button is enabled
  • Vote for it, let's say YES
  • Vote again with the same value
  • Every other action gets blocked: Invalid Sequence. Got 9 expected 10

Possible solution

As far as I understood the root cause is the double voting with identical value, it will try to create two identical blocks, we can prevent this by storing in the state the last vote and disable just that value so you can't vote twice with the same value

Related: cosmos/cosmos-sdk#3002

@jbibla
Copy link
Collaborator

jbibla commented Dec 3, 2018

is double voting supposed to be permitted?

@faboweb
Copy link
Collaborator

faboweb commented Dec 4, 2018

is double voting supposed to be permitted?

no. but you can change your vote.

@fedekunze
Copy link
Contributor

fedekunze commented Dec 4, 2018

is double voting supposed to be permitted?

you can vote as many times as you want if the proposal is still on voting period. You just need to pay gas every time

@jbibla
Copy link
Collaborator

jbibla commented Dec 4, 2018

isn't the sequence number supposed to address this?

@faboweb
Copy link
Collaborator

faboweb commented Dec 5, 2018

isn't the sequence number supposed to address this?

yes you are right, maybe there is a bug in incrementing the sequence on our side.

@faboweb
Copy link
Collaborator

faboweb commented Dec 5, 2018

I would still disable the option to vote for the same for a better UX.

@sabau
Copy link
Contributor Author

sabau commented Dec 5, 2018

I'm trying to reproduce it but it doesn't happen anymore

I had to restart fresh. I'll update the steps to reproduce

@jbibla
Copy link
Collaborator

jbibla commented Dec 5, 2018

I would still disable the option to vote for the same for a better UX.

but if a user is allowed to vote more than once - shouldn't we permit this?

@faboweb
Copy link
Collaborator

faboweb commented Dec 6, 2018

but if a user is allowed to vote more than once - shouldn't we permit this?

I suppose this would only confuse the user. "Have I voted already? Why can I vote 'Yes' again?". I would disable all options, that don't bring any value to the user.

@fedekunze
Copy link
Contributor

fedekunze commented Dec 6, 2018

Why can I vote 'Yes' again?". I would disable all options, that don't bring any value to the user.

We should display the previous vote by the user somewhere on the proposal, that's the main issue here imo.

Thus, I disagree with disabling voting for the same option, if users want to throw away their funds we shouldn't prevent them to do so 💸

@faboweb
Copy link
Collaborator

faboweb commented Dec 6, 2018

if users want to throw away their funds we shouldn't prevent them to do so

what's the reasoning here?

@fedekunze
Copy link
Contributor

I guess the question is more why are you preventing them to do it ? I know it's not "bringing value" but if they choose to do so then be it

@fedekunze
Copy link
Contributor

maybe add an additional confirmation with a note like
You already vote ${this.option} on this proposal. Do you still want to send an additional transaction (with gas costs) ?
But definitely not preventing them to vote twice on the same option

@faboweb
Copy link
Collaborator

faboweb commented Dec 6, 2018

why are you preventing them to do it

reduced complexity is always better for UX. preventing users to make errors as well. We are also i.e. validating form inputs. just because the user is in theory able to perform some action in the backend shouldn't mean the UI allows the user to do so.

@sabau
Copy link
Contributor Author

sabau commented Dec 6, 2018

So the outcome for this if I got it correctly should be:

  • At loading get your last vote, if you voted in another session, reopened the app, we should behave in the same way as if you voted right now
  • Save in the store your action even before the reply from the APIs, so speedy users won't have surprises
  • once you get back the data add/update your last vote in the store
    • I've seen that in the /proposals response this information is not there (who voted what) we just have a summary.
    • We can query proposals/{proposal_id}/votes/{voter} to know the last vote
  • do something with this information: either block that vote option and / or show the datetime when you voted there

@sabau
Copy link
Contributor Author

sabau commented Dec 6, 2018

nice to have: show the datetime of your vote

  • query the transaction that contain your most recent vote

@jbibla
Copy link
Collaborator

jbibla commented Dec 6, 2018

is "voting again" the same as changing your vote? if i vote "yes" and "no" on the same proposal - what is the expected result?

@fedekunze
Copy link
Contributor

is "voting again" the same as changing your vote? if i vote "yes" and "no" on the same proposal - what is the expected result?

that your final vote is "No"

@jbibla
Copy link
Collaborator

jbibla commented Dec 6, 2018

so it's not "voting again" then - it's "changing your vote" - which should be permitted @faboweb ... but we will need to indicate what the users last vote was.

👍

@faboweb
Copy link
Collaborator

faboweb commented Dec 6, 2018

I am all for "changing your vote". I understood the discussion was around if we should allow "voting again" (with the same option).

@jbibla
Copy link
Collaborator

jbibla commented Dec 6, 2018

ahhhh. yes, we should not allow a user to vote the same way again. i understand and agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants