From c52044aeebe5fa212ddf79641f96d4c76310f98d Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Sun, 21 Jul 2024 17:43:06 +0800 Subject: [PATCH 01/27] upgrade to subxt 0.37.0 --- Cargo.lock | 1790 +++++++++++++-------- Cargo.toml | 4 +- client/coretime/bulk/src/lib.rs | 5 +- client/coretime/bulk/src/metadata.rs | 74 +- client/coretime/on-demand/src/metadata.rs | 158 +- 5 files changed, 1277 insertions(+), 754 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4310c35..7b725aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ dependencies = [ "cipher 0.4.4", "ctr", "ghash", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -488,7 +488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", "rayon", ] @@ -637,6 +637,17 @@ dependencies = [ "futures-lite 1.13.0", ] +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", +] + [[package]] name = "async-io" version = "1.13.0" @@ -707,6 +718,17 @@ dependencies = [ "futures-lite 1.13.0", ] +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io 2.3.3", + "blocking", + "futures-lite 2.3.0", +] + [[package]] name = "async-process" version = "1.8.1" @@ -724,6 +746,26 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "async-process" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" +dependencies = [ + "async-channel 2.3.1", + "async-io 2.3.3", + "async-lock 3.4.0", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener 5.3.1", + "futures-lite 2.3.0", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-signal" version = "0.2.8" @@ -849,7 +891,7 @@ dependencies = [ "ark-std", "dleq_vrf", "fflonk", - "merlin 3.0.0", + "merlin", "rand_chacha 0.3.1", "rand_core 0.6.4", "ring 0.1.0", @@ -889,6 +931,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -986,19 +1034,35 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", + "bitcoin_hashes 0.11.0", + "rand", "rand_core 0.6.4", "serde", "unicode-normalization", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -1099,25 +1163,13 @@ dependencies = [ "constant_time_eq 0.3.0", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", + "block-padding", "generic-array 0.14.7", ] @@ -1130,15 +1182,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - [[package]] name = "block-padding" version = "0.2.1" @@ -1158,18 +1201,6 @@ dependencies = [ "piper", ] -[[package]] -name = "bounded-collections" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" -dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", -] - [[package]] name = "bounded-collections" version = "0.2.0" @@ -1342,6 +1373,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -1372,6 +1409,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha" version = "0.3.0" @@ -1644,6 +1687,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "comfy-table" version = "7.1.1" @@ -1667,7 +1720,7 @@ dependencies = [ "ark-std", "fflonk", "getrandom_or_panic", - "merlin 3.0.0", + "merlin", "rand_chacha 0.3.1", ] @@ -1972,7 +2025,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -2004,17 +2057,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -2189,7 +2242,7 @@ dependencies = [ "sc-client-api", "scale-info", "sp-api", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-inherents", "sp-runtime 31.0.1", "sp-state-machine 0.35.0", @@ -2214,7 +2267,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-overseer", "polkadot-primitives", - "rand 0.8.5", + "rand", "sc-client-api", "sc-consensus", "sp-consensus", @@ -2357,7 +2410,7 @@ name = "cumulus-pallet-xcmp-queue" version = "0.7.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "bounded-collections 0.2.0", + "bounded-collections", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", "frame-benchmarking", @@ -2499,7 +2552,7 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "futures", - "jsonrpsee-core", + "jsonrpsee-core 0.20.3", "parity-scale-codec", "polkadot-overseer", "sc-client-api", @@ -2561,11 +2614,11 @@ dependencies = [ "either", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "pin-project", "polkadot-overseer", - "rand 0.8.5", + "rand", "sc-client-api", "sc-rpc-api", "sc-service", @@ -2603,19 +2656,6 @@ dependencies = [ "sp-trie 29.0.0", ] -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -2625,7 +2665,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -2641,7 +2681,7 @@ dependencies = [ "digest 0.10.7", "fiat-crypto", "rustc_version 0.4.0", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -2888,6 +2928,17 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "derive-where" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -2946,7 +2997,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -3116,6 +3167,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -3141,7 +3193,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -3198,7 +3250,8 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.4.1", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -3375,6 +3428,16 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "pin-project-lite 0.2.14", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -3498,15 +3561,9 @@ checksum = "fe5e43d0f78a42ad591453aedb1d7ae631ce7ee445c7643691055a9ed8d3b01c" dependencies = [ "log", "once_cell", - "rand 0.8.5", + "rand", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -3670,13 +3727,13 @@ dependencies = [ "fp-storage", "futures", "hex", - "jsonrpsee", + "jsonrpsee 0.20.3", "libsecp256k1", "log", "pallet-evm", "parity-scale-codec", "prometheus", - "rand 0.8.5", + "rand", "rlp", "sc-client-api", "sc-consensus-aura", @@ -3715,12 +3772,12 @@ source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.7.0#c5d6 dependencies = [ "ethereum", "ethereum-types", - "jsonrpsee", + "jsonrpsee 0.20.3", "rlp", "rustc-hex", "serde", "serde_json", - "sp-core-hashing 15.0.0", + "sp-core-hashing", ] [[package]] @@ -3758,7 +3815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -3771,7 +3828,7 @@ dependencies = [ "ark-poly", "ark-serialize", "ark-std", - "merlin 3.0.0", + "merlin", ] [[package]] @@ -3828,6 +3885,16 @@ dependencies = [ "scale-info", ] +[[package]] +name = "finito" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2384245d85162258a14b43567a9ee3598f5ae746a1581fb5d3d2cb780f0dbf95" +dependencies = [ + "futures-timer", + "pin-project", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -3835,7 +3902,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -4080,7 +4147,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "rand 0.8.5", + "rand", "rand_pcg", "sc-block-builder", "sc-cli", @@ -4199,12 +4266,12 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "futures", "indicatif", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "serde", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-state-machine 0.35.0", @@ -4270,7 +4337,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "syn 2.0.68", ] @@ -4600,7 +4667,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand 0.8.5", + "rand", "rand_core 0.6.4", ] @@ -4669,7 +4736,7 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -4683,7 +4750,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap 2.2.6", "slab", "tokio", @@ -4809,6 +4876,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-literal" version = "0.4.1" @@ -4840,7 +4913,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -4895,6 +4968,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -4902,7 +4986,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite 0.2.14", ] @@ -4950,7 +5034,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -4970,13 +5054,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", + "http 0.2.12", "hyper", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -5325,6 +5409,26 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.31" @@ -5349,17 +5453,39 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", + "jsonrpsee-core 0.20.3", + "jsonrpsee-http-client 0.20.3", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types", - "jsonrpsee-ws-client", + "jsonrpsee-types 0.20.3", + "jsonrpsee-ws-client 0.20.3", "tokio", "tracing", ] +[[package]] +name = "jsonrpsee" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" +dependencies = [ + "jsonrpsee-client-transport 0.22.5", + "jsonrpsee-core 0.22.5", + "jsonrpsee-http-client 0.22.5", + "jsonrpsee-types 0.22.5", +] + +[[package]] +name = "jsonrpsee" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" +dependencies = [ + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "jsonrpsee-ws-client 0.23.2", +] + [[package]] name = "jsonrpsee-client-transport" version = "0.20.3" @@ -5367,14 +5493,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" dependencies = [ "futures-util", - "http", - "jsonrpsee-core", + "http 0.2.12", + "jsonrpsee-core 0.20.3", + "pin-project", + "rustls-native-certs 0.6.3", + "soketto 0.7.1", + "thiserror", + "tokio", + "tokio-rustls 0.24.1", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" +dependencies = [ + "futures-util", + "http 0.2.12", + "jsonrpsee-core 0.22.5", + "pin-project", + "rustls-native-certs 0.7.1", + "rustls-pki-types", + "soketto 0.7.1", + "thiserror", + "tokio", + "tokio-rustls 0.25.0", + "tokio-util", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" +dependencies = [ + "base64 0.22.1", + "futures-util", + "http 1.1.0", + "jsonrpsee-core 0.23.2", "pin-project", - "rustls-native-certs", - "soketto", + "rustls 0.23.11", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto 0.8.0", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tracing", "url", @@ -5393,81 +5563,146 @@ dependencies = [ "futures-timer", "futures-util", "hyper", - "jsonrpsee-types", + "jsonrpsee-types 0.20.3", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "rustc-hash", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "thiserror", "tokio", "tracing", ] [[package]] -name = "jsonrpsee-http-client" -version = "0.20.3" +name = "jsonrpsee-core" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" dependencies = [ + "anyhow", "async-trait", + "beef", + "futures-timer", + "futures-util", "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-types 0.22.5", + "pin-project", + "rustc-hash", "serde", "serde_json", "thiserror", "tokio", - "tower", + "tokio-stream", "tracing", - "url", ] [[package]] -name = "jsonrpsee-proc-macros" -version = "0.20.3" +name = "jsonrpsee-core" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" +checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", - "syn 1.0.109", + "anyhow", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "jsonrpsee-types 0.23.2", + "pin-project", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", ] [[package]] -name = "jsonrpsee-server" +name = "jsonrpsee-http-client" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" dependencies = [ - "futures-util", - "http", + "async-trait", "hyper", - "jsonrpsee-core", - "jsonrpsee-types", - "route-recognizer", + "hyper-rustls", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", "serde", "serde_json", - "soketto", "thiserror", "tokio", - "tokio-stream", - "tokio-util", "tower", "tracing", + "url", ] [[package]] -name = "jsonrpsee-types" -version = "0.20.3" +name = "jsonrpsee-http-client" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" dependencies = [ - "anyhow", + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core 0.22.5", + "jsonrpsee-types 0.22.5", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "route-recognizer", + "serde", + "serde_json", + "soketto 0.7.1", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +dependencies = [ + "anyhow", "beef", "serde", "serde_json", @@ -5475,16 +5710,55 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-types" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" +dependencies = [ + "beef", + "http 1.1.0", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "jsonrpsee-ws-client" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "http 0.2.12", + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "url", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" +dependencies = [ + "http 1.1.0", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", "url", ] @@ -5498,6 +5772,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -5674,7 +5949,7 @@ dependencies = [ "parking_lot 0.12.3", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand", "rw-stream-sink", "smallvec", "thiserror", @@ -5730,7 +6005,7 @@ dependencies = [ "multiaddr", "multihash 0.17.0", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "thiserror", "zeroize", @@ -5755,7 +6030,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "smallvec", "thiserror", @@ -5777,7 +6052,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.10", "tokio", @@ -5813,7 +6088,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.8", "snow", "static_assertions", @@ -5835,7 +6110,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "void", ] @@ -5855,7 +6130,7 @@ dependencies = [ "log", "parking_lot 0.12.3", "quinn-proto", - "rand 0.8.5", + "rand", "rustls 0.20.9", "thiserror", "tokio", @@ -5873,7 +6148,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand", "smallvec", ] @@ -5892,7 +6167,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand 0.8.5", + "rand", "smallvec", "tokio", "void", @@ -5972,9 +6247,9 @@ dependencies = [ "parking_lot 0.12.3", "quicksink", "rw-stream-sink", - "soketto", + "soketto 0.7.1", "url", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -6028,7 +6303,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -6042,7 +6317,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -6533,18 +6808,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "merlin" version = "3.0.0" @@ -6564,7 +6827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ "futures", - "rand 0.8.5", + "rand", "thrift", ] @@ -6611,10 +6874,10 @@ dependencies = [ "lioness", "log", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "rand_distr", - "subtle 2.4.1", + "subtle 2.6.1", "thiserror", "zeroize", ] @@ -6643,7 +6906,7 @@ name = "mmr-rpc" version = "28.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "serde", "sp-api", @@ -6805,7 +7068,7 @@ dependencies = [ "num", "parity-scale-codec", "primitive-types", - "rand 0.8.5", + "rand", "ref-cast", "scale-info", "serde", @@ -6984,7 +7247,7 @@ dependencies = [ "num", "once_cell", "pretty", - "rand 0.8.5", + "rand", "serde", "serde_json", "simplelog", @@ -7013,7 +7276,7 @@ dependencies = [ "num", "once_cell", "pretty", - "rand 0.8.5", + "rand", "regex", "serde", "serde_json", @@ -7453,7 +7716,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -8291,7 +8554,7 @@ dependencies = [ "pallet-balances", "pallet-session", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "sp-runtime 31.0.1", "sp-staking", @@ -8331,7 +8594,7 @@ dependencies = [ "pallet-contracts-proc-macro", "pallet-contracts-uapi", "parity-scale-codec", - "rand 0.8.5", + "rand", "rand_pcg", "scale-info", "serde", @@ -8432,7 +8695,7 @@ dependencies = [ "log", "pallet-election-provider-support-benchmarking", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "sp-arithmetic 23.0.0", "sp-core 28.0.0", @@ -8827,7 +9090,7 @@ version = "0.1.0" source = "git+https://github.com/Magport/pallet-move?branch=main#3c477380e724de6c0290694874cce999cfa768d8" dependencies = [ "frame-support", - "jsonrpsee", + "jsonrpsee 0.20.3", "pallet-move", "parity-scale-codec", "serde", @@ -9016,7 +9279,7 @@ dependencies = [ name = "pallet-pot-rpc" version = "0.1.0" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "pallet-pot-runtime-api", "sp-api", "sp-blockchain", @@ -9226,7 +9489,7 @@ dependencies = [ "pallet-session", "pallet-staking", "parity-scale-codec", - "rand 0.8.5", + "rand", "sp-runtime 31.0.1", "sp-session", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", @@ -9396,7 +9659,7 @@ name = "pallet-transaction-payment-rpc" version = "30.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -9489,7 +9752,7 @@ name = "pallet-xcm" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "bounded-collections 0.2.0", + "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", @@ -9559,7 +9822,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "futures", "hex-literal", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "mc-coretime-bulk", "mc-coretime-on-demand", @@ -9761,6 +10024,19 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-db" version = "0.4.13" @@ -9776,7 +10052,7 @@ dependencies = [ "lz4", "memmap2 0.5.10", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "siphasher 0.3.11", "snap", "winapi", @@ -9890,6 +10166,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle 2.6.1", +] + [[package]] name = "paste" version = "1.0.15" @@ -9902,7 +10189,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", ] [[package]] @@ -9912,6 +10199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "password-hash", ] [[package]] @@ -10036,7 +10324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", - "rand 0.8.5", + "rand", ] [[package]] @@ -10129,7 +10417,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", + "rand", "tracing-gum", ] @@ -10145,7 +10433,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", + "rand", "tracing-gum", ] @@ -10164,7 +10452,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", + "rand", "schnellru", "sp-core 28.0.0", "sp-keystore 0.34.0", @@ -10187,7 +10475,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", + "rand", "sc-network", "schnellru", "thiserror", @@ -10307,13 +10595,13 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "sc-network", "sc-network-common", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-keystore 0.34.0", "tracing-gum", ] @@ -10370,7 +10658,7 @@ dependencies = [ "futures-timer", "itertools 0.10.5", "kvdb", - "merlin 3.0.0", + "merlin", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -10378,7 +10666,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "rand_core 0.6.4", "sc-keystore", @@ -10592,7 +10880,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-parachain-primitives", "polkadot-primitives", - "rand 0.8.5", + "rand", "slotmap", "sp-core 28.0.0", "sp-maybe-compressed-blob", @@ -10638,7 +10926,7 @@ dependencies = [ "sc-executor-wasmtime", "seccompiler", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-io 30.0.0", "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", @@ -10714,7 +11002,7 @@ dependencies = [ "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", - "rand 0.8.5", + "rand", "sc-authority-discovery", "sc-network", "strum 0.24.1", @@ -10808,7 +11096,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "prioritized-metered-channel", - "rand 0.8.5", + "rand", "sc-client-api", "schnellru", "sp-application-crypto 30.0.0", @@ -10845,7 +11133,7 @@ name = "polkadot-parachain-primitives" version = "6.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "bounded-collections 0.2.0", + "bounded-collections", "derive_more", "parity-scale-codec", "polkadot-core-primitives", @@ -10888,7 +11176,7 @@ name = "polkadot-rpc" version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "mmr-rpc", "pallet-transaction-payment-rpc", "polkadot-primitives", @@ -11009,7 +11297,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "rustc-hex", "scale-info", @@ -11188,6 +11476,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c" +[[package]] +name = "polkavm-common" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" + [[package]] name = "polkavm-common" version = "0.9.0" @@ -11204,13 +11498,22 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "polkavm-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +dependencies = [ + "polkavm-derive-impl-macro 0.8.0", +] + [[package]] name = "polkavm-derive" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.9.0", ] [[package]] @@ -11225,6 +11528,18 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "polkavm-derive-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +dependencies = [ + "polkavm-common 0.8.0", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "polkavm-derive-impl" version = "0.9.0" @@ -11237,6 +11552,16 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +dependencies = [ + "polkavm-derive-impl 0.8.0", + "syn 2.0.68", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.9.0" @@ -11354,7 +11679,7 @@ dependencies = [ "prettyplease 0.2.20", "proc-macro2", "quote", - "sp-core-hashing 15.0.0", + "sp-core-hashing", "syn 1.0.109", ] @@ -11689,7 +12014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "rand 0.8.5", + "rand", "ring 0.16.20", "rustc-hash", "rustls 0.20.9", @@ -11715,19 +12040,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -11784,16 +12096,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "rand", ] [[package]] @@ -11852,6 +12155,22 @@ dependencies = [ "yasna", ] +[[package]] +name = "reconnecting-jsonrpsee-ws-client" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06fa4f17e09edfc3131636082faaec633c7baa269396b4004040bc6c52f49f65" +dependencies = [ + "cfg_aliases 0.2.1", + "finito", + "futures", + "jsonrpsee 0.23.2", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -11995,7 +12314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -12011,7 +12330,7 @@ dependencies = [ "blake2 0.10.6", "common", "fflonk", - "merlin 3.0.0", + "merlin", ] [[package]] @@ -12346,10 +12665,39 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle 2.6.1", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +dependencies = [ + "log", + "once_cell", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle 2.6.1", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -12357,7 +12705,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -12371,6 +12732,49 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-platform-verifier" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.11", + "rustls-native-certs 0.7.1", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.5", + "security-framework", + "security-framework-sys", + "webpki-roots 0.26.3", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -12381,6 +12785,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -12480,7 +12895,7 @@ dependencies = [ "parity-scale-codec", "prost 0.12.6", "prost-build", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network", "sp-api", @@ -12549,7 +12964,7 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-genesis-builder", "sp-io 30.0.0", "sp-runtime 31.0.1", @@ -12583,7 +12998,7 @@ dependencies = [ "log", "names", "parity-scale-codec", - "rand 0.8.5", + "rand", "regex", "rpassword", "sc-client-api", @@ -12601,7 +13016,7 @@ dependencies = [ "sp-core 28.0.0", "sp-keyring", "sp-keystore 0.34.0", - "sp-panic-handler 13.0.0", + "sp-panic-handler 13.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-runtime 31.0.1", "sp-version", "thiserror", @@ -12743,7 +13158,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-slots", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-inherents", "sp-keystore 0.34.0", "sp-runtime 31.0.1", @@ -12757,7 +13172,7 @@ version = "0.34.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.20.3", "sc-consensus-babe", "sc-consensus-epochs", "sc-rpc-api", @@ -12799,7 +13214,7 @@ dependencies = [ "sp-consensus", "sp-consensus-beefy", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-keystore 0.34.0", "sp-mmr-primitives", "sp-runtime 31.0.1", @@ -12815,7 +13230,7 @@ version = "13.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -12857,7 +13272,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -12877,7 +13292,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-keystore 0.34.0", "sp-runtime 31.0.1", "substrate-prometheus-endpoint", @@ -12891,7 +13306,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "finality-grandpa", "futures", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "sc-client-api", @@ -12913,7 +13328,7 @@ dependencies = [ "async-trait", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "sc-client-api", @@ -12976,7 +13391,7 @@ dependencies = [ "sp-core 28.0.0", "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-io 30.0.0", - "sp-panic-handler 13.0.0", + "sp-panic-handler 13.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-trie 29.0.0", "sp-version", @@ -13097,7 +13512,7 @@ dependencies = [ "parking_lot 0.12.3", "partial_sort", "pin-project", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network-common", "sc-utils", @@ -13267,7 +13682,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network", "sc-network-common", @@ -13298,7 +13713,7 @@ version = "29.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -13329,7 +13744,7 @@ name = "sc-rpc-api" version = "0.33.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -13349,8 +13764,8 @@ name = "sc-rpc-server" version = "11.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "http", - "jsonrpsee", + "http 0.2.12", + "jsonrpsee 0.20.3", "log", "serde_json", "substrate-prometheus-endpoint", @@ -13368,7 +13783,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -13399,12 +13814,12 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "parking_lot 0.12.3", "pin-project", - "rand 0.8.5", + "rand", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -13481,7 +13896,7 @@ name = "sc-sync-state-rpc" version = "0.34.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "sc-chain-spec", "sc-client-api", @@ -13504,14 +13919,14 @@ dependencies = [ "futures", "libc", "log", - "rand 0.8.5", + "rand", "rand_pcg", "regex", "sc-telemetry", "serde", "serde_json", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-io 30.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", ] @@ -13527,7 +13942,7 @@ dependencies = [ "log", "parking_lot 0.12.3", "pin-project", - "rand 0.8.5", + "rand", "sc-utils", "serde", "serde_json", @@ -13595,7 +14010,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-runtime 31.0.1", "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-transaction-pool", @@ -13636,38 +14051,38 @@ dependencies = [ [[package]] name = "scale-bits" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" dependencies = [ "parity-scale-codec", "scale-info", + "scale-type-resolver", "serde", ] [[package]] name = "scale-decode" -version = "0.10.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-decode-derive", - "scale-info", + "scale-type-resolver", "smallvec", ] [[package]] name = "scale-decode-derive" -version = "0.10.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" +checksum = "9bb22f574168103cdd3133b19281639ca65ad985e24612728f727339dcaf4021" dependencies = [ "darling 0.14.4", - "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -13675,24 +14090,24 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.5.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" +checksum = "4ba0b9c48dc0eb20c60b083c29447c0c4617cb7c4a4c9fef72aa5c5bc539e15e" dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", "scale-bits", "scale-encode-derive", - "scale-info", + "scale-type-resolver", "smallvec", ] [[package]] name = "scale-encode-derive" -version = "0.5.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +checksum = "82ab7e60e2d9c8d47105f44527b26f04418e5e624ffc034f6b4a86c0ba19c5bf" dependencies = [ "darling 0.14.4", "proc-macro-crate 1.1.3", @@ -13728,22 +14143,46 @@ dependencies = [ ] [[package]] -name = "scale-value" -version = "0.13.0" +name = "scale-type-resolver" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" dependencies = [ - "base58", - "blake2 0.10.6", - "derive_more", - "either", - "frame-metadata 15.1.0", - "parity-scale-codec", - "scale-bits", - "scale-decode", - "scale-encode", "scale-info", - "serde", + "smallvec", +] + +[[package]] +name = "scale-typegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498d1aecf2ea61325d4511787c115791639c0fd21ef4f8e11e49dd09eff2bbac" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.68", + "thiserror", +] + +[[package]] +name = "scale-value" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cf9738c263c665144177201126bdad39d3d62512152f178f35002228026976" +dependencies = [ + "base58", + "blake2 0.10.6", + "derive_more", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-type-resolver", + "serde", "yap", ] @@ -13767,24 +14206,6 @@ dependencies = [ "hashbrown 0.13.2", ] -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin 2.0.1", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle 2.4.1", - "zeroize", -] - [[package]] name = "schnorrkel" version = "0.10.2" @@ -13794,7 +14215,7 @@ dependencies = [ "arrayref", "arrayvec 0.7.4", "curve25519-dalek-ng", - "merlin 3.0.0", + "merlin", "rand_core 0.6.4", "sha2 0.9.9", "subtle-ng", @@ -13812,11 +14233,11 @@ dependencies = [ "arrayvec 0.7.4", "curve25519-dalek 4.1.3", "getrandom_or_panic", - "merlin 3.0.0", + "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -13852,7 +14273,8 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.4.1", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -13865,31 +14287,13 @@ dependencies = [ "libc", ] -[[package]] -name = "secp256k1" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" -dependencies = [ - "secp256k1-sys 0.6.1", -] - [[package]] name = "secp256k1" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "secp256k1-sys 0.9.2", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" -dependencies = [ - "cc", + "secp256k1-sys", ] [[package]] @@ -13920,6 +14324,7 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] @@ -14015,6 +14420,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -14039,18 +14454,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -14149,6 +14552,12 @@ name = "simple-mermaid" version = "0.1.0" source = "git+https://github.com/kianenigma/simple-mermaid.git?rev=e48b187bcfd5cc75111acd9d241f1bd36604344b#e48b187bcfd5cc75111acd9d241f1bd36604344b" +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + [[package]] name = "simplelog" version = "0.9.0" @@ -14242,15 +14651,32 @@ checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ "async-channel 1.9.0", "async-executor", - "async-fs", + "async-fs 1.6.0", "async-io 1.13.0", "async-lock 2.8.0", - "async-net", - "async-process", + "async-net 1.8.0", + "async-process 1.8.1", "blocking", "futures-lite 1.13.0", ] +[[package]] +name = "smol" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e635339259e51ef85ac7aa29a1cd991b957047507288697a690e80ab97d07cad" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-fs 2.1.2", + "async-io 2.3.3", + "async-lock 3.4.0", + "async-net 2.0.0", + "async-process 2.2.3", + "blocking", + "futures-lite 2.3.0", +] + [[package]] name = "smoldot" version = "0.11.0" @@ -14278,7 +14704,7 @@ dependencies = [ "hmac 0.12.1", "itertools 0.11.0", "libsecp256k1", - "merlin 3.0.0", + "merlin", "no-std-net", "nom", "num-bigint", @@ -14287,7 +14713,7 @@ dependencies = [ "pbkdf2 0.12.2", "pin-project", "poly1305", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "ruzstd 0.4.0", "schnorrkel 0.10.2", @@ -14298,7 +14724,7 @@ dependencies = [ "siphasher 0.3.11", "slab", "smallvec", - "soketto", + "soketto 0.7.1", "twox-hash", "wasmi", "x25519-dalek 2.0.1", @@ -14307,9 +14733,9 @@ dependencies = [ [[package]] name = "smoldot" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca99148e026936bbc444c3708748207033968e4ef1c33bfc885660ae4d44d21" +checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" dependencies = [ "arrayvec 0.7.4", "async-lock 3.4.0", @@ -14323,17 +14749,17 @@ dependencies = [ "derive_more", "ed25519-zebra 4.0.3", "either", - "event-listener 3.1.0", + "event-listener 4.0.3", "fnv", "futures-lite 2.3.0", "futures-util", "hashbrown 0.14.5", "hex", "hmac 0.12.1", - "itertools 0.11.0", + "itertools 0.12.1", "libm", "libsecp256k1", - "merlin 3.0.0", + "merlin", "no-std-net", "nom", "num-bigint", @@ -14342,7 +14768,7 @@ dependencies = [ "pbkdf2 0.12.2", "pin-project", "poly1305", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "ruzstd 0.5.0", "schnorrkel 0.11.4", @@ -14353,7 +14779,7 @@ dependencies = [ "siphasher 1.0.1", "slab", "smallvec", - "soketto", + "soketto 0.7.1", "twox-hash", "wasmi", "x25519-dalek 2.0.1", @@ -14385,22 +14811,22 @@ dependencies = [ "no-std-net", "parking_lot 0.12.3", "pin-project", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "serde", "serde_json", "siphasher 0.3.11", "slab", - "smol", + "smol 1.3.0", "smoldot 0.11.0", "zeroize", ] [[package]] name = "smoldot-light" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e6f1898682b618b81570047b9d870b3faaff6ae1891b468eddd94d7f903c2fe" +checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" dependencies = [ "async-channel 2.3.1", "async-lock 3.4.0", @@ -14408,27 +14834,27 @@ dependencies = [ "blake2-rfc", "derive_more", "either", - "event-listener 3.1.0", + "event-listener 4.0.3", "fnv", "futures-channel", "futures-lite 2.3.0", "futures-util", "hashbrown 0.14.5", "hex", - "itertools 0.11.0", + "itertools 0.12.1", "log", "lru 0.12.3", "no-std-net", "parking_lot 0.12.3", "pin-project", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "serde", "serde_json", "siphasher 1.0.1", "slab", - "smol", - "smoldot 0.14.0", + "smol 2.0.0", + "smoldot 0.16.0", "zeroize", ] @@ -14452,7 +14878,7 @@ dependencies = [ "ring 0.17.8", "rustc_version 0.4.0", "sha2 0.10.8", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -14485,13 +14911,28 @@ dependencies = [ "bytes", "flate2", "futures", - "http", + "http 0.2.12", "httparse", "log", - "rand 0.8.5", + "rand", "sha-1", ] +[[package]] +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "httparse", + "log", + "rand", + "sha1", +] + [[package]] name = "sp-api" version = "26.0.0" @@ -14529,57 +14970,57 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23030de8eae0272c705cf3e2ce0523a64708a6b53aa23f3cf9053ca63abd08d7" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 26.0.0", - "sp-io 28.0.0", - "sp-std 12.0.0", + "sp-core 28.0.0", + "sp-io 30.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", ] [[package]] name = "sp-application-crypto" -version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13ca6121c22c8bd3d1dce1f05c479101fd0d7b159bef2a3e8c834138d839c75c" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 28.0.0", - "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-core 31.0.0", + "sp-io 33.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sp-arithmetic" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9cf6e5c0c7c2e7be3a4a10af5316d2d40182915509a70f632a66c238a05c37b" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 12.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "static_assertions", ] [[package]] name = "sp-arithmetic" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions", ] @@ -14706,7 +15147,7 @@ dependencies = [ "sp-api", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-io 30.0.0", "sp-mmr-primitives", "sp-runtime 31.0.1", @@ -14746,15 +15187,15 @@ dependencies = [ [[package]] name = "sp-core" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0db34a19be2efa0398a9506a365392d93a85220856d55e0eb78165ad2e1bedc" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "array-bytes 6.2.3", + "bandersnatch_vrfs", "bip39", "bitflags 1.3.2", "blake2 0.10.6", - "bounded-collections 0.1.9", + "bounded-collections", "bs58 0.5.1", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -14763,29 +15204,27 @@ dependencies = [ "hash256-std-hasher", "impl-serde", "itertools 0.10.5", - "lazy_static", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin", "parity-scale-codec", "parking_lot 0.12.3", "paste", "primitive-types", - "rand 0.8.5", - "regex", + "rand", "scale-info", - "schnorrkel 0.9.1", - "secp256k1 0.24.3", + "schnorrkel 0.11.4", + "secp256k1", "secrecy", "serde", - "sp-core-hashing 13.0.0", - "sp-debug-derive 12.0.0", - "sp-externalities 0.23.0", - "sp-runtime-interface 22.0.0", - "sp-std 12.0.0", - "sp-storage 17.0.0", + "sp-crypto-hashing 0.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.4.6", "thiserror", "tracing", "w3f-bls", @@ -14794,15 +15233,14 @@ dependencies = [ [[package]] name = "sp-core" -version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d7a0fd8f16dcc3761198fc83be12872f823b37b749bc72a3a6a1f702509366" dependencies = [ "array-bytes 6.2.3", - "bandersnatch_vrfs", - "bip39", "bitflags 1.3.2", "blake2 0.10.6", - "bounded-collections 0.2.0", + "bounded-collections", "bs58 0.5.1", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -14811,53 +15249,41 @@ dependencies = [ "hash256-std-hasher", "impl-serde", "itertools 0.10.5", + "k256", "libsecp256k1", "log", - "merlin 3.0.0", + "merlin", + "parity-bip39", "parity-scale-codec", "parking_lot 0.12.3", "paste", "primitive-types", - "rand 0.8.5", + "rand", "scale-info", "schnorrkel 0.11.4", - "secp256k1 0.28.2", + "secp256k1", "secrecy", "serde", - "sp-crypto-hashing", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-crypto-hashing 0.1.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.27.0", + "sp-runtime-interface 26.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 20.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.5.0", "thiserror", "tracing", "w3f-bls", "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3 0.10.8", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "15.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", ] [[package]] @@ -14893,13 +15319,27 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3 0.10.8", + "twox-hash", +] + [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "quote", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "syn 2.0.68", ] @@ -14914,9 +15354,9 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "12.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50535e1a5708d3ba5c1195b59ebefac61cc8679c2c24716b87a86e8b7ed2e4a1" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", @@ -14945,35 +15385,35 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884d05160bc89d0943d1c9fb8006c3d44b80f37f8af607aeff8d4d9cc82e279a" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 12.0.0", - "sp-storage 17.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", ] [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-externalities" -version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 20.0.0", ] [[package]] @@ -15003,9 +15443,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301c0ce94f80b324465a6f6173183aa07b26bd71d67f94a44de1fd11dea4a7cb" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "bytes", "ed25519-dalek", @@ -15013,40 +15452,43 @@ dependencies = [ "log", "parity-scale-codec", "rustversion", - "secp256k1 0.24.3", - "sp-core 26.0.0", - "sp-externalities 0.23.0", - "sp-keystore 0.32.0", - "sp-runtime-interface 22.0.0", - "sp-state-machine 0.33.0", - "sp-std 12.0.0", - "sp-tracing 14.0.0", - "sp-trie 27.0.0", + "secp256k1", + "sp-core 28.0.0", + "sp-crypto-hashing 0.0.0", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-keystore 0.34.0", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-state-machine 0.35.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-trie 29.0.0", "tracing", "tracing-core", ] [[package]] name = "sp-io" -version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e09bba780b55bd9e67979cd8f654a31e4a6cf45426ff371394a65953d2177f2" dependencies = [ "bytes", "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive 0.9.1", "rustversion", - "secp256k1 0.28.2", - "sp-core 28.0.0", - "sp-crypto-hashing", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-keystore 0.34.0", - "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-trie 29.0.0", + "secp256k1", + "sp-core 31.0.0", + "sp-crypto-hashing 0.1.0", + "sp-externalities 0.27.0", + "sp-keystore 0.37.0", + "sp-runtime-interface 26.0.0", + "sp-state-machine 0.38.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 16.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 32.0.0", "tracing", "tracing-core", ] @@ -15063,27 +15505,26 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db18ab01b2684856904c973d2be7dbf9ab3607cf706a7bd6648812662e5e7c5" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 26.0.0", - "sp-externalities 0.23.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "thiserror", ] [[package]] name = "sp-keystore" -version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbab8b61bd61d5f8625a0c75753b5d5a23be55d3445419acd42caf59cf6236b" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 28.0.0", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "thiserror", + "sp-core 31.0.0", + "sp-externalities 0.27.0", ] [[package]] @@ -15162,9 +15603,9 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" +checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" dependencies = [ "backtrace", "lazy_static", @@ -15191,29 +15632,6 @@ dependencies = [ "sp-core 28.0.0", ] -[[package]] -name = "sp-runtime" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082bae4a164b8b629ce9cee79ff3c6b20e66d11d8ef37398796567d616325da4" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "sp-application-crypto 28.0.0", - "sp-arithmetic 21.0.0", - "sp-core 26.0.0", - "sp-io 28.0.0", - "sp-std 12.0.0", - "sp-weights 25.0.0", -] - [[package]] name = "sp-runtime" version = "31.0.1" @@ -15226,10 +15644,10 @@ dependencies = [ "log", "parity-scale-codec", "paste", - "rand 0.8.5", + "rand", "scale-info", "serde", - "simple-mermaid", + "simple-mermaid 0.1.0", "sp-application-crypto 30.0.0", "sp-arithmetic 23.0.0", "sp-core 28.0.0", @@ -15239,22 +15657,28 @@ dependencies = [ ] [[package]] -name = "sp-runtime-interface" -version = "22.0.0" +name = "sp-runtime" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695bba5d981a6fd3131b098d65f620601bd822501612bfb65897d4bb660762b1" +checksum = "ec3cb126971e7db2f0fcf8053dce740684c438c7180cfca1959598230f342c58" dependencies = [ - "bytes", + "docify", + "either", + "hash256-std-hasher", "impl-trait-for-tuples", + "log", "parity-scale-codec", - "primitive-types", - "sp-externalities 0.23.0", - "sp-runtime-interface-proc-macro 15.0.0", - "sp-std 12.0.0", - "sp-storage 17.0.0", - "sp-tracing 14.0.0", - "sp-wasm-interface 18.0.0", - "static_assertions", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid 0.1.1", + "sp-application-crypto 33.0.0", + "sp-arithmetic 25.0.0", + "sp-core 31.0.0", + "sp-io 33.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights 30.0.0", ] [[package]] @@ -15295,13 +15719,33 @@ dependencies = [ ] [[package]] -name = "sp-runtime-interface-proc-macro" -version = "15.0.0" +name = "sp-runtime-interface" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2afcbd1bd18d323371111b66b7ac2870bdc1c86c3d7b0dae67b112ca52b4d8" +checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.8.0", + "primitive-types", + "sp-externalities 0.27.0", + "sp-runtime-interface-proc-macro 18.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 20.0.0", + "sp-tracing 16.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 20.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "Inflector", - "proc-macro-crate 1.1.3", + "expander 2.2.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.68", @@ -15310,7 +15754,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" dependencies = [ "Inflector", "expander 2.2.1", @@ -15322,8 +15766,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander 2.2.1", @@ -15364,21 +15809,20 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7c6680d9342c22c10d8272ebf9f0339b0e439b3e67b68f5627f9dfc6926a07" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "smallvec", - "sp-core 26.0.0", - "sp-externalities 0.23.0", - "sp-panic-handler 12.0.0", - "sp-std 12.0.0", - "sp-trie 27.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-panic-handler 13.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-trie 29.0.0", "thiserror", "tracing", "trie-db", @@ -15386,20 +15830,21 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eae0eac8034ba14437e772366336f579398a46d101de13dbb781ab1e35e67c5" dependencies = [ "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "smallvec", - "sp-core 28.0.0", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-panic-handler 13.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-trie 29.0.0", + "sp-core 31.0.0", + "sp-externalities 0.27.0", + "sp-panic-handler 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 32.0.0", "thiserror", "tracing", "trie-db", @@ -15415,13 +15860,13 @@ dependencies = [ "ed25519-dalek", "hkdf", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "sha2 0.10.8", "sp-api", "sp-application-crypto 30.0.0", "sp-core 28.0.0", - "sp-crypto-hashing", + "sp-crypto-hashing 0.0.0", "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "sp-runtime 31.0.1", "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", @@ -15432,9 +15877,9 @@ dependencies = [ [[package]] name = "sp-std" -version = "12.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c78c5a66682568cc7b153603c5d01a2cc8f5c221c7b1e921517a0eef18ae05" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-std" @@ -15448,41 +15893,41 @@ source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90 [[package]] name = "sp-storage" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016f20812cc51bd479cc88d048c35d44cd3adde4accdb159d49d6050f2953595" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 12.0.0", - "sp-std 12.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", ] [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-storage" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#7c6ab07193e60a06de14f90fd3f618ac72ff17b6" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -15500,12 +15945,12 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "14.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d727cb5265641ffbb7d4e42c18b63e29f6cfdbd240aae3bcf093c3d6eb29a19" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" dependencies = [ "parity-scale-codec", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", "tracing-core", "tracing-subscriber 0.2.25", @@ -15560,23 +16005,22 @@ dependencies = [ [[package]] name = "sp-trie" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c4bf89a5bd74f696cd1f23d83bb6abe6bd0abad1f3c70d4b0d7ebec4098cfe" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "ahash 0.8.11", "hash-db", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "scale-info", "schnellru", - "sp-core 26.0.0", - "sp-std 12.0.0", + "sp-core 28.0.0", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", "thiserror", "tracing", "trie-db", @@ -15585,8 +16029,9 @@ dependencies = [ [[package]] name = "sp-trie" -version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1aa91ad26c62b93d73e65f9ce7ebd04459c4bad086599348846a81988d6faa4" dependencies = [ "ahash 0.8.11", "hash-db", @@ -15595,12 +16040,12 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "scale-info", "schnellru", - "sp-core 28.0.0", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-core 31.0.0", + "sp-externalities 0.27.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "tracing", "trie-db", @@ -15637,15 +16082,15 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "18.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d85813d46a22484cdf5e5afddbbe85442dd1b4d84d67a8c7792f92f9f93607" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 12.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "wasmtime", ] @@ -15674,33 +16119,33 @@ dependencies = [ [[package]] name = "sp-weights" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1689f9594c2c4d09ede3d8a991a9eb900654e424fb00b62f2b370170af347acd" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 21.0.0", - "sp-core 26.0.0", - "sp-debug-derive 12.0.0", - "sp-std 12.0.0", + "sp-arithmetic 23.0.0", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", ] [[package]] name = "sp-weights" -version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af6c661fe3066b29f9e1d258000f402ff5cc2529a9191972d214e5871d0ba87" dependencies = [ - "bounded-collections 0.2.0", + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 23.0.0", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0)", + "sp-arithmetic 25.0.0", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -15900,7 +16345,7 @@ version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "array-bytes 6.2.3", - "bounded-collections 0.2.0", + "bounded-collections", "derivative", "environmental", "impl-trait-for-tuples", @@ -15968,7 +16413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ "bitflags 1.3.2", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", "parking_lot 0.11.2", "parking_lot_core 0.8.6", @@ -15982,7 +16427,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.1.1", "memchr", "proc-macro2", "quote", @@ -15998,7 +16443,7 @@ dependencies = [ "bitflags 1.3.2", "byteorder", "keccak", - "subtle 2.4.1", + "subtle 2.6.1", "zeroize", ] @@ -16068,6 +16513,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bip39" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b564c293e6194e8b222e52436bcb99f60de72043c7f845cf6c4406db4df121" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel 0.11.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "substrate-build-script-utils" version = "11.0.0" @@ -16080,7 +16538,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "parity-scale-codec", "sc-rpc-api", @@ -16110,7 +16568,7 @@ version = "0.33.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ "async-trait", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "sc-rpc-api", "serde", @@ -16122,7 +16580,7 @@ name = "substrate-state-trie-migration-rpc" version = "27.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.0#851c824dc7a8e7e6db2d0c9fb29d232f2f45198a" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "sc-client-api", "sc-rpc-api", @@ -16160,9 +16618,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" @@ -16172,22 +16630,22 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7cf683962113b84ce5226bdf6f27d7f92a7e5bb408a5231f6c205407fbb20df" +checksum = "a160cba1edbf3ec4fbbeaea3f1a185f70448116a6bccc8276bb39adb3b3053bd" dependencies = [ "async-trait", - "base58", - "blake2 0.10.6", - "derivative", + "derive-where", "either", "frame-metadata 16.0.0", "futures", "hex", "impl-serde", - "jsonrpsee", + "instant", + "jsonrpsee 0.22.5", "parity-scale-codec", "primitive-types", + "reconnecting-jsonrpsee-ws-client", "scale-bits", "scale-decode", "scale-encode", @@ -16195,47 +16653,78 @@ dependencies = [ "scale-value", "serde", "serde_json", - "sp-core 26.0.0", - "sp-core-hashing 13.0.0", - "sp-runtime 29.0.0", + "sp-crypto-hashing 0.1.0", + "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "thiserror", + "tokio-util", "tracing", + "url", ] [[package]] name = "subxt-codegen" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12800ad6128b4bfc93d2af89b7d368bff7ea2f6604add35f96f6a8c06c7f9abf" +checksum = "d703dca0905cc5272d7cc27a4ac5f37dcaae7671acc7fef0200057cc8c317786" dependencies = [ "frame-metadata 16.0.0", - "heck 0.4.1", + "heck 0.5.0", "hex", - "jsonrpsee", + "jsonrpsee 0.22.5", "parity-scale-codec", "proc-macro2", "quote", "scale-info", + "scale-typegen", "subxt-metadata", "syn 2.0.68", "thiserror", "tokio", ] +[[package]] +name = "subxt-core" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f41eb2e2eea6ed45649508cc735f92c27f1fcfb15229e75f8270ea73177345" +dependencies = [ + "base58", + "blake2 0.10.6", + "derive-where", + "frame-metadata 16.0.0", + "hashbrown 0.14.5", + "hex", + "impl-serde", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 31.0.0", + "sp-crypto-hashing 0.1.0", + "sp-runtime 34.0.0", + "subxt-metadata", + "tracing", +] + [[package]] name = "subxt-lightclient" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243765099b60d97dc7fc80456ab951758a07ed0decb5c09283783f06ca04fc69" +checksum = "9d9406fbdb9548c110803cb8afa750f8b911d51eefdf95474b11319591d225d9" dependencies = [ "futures", "futures-util", "serde", "serde_json", - "smoldot-light 0.12.0", + "smoldot-light 0.14.0", "thiserror", "tokio", "tokio-stream", @@ -16244,49 +16733,51 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5086ce2a90e723083ff19b77f06805d00e732eac3e19c86f6cd643d4255d334" +checksum = "1c195f803d70687e409aba9be6c87115b5da8952cd83c4d13f2e043239818fcd" dependencies = [ "darling 0.20.9", "parity-scale-codec", "proc-macro-error", + "quote", + "scale-typegen", "subxt-codegen", "syn 2.0.68", ] [[package]] name = "subxt-metadata" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19dc60f779bcab44084053e12d4ad5ac18ee217dbe8e26c919e7086fc0228d30" +checksum = "738be5890fdeff899bbffff4d9c0f244fe2a952fb861301b937e3aa40ebb55da" dependencies = [ "frame-metadata 16.0.0", + "hashbrown 0.14.5", "parity-scale-codec", "scale-info", - "sp-core-hashing 13.0.0", - "thiserror", + "sp-crypto-hashing 0.1.0", ] [[package]] name = "subxt-signer" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cc81461f8262b62acf7bfe178a45f22a40336a6ace6a3093bd3e22d7012ba3" +checksum = "f49888ae6ae90fe01b471193528eea5bd4ed52d8eecd2d13f4a2333b87388850" dependencies = [ "bip39", + "cfg-if", "hex", "hmac 0.12.1", "parity-scale-codec", "pbkdf2 0.12.2", "regex", "schnorrkel 0.11.4", - "secp256k1 0.28.2", + "secp256k1", "secrecy", "sha2 0.10.8", - "sp-core-hashing 13.0.0", - "subxt", - "thiserror", + "sp-crypto-hashing 0.1.0", + "subxt-core", "zeroize", ] @@ -16394,7 +16885,7 @@ dependencies = [ "percent-encoding", "pest", "pest_derive", - "rand 0.8.5", + "rand", "regex", "serde", "serde_json", @@ -16624,7 +17115,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" dependencies = [ "pin-project", - "rand 0.8.5", + "rand", "tokio", ] @@ -16638,6 +17129,28 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.11", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.15" @@ -16754,7 +17267,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http", + "http 0.2.12", "http-body", "http-range-header", "pin-project-lite 0.2.14", @@ -16951,7 +17464,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.10", "thiserror", @@ -17037,7 +17550,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand 0.8.5", + "rand", "static_assertions", ] @@ -17173,7 +17686,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.4.1", + "subtle 2.6.1", ] [[package]] @@ -17272,7 +17785,7 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand 0.8.5", + "rand", "rand_chacha 0.3.1", "rand_core 0.6.4", "sha2 0.10.8", @@ -17682,7 +18195,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand 0.8.5", + "rand", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", @@ -17731,6 +18244,15 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "westend-runtime" version = "7.0.0" @@ -18245,7 +18767,7 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.3", - "rand 0.8.5", + "rand", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 96be7da..d56f6f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,8 +61,8 @@ schnellru = "0.2.1" serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] } serde_json = "1.0.105" smallvec = "1.11.0" -subxt = {version = "0.33.0"} -subxt-signer = {version = "0.33.0"} +subxt = {version = "0.37.0"} +subxt-signer = {version = "0.37.0"} tracing = "0.1.37" url = "2.4.0" termcolor = "1.1.3" diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 76acf33..2727159 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -93,6 +93,7 @@ where continue; } let block_number = block.header().number; + let block_hash = block.hash(); let mut bulk_record_local = bulk_record.lock().await; bulk_record_local.coretime_para_height = block_number; @@ -137,7 +138,7 @@ where relevant_keys.push(block_hash_key); let proof = rpc - .state_get_read_proof(relevant_keys, Some(events.block_hash())) + .state_get_read_proof(relevant_keys, Some(block_hash)) .await .unwrap(); let storage_proof = @@ -176,7 +177,7 @@ where // Query CoreAssigned event. let ev_core_assigned = event.as_event::(); - + log::info!("=============event:{:?}", ev_core_assigned); if let Ok(core_assigned_event) = ev_core_assigned { if let Some(ev) = core_assigned_event { log::info!( diff --git a/client/coretime/bulk/src/metadata.rs b/client/coretime/bulk/src/metadata.rs index 9aa3fd0..e7f509d 100644 --- a/client/coretime/bulk/src/metadata.rs +++ b/client/coretime/bulk/src/metadata.rs @@ -19,15 +19,15 @@ //! The data type here is generated by the subxt tool and represents the event-related data of the coretime parachain. //! #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub enum CoreAssignment { #[codec(index = 0)] Idle, @@ -38,48 +38,48 @@ pub enum CoreAssignment { } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct CoreAssigned { pub core: u16, pub when: u32, pub assignment: Vec<(CoreAssignment, u16)>, } -impl subxt::events::StaticEvent for CoreAssigned { +impl ::subxt::ext::subxt_core::events::StaticEvent for CoreAssigned { const PALLET: &'static str = "Broker"; const EVENT: &'static str = "CoreAssigned"; } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct CoreMask(pub [u8; 10usize]); #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct RegionId { pub begin: u32, pub core: u16, @@ -87,22 +87,22 @@ pub struct RegionId { } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct Assigned { pub region_id: RegionId, pub duration: u32, pub task: u32, } -impl ::subxt::events::StaticEvent for Assigned { +impl ::subxt::ext::subxt_core::events::StaticEvent for Assigned { const PALLET: &'static str = "Broker"; const EVENT: &'static str = "Assigned"; } diff --git a/client/coretime/on-demand/src/metadata.rs b/client/coretime/on-demand/src/metadata.rs index ce5404b..37a8c14 100644 --- a/client/coretime/on-demand/src/metadata.rs +++ b/client/coretime/on-demand/src/metadata.rs @@ -20,17 +20,17 @@ //! #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, Eq, PartialEq, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub enum CoreAssignment { #[codec(index = 0)] Idle, @@ -41,56 +41,56 @@ pub enum CoreAssignment { } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct QueueDescriptor<_0> { pub first: _0, pub last: _0, } #[derive( - :: subxt :: ext :: codec :: CompactAs, - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: CompactAs, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct PartsOf57600(pub u16); #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct AssignmentState { pub ratio: PartsOf57600, pub remaining: PartsOf57600, } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct WorkState<_0> { pub assignments: Vec<(CoreAssignment, AssignmentState)>, pub end_hint: Option<_0>, @@ -98,49 +98,49 @@ pub struct WorkState<_0> { pub step: PartsOf57600, } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct CoreDescriptor<_0> { pub queue: Option>, pub current_work: Option>, } #[derive( - :: subxt :: ext :: codec :: CompactAs, - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: CompactAs, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct Id(pub u32); #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct PlaceOrderAllowDeath { pub max_amount: u128, pub para_id: Id, } -impl ::subxt::blocks::StaticExtrinsic for PlaceOrderAllowDeath { +impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceOrderAllowDeath { const PALLET: &'static str = "OnDemandAssignmentProvider"; const CALL: &'static str = "place_order_allow_death"; } @@ -148,8 +148,8 @@ impl ::subxt::blocks::StaticExtrinsic for PlaceOrderAllowDeath { pub fn place_order_allow_death( max_amount: u128, para_id: Id, -) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static( +) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "OnDemandAssignmentProvider", "place_order_allow_death", PlaceOrderAllowDeath { max_amount, para_id }, @@ -162,21 +162,21 @@ pub fn place_order_allow_death( } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct PlaceOrderKeepAlive { pub max_amount: u128, pub para_id: Id, } -impl ::subxt::blocks::StaticExtrinsic for PlaceOrderKeepAlive { +impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceOrderKeepAlive { const PALLET: &'static str = "OnDemandAssignmentProvider"; const CALL: &'static str = "place_order_keep_alive"; } @@ -185,8 +185,8 @@ impl ::subxt::blocks::StaticExtrinsic for PlaceOrderKeepAlive { pub fn place_order_keep_alive( max_amount: u128, para_id: Id, -) -> ::subxt::tx::Payload { - ::subxt::tx::Payload::new_static( +) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "OnDemandAssignmentProvider", "place_order_keep_alive", PlaceOrderKeepAlive { max_amount, para_id }, @@ -199,21 +199,21 @@ pub fn place_order_keep_alive( } #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - :: subxt :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: scale_encode :: EncodeAsType, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] -# [codec (crate = :: subxt :: ext :: codec)] -#[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] -#[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub struct OnDemandOrderPlaced { pub para_id: Id, pub spot_price: u128, } -impl ::subxt::events::StaticEvent for OnDemandOrderPlaced { +impl ::subxt::ext::subxt_core::events::StaticEvent for OnDemandOrderPlaced { const PALLET: &'static str = "OnDemandAssignmentProvider"; const EVENT: &'static str = "OnDemandOrderPlaced"; } From 1e3769a582263f5b5680ba4d907990170a4c7314 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Tue, 23 Jul 2024 21:47:31 +0800 Subject: [PATCH 02/27] upgrade RegionRecord struct --- client/coretime/bulk/src/lib.rs | 14 +++++--------- node/src/chain_spec.rs | 2 +- node/src/service.rs | 3 --- pallets/bulk/src/lib.rs | 30 ++++++++++++++++++++--------- primitives/coretime/bulk/src/lib.rs | 24 ++++++++++++++++++++++- 5 files changed, 50 insertions(+), 23 deletions(-) diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 2727159..43c5f7a 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -29,12 +29,12 @@ use futures::{lock::Mutex, select, FutureExt}; use mc_coretime_common::is_parathread; use mp_coretime_bulk::{ self, well_known_keys::broker_regions, BulkMemRecord, BulkMemRecordItem, BulkRuntimeApi, - BulkStatus, + BulkStatus, RegionRecord, }; use mp_coretime_common::{ chain_state_snapshot::GenericStateProof, well_known_keys::SYSTEM_BLOCKHASH_GENESIS, }; -use pallet_broker::{CoreMask, RegionId, RegionRecord}; +use pallet_broker::{CoreMask, RegionId}; use polkadot_primitives::{AccountId, Balance}; use sc_client_api::UsageProvider; use sc_service::TaskManager; @@ -80,7 +80,7 @@ where let api = OnlineClient::::from_url(rpc_url).await?; - let mut blocks_sub = api.blocks().subscribe_best().await?; + let mut blocks_sub = api.blocks().subscribe_finalized().await?; // For each block, print a bunch of information about it: while let Some(block) = blocks_sub.next().await { @@ -137,10 +137,8 @@ where relevant_keys.push(region_key.as_slice()); relevant_keys.push(block_hash_key); - let proof = rpc - .state_get_read_proof(relevant_keys, Some(block_hash)) - .await - .unwrap(); + let proof = + rpc.state_get_read_proof(relevant_keys, Some(block_hash)).await?; let storage_proof = StorageProof::new(proof.proof.into_iter().map(|bytes| bytes.to_vec())); @@ -177,7 +175,6 @@ where // Query CoreAssigned event. let ev_core_assigned = event.as_event::(); - log::info!("=============event:{:?}", ev_core_assigned); if let Ok(core_assigned_event) = ev_core_assigned { if let Some(ev) = core_assigned_event { log::info!( @@ -220,7 +217,6 @@ where } } } - Ok(()) } pub async fn run_coretime_bulk_task( diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index e1d2408..b77a727 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -289,7 +289,7 @@ fn testnet_genesis( }, "bulkPallet":{ "rpcUrl": b"ws://127.0.0.1:8855".to_vec(), - "genesisHash": U256::from_str("0x4ea18c8f295ba903acbbed39c70ea0569cf1705fa954a537ffa3b8b7125eaf58").expect("internal U256 is valid; qed") + "genesisHash": U256::from_str("0x9e68f1a9b89f5e9f60b1e76db8fe75939ffba5bddc7eb9f39ec9ddf19c700be6").expect("internal U256 is valid; qed") }, "orderPallet": { "slotWidth": 3, diff --git a/node/src/service.rs b/node/src/service.rs index 34566b2..4519e9b 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -49,8 +49,6 @@ use crate::eth::{ FrontierBlockImport as TFrontierBlockImport, FrontierPartialComponents, }; -use cumulus_relay_chain_interface::OccupiedCoreAssumption; -use cumulus_relay_chain_interface::PersistedValidationData; use futures::lock::Mutex; use mc_coretime_bulk::spawn_bulk_task; use mc_coretime_on_demand::spawn_on_demand_order; @@ -581,7 +579,6 @@ fn start_consensus( let params = AuraParams { create_inherent_data_providers: move |_, ()| { let bulk_mem_record_clone = bulk_mem_record.clone(); - let relay_chain_interface = relay_chain_interface.clone(); let order_record_clone = order_record.clone(); async move { let mut bulk_mem_record_clone_local = bulk_mem_record_clone.lock().await; diff --git a/pallets/bulk/src/lib.rs b/pallets/bulk/src/lib.rs index b8a0c00..ceb9919 100644 --- a/pallets/bulk/src/lib.rs +++ b/pallets/bulk/src/lib.rs @@ -28,12 +28,11 @@ use frame_support::{ traits::Currency, }; use frame_system::pallet_prelude::*; -use mp_coretime_bulk::well_known_keys::broker_regions; +use mp_coretime_bulk::{well_known_keys::broker_regions, RegionRecord, RegionRecordV0}; use mp_coretime_common::{ chain_state_snapshot::GenericStateProof, well_known_keys::SYSTEM_BLOCKHASH_GENESIS, }; pub use pallet::*; -use pallet_broker::RegionRecord; use sp_runtime::sp_std::{prelude::*, vec}; use weights::WeightInfo; @@ -245,11 +244,25 @@ pub mod pallet { let region_key = broker_regions(region_id); // Read RegionRecord from proof. - let region_record = storage_rooted_proof + let p_region_record = storage_rooted_proof .read_entry::>>(region_key.as_slice(), None) - .ok() - .ok_or(Error::::FailedReading)?; - + .ok(); + let (balance, purchaser) = if let Some(region_record) = p_region_record { + let balance = region_record.paid.ok_or(Error::::PurchaserNone)?; + let purchaser = region_record.owner.ok_or(Error::::PurchaserNone)?; + (balance, purchaser) + } else { + let region_record = storage_rooted_proof + .read_entry::>>( + region_key.as_slice(), + None, + ) + .ok() + .ok_or(Error::::FailedReading)?; + let balance = region_record.paid.ok_or(Error::::PurchaserNone)?; + let purchaser = region_record.owner; + (balance, purchaser) + }; let genesis_hash_key = SYSTEM_BLOCKHASH_GENESIS; let genesis_hash = storage_rooted_proof .read_entry::(genesis_hash_key, None) @@ -263,8 +276,7 @@ pub mod pallet { let real_start_relaychain_height = Self::relaychain_block_number(); let real_end_relaychain_height = real_start_relaychain_height + duration; let old_record_index = RecordIndex::::get(); - let balance = region_record.paid.ok_or(Error::::PurchaserNone)?; - let purchaser = region_record.owner; + // Create record of purchase coretime. BulkRecords::::insert( old_record_index, @@ -282,7 +294,7 @@ pub mod pallet { Self::deposit_event(Event::RecordCreated { purchaser, price: balance, - duration: region_record.end, + duration, start_relaychain_height, end_relaychain_height, real_start_relaychain_height, diff --git a/primitives/coretime/bulk/src/lib.rs b/primitives/coretime/bulk/src/lib.rs index 96f8fbf..b6e6cfc 100644 --- a/primitives/coretime/bulk/src/lib.rs +++ b/primitives/coretime/bulk/src/lib.rs @@ -26,7 +26,9 @@ use sp_runtime::sp_std::vec::Vec; pub mod inherent_client; pub mod well_known_keys; use codec::{Decode, Encode}; -use pallet_broker::RegionId; +use pallet_broker::{RegionId, Timeslice}; +use sp_core::MaxEncodedLen; +use sp_runtime::RuntimeDebug; use {scale_info::TypeInfo, sp_inherents::InherentIdentifier}; /// Inherent data of bulk mode. @@ -96,3 +98,23 @@ sp_api::decl_runtime_apis! { fn relaychain_block_number()->u32; } } + +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +pub struct RegionRecord { + /// The end of the Region. + pub end: Timeslice, + /// The owner of the Region. + pub owner: Option, + /// The amount paid to Polkadot for this Region, or `None` if renewal is not allowed. + pub paid: Option, +} + +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +pub struct RegionRecordV0 { + /// The end of the Region. + pub end: Timeslice, + /// The owner of the Region. + pub owner: AccountId, + /// The amount paid to Polkadot for this Region, or `None` if renewal is not allowed. + pub paid: Option, +} From 2bb12e5a6f1f307dcfdd280f1a23ccfb2c4e7da6 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Wed, 24 Jul 2024 21:11:55 +0800 Subject: [PATCH 03/27] make on demand module compatible with lower versions --- Cargo.lock | 2 + client/coretime/common/Cargo.toml | 2 + client/coretime/common/src/configuration.rs | 434 ++++++++++++++++++ client/coretime/common/src/lib.rs | 134 +++++- client/coretime/common/src/types.rs | 71 +++ client/coretime/on-demand/src/lib.rs | 76 +-- client/coretime/on-demand/src/metadata.rs | 21 + .../coretime/common/src/well_known_keys.rs | 20 + .../coretime/on-demand/src/well_known_keys.rs | 8 - 9 files changed, 696 insertions(+), 72 deletions(-) create mode 100644 client/coretime/common/src/configuration.rs create mode 100644 client/coretime/common/src/types.rs diff --git a/Cargo.lock b/Cargo.lock index 7b725aa..25da992 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6663,6 +6663,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", + "frame-support", "futures", "log", "mp-coretime-common", @@ -6680,6 +6681,7 @@ dependencies = [ "sc-consensus-slots", "sc-service", "sc-telemetry", + "scale-info", "schnellru", "sp-api", "sp-application-crypto 30.0.0", diff --git a/client/coretime/common/Cargo.toml b/client/coretime/common/Cargo.toml index d9d4a4d..5cc107c 100644 --- a/client/coretime/common/Cargo.toml +++ b/client/coretime/common/Cargo.toml @@ -16,6 +16,7 @@ tracing = { workspace = true } schnellru = { workspace = true } log = { workspace = true } subxt = { workspace = true, features = ["substrate-compat"]} +scale-info = { workspace = true, features = ["derive", "serde"] } mp-coretime-common = { path = "../../../primitives/coretime/common"} @@ -42,6 +43,7 @@ substrate-prometheus-endpoint = { workspace = true } sc-service = { workspace = true } pallet-broker = { workspace = true} sp-storage = { workspace = true } +frame-support = { workspace = true } # Cumulus cumulus-client-consensus-common = { workspace = true } diff --git a/client/coretime/common/src/configuration.rs b/client/coretime/common/src/configuration.rs new file mode 100644 index 0000000..549bc4f --- /dev/null +++ b/client/coretime/common/src/configuration.rs @@ -0,0 +1,434 @@ +// Copyright (C) Magnet. +// This file is part of Magnet. + +// Magnet is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Magnet is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Magnet. If not, see . + +use codec::{Decode, Encode}; +use polkadot_primitives::vstaging::NodeFeatures; +use polkadot_primitives::{AsyncBackingParams, Balance, ExecutorParams, SessionIndex}; +use sp_runtime::Perbill; + +#[derive(Clone, Encode, Decode, Debug)] +pub struct V8HostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub async_backing_params: AsyncBackingParams, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub executor_params: ExecutorParams, + pub code_retention_period: BlockNumber, + pub on_demand_cores: u32, + pub on_demand_retries: u32, + pub on_demand_queue_max_size: u32, + pub on_demand_target_queue_utilization: Perbill, + pub on_demand_fee_variability: Perbill, + pub on_demand_base_fee: Balance, + pub on_demand_ttl: BlockNumber, + pub group_rotation_frequency: BlockNumber, + pub paras_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, +} + +#[derive(Clone, Encode, Decode, Debug)] +pub struct V9HostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub async_backing_params: AsyncBackingParams, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub executor_params: ExecutorParams, + pub code_retention_period: BlockNumber, + pub on_demand_cores: u32, + pub on_demand_retries: u32, + pub on_demand_queue_max_size: u32, + pub on_demand_target_queue_utilization: Perbill, + pub on_demand_fee_variability: Perbill, + pub on_demand_base_fee: Balance, + pub on_demand_ttl: BlockNumber, + pub group_rotation_frequency: BlockNumber, + pub paras_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, + pub minimum_backing_votes: u32, +} + +#[derive(Clone, Encode, PartialEq, Decode, Debug)] +pub struct V10HostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub async_backing_params: AsyncBackingParams, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub executor_params: ExecutorParams, + pub code_retention_period: BlockNumber, + pub on_demand_cores: u32, + pub on_demand_retries: u32, + pub on_demand_queue_max_size: u32, + pub on_demand_target_queue_utilization: Perbill, + pub on_demand_fee_variability: Perbill, + pub on_demand_base_fee: Balance, + pub on_demand_ttl: BlockNumber, + pub group_rotation_frequency: BlockNumber, + pub paras_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, + pub minimum_backing_votes: u32, + pub node_features: NodeFeatures, +} + +#[derive(Copy, Clone, PartialEq, Encode, Decode)] +pub struct ApprovalVotingParams { + /// The maximum number of candidates `approval-voting` can vote for with + /// a single signatures. + /// + /// Setting it to 1, means we send the approval as soon as we have it available. + pub max_approval_coalesce_count: u32, +} +#[derive(Clone, Encode, PartialEq, Decode)] +pub struct V11HostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub async_backing_params: AsyncBackingParams, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub executor_params: ExecutorParams, + pub code_retention_period: BlockNumber, + pub coretime_cores: u32, + pub on_demand_retries: u32, + pub on_demand_queue_max_size: u32, + pub on_demand_target_queue_utilization: Perbill, + pub on_demand_fee_variability: Perbill, + pub on_demand_base_fee: Balance, + pub on_demand_ttl: BlockNumber, + pub group_rotation_frequency: BlockNumber, + pub paras_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, + pub minimum_backing_votes: u32, + pub node_features: NodeFeatures, + pub approval_voting_params: ApprovalVotingParams, +} +#[derive(Copy, Clone, PartialEq, Encode, Decode)] +pub struct SchedulerParams { + /// How often parachain groups should be rotated across parachains. + /// + /// Must be non-zero. + pub group_rotation_frequency: BlockNumber, + /// Availability timeout for a block on a core, measured in blocks. + /// + /// This is the maximum amount of blocks after a core became occupied that validators have time + /// to make the block available. + /// + /// This value only has effect on group rotations. If backers backed something at the end of + /// their rotation, the occupied core affects the backing group that comes afterwards. We limit + /// the effect one backing group can have on the next to `paras_availability_period` blocks. + /// + /// Within a group rotation there is no timeout as backers are only affecting themselves. + /// + /// Must be at least 1. With a value of 1, the previous group will not be able to negatively + /// affect the following group at the expense of a tight availability timeline at group + /// rotation boundaries. + pub paras_availability_period: BlockNumber, + /// The maximum number of validators to have per core. + /// + /// `None` means no maximum. + pub max_validators_per_core: Option, + /// The amount of blocks ahead to schedule paras. + pub lookahead: u32, + /// How many cores are managed by the coretime chain. + pub num_cores: u32, + /// The max number of times a claim can time out in availability. + pub max_availability_timeouts: u32, + /// The maximum queue size of the pay as you go module. + pub on_demand_queue_max_size: u32, + /// The target utilization of the spot price queue in percentages. + pub on_demand_target_queue_utilization: Perbill, + /// How quickly the fee rises in reaction to increased utilization. + /// The lower the number the slower the increase. + pub on_demand_fee_variability: Perbill, + /// The minimum amount needed to claim a slot in the spot pricing queue. + pub on_demand_base_fee: Balance, + /// The number of blocks a claim stays in the scheduler's claim queue before getting cleared. + /// This number should go reasonably higher than the number of blocks in the async backing + /// lookahead. + pub ttl: BlockNumber, +} +#[derive(Clone, Encode, Decode, PartialEq)] +pub struct HostConfiguration { + // NOTE: This structure is used by parachains via merkle proofs. Therefore, this struct + // requires special treatment. + // + // A parachain requested this struct can only depend on the subset of this struct. + // Specifically, only a first few fields can be depended upon. These fields cannot be changed + // without corresponding migration of the parachains. + /** + * The parameters that are required for the parachains. + */ + + /// The maximum validation code size, in bytes. + pub max_code_size: u32, + /// The maximum head-data size, in bytes. + pub max_head_data_size: u32, + /// Total number of individual messages allowed in the parachain -> relay-chain message queue. + pub max_upward_queue_count: u32, + /// Total size of messages allowed in the parachain -> relay-chain message queue before which + /// no further messages may be added to it. If it exceeds this then the queue may contain only + /// a single message. + pub max_upward_queue_size: u32, + /// The maximum size of an upward message that can be sent by a candidate. + /// + /// This parameter affects the size upper bound of the `CandidateCommitments`. + pub max_upward_message_size: u32, + /// The maximum number of messages that a candidate can contain. + /// + /// This parameter affects the size upper bound of the `CandidateCommitments`. + pub max_upward_message_num_per_candidate: u32, + /// The maximum number of outbound HRMP messages can be sent by a candidate. + /// + /// This parameter affects the upper bound of size of `CandidateCommitments`. + pub hrmp_max_message_num_per_candidate: u32, + /// The minimum period, in blocks, between which parachains can update their validation code. + /// + /// This number is used to prevent parachains from spamming the relay chain with validation + /// code upgrades. The only thing it controls is the number of blocks the + /// `UpgradeRestrictionSignal` is set for the parachain in question. + /// + /// If PVF pre-checking is enabled this should be greater than the maximum number of blocks + /// PVF pre-checking can take. Intuitively, this number should be greater than the duration + /// specified by [`pvf_voting_ttl`](Self::pvf_voting_ttl). Unlike, + /// [`pvf_voting_ttl`](Self::pvf_voting_ttl), this parameter uses blocks as a unit. + #[cfg_attr(feature = "std", serde(alias = "validation_upgrade_frequency"))] + pub validation_upgrade_cooldown: BlockNumber, + /// The delay, in blocks, after which an upgrade of the validation code is applied. + /// + /// The upgrade for a parachain takes place when the first candidate which has relay-parent >= + /// the relay-chain block where the upgrade is scheduled. This block is referred as to + /// `expected_at`. + /// + /// `expected_at` is determined when the upgrade is scheduled. This happens when the candidate + /// that signals the upgrade is enacted. Right now, the relay-parent block number of the + /// candidate scheduling the upgrade is used to determine the `expected_at`. This may change in + /// the future with [#4601]. + /// + /// When PVF pre-checking is enabled, the upgrade is scheduled only after the PVF pre-check has + /// been completed. + /// + /// Note, there are situations in which `expected_at` in the past. For example, if + /// [`paras_availability_period`](SchedulerParams::paras_availability_period) is less than the + /// delay set by this field or if PVF pre-check took more time than the delay. In such cases, + /// the upgrade is further at the earliest possible time determined by + /// [`minimum_validation_upgrade_delay`](Self::minimum_validation_upgrade_delay). + /// + /// The rationale for this delay has to do with relay-chain reversions. In case there is an + /// invalid candidate produced with the new version of the code, then the relay-chain can + /// revert [`validation_upgrade_delay`](Self::validation_upgrade_delay) many blocks back and + /// still find the new code in the storage by hash. + /// + /// [#4601]: https://github.com/paritytech/polkadot/issues/4601 + pub validation_upgrade_delay: BlockNumber, + /// Asynchronous backing parameters. + pub async_backing_params: AsyncBackingParams, + + /** + * The parameters that are not essential, but still may be of interest for parachains. + */ + + /// The maximum POV block size, in bytes. + pub max_pov_size: u32, + /// The maximum size of a message that can be put in a downward message queue. + /// + /// Since we require receiving at least one DMP message the obvious upper bound of the size is + /// the PoV size. Of course, there is a lot of other different things that a parachain may + /// decide to do with its PoV so this value in practice will be picked as a fraction of the PoV + /// size. + pub max_downward_message_size: u32, + /// The maximum number of outbound HRMP channels a parachain is allowed to open. + pub hrmp_max_parachain_outbound_channels: u32, + /// The deposit that the sender should provide for opening an HRMP channel. + pub hrmp_sender_deposit: Balance, + /// The deposit that the recipient should provide for accepting opening an HRMP channel. + pub hrmp_recipient_deposit: Balance, + /// The maximum number of messages allowed in an HRMP channel at once. + pub hrmp_channel_max_capacity: u32, + /// The maximum total size of messages in bytes allowed in an HRMP channel at once. + pub hrmp_channel_max_total_size: u32, + /// The maximum number of inbound HRMP channels a parachain is allowed to accept. + pub hrmp_max_parachain_inbound_channels: u32, + /// The maximum size of a message that could ever be put into an HRMP channel. + /// + /// This parameter affects the upper bound of size of `CandidateCommitments`. + pub hrmp_channel_max_message_size: u32, + /// The executor environment parameters + pub executor_params: ExecutorParams, + + /** + * Parameters that will unlikely be needed by parachains. + */ + + /// How long to keep code on-chain, in blocks. This should be sufficiently long that disputes + /// have concluded. + pub code_retention_period: BlockNumber, + + /// The maximum number of validators to use for parachain consensus, period. + /// + /// `None` means no maximum. + pub max_validators: Option, + /// The amount of sessions to keep for disputes. + pub dispute_period: SessionIndex, + /// How long after dispute conclusion to accept statements. + pub dispute_post_conclusion_acceptance_period: BlockNumber, + /// The amount of consensus slots that must pass between submitting an assignment and + /// submitting an approval vote before a validator is considered a no-show. + /// + /// Must be at least 1. + pub no_show_slots: u32, + /// The number of delay tranches in total. Must be at least 1. + pub n_delay_tranches: u32, + /// The width of the zeroth delay tranche for approval assignments. This many delay tranches + /// beyond 0 are all consolidated to form a wide 0 tranche. + pub zeroth_delay_tranche_width: u32, + /// The number of validators needed to approve a block. + pub needed_approvals: u32, + /// The number of samples to do of the `RelayVRFModulo` approval assignment criterion. + pub relay_vrf_modulo_samples: u32, + /// If an active PVF pre-checking vote observes this many number of sessions it gets + /// automatically rejected. + /// + /// 0 means PVF pre-checking will be rejected on the first observed session unless the voting + /// gained supermajority before that the session change. + pub pvf_voting_ttl: SessionIndex, + /// The lower bound number of blocks an upgrade can be scheduled. + /// + /// Typically, upgrade gets scheduled + /// [`validation_upgrade_delay`](Self::validation_upgrade_delay) relay-chain blocks after + /// the relay-parent of the parablock that signalled the validation code upgrade. However, + /// in the case a pre-checking voting was concluded in a longer duration the upgrade will be + /// scheduled to the next block. + /// + /// That can disrupt parachain inclusion. Specifically, it will make the blocks that were + /// already backed invalid. + /// + /// To prevent that, we introduce the minimum number of blocks after which the upgrade can be + /// scheduled. This number is controlled by this field. + /// + /// This value should be greater than + /// [`paras_availability_period`](SchedulerParams::paras_availability_period). + pub minimum_validation_upgrade_delay: BlockNumber, + /// The minimum number of valid backing statements required to consider a parachain candidate + /// backable. + pub minimum_backing_votes: u32, + /// Node features enablement. + pub node_features: NodeFeatures, + /// Params used by approval-voting + pub approval_voting_params: ApprovalVotingParams, + /// Scheduler parameters + pub scheduler_params: SchedulerParams, +} diff --git a/client/coretime/common/src/lib.rs b/client/coretime/common/src/lib.rs index 18a1988..990a8e0 100644 --- a/client/coretime/common/src/lib.rs +++ b/client/coretime/common/src/lib.rs @@ -16,17 +16,28 @@ //! Coretime common function of client. //! +pub mod configuration; +pub mod types; +use crate::types::QueueStatusType; use codec::Decode; +use configuration::{ + HostConfiguration, V10HostConfiguration, V11HostConfiguration, V8HostConfiguration, + V9HostConfiguration, +}; use cumulus_primitives_core::ParaId; use cumulus_relay_chain_interface::RelayChainInterface; -use mp_coretime_common::well_known_keys::paras_para_lifecycles; +use mp_coretime_common::well_known_keys::{ + paras_para_lifecycles, ACTIVE_CONFIG, CONFIGURATION_VERSION, ON_DEMAND_VERSION, + QUEUE_STATUS_TYPE, SPOT_TRAFFIC, +}; use runtime_parachains::paras::ParaLifecycle; use sp_core::{ crypto::{ByteArray, Pair}, H256, }; use sp_keystore::KeystorePtr; +use sp_runtime::{traits::SaturatedConversion, FixedPointNumber, FixedU128}; use std::error::Error; type AuthorityId

=

::Public; @@ -55,6 +66,127 @@ pub async fn is_parathread( Ok(is_parathread) } +pub async fn coretime_cores( + relay_chain: &(impl RelayChainInterface + Clone), + p_hash: H256, +) -> Option { + // pallet version + let pallet_version_storage = + relay_chain.get_storage_by_key(p_hash, CONFIGURATION_VERSION).await.ok()?; + let pallet_version = pallet_version_storage + .map(|raw| ::decode(&mut &raw[..])) + .transpose() + .ok()??; + let active_config_storage = relay_chain.get_storage_by_key(p_hash, ACTIVE_CONFIG).await.ok()?; + // Get cores + let cores = if pallet_version == 8 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_cores + } else if pallet_version == 9 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_cores + } else if pallet_version == 10 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_cores + } else if pallet_version == 11 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.coretime_cores + } else { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.scheduler_params.num_cores + }; + + Some(cores) +} + +pub async fn relaychain_spot_price( + relay_chain: &(impl RelayChainInterface + Clone), + p_hash: H256, +) -> Option { + // configuration pallet version + let ondemand_version_storage = + relay_chain.get_storage_by_key(p_hash, ON_DEMAND_VERSION).await.ok()?; + let ondemand_version = ondemand_version_storage + .map(|raw| ::decode(&mut &raw[..])) + .transpose() + .ok()??; + let spot_traffic = if ondemand_version == 0 { + let spot_traffic_storage = + relay_chain.get_storage_by_key(p_hash, SPOT_TRAFFIC).await.ok()?; + let traffic = spot_traffic_storage + .map(|raw| ::decode(&mut &raw[..])) + .transpose() + .ok()??; + traffic + } else { + let spot_traffic_storage = + relay_chain.get_storage_by_key(p_hash, QUEUE_STATUS_TYPE).await.ok()?; + let traffic = spot_traffic_storage + .map(|raw| ::decode(&mut &raw[..])) + .transpose() + .ok()?? + .traffic; + FixedU128::from(traffic.0) + }; + // configuration pallet version + let configuration_version_storage = + relay_chain.get_storage_by_key(p_hash, CONFIGURATION_VERSION).await.ok()?; + let configuration_version = configuration_version_storage + .map(|raw| ::decode(&mut &raw[..])) + .transpose() + .ok()??; + let active_config_storage = relay_chain.get_storage_by_key(p_hash, ACTIVE_CONFIG).await.ok()?; + // Get cores + let on_demand_base_fee = if configuration_version == 8 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_base_fee + } else if configuration_version == 9 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_base_fee + } else if configuration_version == 10 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_base_fee + } else if configuration_version == 11 { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.on_demand_base_fee + } else { + let configuration = active_config_storage + .map(|raw| >::decode(&mut &raw[..])) + .transpose() + .ok()??; + configuration.scheduler_params.on_demand_base_fee + }; + let spot_price = spot_traffic.saturating_mul_int(on_demand_base_fee.saturated_into::()); + Some(spot_price) +} + /// Randomly select a collator to place an order. pub async fn order_slot( idx: u32, diff --git a/client/coretime/common/src/types.rs b/client/coretime/common/src/types.rs new file mode 100644 index 0000000..2243df3 --- /dev/null +++ b/client/coretime/common/src/types.rs @@ -0,0 +1,71 @@ +// Copyright (C) Magnet. +// This file is part of Magnet. + +// Magnet is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Magnet is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Magnet. If not, see . + +#[derive( + :: subxt :: ext :: subxt_core :: ext :: codec :: CompactAs, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, +)] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] +pub struct QueueIndex(pub ::core::primitive::u32); + +#[derive( + :: subxt :: ext :: subxt_core :: ext :: codec :: CompactAs, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, +)] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] +pub struct ReverseQueueIndex(pub ::core::primitive::u32); + +#[derive( + :: subxt :: ext :: subxt_core :: ext :: codec :: CompactAs, + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, +)] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] +pub struct FixedU128(pub ::core::primitive::u128); + +#[derive( + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, +)] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] +pub struct QueueStatusType { + pub traffic: FixedU128, + pub next_index: QueueIndex, + pub smallest_index: QueueIndex, + pub freed_indices: ::subxt::ext::subxt_core::alloc::vec::Vec, +} diff --git a/client/coretime/on-demand/src/lib.rs b/client/coretime/on-demand/src/lib.rs index 493a02c..7f13cd2 100644 --- a/client/coretime/on-demand/src/lib.rs +++ b/client/coretime/on-demand/src/lib.rs @@ -31,19 +31,14 @@ use cumulus_primitives_core::{ }; use cumulus_relay_chain_interface::{RelayChainInterface, RelayChainResult}; use futures::{lock::Mutex, pin_mut, select, FutureExt, Stream, StreamExt}; -use mc_coretime_common::is_parathread; +use mc_coretime_common::{coretime_cores, is_parathread, relaychain_spot_price}; use metadata::{CoreAssignment, CoreDescriptor}; use mp_coretime_on_demand::{ - self, - well_known_keys::{ - paras_core_descriptors, EnqueuedOrder, ACTIVE_CONFIG, ON_DEMAND_QUEUE, SPOT_TRAFFIC, - }, - OrderRecord, OrderRuntimeApi, OrderStatus, + self, well_known_keys::paras_core_descriptors, OrderRecord, OrderRuntimeApi, OrderStatus, }; use mp_system::OnRelayChainApi; pub use pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi; use polkadot_primitives::OccupiedCoreAssumption; -use runtime_parachains::configuration::HostConfiguration; use sc_client_api::UsageProvider; use sc_service::TaskManager; use sc_transaction_pool_api::{InPoolTransaction, MaintainedTransactionPool}; @@ -55,10 +50,7 @@ use sp_core::H256; use sp_keystore::KeystorePtr; use sp_runtime::{ codec::Encode, - traits::{ - AtLeast32BitUnsigned, Block as BlockT, Header as HeaderT, MaybeDisplay, SaturatedConversion, - }, - FixedPointNumber, FixedU128, + traits::{AtLeast32BitUnsigned, Block as BlockT, Header as HeaderT, MaybeDisplay}, }; use std::{cmp::Ordering, net::SocketAddr}; use std::{error::Error, fmt::Debug, sync::Arc}; @@ -84,21 +76,9 @@ async fn get_spot_price( where Balance: Codec + MaybeDisplay + 'static + Debug + From, { - let spot_traffic_storage = relay_chain.get_storage_by_key(hash, SPOT_TRAFFIC).await.ok()?; - let p_spot_traffic = spot_traffic_storage - .map(|raw| ::decode(&mut &raw[..])) - .transpose() - .ok()?; - let active_config_storage = relay_chain.get_storage_by_key(hash, ACTIVE_CONFIG).await.ok()?; - let p_active_config = active_config_storage - .map(|raw| >::decode(&mut &raw[..])) - .transpose() - .ok()?; - if p_spot_traffic.is_some() && p_active_config.is_some() { - let spot_traffic = p_spot_traffic.unwrap(); - let active_config = p_active_config.unwrap(); - let spot_price = spot_traffic - .saturating_mul_int(active_config.on_demand_base_fee.saturated_into::()); + let p_spot_price = relaychain_spot_price(&relay_chain, hash).await; + log::info!("=============p_spot_price:{:?}", p_spot_price); + if let Some(spot_price) = p_spot_price { Some(Balance::from(spot_price)) } else { None @@ -107,20 +87,14 @@ where /// Whether the relay chain has ondemand function enabled. async fn start_on_demand( - relay_chain: impl RelayChainInterface + Clone, + relay_chain: impl RelayChainInterface + Clone + Send, hash: H256, para_id: ParaId, ) -> Option { - let active_config_storage = relay_chain.get_storage_by_key(hash, ACTIVE_CONFIG).await.ok()?; - // Get config - let p_active_config = active_config_storage - .map(|raw| >::decode(&mut &raw[..])) - .transpose() - .ok()?; - if let Some(active_config) = p_active_config { - let mut result = false; - // Get the number of cores. - let cores = active_config.coretime_cores; + // Get the number of cores. + let r_cores = coretime_cores(&relay_chain, hash).await; + let mut result = false; + if let Some(cores) = r_cores { for core in 0..cores { let key = paras_core_descriptors(polkadot_primitives::CoreIndex(core)); let core_descriptors_storage = @@ -143,11 +117,8 @@ async fn start_on_demand( } } } - Some(result) - } else { - // get config failed - Some(false) } + Some(result) } /// Create an order to purchase core. @@ -348,27 +319,6 @@ where ); // Check whether the conditions for placing an order are met, and if so, place the order - - // Check if it is in the ondemand queue, if so, do not place a order. - // key = OnDemandAssignmentProvider OnDemandQueue - let mut exist_order = false; - let on_demand_queue_storage = relay_chain.get_storage_by_key(p_hash, ON_DEMAND_QUEUE).await?; - let on_demand_queue = on_demand_queue_storage - .map(|raw| >::decode(&mut &raw[..])) - .transpose()?; - if let Some(vvs) = on_demand_queue.clone() { - for vv in vvs.into_iter() { - if vv.para_id == para_id { - exist_order = true; - break; - } - } - } - if exist_order { - let mut order_record_local = order_record.lock().await; - order_record_local.order_status = OrderStatus::Complete; - return Ok(()); - } // get on demand core price let max_amount = parachain.runtime_api().order_max_amount(hash)?; let p_spot_price = get_spot_price::(relay_chain.clone(), p_hash).await; @@ -511,7 +461,7 @@ pub async fn ondemand_event_task( for event in events.iter() { let event = event?; // Query Broker Assigned Event - let ev_order_placed = event.as_event::(); + let ev_order_placed = event.as_event::(); if let Ok(order_placed_event) = ev_order_placed { if let Some(ev) = order_placed_event { log::info!( diff --git a/client/coretime/on-demand/src/metadata.rs b/client/coretime/on-demand/src/metadata.rs index 37a8c14..9f6e344 100644 --- a/client/coretime/on-demand/src/metadata.rs +++ b/client/coretime/on-demand/src/metadata.rs @@ -211,9 +211,30 @@ pub fn place_order_keep_alive( pub struct OnDemandOrderPlaced { pub para_id: Id, pub spot_price: u128, + pub ordered_by: ::subxt::ext::subxt_core::utils::AccountId32, +} + +#[derive( + :: subxt :: ext :: subxt_core :: ext :: codec :: Decode, + :: subxt :: ext :: subxt_core :: ext :: codec :: Encode, + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, +)] +# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)] +#[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] +#[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] +pub struct OnDemandOrderPlacedV0 { + pub para_id: Id, + pub spot_price: u128, } impl ::subxt::ext::subxt_core::events::StaticEvent for OnDemandOrderPlaced { const PALLET: &'static str = "OnDemandAssignmentProvider"; const EVENT: &'static str = "OnDemandOrderPlaced"; } + +impl ::subxt::ext::subxt_core::events::StaticEvent for OnDemandOrderPlacedV0 { + const PALLET: &'static str = "OnDemandAssignmentProvider"; + const EVENT: &'static str = "OnDemandOrderPlaced"; +} diff --git a/primitives/coretime/common/src/well_known_keys.rs b/primitives/coretime/common/src/well_known_keys.rs index aa9c7be..3afc456 100644 --- a/primitives/coretime/common/src/well_known_keys.rs +++ b/primitives/coretime/common/src/well_known_keys.rs @@ -54,3 +54,23 @@ pub fn chain_block_hash(block_number: u32) -> Vec { .collect() }) } + +// configuration pallet version +pub const CONFIGURATION_VERSION: &[u8] = + &hex_literal::hex!["06de3d8a54d27e44a9d5ce189618f22d4e7b9012096b41c4eb3aaf947f6ea429"]; + +//Configuration ActiveConfig +pub const ACTIVE_CONFIG: &[u8] = + &hex_literal::hex!["06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385"]; + +// on demand pallet version +pub const ON_DEMAND_VERSION: &[u8] = + &hex_literal::hex!["8f32430b49607f8d60bfd3a003ddf4b54e7b9012096b41c4eb3aaf947f6ea429"]; + +//OnDemandAssignmentProvider SpotTraffic +pub const SPOT_TRAFFIC: &[u8] = + &hex_literal::hex!["8f32430b49607f8d60bfd3a003ddf4b5c9308a8e0e640735727536bd9069b11e"]; + +//OnDemandAssignmentProvider QueueStatusType +pub const QUEUE_STATUS_TYPE: &[u8] = + &hex_literal::hex!["8f32430b49607f8d60bfd3a003ddf4b58bf29330833ea7904c7209f4ce9d917a"]; diff --git a/primitives/coretime/on-demand/src/well_known_keys.rs b/primitives/coretime/on-demand/src/well_known_keys.rs index efd5fe4..06343af 100644 --- a/primitives/coretime/on-demand/src/well_known_keys.rs +++ b/primitives/coretime/on-demand/src/well_known_keys.rs @@ -35,14 +35,6 @@ pub const SYSTEM_EVENTS: &[u8] = pub const ON_DEMAND_QUEUE: &[u8] = &hex_literal::hex!["8f32430b49607f8d60bfd3a003ddf4b53f35b69d817556cf6b886e5b4f01fbdc"]; -//OnDemandAssignmentProvider SpotTraffic -pub const SPOT_TRAFFIC: &[u8] = - &hex_literal::hex!["8f32430b49607f8d60bfd3a003ddf4b5c9308a8e0e640735727536bd9069b11e"]; - -//Configuration ActiveConfig -pub const ACTIVE_CONFIG: &[u8] = - &hex_literal::hex!["06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385"]; - pub const CORE_DESCRIPTORS: &[u8] = &hex_literal::hex!["638595eebaa445ce03a13547bece90e704e6ac775a3245623103ffec2cb2c92f"]; From c1f8c5fd6562405b43e8f1eb9d7a6e5ebb5a7b82 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Thu, 25 Jul 2024 22:23:34 +0800 Subject: [PATCH 04/27] decode low version RegionRecord --- client/coretime/bulk/src/lib.rs | 17 ++++++++++++++++- node/src/chain_spec.rs | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 43c5f7a..85531fd 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -29,7 +29,7 @@ use futures::{lock::Mutex, select, FutureExt}; use mc_coretime_common::is_parathread; use mp_coretime_bulk::{ self, well_known_keys::broker_regions, BulkMemRecord, BulkMemRecordItem, BulkRuntimeApi, - BulkStatus, RegionRecord, + BulkStatus, RegionRecord, RegionRecordV0, }; use mp_coretime_common::{ chain_state_snapshot::GenericStateProof, well_known_keys::SYSTEM_BLOCKHASH_GENESIS, @@ -154,8 +154,23 @@ where None, ) .ok(); + let mut proof_gen = false; // Check proof is ok. if head_data.is_some() { + proof_gen = true; + } else { + // decode to lower version + let head_data = relay_storage_rooted_proof + .read_entry::>( + region_key.as_slice(), + None, + ) + .ok(); + if head_data.is_some() { + proof_gen = true; + } + } + if proof_gen { // Record some data. let record_item = BulkMemRecordItem { storage_proof, diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index b77a727..9b43a45 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -3,7 +3,7 @@ use parachain_magnet_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; use serde::{Deserialize, Serialize}; -use sp_core::{sr25519, Pair, Public, H160, U256}; +use sp_core::{sr25519, Pair, Public, H160, H256, U256}; use sp_runtime::traits::{IdentifyAccount, Verify}; use sp_std::marker::PhantomData; use std::{collections::BTreeMap, str::FromStr}; @@ -289,7 +289,7 @@ fn testnet_genesis( }, "bulkPallet":{ "rpcUrl": b"ws://127.0.0.1:8855".to_vec(), - "genesisHash": U256::from_str("0x9e68f1a9b89f5e9f60b1e76db8fe75939ffba5bddc7eb9f39ec9ddf19c700be6").expect("internal U256 is valid; qed") + "genesisHash": H256::from_str("0x016f9d0bc355e718ce950727cd423d4915f34ded0a94f466242446b8865e061f").expect("genesis hash error.") }, "orderPallet": { "slotWidth": 3, From 22ae5ea06fd2a94403f01aac882e63030a4cb31a Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Wed, 31 Jul 2024 14:16:19 +0800 Subject: [PATCH 05/27] don't delete lock file --- .github/workflows/rust.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 532f3d6..34e267c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,9 +66,6 @@ jobs: - name: Cargo Clean run: cargo clean - - name: Remove Cargo.lock - run: rm Cargo.lock - - name: Cargo Update run: cargo update From 9857cea363a90ea7fd54f2691bf4ae785755a23c Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Wed, 31 Jul 2024 14:58:30 +0800 Subject: [PATCH 06/27] don't run cargo update --- .github/workflows/rust.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 34e267c..14d4827 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,9 +66,6 @@ jobs: - name: Cargo Clean run: cargo clean - - name: Cargo Update - run: cargo update - - name: Build run: cargo check --release From 9d372840e31860f0cf17a9b6f33b1e3125d9db50 Mon Sep 17 00:00:00 2001 From: toints Date: Wed, 31 Jul 2024 16:42:04 +0800 Subject: [PATCH 07/27] Fixed: excessive deductions When transferring money to an EVM account, a portion will be deducted to create a new account. --- runtime/src/lib.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a81f988..3db5a9c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -13,6 +13,7 @@ pub mod xcms; use codec::{Decode, Encode, MaxEncodedLen}; use core::ops::Div; +use pallet_evm::AddressMapping; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; @@ -362,7 +363,7 @@ pub const GRAND: Balance = QUID * 1_000; pub const MILLICENTS: Balance = CENTS / 1_000; /// The existential deposit. Set to 1/10 of the Connected Relay Chain. -pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; +pub const EXISTENTIAL_DEPOSIT: Balance = 1; /// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is /// used to limit the maximal weight of a single extrinsic. @@ -1416,7 +1417,21 @@ impl_runtime_apis! { } fn account_basic(address: H160) -> EVMAccount { - let (account, _) = pallet_evm::Pallet::::account_basic(&address); + let account_id = ::AddressMapping::into_account_id(address); + + let nonce = frame_system::Pallet::::account_nonce(&account_id); + + let balance_free = + ::Currency::free_balance(account_id.clone()); + let balance_reserved = + ::Currency::reserved_balance(account_id); + let balance = balance_free.saturating_add(balance_reserved); + + + let account = EVMAccount { + nonce: U256::from(UniqueSaturatedInto::::unique_saturated_into(nonce)), + balance: U256::from(UniqueSaturatedInto::::unique_saturated_into(balance)), + }; account } From 83e175a59d22dce3f96af108bc2b38a9819b1ef8 Mon Sep 17 00:00:00 2001 From: toints Date: Wed, 31 Jul 2024 17:39:43 +0800 Subject: [PATCH 08/27] Update rust.yml --- .github/workflows/rust.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 532f3d6..14d4827 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,12 +66,6 @@ jobs: - name: Cargo Clean run: cargo clean - - name: Remove Cargo.lock - run: rm Cargo.lock - - - name: Cargo Update - run: cargo update - - name: Build run: cargo check --release From 529cf8ba5fadcdd2449af32beedc697cb12eddf0 Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Thu, 1 Aug 2024 23:36:42 +0800 Subject: [PATCH 09/27] optimism the asset-bridge Extract the logic to improve construct --- pallets/assets-bridge/src/lib.rs | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index df53215..c66ac03 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -213,7 +213,25 @@ pub mod pallet { #[pallet::constant] type ClaimBond: Get>; } - + impl Pallet { + fn ensure_admin(who: &T::AccountId) -> Result<(), Error> { + if Some(who.clone()) != Self::admin_key() { + Err(Error::::RequireAdmin) + } else { + Ok(()) + } + } + + fn is_in_emergency(asset_id: T::AssetId) -> bool { + Self::emergencies() + .iter() + .any(|emergency| emergency.clone() == asset_id.clone()) + } + + fn is_in_back_foreign(asset_id: T::AssetId) -> bool { + Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) + } + } /// The Substrate Account for Evm Addresses /// /// SubAccounts: map H160 => Option @@ -379,8 +397,7 @@ pub mod pallet { force: LocalFortitude, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(!Self::is_in_emergency(asset_id.clone()), Error::::InEmergency); - ensure!(!amount.is_zero(), Error::::ZeroBalance); + Self::ensure_admin(&who)?; // 1. check evm account //let evm_account = Self::evm_accounts(&who).ok_or(Error::::EthAddressHasNotMapped)?; @@ -711,13 +728,5 @@ where } } - fn is_in_emergency(asset_id: T::AssetId) -> bool { - Self::emergencies() - .iter() - .any(|emergency| emergency.clone() == asset_id.clone()) - } - fn is_in_back_foreign(asset_id: T::AssetId) -> bool { - Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) - } } From 6b439f11b2a95876e1ed9963cb1fdc2869acfb3c Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Thu, 1 Aug 2024 23:56:05 +0800 Subject: [PATCH 10/27] Revert "optimism the asset-bridge" This reverts commit 529cf8ba5fadcdd2449af32beedc697cb12eddf0. --- pallets/assets-bridge/src/lib.rs | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index c66ac03..df53215 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -213,25 +213,7 @@ pub mod pallet { #[pallet::constant] type ClaimBond: Get>; } - impl Pallet { - fn ensure_admin(who: &T::AccountId) -> Result<(), Error> { - if Some(who.clone()) != Self::admin_key() { - Err(Error::::RequireAdmin) - } else { - Ok(()) - } - } - - fn is_in_emergency(asset_id: T::AssetId) -> bool { - Self::emergencies() - .iter() - .any(|emergency| emergency.clone() == asset_id.clone()) - } - - fn is_in_back_foreign(asset_id: T::AssetId) -> bool { - Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) - } - } + /// The Substrate Account for Evm Addresses /// /// SubAccounts: map H160 => Option @@ -397,7 +379,8 @@ pub mod pallet { force: LocalFortitude, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - Self::ensure_admin(&who)?; + ensure!(!Self::is_in_emergency(asset_id.clone()), Error::::InEmergency); + ensure!(!amount.is_zero(), Error::::ZeroBalance); // 1. check evm account //let evm_account = Self::evm_accounts(&who).ok_or(Error::::EthAddressHasNotMapped)?; @@ -728,5 +711,13 @@ where } } + fn is_in_emergency(asset_id: T::AssetId) -> bool { + Self::emergencies() + .iter() + .any(|emergency| emergency.clone() == asset_id.clone()) + } + fn is_in_back_foreign(asset_id: T::AssetId) -> bool { + Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) + } } From 4feb5840b979b53673156955d4adc9a191b1bac8 Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Fri, 2 Aug 2024 00:19:04 +0800 Subject: [PATCH 11/27] optimism asset-bridge optimize the func to improve the construction --- pallets/assets-bridge/src/lib.rs | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index df53215..2062208 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -214,6 +214,29 @@ pub mod pallet { type ClaimBond: Get>; } + impl Pallet { + fn ensure_admin(who: &T::AccountId) -> Result<(), Error> { + if Some(who.clone()) != Self::admin_key() { + Err(Error::::RequireAdmin) + } else { + Ok(()) + } + } + + + fn is_in_emergency(asset_id: T::AssetId) -> bool { + Self::emergencies() + .iter() + .any(|emergency| emergency.clone() == asset_id.clone()) + } + + + fn is_in_back_foreign(asset_id: T::AssetId) -> bool { + Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) + } + } + + /// The Substrate Account for Evm Addresses /// /// SubAccounts: map H160 => Option @@ -711,13 +734,5 @@ where } } - fn is_in_emergency(asset_id: T::AssetId) -> bool { - Self::emergencies() - .iter() - .any(|emergency| emergency.clone() == asset_id.clone()) - } - fn is_in_back_foreign(asset_id: T::AssetId) -> bool { - Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) - } } From fa8a543117325a445941b8828a892a68e160f8b9 Mon Sep 17 00:00:00 2001 From: zachary0809 <139736437+zachary0809@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:26:13 +0800 Subject: [PATCH 12/27] Update rust.yml Delete cargo update and undelete cargo.lock. --- .github/workflows/rust.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 532f3d6..14d4827 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,12 +66,6 @@ jobs: - name: Cargo Clean run: cargo clean - - name: Remove Cargo.lock - run: rm Cargo.lock - - - name: Cargo Update - run: cargo update - - name: Build run: cargo check --release From 34ab5464be0f101d27151d57e867c1403aa2a91d Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Fri, 2 Aug 2024 00:31:31 +0800 Subject: [PATCH 13/27] adjust fmt --- pallets/assets-bridge/src/lib.rs | 39 ++++++++++++++------------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index 2062208..748a14d 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -215,27 +215,24 @@ pub mod pallet { } impl Pallet { - fn ensure_admin(who: &T::AccountId) -> Result<(), Error> { - if Some(who.clone()) != Self::admin_key() { - Err(Error::::RequireAdmin) - } else { - Ok(()) - } - } - - - fn is_in_emergency(asset_id: T::AssetId) -> bool { - Self::emergencies() - .iter() - .any(|emergency| emergency.clone() == asset_id.clone()) - } - - - fn is_in_back_foreign(asset_id: T::AssetId) -> bool { - Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) - } - } + fn ensure_admin(who: &T::AccountId) -> Result<(), Error> { + if Some(who.clone()) != Self::admin_key() { + Err(Error::::RequireAdmin) + } else { + Ok(()) + } + } + + fn is_in_emergency(asset_id: T::AssetId) -> bool { + Self::emergencies() + .iter() + .any(|emergency| emergency.clone() == asset_id.clone()) + } + fn is_in_back_foreign(asset_id: T::AssetId) -> bool { + Self::back_foreign_assets().iter().any(|id| id.clone() == asset_id.clone()) + } + } /// The Substrate Account for Evm Addresses /// @@ -733,6 +730,4 @@ where _ => Err(Error::::ExecutedFailed.into()), } } - - } From e802f249ef3c85f6c238d864d857993dc444401a Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Fri, 2 Aug 2024 00:53:12 +0800 Subject: [PATCH 14/27] apply ensure_admin --- pallets/assets-bridge/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index 748a14d..ca40469 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -516,7 +516,7 @@ pub mod pallet { asset_id: Option, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(Some(who) == Self::admin_key(), Error::::RequireAdmin); + Self::ensure_admin(&who)?; Emergencies::::try_mutate(|emergencies| { if let Some(id) = asset_id.clone() { From f95d805c78ee91a0d5933a568e70c07fbc0801c7 Mon Sep 17 00:00:00 2001 From: Acaishiba Date: Fri, 2 Aug 2024 10:30:26 +0800 Subject: [PATCH 15/27] apply ensure_admin --- pallets/assets-bridge/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/assets-bridge/src/lib.rs b/pallets/assets-bridge/src/lib.rs index ca40469..50d384a 100644 --- a/pallets/assets-bridge/src/lib.rs +++ b/pallets/assets-bridge/src/lib.rs @@ -491,7 +491,7 @@ pub mod pallet { erc20: H160, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(Some(who) == Self::admin_key(), Error::::RequireAdmin); + Self::ensure_admin(&who)?; // ensure asset_id and erc20 address has not been mapped ensure!(!Erc20s::::contains_key(asset_id.clone()), Error::::AssetIdHasMapped); @@ -667,7 +667,7 @@ pub mod pallet { new_contract: H160, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(Some(who) == Self::admin_key(), Error::::RequireAdmin); + Self::ensure_admin(&who)?; EvmContracts::::mutate(|contracts| { contracts.insert(new_contract); From 102c4868171b04c0d2d703b1b2b6a9e13befacce Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Sun, 11 Aug 2024 14:39:25 +0800 Subject: [PATCH 16/27] Ability to configure whether to check GenesisHash, add configuration GenesisHash --- Cargo.toml | 2 +- pallets/bulk/src/benchmarking.rs | 18 ++++++++ pallets/bulk/src/lib.rs | 63 +++++++++++++++++++++++---- pallets/bulk/src/mock.rs | 2 +- pallets/bulk/src/weights.rs | 50 +++++++++++++++++++++ pallets/on-demand/Cargo.toml | 3 +- pallets/on-demand/src/benchmarking.rs | 7 +-- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 2 +- 9 files changed, 132 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d56f6f9..bdede81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "rel sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0", default-features = false } pallet-broker = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0", default-features = false } sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0"} # Substrate FRAME frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.0", default-features = false } diff --git a/pallets/bulk/src/benchmarking.rs b/pallets/bulk/src/benchmarking.rs index 00ba979..39fe455 100644 --- a/pallets/bulk/src/benchmarking.rs +++ b/pallets/bulk/src/benchmarking.rs @@ -20,9 +20,11 @@ use super::*; #[allow(unused)] use crate::Pallet as Bulk; +use core::str::FromStr; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; use frame_system::RawOrigin; use pallet_broker::{CoreMask, RegionId}; +use sp_core::H256; mod test_sproof { use sp_trie::StorageProof; @@ -80,6 +82,22 @@ benchmarks! { verify { assert_eq!(RpcUrl::::get(), Some(url)); } + + set_genesis_hash { + let s in 0 .. 100; + let genesis_hash = H256::from_str("0x016f9d0bc355e718ce950727cd423d4915f34ded0a94f466242446b8865e061f").expect("genesis hash error."); + }: _(RawOrigin::Root, genesis_hash.clone()) + verify { + assert_eq!(GenesisHash::::get(), genesis_hash); + } + + set_check_genesis_hash { + let s in 0 .. 100; + let check_genesis_hash = true; + }: _(RawOrigin::Root, check_genesis_hash) + verify { + assert_eq!(CheckGenesisHash::::get(), check_genesis_hash); + } } impl_benchmark_test_suite!(Bulk, crate::mock::ExtBuilder::default().build(), crate::mock::Test,); diff --git a/pallets/bulk/src/lib.rs b/pallets/bulk/src/lib.rs index ceb9919..9814f55 100644 --- a/pallets/bulk/src/lib.rs +++ b/pallets/bulk/src/lib.rs @@ -114,6 +114,16 @@ pub mod pallet { #[pallet::getter(fn genesis_hash)] pub type GenesisHash = StorageValue<_, PHash, ValueQuery>; + #[pallet::type_value] + pub fn CheckGenesisHashOnEmpty() -> bool { + false + } + + /// Is check coretime parachain genesis block hash or not. + #[pallet::storage] + #[pallet::getter(fn check_genesis_hash)] + pub type CheckGenesisHash = StorageValue<_, bool, ValueQuery, CheckGenesisHashOnEmpty>; + /// Bulk purchase Information Map. #[pallet::storage] #[pallet::getter(fn bulk_records)] @@ -124,6 +134,7 @@ pub mod pallet { pub struct GenesisConfig { pub rpc_url: BoundedVec, pub genesis_hash: PHash, + pub check_genesis_hash: bool, pub _marker: PhantomData, } @@ -132,6 +143,7 @@ pub mod pallet { Self { rpc_url: BoundedVec::new(), genesis_hash: Default::default(), + check_genesis_hash: false, _marker: Default::default(), } } @@ -142,6 +154,7 @@ pub mod pallet { fn build(&self) { RpcUrl::::put(&self.rpc_url); GenesisHash::::put(&self.genesis_hash); + CheckGenesisHash::::put(&self.check_genesis_hash); } } @@ -263,16 +276,20 @@ pub mod pallet { let purchaser = region_record.owner; (balance, purchaser) }; - let genesis_hash_key = SYSTEM_BLOCKHASH_GENESIS; - let genesis_hash = storage_rooted_proof - .read_entry::(genesis_hash_key, None) - .ok() - .ok_or(Error::::FailedReading)?; - - let stored_hash = GenesisHash::::get(); - if genesis_hash != stored_hash { - Err(Error::::GenesisHashInconsistency)?; + + if Self::check_genesis_hash() { + let genesis_hash_key = SYSTEM_BLOCKHASH_GENESIS; + let genesis_hash = storage_rooted_proof + .read_entry::(genesis_hash_key, None) + .ok() + .ok_or(Error::::FailedReading)?; + + let stored_hash = GenesisHash::::get(); + if genesis_hash != stored_hash { + Err(Error::::GenesisHashInconsistency)?; + } } + let real_start_relaychain_height = Self::relaychain_block_number(); let real_end_relaychain_height = real_start_relaychain_height + duration; let old_record_index = RecordIndex::::get(); @@ -321,6 +338,34 @@ pub mod pallet { Ok(()) } + + /// Set coretime parachain genesis hash. + /// + /// Parameters: + /// - `genesis_hash`: genesis hash. + #[pallet::call_index(2)] + #[pallet::weight(::WeightInfo::set_genesis_hash())] + pub fn set_genesis_hash(origin: OriginFor, genesis_hash: PHash) -> DispatchResult { + T::UpdateOrigin::ensure_origin(origin)?; + + GenesisHash::::put(genesis_hash); + + Ok(()) + } + + /// Set check coretime parachain genesis hash. + /// + /// Parameters: + /// - `check`: check genesis hash. + #[pallet::call_index(3)] + #[pallet::weight(::WeightInfo::set_check_genesis_hash())] + pub fn set_check_genesis_hash(origin: OriginFor, check: bool) -> DispatchResult { + T::UpdateOrigin::ensure_origin(origin)?; + + CheckGenesisHash::::put(check); + + Ok(()) + } } } diff --git a/pallets/bulk/src/mock.rs b/pallets/bulk/src/mock.rs index 45db57b..e4d672b 100644 --- a/pallets/bulk/src/mock.rs +++ b/pallets/bulk/src/mock.rs @@ -202,7 +202,7 @@ impl ExtBuilder { "0x4ea18c8f295ba903acbbed39c70ea0569cf1705fa954a537ffa3b8b7125eaf58", ) .expect("internal U256 is valid; qed"), - _marker: Default::default(), + ..Default::default() } .assimilate_storage(&mut t) .unwrap(); diff --git a/pallets/bulk/src/weights.rs b/pallets/bulk/src/weights.rs index 7728878..ea85c8a 100644 --- a/pallets/bulk/src/weights.rs +++ b/pallets/bulk/src/weights.rs @@ -37,6 +37,8 @@ use core::marker::PhantomData; pub trait WeightInfo { fn set_rpc_url() -> Weight; fn create_record() -> Weight; + fn set_genesis_hash() -> Weight; + fn set_check_genesis_hash() -> Weight; } /// Weight functions for `pallet_bulk`. pub struct SubstrateWeight(PhantomData); @@ -70,6 +72,32 @@ impl WeightInfo for SubstrateWeight { .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } + /// Storage: `BulkPallet::GenesisHash` (r:0 w:1) + /// Proof: `BulkPallet::GenesisHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// The range of component `s` is `[0, 100]`. + fn set_genesis_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_537_000 picoseconds. + Weight::from_parts(4_080_512, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 465 + .saturating_add(Weight::from_parts(2, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `BulkPallet::CheckGenesisHash` (r:0 w:1) + /// Proof: `BulkPallet::CheckGenesisHash` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// The range of component `s` is `[0, 100]`. + fn set_check_genesis_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_306_000 picoseconds. + Weight::from_parts(3_896_852, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } } impl WeightInfo for () { @@ -92,4 +120,26 @@ impl WeightInfo for () { .saturating_add(Weight::from_parts(0, 0)) .saturating_add(RocksDbWeight::get().writes(1)) } + + fn set_genesis_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_537_000 picoseconds. + Weight::from_parts(4_080_512, 0) + .saturating_add(Weight::from_parts(0, 0)) + // Standard Error: 465 + .saturating_add(Weight::from_parts(2, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + + fn set_check_genesis_hash() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_306_000 picoseconds. + Weight::from_parts(3_896_852, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } } \ No newline at end of file diff --git a/pallets/on-demand/Cargo.toml b/pallets/on-demand/Cargo.toml index 9851647..a8eb143 100644 --- a/pallets/on-demand/Cargo.toml +++ b/pallets/on-demand/Cargo.toml @@ -38,6 +38,7 @@ sp-trie = { workspace = true, default-features = false } pallet-balances = { workspace = true, default-features = false } sp-core = { workspace = true , default-features = false} pallet-aura = { workspace = true, default-features = false } +sp-consensus-aura = { workspace = true, default-features = false} [dev-dependencies] serde = { workspace = true } @@ -56,7 +57,7 @@ pallet-society ={ workspace = true, default-features = false} xcm-builder = { workspace = true, default-features = false } parachains-common = { workspace = true, default-features = false } pallet-timestamp = { workspace = true, default-features = false } -sp-keyring = { workspace = true, default-features = false} +sp-keyring = { workspace = true } [features] default = [ "std" ] diff --git a/pallets/on-demand/src/benchmarking.rs b/pallets/on-demand/src/benchmarking.rs index 35a72e1..62c07f1 100644 --- a/pallets/on-demand/src/benchmarking.rs +++ b/pallets/on-demand/src/benchmarking.rs @@ -20,13 +20,14 @@ pub use super::*; #[allow(unused)] use crate::Pallet as Order; -use codec::Encode; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; use frame_system::RawOrigin; -use sp_core::crypto::UncheckedFrom; +use sp_consensus_aura::sr25519::AuthorityId; use sp_runtime::Perbill; benchmarks! { + where_clause { where T::AccountId : From<[u8; 32]>,} + set_slot_width { let s in 0 .. 100; let caller: T::AccountId = whitelisted_caller(); @@ -57,7 +58,7 @@ benchmarks! { create_order { let s in 0..100; let r = [0xd4,0x35,0x93,0xc7,0x15,0xfd,0xd3,0x1c,0x61,0x14,0x1a,0xbd,0x04,0xa9,0x9f,0xd6,0x82,0x2c,0x85,0x58,0x85,0x4c,0xcd,0xe3,0x9a,0x56,0x84,0xe7,0xa5,0x6d,0xa2,0x7d]; - let author_pub = T::AccountId::try_from(r).unwrap(); + let author_pub = AuthorityId::from(sp_core::sr25519::Public::from_raw(r)); let bulk_inherent_data = mp_coretime_on_demand::OrderInherentData { relay_chian_number: 40, author_pub: Some(author_pub), diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 7c64e87..4718828 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -262,7 +262,7 @@ runtime-benchmarks = [ "pallet-ranked-collective/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-contracts/runtime-benchmarks", - "pallet-move/runtime-benchmarks", + #"pallet-move/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-bulk/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 51d8f53..f228c54 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1305,7 +1305,7 @@ mod benches { [cumulus_pallet_xcmp_queue, XcmpQueue] [pallet_bulk, BulkPallet] [pallet_on_demand, OrderPallet] - [pallet_move, MoveModule] + // [pallet_move, MoveModule] [pallet_multisig, Multisig] [pallet_proxy, Proxy] ); From a368e2ed2d919137a37245a61e0353f6a39c39bc Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Sun, 11 Aug 2024 14:42:07 +0800 Subject: [PATCH 17/27] recover move pallet bechmark --- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 4718828..7c64e87 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -262,7 +262,7 @@ runtime-benchmarks = [ "pallet-ranked-collective/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-contracts/runtime-benchmarks", - #"pallet-move/runtime-benchmarks", + "pallet-move/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-bulk/runtime-benchmarks", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index f228c54..51d8f53 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1305,7 +1305,7 @@ mod benches { [cumulus_pallet_xcmp_queue, XcmpQueue] [pallet_bulk, BulkPallet] [pallet_on_demand, OrderPallet] - // [pallet_move, MoveModule] + [pallet_move, MoveModule] [pallet_multisig, Multisig] [pallet_proxy, Proxy] ); From 44a1ab85e39174dd74f741bb3f9a56f0ad7efe15 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Mon, 12 Aug 2024 20:09:06 +0800 Subject: [PATCH 18/27] block time need set 12000 when async backing turn off --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 51d8f53..6c68881 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -341,7 +341,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { /// up by `pallet_aura` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 6000; +pub const MILLISECS_PER_BLOCK: u64 = 12000; pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2000; // NOTE: Currently it is not possible to change the slot duration after the chain has started. From 85526b81cfc1c5ee3029b0e9ffbd49ad008c527e Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Thu, 15 Aug 2024 22:02:29 +0800 Subject: [PATCH 19/27] Modify the gas threshold type, representing value/100 --- pallets/on-demand/src/lib.rs | 20 ++++++++++++++------ pallets/on-demand/src/mock.rs | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pallets/on-demand/src/lib.rs b/pallets/on-demand/src/lib.rs index 8f45429..9104fe1 100644 --- a/pallets/on-demand/src/lib.rs +++ b/pallets/on-demand/src/lib.rs @@ -34,7 +34,10 @@ use frame_support::{ use frame_system::pallet_prelude::*; pub use pallet::*; use primitives::Balance; -use sp_runtime::sp_std::{prelude::*, vec}; +use sp_runtime::{ + sp_std::{prelude::*, vec}, + traits::Saturating, +}; pub mod weights; use cumulus_pallet_parachain_system::RelaychainStateProvider; use sp_runtime::Perbill; @@ -110,7 +113,7 @@ pub mod pallet { /// Gas threshold that triggers order placement. #[pallet::storage] #[pallet::getter(fn gas_threshold)] - pub(super) type GasThreshold = StorageValue<_, Perbill, ValueQuery>; + pub(super) type GasThreshold = StorageValue<_, u128, ValueQuery>; /// Order Information Map. #[pallet::storage] @@ -132,7 +135,7 @@ pub mod pallet { { pub slot_width: u32, pub price_limit: BalanceOf, - pub gas_threshold: Perbill, + pub gas_threshold: u128, } #[pallet::genesis_build] @@ -307,7 +310,7 @@ pub mod pallet { #[pallet::weight(::WeightInfo::set_gas_threshold())] pub fn set_gas_threshold( origin: OriginFor, - threshold: Perbill, + threshold: u128, ) -> DispatchResultWithPostInfo { T::UpdateOrigin::ensure_origin(origin)?; @@ -325,9 +328,14 @@ where /// /// Parameters: /// - `gas_balance`: The total gas. - pub fn reach_txpool_threshold(gas_balance: BalanceOf, core_price: BalanceOf) -> bool { + pub fn reach_txpool_threshold(gas_balance: BalanceOf, core_price: BalanceOf) -> bool + where + BalanceOf: Into, + { let txpool_threshold = GasThreshold::::get(); - gas_balance > txpool_threshold * core_price + let left = gas_balance.into(); + let right = txpool_threshold * core_price.into() / 100; + left > right } fn check_slot_author(relaychian_number: u32, author: T::AccountId) -> bool { diff --git a/pallets/on-demand/src/mock.rs b/pallets/on-demand/src/mock.rs index 62d8ab6..36bfb7c 100644 --- a/pallets/on-demand/src/mock.rs +++ b/pallets/on-demand/src/mock.rs @@ -229,7 +229,7 @@ impl ExtBuilder { crate::GenesisConfig:: { slot_width: 3, price_limit: 200000000, - gas_threshold: Perbill::one(), + gas_threshold: 1, } .assimilate_storage(&mut t) .unwrap(); From 7216b6b8fa04790fbf0e457834ae7e85e61993ce Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Thu, 15 Aug 2024 22:22:01 +0800 Subject: [PATCH 20/27] fixup cargo fmt error --- pallets/on-demand/src/mock.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pallets/on-demand/src/mock.rs b/pallets/on-demand/src/mock.rs index 36bfb7c..a423a7f 100644 --- a/pallets/on-demand/src/mock.rs +++ b/pallets/on-demand/src/mock.rs @@ -226,13 +226,9 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.balances } .assimilate_storage(&mut t) .unwrap(); - crate::GenesisConfig:: { - slot_width: 3, - price_limit: 200000000, - gas_threshold: 1, - } - .assimilate_storage(&mut t) - .unwrap(); + crate::GenesisConfig:: { slot_width: 3, price_limit: 200000000, gas_threshold: 1 } + .assimilate_storage(&mut t) + .unwrap(); pallet_aura::GenesisConfig:: { authorities: vec![Alice.public().into()] } .assimilate_storage(&mut t) .unwrap(); From 537f32deab6ff4a18649986d1bf8f953f5e0113c Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Sat, 17 Aug 2024 15:34:06 +0800 Subject: [PATCH 21/27] Modify the judgment logic of gas threshold --- client/coretime/common/src/lib.rs | 2 +- client/coretime/on-demand/src/lib.rs | 53 ++++++++++++++++++++++------ node/src/service.rs | 7 ++++ 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/client/coretime/common/src/lib.rs b/client/coretime/common/src/lib.rs index 990a8e0..6b87470 100644 --- a/client/coretime/common/src/lib.rs +++ b/client/coretime/common/src/lib.rs @@ -141,7 +141,7 @@ pub async fn relaychain_spot_price( .transpose() .ok()?? .traffic; - FixedU128::from(traffic.0) + FixedU128::from_rational(traffic.0, FixedU128::accuracy()) }; // configuration pallet version let configuration_version_storage = diff --git a/client/coretime/on-demand/src/lib.rs b/client/coretime/on-demand/src/lib.rs index 7f13cd2..f162549 100644 --- a/client/coretime/on-demand/src/lib.rs +++ b/client/coretime/on-demand/src/lib.rs @@ -55,6 +55,7 @@ use sp_runtime::{ use std::{cmp::Ordering, net::SocketAddr}; use std::{error::Error, fmt::Debug, sync::Arc}; use submit_order::{build_rpc_for_submit_order, SubmitOrderError}; +use subxt::backend::{legacy::LegacyRpcMethods, rpc::RpcClient}; use subxt::{OnlineClient, PolkadotConfig}; /// Order type @@ -143,11 +144,13 @@ async fn reach_txpool_threshold( height: RelayBlockNumber, snap_txs: Vec, core_price: Balance, + relay_decimal: u64, + parachain_decimal: u64, ) -> Option<(bool, OrderType)> where Block: BlockT, P: ProvideRuntimeApi + UsageProvider, - Balance: Codec + MaybeDisplay + 'static + Debug + AtLeast32BitUnsigned + Copy, + Balance: Codec + MaybeDisplay + 'static + Debug + AtLeast32BitUnsigned + Copy + From, P::Api: TransactionPaymentApi + OrderRuntimeApi + OnRelayChainApi, @@ -170,14 +173,19 @@ where .ok()?; all_gas_value = query_fee.final_fee().add(all_gas_value); if transaction_pool.status().ready != 0 { + let new_core_price = if parachain_decimal >= relay_decimal { + core_price.saturating_mul( + (10 as u128).pow((parachain_decimal - relay_decimal) as u32).into(), + ) + } else { + core_price.checked_div( + &(10 as u128).pow((parachain_decimal - relay_decimal) as u32).into(), + )? + }; // Converted to a precision of 18 is_place_order = parachain .runtime_api() - .reach_txpool_threshold( - block_hash, - all_gas_value, - core_price.saturating_mul(1_000_000u32.into()), - ) + .reach_txpool_threshold(block_hash, all_gas_value, new_core_price) .ok()?; } log::info!( @@ -253,6 +261,8 @@ async fn handle_relaychain_stream( order_record: Arc>, transaction_pool: Arc, url: String, + relay_decimal: u64, + parachain_decimal: u64, ) -> Result<(), Box> where Block: BlockT, @@ -322,7 +332,15 @@ where // get on demand core price let max_amount = parachain.runtime_api().order_max_amount(hash)?; let p_spot_price = get_spot_price::(relay_chain.clone(), p_hash).await; - let spot_price = if let Some(pot_price) = p_spot_price { pot_price } else { max_amount }; + let (spot_price, place_price) = if let Some(spot_price) = p_spot_price { + if spot_price > max_amount { + (spot_price, spot_price) + } else { + (spot_price, max_amount) + } + } else { + (max_amount, max_amount) + }; // Check whether the gas of the transaction pool has reached the spot price threshold. let mut order_record_local = order_record.lock().await; @@ -332,6 +350,8 @@ where height, order_record_local.txs.clone(), spot_price, + relay_decimal, + parachain_decimal, ) .await; let mut can_order = false; @@ -359,7 +379,7 @@ where order_record_local.author_pub = Some(author); order_record_local.txs = get_txs(transaction_pool).await; let order_result = - try_place_order::(keystore, para_id, url, spot_price).await; + try_place_order::(keystore, para_id, url, place_price).await; order_record_local.order_status = OrderStatus::Order; if order_result.is_ok() { log::info!("===========place order successfully",); @@ -401,6 +421,7 @@ async fn relay_chain_notification( order_record: Arc>, transaction_pool: Arc, url: String, + parachain_decimal: u64, ) where R: RelayChainInterface + Clone, Block: BlockT, @@ -419,6 +440,14 @@ async fn relay_chain_notification( + OnRelayChainApi, ExPool: MaintainedTransactionPool::Hash> + 'static, { + let rpc_client = RpcClient::from_url(url.clone()).await.expect("rpc connect failed"); + let rpc = LegacyRpcMethods::::new(rpc_client.clone()); + let properties = rpc.system_properties().await.expect("can't get relaychain properties"); + let relay_decimal = properties + .get("tokenDecimals") + .and_then(|v| v.as_u64()) + .expect("can't get relaychain token decimal"); + let new_best_heads = match new_best_heads(relay_chain.clone(), para_id).await { Ok(best_heads_stream) => best_heads_stream.fuse(), Err(_err) => { @@ -431,7 +460,7 @@ async fn relay_chain_notification( h = new_best_heads.next() => { match h { Some((height, head, hash)) => { - let _ = handle_relaychain_stream(head,height, &*parachain,keystore.clone(), relay_chain.clone(), hash, para_id, order_record.clone(),transaction_pool.clone(), url.clone()).await; + let _ = handle_relaychain_stream(head,height, &*parachain,keystore.clone(), relay_chain.clone(), hash, para_id, order_record.clone(),transaction_pool.clone(), url.clone(), relay_decimal, parachain_decimal).await; }, None => { return; @@ -449,7 +478,7 @@ pub async fn ondemand_event_task( ) -> Result<(), Box> { // Get the final block of the relaychain through subxt. - let api = OnlineClient::::from_url(rpc_url).await?; + let api = OnlineClient::::from_url(rpc_url.clone()).await?; let mut blocks_sub = api.blocks().subscribe_best().await?; @@ -497,6 +526,7 @@ pub async fn run_on_demand_task( order_record: Arc>, transaction_pool: Arc, url: String, + parachain_decimal: u64, ) where R: RelayChainInterface + Clone, Block: BlockT, @@ -523,6 +553,7 @@ pub async fn run_on_demand_task( order_record.clone(), transaction_pool, url.clone(), + parachain_decimal, ); let event_notification = event_notification(para_id, url, order_record); select! { @@ -540,6 +571,7 @@ pub fn spawn_on_demand_order( keystore: KeystorePtr, order_record: Arc>, relay_rpc: Option, + parachain_decimal: u64, ) -> sc_service::error::Result<()> where Block: BlockT, @@ -571,6 +603,7 @@ where order_record, transaction_pool.clone(), url, + parachain_decimal, ); task_manager.spawn_essential_handle().spawn_blocking( "on demand order task", diff --git a/node/src/service.rs b/node/src/service.rs index 4519e9b..64d0fb7 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -241,6 +241,12 @@ async fn start_node_impl( let backend = params.backend.clone(); let mut task_manager = params.task_manager; let relay_rpc = polkadot_config.rpc_addr; + let parachain_decimal = parachain_config + .chain_spec + .properties() + .get("tokenDecimals") + .and_then(|v| v.as_u64()) + .expect("can't get token decimal"); let (relay_chain_interface, collator_key) = build_relay_chain_interface( polkadot_config, @@ -466,6 +472,7 @@ async fn start_node_impl( params.keystore_container.keystore(), order_record.clone(), relay_rpc, + parachain_decimal, )?; let bulk_mem_record = Arc::new(Mutex::new(BulkMemRecord { coretime_para_height: 0, items: Vec::new() })); From 7a7250e5622e3a93738011d10b19f272c1e1650d Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Sun, 18 Aug 2024 10:27:20 +0800 Subject: [PATCH 22/27] Fix coretime task's rpc connection --- client/coretime/on-demand/src/lib.rs | 7 ++----- node/src/service.rs | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/client/coretime/on-demand/src/lib.rs b/client/coretime/on-demand/src/lib.rs index f162549..43c1568 100644 --- a/client/coretime/on-demand/src/lib.rs +++ b/client/coretime/on-demand/src/lib.rs @@ -570,7 +570,7 @@ pub fn spawn_on_demand_order( task_manager: &TaskManager, keystore: KeystorePtr, order_record: Arc>, - relay_rpc: Option, + relay_rpc: String, parachain_decimal: u64, ) -> sc_service::error::Result<()> where @@ -592,9 +592,6 @@ where + TransactionPaymentApi + OnRelayChainApi, { - let mut url = String::from("ws://"); - url.push_str(&relay_rpc.expect("Should set rpc address for submit order extrinic").to_string()); - let on_demand_order_task = run_on_demand_task( para_id, parachain.clone(), @@ -602,7 +599,7 @@ where keystore, order_record, transaction_pool.clone(), - url, + relay_rpc, parachain_decimal, ); task_manager.spawn_essential_handle().spawn_blocking( diff --git a/node/src/service.rs b/node/src/service.rs index 64d0fb7..c2c01af 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -4,7 +4,7 @@ use sp_core::U256; use std::{path::Path, sync::Arc, time::Duration}; -use cumulus_client_cli::CollatorOptions; +use cumulus_client_cli::{CollatorOptions, RelayChainMode}; // Local Runtime Types use parachain_magnet_runtime::{ opaque::{Block, Hash}, @@ -240,13 +240,23 @@ async fn start_node_impl( let client = params.client.clone(); let backend = params.backend.clone(); let mut task_manager = params.task_manager; - let relay_rpc = polkadot_config.rpc_addr; let parachain_decimal = parachain_config .chain_spec .properties() .get("tokenDecimals") .and_then(|v| v.as_u64()) .expect("can't get token decimal"); + let relay_rpc = + if let RelayChainMode::ExternalRpc(urls) = collator_options.clone().relay_chain_mode { + urls[0].as_str().to_string() + } else { + let rpc_addr = polkadot_config.rpc_addr; + let mut url = String::from("ws://"); + url.push_str( + &rpc_addr.expect("Should set rpc address for submit order extrinic").to_string(), + ); + url + }; let (relay_chain_interface, collator_key) = build_relay_chain_interface( polkadot_config, From 896b4a104683918fd5930703a673ec425774faba Mon Sep 17 00:00:00 2001 From: toints Date: Thu, 5 Sep 2024 14:15:00 +0800 Subject: [PATCH 23/27] fix: fixed relychain and parachain has different token decimals --- pallets/liquidation/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pallets/liquidation/src/lib.rs b/pallets/liquidation/src/lib.rs index 53fc3dc..772e6c5 100644 --- a/pallets/liquidation/src/lib.rs +++ b/pallets/liquidation/src/lib.rs @@ -288,7 +288,10 @@ pub mod pallet { let (collator, real_gas_cost) = match T::OrderGasCost::gas_cost(n) { Ok(cost) => match cost { - Some((collator, real_gas_cost)) => (collator, real_gas_cost), + Some((collator, real_gas_cost)) => { + let adjusted_gas_cost = real_gas_cost * PARACHAIN_TO_RELAYCHAIN_UNIT; + (collator, adjusted_gas_cost) + }, None => return, }, Err(_) => { From ba0f70c14c947a7ea365b0b4a2716075f88bf222 Mon Sep 17 00:00:00 2001 From: toints Date: Tue, 10 Sep 2024 15:47:15 +0800 Subject: [PATCH 24/27] style: format code with rustc-1.81.0 --- client/coretime/bulk/src/lib.rs | 13 +++++++------ pallets/liquidation/src/lib.rs | 3 ++- runtime/src/xcms/xcm_weight.rs | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 76acf33..cac6112 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -198,12 +198,13 @@ where let constant_query = subxt::dynamic::constant("Broker", "TimeslicePeriod"); - let time_slice = - api.constants() - .at(&constant_query)? - .to_value()? - .as_u128() - .expect("coretime parachain time slice none") as u32; + let time_slice = api + .constants() + .at(&constant_query)? + .to_value()? + .as_u128() + .expect("coretime parachain time slice none") + as u32; item.end_relaychain_height = ev.when + item.duration * time_slice; diff --git a/pallets/liquidation/src/lib.rs b/pallets/liquidation/src/lib.rs index 772e6c5..a55fcfd 100644 --- a/pallets/liquidation/src/lib.rs +++ b/pallets/liquidation/src/lib.rs @@ -673,7 +673,8 @@ pub mod pallet { let total_existing_operation_ratio: u32 = OperationRatios::::iter().map(|(_, r)| r).sum(); let total_ratio = system_ratio - + treasury_ratio + collator_ratio + + treasury_ratio + + collator_ratio + total_existing_operation_ratio + ratio; log::info!("3 -+-+-+-+-+ set operation ratio, total ratio:{:?}, system_ratio:{:?}, treasury_ratio:{:?}, collator_ratio:{:?}, operation account:{:?}, op_ratio:{:?}", diff --git a/runtime/src/xcms/xcm_weight.rs b/runtime/src/xcms/xcm_weight.rs index 12a2b7f..0977a19 100644 --- a/runtime/src/xcms/xcm_weight.rs +++ b/runtime/src/xcms/xcm_weight.rs @@ -285,7 +285,8 @@ impl< AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, - > WeightTrader for UsingComponentsEx + > WeightTrader + for UsingComponentsEx { fn new() -> Self { Self(Weight::zero(), Zero::zero(), PhantomData) From 4386a6229c4c187d91da2fb45bfdffd2214322ba Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Fri, 13 Sep 2024 12:08:54 +0800 Subject: [PATCH 25/27] 1.Modify move dependencies 2.In ondemand mode, only the information of your own chain is displayed --- Cargo.lock | 4 ++-- client/coretime/bulk/src/lib.rs | 13 ++++++------- client/coretime/on-demand/src/lib.rs | 10 +++++----- pallets/liquidation/src/lib.rs | 3 +-- runtime/src/xcms/xcm_weight.rs | 3 +-- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25da992..c8f0be2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9063,7 +9063,7 @@ dependencies = [ [[package]] name = "pallet-move" version = "0.1.0" -source = "git+https://github.com/Magport/pallet-move?branch=main#3c477380e724de6c0290694874cce999cfa768d8" +source = "git+https://github.com/Magport/pallet-move?branch=main#780b6eefee2933971492eefd9e5807db614e9c0d" dependencies = [ "anyhow", "bcs 0.1.4", @@ -9089,7 +9089,7 @@ dependencies = [ [[package]] name = "pallet-move-rpc" version = "0.1.0" -source = "git+https://github.com/Magport/pallet-move?branch=main#3c477380e724de6c0290694874cce999cfa768d8" +source = "git+https://github.com/Magport/pallet-move?branch=main#780b6eefee2933971492eefd9e5807db614e9c0d" dependencies = [ "frame-support", "jsonrpsee 0.20.3", diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 82e895c..85531fd 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -211,13 +211,12 @@ where let constant_query = subxt::dynamic::constant("Broker", "TimeslicePeriod"); - let time_slice = api - .constants() - .at(&constant_query)? - .to_value()? - .as_u128() - .expect("coretime parachain time slice none") - as u32; + let time_slice = + api.constants() + .at(&constant_query)? + .to_value()? + .as_u128() + .expect("coretime parachain time slice none") as u32; item.end_relaychain_height = ev.when + item.duration * time_slice; diff --git a/client/coretime/on-demand/src/lib.rs b/client/coretime/on-demand/src/lib.rs index 43c1568..15df8af 100644 --- a/client/coretime/on-demand/src/lib.rs +++ b/client/coretime/on-demand/src/lib.rs @@ -493,13 +493,13 @@ pub async fn ondemand_event_task( let ev_order_placed = event.as_event::(); if let Ok(order_placed_event) = ev_order_placed { if let Some(ev) = order_placed_event { - log::info!( - "=====================Find OnDemandOrderPlaced event:{:?},{:?}================", - ev.para_id, - ev.spot_price, - ); let exp_id: u32 = para_id.into(); if ev.para_id.0 == exp_id { + log::info!( + "=====================Find OnDemandOrderPlaced event:{:?},{:?}================", + ev.para_id, + ev.spot_price, + ); // The orderer gets it from the slot by default. let mut order_record_local = order_record.lock().await; order_record_local.price = ev.spot_price; diff --git a/pallets/liquidation/src/lib.rs b/pallets/liquidation/src/lib.rs index a55fcfd..772e6c5 100644 --- a/pallets/liquidation/src/lib.rs +++ b/pallets/liquidation/src/lib.rs @@ -673,8 +673,7 @@ pub mod pallet { let total_existing_operation_ratio: u32 = OperationRatios::::iter().map(|(_, r)| r).sum(); let total_ratio = system_ratio - + treasury_ratio - + collator_ratio + + treasury_ratio + collator_ratio + total_existing_operation_ratio + ratio; log::info!("3 -+-+-+-+-+ set operation ratio, total ratio:{:?}, system_ratio:{:?}, treasury_ratio:{:?}, collator_ratio:{:?}, operation account:{:?}, op_ratio:{:?}", diff --git a/runtime/src/xcms/xcm_weight.rs b/runtime/src/xcms/xcm_weight.rs index 0977a19..12a2b7f 100644 --- a/runtime/src/xcms/xcm_weight.rs +++ b/runtime/src/xcms/xcm_weight.rs @@ -285,8 +285,7 @@ impl< AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, - > WeightTrader - for UsingComponentsEx + > WeightTrader for UsingComponentsEx { fn new() -> Self { Self(Weight::zero(), Zero::zero(), PhantomData) From e57bad5d1d9186b054f59a1816c5bc8e22130947 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Fri, 13 Sep 2024 13:22:05 +0800 Subject: [PATCH 26/27] fix cargo fmt bug --- client/coretime/bulk/src/lib.rs | 13 +++++++------ pallets/liquidation/src/lib.rs | 3 ++- runtime/src/xcms/xcm_weight.rs | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/coretime/bulk/src/lib.rs b/client/coretime/bulk/src/lib.rs index 85531fd..82e895c 100644 --- a/client/coretime/bulk/src/lib.rs +++ b/client/coretime/bulk/src/lib.rs @@ -211,12 +211,13 @@ where let constant_query = subxt::dynamic::constant("Broker", "TimeslicePeriod"); - let time_slice = - api.constants() - .at(&constant_query)? - .to_value()? - .as_u128() - .expect("coretime parachain time slice none") as u32; + let time_slice = api + .constants() + .at(&constant_query)? + .to_value()? + .as_u128() + .expect("coretime parachain time slice none") + as u32; item.end_relaychain_height = ev.when + item.duration * time_slice; diff --git a/pallets/liquidation/src/lib.rs b/pallets/liquidation/src/lib.rs index 772e6c5..a55fcfd 100644 --- a/pallets/liquidation/src/lib.rs +++ b/pallets/liquidation/src/lib.rs @@ -673,7 +673,8 @@ pub mod pallet { let total_existing_operation_ratio: u32 = OperationRatios::::iter().map(|(_, r)| r).sum(); let total_ratio = system_ratio - + treasury_ratio + collator_ratio + + treasury_ratio + + collator_ratio + total_existing_operation_ratio + ratio; log::info!("3 -+-+-+-+-+ set operation ratio, total ratio:{:?}, system_ratio:{:?}, treasury_ratio:{:?}, collator_ratio:{:?}, operation account:{:?}, op_ratio:{:?}", diff --git a/runtime/src/xcms/xcm_weight.rs b/runtime/src/xcms/xcm_weight.rs index 12a2b7f..0977a19 100644 --- a/runtime/src/xcms/xcm_weight.rs +++ b/runtime/src/xcms/xcm_weight.rs @@ -285,7 +285,8 @@ impl< AccountId, Currency: CurrencyT, OnUnbalanced: OnUnbalancedT, - > WeightTrader for UsingComponentsEx + > WeightTrader + for UsingComponentsEx { fn new() -> Self { Self(Weight::zero(), Zero::zero(), PhantomData) From 4740494afba6561366cecd2f25d28d11a52810a1 Mon Sep 17 00:00:00 2001 From: sulijia <984115358@qq.com> Date: Fri, 13 Sep 2024 23:25:29 +0800 Subject: [PATCH 27/27] Fixed the bug that multiple collators do not create order when generating blocks in ondemand mode --- client/coretime/common/src/lib.rs | 16 ++++++++++++ client/coretime/on-demand/src/lib.rs | 39 ++++++++++++++++------------ 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/client/coretime/common/src/lib.rs b/client/coretime/common/src/lib.rs index 6b87470..542ca0b 100644 --- a/client/coretime/common/src/lib.rs +++ b/client/coretime/common/src/lib.rs @@ -208,3 +208,19 @@ pub async fn order_slot( None } } + +/// Get the collator of this slot. +pub async fn order_slot_author( + idx: u32, + authorities: &[AuthorityId

], +) -> Option { + if authorities.is_empty() { + return None; + } + + let expected_author = authorities.get(idx as usize).expect( + "authorities not empty; index constrained to list length;this is a valid index; qed", + ); + + Some(expected_author.clone()) +} diff --git a/client/coretime/on-demand/src/lib.rs b/client/coretime/on-demand/src/lib.rs index 15df8af..7029494 100644 --- a/client/coretime/on-demand/src/lib.rs +++ b/client/coretime/on-demand/src/lib.rs @@ -368,23 +368,28 @@ where } } } - if let Some(author) = collator_public { - //your turn - if can_order { - if order_period { - if order_record_local.order_status == OrderStatus::Init { - log::info!("============place order, type:{:?}", order_type); - order_record_local.relay_parent = p_hash; - order_record_local.relay_height = height; - order_record_local.author_pub = Some(author); - order_record_local.txs = get_txs(transaction_pool).await; - let order_result = - try_place_order::(keystore, para_id, url, place_price).await; - order_record_local.order_status = OrderStatus::Order; - if order_result.is_ok() { - log::info!("===========place order successfully",); - } else { - log::info!("===========place order error:{:?}", order_result); + + if order_period { + let solt_author = + mc_coretime_common::order_slot_author::(idx, &authorities).await; + if let Some(author) = solt_author { + order_record_local.relay_parent = p_hash; + order_record_local.relay_height = height; + order_record_local.author_pub = Some(author); + order_record_local.txs = get_txs(transaction_pool).await; + //your turn + if collator_public.is_some() { + if can_order { + if order_record_local.order_status == OrderStatus::Init { + log::info!("============place order, type:{:?}", order_type); + let order_result = + try_place_order::(keystore, para_id, url, place_price).await; + order_record_local.order_status = OrderStatus::Order; + if order_result.is_ok() { + log::info!("===========place order successfully",); + } else { + log::info!("===========place order error:{:?}", order_result); + } } } }