feat(server): support Extrinsic V5 transaction signing - #333
Draft
pgherveou wants to merge 2 commits into
Draft
Conversation
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.
Summary
txExtVersion: 5in the local signing host while preserving the existing V4 path.VerifySignatureproviding the authorization boundary.Root cause
The local transaction builder only implemented V4 and rejected every other transaction version at the signing-host gate. V5 also cannot reuse the V4 signer payload: FRAME keeps
(transaction_extension_version, call)as an immutable base implication, whileVerifyMultiSignatureexcludes only extension implications that precede it. The frame-decode API previously lost that base when applying the authorization boundary.This PR consumes the corrected frame-decode semantics through Subxt instead of reproducing the metadata-sensitive implication and encoding logic in TrUAPI.
Dependency chain
The draft uses immutable Git revisions for both upstream changes so the complete stack can be reviewed and tested before publication. Before merge, replace those pins with published crate versions and refresh
Cargo.lockin normal follow-up commits. Keep this PR in draft until both upstream releases are available.Conformance references
The signer implication follows FRAME
TxBaseImplication/ImplicationPartsandVerifyMultiSignaturesemantics documented and linked in paritytech/frame-decode#104. That PR also cross-checks the V5 wire format against PAPImainand the complete implication pipeline against the production substrate-sdk-ios implementation used by polkadot-app-ios-v2.The focused TrUAPI regression independently constructs the expected
blake2_256(extension_version || call || explicit_suffix || implicit_suffix), verifies the embedded product-account signature, and proves that it does not verify against the former call-cleared payload.Validation
cargo fmt --all -- --checkcargo check -p truapi-servercargo test -p truapi-server— 417 unit tests plus all integration, wire-shape, and Rust/TypeScript parity tests pass./scripts/codegen.shnpm run typecheck:examplesSigning/create_transaction: V4 and V5 both pass; V5 produces a General extrinsic with inner prefix0x45 00