Decrypt completed sync transactions outside mNxsMutex - #358
Open
jolavillette wants to merge 1 commit into
Open
Conversation
processTransactions() ran processTransactionForDecryption() -- per-item circle RSA decryption of completed incoming transactions -- while holding mNxsMutex. On channels with circle-restricted groups this was measured at 1-3 s of pure RSA per sync cycle (2026 ms of a 2028 ms pass, ~225 s accumulated over a 73-minute session), blocking every other user of the service (tick, item reception, API) for the whole duration. Take the completed transactions out of the active map under the mutex, decrypt them after it is released -- the thread is their only owner at that point -- and re-take it only to queue them into mComplTransactions. Behavior is otherwise unchanged: processTransactionForDecryption() replaces encrypted items in place and always returns true nowadays; items whose keys are unavailable stay encrypted and are dropped at validation, as before. Co-Authored-By: Claude Fable 5 <[email protected]>
jolavillette
force-pushed
the
fix/gxs-transaction-decrypt-nofreeze
branch
from
August 6, 2026 23:17
5359e46 to
33ed4d6
Compare
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.
processTransactions() ran processTransactionForDecryption() — per-item circle RSA decryption of completed incoming transactions — while holding mNxsMutex. On a node subscribed to circle-restricted channels this was measured at 1–3 s of RSA per sync cycle (about 225 s accumulated over a 73-minute session), blocking every other user of the service (tick, item reception, API) for the duration.
Completed transactions now leave the active map under the mutex, are decrypted after it is released — the thread is their sole owner at that point — and are queued into mComplTransactions under a brief relock. Behavior is otherwise unchanged: items whose keys are unavailable stay encrypted and are dropped at validation, as before.
🤖 Generated with Claude Code