perf(multichain-account-service): add Solana account batching#8131
perf(multichain-account-service): add Solana account batching#8131
Conversation
8f805c8 to
6d1259e
Compare
716a57a to
16a70a6
Compare
6d1259e to
99d0aa2
Compare
packages/multichain-account-service/src/providers/SolAccountProvider.ts
Outdated
Show resolved
Hide resolved
18c070d to
05ecd6a
Compare
25d09e4 to
957ea19
Compare
6fd4e76 to
fb482ca
Compare
packages/multichain-account-service/src/providers/SolAccountProvider.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/providers/SnapAccountProvider.ts
Outdated
Show resolved
Hide resolved
fb482ca to
20605ec
Compare
957ea19 to
222e1eb
Compare
20605ec to
4feb6e9
Compare
packages/multichain-account-service/src/providers/SolAccountProvider.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.


Explanation
Implementing proper batching for our Solana account provider.
References
:createMultichainAccountGroupsaction to batch account creation #7801Checklist
Note
Medium Risk
Changes core Snap-based account creation paths for Solana/Bitcoin/Tron, including new batching behavior and a new
createAccountscall 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.v2config flag that switchescreateAccounts(single and range) from repeatedcreateAccountcalls to a singleSnapKeyring.createAccountscall, while keeping v1 behavior as the default.Refactors provider internals and tests to cover v1 vs v2 behavior.
SnapAccountProvider’s restricted keyring interface now exposescreateAccounts, 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.