Skip to content

Commit 9fd7b43

Browse files
jsdwbkchr
andauthored
Expose metadata-hash feature from polkadot crate (#4886)
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 <git@kchr.de>
1 parent 9403a5d commit 9fd7b43

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

polkadot/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ jemalloc-allocator = [
6868
"polkadot-overseer/jemalloc-allocator",
6969
]
7070

71+
# Generate the metadata hash needed for CheckMetadataHash
72+
# in the builtin test runtimes (westend and rococo).
73+
metadata-hash = [
74+
"polkadot-cli/metadata-hash",
75+
]
7176

7277
# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky
7378
# when run locally depending on system load

polkadot/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ substrate-build-script-utils = { workspace = true, default-features = true }
4949
[features]
5050
default = ["cli", "db", "full-node"]
5151
db = ["polkadot-service/db"]
52+
metadata-hash = ["polkadot-service/metadata-hash"]
5253
service = ["dep:polkadot-service"]
5354
cli = [
5455
"clap",

polkadot/node/service/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ rococo-native = [
201201
"rococo-runtime-constants",
202202
]
203203

204+
# Generate the metadata hash needed for CheckMetadataHash
205+
# in the test runtimes.
206+
metadata-hash = [
207+
"rococo-runtime?/metadata-hash",
208+
"westend-runtime?/metadata-hash",
209+
]
210+
204211
runtime-benchmarks = [
205212
"frame-benchmarking-cli/runtime-benchmarks",
206213
"frame-benchmarking/runtime-benchmarks",

0 commit comments

Comments
 (0)