Skip to content

Commit

Permalink
Expose metadata-hash feature from polkadot crate (paritytech#4886)
Browse files Browse the repository at this point in the history
Enabling this feature when building the `polkadot ` crate will lead it
to being enabled for the builtin westend and rococo runtimes. The result
of that is that a merkleized metadata hash will be computed (at some
time cost) in those runtimes, which will allow transactions which
include a hash via the `CheckMetadataHash` extension to work.

The idea is that this is useful for being able to test/experiment with
the `CheckMetadataHash` extension against local nodes.

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
2 people authored and TomaszWaszczyk committed Jul 13, 2024
1 parent 3fab972 commit c7ce360
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ jemalloc-allocator = [
"polkadot-overseer/jemalloc-allocator",
]

# Generate the metadata hash needed for CheckMetadataHash
# in the builtin test runtimes (westend and rococo).
metadata-hash = [
"polkadot-cli/metadata-hash",
]

# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky
# when run locally depending on system load
Expand Down
1 change: 1 addition & 0 deletions polkadot/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ substrate-build-script-utils = { workspace = true, default-features = true }
[features]
default = ["cli", "db", "full-node"]
db = ["polkadot-service/db"]
metadata-hash = ["polkadot-service/metadata-hash"]
service = ["dep:polkadot-service"]
cli = [
"clap",
Expand Down
7 changes: 7 additions & 0 deletions polkadot/node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ rococo-native = [
"rococo-runtime-constants",
]

# Generate the metadata hash needed for CheckMetadataHash
# in the test runtimes.
metadata-hash = [
"rococo-runtime?/metadata-hash",
"westend-runtime?/metadata-hash",
]

runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
Expand Down

0 comments on commit c7ce360

Please sign in to comment.