Repository navigation
feat(sdk-api,express): configurable Argon2id concurrency limit - #10236
Open
mohammadalfaiyazbitgo wants to merge 1 commit into
Open
mohammadalfaiyazbitgo wants to merge 1 commit into
mohammadalfaiyazbitgo wants to merge 1 commit into
Conversation
Limit concurrent Argon2id hashes with a shared FIFO queue (16 running, 500 waiting by default). Callers beyond the waiting limit get AsyncWorkQueueFullError instead of queueing indefinitely. Configure via BitGoAPIOptions.argon2Concurrency in the SDK, or --argon2concurrency / BITGO_ARGON2_CONCURRENCY in Express. Express maps queue-full errors to the existing 500 response rather than an incorrect-password error. TICKET: WCN-4893
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
Contributor
|
|
This branch has not been deployed
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.
What
Adds a shared FIFO limiter around Argon2id hashing in
sdk-api. Default is 16 running hashes and 500 waiting; calls beyond the waiting limit fail fast withAsyncWorkQueueFullError.BitGoAPIOptions.argon2Concurrency(positive safe integer, last explicit value wins across clients in one isolate).--argon2concurrency/BITGO_ARGON2_CONCURRENCY(CLI wins; malformed env fails fast).Bulk-share batching and AES/HKDF-only paths are unchanged.
Memory (default case)
Profiled on Apple M1 Max, 64 GB RAM. Offline mocked burst of 50 concurrent Go Account wallets with real v2 encryption. Whole-process RSS, so these show shape rather than production load.
Idle startup is ~0.7 GB. Each default-cap hash is ~64 MiB of WASM memory, so 16 in flight budgets about 1 GiB. Accepted decrypts can use up to 256 MiB each. Not a total RSS cap, and each process or worker has its own limit.
Test status
sdk-apiunit suite: 295 passing.expressunit suite: 2022 passing (needs a localBITGOJS_TEST_PASSWORD).bitgotest/v2/unit/wallets.ts: 14 failing, not yet resolved. Triaged as stale expectations, Nock request-shape mismatches, an invalid base58 test fixture, and 413 retry behavior the code doesn't implement. I have not yet confirmed these fail on the base commit, so treat them as unverified. Reviewers may want that comparison before merge.TICKET: WCN-4893