feat(host-rpc): add backpressure controls to notifier#123
Merged
Conversation
Bound concurrent RPC block fetches with configurable max_rpc_concurrency (default 8) and coalesce stale subscription headers via Latest<S> stream adapter to prevent slow-consumer backlog buildup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fraser999
approved these changes
Mar 30, 2026
Contributor
Fraser999
left a comment
There was a problem hiding this comment.
Non-blocking nitpicks only.
| /// Set the maximum number of concurrent RPC block fetches (default: 8). | ||
| /// | ||
| /// Values below 1 are clamped to 1. | ||
| pub const fn with_max_rpc_concurrency(mut self, max_rpc_concurrency: usize) -> Self { |
Contributor
There was a problem hiding this comment.
We could add with_max_rpc_concurrency to the doc example above here.
Also, we clamp here, but not in with_backfill_batch_size or with_buffer_capacity which is a bit inconsistent.
…mple Add consistent minimum-value clamping (to 1) for buffer_capacity and backfill_batch_size to match max_rpc_concurrency. Add the missing with_max_rpc_concurrency call to the builder doc example. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds backpressure controls to
RpcHostNotifierto prevent unbounded RPC fan-out and stale header processing. Closes ENG-2104.FuturesOrderedwithstream::buffered(max_rpc_concurrency)(default 8, configurable viaSIGNET_HOST_MAX_RPC_CONCURRENCY)Latest<S>stream adapter drains buffered subscription headers and yields only the most recent, discarding stale intermediateshost_rpc.headers_coalescedcounter tracks skipped headersTest plan
Latest<S>pass (cargo t -p signet-host-rpc)headers_coalescedmetric under load to confirm coalescing behavior🤖 Generated with Claude Code