Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16: Add unstable metadata v16 #82

Merged
merged 7 commits into from
Oct 9, 2024
Merged

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 <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Sep 13, 2024
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
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

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
serialize

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv merged commit 201d9e5 into main Oct 9, 2024
9 checks passed
@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