Prep v0.17.0 release: add methods for encoding extrinsics and related data#87
Merged
Prep v0.17.0 release: add methods for encoding extrinsics and related data#87
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prepares the v0.17.0 release by adding no-std-capable extrinsic encoding APIs (V4 and V5) to frame_decode::extrinsics, including signer payload construction and a new transaction extensions abstraction that selects appropriate extension versions from metadata.
Changes:
- Add
extrinsic_encodermodule with APIs to encode V4 unsigned/signed extrinsics, V5 bare/general extrinsics, and V4/V5 signer payloads. - Introduce
TransactionExtension/TransactionExtensionstraits and integrate extension-version selection via metadata. - Extend
ExtrinsicTypeInfoto support call lookup by name and to expose available transaction-extension versions; bump crate to0.17.0.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/methods/extrinsic_encoder.rs |
New core implementation for encoding extrinsics, signer payloads, and call data. |
src/methods/extrinsic_encoder/transaction_extension.rs |
Defines the per-extension encoding trait used by encoders. |
src/methods/extrinsic_encoder/transaction_extensions.rs |
Tuple-based aggregation and dispatch for sets of extensions. |
src/methods/extrinsic_type_info.rs |
Extends metadata-derived type info to support encoding needs (lookup by name, extension versions, implicits). |
src/methods/extrinsic_decoder.rs |
Updates decoder to use renamed call-info lookup by index. |
src/lib.rs |
Re-exports the new extrinsic encoding APIs from frame_decode::extrinsics. |
src/methods/mod.rs |
Wires the new extrinsic_encoder module into the crate. |
src/utils.rs / src/utils/type_registry_from_metadata.rs |
Adjust legacy gating to be module-level (avoids per-item cfg clutter). |
src/methods/storage_type_info.rs |
Moves alloc::format import into legacy submodule. |
Cargo.toml / Cargo.lock |
Bumps crate version to 0.17.0. |
CHANGELOG.md |
Adds 0.17.0 entry describing the new encoding APIs. |
.gitignore |
Ignores .claude. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR adds the necessary methods to allow users to encode v4 and v5 unsigned and signed extrinsics, signer payloads and call data. It also adds
TransactionExtensiontraits and handles the logic of selecting which transaction extensions to use, and extendsExtrinsicTypeInfo(and impls of this) as needed to make this all work.The aim here is to make extrinsic encoding logic available in
no-stdcontexts, and to get all of the logic for encoding and decoding storage/constants/runtime APIs/view functions/extrinsics in one place. Everything else was already in this crate, and with this extrinsic encode logic we complete the set.Note: Subxt has been updated locally to work with this PR in subxt#2177 and as such we've tested the APIs (at least insofar as they are/were tested in Subxt) and verified that we have what we need.
Note 2: As always, it would be good to get more testing moved to this crate. It's just typically been easier to do it in the Subxt crate since Subxt makes it easy to run E2E tests against some node to test things. See #2 for ideas on how to better test this crate.