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

genProof throws FailedDecryption trying to decrypt the placeholder message created during poll.init() #1134

Closed
3 tasks done
yuetloo opened this issue Jan 30, 2024 · 2 comments · Fixed by #1303
Closed
3 tasks done
Assignees

Comments

@yuetloo
Copy link
Contributor

yuetloo commented Jan 30, 2024

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am not running a deprecated version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

Please describe the behavior you are expecting

Decryption failed when trying to decrypt the placeholder message generated during poll.init(). Note that the message is not encrypted (that's why it failed to decrypt).

https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/contracts/Poll.sol#L142

    // init messageAq here by inserting placeholderLeaf
    uint256[2] memory dat;
    dat[0] = NOTHING_UP_MY_SLEEVE;
    dat[1] = 0;
    (Message memory _message, PubKey memory _padKey, uint256 placeholderLeaf) = padAndHashMessage(dat, 1);
    extContracts.messageAq.enqueue(placeholderLeaf);

    emit PublishMessage(_message, _padKey);

If the error was intentional to get the poll message processor to inject a blank ballot, it should just log a different message and process it properly rather than relying on throwing error to insert blank ballot.

Current Behavior

What is the current behavior?

Failure Information

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. you get it...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • MACI version:
  • Firmware Version:
  • Operating System:
  • SDK version:
  • Toolchain version:

Failure Logs

Please include any relevant log snippets or files here.

@ctrlc03
Copy link
Collaborator

ctrlc03 commented Jan 31, 2024

thanks @yuetloo

perhaps we could directly skip processing if message index is 0 and just add the empty ballot? In terms of functionality there would not be any changes. Or, we could keep as is, and with the addition of optional logs for poll.processMessages (#1138) this would be logged with index 0, which we know it's reserved for the blank message. Let me know if I'm missing something?

@ctrlc03 ctrlc03 self-assigned this Jan 31, 2024
@yuetloo
Copy link
Contributor Author

yuetloo commented Feb 2, 2024

This issue is more to make the log looks cleaner and minimize confusion. I'm good if you just skip processing the message at index 0 and add an empty ballot.

Currently, this is what we see in our log.

[i] Generating proofs of message processing...
Error at message index 0 - failed decryption due to either wrong encryption public key or corrupted ciphertext
[i] Progress: 1 / 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants