Repository navigation
blockstream: make subscription channel size configurable - #91
Merged
sduchesneau merged 2 commits intoNov 4, 2026
Merged
sduchesneau merged 2 commits into
sduchesneau merged 2 commits into
Conversation
The block stream server closed a subscription once 200 blocks were queued for it. A reader catching up after a stall can push more than that in one burst, which drops every connected relayer at the same time. Add ServerOptionWithSubscriptionChannelSize, keeping 200 as the default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The block stream server closed a subscription once 200 blocks were queued for it. A reader catching up after a stall can push more than that in one burst, which drops every connected relayer at the same time. Add ServerOptionWithSubscriptionChannelSize, keeping 200 as the default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
matthewdarwin
added a commit
to pinax-network/firehose-core
that referenced
this pull request
Nov 4, 2026
Drops the temporary replace on the pinax-network fork now that streamingfast/bstream#91 is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
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.
The block stream server closes a subscription once 200 blocks are queued for it (
chanSize := 200inServer.subscribe). This addsServerOptionWithSubscriptionChannelSizeso the server's owner can set that size. The default stays at 200 (DefaultSubscriptionChannelSize), so nothing changes unless the option is passed.How it was found
Setup: a reader-node with
--reader-node-blocks-chan-capacity=20000(a fast chain with small blocks), feeding two relayers on other hosts.What happened:
reach max buffer size for subcription, closing channel {"capacity": 200}for the relayers, and the subscriptions were closed.The reader's own queue can hold 20,000 blocks, but each subscriber could only hold 200 of them, and there was no setting to change that.
Reproduction
firecore from
develop, runningreader-node-stdin+relayerwithreader-node-blocks-chan-capacity: 20000. A second, deliberately slow subscriber (ablockstream.NewSourceclient sleeping 2 ms per block) stands in for a relayer that can't keep up. stdin gets 20 blocks at 4 blocks/s, then 5,000 at once, then 40 more at 4 blocks/s.reach max buffer sizelogscapacity: 200)Tests
TestBlockServerSubscriptionChannelSize: the default, a value below 1 (ignored), and a set size plus the burst.TestBlockServerSubscriptionClosedWhenFull: a subscription holds exactly its size and is closed on the next block.Companion change in firehose-core, which sets the size from the reader's blocks channel capacity: streamingfast/firehose-core#318
🤖 Generated with Claude Code