Skip to content

feat: MinimalInterchainAccountRouter for Igra#8323

Merged
paulbalaji merged 18 commits intomainfrom
pb/igra-slim-ica
Mar 18, 2026
Merged

feat: MinimalInterchainAccountRouter for Igra#8323
paulbalaji merged 18 commits intomainfrom
pb/igra-slim-ica

Conversation

@paulbalaji
Copy link
Copy Markdown
Collaborator

@paulbalaji paulbalaji commented Mar 11, 2026

Summary

Igra (Kaspa L2/EVM) has a 100k storage mass limit per L1 transaction. The full InterchainAccountRouter deployment exceeds this (~147k storage mass, ~36KB initcode). This PR adds a stripped-down MinimalInterchainAccountRouter that fits under the limit and wires it through the SDK/infra with explicit config-driven selection.

Changes

Solidity

  • MinimalInterchainAccountRouter.sol — New contract that removes commit-reveal, unused overloads, CommitmentReadIsm, CCIP_READ_ISM immutable, and receive(). Constructor takes 3 args (mailbox, hook, owner) instead of 5. Account derivation (salt, CREATE2) is identical to the full router — ICAs are interoperable.

SDK

  • types.ts — Added IcaRouterType enum ('regular' | 'minimal'). Optional routerType field on IcaRouterConfigSchema — defaults to regular when omitted.
  • InterchainAccountDeployer.ts — Selects router variant based on routerType. Validates config consistency: regular requires commitmentIsm, minimal rejects it. Uses deployContractFromFactory with manual writeCache (keyed as minimalInterchainAccountRouter) for crash recovery. Minimal deployments verify as MinimalInterchainAccountRouter.
  • EvmIcaReader.ts — Derives routerType from on-chain state (CCIP_READ_ISM present → regular, absent → minimal).
  • EvmIsmReader.ts — After CCIP_READ_ISM() fails, falls back to implementation() probe to detect minimal ICA routers as INTERCHAIN_ACCOUNT_ROUTING.
  • contracts.ts — Removed unused minimalInterchainAccountFactories.

Infra

  • chain.tsminimalIcaChains: ['igra'] list.
  • deploy.ts / check-utils.ts — Minimal chains get explicit routerType: MINIMAL; all others omit it (defaults to regular).
  • verification.json — Fixed igra entry name to MinimalInterchainAccountRouter.

Tests

  • Forge — Extracted shared test suite (InterchainAccountRouterSharedTest) with 20 tests covering enrollment, callRemoteWithOverrides, ISM routing, ICA accounts, value send/receive, and salts. Both InterchainAccountRouterTest and MinimalInterchainAccountRouterTest inherit it via _deployRouter override — no test duplication.
  • Hardhat — Minimal deploy path, config validation (minimal + commitmentIsm rejected, regular without commitmentIsm rejected), and full e2e call-forwarding via minimal router.

Driveby

  • .github/workflows/test-env.yml — Increased job timeout-minutes from 10 to 30. The retry action allows 3 attempts × 8min + wait time, which could exceed the previous 10min job timeout.

Other

  • AGENTS.md — Fixed pnpm prettierpnpm format.
  • package.json — Added "prettier" script alias.

Test plan

  • Forge: 99 tests pass (59 full router + 20 shared via minimal + 20 shared via full)
  • Hardhat: 428 tests pass (including 4 new minimal router tests)
  • SDK unit: 384 tests pass
  • pnpm build passes
  • pnpm lint passes
  • Contract verified on Igra Blockscout

🤖 Generated with Claude Code


Note

Medium Risk
Adds a new ICA router contract variant and changes deployment/config/detection paths across Solidity, SDK, and infra; misconfiguration or selector/interface mismatches could affect ICA deployments on targeted chains.

Overview
Adds a new size-reduced MinimalInterchainAccountRouter Solidity contract (no commit-reveal / CommitmentReadIsm subdeployment) and factors shared ICA router logic into AbstractInterchainAccountRouter, with InterchainAccountRouter updated to inherit from it.

Updates the TypeScript SDK and infra to select, deploy, and detect the minimal vs regular router via a new IcaRouterType/routerType config field, including stricter config validation in InterchainAccountDeployer and on-chain detection in EvmIcaReader/EvmIsmReader.

Adds/adjusts tests to run the shared ICA test suite against both router variants (new Forge test for minimal) and extends Hardhat tests for minimal deployment and config validation; infra config marks igra as a minimal-router chain and updates verification metadata.

Written by Cursor Bugbot for commit 456b465. This will update automatically on new commits. Configure here.


Open with Devin

Summary by CodeRabbit

  • New Features

    • Adds a lightweight MinimalInterchainAccountRouter option and SDK support for detecting/handling router types (REGULAR vs MINIMAL).
  • Tests

    • Expanded test coverage for minimal-router deployment, routing, fee behaviors, and compatibility with existing ICA scenarios.
  • Chores

    • Infra now emits minimal-router configs; added minimal-chain listing and an npm script alias for formatting.
  • Documentation

    • Updated quick-reference formatting command in contributor guidance.

@github-project-automation github-project-automation Bot moved this to In Review in Hyperlane Tasks Mar 11, 2026
@paulbalaji paulbalaji changed the title Add MinimalInterchainAccountRouter for Igra deployment feat: MinimalInterchainAccountRouter Mar 11, 2026
@paulbalaji paulbalaji changed the title feat: MinimalInterchainAccountRouter feat: MinimalInterchainAccountRouter for Igra Mar 11, 2026
github-advanced-security[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

Base automatically changed from pb/igra to main March 12, 2026 14:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 93.82716% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.79%. Comparing base (a6b7bf3) to head (456b465).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8323      +/-   ##
==========================================
+ Coverage   76.49%   76.79%   +0.30%     
==========================================
  Files         128      130       +2     
  Lines        3416     3443      +27     
  Branches      290      291       +1     
==========================================
+ Hits         2613     2644      +31     
+ Misses        786      782       -4     
  Partials       17       17              
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 74.55% <ø> (ø)
isms 81.46% <ø> (ø)
token 87.33% <ø> (ø)
middlewares 87.87% <93.82%> (+2.40%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ize limits

Stripped-down InterchainAccountRouter that removes commit-reveal functionality,
unused function overloads, and the CommitmentReadIsm sub-deployment. Reduces
initcode from 35,996 to 19,256 bytes (~46.5% reduction) to fit under Igra's
100k storage mass limit per L1 transaction.
Made commitmentIsm optional in IcaRouterConfigSchema. When omitted, the
deployer uses MinimalInterchainAccountRouter (3 constructor args) instead
of the full InterchainAccountRouter (5 args). EvmIcaReader gracefully
handles missing CCIP_READ_ISM. Infra deploy and check-deploy skip
commitmentIsm config for chains in minimalIcaChains (igra).
Extract shared tests (enrollment, callRemoteWithOverrides, ISM routing,
ICA accounts, value send/receive, salts) into InterchainAccountRouterSharedTest.
MinimalInterchainAccountRouter.t.sol now inherits it, overriding only _deployRouter.
…ection

implementation() is too broad — DomainRoutingIsm and upgradeable proxies
also expose it, causing false positives. bytecodeHash() is unique to ICA routers.
The retry action allows 3 attempts × 8min + wait time, which can
exceed the previous 10min job timeout.
@paulbalaji
Copy link
Copy Markdown
Collaborator Author

@claude security review pls

@claude

This comment was marked as resolved.

@claude

This comment was marked as resolved.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 17, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8bef1770-995a-4a21-aea1-4956195a8f61

📥 Commits

Reviewing files that changed from the base of the PR and between b25ebb3 and 456b465.

📒 Files selected for processing (1)
  • typescript/sdk/src/ism/EvmIsmReader.test.ts

📝 Walkthrough

Walkthrough

This PR adds a MinimalInterchainAccountRouter and AbstractInterchainAccountRouter, updates SDK types/readers to detect MINIMAL vs REGULAR routers, adapts infra/deploy/check scripts and configs for minimal chains, and adds tests and changesets to support minimal ICA deployments.

Changes

Cohort / File(s) Summary
Changesets
\.changeset/slim-ica-core.md, \.changeset/slim-ica-router-type.md
Add changeset entries bumping @hyperlane-xyz/core and @hyperlane-xyz/sdk documenting MinimalInterchainAccountRouter support.
Docs & Scripts
AGENTS.md, package.json
Replace prettier mentions with format in docs and add prettier npm script aliasing turbo run format.
Solidity: Minimal Router
solidity/contracts/middleware/MinimalInterchainAccountRouter.sol
Add compact MinimalInterchainAccountRouter implementing handle/route, Create2 deployment of ICA implementations, and minimal multicall-only execution flow.
Solidity: Abstract Base
solidity/contracts/middleware/AbstractInterchainAccountRouter.sol
Introduce abstract base with deterministic Create2 hosting, implementation/bytecode hash, ISM mappings, enrollment APIs, account deployment helpers, events, and dispatch plumbing.
Solidity: Router Refactor
solidity/contracts/middleware/InterchainAccountRouter.sol
Rebase InterchainAccountRouter to inherit from abstract base; move deployment/derivation logic into base and update public signatures/overrides.
Solidity Tests
solidity/test/InterchainAccountRouter.t.sol, solidity/test/MinimalInterchainAccountRouter.t.sol
Make deployIcaRouter virtual in test base; add MinimalInterchainAccountRouterTest adapter and refactor/add tests to exercise minimal-router behavior and shared ICA flows.
Infra: Chain Config & Verification
typescript/infra/src/config/chain.ts, typescript/infra/config/environments/mainnet3/middleware/accounts/verification.json
Export minimalIcaChains (includes igra) and add verification entry for MinimalInterchainAccountRouter on mainnet3.
Infra Scripts
typescript/infra/scripts/deploy.ts, typescript/infra/scripts/check/check-utils.ts
Detect minimal chains via minimalIcaChains.includes(chain) and emit routerType: IcaRouterType.MINIMAL for those chains; preserve commitmentIsm only for regular routers.
SDK Types & Readers
typescript/sdk/src/ica/types.ts, typescript/sdk/src/ica/EvmIcaReader.ts, typescript/sdk/src/ism/EvmIsmReader.ts, typescript/sdk/src/index.ts
Add IcaRouterType enum (REGULAR/MINIMAL), make commitmentIsm optional, detect router type at runtime (CCIP_READ_ISM / bytecodeHash), and surface routerType in derived configs.
SDK Middleware & Tests
typescript/sdk/src/middleware/account/InterchainAccountDeployer.ts, typescript/sdk/src/middleware/account/accounts.hardhat-test.ts
Conditionally deploy MinimalInterchainAccountRouter for MINIMAL routerType, enforce commitmentIsm rules per routerType, and add tests verifying deployment and call forwarding.
TypeScript Utility
typescript/infra/scripts/check/check-utils.ts
Add imports/logic for minimalIcaChains and conditional router config handling for minimal chains.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Router as MinimalICA Router
    participant Mailbox as Mailbox
    participant ISM as ISM
    participant RemoteAccount as Remote ICA
    participant Target as Target Contract

    User->>Router: callRemoteWithOverrides(dest, calls, metadata)
    Router->>Mailbox: dispatch(destination, body, hook, metadata)
    Mailbox->>ISM: verify message
    ISM-->>Mailbox: verification result
    Mailbox-->>Router: mailbox callback / delivery
    Router->>Router: derive salt & getDeployedInterchainAccount (Create2 if needed)
    Router->>RemoteAccount: execute multicall(calls) payable
    RemoteAccount->>Target: perform calls
    Target-->>RemoteAccount: return results
    RemoteAccount-->>Router: execution result
    Router-->>User: return dispatch/receipt
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

Small router sneaks where giants fail,
Salt and Create2 set the trail.
Messages cross with quiet pride,
Minimal in weight, big on stride.
Works like a charm — now let it ride.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat: MinimalInterchainAccountRouter for Igra' accurately and specifically describes the main change: introducing a new minimal router variant designed for the Igra chain.
Description check ✅ Passed The PR description is comprehensive and well-structured. It includes a clear summary explaining the motivation (100k storage mass limit), detailed breakdown of changes across Solidity/SDK/Infra/Tests, test results, and backward compatibility notes. All required template sections are addressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pb/igra-slim-ica
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Reverted CCIP_READ_ISM catch to bare catch block, consistent with
EvmIsmReader and EvmHookReader contract-probing patterns. Added missing
CAST comment for the double-cast in InterchainAccountDeployer.
cursor[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Hooks like IGP and ProtocolFee refund overpayment to message.senderAddress()
which resolves to the router contract. Without receive(), the refund
sendValue() call reverts, causing dispatches with native value to fail.
coderabbitai[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

…rrors

Extracted isIcaRouter() helper in EvmIsmReader to eliminate duplicated
CCIP_READ_ISM/bytecodeHash probe logic. Added solhint-disable comments
for intentional virtual override in AbstractInterchainAccountRouter.
coderabbitai[bot]

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

…d code

The second isIcaRouter call was unreachable after the early return from
the first. Now calls once, stores the result, and flows through to
populate the domain→ISM mapping for ownable ICA routers.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Stub Ownable__factory and fix DefaultFallbackRoutingIsm domains() mock
to return empty array instead of rejecting, since the refactored code
now flows through owner/domains checks before the ICA branch.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 14 additional findings in Devin Review.

Open in Devin Review

Comment thread typescript/sdk/src/middleware/account/InterchainAccountDeployer.ts
Comment thread typescript/sdk/src/ica/EvmIcaReader.ts
Copy link
Copy Markdown
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

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


2026-03-17T19:29:53.8590991Z Detected bytecode changes:
2026-03-17T19:29:53.8591947Z Only in solidity/HEAD-bytecode: MinimalInterchainAccountRouter-bytecode.txt
2026-03-17T19:29:53.8592685Z 
2026-03-17T19:29:53.8661735Z Bytecode changes detected.
2026-03-17T19:29:53.8662032Z 
2026-03-17T19:29:53.8882410Z Found @hyperlane-xyz/core changeset with 'minor' bump (required: patch or higher)
2026-03-17T19:29:53.8883466Z 
2026-03-17T19:29:53.8884010Z Bytecode changes are permitted with the existing changeset.

LGTM, ICA router bytecode unchanged

@paulbalaji paulbalaji added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 6c715a7 Mar 18, 2026
103 checks passed
@paulbalaji paulbalaji deleted the pb/igra-slim-ica branch March 18, 2026 13:22
@github-project-automation github-project-automation Bot moved this from In Review to Done in Hyperlane Tasks Mar 18, 2026
paulbalaji added a commit that referenced this pull request Mar 18, 2026
Cherry-picked solidity changes from 6c715a7 (#8323):
- Extract AbstractInterchainAccountRouter base contract
- Add MinimalInterchainAccountRouter for Igra
- Refactor InterchainAccountRouter to extend abstract base
- Update and add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants