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

add support for metadata hash extention #3114

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions parachain/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 parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "r
sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/litentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { 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 @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

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

[features]
default = ["std"]
Expand Down Expand Up @@ -186,6 +187,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/litentry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/litentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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.
Expand Down Expand Up @@ -224,7 +225,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/paseo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { 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 @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

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

[features]
default = ["std"]
Expand Down Expand Up @@ -191,6 +192,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/paseo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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.
Expand Down Expand Up @@ -230,7 +231,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { 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 @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

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

[features]
default = ["std"]
Expand Down Expand Up @@ -191,6 +192,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/rococo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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.
Expand Down Expand Up @@ -229,7 +230,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down
10 changes: 10 additions & 0 deletions parachain/ts-tests/common/utils/integration-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ export async function initApiPromise(config: any): Promise<ParachainConfig> {
// Initiate the polkadot API.
const api = await ApiPromise.create({
provider: wsProvider,
signedExtensions: {
CheckMetadataHash: {
extrinsic: {
mode: 'u8'
},
payload: {
metadataHash: 'Option<[u8;32]>'
}
}
}
});

console.log(`Initialization done`);
Expand Down
10 changes: 5 additions & 5 deletions tee-worker/Cargo.lock

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

4 changes: 2 additions & 2 deletions tee-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ rlp = { version = "0.5", default-features = false }
sha3 = { version = "0.10", default-features = false }

url = { git = "https://github.com/domenukk/rust-url", branch = "no_std", default-features = false, features = ["alloc", "no_std_net"] }
substrate-api-client = { git = "https://github.com/scs/substrate-api-client", branch = "polkadot-v0.9.42-tag-v0.14.0", default-features = false, features = ["sync-api"] }
substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.14.0" }
substrate-api-client = { git = "https://github.com/encointer/substrate-api-client.git", branch = "v0.9.42-tag-v0.14.0-retracted-check-metadata-hash", default-features = false, features = ["sync-api"] }
substrate-client-keystore = { git = "https://github.com/encointer/substrate-api-client.git", branch = "v0.9.42-tag-v0.14.0-retracted-check-metadata-hash" }

# substrate
finality-grandpa = { version = "0.16.0", default-features = false, features = ["derive-codec"] }
Expand Down
8 changes: 4 additions & 4 deletions tee-worker/bitacross/enclave-runtime/Cargo.lock

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

Loading
Loading