Repository navigation
fix(rpc): queue Merkle proof requests instead of refusing them - #164
Merged
Merged
Conversation
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.
fix(rpc): queue Merkle proof requests instead of refusing them
The
privacy_getMerkleProof*RPCs refused any request past 4 in flight, with no queue: a burst of 16 simultaneous requests lost 12, although each proof takes ~2.5 ms and the node could have served all of them in ~10 ms. Every client had to retry around a refusal that should not happen under normal load.What changes (
client/rpc-v2/src/privacy.rs,ProofGate)available_parallelism), automatic. The rest stay free for importing and authoring blocks, GRANDPA, networking and the other RPCs. 4 cores → 2, 16 → 8-32009)blocking, so each request waits on its own blocking thread: stdMutex+Condvar, no new dependency.Measured (dev node, sealed 2^20-leaf tree: the most expensive path; 16 WebSocket connections, 10 cores → 5 slots)
privacy_getMerkleRoot(not gated) answered in ≤ 10 ms, and the node kept authoring blocks, with no errors in the log.Testing
fc-rpc-v2: 44 tests. Clippy-D warningsand fmt clean; the node builds. The gate tests (zero failures over 30 consecutive runs; they use threads) cover:slotsat once;Live regression: e2e spends against the new node, 20/20.
No runtime change: node only.