Skip to content

Commit

Permalink
add CheckMetadataHash signed extension
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Jun 28, 2024
1 parent 4e39511 commit d5550b7
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 14 deletions.
54 changes: 54 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ cumulus-primitives-timestamp = { version = "0.14.0", default-features = false }
cumulus-primitives-utility = { version = "0.14.0", default-features = false }
frame-benchmarking = { version = "35.0.0", default-features = false }
frame-executive = { version = "35.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.3.0", default-features = false }
frame-support = { version = "35.0.0", default-features = false }
frame-system = { version = "35.0.0", default-features = false }
frame-system-benchmarking = { version = "35.0.0", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion polkadot-parachains/integritee-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -105,7 +106,7 @@ polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-runtime-parachains = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true, optional = true }
substrate-wasm-builder = { workspace = true, optional = true, features = ["metadata-hash"] }

[features]
default = ["std"]
Expand All @@ -123,6 +124,7 @@ std = [
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
Expand Down
8 changes: 2 additions & 6 deletions polkadot-parachains/integritee-runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@

#[cfg(feature = "std")]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("TEER", 12)
.build()
}

/// The wasm builder is deactivated when compiling
/// this crate for wasm to speed up the compilation.
#[cfg(not(feature = "std"))]
fn main() {}
5 changes: 4 additions & 1 deletion polkadot-parachains/shell-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -68,7 +69,7 @@ hex = { workspace = true }
hex-literal = { workspace = true }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, optional = true, features = ["metadata-hash"] }

[features]
default = ["std"]
Expand All @@ -83,6 +84,7 @@ std = [
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
Expand Down Expand Up @@ -120,6 +122,7 @@ std = [
"staging-xcm-builder/std",
"staging-xcm-executor/std",
"staging-xcm/std",
"substrate-wasm-builder",
"xcm-transactor-primitives/std",
]
# Weird cargo behaviour: We have to feature gate the `runtime-benchmarks` behind
Expand Down
8 changes: 2 additions & 6 deletions polkadot-parachains/shell-runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@

#[cfg(feature = "std")]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("TEER", 12)
.build()
}

/// The wasm builder is deactivated when compiling
/// this crate for wasm to speed up the compilation.
#[cfg(not(feature = "std"))]
fn main() {}
1 change: 1 addition & 0 deletions polkadot-parachains/shell-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
Expand Down

0 comments on commit d5550b7

Please sign in to comment.