diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d73f564..8ccc3820c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [vNext] - ... +======= + +## [4.8.9] + +- [C,D] Updated Substrate to polkadot-v0.9.42 +- Added ChargeError event to payout pallet ## [4.8.8] diff --git a/Cargo.lock b/Cargo.lock index 02c4ce11f..e8a45713f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,6 +371,17 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "async-trait" version = "0.1.77" @@ -446,10 +457,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "base58" +name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -778,7 +789,7 @@ dependencies = [ [[package]] name = "cere-cli" -version = "4.8.8" +version = "4.8.9" dependencies = [ "cere-client", "cere-service", @@ -793,7 +804,7 @@ dependencies = [ [[package]] name = "cere-client" -version = "4.8.8" +version = "4.8.9" dependencies = [ "cere-dev-runtime", "cere-runtime", @@ -825,7 +836,7 @@ dependencies = [ [[package]] name = "cere-dev-runtime" -version = "4.8.8" +version = "4.8.9" dependencies = [ "cere-runtime-common", "ddc-primitives", @@ -914,7 +925,7 @@ dependencies = [ [[package]] name = "cere-rpc" -version = "4.8.8" +version = "4.8.9" dependencies = [ "jsonrpsee", "node-primitives", @@ -943,7 +954,7 @@ dependencies = [ [[package]] name = "cere-runtime" -version = "4.8.8" +version = "4.8.9" dependencies = [ "cere-runtime-common", "ddc-primitives", @@ -1032,17 +1043,22 @@ dependencies = [ [[package]] name = "cere-runtime-common" -version = "4.8.8" +version = "4.8.9" dependencies = [ "frame-support", + "log", "node-primitives", + "pallet-session", + "sp-api", "sp-core", + "sp-io", "sp-runtime", + "sp-std", ] [[package]] name = "cere-service" -version = "4.8.8" +version = "4.8.9" dependencies = [ "cere-client", "cere-dev-runtime", @@ -1272,6 +1288,19 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -1493,6 +1522,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1703,7 +1744,7 @@ dependencies = [ [[package]] name = "ddc-primitives" -version = "4.8.8" +version = "4.8.9" dependencies = [ "frame-support", "frame-system", @@ -1857,6 +1898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -1965,11 +2007,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ "der 0.6.1", - "elliptic-curve", - "rfc6979", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", "signature 1.6.4", ] +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.3", +] + [[package]] name = "ed25519" version = "1.5.3" @@ -2044,22 +2100,47 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", "der 0.6.1", "digest 0.10.7", - "ff", + "ff 0.12.1", "generic-array 0.14.7", - "group", + "group 0.12.1", "hkdf", "pem-rfc7468", "pkcs8 0.9.0", "rand_core 0.6.4", - "sec1", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.5", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", "subtle", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "enum-as-inner" version = "0.5.1" @@ -2213,6 +2294,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.5" @@ -2304,7 +2395,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", ] @@ -2327,7 +2418,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-support-procedural", @@ -2352,7 +2443,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "array-bytes", @@ -2399,18 +2490,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2427,7 +2518,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -2456,15 +2547,19 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ + "async-recursion", "futures", + "indicatif", + "jsonrpsee", "log", "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", + "spinners", "substrate-rpc-client", "tokio", ] @@ -2472,7 +2567,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags 1.3.2", "environmental", @@ -2505,44 +2600,45 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", "itertools", + "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "log", @@ -2560,7 +2656,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -2575,7 +2671,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -2584,7 +2680,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "parity-scale-codec", @@ -2771,6 +2867,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2867,7 +2964,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -3131,6 +3239,23 @@ dependencies = [ "tokio-rustls 0.23.4", ] +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.10", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.24.1", + "webpki-roots 0.25.3", +] + [[package]] name = "iana-time-zone" version = "0.1.59" @@ -3266,6 +3391,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" +[[package]] +name = "indicatif" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + [[package]] name = "inout" version = "0.1.3" @@ -3398,6 +3536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", + "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", @@ -3454,6 +3593,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls 0.24.2", + "jsonrpsee-core", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "jsonrpsee-proc-macros" version = "0.16.3" @@ -3517,13 +3675,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "once_cell", "sha2 0.10.8", ] @@ -3557,9 +3716,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844" +checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" dependencies = [ "kvdb", "num_cpus", @@ -3662,7 +3821,7 @@ dependencies = [ "prost-build", "rand 0.8.5", "rw-stream-sink", - "sec1", + "sec1 0.3.0", "sha2 0.10.8", "smallvec", "thiserror", @@ -4069,9 +4228,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.3+7.4.4" +version = "0.10.0+7.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" +checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" dependencies = [ "bindgen", "bzip2-sys", @@ -4249,6 +4408,12 @@ dependencies = [ "libc", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "match_cfg" version = "0.1.0" @@ -4630,7 +4795,7 @@ dependencies = [ [[package]] name = "node-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-system", "parity-scale-codec", @@ -4733,6 +4898,12 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" version = "0.29.0" @@ -4808,8 +4979,8 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.8", ] @@ -4819,15 +4990,15 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.8", ] [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -4843,7 +5014,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -4857,7 +5028,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4870,7 +5041,7 @@ dependencies = [ "scale-info", "sp-application-crypto", "sp-consensus-babe", - "sp-consensus-vrf", + "sp-core", "sp-io", "sp-runtime", "sp-session", @@ -4881,7 +5052,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4901,7 +5072,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4916,7 +5087,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4933,7 +5104,7 @@ dependencies = [ [[package]] name = "pallet-chainbridge" -version = "4.8.8" +version = "4.8.9" dependencies = [ "frame-support", "frame-system", @@ -4949,7 +5120,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4968,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -4985,7 +5156,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags 1.3.2", "environmental", @@ -5008,14 +5179,14 @@ dependencies = [ "sp-runtime", "sp-std", "wasm-instrument 0.4.0", - "wasmi 0.20.0", + "wasmi 0.28.0", "wasmparser-nostd", ] [[package]] name = "pallet-contracts-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -5028,16 +5199,16 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "pallet-ddc-clusters" -version = "4.8.8" +version = "4.8.9" dependencies = [ "ddc-primitives", "frame-benchmarking", @@ -5062,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-ddc-customers" -version = "4.8.8" +version = "4.8.9" dependencies = [ "ddc-primitives", "frame-benchmarking", @@ -5084,7 +5255,7 @@ dependencies = [ [[package]] name = "pallet-ddc-nodes" -version = "4.8.8" +version = "4.8.9" dependencies = [ "ddc-primitives", "frame-benchmarking", @@ -5105,7 +5276,7 @@ dependencies = [ [[package]] name = "pallet-ddc-payouts" -version = "4.8.8" +version = "4.8.9" dependencies = [ "byte-unit", "chrono", @@ -5129,7 +5300,7 @@ dependencies = [ [[package]] name = "pallet-ddc-staking" -version = "4.8.8" +version = "4.8.9" dependencies = [ "ddc-primitives", "frame-benchmarking", @@ -5152,7 +5323,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5170,7 +5341,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5193,7 +5364,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5206,7 +5377,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5223,7 +5394,7 @@ dependencies = [ [[package]] name = "pallet-erc20" -version = "4.8.8" +version = "4.8.9" dependencies = [ "frame-support", "frame-system", @@ -5241,7 +5412,7 @@ dependencies = [ [[package]] name = "pallet-erc721" -version = "4.8.8" +version = "4.8.9" dependencies = [ "frame-support", "frame-system", @@ -5258,7 +5429,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5276,7 +5447,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5299,7 +5470,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5315,7 +5486,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5335,7 +5506,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5352,7 +5523,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5366,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5383,7 +5554,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5399,7 +5570,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5416,7 +5587,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5436,7 +5607,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -5447,7 +5618,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5464,7 +5635,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5488,7 +5659,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5505,7 +5676,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5520,7 +5691,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5535,7 +5706,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5552,7 +5723,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5573,7 +5744,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5589,7 +5760,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5603,7 +5774,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5626,18 +5797,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5651,7 +5822,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5669,7 +5840,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5688,7 +5859,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-support", "frame-system", @@ -5704,7 +5875,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5720,7 +5891,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5732,7 +5903,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5749,7 +5920,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -5765,7 +5936,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-benchmarking", "frame-support", @@ -6125,6 +6296,12 @@ dependencies = [ "universal-hash 0.5.1", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -6197,7 +6374,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -6207,7 +6384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" dependencies = [ "toml_datetime", - "toml_edit", + "toml_edit 0.20.2", ] [[package]] @@ -6234,6 +6411,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "proc-macro2" version = "1.0.76" @@ -6679,11 +6867,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -6715,9 +6913,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" dependencies = [ "libc", "librocksdb-sys", @@ -6977,7 +7175,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "sp-core", @@ -6988,7 +7186,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7016,7 +7214,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "futures-timer", @@ -7039,7 +7237,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7054,7 +7252,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -7073,18 +7271,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "chrono", @@ -7124,7 +7322,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "fnv", "futures", @@ -7150,7 +7348,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db", "kvdb", @@ -7176,7 +7374,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7201,13 +7399,12 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "fork-tree", "futures", "log", - "merlin", "num-bigint", "num-rational", "num-traits", @@ -7220,7 +7417,6 @@ dependencies = [ "sc-keystore", "sc-telemetry", "scale-info", - "schnorrkel", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -7228,7 +7424,6 @@ dependencies = [ "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", @@ -7240,7 +7435,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "jsonrpsee", @@ -7262,7 +7457,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7275,7 +7470,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.2", "array-bytes", @@ -7315,7 +7510,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "finality-grandpa", "futures", @@ -7335,7 +7530,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -7358,7 +7553,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "lru", "parity-scale-codec", @@ -7382,7 +7577,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7395,7 +7590,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "sc-allocator", @@ -7408,7 +7603,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "anyhow", "cfg-if", @@ -7426,7 +7621,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "futures", @@ -7442,7 +7637,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -7457,7 +7652,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-channel", @@ -7487,6 +7682,7 @@ dependencies = [ "serde", "serde_json", "smallvec", + "snow", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -7501,7 +7697,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "cid", "futures", @@ -7521,7 +7717,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -7549,7 +7745,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.2", "futures", @@ -7568,7 +7764,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -7590,7 +7786,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "async-trait", @@ -7624,7 +7820,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -7644,7 +7840,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "bytes", @@ -7652,7 +7848,7 @@ dependencies = [ "futures", "futures-timer", "hyper", - "hyper-rustls", + "hyper-rustls 0.23.2", "libp2p", "num_cpus", "once_cell", @@ -7675,7 +7871,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "libp2p", @@ -7688,7 +7884,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7697,7 +7893,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "jsonrpsee", @@ -7727,7 +7923,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7746,7 +7942,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "http", "jsonrpsee", @@ -7761,7 +7957,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", "futures", @@ -7787,7 +7983,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "directories", @@ -7853,7 +8049,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "log", "parity-scale-codec", @@ -7864,7 +8060,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "clap", "fs4", @@ -7880,7 +8076,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7899,7 +8095,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "libc", @@ -7918,7 +8114,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "chrono", "futures", @@ -7937,7 +8133,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "atty", @@ -7968,18 +8164,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -8006,7 +8202,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -8020,7 +8216,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-channel", "futures", @@ -8146,7 +8342,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", + "base16ct 0.1.1", "der 0.6.1", "generic-array 0.14.7", "pkcs8 0.9.0", @@ -8154,6 +8350,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.24.3" @@ -8268,6 +8478,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -8378,6 +8597,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ + "digest 0.10.7", "rand_core 0.6.4", ] @@ -8484,13 +8704,15 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -8502,7 +8724,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "blake2", @@ -8510,13 +8732,13 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8529,7 +8751,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "integer-sqrt", "num-traits", @@ -8543,7 +8765,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8556,7 +8778,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-api", @@ -8568,7 +8790,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "log", @@ -8586,7 +8808,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures", @@ -8601,7 +8823,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "parity-scale-codec", @@ -8619,10 +8841,9 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", - "merlin", "parity-scale-codec", "scale-info", "serde", @@ -8630,7 +8851,6 @@ dependencies = [ "sp-application-crypto", "sp-consensus", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", @@ -8642,7 +8862,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "finality-grandpa", "log", @@ -8660,7 +8880,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8669,29 +8889,16 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" -dependencies = [ - "parity-scale-codec", - "scale-info", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes", - "base58", "bitflags 1.3.2", "blake2", "bounded-collections", + "bs58", "dyn-clonable", "ed25519-zebra", "futures", @@ -8704,6 +8911,7 @@ dependencies = [ "merlin", "parity-scale-codec", "parking_lot 0.12.1", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -8728,7 +8936,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "blake2b_simd", "byteorder", @@ -8742,18 +8950,18 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8762,17 +8970,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "environmental", "parity-scale-codec", @@ -8783,7 +8991,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8798,7 +9006,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes", "ed25519 1.5.3", @@ -8807,6 +9015,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -8823,7 +9032,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "lazy_static", "sp-core", @@ -8834,14 +9043,11 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ - "async-trait", "futures", - "merlin", "parity-scale-codec", "parking_lot 0.12.1", - "schnorrkel", "serde", "sp-core", "sp-externalities", @@ -8851,16 +9057,27 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", ] [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8874,7 +9091,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-core", @@ -8884,7 +9101,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "backtrace", "lazy_static", @@ -8894,7 +9111,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "rustc-hash", "serde", @@ -8904,7 +9121,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "either", "hash256-std-hasher", @@ -8926,7 +9143,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -8944,19 +9161,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "Inflector", "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -8970,10 +9187,11 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", "sp-std", @@ -8982,7 +9200,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hash-db", "log", @@ -9002,12 +9220,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9020,7 +9238,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "futures-timer", @@ -9035,7 +9253,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "sp-std", @@ -9047,7 +9265,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "sp-api", "sp-runtime", @@ -9056,7 +9274,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "log", @@ -9072,11 +9290,11 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ahash 0.8.2", "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", @@ -9095,7 +9313,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9112,18 +9330,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9137,7 +9355,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "parity-scale-codec", "scale-info", @@ -9161,6 +9379,17 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spinners" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +dependencies = [ + "lazy_static", + "maplit", + "strum", +] + [[package]] name = "spki" version = "0.6.0" @@ -9299,7 +9528,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "platforms 2.0.0", ] @@ -9307,7 +9536,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -9326,7 +9555,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "hyper", "log", @@ -9338,7 +9567,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "jsonrpsee", @@ -9351,7 +9580,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "jsonrpsee", "log", @@ -9370,7 +9599,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "futures", "substrate-test-utils-derive", @@ -9380,18 +9609,18 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "ansi_term", "build-helper", @@ -9400,7 +9629,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum", "tempfile", - "toml", + "toml 0.7.8", "walkdir", "wasm-opt", ] @@ -9730,11 +9959,39 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + [[package]] name = "toml_datetime" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] [[package]] name = "toml_edit" @@ -9952,7 +10209,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.40#98f2e3451c9143278ec53c6718940aeabcd3b68a" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "async-trait", "clap", @@ -9982,7 +10239,7 @@ dependencies = [ "sp-version", "sp-weights", "substrate-rpc-client", - "zstd", + "zstd 0.12.4", ] [[package]] @@ -10366,13 +10623,13 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.20.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01bf50edb2ea9d922aa75a7bf3c15e26a6c9e2d18c56e862b49737a582901729" +checksum = "8e61a7006b0fdf24f6bbe8dcfdad5ca1b350de80061fb2827f31c82fbbb9565a" dependencies = [ "spin 0.9.8", "wasmi_arena", - "wasmi_core 0.5.0", + "wasmi_core 0.12.0", "wasmparser-nostd", ] @@ -10387,9 +10644,9 @@ dependencies = [ [[package]] name = "wasmi_arena" -version = "0.1.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ea379cbb0b41f3a9f0bf7b47036d036aae7f43383d8cc487d4deccf40dee0a" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" [[package]] name = "wasmi_core" @@ -10407,13 +10664,14 @@ dependencies = [ [[package]] name = "wasmi_core" -version = "0.5.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5bf998ab792be85e20e771fe14182b4295571ad1d4f89d3da521c1bef5f597a" +checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" dependencies = [ "downcast-rs", "libm", "num-traits", + "paste", ] [[package]] @@ -10428,9 +10686,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.91.0" +version = "0.100.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c37f310b5a62bfd5ae7c0f1d8e6f98af16a5d6d84ba764e9c36439ec14e318b" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" dependencies = [ "indexmap-nostd", ] @@ -10487,9 +10745,9 @@ dependencies = [ "rustix 0.36.17", "serde", "sha2 0.10.8", - "toml", + "toml 0.5.11", "windows-sys 0.42.0", - "zstd", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -10730,7 +10988,7 @@ dependencies = [ "ccm", "curve25519-dalek 3.2.0", "der-parser 8.2.0", - "elliptic-curve", + "elliptic-curve 0.12.3", "hkdf", "hmac 0.12.1", "log", @@ -10741,7 +10999,7 @@ dependencies = [ "rcgen 0.10.0", "ring 0.16.20", "rustls 0.19.1", - "sec1", + "sec1 0.3.0", "serde", "sha1", "sha2 0.10.8", @@ -11304,7 +11562,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -11317,6 +11584,16 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.9+zstd.1.5.5" diff --git a/Cargo.toml b/Cargo.toml index 6b4758b80..ba118a9a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,10 @@ [workspace.package] -version = "4.8.8" +version = "4.8.9" authors = ["Cerebellum-Network"] edition = "2021" homepage = "https://cere.network/" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +repository = "https://github.com/Cerebellum-Network/blockchain-node" [workspace] members = [ @@ -46,120 +47,120 @@ url = { version = "2.4.1" } # Substrate Dependencies # Please keey format such that: # dependency-name = { git = "X", branch = "Y", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-bags-list = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-child-bounties = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-fast-unstake = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false, features = ["historical"] } -pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-society = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-tips = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-network-common = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-sync-state = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sc-sysinfo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false } -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +node-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-bags-list = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-child-bounties = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-fast-unstake = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false, features = ["historical"] } +pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-society = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-network-common = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-sync-state = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-sysinfo = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", default-features = false } +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } # Cere Dependenies cere-client = { path = "node/client" } diff --git a/Dockerfile.tests b/Dockerfile.tests index 23c25292b..265a9e333 100644 --- a/Dockerfile.tests +++ b/Dockerfile.tests @@ -31,4 +31,4 @@ RUN PB_REL="https://github.com/protocolbuffers/protobuf/releases" && \ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ export PATH=$PATH:$HOME/.cargo/bin && \ scripts/init.sh && \ - TRYBUILD=overwrite cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path cli/Cargo.toml + TRYBUILD=overwrite cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path node/cli/Cargo.toml diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index b6b286d67..a71d15e50 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "cere-cli" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [package.metadata.wasm-pack.profile.release] # `wasm-opt` has some problems on Linux, see diff --git a/node/client/Cargo.toml b/node/client/Cargo.toml index 3961a54a5..95fdd6a27 100644 --- a/node/client/Cargo.toml +++ b/node/client/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "cere-client" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 0eee61e41..955650257 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "cere-rpc" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 2f0406fd3..42adc9af4 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -10,8 +10,6 @@ use std::sync::Arc; use jsonrpsee::RpcModule; use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index}; use sc_client_api::AuxStore; -use sc_consensus_babe::{BabeConfiguration, Epoch}; -use sc_consensus_epochs::SharedEpochChanges; use sc_consensus_grandpa::{ FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState, }; @@ -24,18 +22,15 @@ use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sp_consensus::SelectChain; use sp_consensus_babe::BabeApi; -use sp_keystore::SyncCryptoStorePtr; +use sp_keystore::KeystorePtr; /// Extra dependencies for BABE. pub struct BabeDeps { - /// BABE protocol config. - pub babe_config: BabeConfiguration, - /// BABE pending epoch changes. - pub shared_epoch_changes: SharedEpochChanges, + /// A handle to the BABE worker for issuing requests. + pub babe_worker_handle: sc_consensus_babe::BabeWorkerHandle, /// The keystore that manages the keys of the node. - pub keystore: SyncCryptoStorePtr, + pub keystore: KeystorePtr, } - /// Extra dependencies for GRANDPA pub struct GrandpaDeps { /// Voting round info. @@ -102,7 +97,7 @@ where let mut io = RpcModule::new(()); let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa } = deps; - let BabeDeps { keystore, babe_config, shared_epoch_changes } = babe; + let BabeDeps { babe_worker_handle, keystore } = babe; let GrandpaDeps { shared_voter_state, shared_authority_set, @@ -117,15 +112,8 @@ where // These RPCs should use an asynchronous caller instead. io.merge(TransactionPayment::new(client.clone()).into_rpc())?; io.merge( - Babe::new( - client.clone(), - shared_epoch_changes.clone(), - keystore, - babe_config, - select_chain, - deny_unsafe, - ) - .into_rpc(), + Babe::new(client.clone(), babe_worker_handle.clone(), keystore, select_chain, deny_unsafe) + .into_rpc(), )?; io.merge( Grandpa::new( @@ -139,7 +127,7 @@ where )?; io.merge( - SyncState::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)? + SyncState::new(chain_spec, client.clone(), shared_authority_set, babe_worker_handle)? .into_rpc(), )?; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 9c6c21baa..099ee703b 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "cere-service" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 41653a1ec..2ba81f307 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -31,7 +31,9 @@ pub use cere_client::{ }; pub use chain_spec::{CereChainSpec, CereDevChainSpec}; pub use node_primitives::{Block, BlockNumber}; -pub use sc_executor::NativeElseWasmExecutor; +use sc_executor::{ + HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, +}; pub use sc_service::ChainSpec; pub use sp_api::ConstructRuntimeApi; @@ -84,12 +86,19 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + + let wasm = WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size) + .build(); + + let executor = NativeElseWasmExecutor::::new_with_wasm_executor(wasm); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -155,10 +164,6 @@ where RuntimeApiCollection>, ExecutorDispatch: NativeExecutionDispatch + 'static, { - if config.keystore_remote.is_some() { - return Err(ServiceError::Other("Remote Keystores are not supported.".into())) - } - let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = sc_transaction_pool::BasicPool::new_full( @@ -184,7 +189,7 @@ where )?; let slot_duration = babe_link.config().slot_duration(); - let import_queue = sc_consensus_babe::import_queue( + let (import_queue, babe_worker_handle) = sc_consensus_babe::import_queue( babe_link.clone(), block_import.clone(), Some(Box::new(justification_import)), @@ -209,7 +214,7 @@ where let import_setup = (block_import, grandpa_link, babe_link); let (rpc_extensions_builder, rpc_setup) = { - let (_, grandpa_link, babe_link) = &import_setup; + let (_, grandpa_link, _babe_link) = &import_setup; let justification_stream = grandpa_link.justification_stream(); let shared_authority_set = grandpa_link.shared_authority_set().clone(); @@ -221,13 +226,10 @@ where Some(shared_authority_set.clone()), ); - let babe_config = babe_link.config().clone(); - let shared_epoch_changes = babe_link.epoch_changes().clone(); - let client = client.clone(); let pool = transaction_pool.clone(); let select_chain = select_chain.clone(); - let keystore = keystore_container.sync_keystore(); + let keystore = keystore_container.keystore(); let chain_spec = config.chain_spec.cloned_box(); let rpc_backend = backend.clone(); @@ -239,8 +241,7 @@ where chain_spec: chain_spec.cloned_box(), deny_unsafe, babe: cere_rpc::BabeDeps { - babe_config: babe_config.clone(), - shared_epoch_changes: shared_epoch_changes.clone(), + babe_worker_handle: babe_worker_handle.clone(), keystore: keystore.clone(), }, grandpa: cere_rpc::GrandpaDeps { @@ -405,7 +406,7 @@ where config, backend: backend.clone(), client: client.clone(), - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), network: network.clone(), rpc_builder: Box::new(rpc_builder), transaction_pool: transaction_pool.clone(), @@ -445,7 +446,7 @@ where let client_clone = client.clone(); let slot_duration = babe_link.config().slot_duration(); let babe_config = sc_consensus_babe::BabeParams { - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), client: client.clone(), select_chain, env: proposer, @@ -521,8 +522,7 @@ where // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = - if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None }; + let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None }; let config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec diff --git a/pallets/chainbridge/Cargo.toml b/pallets/chainbridge/Cargo.toml index 78ae61038..5463d7e9a 100644 --- a/pallets/chainbridge/Cargo.toml +++ b/pallets/chainbridge/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "pallet-chainbridge" -version = "4.8.8" -authors = ["Parity Technologies "] -edition = "2021" -homepage = "https://substrate.io" -license = "Unlicense" -readme = "README.md" -repository = "https://github.com/paritytech/substrate/" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true description = "" [package.metadata.docs.rs] diff --git a/pallets/chainbridge/src/lib.rs b/pallets/chainbridge/src/lib.rs index 161d7cfd4..5661f0b56 100644 --- a/pallets/chainbridge/src/lib.rs +++ b/pallets/chainbridge/src/lib.rs @@ -2,6 +2,9 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] +pub mod weights; +use crate::weights::WeightInfo; + #[cfg(test)] pub(crate) mod mock; #[cfg(test)] @@ -9,7 +12,7 @@ mod tests; use codec::{Decode, Encode, EncodeLike}; use frame_support::{ - dispatch::{DispatchResult, GetDispatchInfo, Weight}, + dispatch::{DispatchResult, GetDispatchInfo}, ensure, pallet_prelude::*, traits::{EnsureOrigin, Get}, @@ -148,6 +151,8 @@ pub mod pallet { #[pallet::constant] type BridgeAccountId: Get; + + type WeightInfo: WeightInfo; } /// All whitelisted chains and their respective transaction counts @@ -278,7 +283,7 @@ pub mod pallet { /// - O(1) lookup and insert /// # #[pallet::call_index(0)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::set_threshold())] pub fn set_threshold(origin: OriginFor, threshold: u32) -> DispatchResult { Self::ensure_admin(origin)?; Self::set_relayer_threshold(threshold) @@ -290,7 +295,7 @@ pub mod pallet { /// - O(1) write /// # #[pallet::call_index(1)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::set_resource())] pub fn set_resource( origin: OriginFor, id: ResourceId, @@ -309,7 +314,7 @@ pub mod pallet { /// - O(1) removal /// # #[pallet::call_index(2)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::remove_resource())] pub fn remove_resource(origin: OriginFor, id: ResourceId) -> DispatchResult { Self::ensure_admin(origin)?; Self::unregister_resource(id) @@ -321,7 +326,7 @@ pub mod pallet { /// - O(1) lookup and insert /// # #[pallet::call_index(3)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::whitelist_chain())] pub fn whitelist_chain(origin: OriginFor, id: ChainId) -> DispatchResult { Self::ensure_admin(origin)?; Self::whitelist(id) @@ -333,7 +338,7 @@ pub mod pallet { /// - O(1) lookup and insert /// # #[pallet::call_index(4)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::add_relayer())] pub fn add_relayer(origin: OriginFor, v: T::AccountId) -> DispatchResult { Self::ensure_admin(origin)?; Self::register_relayer(v) @@ -345,7 +350,7 @@ pub mod pallet { /// - O(1) lookup and removal /// # #[pallet::call_index(5)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::remove_relayer())] pub fn remove_relayer(origin: OriginFor, v: T::AccountId) -> DispatchResult { Self::ensure_admin(origin)?; Self::unregister_relayer(v) @@ -360,7 +365,7 @@ pub mod pallet { /// - weight of proposed call, regardless of whether execution is performed /// # #[pallet::call_index(6)] - #[pallet::weight(call.get_dispatch_info().weight + Weight::from_parts(195_000_000_u64, 0))] + #[pallet::weight(::WeightInfo::acknowledge_proposal())] pub fn acknowledge_proposal( origin: OriginFor, nonce: DepositNonce, @@ -382,7 +387,7 @@ pub mod pallet { /// - Fixed, since execution of proposal should not be included /// # #[pallet::call_index(7)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::reject_proposal())] pub fn reject_proposal( origin: OriginFor, nonce: DepositNonce, @@ -407,7 +412,7 @@ pub mod pallet { /// - weight of proposed call, regardless of whether execution is performed /// # #[pallet::call_index(8)] - #[pallet::weight(prop.get_dispatch_info().weight + Weight::from_parts(195_000_000_u64, 0))] + #[pallet::weight(::WeightInfo::eval_vote_state())] pub fn eval_vote_state( origin: OriginFor, nonce: DepositNonce, diff --git a/pallets/chainbridge/src/mock.rs b/pallets/chainbridge/src/mock.rs index 0c0407dac..81ba159cd 100644 --- a/pallets/chainbridge/src/mock.rs +++ b/pallets/chainbridge/src/mock.rs @@ -67,6 +67,10 @@ impl pallet_balances::Config for Test { type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } parameter_types! { @@ -82,6 +86,7 @@ impl crate::pallet::Config for Test { type ChainIdentity = TestChainId; type ProposalLifetime = ProposalLifetime; type BridgeAccountId = BridgeAccountId; + type WeightInfo = (); } type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; diff --git a/pallets/chainbridge/src/weights.rs b/pallets/chainbridge/src/weights.rs new file mode 100644 index 000000000..6e514aa92 --- /dev/null +++ b/pallets/chainbridge/src/weights.rs @@ -0,0 +1,81 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_erc20. +pub trait WeightInfo { + fn set_threshold() -> Weight; + fn set_resource() -> Weight; + fn remove_resource() -> Weight; + fn whitelist_chain() -> Weight; + fn add_relayer() -> Weight; + fn remove_relayer() -> Weight; + fn acknowledge_proposal() -> Weight; + fn reject_proposal() -> Weight; + fn eval_vote_state() -> Weight; +} + +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn set_threshold() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn set_resource() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remove_resource() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn whitelist_chain() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn add_relayer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remove_relayer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn acknowledge_proposal() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn reject_proposal() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn eval_vote_state() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn set_threshold() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn set_resource() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remove_resource() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn whitelist_chain() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn add_relayer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remove_relayer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn acknowledge_proposal() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn reject_proposal() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn eval_vote_state() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} diff --git a/pallets/ddc-clusters/Cargo.toml b/pallets/ddc-clusters/Cargo.toml index 6f5c2ccd8..408681f82 100644 --- a/pallets/ddc-clusters/Cargo.toml +++ b/pallets/ddc-clusters/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "pallet-ddc-clusters" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party depdencies diff --git a/pallets/ddc-clusters/src/mock.rs b/pallets/ddc-clusters/src/mock.rs index bf2f5f4b0..3634af5bb 100644 --- a/pallets/ddc-clusters/src/mock.rs +++ b/pallets/ddc-clusters/src/mock.rs @@ -63,6 +63,7 @@ parameter_types! { pub const MaxDepth: u32 = 100; pub const MaxValueSize: u32 = 16_384; pub Schedule: pallet_contracts::Schedule = Default::default(); + pub static DefaultDepositLimit: Balance = 10_000_000; } impl Convert> for Test { @@ -85,13 +86,12 @@ impl contracts::Config for Test { type WeightPrice = Self; //pallet_transaction_payment::Module; type WeightInfo = (); type ChainExtension = (); - type DeletionQueueDepth = (); - type DeletionWeightLimit = (); type Schedule = Schedule; type RuntimeCall = RuntimeCall; type CallFilter = Nothing; type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; + type DefaultDepositLimit = DefaultDepositLimit; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; @@ -174,6 +174,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/pallets/ddc-clusters/src/node_provider_auth.rs b/pallets/ddc-clusters/src/node_provider_auth.rs index a8b6ff237..60bdb80d7 100644 --- a/pallets/ddc-clusters/src/node_provider_auth.rs +++ b/pallets/ddc-clusters/src/node_provider_auth.rs @@ -57,7 +57,7 @@ where None, call_data, false, - pallet_contracts::Determinism::Deterministic, + pallet_contracts::Determinism::Enforced, ) .result .map_err(|_| NodeProviderAuthContractError::ContractCallFailed)? @@ -129,7 +129,7 @@ where None, call_data, false, - pallet_contracts::Determinism::Deterministic, + pallet_contracts::Determinism::Enforced, ) .result .map_err(|_| NodeProviderAuthContractError::NodeAuthorizationNotSuccessful)?; diff --git a/pallets/ddc-customers/Cargo.toml b/pallets/ddc-customers/Cargo.toml index d143847d1..16504a6e5 100644 --- a/pallets/ddc-customers/Cargo.toml +++ b/pallets/ddc-customers/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "pallet-ddc-customers" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/pallets/ddc-customers/src/mock.rs b/pallets/ddc-customers/src/mock.rs index 982a4cf8c..1c7e02566 100644 --- a/pallets/ddc-customers/src/mock.rs +++ b/pallets/ddc-customers/src/mock.rs @@ -86,6 +86,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/pallets/ddc-nodes/Cargo.toml b/pallets/ddc-nodes/Cargo.toml index 5a37aae59..f32d0d5f4 100644 --- a/pallets/ddc-nodes/Cargo.toml +++ b/pallets/ddc-nodes/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "pallet-ddc-nodes" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/pallets/ddc-nodes/src/mock.rs b/pallets/ddc-nodes/src/mock.rs index e42ea6ad6..865e336ac 100644 --- a/pallets/ddc-nodes/src/mock.rs +++ b/pallets/ddc-nodes/src/mock.rs @@ -81,6 +81,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/pallets/ddc-payouts/Cargo.toml b/pallets/ddc-payouts/Cargo.toml index aba3d5b3a..cbe280eb1 100644 --- a/pallets/ddc-payouts/Cargo.toml +++ b/pallets/ddc-payouts/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "pallet-ddc-payouts" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/pallets/ddc-payouts/src/lib.rs b/pallets/ddc-payouts/src/lib.rs index 89f0e0517..725ec5358 100644 --- a/pallets/ddc-payouts/src/lib.rs +++ b/pallets/ddc-payouts/src/lib.rs @@ -231,6 +231,14 @@ pub mod pallet { AuthorisedCaller { authorised_caller: T::AccountId, }, + ChargeError { + cluster_id: ClusterId, + era: DdcEra, + batch_index: BatchIndex, + customer_id: T::AccountId, + amount: u128, + error: DispatchError, + }, } #[pallet::error] @@ -457,7 +465,17 @@ pub mod pallet { total_customer_charge, ) { Ok(actually_charged) => actually_charged, - Err(_e) => 0, + Err(e) => { + Self::deposit_event(Event::::ChargeError { + cluster_id, + era, + batch_index, + customer_id: customer_id.clone(), + amount: total_customer_charge, + error: e, + }); + 0 + }, }; if amount_actually_charged < total_customer_charge { diff --git a/pallets/ddc-payouts/src/mock.rs b/pallets/ddc-payouts/src/mock.rs index c47ab5d58..c994dcdff 100644 --- a/pallets/ddc-payouts/src/mock.rs +++ b/pallets/ddc-payouts/src/mock.rs @@ -111,6 +111,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } parameter_types! { @@ -152,7 +156,6 @@ impl CustomerCharger for TestCustomerCharger { let account_5 = T::AccountId::decode(&mut &temp[..]).unwrap(); if content_owner == account_1 || - content_owner == account_2 || content_owner == account_3 || content_owner == account_4 || content_owner == account_5 @@ -161,15 +164,16 @@ impl CustomerCharger for TestCustomerCharger { } if amount_to_charge < 50_000_000 && content_owner == account_3 { + assert!(PARTIAL_CHARGE < amount); amount_to_charge = PARTIAL_CHARGE; // for user 3 } if content_owner == account_2 { + assert!(USER2_BALANCE < amount); amount_to_charge = USER2_BALANCE; // for user 2 } let charge = amount_to_charge.saturated_into::>(); - ::Currency::transfer( &content_owner, &billing_vault, @@ -185,6 +189,8 @@ pub const ACCOUNT_ID_2: AccountId = 2; pub const ACCOUNT_ID_3: AccountId = 3; pub const ACCOUNT_ID_4: AccountId = 4; pub const ACCOUNT_ID_5: AccountId = 5; +pub const ACCOUNT_ID_6: AccountId = 6; +pub const ACCOUNT_ID_7: AccountId = 7; pub struct TestClusterCreator; impl ClusterCreator for TestClusterCreator { fn create_new_cluster( @@ -218,14 +224,20 @@ pub const VALIDATOR1_SCORE: u64 = 30; pub const VALIDATOR2_SCORE: u64 = 45; pub const VALIDATOR3_SCORE: u64 = 25; -pub const PARTIAL_CHARGE: u128 = 100; -pub const USER2_BALANCE: u128 = 10; +pub const PARTIAL_CHARGE: u128 = 10; +pub const USER2_BALANCE: u128 = 5; pub const USER3_BALANCE: u128 = 1000; -pub const FREE_CLUSTER_ID: ClusterId = ClusterId::zero(); -pub const ONE_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(5u8); +pub const NO_FEE_CLUSTER_ID: ClusterId = ClusterId::zero(); +pub const ONE_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(4u8); pub const CERE_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(10u8); - +pub const HIGH_FEES_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(5u8); +pub const GET_PUT_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(3u8); +pub const STORAGE_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(6u8); +pub const STREAM_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(7u8); +pub const PUT_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(8u8); +pub const GET_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(9u8); +pub const STORAGE_STREAM_ZERO_CLUSTER_ID: ClusterId = ClusterId::repeat_byte(11u8); pub const PRICING_PARAMS: ClusterPricingParams = ClusterPricingParams { unit_per_mb_streamed: 2_000_000, unit_per_mb_stored: 3_000_000, @@ -233,6 +245,34 @@ pub const PRICING_PARAMS: ClusterPricingParams = ClusterPricingParams { unit_per_get_request: 5_000_000, }; +pub const PRICING_PARAMS_STREAM_ZERO: ClusterPricingParams = ClusterPricingParams { + unit_per_mb_streamed: 0, + unit_per_mb_stored: 3_000_000, + unit_per_put_request: 4_000_000, + unit_per_get_request: 5_000_000, +}; + +pub const PRICING_PARAMS_STORAGE_ZERO: ClusterPricingParams = ClusterPricingParams { + unit_per_mb_streamed: 2_000_000, + unit_per_mb_stored: 0, + unit_per_put_request: 4_000_000, + unit_per_get_request: 5_000_000, +}; + +pub const PRICING_PARAMS_GET_ZERO: ClusterPricingParams = ClusterPricingParams { + unit_per_mb_streamed: 2_000_000, + unit_per_mb_stored: 3_000_000, + unit_per_put_request: 4_000_000, + unit_per_get_request: 0, +}; + +pub const PRICING_PARAMS_PUT_ZERO: ClusterPricingParams = ClusterPricingParams { + unit_per_mb_streamed: 2_000_000, + unit_per_mb_stored: 3_000_000, + unit_per_put_request: 0, + unit_per_get_request: 5_000_000, +}; + pub const PRICING_PARAMS_ONE: ClusterPricingParams = ClusterPricingParams { unit_per_mb_streamed: 10_000_000_000, unit_per_mb_stored: 10_000_000_000, @@ -253,6 +293,12 @@ pub const PRICING_FEES: ClusterFeesParams = ClusterFeesParams { cluster_reserve_share: Perquintill::from_percent(2), }; +pub const PRICING_FEES_HIGH: ClusterFeesParams = ClusterFeesParams { + treasury_share: Perquintill::from_percent(10), + validators_share: Perquintill::from_percent(20), + cluster_reserve_share: Perquintill::from_percent(20), +}; + pub const PRICING_FEES_ZERO: ClusterFeesParams = ClusterFeesParams { treasury_share: Perquintill::from_percent(0), validators_share: Perquintill::from_percent(0), @@ -339,21 +385,31 @@ impl SortedListProvider for TestValidator } pub fn get_fees(cluster_id: &ClusterId) -> ClusterFeesParams { - if *cluster_id == FREE_CLUSTER_ID || + if *cluster_id == NO_FEE_CLUSTER_ID || *cluster_id == ONE_CLUSTER_ID || *cluster_id == CERE_CLUSTER_ID { PRICING_FEES_ZERO + } else if *cluster_id == HIGH_FEES_CLUSTER_ID { + PRICING_FEES_HIGH } else { PRICING_FEES } } pub fn get_pricing(cluster_id: &ClusterId) -> ClusterPricingParams { - if *cluster_id == FREE_CLUSTER_ID || *cluster_id == ONE_CLUSTER_ID { + if *cluster_id == ONE_CLUSTER_ID || *cluster_id == NO_FEE_CLUSTER_ID { PRICING_PARAMS_ONE } else if *cluster_id == CERE_CLUSTER_ID { PRICING_PARAMS_CERE + } else if *cluster_id == STORAGE_ZERO_CLUSTER_ID { + PRICING_PARAMS_STORAGE_ZERO + } else if *cluster_id == STREAM_ZERO_CLUSTER_ID { + PRICING_PARAMS_STREAM_ZERO + } else if *cluster_id == PUT_ZERO_CLUSTER_ID { + PRICING_PARAMS_PUT_ZERO + } else if *cluster_id == GET_ZERO_CLUSTER_ID { + PRICING_PARAMS_GET_ZERO } else { PRICING_PARAMS } @@ -423,6 +479,8 @@ impl ExtBuilder { (3, USER3_BALANCE), // > PARTIAL_CHARGE (4, 1000000000000000000000000), (5, 1000000000000000000000000), + (6, 1000000000000000000000000), + (7, 1000000000000000000000000), ], } .assimilate_storage(&mut storage); diff --git a/pallets/ddc-payouts/src/tests.rs b/pallets/ddc-payouts/src/tests.rs index a20ae8a08..0ecab2fc0 100644 --- a/pallets/ddc-payouts/src/tests.rs +++ b/pallets/ddc-payouts/src/tests.rs @@ -353,13 +353,42 @@ fn calculate_charge_parts_for_month(cluster_id: ClusterId, usage: CustomerUsage) } } +fn calculate_charge_parts_for_hour(cluster_id: ClusterId, usage: CustomerUsage) -> CustomerCharge { + let pricing_params = get_pricing(&cluster_id); + + let duration_seconds = 1.0 * 1.0 * 3600.0; + let seconds_in_month = 30.44 * 24.0 * 3600.0; + let fraction_of_hour = + Perquintill::from_rational(duration_seconds as u64, seconds_in_month as u64); + let storage = fraction_of_hour * + (|| -> Option { + (usage.stored_bytes as u128) + .checked_mul(pricing_params.unit_per_mb_stored)? + .checked_div(byte_unit::MEBIBYTE) + })() + .unwrap(); + + CustomerCharge { + transfer: pricing_params.unit_per_mb_streamed * (usage.transferred_bytes as u128) / + byte_unit::MEBIBYTE, + storage, + puts: pricing_params.unit_per_put_request * (usage.number_of_puts as u128), + gets: pricing_params.unit_per_get_request * (usage.number_of_gets as u128), + } +} + fn calculate_charge_for_month(cluster_id: ClusterId, usage: CustomerUsage) -> u128 { let charge = calculate_charge_parts_for_month(cluster_id, usage); charge.transfer + charge.storage + charge.puts + charge.gets } +fn calculate_charge_for_hour(cluster_id: ClusterId, usage: CustomerUsage) -> u128 { + let charge = calculate_charge_parts_for_hour(cluster_id, usage); + charge.transfer + charge.storage + charge.puts + charge.gets +} + #[test] -fn send_charging_customers_batch_works1() { +fn send_charging_customers_batch_works() { ExtBuilder.build_and_execute(|| { System::set_block_number(1); @@ -602,7 +631,197 @@ fn send_charging_customers_batch_works1() { } #[test] -fn send_charging_customers_batch_works1_for_day() { +fn end_charging_customers_works_small_usage_1_hour() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user6 = 6u128; + let user7 = 7u128; + let cluster_id = HIGH_FEES_CLUSTER_ID; + let era = 100; + let max_batch_index = 0; + let batch_index = 0; + let usage6 = CustomerUsage { + transferred_bytes: 0, + stored_bytes: 474_957, + number_of_puts: 0, + number_of_gets: 0, + }; + let usage7 = CustomerUsage { + transferred_bytes: 474_957, + stored_bytes: 0, + number_of_puts: 0, + number_of_gets: 0, + }; + let payers1 = vec![(user6, usage6.clone()), (user7, usage7.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 1.0 * 3600.0) as i64; // 1 hour + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let report_before = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let usage6_charge = calculate_charge_for_hour(cluster_id, usage6.clone()); + let usage7_charge = calculate_charge_for_hour(cluster_id, usage7.clone()); + let charge6 = calculate_charge_parts_for_hour(cluster_id, usage6); + let charge7 = calculate_charge_parts_for_hour(cluster_id, usage7); + assert_eq!(charge7.puts + charge6.puts, report_before.total_customer_charge.puts); + assert_eq!(charge7.gets + charge6.gets, report_before.total_customer_charge.gets); + assert_eq!(charge7.storage + charge6.storage, report_before.total_customer_charge.storage); + assert_eq!( + charge7.transfer + charge6.transfer, + report_before.total_customer_charge.transfer + ); + + System::assert_has_event( + Event::Charged { + cluster_id, + era, + customer_id: user6, + batch_index, + amount: usage6_charge, + } + .into(), + ); + + System::assert_has_event( + Event::Charged { + cluster_id, + era, + customer_id: user7, + batch_index, + amount: usage7_charge, + } + .into(), + ); + + let mut balance = Balances::free_balance(DdcPayouts::account_id()); + let charge = usage7_charge + usage6_charge; + assert_eq!(balance - Balances::minimum_balance(), charge); + + balance = Balances::free_balance(TREASURY_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(RESERVE_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR1_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR2_ACCOUNT_ID); + assert_eq!(balance, 0); + + balance = Balances::free_balance(VALIDATOR3_ACCOUNT_ID); + assert_eq!(balance, 0); + + assert_ok!(DdcPayouts::end_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + )); + + System::assert_has_event(Event::ChargingFinished { cluster_id, era }.into()); + let report_after = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!(report_after.state, State::CustomersChargedWithFees); + + let fees = get_fees(&cluster_id); + let total_left_from_one = + (fees.treasury_share + fees.validators_share + fees.cluster_reserve_share) + .left_from_one(); + + assert_eq!( + total_left_from_one, + Perquintill::one() - + (PRICING_FEES_HIGH.treasury_share + + PRICING_FEES_HIGH.validators_share + + PRICING_FEES_HIGH.cluster_reserve_share) + ); + assert_eq!(fees.treasury_share, PRICING_FEES_HIGH.treasury_share); + assert_eq!(fees.validators_share, PRICING_FEES_HIGH.validators_share); + assert_eq!(fees.cluster_reserve_share, PRICING_FEES_HIGH.cluster_reserve_share); + + balance = Balances::free_balance(TREASURY_ACCOUNT_ID); + assert_eq!(balance, get_fees(&cluster_id).treasury_share * charge); + assert!(balance > 0); + + balance = Balances::free_balance(RESERVE_ACCOUNT_ID); + assert_eq!(balance, get_fees(&cluster_id).cluster_reserve_share * charge); + assert!(balance > 0); + + balance = Balances::free_balance(VALIDATOR1_ACCOUNT_ID); + let mut ratio = Perquintill::from_rational( + VALIDATOR1_SCORE, + VALIDATOR1_SCORE + VALIDATOR2_SCORE + VALIDATOR3_SCORE, + ); + assert_eq!(balance, get_fees(&cluster_id).validators_share * ratio * charge); + assert!(balance > 0); + + balance = Balances::free_balance(VALIDATOR2_ACCOUNT_ID); + ratio = Perquintill::from_rational( + VALIDATOR2_SCORE, + VALIDATOR1_SCORE + VALIDATOR2_SCORE + VALIDATOR3_SCORE, + ); + assert_eq!(balance, get_fees(&cluster_id).validators_share * ratio * charge); + assert!(balance > 0); + + balance = Balances::free_balance(VALIDATOR3_ACCOUNT_ID); + ratio = Perquintill::from_rational( + VALIDATOR3_SCORE, + VALIDATOR1_SCORE + VALIDATOR2_SCORE + VALIDATOR3_SCORE, + ); + assert_eq!(balance, get_fees(&cluster_id).validators_share * ratio * charge); + assert!(balance > 0); + + assert_eq!( + report_after.total_customer_charge.transfer, + total_left_from_one * report_before.total_customer_charge.transfer + ); + assert!(report_after.total_customer_charge.transfer > 0); + assert_eq!( + report_after.total_customer_charge.storage, + total_left_from_one * report_before.total_customer_charge.storage + ); + assert!(report_after.total_customer_charge.storage > 0); + assert_eq!( + report_after.total_customer_charge.puts, + total_left_from_one * report_before.total_customer_charge.puts + ); + assert_eq!( + report_after.total_customer_charge.gets, + total_left_from_one * report_before.total_customer_charge.gets + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_for_day() { ExtBuilder.build_and_execute(|| { System::set_block_number(1); @@ -845,7 +1064,1222 @@ fn send_charging_customers_batch_works1_for_day() { } #[test] -fn send_charging_customers_batch_works2() { +fn send_charging_customers_batch_works_for_day_free_storage() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user1 = 1u128; + let user2_debtor = 2u128; + let user3_debtor = 3u128; + let user4 = 4u128; + let cluster_id = STORAGE_ZERO_CLUSTER_ID; + let era = 100; + let max_batch_index = 3; + let mut batch_index = 0; + let usage1 = CustomerUsage { + // should pass without debt + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let usage2 = CustomerUsage { + // should fail as not enough balance + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage3 = CustomerUsage { + // should pass but with debt (partial charge) + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage4 = CustomerUsage { + // should pass without debt + transferred_bytes: 467457, + stored_bytes: 45674567456, + number_of_puts: 3456345, + number_of_gets: 242334563456423, + }; + let payers1 = vec![(user2_debtor, usage2.clone()), (user4, usage4.clone())]; + let payers2 = vec![(user1, usage1.clone())]; + let payers3 = vec![(user3_debtor, usage3.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 24.0 * 3600.0) as i64; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let usage4_charge = calculate_charge_for_day(cluster_id, usage4.clone()); + let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); + let expected_charge2 = calculate_charge_for_day(cluster_id, usage2.clone()); + let mut debt = expected_charge2 - USER2_BALANCE; + assert_eq!(user2_debt, debt); + + let ratio = Perquintill::from_rational(USER2_BALANCE, expected_charge2); + let mut charge2 = calculate_charge_parts_for_day(cluster_id, usage2); + charge2.storage = ratio * charge2.storage; + charge2.transfer = ratio * charge2.transfer; + charge2.gets = ratio * charge2.gets; + charge2.puts = ratio * charge2.puts; + + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge4 = calculate_charge_parts_for_day(cluster_id, usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + charged: USER2_BALANCE, + expected_to_charge: expected_charge2, + } + .into(), + ); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_last_event( + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), + ); + + assert_eq!(System::events().len(), 5 + 3 + 1); // 1 for Currency::transfer + + // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers2, + )); + + System::assert_last_event( + Event::Charged { + cluster_id, + era, + batch_index, + customer_id: user1, + amount: calculate_charge_for_day(cluster_id, usage1.clone()), + } + .into(), + ); + + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts_for_day(cluster_id, usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + assert_eq!(report.state, State::ChargingCustomers); + let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); + assert_eq!(user1_debt, None); + + let balance_before = Balances::free_balance(DdcPayouts::account_id()); + + // batch 3 + batch_index += 1; + before_total_customer_charge = report.total_customer_charge.clone(); + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers3, + )); + + let user3_charge = calculate_charge_for_day(cluster_id, usage3.clone()); + let charge3 = calculate_charge_parts_for_day(cluster_id, usage3); + let ratio = Perquintill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + let balance = Balances::free_balance(DdcPayouts::account_id()); + assert_eq!(balance, balance_before + PARTIAL_CHARGE); + + let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); + debt = user3_charge - PARTIAL_CHARGE; + assert_eq!(user3_debt, debt); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + + System::assert_last_event( + Event::ChargeFailed { + cluster_id, + era, + batch_index, + customer_id: user3_debtor, + charged: PARTIAL_CHARGE, + expected_to_charge: user3_charge, + } + .into(), + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_for_day_free_stream() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user1 = 1u128; + let user2_debtor = 2u128; + let user3_debtor = 3u128; + let user4 = 4u128; + let cluster_id = STREAM_ZERO_CLUSTER_ID; + let era = 100; + let max_batch_index = 3; + let mut batch_index = 0; + let usage1 = CustomerUsage { + // should pass without debt + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let usage2 = CustomerUsage { + // should fail as not enough balance + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage3 = CustomerUsage { + // should pass but with debt (partial charge) + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage4 = CustomerUsage { + // should pass without debt + transferred_bytes: 467457, + stored_bytes: 45674567456, + number_of_puts: 3456345, + number_of_gets: 242334563456423, + }; + let payers1 = vec![(user2_debtor, usage2.clone()), (user4, usage4.clone())]; + let payers2 = vec![(user1, usage1.clone())]; + let payers3 = vec![(user3_debtor, usage3.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 24.0 * 3600.0) as i64; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let usage4_charge = calculate_charge_for_day(cluster_id, usage4.clone()); + let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); + let expected_charge2 = calculate_charge_for_day(cluster_id, usage2.clone()); + let mut debt = expected_charge2 - USER2_BALANCE; + assert_eq!(user2_debt, debt); + + let ratio = Perquintill::from_rational(USER2_BALANCE, expected_charge2); + let mut charge2 = calculate_charge_parts_for_day(cluster_id, usage2); + charge2.storage = ratio * charge2.storage; + charge2.transfer = ratio * charge2.transfer; + charge2.gets = ratio * charge2.gets; + charge2.puts = ratio * charge2.puts; + + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge4 = calculate_charge_parts_for_day(cluster_id, usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + charged: USER2_BALANCE, + expected_to_charge: expected_charge2, + } + .into(), + ); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_last_event( + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), + ); + + assert_eq!(System::events().len(), 5 + 3 + 1); // 1 for Currency::transfer + + // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers2, + )); + + System::assert_last_event( + Event::Charged { + cluster_id, + era, + batch_index, + customer_id: user1, + amount: calculate_charge_for_day(cluster_id, usage1.clone()), + } + .into(), + ); + + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts_for_day(cluster_id, usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + assert_eq!(report.state, State::ChargingCustomers); + let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); + assert_eq!(user1_debt, None); + + let balance_before = Balances::free_balance(DdcPayouts::account_id()); + + // batch 3 + batch_index += 1; + before_total_customer_charge = report.total_customer_charge.clone(); + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers3, + )); + + let user3_charge = calculate_charge_for_day(cluster_id, usage3.clone()); + let charge3 = calculate_charge_parts_for_day(cluster_id, usage3); + let ratio = Perquintill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + let balance = Balances::free_balance(DdcPayouts::account_id()); + assert_eq!(balance, balance_before + PARTIAL_CHARGE); + + let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); + debt = user3_charge - PARTIAL_CHARGE; + assert_eq!(user3_debt, debt); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + + System::assert_last_event( + Event::ChargeFailed { + cluster_id, + era, + batch_index, + customer_id: user3_debtor, + charged: PARTIAL_CHARGE, + expected_to_charge: user3_charge, + } + .into(), + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_for_day_free_get() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user1 = 1u128; + let user2_debtor = 2u128; + let user3_debtor = 3u128; + let user4 = 4u128; + let cluster_id = GET_ZERO_CLUSTER_ID; + let era = 100; + let max_batch_index = 3; + let mut batch_index = 0; + let usage1 = CustomerUsage { + // should pass without debt + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let usage2 = CustomerUsage { + // should fail as not enough balance + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage3 = CustomerUsage { + // should pass but with debt (partial charge) + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage4 = CustomerUsage { + // should pass without debt + transferred_bytes: 467457, + stored_bytes: 45674567456, + number_of_puts: 3456345, + number_of_gets: 242334563456423, + }; + let payers1 = vec![(user2_debtor, usage2.clone()), (user4, usage4.clone())]; + let payers2 = vec![(user1, usage1.clone())]; + let payers3 = vec![(user3_debtor, usage3.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 24.0 * 3600.0) as i64; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let usage4_charge = calculate_charge_for_day(cluster_id, usage4.clone()); + let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); + let expected_charge2 = calculate_charge_for_day(cluster_id, usage2.clone()); + let mut debt = expected_charge2 - USER2_BALANCE; + assert_eq!(user2_debt, debt); + + let ratio = Perquintill::from_rational(USER2_BALANCE, expected_charge2); + let mut charge2 = calculate_charge_parts_for_day(cluster_id, usage2); + charge2.storage = ratio * charge2.storage; + charge2.transfer = ratio * charge2.transfer; + charge2.gets = ratio * charge2.gets; + charge2.puts = ratio * charge2.puts; + + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge4 = calculate_charge_parts_for_day(cluster_id, usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + charged: USER2_BALANCE, + expected_to_charge: expected_charge2, + } + .into(), + ); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_last_event( + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), + ); + + assert_eq!(System::events().len(), 5 + 3 + 1); // 1 for Currency::transfer + + // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers2, + )); + + System::assert_last_event( + Event::Charged { + cluster_id, + era, + batch_index, + customer_id: user1, + amount: calculate_charge_for_day(cluster_id, usage1.clone()), + } + .into(), + ); + + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts_for_day(cluster_id, usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + assert_eq!(report.state, State::ChargingCustomers); + let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); + assert_eq!(user1_debt, None); + + let balance_before = Balances::free_balance(DdcPayouts::account_id()); + + // batch 3 + batch_index += 1; + before_total_customer_charge = report.total_customer_charge.clone(); + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers3, + )); + + let user3_charge = calculate_charge_for_day(cluster_id, usage3.clone()); + let charge3 = calculate_charge_parts_for_day(cluster_id, usage3); + let ratio = Perquintill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + let balance = Balances::free_balance(DdcPayouts::account_id()); + assert_eq!(balance, balance_before + PARTIAL_CHARGE); + + let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); + debt = user3_charge - PARTIAL_CHARGE; + assert_eq!(user3_debt, debt); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + + System::assert_last_event( + Event::ChargeFailed { + cluster_id, + era, + batch_index, + customer_id: user3_debtor, + charged: PARTIAL_CHARGE, + expected_to_charge: user3_charge, + } + .into(), + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_for_day_free_put() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user1 = 1u128; + let user2_debtor = 2u128; + let user3_debtor = 3u128; + let user4 = 4u128; + let cluster_id = PUT_ZERO_CLUSTER_ID; + let era = 100; + let max_batch_index = 3; + let mut batch_index = 0; + let usage1 = CustomerUsage { + // should pass without debt + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let usage2 = CustomerUsage { + // should fail as not enough balance + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage3 = CustomerUsage { + // should pass but with debt (partial charge) + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage4 = CustomerUsage { + // should pass without debt + transferred_bytes: 467457, + stored_bytes: 45674567456, + number_of_puts: 3456345, + number_of_gets: 242334563456423, + }; + let payers1 = vec![(user2_debtor, usage2.clone()), (user4, usage4.clone())]; + let payers2 = vec![(user1, usage1.clone())]; + let payers3 = vec![(user3_debtor, usage3.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 24.0 * 3600.0) as i64; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let usage4_charge = calculate_charge_for_day(cluster_id, usage4.clone()); + let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); + let expected_charge2 = calculate_charge_for_day(cluster_id, usage2.clone()); + let mut debt = expected_charge2 - USER2_BALANCE; + assert_eq!(user2_debt, debt); + + let ratio = Perquintill::from_rational(USER2_BALANCE, expected_charge2); + let mut charge2 = calculate_charge_parts_for_day(cluster_id, usage2); + charge2.storage = ratio * charge2.storage; + charge2.transfer = ratio * charge2.transfer; + charge2.gets = ratio * charge2.gets; + charge2.puts = ratio * charge2.puts; + + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge4 = calculate_charge_parts_for_day(cluster_id, usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + charged: USER2_BALANCE, + expected_to_charge: expected_charge2, + } + .into(), + ); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_last_event( + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), + ); + + assert_eq!(System::events().len(), 5 + 3 + 1); // 1 for Currency::transfer + + // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers2, + )); + + System::assert_last_event( + Event::Charged { + cluster_id, + era, + batch_index, + customer_id: user1, + amount: calculate_charge_for_day(cluster_id, usage1.clone()), + } + .into(), + ); + + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts_for_day(cluster_id, usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + assert_eq!(report.state, State::ChargingCustomers); + let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); + assert_eq!(user1_debt, None); + + let balance_before = Balances::free_balance(DdcPayouts::account_id()); + + // batch 3 + batch_index += 1; + before_total_customer_charge = report.total_customer_charge.clone(); + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers3, + )); + + let user3_charge = calculate_charge_for_day(cluster_id, usage3.clone()); + let charge3 = calculate_charge_parts_for_day(cluster_id, usage3); + let ratio = Perquintill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + let balance = Balances::free_balance(DdcPayouts::account_id()); + assert_eq!(balance, balance_before + PARTIAL_CHARGE); + + let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); + debt = user3_charge - PARTIAL_CHARGE; + assert_eq!(user3_debt, debt); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + + System::assert_last_event( + Event::ChargeFailed { + cluster_id, + era, + batch_index, + customer_id: user3_debtor, + charged: PARTIAL_CHARGE, + expected_to_charge: user3_charge, + } + .into(), + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_for_day_free_storage_stream() { + ExtBuilder.build_and_execute(|| { + System::set_block_number(1); + + let dac_account = 123u128; + let user1 = 1u128; + let user2_debtor = 2u128; + let user3_debtor = 3u128; + let user4 = 4u128; + let cluster_id = STORAGE_STREAM_ZERO_CLUSTER_ID; + let era = 100; + let max_batch_index = 3; + let mut batch_index = 0; + let usage1 = CustomerUsage { + // should pass without debt + transferred_bytes: 23452345, + stored_bytes: 3345234523, + number_of_puts: 4456456345234523, + number_of_gets: 523423, + }; + let usage2 = CustomerUsage { + // should fail as not enough balance + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage3 = CustomerUsage { + // should pass but with debt (partial charge) + transferred_bytes: 1, + stored_bytes: 2, + number_of_puts: 3, + number_of_gets: 4, + }; + let usage4 = CustomerUsage { + // should pass without debt + transferred_bytes: 467457, + stored_bytes: 45674567456, + number_of_puts: 3456345, + number_of_gets: 242334563456423, + }; + let payers1 = vec![(user2_debtor, usage2.clone()), (user4, usage4.clone())]; + let payers2 = vec![(user1, usage1.clone())]; + let payers3 = vec![(user3_debtor, usage3.clone())]; + let start_date = NaiveDate::from_ymd_opt(2023, 4, 1).unwrap(); // April 1st + let time = NaiveTime::from_hms_opt(0, 0, 0).unwrap(); // Midnight + let start_era: i64 = + DateTime::::from_naive_utc_and_offset(start_date.and_time(time), Utc).timestamp(); + let end_era: i64 = start_era + (1.0 * 24.0 * 3600.0) as i64; + + assert_ok!(DdcPayouts::set_authorised_caller(RuntimeOrigin::root(), dac_account)); + assert_ok!(DdcPayouts::begin_billing_report( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + start_era, + end_era, + )); + + assert_ok!(DdcPayouts::begin_charging_customers( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + max_batch_index, + )); + assert_eq!(System::events().len(), 3); + + // batch 1 + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers1, + )); + + let usage4_charge = calculate_charge_for_day(cluster_id, usage4.clone()); + let user2_debt = DdcPayouts::debtor_customers(cluster_id, user2_debtor).unwrap(); + let expected_charge2 = calculate_charge_for_day(cluster_id, usage2.clone()); + let mut debt = expected_charge2 - USER2_BALANCE; + assert_eq!(user2_debt, debt); + + let ratio = Perquintill::from_rational(USER2_BALANCE, expected_charge2); + let mut charge2 = calculate_charge_parts_for_day(cluster_id, usage2); + charge2.storage = ratio * charge2.storage; + charge2.transfer = ratio * charge2.transfer; + charge2.gets = ratio * charge2.gets; + charge2.puts = ratio * charge2.puts; + + let mut report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge4 = calculate_charge_parts_for_day(cluster_id, usage4); + assert_eq!(charge2.puts + charge4.puts, report.total_customer_charge.puts); + assert_eq!(charge2.gets + charge4.gets, report.total_customer_charge.gets); + assert_eq!(charge2.storage + charge4.storage, report.total_customer_charge.storage); + assert_eq!(charge2.transfer + charge4.transfer, report.total_customer_charge.transfer); + + System::assert_has_event( + Event::ChargeFailed { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + charged: USER2_BALANCE, + expected_to_charge: expected_charge2, + } + .into(), + ); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user2_debtor, + batch_index, + amount: debt, + } + .into(), + ); + System::assert_last_event( + Event::Charged { + cluster_id, + era, + customer_id: user4, + batch_index, + amount: usage4_charge, + } + .into(), + ); + + assert_eq!(System::events().len(), 5 + 3 + 1); // 1 for Currency::transfer + + // batch 2 + let mut before_total_customer_charge = report.total_customer_charge.clone(); + batch_index += 1; + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers2, + )); + + System::assert_last_event( + Event::Charged { + cluster_id, + era, + batch_index, + customer_id: user1, + amount: calculate_charge_for_day(cluster_id, usage1.clone()), + } + .into(), + ); + + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + let charge1 = calculate_charge_parts_for_day(cluster_id, usage1); + assert_eq!( + charge1.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + charge1.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + charge1.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + charge1.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + assert_eq!(report.state, State::ChargingCustomers); + let user1_debt = DdcPayouts::debtor_customers(cluster_id, user1); + assert_eq!(user1_debt, None); + + let balance_before = Balances::free_balance(DdcPayouts::account_id()); + + // batch 3 + batch_index += 1; + before_total_customer_charge = report.total_customer_charge.clone(); + assert_ok!(DdcPayouts::send_charging_customers_batch( + RuntimeOrigin::signed(dac_account), + cluster_id, + era, + batch_index, + payers3, + )); + + let user3_charge = calculate_charge_for_day(cluster_id, usage3.clone()); + let charge3 = calculate_charge_parts_for_day(cluster_id, usage3); + let ratio = Perquintill::from_rational(PARTIAL_CHARGE, user3_charge); + report = DdcPayouts::active_billing_reports(cluster_id, era).unwrap(); + assert_eq!( + ratio * charge3.puts + before_total_customer_charge.puts, + report.total_customer_charge.puts + ); + assert_eq!( + ratio * charge3.gets + before_total_customer_charge.gets, + report.total_customer_charge.gets + ); + assert_eq!( + ratio * charge3.storage + before_total_customer_charge.storage, + report.total_customer_charge.storage + ); + assert_eq!( + ratio * charge3.transfer + before_total_customer_charge.transfer, + report.total_customer_charge.transfer + ); + + let balance = Balances::free_balance(DdcPayouts::account_id()); + assert_eq!(balance, balance_before + PARTIAL_CHARGE); + + let user3_debt = DdcPayouts::debtor_customers(cluster_id, user3_debtor).unwrap(); + debt = user3_charge - PARTIAL_CHARGE; + assert_eq!(user3_debt, debt); + + System::assert_has_event( + Event::Indebted { + cluster_id, + era, + customer_id: user3_debtor, + batch_index, + amount: user3_debt, + } + .into(), + ); + + System::assert_last_event( + Event::ChargeFailed { + cluster_id, + era, + batch_index, + customer_id: user3_debtor, + charged: PARTIAL_CHARGE, + expected_to_charge: user3_charge, + } + .into(), + ); + }) +} + +#[test] +fn send_charging_customers_batch_works_zero_fees() { ExtBuilder.build_and_execute(|| { System::set_block_number(1); diff --git a/pallets/ddc-staking/Cargo.toml b/pallets/ddc-staking/Cargo.toml index bfc32eafc..56ef3c6b3 100644 --- a/pallets/ddc-staking/Cargo.toml +++ b/pallets/ddc-staking/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "pallet-ddc-staking" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] # 3rd-party dependencies diff --git a/pallets/ddc-staking/src/lib.rs b/pallets/ddc-staking/src/lib.rs index 444ce8f88..5a3bc5a3a 100644 --- a/pallets/ddc-staking/src/lib.rs +++ b/pallets/ddc-staking/src/lib.rs @@ -744,7 +744,7 @@ pub mod pallet { /// /// The dispatch origin for this call must be _Signed_ by the controller. #[pallet::call_index(7)] - #[pallet::weight(10_000)] + #[pallet::weight(T::WeightInfo::fast_chill())] pub fn fast_chill(origin: OriginFor) -> DispatchResult { let controller = ensure_signed(origin)?; diff --git a/pallets/ddc-staking/src/mock.rs b/pallets/ddc-staking/src/mock.rs index 17b8c20e2..daafc2e3f 100644 --- a/pallets/ddc-staking/src/mock.rs +++ b/pallets/ddc-staking/src/mock.rs @@ -95,6 +95,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/pallets/ddc-staking/src/tests.rs b/pallets/ddc-staking/src/tests.rs index a3e236905..b1cace762 100644 --- a/pallets/ddc-staking/src/tests.rs +++ b/pallets/ddc-staking/src/tests.rs @@ -286,7 +286,8 @@ fn staking_should_work() { NodePubKey::StoragePubKey(StorageNodePubKey::new([5; 32])), 1500 )); - System::assert_last_event(Event::Bonded(3, 1500).into()); + let events = System::events(); + assert_eq!(events[events.len() - 2].event, Event::Bonded(3, 1500).into()); assert_ok!(DdcStaking::store(RuntimeOrigin::signed(4), ClusterId::from([0; 20]))); System::assert_last_event(Event::Activated(3).into()); @@ -422,7 +423,11 @@ fn storage_full_unbonding_works() { node_pub_key.clone(), storage_bond_size, // min bond size )); - System::assert_last_event(Event::Bonded(provider_stash, storage_bond_size).into()); + let events = System::events(); + assert_eq!( + events[events.len() - 2].event, + Event::Bonded(provider_stash, storage_bond_size).into() + ); assert_ok!(DdcStaking::store(RuntimeOrigin::signed(provider_controller), cluster_id)); System::assert_last_event(Event::Activated(provider_stash).into()); diff --git a/pallets/ddc-staking/src/weights.rs b/pallets/ddc-staking/src/weights.rs index 523478f3b..5bd1147c9 100644 --- a/pallets/ddc-staking/src/weights.rs +++ b/pallets/ddc-staking/src/weights.rs @@ -34,6 +34,7 @@ pub trait WeightInfo { fn chill() -> Weight; fn set_controller() -> Weight; fn set_node() -> Weight; + fn fast_chill() -> Weight; } /// Weights for pallet_ddc_staking using the Substrate node and recommended hardware. @@ -106,6 +107,9 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } + fn fast_chill() -> Weight { + Weight::from_parts(28_000_000_u64, 0) + } } // For backwards compatibility and tests @@ -177,4 +181,7 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } + fn fast_chill() -> Weight { + Weight::from_parts(28_000_000_u64, 0) + } } \ No newline at end of file diff --git a/pallets/erc20/Cargo.toml b/pallets/erc20/Cargo.toml index 5b6fdde72..45f5417a2 100644 --- a/pallets/erc20/Cargo.toml +++ b/pallets/erc20/Cargo.toml @@ -1,13 +1,12 @@ [package] name = "pallet-erc20" -version = "4.8.8" -authors = ["Parity Technologies "] -edition = "2021" -homepage = "https://substrate.dev" -license = "Unlicense" -readme = "README.md" -repository = "https://github.com/paritytech/substrate/" -description = "FRAME example pallet" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/erc20/src/lib.rs b/pallets/erc20/src/lib.rs index 5a107ea72..239251f12 100644 --- a/pallets/erc20/src/lib.rs +++ b/pallets/erc20/src/lib.rs @@ -16,6 +16,9 @@ use sp_arithmetic::traits::SaturatedConversion; use sp_core::U256; use sp_std::prelude::*; +pub mod weights; +use crate::weights::WeightInfo; + type ResourceId = bridge::ResourceId; pub type BalanceOf = @@ -46,6 +49,7 @@ pub mod pallet { type NativeTokenId: Get; #[pallet::constant] type Erc721Id: Get; + type WeightInfo: WeightInfo; } #[pallet::error] @@ -67,7 +71,7 @@ pub mod pallet { /// Transfers an arbitrary hash to a (whitelisted) destination chain. #[pallet::call_index(0)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::transfer_hash())] pub fn transfer_hash( origin: OriginFor, hash: T::Hash, @@ -83,7 +87,7 @@ pub mod pallet { /// Transfers some amount of the native token to some recipient on a (whitelisted) /// destination chain. #[pallet::call_index(1)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::transfer_native())] pub fn transfer_native( origin: OriginFor, amount: BalanceOf, @@ -108,7 +112,7 @@ pub mod pallet { /// Transfer a non-fungible token (erc721) to a (whitelisted) destination chain. #[pallet::call_index(2)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::transfer_erc721())] pub fn transfer_erc721( origin: OriginFor, recipient: Vec, @@ -141,7 +145,7 @@ pub mod pallet { /// Executes a simple currency transfer using the bridge account as the source #[pallet::call_index(3)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::transfer())] pub fn transfer( origin: OriginFor, to: T::AccountId, @@ -154,7 +158,7 @@ pub mod pallet { /// This can be called by the bridge to demonstrate an arbitrary call from a proposal. #[pallet::call_index(4)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::remark())] pub fn remark(origin: OriginFor, hash: T::Hash) -> DispatchResult { T::BridgeOrigin::ensure_origin(origin)?; Self::deposit_event(Event::::Remark(hash)); @@ -163,7 +167,7 @@ pub mod pallet { /// Allows the bridge to issue new erc721 tokens #[pallet::call_index(5)] - #[pallet::weight(195_000_000)] + #[pallet::weight(::WeightInfo::mint_erc721())] pub fn mint_erc721( origin: OriginFor, recipient: T::AccountId, diff --git a/pallets/erc20/src/mock.rs b/pallets/erc20/src/mock.rs index 365518f4e..b098ed898 100644 --- a/pallets/erc20/src/mock.rs +++ b/pallets/erc20/src/mock.rs @@ -99,6 +99,7 @@ impl Config for Test { type HashId = HashId; type NativeTokenId = NativeTokenId; type Erc721Id = Erc721Id; + type WeightInfo = (); } pub type Block = sp_runtime::generic::Block; diff --git a/pallets/erc20/src/weights.rs b/pallets/erc20/src/weights.rs new file mode 100644 index 000000000..aab8cf92f --- /dev/null +++ b/pallets/erc20/src/weights.rs @@ -0,0 +1,60 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_erc20. +pub trait WeightInfo { + fn transfer_hash() -> Weight; + fn transfer_native() -> Weight; + fn transfer_erc721() -> Weight; + fn transfer() -> Weight; + fn remark() -> Weight; + fn mint_erc721() -> Weight; +} + +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn transfer_hash() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer_native() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer_erc721() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remark() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn mint_erc721() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn transfer_hash() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer_native() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer_erc721() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn remark() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn mint_erc721() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} diff --git a/pallets/erc721/Cargo.toml b/pallets/erc721/Cargo.toml index ac187d475..949c486a2 100644 --- a/pallets/erc721/Cargo.toml +++ b/pallets/erc721/Cargo.toml @@ -1,13 +1,12 @@ [package] name = "pallet-erc721" -version = "4.8.8" -authors = ["Parity Technologies "] -edition = "2021" -homepage = "https://substrate.dev" -license = "Unlicense" -readme = "README.md" -repository = "https://github.com/paritytech/substrate/" -description = "FRAME example pallet" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/erc721/src/lib.rs b/pallets/erc721/src/lib.rs index 1dd59953c..f3f1cbd8e 100644 --- a/pallets/erc721/src/lib.rs +++ b/pallets/erc721/src/lib.rs @@ -15,6 +15,8 @@ use sp_core::U256; use sp_runtime::RuntimeDebug; use sp_std::prelude::*; +pub mod weights; +use crate::weights::WeightInfo; mod mock; mod tests; @@ -42,6 +44,7 @@ pub mod pallet { /// This is not explicitly used for anything, but may reflect the bridge's notion of /// resource ID. type Identifier: Get<[u8; 32]>; + type WeightInfo: WeightInfo; } /// Maps tokenId to Erc721 object @@ -89,7 +92,7 @@ pub mod pallet { impl Pallet { /// Creates a new token with the given token ID and metadata, and gives ownership to owner #[pallet::call_index(0)] - #[pallet::weight(195_000_000)] + #[pallet::weight(T::WeightInfo::mint())] pub fn mint( origin: OriginFor, owner: T::AccountId, @@ -105,7 +108,7 @@ pub mod pallet { /// Changes ownership of a token sender owns #[pallet::call_index(1)] - #[pallet::weight(195_000_000)] + #[pallet::weight(T::WeightInfo::transfer())] pub fn transfer(origin: OriginFor, to: T::AccountId, id: TokenId) -> DispatchResult { let sender = ensure_signed(origin)?; @@ -116,7 +119,7 @@ pub mod pallet { /// Remove token from the system #[pallet::call_index(2)] - #[pallet::weight(195_000_000)] + #[pallet::weight(T::WeightInfo::burn())] pub fn burn(origin: OriginFor, id: TokenId) -> DispatchResult { ensure_root(origin)?; diff --git a/pallets/erc721/src/mock.rs b/pallets/erc721/src/mock.rs index 57289ac42..5c3f1fc2e 100644 --- a/pallets/erc721/src/mock.rs +++ b/pallets/erc721/src/mock.rs @@ -65,6 +65,10 @@ impl pallet_balances::Config for Test { type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = (); } parameter_types! { @@ -74,6 +78,7 @@ parameter_types! { impl Config for Test { type RuntimeEvent = RuntimeEvent; type Identifier = Erc721Id; + type WeightInfo = (); } pub type Block = sp_runtime::generic::Block; diff --git a/pallets/erc721/src/weights.rs b/pallets/erc721/src/weights.rs new file mode 100644 index 000000000..dc5fb47d9 --- /dev/null +++ b/pallets/erc721/src/weights.rs @@ -0,0 +1,40 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_erc721. +pub trait WeightInfo { + fn mint() -> Weight; + fn transfer() -> Weight; + fn burn() -> Weight; +} + +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn mint() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn transfer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn burn() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn mint() -> Weight { + Weight::from_parts(195_000_000u64, 0) + + } + fn transfer() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } + fn burn() -> Weight { + Weight::from_parts(195_000_000u64, 0) + } +} diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 4f930a580..2d6ac5463 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "ddc-primitives" -version = "4.8.8" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] codec = { workspace = true } diff --git a/runtime/cere-dev/Cargo.toml b/runtime/cere-dev/Cargo.toml index 4866ef07b..3dcf80e4f 100644 --- a/runtime/cere-dev/Cargo.toml +++ b/runtime/cere-dev/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "cere-dev-runtime" -version = "4.8.8" -authors = ["Parity Technologies "] -build = "build.rs" -edition = "2021" -homepage = "https://substrate.io" -license = "Apache-2.0" -repository = "https://github.com/paritytech/substrate/" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index b067f9e34..8d9f0347b 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -130,10 +130,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 48800, + spec_version: 48900, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 13, + transaction_version: 14, state_version: 0, }; @@ -201,6 +201,7 @@ parameter_types! { }) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); + pub MaxCollectivesProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; } const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); @@ -430,6 +431,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = frame_system::Pallet; type WeightInfo = pallet_balances::weights::SubstrateWeight; + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = ConstU32<0>; } parameter_types! { @@ -818,6 +823,7 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxCollectivesProposalWeight; } parameter_types! { @@ -877,6 +883,7 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxCollectivesProposalWeight; } type EnsureRootOrHalfCouncil = EitherOfDiverse< @@ -986,6 +993,7 @@ impl pallet_tips::Config for Runtime { parameter_types! { pub const DepositPerItem: Balance = deposit(1, 0); pub const DepositPerByte: Balance = deposit(0, 1); + pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); pub const MaxValueSize: u32 = 16 * 1024; // The lazy deletion runs inside on_initialize. pub DeletionWeightLimit: Weight = RuntimeBlockWeights::get() @@ -993,7 +1001,6 @@ parameter_types! { .get(DispatchClass::Normal) .max_total .unwrap_or(RuntimeBlockWeights::get().max_block); - pub DeletionQueueDepth: u32 = 128; pub Schedule: pallet_contracts::Schedule = Default::default(); } @@ -1012,12 +1019,11 @@ impl pallet_contracts::Config for Runtime { type CallFilter = Nothing; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; + type DefaultDepositLimit = DefaultDepositLimit; type CallStack = [pallet_contracts::Frame; 5]; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type ChainExtension = (); - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; @@ -1241,6 +1247,7 @@ impl pallet_chainbridge::Config for Runtime { type ChainIdentity = ChainId; type ProposalLifetime = ProposalLifetime; type BridgeAccountId = BridgeAccountId; + type WeightInfo = pallet_chainbridge::weights::SubstrateWeight; } parameter_types! { @@ -1254,6 +1261,7 @@ parameter_types! { impl pallet_erc721::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Identifier = NFTTokenId; + type WeightInfo = pallet_erc721::weights::SubstrateWeight; } impl pallet_erc20::Config for Runtime { @@ -1263,6 +1271,7 @@ impl pallet_erc20::Config for Runtime { type HashId = HashId; type NativeTokenId = NativeTokenId; type Erc721Id = NFTTokenId; + type WeightInfo = pallet_erc20::weights::SubstrateWeight; } parameter_types! { @@ -1483,14 +1492,8 @@ impl Get for NominationPoolsMigrationV4OldPallet { /// Runtime migrations type Migrations = ( - // 0.9.40 - pallet_nomination_pools::migration::v4::MigrateV3ToV5< - Runtime, - NominationPoolsMigrationV4OldPallet, - >, - // this release they will be properly pruned after the bonding duration has - // elapsed) - pallet_grandpa::migrations::CleanupSetIdSessionMap, + pallet_offences::migration::v1::MigrateToV1, + cere_runtime_common::session::migration::ClearOldSessionStorage, ); /// Executive: handles dispatch to the various modules. @@ -1582,6 +1585,14 @@ impl_runtime_apis! { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder for Runtime { @@ -1735,7 +1746,7 @@ impl_runtime_apis! { storage_deposit_limit, input_data, true, - pallet_contracts::Determinism::Deterministic, + pallet_contracts::Determinism::Enforced, ) } diff --git a/runtime/cere/Cargo.toml b/runtime/cere/Cargo.toml index 20a20a396..4259a6206 100644 --- a/runtime/cere/Cargo.toml +++ b/runtime/cere/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "cere-runtime" -version = "4.8.8" -authors = ["Parity Technologies "] -build = "build.rs" -edition = "2021" -homepage = "https://substrate.io" -license = "Apache-2.0" -repository = "https://github.com/paritytech/substrate/" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -75,7 +75,7 @@ pallet-utility = { workspace = true } pallet-vesting = { workspace = true } sp-api = { workspace = true } sp-authority-discovery = { workspace = true } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40", default-features = false, version = "4.0.0-dev" } +sp-block-builder = { workspace = true } sp-consensus-babe = { workspace = true } sp-core = { workspace = true } sp-inherents = { workspace = true } diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index fce044f75..9253ae3c4 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -125,10 +125,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 48801, + spec_version: 48901, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 13, + transaction_version: 14, state_version: 0, }; @@ -196,6 +196,7 @@ parameter_types! { }) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); + pub MaxCollectivesProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; } const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct()); @@ -425,6 +426,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = frame_system::Pallet; type WeightInfo = pallet_balances::weights::SubstrateWeight; + type FreezeIdentifier = (); + type MaxFreezes = (); + type HoldIdentifier = (); + type MaxHolds = ConstU32<0>; } parameter_types! { @@ -822,6 +827,7 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxCollectivesProposalWeight; } parameter_types! { @@ -881,6 +887,7 @@ impl pallet_collective::Config for Runtime { type SetMembersOrigin = EnsureRoot; type DefaultVote = pallet_collective::PrimeDefaultVote; type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxCollectivesProposalWeight; } type EnsureRootOrHalfCouncil = EitherOfDiverse< @@ -990,6 +997,7 @@ impl pallet_tips::Config for Runtime { parameter_types! { pub const DepositPerItem: Balance = deposit(1, 0); pub const DepositPerByte: Balance = deposit(0, 1); + pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); pub const MaxValueSize: u32 = 16 * 1024; // The lazy deletion runs inside on_initialize. pub DeletionWeightLimit: Weight = RuntimeBlockWeights::get() @@ -997,7 +1005,6 @@ parameter_types! { .get(DispatchClass::Normal) .max_total .unwrap_or(RuntimeBlockWeights::get().max_block); - pub DeletionQueueDepth: u32 = 128; pub Schedule: pallet_contracts::Schedule = Default::default(); pub UnsafeUnstableInterface: bool = false; } @@ -1017,12 +1024,11 @@ impl pallet_contracts::Config for Runtime { type CallFilter = Nothing; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; + type DefaultDepositLimit = DefaultDepositLimit; type CallStack = [pallet_contracts::Frame; 5]; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; type ChainExtension = (); - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; type AddressGenerator = pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; @@ -1246,6 +1252,7 @@ impl pallet_chainbridge::Config for Runtime { type ChainIdentity = ChainId; type ProposalLifetime = ProposalLifetime; type BridgeAccountId = BridgeAccountId; + type WeightInfo = pallet_chainbridge::weights::SubstrateWeight; } parameter_types! { @@ -1259,6 +1266,7 @@ parameter_types! { impl pallet_erc721::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Identifier = NFTTokenId; + type WeightInfo = pallet_erc721::weights::SubstrateWeight; } impl pallet_erc20::Config for Runtime { @@ -1268,6 +1276,7 @@ impl pallet_erc20::Config for Runtime { type HashId = HashId; type NativeTokenId = NativeTokenId; type Erc721Id = NFTTokenId; + type WeightInfo = pallet_erc20::weights::SubstrateWeight; } parameter_types! { @@ -1488,15 +1497,10 @@ impl Get for NominationPoolsMigrationV4OldPallet { /// Runtime migrations type Migrations = ( - // 0.9.40 - pallet_nomination_pools::migration::v4::MigrateV3ToV5< - Runtime, - NominationPoolsMigrationV4OldPallet, - >, - // this release they will be properly pruned after the bonding duration has - // elapsed) - pallet_grandpa::migrations::CleanupSetIdSessionMap, + pallet_offences::migration::v1::MigrateToV1, + cere_runtime_common::session::migration::ClearOldSessionStorage, ); + /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -1540,7 +1544,6 @@ mod benches { [pallet_multisig, Multisig] [pallet_nomination_pools, NominationPoolsBench::] [pallet_offences, OffencesBench::] - [pallet_preimage, Preimage] [pallet_proxy, Proxy] [pallet_preimage, Preimage] [pallet_scheduler, Scheduler] @@ -1574,6 +1577,14 @@ impl_runtime_apis! { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder for Runtime { @@ -1726,7 +1737,7 @@ impl_runtime_apis! { storage_deposit_limit, input_data, true, - pallet_contracts::Determinism::Deterministic, + pallet_contracts::Determinism::Enforced, ) } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index bbd81254e..23b3d41fc 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,14 +1,24 @@ [package] name = "cere-runtime-common" -version = "4.8.8" -authors = ["Parity Technologies "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] +log = { version = "0.4.17", default-features = false } + frame-support = { workspace = true } node-primitives = { workspace = true } +pallet-session = { workspace = true } +sp-api = { workspace = true } sp-core = { workspace = true } +sp-io = { workspace = true } sp-runtime = { workspace = true } +sp-std = { workspace = true } [features] default = ["std"] diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index fd38fa810..4fda51c1f 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] pub mod constants; +pub mod session; use node_primitives::Balance; diff --git a/runtime/common/src/session/migration.rs b/runtime/common/src/session/migration.rs new file mode 100644 index 000000000..87bcd8d7d --- /dev/null +++ b/runtime/common/src/session/migration.rs @@ -0,0 +1,70 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +use frame_support::{ + storage::storage_prefix, + traits::{Get, OnRuntimeUpgrade}, + weights::Weight, +}; +use pallet_session::Config; +use sp_io::{storage::clear_prefix, KillStorageResult}; +#[cfg(feature = "try-runtime")] +use sp_std::vec::Vec; + +/// This migration clears everything under `Session::HistoricalSessions` +/// and `Session::StoredRange` that were not cleared when +/// the pallet was moved to its new prefix (`Historical`) +pub struct ClearOldSessionStorage(sp_std::marker::PhantomData); +impl OnRuntimeUpgrade for ClearOldSessionStorage { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let prefix = storage_prefix(b"Session", b"StoredRange"); + let keys_removed_stored_range = match clear_prefix(&prefix, None) { + KillStorageResult::AllRemoved(value) => value, + KillStorageResult::SomeRemaining(value) => { + log::error!( + "`clear_prefix` failed to remove all keys. THIS SHOULD NEVER HAPPEN! ๐Ÿšจ", + ); + value + }, + } as u64; + + let prefix = storage_prefix(b"Session", b"HistoricalSessions"); + let keys_removed_historical_sessions = match clear_prefix(&prefix, None) { + KillStorageResult::AllRemoved(value) => value, + KillStorageResult::SomeRemaining(value) => { + log::error!( + "`clear_prefix` failed to remove all keys. THIS SHOULD NEVER HAPPEN! ๐Ÿšจ", + ); + value + }, + } as u64; + + let keys_removed = keys_removed_stored_range + keys_removed_historical_sessions; + log::info!("Removed {} keys ๐Ÿงน", keys_removed); + + T::DbWeight::get().reads_writes(keys_removed, keys_removed) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), &'static str> { + Ok(()) + } +} diff --git a/runtime/common/src/session/mod.rs b/runtime/common/src/session/mod.rs new file mode 100644 index 000000000..5f99cba0e --- /dev/null +++ b/runtime/common/src/session/mod.rs @@ -0,0 +1,17 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot 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. + +// Polkadot 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 Polkadot. If not, see . + +pub mod migration;