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

Validator Signatures #6

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Validator Signatures #6

wants to merge 7 commits into from

Conversation

asaj
Copy link
Contributor

@asaj asaj commented Dec 21, 2022

No description provided.

@asaj asaj marked this pull request as ready for review December 21, 2022 13:47
@asaj asaj marked this pull request as draft December 21, 2022 16:24
@asaj asaj marked this pull request as ready for review December 21, 2022 21:08
HIP-2.md Show resolved Hide resolved
Comment on lines +57 to +71
* @notice Emitted when a validator signature is verified
* @dev Used by watchtowers to detect fraudulent validators
* @param domain The origin domain of the Mailbox being validated
* @param mailbox The address of the Mailbox being validated, as bytes32
* @param root The merkle root that the validator is attesting to
* @param index The message count that the validator is attesting to
* @param signature The 65-byte ECDSA validator signature
*/
event ValidatorSignature(
uint32 domain,
bytes32 mailbox,
bytes32 root,
uint32 index
bytes signature
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems expensive to emit this for every signature verification

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lots of redundant event info every message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call, it's about 600 gas to emit the domain/mailbox/root/index, plus another couple hundred for the event itself.

Maybe this would be better? Wdyt?

event ValidatorSignatures(
        uint32 domain,
        bytes32 mailbox,
        bytes32 root,
        uint32 index
        bytes[] signatures
    );

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo domain and mailbox are unnecessary as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the root implicitly commit to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not. Even if did, as a watcher, how would you recover the mailbox/origin domain in order to construct your fraud proof?

HIP-2.md Show resolved Hide resolved
HIP-2.md Show resolved Hide resolved
@tkporter tkporter mentioned this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants