Skip to content

Receive and send gRPC responses up to 2 GiB - #37

Merged
sduchesneau merged 4 commits into
developfrom
feature/large-block-messages
Sep 17, 2026
Merged

sduchesneau merged 4 commits into
developfrom
feature/large-block-messages

Conversation

@sduchesneau

@sduchesneau sduchesneau commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Clients from `NewClientConn` now receive messages up to `dgrpc.MaxResponseSize` (2 GiB) instead of 1 GiB. Standard servers send up to the same size, which is one byte more than the grpc-go default.

Firehose blocks travel in responses, from the reader to the relayer, to Firehose and Substreams, and to clients, so they can now be up to 2 GiB with their message. Request limits (client send, server receive) are unchanged: requests are small, and a larger server receive limit lets a small compressed request expand to that size in server memory.

Tested between a standard server and `NewInternalClient`: a response of 2 GiB minus 64 bytes goes through, and one of 2 GiB + 1 byte fails with `trying to send message larger than max (2147483661 vs. 2147483648)`.

Firehose blocks can reach 3 GiB. Clients received at most 1 GiB and servers sent at
most 2 GiB. Server receive limits stay as they are since requests are small.
Requests are small, only responses carry blocks.
@sduchesneau sduchesneau changed the title Send and receive gRPC messages up to 3.5 GiB Receive and send gRPC responses up to 2 GiB Sep 17, 2026
@sduchesneau
sduchesneau marked this pull request as ready for review September 17, 2026 15:06
Comment thread client.go Outdated
// MaxResponseSize is the largest gRPC response message in bytes that clients created by this
// package receive and that servers created by this package send. Requests keep the gRPC
// limits, they are expected to be small.
const MaxResponseSize = min(2*1024*1024*1024, math.MaxInt)

@UlysseCorbeil UlysseCorbeil Sep 17, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc side : defaultServerMaxSendMessageSize -> math.MaxInt32 = 2147483647
min(210241024*1024, math.MaxInt) = 2147483648

@sduchesneau
sduchesneau merged commit 85358c5 into develop Sep 17, 2026
3 checks passed
@sduchesneau
sduchesneau deleted the feature/large-block-messages branch September 17, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants