Skip to content

rehearsal: batch requests (fork CI only, do not merge) - #16

Closed
michael-moffett wants to merge 13 commits into
mainfrom
rehearse/717-7fa6f1a
Closed

rehearsal: batch requests (fork CI only, do not merge)#16
michael-moffett wants to merge 13 commits into
mainfrom
rehearse/717-7fa6f1a

Conversation

@michael-moffett

@michael-moffett michael-moffett commented Sep 5, 2026

Copy link
Copy Markdown
Member

CI rehearsal on our fork for the batch-request fix. Not for merge.

92Infinitus92 and others added 13 commits September 1, 2026 14:52
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
@michael-moffett
michael-moffett deleted the rehearse/717-7fa6f1a branch September 5, 2026 14:00
@michael-moffett michael-moffett changed the title rehearsal: 717 batch requests (fork CI only, do not merge) rehearsal: batch requests (fork CI only, do not merge) Sep 5, 2026
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.

6 participants