Skip to content

feat(core): batch set/remove on DomainRoutingIsm#8655

Draft
paulbalaji wants to merge 1 commit intomainfrom
pbio/routing-ism-batch-ops
Draft

feat(core): batch set/remove on DomainRoutingIsm#8655
paulbalaji wants to merge 1 commit intomainfrom
pbio/routing-ism-batch-ops

Conversation

@paulbalaji
Copy link
Copy Markdown
Collaborator

@paulbalaji paulbalaji commented Apr 22, 2026

Summary

Adds setBatch(DomainModule[]) and removeBatch(uint32[]) to DomainRoutingIsm so routing ISM owners can enroll or unenroll many domains in a single tx after initialization. Mirrors the setHooks(HookConfig[]) pattern on DomainRoutingHook.

Why

Today the only way to enroll many domains in a single tx is the initialize(address,uint32[],address[]) initializer, which can only be called once. Post-init, HyperlaneIsmFactory loops set() one domain at a time (see #8583, which had to shard the initializer itself to stay under block gas limits on citrea / shibarium / etc.). A follow-on batch setter lets the SDK keep shard sizes tight without eating N txs per deploy.

Applies to all routing ISMs (via inheritance)

  • DomainRoutingIsm.setBatch(...) — upsert-many (standard behavior).
  • IncrementalDomainRoutingIsm.setBatch(...)batch-add-many. The _set override at IncrementalDomainRoutingIsm.sol:22 rejects any domain that already exists, so batched calls on incremental ISMs are effectively batch-adds (any duplicate in the batch reverts the whole tx).
  • DefaultFallbackRoutingIsm.setBatch(...) — inherits upsert-many unchanged.
  • removeBatch reverts on incremental (covered by a test), matching its single-domain remove.

Design (minimal)

Trimmed from the fuller #5219. Keeps the surface deliberately small:

  • setBatch(DomainModule[]) — upsert (or batch-add on incremental, via inheritance)
  • removeBatch(uint32[]) — remove many
  • DomainModule struct (mirrors hook's HookConfig)

Dropped from #5219: the separate add / addBatch function selectors (motivated by role-based ACL on an AccessManager — orthogonal to the batching behavior itself; can be added later if that use case lands), and ModuleSet / ModuleRemoved events (DomainRoutingHook doesn't emit equivalents — can add symmetrically on both sides later if needed).

Test plan

Adds setBatch(DomainModule[]) and removeBatch(uint32[]) so routing ISM
owners can enroll or unenroll many domains in a single tx after
initialization. Mirrors the setHooks(HookConfig[]) pattern on
DomainRoutingHook. Inherited by IncrementalDomainRoutingIsm (removeBatch
reverts, consistent with remove) and DefaultFallbackRoutingIsm.
@paulbalaji paulbalaji force-pushed the pbio/routing-ism-batch-ops branch from 223a896 to 38d81ab Compare April 22, 2026 17:20
@paulbalaji paulbalaji changed the title feat(core): batch set/add/remove on DomainRoutingIsm feat(core): setBatch/removeBatch on DomainRoutingIsm Apr 22, 2026
@paulbalaji paulbalaji changed the title feat(core): setBatch/removeBatch on DomainRoutingIsm feat(core): batch set/remove on DomainRoutingIsm Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.36%. Comparing base (f6d797b) to head (38d81ab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8655      +/-   ##
==========================================
+ Coverage   79.33%   79.36%   +0.02%     
==========================================
  Files         143      143              
  Lines        4278     4284       +6     
  Branches      436      436              
==========================================
+ Hits         3394     3400       +6     
  Misses        855      855              
  Partials       29       29              
Flag Coverage Δ
solidity 80.62% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 87.80% <ø> (ø)
hooks 78.11% <ø> (ø)
isms 81.71% <100.00%> (+0.25%) ⬆️
token 88.00% <ø> (ø)
middlewares 87.76% <ø> (ø)
🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant