-
Notifications
You must be signed in to change notification settings - Fork 143
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
Negative voting (v1) #283
Negative voting (v1) #283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some changes to cli/test2.sh
. May I suggest creating a new testN.sh
file instead? Also, please try the other testX.sh
files; I'm not sure but they may also require updates.
After citing feedback from @weijiekoh on the initial iteration of this pull request, the change brought upon the tallying circuits result tree's root composition gave rise to a collision vulnerability. As the sum of the positive and negative tallies at a specific depth can be replicated using other integer combinations. Therefore to inhibit this and retain the level of viability that is present in v1, leaves within the results trees now translate to packed vote leafs for positive and negative tallies at a specific depth with the introduction of the Furthermore, integration tests have been refined and expanded, as it was not successfully conditioning the presence of the |
The constraints limiting vote leaf field sizes in both circumstances have been redacted, in place is the mux selector that @weijiekoh recommended to no-op invalid vote leaves when processing messages and
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good once this final suggestion is tested and committed.
Co-authored-by: Koh Wei Jie <weijiekoh@users.noreply.github.com>
A feature previously prototyped but not entirely integrated in #112, the discussions here concluded that:
Upon building on the structure previously developed, the following aspects of the stack have been altered to support this feature
Circuits
VoteLeaf
UnpackVoteLeaf
as it would fail for zero values with circomlib'sLessEqThan
MessageValidator
CalculateVoteLeafSquared
components; one for the messages vote leaf, the other for the current vote option vote leaf. Allowing the correct computation of the squared sum of positive and negative values for each leaf and deeming whether there is a sufficient voice credit balanceProcessMessages
CalculateVoteLeafSquared
components; one for the current vote leaf, the other being the command's vote leaf to compute whether there are enough voice credits to process the message as validTallyVotes
resultCalc
componentCalculateTotal
to 2-dimensional array with elements[n][0]
assigned positive tallies and[n][1]
one with negativeUnpackVoteLeaf
components, to feed each as an input to the associated index for summationCalculateVoteLeafSquared
template arrays, one for the total voice credits spent per vote option tally and the other for the total voice credits spentDomain Objects
VoteLeaf
class refactored to suit a 50 bit value and to the new BigInt typeCore
Cli
--wv
, if not flagged negative votes are set to zeroIntegration tests