Repository navigation
feat(truapi): refuse a request in a version the host does not know - #1650
Merged
Merged
Conversation
A host refuses a request or subscription start in a version newer than it knows with an `UnsupportedVersion` protocol error, before handling it, and names the newest version it accepts. Handlers now take their decoded request. `on_request` and `on_subscription` infer the request type from the handler, decode the payload, answer bytes that do not decode with `MalformedFrame`, and record the type's `Versioned::LATEST`. The dispatcher checks the version byte after reserving the call, so duplicate ids and early withdrawals are handled as for any other request. Generated handlers no longer carry their own decode step. The TS transport decodes the new error from a codec declared like the Rust enum, settles the refused call as `Unsupported` as it does for `UnsupportedMessage`, and warns with the newest version the host accepts. The Rust decoder reads the known variants from the enum's type information. A host built before this answers such a request with `MalformedFrame`.
…he handler it wraps
Contributor
Bundle size reportCompared with
WebAssembly modules
Changed files (4)
Commit: e14e635 |
Contributor
|
CI Status: 24 required jobs green, 21 passed and 3 skipped by path filter. All job results
Signing credentials: valid as of 2026-10-26 Commit |
pgherveou
approved these changes
Oct 26, 2026
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.
Closes https://github.com/paritytech/platform-bugs/issues/123
A product built against a newer protocol can send a request version the host doesn't know. The host refuses it with an
UnsupportedVersionprotocol error, and the call fails asUnsupported, like an unknown method.[0, 1, trait, method, newest_version]on(255, 255), and the host logs it once per method.Unsupportedand logs the newest version the host accepts.Existing messages don't change. Apps released before this still answer
MalformedFrame.