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

Metadata Hash seems to be broken in stable2409/published crates.io versions #6776

Closed
2 tasks done
blakebyrnes opened this issue Dec 5, 2024 · 3 comments
Closed
2 tasks done
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@blakebyrnes
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

When the metadata-hash feature is enabled, there is a conflict between two versions of frame-metadata and the compiler can't figure out which version to use. The resulting error looks like:

   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/substrate-wasm-builder-24.0.1/src/metadata_hash.rs:107:27
    |
107 |     generate_metadata_digest(&metadata, extra_info)
    |     ------------------------ ^^^^^^^^^ expected `frame_metadata::RuntimeMetadata`, found `RuntimeMetadata`
    |     |
    |     arguments to this function are incorrect
    |
    = note: `RuntimeMetadata` and `frame_metadata::RuntimeMetadata` have similar names, but are actually distinct types
note: `RuntimeMetadata` is defined in crate `frame_metadata`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-metadata-16.0.0/src/lib.rs:99:1
    |
99  | pub enum RuntimeMetadata {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
note: `frame_metadata::RuntimeMetadata` is defined in crate `frame_metadata`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frame-metadata-17.0.0/src/lib.rs:103:1
    |
103 | pub enum RuntimeMetadata {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `frame_metadata` are being used?
note: function defined here
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/merkleized-metadata-0.1.1/src/lib.rs:56:8
    |
56  | pub fn generate_metadata_digest(

I can resolve this issue by pegging the merkleized-metadata crate as so:

[patch.crates-io]
merkleized-metadata = { git = "https://github.com/bkchr/merkleized-metadata", rev = "18c9f872ce583f9aaf53a25717af6f3db7605871" }

This forces it to go to a version where it hasn't yet updated the frame-metadata to a major version change (16.0 -> 17.0).

Steps to reproduce

Build a runtime with metadata-hash enabled using this combo:

frame-support = { version = "38.0.0", default-features = false }
-> depends on frame-metadata v16.0.0
substrate-wasm-builder = { version = "24.0.1", features=["metadata-hash"] }
-> depends on frame-metadata v16.0.0
-> depends on merkleized-metadata 0.1.0, which in turn, upgrades to 0.1.1, and frame-metadata v17.0.0

@blakebyrnes blakebyrnes added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Dec 5, 2024
@blakebyrnes
Copy link
Author

@ggwpez Sorry to tag out of the blue, but this seems like something you're passionate about at the moment. It's a little strange, imo, that this got zero attention after 5 days, but maybe I didn't provide enough to reproduce?

@xlc
Copy link
Contributor

xlc commented Dec 11, 2024

looks like dup of bkchr/merkleized-metadata#7

@bkchr
Copy link
Member

bkchr commented Dec 12, 2024

I yanked the broken crate versions. Sorry!

@bkchr bkchr closed this as completed Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

3 participants