Repository navigation
Receive and send gRPC responses up to 2 GiB - #37
Merged
Merged
Conversation
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
marked this pull request as ready for review
September 17, 2026 15:06
UlysseCorbeil
approved these changes
Sep 17, 2026
| // 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) |
There was a problem hiding this comment.
grpc side : defaultServerMaxSendMessageSize -> math.MaxInt32 = 2147483647
min(210241024*1024, math.MaxInt) = 2147483648
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.
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)`.