Skip to content

fix: skip already-aligned accounts during wallet alignment#9269

Open
mathieuartu wants to merge 3 commits into
mainfrom
fix/alignment-traces-scoped
Open

fix: skip already-aligned accounts during wallet alignment#9269
mathieuartu wants to merge 3 commits into
mainfrom
fix/alignment-traces-scoped

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Explanation

References

Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1939

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes core wallet alignment and account creation orchestration, but behavior is narrowed (less work, same end goal) and is covered by expanded alignment tests.

Overview
Wallet alignment no longer calls createAccounts for every provider across the full group index range. It now derives per-provider contiguous sub-ranges of missing (provider, group index) pairs and only invokes providers for those gaps; fully aligned providers are skipped entirely.

MultichainAccountGroup gains isProviderAligned(provider), and isAligned() delegates to it. Shared group-state building is refactored from #buildGroupStateForRange to #buildGroupState with a getSubRanges callback: creation still passes the full [from, to] range; alignment uses #getUnalignedSubRangesForProvider (missing groups count as unaligned). Tests cover partial gaps, skipping aligned providers, and non-contiguous missing indices; the changelog documents the fix.

Reviewed by Cursor Bugbot for commit 7d30943. Bugbot is set up for automated code reviews on this repo. Configure here.

@mathieuartu mathieuartu self-assigned this Jun 25, 2026
@mathieuartu mathieuartu requested review from a team as code owners June 25, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant