feat: Add AggregationISM to hyperlane-cosmos#152
feat: Add AggregationISM to hyperlane-cosmos#152jonas089 wants to merge 5 commits intobcp-innovations:mainfrom
Conversation
|
Thanks for your PR. Why are you removing all the "Arrange", "Act" and "Assert" comments from the test files? Can you please make sure that CI passes. You can also run |
e0d5781 to
1a81626
Compare
|
@mbreithecker I re-added the comments. Removed them because I thought they were not very useful, but I understand that you want to keep them. Working on CI now. |
There was a problem hiding this comment.
Pull request overview
This PR implements AggregationISM for the hyperlane-cosmos module, enabling M-of-N verification by composing multiple existing ISMs. The implementation validates messages when a configurable threshold of child ISMs successfully verify them.
Changes:
- Added AggregationISM type with threshold-based verification and ownership management
- Implemented keeper methods for creating and updating aggregation ISMs
- Added comprehensive validation and testing for edge cases and nested aggregation
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| x/core/01_interchain_security/types/types.pb.go | Generated protobuf code for AggregationISM type definition |
| x/core/01_interchain_security/types/msg_aggregation.go | Message validation for aggregation ISM operations |
| x/core/01_interchain_security/types/events.pb.go | Generated event definitions for aggregation ISM lifecycle |
| x/core/01_interchain_security/types/errors.go | New error types for aggregation validation |
| x/core/01_interchain_security/types/codec.go | Interface registration for aggregation messages and types |
| x/core/01_interchain_security/types/aggregation_ism_test.go | Unit tests for validation logic |
| x/core/01_interchain_security/types/aggregation_ism.go | Core aggregation ISM implementation with validation |
| x/core/01_interchain_security/keeper/msg_server_test.go | Integration tests for message handlers |
| x/core/01_interchain_security/keeper/msg_server.go | Keeper methods for aggregation ISM CRUD operations |
| x/core/01_interchain_security/keeper/keeper.go | Handler registration for aggregation ISM |
| x/core/01_interchain_security/keeper/genesis.go | Genesis state handling for aggregation ISMs |
| x/core/01_interchain_security/keeper/aggregation_ism_handler_test.go | Verification logic tests including nested aggregation |
| x/core/01_interchain_security/keeper/aggregation_ism_handler.go | Aggregation verification handler with early exit optimization |
| tests/integration/mock.go | Enhanced mock ISM to support pass/fail states |
| proto/hyperlane/core/interchain_security/v1/types.proto | Protobuf schema for AggregationISM |
| proto/hyperlane/core/interchain_security/v1/tx.proto | Protobuf definitions for aggregation messages |
| proto/hyperlane/core/interchain_security/v1/events.proto | Event schemas for aggregation ISM operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "bytes" | ||
| "context" | ||
|
|
||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
|
||
| "cosmossdk.io/errors" | ||
|
|
||
| "cosmossdk.io/collections" | ||
|
|
||
| "github.com/bcp-innovations/hyperlane-cosmos/util" | ||
| "cosmossdk.io/errors" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| "github.com/ethereum/go-ethereum/crypto" | ||
|
|
||
| "github.com/bcp-innovations/hyperlane-cosmos/util" | ||
| "github.com/bcp-innovations/hyperlane-cosmos/x/core/01_interchain_security/types" |
There was a problem hiding this comment.
The 'bytes' and 'crypto' imports at lines 4 and 10 may no longer be necessary. These imports were likely used in the original code before the refactoring that extracted validateOwnershipTransfer and validateModulesExist. Consider removing unused imports to improve code maintainability.
2cc3770 to
a6e122f
Compare
This PR introduces a full implementation of AggregationISM for the
hyperlane-cosmosmodule.AggregationISM allows composing multiple existing ISMs and enforcing an M-of-N verification policy. Message verification succeeds only if at least
thresholdchild ISMs successfully verify the message.New ISM type
AggregationISMwith on-chain storage, validation, and routingVerification logic
Verify()on each configured child ISM via the core keeperState & ownership management
Messages & events
MsgCreateAggregationIsmMsgSetAggregationIsmModulesMsgUpdateAggregationIsmOwnerValidation
Tests