Skip to content

Commit

Permalink
add check metadatahash signed extension (#297)
Browse files Browse the repository at this point in the history
* polkadot-v1.13.0 and bump integritee and orml pallets

* bump rust-toolchain

* some update fixes

* fix pallet asset update to v1.13.0

* update runtimes to be async backing ready

* [node] fix build

* [integritee-runtime] add migration

* add `CheckMetadataHash` signed extension

* bump versions

* fix SignedExtension

---------

Co-authored-by: Alain Brenzikofer <alain@integritee.network>
  • Loading branch information
clangenb and brenzi authored Jul 1, 2024
1 parent 8cbf3e2 commit b2fe75e
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 23 deletions.
60 changes: 57 additions & 3 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
2 changes: 1 addition & 1 deletion polkadot-parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "integritee-collator"
description = "The Integritee parachain collator binary"
# align major.minor revision with polkadot SDK. bump patch revision ad lib. make this the github release tag
version = "1.10.0"
version = "1.13.0"
authors = ["Integritee AG <hello@integritee.network>"]
homepage = "https://integritee.network/"
repository = "https://github.com/integritee-network/parachain"
Expand Down
6 changes: 4 additions & 2 deletions polkadot-parachains/integritee-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "integritee-runtime"
description = "The Integritee parachain runtime"
# align major.minor revision with polkadot SDK. patch revision must match runtime spec_version
version = "1.10.520"
version = "1.13.530"
authors = ["Integritee AG <hello@integritee.network>"]
homepage = "https://integritee.network/"
repository = "https://github.com/integritee-network/parachain"
Expand Down 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: 3 additions & 2 deletions polkadot-parachains/integritee-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("integritee-parachain"),
impl_name: create_runtime_str!("integritee-full"),
authoring_version: 2,
spec_version: 520,
spec_version: 530,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 7,
transaction_version: 8,
state_version: 0,
};

Expand Down Expand Up @@ -1071,6 +1071,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
7 changes: 5 additions & 2 deletions polkadot-parachains/shell-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "shell-runtime"
description = "The Integritee shell parachain runtime"
# align major.minor revision with polkadot SDK. patch should match spec_version
version = "1.10.17"
version = "1.13.18"
authors = ["Integritee AG <hello@integritee.network>"]
homepage = "https://integritee.network/"
repository = "https://github.com/integritee-network/parachain"
Expand All @@ -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() {}
3 changes: 2 additions & 1 deletion polkadot-parachains/shell-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("integritee-parachain"),
impl_name: create_runtime_str!("integritee-shell"),
authoring_version: 0,
spec_version: 17,
spec_version: 18,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down 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 b2fe75e

Please sign in to comment.