feat(core): batch set/remove on DomainRoutingIsm#8655
Draft
paulbalaji wants to merge 1 commit intomainfrom
Draft
feat(core): batch set/remove on DomainRoutingIsm#8655paulbalaji wants to merge 1 commit intomainfrom
paulbalaji wants to merge 1 commit intomainfrom
Conversation
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.
223a896 to
38d81ab
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
setBatch(DomainModule[])andremoveBatch(uint32[])toDomainRoutingIsmso routing ISM owners can enroll or unenroll many domains in a single tx after initialization. Mirrors thesetHooks(HookConfig[])pattern onDomainRoutingHook.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,HyperlaneIsmFactoryloopsset()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_setoverride atIncrementalDomainRoutingIsm.sol:22rejects 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.removeBatchreverts on incremental (covered by a test), matching its single-domainremove.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 manyDomainModulestruct (mirrors hook'sHookConfig)Dropped from #5219: the separate
add/addBatchfunction selectors (motivated by role-based ACL on an AccessManager — orthogonal to the batching behavior itself; can be added later if that use case lands), andModuleSet/ModuleRemovedevents (DomainRoutingHookdoesn't emit equivalents — can add symmetrically on both sides later if needed).Test plan
forge test --match-contract "DomainRoutingIsmTest|DefaultFallbackRoutingIsmTest|IncrementalDomainRoutingIsmTest"— 41 passed across all three suites