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

Make merkle proofs optional on multisig ISM #2173

Merged
merged 45 commits into from
May 25, 2023
Merged

Make merkle proofs optional on multisig ISM #2173

merged 45 commits into from
May 25, 2023

Conversation

yorhodes
Copy link
Member

@yorhodes yorhodes commented May 4, 2023

Description

Validators currently sign (root, index) checkpoints and during verification, a message is passed as calldata, an id() is derived, and a proof of id() at index in root is verified

This provides “all or nothing” censorship resistance guarantees because a validator can only sign roots to allow any contained messages to be processed.

We have considered alternatives where validators sign message directly and we lose censorship resistance in exchange for eliminating merkle proof verification gas costs.

However, if validators sign (root, index, message) tuples, we can skip merkle proof verification on the destination chain while still maintaining censorship resistance by providing two valid metadata formats:

  1. existing validator signatures and merkle proof verification of inclusion
  2. including merkle proof verification for pathway where validators are censoring message

It’s worth noting the validator is required to index event data to produce this new signature format. However, this does not require historical indexing and new validators being spun up can simply begin indexing from tip.

See #2187 for validator changes
See #2248 for relayer and e2e test changes

Drive-by changes

Merkle index also optional

Related issues

Backward compatibility

  • new ISM deployment is necessary (we could upgrade implementation in theory)
  • Validator and relayer upgrades

Testing

Unit (fuzz) Tests

@nambrot nambrot mentioned this pull request May 5, 2023
1 task
@yorhodes yorhodes marked this pull request as ready for review May 5, 2023 21:26
@yorhodes yorhodes requested a review from tkporter as a code owner May 5, 2023 21:26
Copy link
Contributor

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Very nice. Haven't looked at tests yet

@yorhodes yorhodes requested a review from asaj May 23, 2023 17:50
Copy link
Contributor

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Skipped the contracts for expediency

rust/agents/relayer/src/msg/metadata/base.rs Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/validator/src/settings.rs Show resolved Hide resolved
typescript/sdk/src/consts/multisigIsm.ts Outdated Show resolved Hide resolved
typescript/sdk/src/ism/HyperlaneIsmFactory.ts Show resolved Hide resolved
typescript/sdk/src/ism/HyperlaneIsmFactory.ts Show resolved Hide resolved
typescript/sdk/src/ism/HyperlaneIsmFactoryDeployer.ts Outdated Show resolved Hide resolved
@yorhodes yorhodes requested a review from asaj May 24, 2023 05:19
Copy link
Contributor

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Reviewed the diff

rust/agents/relayer/src/msg/metadata/base.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/validator/src/submit.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Re-reviewed the contracts, just nits, we're in the home stretch

solidity/contracts/isms/multisig/AbstractMultisigIsm.sol Outdated Show resolved Hide resolved
solidity/contracts/libs/LegacyCheckpointLib.sol Outdated Show resolved Hide resolved
solidity/contracts/libs/LegacyCheckpointLib.sol Outdated Show resolved Hide resolved
solidity/test/isms/MultisigIsm.t.sol Outdated Show resolved Hide resolved
solidity/test/isms/MultisigIsm.t.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@mattiekat mattiekat left a comment

Choose a reason for hiding this comment

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

I just looked at the rust stuff and mostly focused on rust idoms since I think @asaj already looked more at the logic

rust/agents/relayer/Cargo.toml Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/agents/relayer/src/msg/metadata/multisig/base.rs Outdated Show resolved Hide resolved
rust/hyperlane-base/src/types/multisig.rs Show resolved Hide resolved
rust/hyperlane-base/src/types/multisig.rs Outdated Show resolved Hide resolved
rust/hyperlane-base/src/types/multisig.rs Outdated Show resolved Hide resolved
rust/hyperlane-base/src/types/multisig.rs Show resolved Hide resolved
rust/hyperlane-core/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@mattiekat mattiekat left a comment

Choose a reason for hiding this comment

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

I just looked at the rust stuff and mostly focused on rust idioms since I think @asaj already looked more at the logic

@yorhodes yorhodes enabled auto-merge (squash) May 24, 2023 19:14
@yorhodes yorhodes merged commit 50f04db into main May 25, 2023
@yorhodes yorhodes deleted the optional-merkle branch May 25, 2023 14:14
@nambrot nambrot added this to the Death to Merkle Tree milestone Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Death to Merkle Tree
5 participants