Skip to content

v16: Add unstable metadata v16#82

Merged
lexnv merged 7 commits intomainfrom
lexnv/metadata-v16-associated-types
Oct 9, 2024
Merged

v16: Add unstable metadata v16#82
lexnv merged 7 commits intomainfrom
lexnv/metadata-v16-associated-types

Conversation

@lexnv
Copy link
Contributor

@lexnv lexnv commented Sep 13, 2024

This PR adds the metadata V16 to the frame-metadata crate, under the unstable feature flag.

The u32 ID of the metadata V16 is currently u32::MAX to mark the metadata as unstable.

This PR paves the way towards collecting the metadata in substrate and enables the extraction of the metadata via the runtime API calls.

cc @paritytech/subxt-team

Signed-off-by: Alexandru Vasile <[email protected]>
@lexnv lexnv self-assigned this Sep 13, 2024
Signed-off-by: Alexandru Vasile <[email protected]>
Copy link
Contributor

@jsdw jsdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

/// The type of the outermost Extra enum.
pub extra_ty: T::Type,
/// The signed extensions in the order they appear in the extrinsic.
pub signed_extensions: Vec<SignedExtensionMetadata<T>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub signed_extensions: Vec<SignedExtensionMetadata<T>>,
pub transaction_extensions: Vec<SignedExtensionMetadata<T>>,

Do we want to rename it directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we can do it now since its quite a small change :D Thanks for pointing this out 🙏 Have also renamed the struct SignedExtensionMetadata -> struct TransactionExtensionMetadata

)]
pub struct ExtrinsicMetadata<T: Form = MetaForm> {
/// Extrinsic version.
pub version: u8,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could return a Vec<u8> that represents all the available versions.

Comment on lines +51 to +52
/// The type of the `Runtime`.
pub ty: <PortableForm as Form>::Type,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what is this needed? I mean this type is just some dummy type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After briefly looking into subxt I didn't find any usage of this type 🤔 I believe we expose it in our metadata APIs and keep around, have removed it for now

@lexnv lexnv merged commit 201d9e5 into main Oct 9, 2024
@lexnv lexnv deleted the lexnv/metadata-v16-associated-types branch October 9, 2024 14:16
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.

4 participants