rehearsal: batch requests (fork CI only, do not merge) - #16
Closed
michael-moffett wants to merge 13 commits into
Closed
rehearsal: batch requests (fork CI only, do not merge)#16michael-moffett wants to merge 13 commits into
michael-moffett wants to merge 13 commits into
Conversation
…ld (solana-foundation#761) Co-authored-by: Micaiah Reid <micaiahreid@gmail.com>
SurfpoolMiddleware::on_request bound Request::Single(Call::MethodCall) and rejected everything else, so every batch was discarded before the handler saw it. jsonrpc-core already parses Request::Batch and its handler already implements the batch response rules; the middleware was the only thing in the way. Batches now go through the same surfnet_-prefix cheatcode gate as single requests, one element at a time. A gated element fails on its own rather than failing the batch, and a gated notification is answered by nothing, as any notification is. Closes solana-foundation#717
An empty array `[]` deserialized to Request::Batch(vec![]), reached dispatch_batch, and fell out of `if forwarded.is_empty()` as None, so the server sent no response at all. At 3c143ad the same input was answered -32600 with a null id, making this a regression against base as well as a JSON-RPC 2.0 §6 MUST ("the Server MUST respond with a single Response object" for an array with no values). F1: gate the batch arm on !calls.is_empty(), routing `[]` to the existing rejection arm three lines below, so the restored answer is byte identical to base. F2: a fifth test, an_empty_batch_is_answered_with_one_invalid_request, for the restored spec behaviour. It fails before F1 (unwrap on None) and passes after. Applied verbatim from the S4b code-quality worklist. Ticket: T-DIR-P040-S4B-A-APPLY-F1-F2-717-2026-09-04
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.
CI rehearsal on our fork for the batch-request fix. Not for merge.