Repository navigation
Frame through the runtime: its JSON-RPC, and body-bytes requests - #29
Merged
Merged
Conversation
comline-runtime's `jsonrpc` feature (runtime#49) builds the JSON-RPC framing without `std`, so the copy vendored in `src/framing.rs` goes and `WireFraming::Jsonrpc` delegates to `JsonRpcFraming`. runtime#45's `found-*` vectors still pass byte for byte. `encode_request_body` (runtime#50) takes params the codec has already laid out, so `Preencoded`, the `WireFormat` that ignored its value to smuggle them through, goes too. `WireFraming::encode_request` takes the body as `&[u8]` and the call's real `one_way`. No frame changes: datagram@2 has no bit for it, and the simulator's JSON-RPC is a lockstep `Client`'s, whose `notify` keeps the id. A test pins that. serde_json no longer needs `raw_value` here; the runtime enables what it uses itself.
Member
Author
|
Wasm size after
CI is green. |
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.
Moves the simulator onto two runtime changes now on
main:jsonrpcfeature builds JSON-RPC withoutstd.encode_request_bodyonFramingandConnectionFraming.Changes
comline-runtimeis pinned to207b38a, withfeatures = ["alloc", "jsonrpc"].src/framing.rsis deleted.WireFraming::Jsonrpcnow callscomline_runtime::framing::JsonRpcFraming.found-*vectors in the tests still pass byte for byte.Preencodedand its test are deleted. That was theWireFormatthat ignored its value so it could pass encoded bytes through.WireFraming::encode_requestnow takes the body as&[u8]and calls each framing'sencode_request_body.Result, because nothing in it can fail.serde_jsonno longer enablesraw_value. Only the deleted copy used it, and the runtime turns it on for itself.src/framing.rs's module doc now says the simulator keeps its own request ids, because it plays both ends on one simulated clock.one_wayRequests now pass the call's real
one_wayinstead of a hard-codedfalse. This changes no bytes:Client. It only models server-provided protocols, and the Rust generator puts such a package on aClient, not aConnection(on_connectionin generation'sconnections.rs).Client::notifykeeps theid.Connectionis a one-way call sent as a notification with noid.A new test pins this: one-way and two-way requests come out identical on every framing.
Wasm size (post-
wasm-opt, from the CI logs)The figures are in a comment below.