fix: support comma-separated NEW_CHAIN without duplicating cross-new-chain edges#538
Merged
ravinagill15 merged 3 commits intomainfrom Apr 29, 2026
Merged
fix: support comma-separated NEW_CHAIN without duplicating cross-new-chain edges#538ravinagill15 merged 3 commits intomainfrom
ravinagill15 merged 3 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: a538843 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
08bc1f3 to
a99e2a0
Compare
clauBv23
reviewed
Apr 28, 2026
clauBv23
reviewed
Apr 28, 2026
clauBv23
reviewed
Apr 28, 2026
Contributor
|
fixed the comments in #544, let me know it you agree and feel free to adjust anything @ravinagill15 skipped the new tests since they use rpcs, tested them locally, and all green |
…chain edges NEW_CHAIN now accepts a comma-separated list. When multiple new chains are specified, each directed edge (A→B) is kept exactly once if either endpoint is a new chain — including edges between new chains, which previously could be emitted twice by callers iterating per-chain. - getNewChain/getNewChainEid → getNewChains/getNewChainEids (array/Set) - filterConnections uses set-membership filtering - All builders (messaging, asset, feelib, rewarder, staking, treasurer, oft-wrapper) accept a list of new chains - Added multi-chain test coverage across all config test suites Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
b9551b6 to
a538843
Compare
clauBv23
approved these changes
Apr 28, 2026
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
Fixes a bug introduced alongside #514 where configuring more than one new chain at a time (e.g.
NEW_CHAIN='subtensorevm-mainnet,ault-mainnet') produced 58 duplicate transactions in the OneSig bundle between the two new chains.What was happening
getNewChain()returned the raw comma-separated string.getNewChainEid()tried to resolve the whole string as a single chain name → threw (or, in the iterate-per-chain variant, emitted each cross-new-chain edge once per run).filterConnectionsfiltered on a singlenewChainEid, so edges between two new chains could be kept under both chains' filter passes when callers iterated manually.What this PR does
getNewChain→getNewChains(): string[](splits on,, trims, drops empties).getNewChainEid→getNewChainEids(): Set<EndpointId>— aSet, so edges get kept at most once.filterConnectionsnow uses set-membership filtering. Each directed edgeA→Bis emitted exactly once if either endpoint is a new chain, whether or not both endpoints are new.Single-chain behavior is unchanged.
Test plan
pnpm test:hardhat— 300 passing (up from 295, including 5 new multi-chain tests)NEW_CHAIN='subtensorevm-mainnet,ault-mainnet' make configure-mainnetand confirm the OneSig bundle no longer flags duplicate transactions🤖 Generated with Claude Code