Extract streaming protocol (receiver)#3625
Merged
Tristan-Wilson merged 10 commits intomasterfrom Sep 12, 2025
Merged
Conversation
Tristan-Wilson
approved these changes
Sep 12, 2025
| func calculateEffectiveChunkSize(maxStoreChunkBodySize int) (uint64, error) { | ||
| chunkSize := (maxStoreChunkBodySize - len(sendChunkJSONBoilerplate) - 512 /* headers */) / 2 | ||
| func calculateEffectiveChunkSize(maxStoreChunkBodySize int, rpcMethods DataStreamingRPCMethods) (uint64, error) { | ||
| jsonOverhead := len("{\"jsonrpc\":\"2.0\",\"id\":4294967295,\"method\":\"\",\"params\":[\"\"]}") + len(rpcMethods.receiveChunk) |
This was referenced Oct 9, 2025
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.
Follow-up to #3603: I extracted the receiver-side of the streaming protocol. This way, completing NIT-3515 should be trivial without any code copying.
In detail:
messageStoremaintains partial messagesDataStreamReceivermaintains protocol (signature validation, passing data down tomessageStore)DASRPCServermaintains the end server (exposes RPC endpoints, forwards queries down toDataStreamReceiver)// lint:require-exhaustive-initializationto all the related structs (to move related issue Use the struct-initialization linter more #3121 a bit forward)messageStoreandpartialMessage(previouslybatchBuilderandbatch)