-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat(contracts): relay messages #2002
base: dev
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
- [x] Add relay messages method to Poll contract - [x] Use struct for deploy poll args - [x] Add relayer addresses to Poll contract
abc2739
to
716681f
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.
Thanks, left some comments
/// @notice Allows relayer to publish messages using IPFS. | ||
/// @param _messageHashes The message hashes | ||
/// @param _ipfsHash The IPFS hash of the messages batch | ||
function relayMessagesBatch( |
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.
should we add it to the interface too?
/// @param _messageHashes The message hashes | ||
/// @param _ipfsHash The IPFS hash of the messages batch | ||
function relayMessagesBatch( | ||
uint256[] calldata _messageHashes, |
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 thought we'd be relaying the full batch hash rather than each message hash, but this would work too, just a little bit more expensive for the relayer, but something to consider
Also if we go like this, it might be worth considering to constrain the number of hashes sent to be <= messageBatchSize, to keep things a bit more clean (only the last batch might be smaller)
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 use message hashes to keep numMessages
sync with offchain messages.
And why do we need to check messageBatchSize
? When we update chain hash we have this check when adding new chain hash:
if (numMessages % messageBatchSize == 0) {
batchHashes.push(newChainHash);
}
I think it's the same logic for publishMessageBatch
, there is no check for messageBatchSize
.
Description
Additional Notes
This is a part of happy offchain path
Related issue(s)
Related to privacy-scaling-explorations/maci-platform#279
Confirmation
Important
We do not accept minor grammatical fixes (e.g., correcting typos, rewording sentences) unless they significantly improve clarity in technical documentation. These contributions, while appreciated, are not a priority for merging. If there is a grammatical error feel free to message the team.