From a8b1230d6ee29d0aca2b11c06a256637ed2eff46 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Tue, 27 Aug 2024 11:18:10 +1200 Subject: [PATCH] enable metadata hash (#2786) * wip * Update runtime/acala/src/lib.rs Co-authored-by: zjb0807 * fix * fix * revert * enable metadata hash * fix --------- Co-authored-by: zjb0807 --- Cargo.lock | 291 +++++++++++++++++++++++++------------- Cargo.toml | 11 +- runtime/acala/Cargo.toml | 2 + runtime/acala/build.rs | 6 +- runtime/acala/src/lib.rs | 6 +- runtime/karura/Cargo.toml | 2 + runtime/karura/build.rs | 6 +- runtime/karura/src/lib.rs | 6 +- 8 files changed, 212 insertions(+), 118 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcee7f3317..9d48d33af0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-rpc-runtime-api", @@ -298,7 +299,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -444,9 +445,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-channel" @@ -467,7 +468,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -478,7 +479,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -553,7 +554,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -617,6 +618,19 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake3" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -697,9 +711,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" [[package]] name = "byteorder" @@ -726,9 +740,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -772,12 +786,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.10" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1187,7 +1202,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1279,13 +1294,11 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "089cde9805125028d21518c07e54ae89e80679e77efef91301ce73beaf464379" +checksum = "455b6a7ecafa48fdc6194cca069d079985d7a67568a83f14cfb935a256108441" dependencies = [ "cumulus-primitives-core", - "futures", - "parity-scale-codec", "sp-inherents", "sp-timestamp", ] @@ -1348,14 +1361,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] name = "cxx" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273dcfd3acd4e1e276af13ed2a43eea7001318823e7a726a6b3ed39b4acc0b82" +checksum = "3c4eae4b7fc8dcb0032eb3b1beee46b38d371cdeaf2d0c64b9944f6f69ad7755" dependencies = [ "cc", "cxxbridge-flags", @@ -1365,9 +1378,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b2766fbd92be34e9ed143898fce6c572dc009de39506ed6903e5a05b68914e" +checksum = "6c822bf7fb755d97328d6c337120b6f843678178751cba33c9da25cf522272e0" dependencies = [ "cc", "codespan-reporting", @@ -1375,24 +1388,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] name = "cxxbridge-flags" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839fcd5e43464614ffaa989eaf1c139ef1f0c51672a1ed08023307fa1b909ccd" +checksum = "719d6197dc016c88744aff3c0d0340a01ecce12e8939fc282e7c8f583ee64bc6" [[package]] name = "cxxbridge-macro" -version = "1.0.124" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2c1c1776b986979be68bb2285da855f8d8a35851a769fca8740df7c3d07877" +checksum = "35de3b547387863c8f82013c4f79f1c2162edee956383e4089e1d04c18c4f16c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1424,7 +1437,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1437,7 +1450,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1503,7 +1516,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.74", + "syn 2.0.76", "termcolor", "toml 0.8.19", "walkdir", @@ -1640,7 +1653,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1651,7 +1664,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1875,7 +1888,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1892,9 +1905,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -2005,7 +2018,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2056,6 +2069,22 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata-hash-extension" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4033a2b473472e7ad29ff501d3cedff36f8eaa26f61654d19b6b5cf3e1885296" +dependencies = [ + "array-bytes", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "frame-support" version = "37.0.0" @@ -2115,7 +2144,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2128,7 +2157,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2139,14 +2168,14 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] name = "frame-system" -version = "37.0.0" +version = "37.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0fd8236a0a53db6b85b0fa3464d8928dd0fafa29b3571c764dbfc58d5bf1d6" +checksum = "043790fff021477061b207fd6b33743793b63fc64a583358956787229d039717" dependencies = [ "cfg-if", "docify", @@ -2268,7 +2297,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2460,6 +2489,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2728,18 +2763,18 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -2814,6 +2849,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-rpc-runtime-api", @@ -2984,9 +3020,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -3074,9 +3110,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -3173,7 +3209,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3187,7 +3223,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3198,7 +3234,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3209,7 +3245,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3411,6 +3447,20 @@ dependencies = [ "hash-db", ] +[[package]] +name = "merkleized-metadata" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" +dependencies = [ + "array-bytes", + "blake3", + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-info", +] + [[package]] name = "merlin" version = "3.0.0" @@ -3444,7 +3494,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -4255,7 +4305,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -4363,7 +4413,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -5903,9 +5953,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "16.0.0" +version = "16.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b41b52fd494db19f775e32a2a420d381be20fd12529ec30566f5f342e5d5f0a" +checksum = "c2fae7580b1a541a810e3602c46086a181a6e8aa2c178f3b6f0a4fb5e0bd9f9c" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -5998,7 +6048,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -6008,7 +6058,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -6055,12 +6105,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -6128,7 +6178,7 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -6165,9 +6215,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -6245,9 +6295,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -6271,7 +6321,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -6841,6 +6891,29 @@ 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.3" @@ -6867,6 +6940,12 @@ 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 = "schnellru" version = "0.2.3" @@ -6977,9 +7056,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.207" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -6995,22 +7074,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.207" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -7208,7 +7288,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -7266,9 +7346,9 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "37.0.0" +version = "37.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307b711ca03fe93bcae959a9b7b11ab2cfb9756851f26eda4e5a95d0e2763410" +checksum = "a309eecd6b5689f57e67181deaa628d9c8951db1ba0d26f07c69e14dffdc4765" dependencies = [ "futures", "parity-scale-codec", @@ -7417,7 +7497,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -7438,7 +7518,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -7644,7 +7724,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -7827,7 +7907,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8024,7 +8104,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8037,7 +8117,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8085,13 +8165,22 @@ version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0104598a022d22430f27e535b7aed148af9dcd0a3eb23697c02168071a325e33" dependencies = [ + "array-bytes", "build-helper", "cargo_metadata 0.15.4", "console", "filetime", + "frame-metadata", + "merkleized-metadata", + "parity-scale-codec", "parity-wasm 0.45.0", "polkavm-linker", + "sc-executor", + "sp-core", + "sp-io", "sp-maybe-compressed-blob", + "sp-tracing", + "sp-version", "strum 0.26.3", "tempfile", "toml 0.8.19", @@ -8118,9 +8207,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -8178,7 +8267,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8227,9 +8316,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "libc", @@ -8345,7 +8434,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8493,9 +8582,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "universal-hash" @@ -8631,7 +8720,7 @@ source = "git+https://github.com/open-web3-stack/wasm-bencher?branch=polkadot-st dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -8656,7 +8745,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -8678,7 +8767,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9266,7 +9355,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -9325,7 +9414,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -9345,7 +9434,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 71c1a67963..be9b924392 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -217,13 +217,14 @@ cumulus-pallet-xcm = { version = "0.16.0", default-features = false } cumulus-pallet-xcmp-queue = { version = "0.16.0", default-features = false } cumulus-primitives-core = { version = "0.15.0", default-features = false } cumulus-primitives-parachain-inherent = { version = "0.15.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.15.0", default-features = false } +cumulus-primitives-timestamp = { version = "0.15.1", default-features = false } cumulus-primitives-utility = { version = "0.16.0", default-features = false } cumulus-test-relay-sproof-builder = { version = "0.15.0", default-features = false } frame-benchmarking = { version = "37.0.0", default-features = false } frame-executive = { version = "37.0.0", default-features = false } +frame-metadata-hash-extension = { version = "0.5.0", default-features = false } frame-support = { version = "37.0.0", default-features = false } -frame-system = { version = "37.0.0", default-features = false } +frame-system = { version = "37.1.0", default-features = false } frame-system-rpc-runtime-api = { version = "34.0.0", default-features = false } frame-try-runtime = { version = "0.43.0", default-features = false } pallet-aura = { version = "36.0.0", default-features = false } @@ -260,12 +261,12 @@ polkadot-core-primitives = { version = "15.0.0", default-features = false } polkadot-parachain-primitives = { version = "14.0.0", default-features = false } polkadot-primitives = { version = "15.0.0", default-features = false } polkadot-runtime-common = { version = "16.0.0", default-features = false } -polkadot-runtime-parachains = { version = "16.0.0", default-features = false } +polkadot-runtime-parachains = { version = "16.0.1", default-features = false } sp-api = { version = "34.0.0", default-features = false } sp-application-crypto = { version = "38.0.0", default-features = false } sp-arithmetic = { version = "26.0.0", default-features = false } sp-block-builder = { version = "34.0.0", default-features = false } -sp-blockchain = { version = "37.0.0", default-features = false } +sp-blockchain = { version = "37.0.1", default-features = false } sp-consensus = { version = "0.40.0", default-features = false } sp-consensus-aura = { version = "0.40.0", default-features = false } sp-consensus-slots = { version = "0.40.0", default-features = false } @@ -297,5 +298,5 @@ xcm-builder = { version = "16.0.0", package = "staging-xcm-builder", default-fea xcm-executor = { version = "16.0.0", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -substrate-wasm-builder = { version = "24.0.0" } +substrate-wasm-builder = { version = "24.0.0", features = ["metadata-hash"] } xcm-simulator = { version = "16.0.0" } diff --git a/runtime/acala/Cargo.toml b/runtime/acala/Cargo.toml index b8f2dbd2a6..cdef5a33b5 100644 --- a/runtime/acala/Cargo.toml +++ b/runtime/acala/Cargo.toml @@ -16,6 +16,7 @@ hex-literal = { workspace = true } # substrate 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 } @@ -156,6 +157,7 @@ std = [ "serde_json/std", "frame-benchmarking/std", + "frame-metadata-hash-extension/std", "frame-executive/std", "frame-support/std", "frame-system-rpc-runtime-api/std", diff --git a/runtime/acala/build.rs b/runtime/acala/build.rs index 28667e9fba..cf447b3c80 100644 --- a/runtime/acala/build.rs +++ b/runtime/acala/build.rs @@ -18,10 +18,8 @@ #[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("ACA", 12) .build() } diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 31e126d643..8bbef049d0 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -1069,6 +1069,7 @@ where frame_system::CheckEra::::from(generic::Era::mortal(period, current_block)), runtime_common::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), + frame_metadata_hash_extension::CheckMetadataHash::new(true), module_evm::SetEvmOrigin::::new(), module_transaction_payment::ChargeTransactionPayment::::from(tip), ); @@ -1960,6 +1961,7 @@ pub type SignedExtra = ( frame_system::CheckEra, runtime_common::CheckNonce, frame_system::CheckWeight, + frame_metadata_hash_extension::CheckMetadataHash, // `SetEvmOrigin` needs ahead of `ChargeTransactionPayment`, we set origin in `SetEvmOrigin::validate()`, then // `ChargeTransactionPayment::validate()` can process erc20 token transfer successfully in the case of using erc20 // as fee token. @@ -2525,7 +2527,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig } } - let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); + let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone(); if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) { // require immortal @@ -2574,7 +2576,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig } } - let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); + let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone(); if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) { // require immortal diff --git a/runtime/karura/Cargo.toml b/runtime/karura/Cargo.toml index 0d605fcdd2..c1f879f3c0 100644 --- a/runtime/karura/Cargo.toml +++ b/runtime/karura/Cargo.toml @@ -16,6 +16,7 @@ hex-literal = { workspace = true } # substrate 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 } @@ -158,6 +159,7 @@ std = [ "serde_json/std", "frame-benchmarking/std", + "frame-metadata-hash-extension/std", "frame-executive/std", "frame-support/std", "frame-system-rpc-runtime-api/std", diff --git a/runtime/karura/build.rs b/runtime/karura/build.rs index 28667e9fba..29a56095c6 100644 --- a/runtime/karura/build.rs +++ b/runtime/karura/build.rs @@ -18,10 +18,8 @@ #[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("KAR", 12) .build() } diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index a568891bde..07839b2067 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -1075,6 +1075,7 @@ where frame_system::CheckEra::::from(generic::Era::mortal(period, current_block)), runtime_common::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), + frame_metadata_hash_extension::CheckMetadataHash::::new(true), module_evm::SetEvmOrigin::::new(), module_transaction_payment::ChargeTransactionPayment::::from(tip), ); @@ -1992,6 +1993,7 @@ pub type SignedExtra = ( frame_system::CheckEra, runtime_common::CheckNonce, frame_system::CheckWeight, + frame_metadata_hash_extension::CheckMetadataHash, // `SetEvmOrigin` needs ahead of `ChargeTransactionPayment`, we set origin in `SetEvmOrigin::validate()`, then // `ChargeTransactionPayment::validate()` can process erc20 token transfer successfully in the case of using erc20 // as fee token. @@ -2555,7 +2557,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig } } - let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); + let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone(); if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) { // require immortal @@ -2604,7 +2606,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig } } - let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); + let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone(); if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) { // require immortal