Feature: Batch voting #62

Closed
fsmanuel wants to merge 3 commits from feature/batch-voting into master
fsmanuel commented 2018-04-24 13:32:59 +00:00 (Migrated from github.com)

This is the counterpart to https://github.com/67P/truffle-kredits/pull/26

I can not test it at the moment because the estimated gas doesn't work.
Everything else should be done until we have a better design.

This is the counterpart to https://github.com/67P/truffle-kredits/pull/26 I can not test it at the moment because the estimated gas doesn't work. Everything else should be done until we have a better design.
raucao (Migrated from github.com) reviewed 2018-04-24 13:32:59 +00:00
fsmanuel commented 2018-04-24 13:38:30 +00:00 (Migrated from github.com)

@bumi can you test with this branch. My internet is shitty... and I forgot what to do if the gas estimation fails.

@bumi can you test with this branch. My internet is shitty... and I forgot what to do if the gas estimation fails.
bumi commented 2018-04-24 13:40:51 +00:00 (Migrated from github.com)

will check it out (hopefully later today/evening).
if the gas estimate fails it either means it can not estimate the gas ;) ... because the contract has an error or I don't know.
That loop in the batch vote function for sure could be an issue...

will check it out (hopefully later today/evening). if the gas estimate fails it either means it can not estimate the gas ;) ... because the contract has an error or I don't know. That loop in the batch vote function for sure could be an issue...
fsmanuel commented 2018-04-24 13:45:42 +00:00 (Migrated from github.com)

Good. That sounds like it's your problem not mine 😃

Good. That sounds like it's your problem not mine 😃
bumi commented 2018-04-24 13:57:37 +00:00 (Migrated from github.com)

😱

:scream:
raucao commented 2018-04-24 14:57:33 +00:00 (Migrated from github.com)

Shouldn't there be a way to suggest a gas amount to the wallet for a transaction? It would seem that this is a basic need for any complex contract interaction, as wallets cannot estimate everything on their own.

Shouldn't there be a way to suggest a gas amount to the wallet for a transaction? It would seem that this is a basic need for any complex contract interaction, as wallets cannot estimate everything on their own.
bumi commented 2018-04-24 23:46:56 +00:00 (Migrated from github.com)

yes, but the wallet should be able to estimate the gas - "simulating" the execution should be a better estimate than some value that we provide.

yes, but the wallet should be able to estimate the gas - "simulating" the execution should be a better estimate than some value that we provide.
raucao commented 2018-04-25 09:18:23 +00:00 (Migrated from github.com)

Didn't you just have the issue that the wallet estimated wrong, by a factor of 10 or more? At least Metamask seems to be planning some improvements: https://github.com/MetaMask/metamask-extension/issues/3914

But my question was rather aimed at solving the problem for us right now, without relying on wallet implementations, so we can start using the system.

Didn't you just have the issue that the wallet estimated wrong, by a factor of 10 or more? At least Metamask seems to be planning some improvements: https://github.com/MetaMask/metamask-extension/issues/3914 But my question was rather aimed at solving the problem for us right now, without relying on wallet implementations, so we can start using the system.
bumi commented 2018-04-25 09:35:18 +00:00 (Migrated from github.com)

our issue was related to ganache (+ ethers maye...)
I first need to review the contract code most of the time if the estimation does not work something is wrong with the contract

our issue was related to ganache (+ ethers maye...) I first need to review the contract code most of the time if the estimation does not work something is wrong with the contract
bumi commented 2018-04-26 21:44:55 +00:00 (Migrated from github.com)

actually it works well for me! pretty cool actually!
I did not have to change any gas settings... maybe @skddc can you also check it?

One issue:
I have 4 open proposals. I select two, vote for them. These get executed and get removed from the list of open proposals. BUT they stay selected. once I select the remaining proposals and do submit selected it also tries to submit the already submitted ones.

actually it works well for me! pretty cool actually! I did not have to change any gas settings... maybe @skddc can you also check it? One issue: I have 4 open proposals. I select two, vote for them. These get executed and get removed from the list of open proposals. BUT they stay selected. once I select the remaining proposals and do submit selected it also tries to submit the already submitted ones.
fsmanuel commented 2018-04-26 21:58:43 +00:00 (Migrated from github.com)

Good catch! I’ll remove the selection after the submit!

Good catch! I’ll remove the selection after the submit!
bumi commented 2018-04-26 22:04:53 +00:00 (Migrated from github.com)

👍

we should remove executed proposals also. As maybe...maybe a proposal gets executed before I vote and then my whole batch vote fails.
It might also make sense to change the behaviour of the vote function and not fail if a proposal is already executed... but just count the vote but don't execute it?

:+1: we should remove executed proposals also. As maybe...maybe a proposal gets executed before I vote and then my whole batch vote fails. It might also make sense to change the behaviour of the vote function and not fail if a proposal is already executed... but just count the vote but don't execute it?
raucao commented 2018-04-26 22:16:50 +00:00 (Migrated from github.com)

Just as an aside, I wouldn't put much work in the UI there right now, as it's going to change entirely. There won't be any selection of contribution entries for the batch voting for example. As long as the underlying batch vote works for now, it should be good enough, and we can then get to the edge cases when we have the new UI.

Just as an aside, I wouldn't put much work in the UI there right now, as it's going to change entirely. There won't be any selection of contribution entries for the batch voting for example. As long as the underlying batch vote works for now, it should be good enough, and we can then get to the edge cases when we have the new UI.
bumi commented 2018-05-03 15:12:08 +00:00 (Migrated from github.com)

we should still merge this one, right? it implements everything needed on batch voting independently of the exact UI.
the removal of the selection is missing then we're good to merge.

we should still merge this one, right? it implements everything needed on batch voting independently of the exact UI. the removal of the selection is missing then we're good to merge.
raucao commented 2018-05-03 15:17:40 +00:00 (Migrated from github.com)

I'll check it out when I have everything running on Kovan on my machine.

I'll check it out when I have everything running on Kovan on my machine.
fsmanuel commented 2018-05-03 15:47:54 +00:00 (Migrated from github.com)

I'll update in a sec.

I'll update in a sec.
fsmanuel commented 2018-05-03 18:12:13 +00:00 (Migrated from github.com)

Updated

Updated
fsmanuel commented 2018-06-14 15:38:39 +00:00 (Migrated from github.com)

@bumi @skddc can you have another look?

@bumi @skddc can you have another look?
raucao commented 2018-06-14 15:47:07 +00:00 (Migrated from github.com)

Yup, will do this next.

Yup, will do this next.
fsmanuel (Migrated from github.com) reviewed 2018-06-14 17:16:41 +00:00
fsmanuel (Migrated from github.com) commented 2018-06-14 17:16:41 +00:00

That comment should be removed

That comment should be removed
raucao commented 2018-06-15 07:20:50 +00:00 (Migrated from github.com)

I get the following error:

this.kredits.Operator.functions.batchVote is not a function

I rebased this on master locally, but that shouldn't change anything I would assume.

I get the following error: this.kredits.Operator.functions.batchVote is not a function I rebased this on master locally, but that shouldn't change anything I would assume.
bumi commented 2018-06-15 07:43:40 +00:00 (Migrated from github.com)

@skddc that's probably because the ABI of the operator was not up to date: https://github.com/67P/kredits-contracts/commit/7216522d833f11e44377df86b1fde21fecae1e7e

@skddc that's probably because the ABI of the operator was not up to date: https://github.com/67P/kredits-contracts/commit/7216522d833f11e44377df86b1fde21fecae1e7e
bumi commented 2018-06-15 07:45:56 +00:00 (Migrated from github.com)

I released a new version of kredits-contracts 3.0.2 - can you try with that one?

I released a new version of kredits-contracts `3.0.2` - can you try with that one?

Pull request closed

Sign in to join this conversation.