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

Update frame metadata to v16 #657

Merged
merged 7 commits into from
Oct 31, 2023
Merged

Conversation

haerdib
Copy link
Contributor

@haerdib haerdib commented Oct 25, 2023

Updates the frame-metadata to v16.0

To ensure the tests still run with the v14 -> v15 conversion, it was necessary to exchange the outdated ksm metdata from parity (older than 2 years) with a newer one, as it did not contain the enum "RuntimeCall" yet (see parity discussion: paritytech/subxt#1171). To retrieve the metadata from a Kusama node, the file dump_metadata was created. This also allows fetching different metadata for testing purposes when needed.

Additionally, the following was updated:

  • Updated rust-toolchain to a slightly newer one
  • Fixed "tungstenite deprecated" clippy warnings
  • Renamed InvalidMetadataError to MetadataConversionError to clarify the error name. Also moved the Error Types from MetadataError to MetadataConversionError which were only used in metadata conversion.

closes #608

@haerdib haerdib self-assigned this Oct 30, 2023
@haerdib haerdib added the F7-enhancement Enhances an already existing functionality label Oct 30, 2023
@haerdib haerdib requested a review from masapr October 30, 2023 09:08
@haerdib haerdib marked this pull request as ready for review October 30, 2023 09:08
Copy link
Collaborator

@masapr masapr left a comment

Choose a reason for hiding this comment

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

👍 LGTM
Just a comment on the tests: you test against a correct .bin file and on-the-fly generated erroneous metadata. Would there be an old or invalid .bin file you can also test against?

@haerdib
Copy link
Contributor Author

haerdib commented Oct 31, 2023

Just a comment on the tests: you test against a correct .bin file and on-the-fly generated erroneous metadata. Would there be an old or invalid .bin file you can also test against?

Yes, there would be the old .bin file, which does not contain any "RuntimeCall" (and similiar) enums. But I don't think this should be tested against, since this is actually rather undesired but hardly preventable behaviour (see subxt discussion:paritytech/subxt#1174 (comment)) . I don't know how to get erroneous metadata.

Do you think the manually generated metadata is not sufficient?

@masapr
Copy link
Collaborator

masapr commented Oct 31, 2023

So, it panics, when you use the old one? What I meant was to test the error-case to know how it behaves in that case. That's all.

But you can really leave it as is.

@haerdib
Copy link
Contributor Author

haerdib commented Oct 31, 2023

No, it is a legitimate worry, as this does break the compatibility with very old node runtimes. It does not panic, but it returns an error MetadataConversionError::TypeNameNotFound( .. ) (see the test: https://github.com/scs/substrate-api-client/pull/657/files#diff-7f07d2e92e3f41eabe45f4f95c26fda3f502c19e35d851ea39aa34c303d42993R424-R425)

But I think this should be alright, since it allows using the new v15 metadata (and reasonably old v14) and we are not supporting old polkadot-branches anyway.

@haerdib haerdib merged commit fce185f into master Oct 31, 2023
44 checks passed
@haerdib haerdib deleted the bh/update-frame-metadata-to-v16 branch October 31, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2-breaksapi F7-enhancement Enhances an already existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update dependencies and frame-metadata feature flags
2 participants