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

P-949 Enable metadata hash for runtime #3280

Merged
merged 6 commits into from
Mar 6, 2025
Merged
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
57 changes: 56 additions & 1 deletion parachain/Cargo.lock

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

3 changes: 2 additions & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch =
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
Expand Down Expand Up @@ -266,7 +267,7 @@ frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branc
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" }
cumulus-pallet-session-benchmarking = { git = 'https://github.com/paritytech/polkadot-sdk', branch = "stable2407", default-features = false }
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" }
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", features = ["metadata-hash"] }

# local
core-primitives = { path = "../common/primitives/core", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ homepage = 'https://litentry.com/'
license = 'GPL-3.0'
name = 'litentry-collator'
repository = 'https://github.com/litentry/litentry-parachain'
version = '0.9.23'
version = '0.9.24'

[[bin]]
name = 'litentry-collator'
Expand Down Expand Up @@ -104,6 +104,7 @@ xcm = { workspace = true }

frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
frame-try-runtime = { workspace = true, optional = true }

Expand Down
5 changes: 4 additions & 1 deletion parachain/runtime/litentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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 @@ -133,7 +134,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, optional = true }

[features]
default = ["std"]
Expand Down Expand Up @@ -216,6 +217,7 @@ std = [
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-metadata-hash-extension/std",
"frame-system/std",
"frame-try-runtime?/std",
"hex?/std",
Expand Down Expand Up @@ -303,6 +305,7 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
Expand Down
11 changes: 7 additions & 4 deletions parachain/runtime/litentry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
// You should have received a copy of the GNU General Public License
// along with Litentry. If not, see <https://www.gnu.org/licenses/>.

use substrate_wasm_builder::WasmBuilder;

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

#[cfg(not(feature = "std"))]
fn main() {}
5 changes: 3 additions & 2 deletions parachain/runtime/litentry/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,10 +231,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("heima"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9233,
spec_version: 9240,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
// https://hackmd.io/JagpUd8tTjuKf9HQtpvHIQ
// The trie is an abstraction that sits between the Runtime (and its Overlays) and the actual database, providing an important abstraction to the blockchain, namely storage proofs and state roots.
// The trie format has changed since this pull request(#9732) in substrate. The main new difference is, that nodes that contain values larger than 256 bits will not storage the value itself, but rather store the hash of that value. The value itself, is consequently stored in the node that lives in the path traversed by this new hash.
Expand Down
5 changes: 4 additions & 1 deletion parachain/runtime/paseo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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 @@ -150,7 +151,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, optional = true }

[features]
default = ["std"]
Expand Down Expand Up @@ -246,6 +247,7 @@ std = [
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-metadata-hash-extension/std",
"frame-system/std",
"frame-try-runtime?/std",
"log/std",
Expand Down Expand Up @@ -336,6 +338,7 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
Expand Down
1 change: 1 addition & 0 deletions parachain/runtime/paseo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn main() {
.with_current_project()
.export_heap_base()
.import_memory()
.enable_metadata_hash("HEI", 18)
.build();
}

Expand Down
5 changes: 3 additions & 2 deletions parachain/runtime/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,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 @@ -232,10 +233,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("heima"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9233,
spec_version: 9240,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
// https://hackmd.io/JagpUd8tTjuKf9HQtpvHIQ
// The trie is an abstraction that sits between the Runtime (and its Overlays) and the actual database, providing an important abstraction to the blockchain, namely storage proofs and state roots.
// The trie format has changed since this pull request(#9732) in substrate. The main new difference is, that nodes that contain values larger than 256 bits will not storage the value itself, but rather store the hash of that value. The value itself, is consequently stored in the node that lives in the path traversed by this new hash.
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 @@ -137,8 +137,8 @@ sha3 = { version = "0.10", default-features = false }
built = { version = "0.6.1", default-features = false }

url = { git = "https://github.com/domenukk/rust-url", rev = "316c868", default-features = false, features = ["alloc", "no_std_net"] }
substrate-api-client = { git = "https://github.com/Kailai-Wang/substrate-api-client", branch = "polkadot-v0.9.42-litentry", default-features = false, features = ["sync-api"] }
substrate-client-keystore = { git = "https://github.com/Kailai-Wang/substrate-api-client", branch = "polkadot-v0.9.42-litentry" }
substrate-api-client = { git = "https://github.com/encointer/substrate-api-client", 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", 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/identity/enclave-runtime/Cargo.lock

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

Loading