From 3f7d6b2759a450311ceff2e79021d449c0f38fa0 Mon Sep 17 00:00:00 2001 From: yooml Date: Tue, 18 Jun 2024 10:38:59 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20=F0=9F=8E=B8=20add=20metadata?= =?UTF-8?q?-hash-extension=20(#1265)"=20(#1268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. --- Cargo.lock | 87 +++++------------------------ Cargo.toml | 3 +- runtime/bifrost-kusama/Cargo.toml | 6 +- runtime/bifrost-kusama/build.rs | 12 +--- runtime/bifrost-kusama/src/lib.rs | 2 - runtime/bifrost-polkadot/Cargo.toml | 6 +- runtime/bifrost-polkadot/build.rs | 12 +--- runtime/bifrost-polkadot/src/lib.rs | 1 - 8 files changed, 18 insertions(+), 111 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52b17fed8..9e7440541 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1063,7 +1063,6 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", - "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -1218,7 +1217,6 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", - "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -4546,22 +4544,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-metadata-hash-extension" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb1eec9eb46d3e016c95b2fa875118c04609f2150013c56a894cae00581e265" -dependencies = [ - "array-bytes 6.2.2", - "docify", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime", -] - [[package]] name = "frame-remote-externalities" version = "0.36.0" @@ -5317,7 +5299,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -6714,20 +6696,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "merkleized-metadata" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" -dependencies = [ - "array-bytes 6.2.2", - "blake3", - "frame-metadata", - "parity-scale-codec", - "scale-decode", - "scale-info", -] - [[package]] name = "merlin" version = "3.0.0" @@ -12496,29 +12464,6 @@ dependencies = [ "sp-arithmetic", ] -[[package]] -name = "scale-bits" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" -dependencies = [ - "parity-scale-codec", - "scale-type-resolver", -] - -[[package]] -name = "scale-decode" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" -dependencies = [ - "derive_more", - "parity-scale-codec", - "scale-bits", - "scale-type-resolver", - "smallvec", -] - [[package]] name = "scale-info" version = "2.11.2" @@ -12545,12 +12490,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-type-resolver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" - [[package]] name = "schannel" version = "0.1.23" @@ -14292,25 +14231,16 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "18.0.1" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" +checksum = "511bbc2df035f5fe2556d855369a1bbb45df620360391a1f6e3fa1a1d64af79a" dependencies = [ - "array-bytes 6.2.2", "build-helper", "cargo_metadata", "console", "filetime", - "frame-metadata", - "merkleized-metadata", - "parity-scale-codec", "parity-wasm", - "sc-executor", - "sp-core", - "sp-io", "sp-maybe-compressed-blob", - "sp-tracing", - "sp-version", "strum 0.24.1", "tempfile", "toml 0.8.12", @@ -15845,7 +15775,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] @@ -15858,6 +15788,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + [[package]] name = "windows-sys" version = "0.45.0" diff --git a/Cargo.toml b/Cargo.toml index 91352c831..36d17fcee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,6 @@ cumulus-primitives-utility = { version = "0.8.0", default-featur cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false } frame-benchmarking = { version = "29.0.0", default-features = false } frame-executive = { version = "29.0.0", default-features = false } -frame-metadata-hash-extension = { version = "0.1.0", default-features = false } frame-support = { version = "29.0.0", default-features = false } frame-system = { version = "29.0.0", default-features = false } frame-system-benchmarking = { version = "29.0.0", default-features = false } @@ -265,7 +264,7 @@ sp-rpc = { version = "27.0.0" } substrate-build-script-utils = { version = "11.0.0" } substrate-frame-rpc-system = { version = "29.0.0" } substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "18.0.1" } +substrate-wasm-builder = { version = "18.0.0" } try-runtime-cli = { version = "0.39.0" } xcm-emulator = { version = "0.6.0" } xcm-simulator = { version = "8.0.0" } diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index 95cf2c1be..fee68ce52 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -21,7 +21,6 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } -frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -160,7 +159,6 @@ std = [ "frame-benchmarking?/std", "frame-executive/std", - "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -399,8 +397,6 @@ try-runtime = [ "bifrost-channel-commission/try-runtime", ] -# Enable the metadata hash generation in the wasm builder. -metadata-hash = ["substrate-wasm-builder/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -411,7 +407,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["sp-api/disable-logging"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-kusama/build.rs b/runtime/bifrost-kusama/build.rs index 24206c333..a6d8f457d 100644 --- a/runtime/bifrost-kusama/build.rs +++ b/runtime/bifrost-kusama/build.rs @@ -16,17 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(all(feature = "metadata-hash", feature = "std"))] -fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .enable_metadata_hash("BNC", 12) - .build() -} - -#[cfg(all(not(feature = "metadata-hash"), feature = "std"))] +#[cfg(feature = "std")] fn main() { substrate_wasm_builder::WasmBuilder::new() .with_current_project() diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 3b06312c0..dbd25ac53 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -923,7 +923,6 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), - frame_metadata_hash_extension::CheckMetadataHash::::new(true), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { @@ -2031,7 +2030,6 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, - frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index fba01fcc1..c30f52443 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -21,7 +21,6 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } -frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -157,7 +156,6 @@ std = [ "strum/std", "frame-executive/std", - "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -374,8 +372,6 @@ try-runtime = [ "zenlink-protocol/try-runtime", ] -# Enable the metadata hash generation in the wasm builder. -metadata-hash = ["substrate-wasm-builder/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -386,7 +382,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] +on-chain-release-build = ["sp-api/disable-logging"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-polkadot/build.rs b/runtime/bifrost-polkadot/build.rs index a0321ffe4..8b3550ecf 100644 --- a/runtime/bifrost-polkadot/build.rs +++ b/runtime/bifrost-polkadot/build.rs @@ -15,17 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(all(feature = "metadata-hash", feature = "std"))] -fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .enable_metadata_hash("BNC", 12) - .build() -} - -#[cfg(all(not(feature = "metadata-hash"), feature = "std"))] +#[cfg(feature = "std")] fn main() { substrate_wasm_builder::WasmBuilder::new() .with_current_project() diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 0d041515d..7cab2a8ac 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1864,7 +1864,6 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, - frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic =