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
fix(circuits): enforce use of stateIndex from message #1170
Conversation
✅ Deploy Preview for maci-typedoc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
efc1626
to
8973c84
Compare
Thanks @ctrlc03!
Not sure what you mean hear, could you please clarify? |
Have a look at core/ts/Poll.ts in genProcessMessagesPartialInputs, for some reason we were padding with the last message in the array (basically there might be one batch which needs to be padded to be full, which is the first one unless messages % batch size === 0). Now instead of sending the last message in the message array, which could have been a top up or a vote message (random based on whatever is sent last in a voting round), we just send a command with a state index of 0 so when processed by the circuit it'll just do nothing. |
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.
@ctrlc03 thanks, just one minor comment.
8973c84
to
37d7961
Compare
077b7ae
to
1185b97
Compare
1185b97
to
94f5c78
Compare
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.
@ctrlc03 thanks!
94f5c78
to
7271b95
Compare
LGTM! |
7271b95
to
8cab606
Compare
… = 0 Prevent coordinator censoring a valid second message by passing the currentVoteWeight equal to a number which would result in not enough voice credits in the circuit
8cab606
to
22e091d
Compare
Description
Prevent passing unmatched state leaves to censor votes by the coordinator. Instead, ensure that the state leaf sent for each message, is the state leaf at position message.stateIndex within the stateTree. Also, force decryption on the TS message processing, to ensure that a malicious user might not send an invalid message which when decrypted by the circuit (using decryptWithoutCheck and thus possibily failing decryption) would result in a valid stateIndex, causing a DoS on the coordinator which would not be able to generate a proof.
Also, the padding messages are not anymore the last message sent (this.messages[this.messages.length - 1]), but actually an empty command with a state index 0 so that when processed in the circuit, it will have no effect.
cc @kcharbo3
Related issue(s)
re #1133
Confirmation