Skip to content

perf(multichain-account-service): add Solana account batching#8131

Open
ccharly wants to merge 4 commits intomainfrom
cc/feat/solana-batch-accounts
Open

perf(multichain-account-service): add Solana account batching#8131
ccharly wants to merge 4 commits intomainfrom
cc/feat/solana-batch-accounts

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Mar 6, 2026

Explanation

Implementing proper batching for our Solana account provider.

References

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 Snap-based account creation paths for Solana/Bitcoin/Tron, including new batching behavior and a new createAccounts call into the Snap keyring; bugs here could create wrong accounts or impact discovery/alignment flows.

Overview
Adds an optional batched account-creation path for Snap-based providers (Solana/Bitcoin/Tron). Providers now support a createAccounts.v2 config flag that switches createAccounts (single and range) from repeated createAccount calls to a single SnapKeyring.createAccounts call, while keeping v1 behavior as the default.

Refactors provider internals and tests to cover v1 vs v2 behavior. SnapAccountProvider’s restricted keyring interface now exposes createAccounts, discovery flows route through the unified creation helper, and unit tests add mocks plus assertions for idempotency, range handling, and timeout behavior under both versions; changelog is updated to note Solana range batching.

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

@ccharly ccharly changed the title feat(multichain-account-service): add Solana account batching perf(multichain-account-service): add Solana account batching Mar 6, 2026
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch from 8f805c8 to 6d1259e Compare March 6, 2026 10:58
@ccharly ccharly force-pushed the cc/feat/backup-and-sync-batch branch 5 times, most recently from 716a57a to 16a70a6 Compare March 9, 2026 17:12
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch from 6d1259e to 99d0aa2 Compare March 9, 2026 17:17
@ccharly ccharly marked this pull request as ready for review March 9, 2026 17:17
@ccharly ccharly requested review from a team as code owners March 9, 2026 17:17
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch 2 times, most recently from 18c070d to 05ecd6a Compare March 9, 2026 18:18
@ccharly ccharly force-pushed the cc/feat/backup-and-sync-batch branch from 25d09e4 to 957ea19 Compare March 10, 2026 09:35
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch 2 times, most recently from 6fd4e76 to fb482ca Compare March 10, 2026 14:43
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch from fb482ca to 20605ec Compare March 10, 2026 15:32
@ccharly ccharly force-pushed the cc/feat/backup-and-sync-batch branch from 957ea19 to 222e1eb Compare March 12, 2026 08:56
Base automatically changed from cc/feat/backup-and-sync-batch to main March 12, 2026 13:01
@ccharly ccharly force-pushed the cc/feat/solana-batch-accounts branch from 20605ec to 4feb6e9 Compare March 12, 2026 17:13
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

this.accounts.add(snapAccount.id);
accounts.push(snapAccount);
}
return accounts;
Copy link

Choose a reason for hiding this comment

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

Near-identical #createAccounts duplicated across BTC and TRX providers

Low Severity

BtcAccountProvider.#createAccounts and TrxAccountProvider.#createAccounts are ~70-line methods that are structurally identical — the only differences are addressType (BtcAccountType.P2wpkh vs TrxAccountType.Eoa) and scope (BtcScope.Mainnet vs TrxScope.Mainnet). This PR expanded the prior ~10-line duplication to ~70 lines each by adding the v1/v2 branching logic. This substantially increases the maintenance burden and the risk that a future bug fix is applied to one but not the other.

Additional Locations (1)
Fix in Cursor Fix in Web

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant