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

proveVoteTallyBatch() may fail on the final batch #90

Closed
weijiekoh opened this issue May 1, 2020 · 0 comments
Closed

proveVoteTallyBatch() may fail on the final batch #90

weijiekoh opened this issue May 1, 2020 · 0 comments

Comments

@weijiekoh
Copy link
Contributor

weijiekoh commented May 1, 2020

The final invocation of proveVoteTallyBatch() requires that the sender pass in a uint256[] memory _finalResults value. There is be an upper limit on the size of the array (a simple test showed that the limit is between 2 ** 5 and 2 ** 6 values), and make it impossible to tally the final batch.

I have a workaround in mind but I will think of more solutions:

Create a function which accepts a batch of values from the full list of results, and inserts each value into a Merkle tree, and store the root on-chain. One transaction is required per batch. Once all batches have been inserted, the final invocation of proveVoteTallyBatch() can look up the root and use it to verify that the commitment to the final tally is correct. Doing so will, however, reveal the results before the final invocation of proveVoteTallyBatch().

Edit (3 May 2020): After discussing with @kobigurk, I've created issue #91 and will close this issue in favour of it.

@weijiekoh weijiekoh self-assigned this May 1, 2020
@weijiekoh weijiekoh added this to Needs review in Minimum Viable MACI May 1, 2020
@weijiekoh weijiekoh moved this from Needs review to Sprint 5 (optimisations) in Minimum Viable MACI May 1, 2020
@weijiekoh weijiekoh moved this from Sprint 5 (optimisations) to In progress in Minimum Viable MACI May 3, 2020
@weijiekoh weijiekoh moved this from In progress to Done in Minimum Viable MACI May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

4 participants