diff --git a/Cargo.lock b/Cargo.lock index c30857b81..4bea22628 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "gimli 0.27.1", + "gimli 0.27.3", ] [[package]] @@ -42,7 +42,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -51,7 +51,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", ] @@ -62,7 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -153,25 +153,31 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] [[package]] name = "always-assert" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_system_properties" @@ -191,11 +197,60 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -235,9 +290,9 @@ checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -247,9 +302,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asn1-rs" @@ -291,7 +346,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "synstructure", ] @@ -303,7 +358,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "synstructure", ] @@ -315,14 +370,14 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "asn1_der" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" [[package]] name = "assert_matches" @@ -332,63 +387,62 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-io" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg", + "cfg-if", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", - "winapi", ] [[package]] name = "async-lock" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", - "futures-lite", ] [[package]] name = "async-trait" -version = "0.1.63" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "asynchronous-codec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] name = "atomic-waker" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atty" @@ -409,16 +463,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ - "addr2line 0.19.0", + "addr2line 0.20.0", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", - "object 0.30.3", + "miniz_oxide", + "object 0.31.1", "rustc-demangle", ] @@ -448,15 +502,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" -version = "1.5.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "battery-station-runtime" @@ -642,11 +696,11 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.60.1" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -657,6 +711,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", + "syn 1.0.109", ] [[package]] @@ -665,6 +720,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "1.0.1" @@ -683,43 +744,43 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] name = "blake2b_simd" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", - "arrayvec 0.7.2", - "constant_time_eq 0.1.5", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] name = "blake2s_simd" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", - "arrayvec 0.7.2", - "constant_time_eq 0.1.5", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] name = "blake3" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895adc16c8b3273fbbc32685a7d55227705eda08c01e77704020f3491924b44b" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "cc", "cfg-if", - "constant_time_eq 0.2.4", - "digest 0.10.6", + "constant_time_eq 0.3.0", + "digest 0.10.7", ] [[package]] @@ -740,16 +801,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -794,9 +855,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.1.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", "serde", @@ -813,9 +874,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -837,9 +898,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -852,26 +913,20 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - [[package]] name = "camino" -version = "1.1.2" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -884,18 +939,19 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.18", "serde", "serde_json", ] [[package]] name = "cc" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -966,15 +1022,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", - "time 0.1.44", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -998,7 +1054,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -1007,7 +1063,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -1031,9 +1087,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -1042,46 +1098,50 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "03aef18ddf7d879c15ce20f04826ef8418101c7e528014c3eeea13321047dca3" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ce6fffb678c9b80a70b6b6de0aad31df727623a70fd9a842c30cd573e2fa98" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.0" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "coarsetime" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454038500439e141804c655b4cd1bc6a70bcb95cd2bc9463af5661b6956f0e46" +checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" dependencies = [ "libc", "once_cell", @@ -1099,11 +1159,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "comfy-table" -version = "6.1.4" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" +checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" dependencies = [ "strum", "strum_macros", @@ -1148,30 +1214,30 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ - "cache-padded", + "crossbeam-utils", ] [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "convert_case" @@ -1191,9 +1257,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core2" @@ -1247,7 +1313,7 @@ version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", @@ -1356,9 +1422,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1366,9 +1432,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -1377,14 +1443,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset 0.9.0", "scopeguard", ] @@ -1400,9 +1466,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -1419,7 +1485,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1431,7 +1497,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1442,7 +1508,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -1452,7 +1518,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -1685,7 +1751,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1945,9 +2011,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.3" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ace70fc06e06f7f689d2624dc4e2f0ea666efb5aa704215f7249ae6e047a7" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if", "cpufeatures", @@ -1967,14 +2033,14 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] name = "cxx" -version = "1.0.87" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b61a7545f753a88bcbe0a70de1fcc0221e10bfc752f576754fa91e663db1622e" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -1984,9 +2050,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.87" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f464457d494b5ed6905c63b0c4704842aba319084a0a3561cdc1359536b53200" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -1994,24 +2060,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "cxxbridge-flags" -version = "1.0.87" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c7119ce3a3701ed81aca8410b9acf6fc399d2629d057b87e2efa4e63a3aaea" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.87" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e07508b90551e610910fa648a1878991d367064997a596135b86df30daf07e" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] @@ -2035,7 +2101,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2046,20 +2112,20 @@ checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2067,12 +2133,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2116,9 +2182,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivative" @@ -2128,7 +2194,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2139,7 +2205,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2160,7 +2226,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2170,7 +2236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2183,7 +2249,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2207,16 +2273,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -2270,7 +2336,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2287,9 +2353,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dyn-clonable" @@ -2309,14 +2375,14 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "dyn-clone" -version = "1.0.10" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ecdsa" @@ -2360,7 +2426,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", - "hashbrown", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -2369,9 +2435,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -2382,9 +2448,9 @@ dependencies = [ "base16ct", "crypto-bigint", "der", - "digest 0.10.6", + "digest 0.10.7", "ff", - "generic-array 0.14.6", + "generic-array 0.14.7", "group", "hkdf", "pem-rfc7468", @@ -2404,38 +2470,38 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "enumflags2" -version = "0.7.5" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "enumn" -version = "0.1.6" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88bcb3a067a6555d577aba299e75eff9942da276e6506fc6274327daa026132" +checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] @@ -2470,6 +2536,12 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -2481,6 +2553,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2528,7 +2611,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2545,13 +2628,19 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fatality" version = "0.0.6" @@ -2569,11 +2658,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" dependencies = [ "expander 0.0.4", - "indexmap", + "indexmap 1.9.3", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "thiserror", ] @@ -2614,21 +2703,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.42.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] name = "finality-grandpa" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24e6c429951433ccb7c87fd528c60084834dcd14763182c1f83291bcde24c34" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", "futures 0.3.28", @@ -2660,13 +2749,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide 0.5.4", + "miniz_oxide", ] [[package]] @@ -2694,9 +2783,9 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -2785,7 +2874,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2824,9 +2913,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2855,7 +2944,7 @@ name = "frame-support" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "bitflags", + "bitflags 1.3.2", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", @@ -2893,7 +2982,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2905,7 +2994,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2915,7 +3004,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2988,12 +3077,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fs_extra" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" - [[package]] name = "funty" version = "2.0.0" @@ -3057,16 +3140,16 @@ checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "waker-fn", ] @@ -3078,7 +3161,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -3124,7 +3207,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -3149,9 +3232,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", @@ -3180,9 +3263,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -3216,15 +3299,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.1" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glob" @@ -3234,9 +3317,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", "bstr", @@ -3258,9 +3341,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -3268,7 +3351,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -3277,9 +3360,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.6" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -3313,11 +3396,17 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -3330,12 +3419,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -3384,7 +3470,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3394,7 +3480,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.6", + "generic-array 0.14.7", "hmac 0.8.1", ] @@ -3411,9 +3497,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -3428,7 +3514,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] @@ -3445,9 +3531,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -3457,9 +3543,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -3471,8 +3557,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.9", - "socket2", + "pin-project-lite 0.2.12", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -3496,26 +3582,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.48.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -3537,9 +3622,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3571,7 +3656,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.34.0", ] [[package]] @@ -3600,20 +3685,30 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "indexmap-nostd" version = "0.4.0" @@ -3626,7 +3721,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -3680,12 +3775,13 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi 0.3.2", "libc", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -3696,32 +3792,31 @@ checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", + "windows-sys 0.48.0", "winreg", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes 1.0.4", - "rustix 0.36.7", - "windows-sys 0.42.0", + "hermit-abi 0.3.2", + "rustix 0.38.8", + "windows-sys 0.48.0", ] [[package]] @@ -3735,24 +3830,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -3799,7 +3894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" dependencies = [ "anyhow", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "async-lock", "async-trait", "beef", @@ -3830,7 +3925,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -3890,14 +3985,14 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] name = "keccak" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -4060,15 +4155,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libfuzzer-sys" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb09950ae85a0a94b27676cccf37da5ff13f27076aa1adbc6545dd0d0e1bd4e" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" dependencies = [ "arbitrary", "cc", @@ -4087,9 +4182,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" @@ -4100,7 +4195,7 @@ dependencies = [ "bytes", "futures 0.3.28", "futures-timer", - "getrandom 0.2.8", + "getrandom 0.2.10", "instant", "libp2p-core 0.38.0", "libp2p-dns", @@ -4151,7 +4246,7 @@ dependencies = [ "rand 0.8.5", "rw-stream-sink", "sec1", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "thiserror", "unsigned-varint", @@ -4235,7 +4330,7 @@ dependencies = [ "multihash 0.17.0", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "zeroize", ] @@ -4246,7 +4341,7 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "asynchronous-codec", "bytes", "either", @@ -4260,7 +4355,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "thiserror", "uint", @@ -4282,7 +4377,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.4.9", "tokio", "trust-dns-proto", "void", @@ -4335,7 +4430,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "snow", "static_assertions", "thiserror", @@ -4428,7 +4523,7 @@ checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -4443,7 +4538,7 @@ dependencies = [ "libc", "libp2p-core 0.38.0", "log", - "socket2", + "socket2 0.4.9", "tokio", ] @@ -4546,9 +4641,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.0+7.4.4" +version = "0.8.3+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" +checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" dependencies = [ "bindgen", "bzip2-sys", @@ -4609,9 +4704,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -4620,9 +4715,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" dependencies = [ "cc", ] @@ -4660,15 +4755,21 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -4676,9 +4777,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -4686,7 +4787,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -4739,7 +4840,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -4750,10 +4851,11 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" dependencies = [ + "autocfg", "rawpointer", ] @@ -4763,7 +4865,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -4774,18 +4876,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.36.7", + "rustix 0.37.23", ] [[package]] name = "memmap2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] @@ -4801,9 +4903,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -4815,7 +4917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -4855,32 +4957,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -4920,9 +5012,9 @@ dependencies = [ [[package]] name = "mockall" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ "cfg-if", "downcast", @@ -4935,14 +5027,14 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -5026,9 +5118,9 @@ dependencies = [ "blake2s_simd", "blake3", "core2", - "digest 0.10.6", + "digest 0.10.7", "multihash-derive", - "sha2 0.10.6", + "sha2 0.10.7", "sha3", "unsigned-varint", ] @@ -5054,7 +5146,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "synstructure", ] @@ -5104,7 +5196,7 @@ checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -5141,7 +5233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "netlink-packet-core", @@ -5150,9 +5242,9 @@ dependencies = [ [[package]] name = "netlink-packet-utils" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" dependencies = [ "anyhow", "byteorder", @@ -5177,9 +5269,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e21fbb6f3d253a14df90eb0000a6066780a15dd901a7519ce02d77a94985b" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ "bytes", "futures 0.3.28", @@ -5239,11 +5331,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.6.5", @@ -5265,15 +5357,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -5293,20 +5376,20 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] [[package]] name = "num-format" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "itoa", ] @@ -5334,9 +5417,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -5344,11 +5427,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -5359,16 +5442,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown", - "indexmap", + "hashbrown 0.12.3", + "indexmap 1.9.3", "memchr", ] [[package]] name = "object" -version = "0.30.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -5444,7 +5527,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -5609,12 +5692,6 @@ dependencies = [ "xcm-executor", ] -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "p256" version = "0.11.1" @@ -5623,7 +5700,7 @@ checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -5634,7 +5711,7 @@ checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -5915,7 +5992,7 @@ name = "pallet-contracts" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "bitflags", + "bitflags 1.3.2", "frame-benchmarking", "frame-support", "frame-system", @@ -5944,7 +6021,7 @@ name = "pallet-contracts-primitives" version = "7.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ - "bitflags", + "bitflags 1.3.2", "parity-scale-codec", "sp-runtime", "sp-std", @@ -5958,7 +6035,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -6512,7 +6589,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -6768,11 +6845,11 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.2.2" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ab01d0f889e957861bc65888d5ccbe82c158d0270136ba46820d43837cdf72" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "bitvec", "byte-slice-cast", "bytes", @@ -6783,14 +6860,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -6807,9 +6884,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -6829,7 +6906,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.6", + "parking_lot_core 0.9.8", ] [[package]] @@ -6841,29 +6918,29 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.42.0", + "windows-targets", ] [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" @@ -6880,7 +6957,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -6909,15 +6986,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.5.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ "thiserror", "ucd-trie", @@ -6925,9 +7002,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf026e2d0581559db66d837fe5242320f525d85c76283c61f4d51a1238d65ea" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -6935,56 +7012,56 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b27bd18aa01d91c8ed2b61ea23406a676b42d82609c6e2581fba42f0c15f17f" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "pest_meta" -version = "2.5.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02b677c1859756359fc9983c2e56a0237f18624a3789528804406b7e915e5d" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.0.0", ] [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] @@ -6995,9 +7072,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -7017,9 +7094,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" @@ -7218,7 +7295,7 @@ dependencies = [ "fatality", "futures 0.3.28", "futures-timer", - "indexmap", + "indexmap 1.9.3", "lru", "parity-scale-codec", "polkadot-erasure-coding", @@ -8050,7 +8127,7 @@ name = "polkadot-runtime-parachains" version = "0.9.37" source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.37-recent-bootnodes#7632261076558a807a6d4585df9cea8e0f2ded05" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bitvec", "derive_more", "frame-benchmarking", @@ -8202,7 +8279,7 @@ dependencies = [ "arrayvec 0.5.2", "fatality", "futures 0.3.28", - "indexmap", + "indexmap 1.9.3", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8342,16 +8419,18 @@ dependencies = [ [[package]] name = "polling" -version = "2.5.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", + "bitflags 1.3.2", "cfg-if", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "windows-sys 0.42.0", + "pin-project-lite 0.2.12", + "windows-sys 0.48.0", ] [[package]] @@ -8411,15 +8490,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ "predicates-core", "termtree", @@ -8427,12 +8506,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.23" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -8466,9 +8545,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", "toml_edit", @@ -8483,7 +8562,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "version_check", ] @@ -8541,14 +8620,14 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "prost" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -8556,9 +8635,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -8571,7 +8650,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 1.0.107", + "syn 1.0.109", "tempfile", "which", ] @@ -8591,24 +8670,23 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "bytes", "prost", ] @@ -8667,9 +8745,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -8739,7 +8817,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -8778,9 +8856,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -8788,9 +8866,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -8829,7 +8907,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -8838,8 +8925,8 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] @@ -8858,22 +8945,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.14" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.14" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] @@ -8890,13 +8977,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", ] [[package]] @@ -8905,23 +8993,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "resolv-conf" @@ -9132,9 +9228,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -9163,7 +9259,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.18", ] [[package]] @@ -9177,12 +9273,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.13" +version = "0.35.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" +checksum = "6380889b07a03b5ecf1d44dc9ede6fd2145d84b502a2a9ca0b03c48e0cc3220f" dependencies = [ - "bitflags", - "errno", + "bitflags 1.3.2", + "errno 0.2.8", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -9191,16 +9287,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.7" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", - "errno", - "io-lifetimes 1.0.4", + "bitflags 1.3.2", + "errno 0.3.2", + "io-lifetimes 1.0.11", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno 0.3.2", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys 0.48.0", ] [[package]] @@ -9230,9 +9339,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -9242,18 +9351,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rw-stream-sink" @@ -9268,9 +9377,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safe-mix" @@ -9390,7 +9499,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -9727,7 +9836,7 @@ dependencies = [ "libc", "log", "once_cell", - "rustix 0.35.13", + "rustix 0.35.14", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9892,7 +10001,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "futures 0.3.28", "futures-timer", @@ -10315,7 +10424,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -10374,9 +10483,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "bitvec", "cfg-if", @@ -10388,23 +10497,23 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "303959cf613a6f6efd19ed4b4ad5bf79966a13352716299ad532cfb115f4205c" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -10427,15 +10536,15 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" @@ -10477,7 +10586,7 @@ checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ "base16ct", "der", - "generic-array 0.14.6", + "generic-array 0.14.7", "pkcs8", "subtle", "zeroize", @@ -10512,11 +10621,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -10525,9 +10634,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -10553,9 +10662,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -10568,29 +10677,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", @@ -10639,7 +10748,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -10669,22 +10778,22 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] name = "sha3" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -10705,9 +10814,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -10718,7 +10827,7 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -10742,18 +10851,18 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] [[package]] name = "slice-group-by" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" @@ -10778,9 +10887,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snap" @@ -10790,31 +10899,41 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.3", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", - "sha2 0.10.6", + "sha2 0.10.7", "subtle", ] [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soketto" version = "0.7.1" @@ -10859,7 +10978,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11052,7 +11171,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "array-bytes 4.2.0", "base58", - "bitflags", + "bitflags 1.3.2", "blake2", "dyn-clonable", "ed25519-zebra", @@ -11094,8 +11213,8 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "blake2", "byteorder", - "digest 0.10.6", - "sha2 0.10.6", + "digest 0.10.7", + "sha2 0.10.7", "sha3", "sp-std", "twox-hash", @@ -11109,7 +11228,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11128,7 +11247,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11347,7 +11466,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11473,7 +11592,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "ahash", "hash-db", - "hashbrown", + "hashbrown 0.12.3", "lazy_static", "lru", "memory-db", @@ -11514,7 +11633,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11569,9 +11688,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.38.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e40c020d72bc0a9c5660bb71e4a6fdef081493583062c474740a7d59f55f0e7b" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -11612,7 +11731,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg_aliases", "libc", "parking_lot 0.11.2", @@ -11631,7 +11750,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11644,7 +11763,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11685,7 +11804,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11731,12 +11850,12 @@ dependencies = [ [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed#a4fb461aae6205ffc55bed51254a40c52be04e5d" +source = "git+https://github.com/encointer/substrate-fixed#df67f97a6db9b40215f105613b381ca82f1e2ff4" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=v1.16.0)", + "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0)", ] [[package]] @@ -11862,9 +11981,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -11873,9 +11992,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -11890,17 +12009,17 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "unicode-xid", ] [[package]] name = "system-configuration" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -11923,22 +12042,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.5" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix 0.38.8", + "windows-sys 0.48.0", ] [[package]] @@ -11952,9 +12070,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-case" @@ -11975,7 +12093,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -11987,7 +12105,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "test-case-core", ] @@ -12007,22 +12125,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -12033,10 +12151,11 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -12075,20 +12194,19 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.2+5.3.0-patched" +version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ "cc", - "fs_extra", "libc", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -12135,7 +12253,7 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -12163,39 +12281,38 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.2" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] @@ -12211,27 +12328,27 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -12247,19 +12364,19 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.5.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.18.0" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap", - "nom8", + "indexmap 2.0.0", "toml_datetime", + "winnow", ] [[package]] @@ -12279,14 +12396,14 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -12311,27 +12428,27 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -12378,7 +12495,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -12390,7 +12507,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -12444,7 +12561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", "log", "rustc-hex", "smallvec", @@ -12477,7 +12594,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.4.9", "thiserror", "tinyvec", "tokio", @@ -12574,7 +12691,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "digest 0.10.6", + "digest 0.10.7", "rand 0.8.5", "static_assertions", ] @@ -12588,7 +12705,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "typenum" version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=v1.16.0#4c8dddaa8bdd13130149e43b4085ad14e960617f" +source = "git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0#4cba9a73f7e94ba38c824616efab93f177c9a556" dependencies = [ "parity-scale-codec", "scale-info", @@ -12596,15 +12713,15 @@ dependencies = [ [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", @@ -12614,15 +12731,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -12651,7 +12768,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -12685,22 +12802,28 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -12744,22 +12867,20 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -12783,9 +12904,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -12793,24 +12914,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -12820,9 +12941,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12830,22 +12951,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" @@ -12989,7 +13110,7 @@ version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -13010,7 +13131,7 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object 0.29.0", @@ -13050,7 +13171,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.35.13", + "rustix 0.35.14", "serde", "sha2 0.9.9", "toml", @@ -13088,7 +13209,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", - "indexmap", + "indexmap 1.9.3", "log", "object 0.29.0", "serde", @@ -13113,7 +13234,7 @@ dependencies = [ "log", "object 0.29.0", "rustc-demangle", - "rustix 0.35.13", + "rustix 0.35.14", "serde", "target-lexicon", "thiserror", @@ -13131,7 +13252,7 @@ checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" dependencies = [ "object 0.29.0", "once_cell", - "rustix 0.35.13", + "rustix 0.35.14", ] [[package]] @@ -13143,7 +13264,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -13151,7 +13272,7 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.35.13", + "rustix 0.35.14", "thiserror", "wasmtime-asm-macros", "wasmtime-environ", @@ -13173,9 +13294,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -13233,7 +13354,7 @@ dependencies = [ "sdp", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "stun", "thiserror", "time 0.3.25", @@ -13295,14 +13416,14 @@ dependencies = [ "sec1", "serde", "sha1", - "sha2 0.10.6", + "sha2 0.10.7", "signature", "subtle", "thiserror", "tokio", "webpki 0.21.4", "webrtc-util", - "x25519-dalek 2.0.0-rc.3", + "x25519-dalek 2.0.0", "x509-parser 0.13.2", ] @@ -13337,7 +13458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" dependencies = [ "log", - "socket2", + "socket2 0.4.9", "thiserror", "tokio", "webrtc-util", @@ -13404,7 +13525,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "cc", "ipnet", @@ -13418,15 +13539,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "westend-runtime" version = "0.9.37" @@ -13544,9 +13656,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -13592,6 +13704,15 @@ dependencies = [ "windows_x86_64_msvc 0.34.0", ] +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -13611,20 +13732,50 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -13640,9 +13791,15 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -13658,9 +13815,15 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -13676,9 +13839,15 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -13694,15 +13863,27 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -13718,17 +13899,33 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +dependencies = [ + "memchr", +] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -13753,11 +13950,11 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-rc.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7fae07da688e17059d5886712c933bb0520f15eff2e09cfa18e30968f4e63a" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.0.0-rc.3", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "serde", "zeroize", @@ -13886,7 +14083,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -14132,14 +14329,13 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", - "synstructure", + "syn 2.0.29", ] [[package]] @@ -14163,7 +14359,7 @@ dependencies = [ name = "zrml-court" version = "0.3.11" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "frame-benchmarking", "frame-support", "frame-system", @@ -14334,7 +14530,7 @@ dependencies = [ "cfg-if", "frame-support", "frame-system", - "hashbrown", + "hashbrown 0.12.3", "pallet-balances", "pallet-timestamp", "parity-scale-codec", @@ -14482,9 +14678,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.5+zstd.1.5.2" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index c8de6d853..98d072c2a 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -13,27 +13,47 @@ components which query the chain's storage, the extrinsics or the runtime APIs/RPC interface. ## v0.4.0 + [#976]: https://github.com/zeitgeistpm/zeitgeist/pull/976 +### Changed + +All things about Global Disputes Fix ⚠️ : + +- Replace `WinnerInfo` by `GlobalDisputeInfo` with the following fields: + - `winner_outcome: OutcomeReport` + - `outcome_info: OutcomeInfo` + - `status: GdStatus` + +### Removed + +All things about Global Disputes Fix ⚠️ : + +- Remove the following event: + - `OutcomeOwnersRewardedWithNoFunds` + ### Added -- ⚠️ Add court production implementation ([#976]). - Dispatchable calls are: - - `join_court` - Join the court with a stake to become a juror in order to get the stake-weighted - chance to be selected for decision making. + +- ⚠️ Add court production implementation ([#976]). Dispatchable calls are: + - `join_court` - Join the court with a stake to become a juror in order to get + the stake-weighted chance to be selected for decision making. - `delegate` - Join the court with a stake to become a delegator in order to - delegate the voting power to actively participating jurors. - - `prepare_exit_court` - Prepare as a court participant to leave the court system. + delegate the voting power to actively participating jurors. + - `prepare_exit_court` - Prepare as a court participant to leave the court + system. - `exit_court` - Exit the court system in order to get the stake back. - - `vote` - An actively participating juror votes secretely on a specific court case, - in which the juror got selected. + - `vote` - An actively participating juror votes secretely on a specific court + case, in which the juror got selected. - `denounce_vote` - Denounce a selected and active juror, if the secret and - vote is known before the actual reveal period. - - `reveal_vote` - An actively participating juror reveals the previously casted secret vote. - - `appeal` - After the reveal phase (aggregation period), the jurors decision can be appealed. - - `reassign_juror_stakes` - After the appeal period is over, - losers pay the winners for the jurors and delegators. - - `set_inflation` - Set the yearly inflation rate of the court system. - Events are: + vote is known before the actual reveal period. + - `reveal_vote` - An actively participating juror reveals the previously + casted secret vote. + - `appeal` - After the reveal phase (aggregation period), the jurors decision + can be appealed. + - `reassign_juror_stakes` - After the appeal period is over, losers pay the + winners for the jurors and delegators. + - `set_inflation` - Set the yearly inflation rate of the court system. Events + are: - `JurorJoined` - A juror joined the court system. - `ExitPrepared` - A court participant prepared to exit the court system. - `ExitedCourt` - A court participant exited the court system. @@ -44,12 +64,32 @@ APIs/RPC interface. - `CourtAppealed` - A court case was appealed. - `MintedInCourt` - A court participant was rewarded with newly minted tokens. - `StakesReassigned` - The juror and delegator stakes have been reassigned. - The losing jurors have been slashed. - The winning jurors have been rewarded by the losers. - The losing jurors are those, who did not vote, or did not vote with the plurality, - were denounced or did not reveal their vote. + The losing jurors have been slashed. The winning jurors have been rewarded + by the losers. The losing jurors are those, who did not vote, or did not + vote with the plurality, were denounced or did not reveal their vote. - `InflationSet` - The yearly inflation rate of the court system was set. +All things about Global Disputes Fix ⚠️ : + +- Add new dispatchable function: + - `refund_vote_fees` - Return all vote funds and fees, when a global dispute + was destroyed. +- Add the following events: + - `OutcomeOwnerRewarded` for `Possession::Paid` + - `OutcomeOwnersRewarded` for `Possession::Shared` + - `OutcomesFullyCleaned` and `OutcomesPartiallyCleaned` for extrinsic + `refund_vote_fees` +- Add enum `Possession` with variants: +- `Paid { owner: AccountId, fee: Balance }` +- `Shared { owners: BoundedVec }` +- `OutcomeInfo` has the following fields: + - `outcome_sum: Balance` + - `possession: Possession` +- Add `GdStatus` with the following enum variants: + - `Active { add_outcome_end: BlockNumber, vote_end: BlockNumber }` + - `Finished` + - `Destroyed` + ## v0.3.11 [#1049]: https://github.com/zeitgeistpm/zeitgeist/pull/1049 @@ -57,9 +97,10 @@ APIs/RPC interface. ### Changed - ⚠️ All tokens now use 10 fractional decimal places ([#1049]). -- Cross-consensus messages (XCM) assume the global canonical representation for token balances. -- The token metadata in the asset registry now assumes that the existential deposit and fee factor - are stored in base 10,000,000,000. +- Cross-consensus messages (XCM) assume the global canonical representation for + token balances. +- The token metadata in the asset registry now assumes that the existential + deposit and fee factor are stored in base 10,000,000,000. ## v0.3.10 @@ -70,6 +111,7 @@ APIs/RPC interface. - Use pallet-asset-tx-payment for allowing to pay transaction fees in foreign currencies ([#1022]). This requires each transaction to specify the fee payment token with `asset_id` (`None` is ZTG). + > > > > > > > chralt98-court-overhaul ## v0.3.9 @@ -81,6 +123,9 @@ APIs/RPC interface. - ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market` struct's layout has changed ([#903]). + + # v0.3.9 + - Adjust `deposit` function used to calculate storage fees for the following pallets: identity, multisig, preimage, proxy. The cost of adding an identity reduced from a minimum of 125 ZTG to a minimum of 1.5243 ZTG ([#1011]) @@ -250,8 +295,8 @@ APIs/RPC interface. - The `MarketCounter` of the `market-commons` pallet is incremented by one. This means that `MarketCounter` is now equal to the total number of markets ever created, instead of equal to the id of the last market created. For details - regarding this fix, see and - . + regarding this fix, see + and . - Made the `min_asset_amount_out` and `max_price` parameters of `swap_exact_amount_in` and the `max_asset_amount_in` and `max_price` diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 29a597379..05626c688 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -53,12 +53,14 @@ parameter_types! { // Global disputes parameters parameter_types! { + pub const AddOutcomePeriod: BlockNumber = 20; pub const GlobalDisputeLockId: LockIdentifier = *b"zge/vote"; pub const GlobalDisputesPalletId: PalletId = PalletId(*b"zge/gldp"); pub const MaxGlobalDisputeVotes: u32 = 50; pub const MaxOwners: u32 = 10; pub const MinOutcomeVoteAmount: Balance = 10 * CENT; pub const RemoveKeysLimit: u32 = 250; + pub const GdVotingPeriod: BlockNumber = 140; pub const VotingOutcomeFee: Balance = 100 * CENT; } @@ -70,8 +72,8 @@ parameter_types! { // Prediction Market parameters parameter_types! { pub const AdvisoryBond: Balance = 25 * CENT; - pub const DisputeBond: Balance = 20 * BASE; - pub const GlobalDisputePeriod: BlockNumber = 7 * BLOCKS_PER_DAY; + pub const DisputeBond: Balance = 5 * BASE; + pub const DisputeFactor: Balance = 2 * BASE; pub const MaxCategories: u16 = 10; pub const MaxDisputeDuration: BlockNumber = 50; pub const MaxDisputes: u16 = 6; diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 2c6973b0f..2ea872bfe 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -402,18 +402,20 @@ parameter_types! { parameter_types! { // Global Disputes + /// The time period in which the addition of new outcomes are allowed. + pub const AddOutcomePeriod: BlockNumber = BLOCKS_PER_DAY; /// Vote lock identifier, mainly used for the LockableCurrency on the native token. pub const GlobalDisputeLockId: LockIdentifier = GLOBAL_DISPUTES_LOCK_ID; /// Pallet identifier pub const GlobalDisputesPalletId: PalletId = GLOBAL_DISPUTES_PALLET_ID; - /// The period for a global dispute to end. - pub const GlobalDisputePeriod: BlockNumber = 3 * BLOCKS_PER_DAY; - /// The maximum number of owners for a voting outcome for private API calls of `push_voting_outcome`. + /// The maximum number of owners for a voting outcome for private API calls of `push_vote_outcome`. pub const MaxOwners: u32 = 10; /// The maximum number of market ids (participate in multiple different global disputes at the same time) for one account to vote on outcomes. pub const MaxGlobalDisputeVotes: u32 = 50; /// The minimum required amount to vote on an outcome. pub const MinOutcomeVoteAmount: Balance = 10 * BASE; + /// The time period in which votes are allowed. + pub const GdVotingPeriod: BlockNumber = 3 * BLOCKS_PER_DAY; /// The fee required to add a voting outcome. pub const VotingOutcomeFee: Balance = 200 * BASE; /// The remove limit for the Outcomes storage double map. diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index fbee213d1..c4309afe9 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -61,6 +61,8 @@ macro_rules! decl_common_types { // IMPORTANT that AddDisputeBond comes before MoveDataToSimpleDisputes!!! zrml_prediction_markets::migrations::AddDisputeBond, zrml_prediction_markets::migrations::MoveDataToSimpleDisputes, + // TODO check when to execute this migration and what happens for main-net, since global-disputes was only present on battery station + zrml_global_disputes::migrations::ModifyGlobalDisputesStructures, ); pub type Executive = frame_executive::Executive< @@ -1094,7 +1096,6 @@ macro_rules! impl_config_traits { type DisputeBond = DisputeBond; type RuntimeEvent = RuntimeEvent; type GlobalDisputes = GlobalDisputes; - type GlobalDisputePeriod = GlobalDisputePeriod; // LiquidityMining is currently unstable. // NoopLiquidityMining will be applied only to mainnet once runtimes are separated. type LiquidityMining = NoopLiquidityMining; @@ -1156,7 +1157,9 @@ macro_rules! impl_config_traits { } impl zrml_global_disputes::Config for Runtime { + type AddOutcomePeriod = AddOutcomePeriod; type Currency = Balances; + type DisputeResolution = zrml_prediction_markets::Pallet; type RuntimeEvent = RuntimeEvent; type GlobalDisputeLockId = GlobalDisputeLockId; type GlobalDisputesPalletId = GlobalDisputesPalletId; @@ -1165,6 +1168,7 @@ macro_rules! impl_config_traits { type MaxOwners = MaxOwners; type MinOutcomeVoteAmount = MinOutcomeVoteAmount; type RemoveKeysLimit = RemoveKeysLimit; + type GdVotingPeriod = GdVotingPeriod; type VotingOutcomeFee = VotingOutcomeFee; type WeightInfo = zrml_global_disputes::weights::WeightInfo; } diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 1418103f9..86d5ae74a 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -402,18 +402,20 @@ parameter_types! { parameter_types! { // Global Disputes + /// The time period in which the addition of new outcomes are allowed. + pub const AddOutcomePeriod: BlockNumber = BLOCKS_PER_DAY; /// Vote lock identifier, mainly used for the LockableCurrency on the native token. pub const GlobalDisputeLockId: LockIdentifier = GLOBAL_DISPUTES_LOCK_ID; /// Pallet identifier pub const GlobalDisputesPalletId: PalletId = GLOBAL_DISPUTES_PALLET_ID; - /// The period for a global dispute to end. - pub const GlobalDisputePeriod: BlockNumber = 7 * BLOCKS_PER_DAY; - /// The maximum number of owners for a voting outcome for private API calls of `push_voting_outcome`. + /// The maximum number of owners for a voting outcome for private API calls of `push_vote_outcome`. pub const MaxOwners: u32 = 10; /// The maximum number of market ids (participate in multiple different global disputes at the same time) for one account to vote on outcomes. pub const MaxGlobalDisputeVotes: u32 = 50; /// The minimum required amount to vote on an outcome. pub const MinOutcomeVoteAmount: Balance = 10 * BASE; + /// The time period in which votes are allowed. + pub const GdVotingPeriod: BlockNumber = 7 * BLOCKS_PER_DAY; /// The fee required to add a voting outcome. pub const VotingOutcomeFee: Balance = 200 * BASE; /// The remove limit for the Outcomes storage double map. diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index a9fbfcfdc..0a19a1576 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -402,12 +402,12 @@ mod pallet { /// The caller has not enough funds to join the court with the specified amount. AmountExceedsBalance, /// After the first join of the court the amount has to be equal or higher than the current stake. - /// This is to ensure the slashable amount in active court rounds + /// This is to ensure the slashable amount in active court rounds /// is still smaller or equal to the stake. /// It is also necessary to calculate the `unconsumed` stake properly. /// Otherwise a juror could just reduce the probability to get selected whenever they want. /// But this has to be done by `prepare_exit_court` and `exit_court`. - /// Additionally, the `join_court` and `delegate` extrinsics + /// Additionally, the `join_court` and `delegate` extrinsics /// use `extend_lock` and not `set_lock` or `remove_lock`. /// This means those extrinsics are not meant to get out, but only to get into the court. AmountBelowLastJoin, @@ -2319,39 +2319,50 @@ mod pallet { Error::::MarketDoesNotHaveCourtMechanism ); - let court_id = >::get(market_id) - .ok_or(Error::::MarketIdToCourtIdNotFound)?; - - let court = >::get(court_id).ok_or(Error::::CourtNotFound)?; + // oracle outcome is added by pm-pallet + let mut gd_outcomes: Vec> = + Vec::new(); - let report = market.report.as_ref().ok_or(Error::::MarketReportNotFound)?; - let oracle_outcome = &report.outcome; + let mut appeals_len = 0u32; + let mut draws_len = 0u32; - let appeals_len = court.appeals.len() as u32; - - let gd_outcomes = court - .appeals - .iter() - .filter_map(|a| { - match a.appealed_vote_item.clone().into_outcome() { - // oracle outcome is added by pm pallet - Some(outcome) if outcome != *oracle_outcome => Some(GlobalDisputeItem { - outcome, - // we have no better global dispute outcome owner - owner: Self::treasury_account_id(), - // initial vote amount - initial_vote_amount: >::zero(), - }), - _ => None, - } - }) - .collect::>>(); + // None case can happen if no dispute could be created, + // because there is not enough juror and delegator stake, + // in this case allow a global dispute + if let Some(court_id) = >::get(market_id) { + let court = >::get(court_id).ok_or(Error::::CourtNotFound)?; + + appeals_len = court.appeals.len() as u32; + + let report = market.report.as_ref().ok_or(Error::::MarketReportNotFound)?; + let oracle_outcome = &report.outcome; + + gd_outcomes = court + .appeals + .iter() + .filter_map(|a| { + match a.appealed_vote_item.clone().into_outcome() { + // oracle outcome is added by pm pallet + Some(outcome) if outcome != *oracle_outcome => { + Some(GlobalDisputeItem { + outcome, + // we have no better global dispute outcome owner + owner: Self::treasury_account_id(), + // initial vote amount + initial_vote_amount: >::zero(), + }) + } + _ => None, + } + }) + .collect::>>(); - let old_draws = SelectedDraws::::get(court_id); - let draws_len = old_draws.len() as u32; - Self::unlock_participants_from_last_draw(court_id, old_draws); - >::remove(court_id); - >::remove(court_id); + let old_draws = SelectedDraws::::get(court_id); + draws_len = old_draws.len() as u32; + Self::unlock_participants_from_last_draw(court_id, old_draws); + >::remove(court_id); + >::remove(court_id); + } let res = ResultWithWeightInfo { result: gd_outcomes, diff --git a/zrml/global-disputes/README.md b/zrml/global-disputes/README.md index b1bbf73fd..8417e2b42 100644 --- a/zrml/global-disputes/README.md +++ b/zrml/global-disputes/README.md @@ -32,11 +32,19 @@ on which the market finally resolves. get their reward. Fails if the global dispute is not concluded yet. - `reward_outcome_owner` - Reward the collected fees to the owner(s) of a voting outcome. Fails if not all outcomes are already purged. +- `refund_vote_fees` - Return all vote funds and fees, when a global dispute was + destroyed. #### Private Pallet API -- `push_voting_outcome` - Start a global dispute, add an initial voting outcome - and vote on it. +- `push_vote_outcome` - Add an initial voting outcome and vote on it with + `initial_vote_balance`. - `determine_voting_winner` - Determine the canonical voting outcome based on total locked tokens. -- `is_started` - Check if the global dispute started already. +- `does_exist` - Check if the global dispute does already exist. +- `is_active` - Check if the global dispute is active to get votes + (`vote_on_outcome`) and allow the addition of new voting outcomes with + `add_vote_outcome`. +- `start_global_dispute` - Start a global dispute. +- `destroy_global_dispute` - Allow the users to get their voting funds and fee + payments back. diff --git a/zrml/global-disputes/src/benchmarks.rs b/zrml/global-disputes/src/benchmarks.rs index 2fb52724b..cfa9c9a50 100644 --- a/zrml/global-disputes/src/benchmarks.rs +++ b/zrml/global-disputes/src/benchmarks.rs @@ -24,8 +24,8 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{ - global_disputes_pallet_api::GlobalDisputesPalletApi, types::*, BalanceOf, Call, Config, - Pallet as GlobalDisputes, *, + global_disputes_pallet_api::GlobalDisputesPalletApi, types::*, utils::market_mock, BalanceOf, + Call, Config, Pallet as GlobalDisputes, *, }; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; use frame_support::{ @@ -38,6 +38,7 @@ use num_traits::ops::checked::CheckedRem; use sp_runtime::traits::{Bounded, SaturatedConversion, Saturating}; use sp_std::prelude::*; use zeitgeist_primitives::types::OutcomeReport; +use zrml_market_commons::MarketCommonsPalletApi; fn deposit(caller: &T::AccountId) where @@ -53,8 +54,8 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { benchmarks! { vote_on_outcome { - // only Outcomes owners, but not Winners owners is present during vote_on_outcome - let o in 1..T::MaxOwners::get(); + // only Outcomes owners, but not GlobalDisputesInfo owners is present during vote_on_outcome + let o in 2..T::MaxOwners::get(); // ensure we have one vote left for the call let v in 0..(T::MaxGlobalDisputeVotes::get() - 1); @@ -63,20 +64,36 @@ benchmarks! { // ensure that we get the worst case // to actually insert the new item at the end of the binary search let market_id: MarketIdOf = v.into(); + let market = market_mock::(); + for i in 0..=v { + T::MarketCommons::push_market(market.clone()).unwrap(); + } + let outcome = OutcomeReport::Scalar(0); let amount: BalanceOf = T::MinOutcomeVoteAmount::get().saturated_into(); deposit::(&caller); + + let mut initial_items: Vec> = Vec::new(); + initial_items.push(InitialItem { + outcome: outcome.clone(), + owner: caller.clone(), + amount: 1_000_000_000u128.saturated_into(), + }); for i in 1..=o { let owner = account("outcomes_owner", i, 0); - GlobalDisputes::::push_voting_outcome( - &market_id, - outcome.clone(), - &owner, - 1_000_000_000u128.saturated_into(), - ) - .unwrap(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(i.saturated_into()), + owner, + amount: 1_000_000_000u128.saturated_into(), + }); } + GlobalDisputes::::start_global_dispute( + &market_id, + initial_items.as_slice(), + ) + .unwrap(); + let mut vote_locks: BoundedVec<( MarketIdOf, BalanceOf @@ -91,9 +108,18 @@ benchmarks! { // minus one to ensure, that we use the worst case // for using a new winner info after the vote_on_outcome call let vote_sum = amount - 1u128.saturated_into(); - let outcome_info = OutcomeInfo { outcome_sum: vote_sum, owners: Default::default() }; - let winner_info = WinnerInfo {outcome: outcome.clone(), is_finished: false, outcome_info}; - >::insert(market_id, winner_info); + let possession = Possession::Shared { owners: Default::default() }; + let outcome_info = OutcomeInfo { outcome_sum: vote_sum, possession }; + let now = >::block_number(); + let add_outcome_end = now + T::AddOutcomePeriod::get(); + let vote_end = add_outcome_end + T::GdVotingPeriod::get(); + let gd_info = GlobalDisputeInfo { + winner_outcome: outcome.clone(), + status: GdStatus::Active { add_outcome_end, vote_end }, + outcome_info, + }; + >::insert(market_id, gd_info); + >::set_block_number(add_outcome_end + 1u32.into()); }: _(RawOrigin::Signed(caller.clone()), market_id, outcome.clone(), amount) verify { assert_last_event::( @@ -119,10 +145,18 @@ benchmarks! { } let owners = BoundedVec::try_from(owners).unwrap(); let outcome = OutcomeReport::Scalar(0); - let outcome_info = OutcomeInfo { outcome_sum: vote_sum, owners }; + let possession = Possession::Shared { owners }; + let outcome_info = OutcomeInfo { outcome_sum: vote_sum, possession }; // is_finished is false, // because we need `lock_needed` to be greater zero to set a lock. - let winner_info = WinnerInfo {outcome, is_finished: false, outcome_info}; + let now = >::block_number(); + let add_outcome_end = now + T::AddOutcomePeriod::get(); + let vote_end = add_outcome_end + T::GdVotingPeriod::get(); + let gd_info = GlobalDisputeInfo { + winner_outcome: outcome, + status: GdStatus::Active { add_outcome_end, vote_end }, + outcome_info + }; let caller: T::AccountId = whitelisted_caller(); let voter: T::AccountId = account("voter", 0, 0); @@ -133,7 +167,7 @@ benchmarks! { let market_id: MarketIdOf = i.saturated_into(); let locked_balance: BalanceOf = i.saturated_into(); vote_locks.try_push((market_id, locked_balance)).unwrap(); - >::insert(market_id, winner_info.clone()); + >::insert(market_id, gd_info.clone()); } >::insert(voter.clone(), vote_locks.clone()); }: { @@ -159,10 +193,11 @@ benchmarks! { } let owners = BoundedVec::try_from(owners).unwrap(); let outcome = OutcomeReport::Scalar(0); - let outcome_info = OutcomeInfo { outcome_sum: vote_sum, owners }; + let possession = Possession::Shared { owners }; + let outcome_info = OutcomeInfo { outcome_sum: vote_sum, possession }; // is_finished is true, // because we need `lock_needed` to be zero to remove all locks. - let winner_info = WinnerInfo {outcome, is_finished: true, outcome_info}; + let gd_info = GlobalDisputeInfo {winner_outcome: outcome, status: GdStatus::Finished, outcome_info}; let caller: T::AccountId = whitelisted_caller(); let voter: T::AccountId = account("voter", 0, 0); @@ -175,7 +210,7 @@ benchmarks! { let market_id: MarketIdOf = i.saturated_into(); let locked_balance: BalanceOf = 1u128.saturated_into(); vote_locks.try_push((market_id, locked_balance)).unwrap(); - >::insert(market_id, winner_info.clone()); + >::insert(market_id, gd_info.clone()); } >::insert(voter.clone(), vote_locks); }: { @@ -192,48 +227,59 @@ benchmarks! { add_vote_outcome { // concious decision for using component 0..MaxOwners here // because although we check that is_finished is false, - // Winners counts processing time for the decoding of the owners vector. - // then if the owner information is not present on Winners, + // GlobalDisputesInfo counts processing time for the decoding of the owners vector. + // then if the owner information is not present on GlobalDisputesInfo, // the owner info is present on Outcomes // this happens in the case, that Outcomes is not none at the query time. let w in 1..T::MaxOwners::get(); - let mut owners = Vec::new(); + let mut owners: Vec> = Vec::new(); for i in 1..=w { - let owner = account("winners_owner", i, 0); + let owner: AccountIdOf = account("winners_owner", i, 0); owners.push(owner); } - let owners = BoundedVec::try_from(owners).unwrap(); - let outcome_info = OutcomeInfo { outcome_sum: 42u128.saturated_into(), owners }; - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(0), - is_finished: false, + let owners: BoundedVec, T::MaxOwners> = BoundedVec::try_from(owners) + .unwrap(); + + let possession = Possession::Shared { owners }; + let outcome_info = OutcomeInfo { outcome_sum: 42u128.saturated_into(), possession: possession.clone() }; + let now = >::block_number(); + let add_outcome_end = now + T::AddOutcomePeriod::get(); + let vote_end = add_outcome_end + T::GdVotingPeriod::get(); + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(0), + status: GdStatus::Active { add_outcome_end, vote_end }, outcome_info, }; let caller: T::AccountId = whitelisted_caller(); let market_id: MarketIdOf = 0u128.saturated_into(); + let market = market_mock::(); + T::MarketCommons::push_market(market).unwrap(); let outcome = OutcomeReport::Scalar(20); - >::insert(market_id, winner_info); + >::insert(market_id, gd_info); deposit::(&caller); }: _(RawOrigin::Signed(caller.clone()), market_id, outcome.clone()) verify { assert_last_event::(Event::AddedVotingOutcome:: { market_id, - owner: caller, + owner: caller.clone(), outcome: outcome.clone(), }.into()); - let winner_info = >::get(market_id).unwrap(); - assert_eq!(winner_info.outcome_info.outcome_sum, T::VotingOutcomeFee::get()); - // zero owners as long as dispute not finished and reward_outcome_owner not happened - assert_eq!(winner_info.outcome_info.owners.len(), 0usize); + let gd_info = >::get(market_id).unwrap(); + assert_eq!(gd_info.outcome_info.outcome_sum, T::VotingOutcomeFee::get()); + // None as long as dispute not finished and reward_outcome_owner not happened + assert_eq!(gd_info.outcome_info.possession, possession); let outcomes_item = >::get(market_id, outcome).unwrap(); assert_eq!(outcomes_item.outcome_sum, T::VotingOutcomeFee::get()); - assert_eq!(outcomes_item.owners.len(), 1usize); + assert_eq!( + outcomes_item.possession, + Possession::Paid { owner: caller, fee: T::VotingOutcomeFee::get() }, + ); } - reward_outcome_owner_with_funds { + reward_outcome_owner_shared_possession { let o in 1..T::MaxOwners::get(); let market_id: MarketIdOf = 0u128.saturated_into(); @@ -244,16 +290,16 @@ benchmarks! { owners_vec.push(owner); } let owners = BoundedVec::try_from(owners_vec.clone()).unwrap(); - - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(0), - is_finished: true, + let possession = Possession::Shared { owners }; + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(0), + status: GdStatus::Finished, outcome_info: OutcomeInfo { outcome_sum: 42u128.saturated_into(), - owners, + possession, }, }; - >::insert(market_id, winner_info.clone()); + >::insert(market_id, gd_info.clone()); let reward_account = GlobalDisputes::::reward_account(&market_id); let _ = T::Currency::deposit_creating( @@ -274,7 +320,7 @@ benchmarks! { ) .unwrap(); } verify { - assert!(winner_info.outcome_info.owners.len() == o as usize); + assert!(gd_info.outcome_info.possession.get_shared_owners().unwrap().len() == o as usize); assert_last_event::( Event::OutcomeOwnersRewarded:: { market_id, @@ -291,10 +337,76 @@ benchmarks! { assert_eq!(T::Currency::free_balance(&reward_account), expected); } - reward_outcome_owner_no_funds { + reward_outcome_owner_paid_possession { + let market_id: MarketIdOf = 0u128.saturated_into(); + + let owner: AccountIdOf = account("winners_owner", 0, 0); + let possession = Possession::Paid { owner: owner.clone(), fee: T::VotingOutcomeFee::get() }; + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(0), + status: GdStatus::Finished, + outcome_info: OutcomeInfo { + outcome_sum: 42u128.saturated_into(), + possession, + }, + }; + >::insert(market_id, gd_info); + + let reward_account = GlobalDisputes::::reward_account(&market_id); + let _ = T::Currency::deposit_creating( + &reward_account, + T::VotingOutcomeFee::get().saturating_mul(10u128.saturated_into()), + ); + let reward_before = T::Currency::free_balance(&reward_account); + + let caller: T::AccountId = whitelisted_caller(); + + let outcome = OutcomeReport::Scalar(20); + + deposit::(&caller); + }: { + >::reward_outcome_owner( + RawOrigin::Signed(caller.clone()).into(), + market_id + ) + .unwrap(); + } verify { + assert_last_event::( + Event::OutcomeOwnerRewarded:: { + market_id, + owner: owner.clone(), + } + .into(), + ); + assert!(T::Currency::free_balance(&reward_account) == 0u128.saturated_into()); + } + + purge_outcomes { + // RemoveKeysLimit - 2 to ensure that we actually fully clean and return at the end + // at least two voting outcomes + let k in 2..(T::RemoveKeysLimit::get() - 2); + let o in 1..T::MaxOwners::get(); let market_id: MarketIdOf = 0u128.saturated_into(); + let market = market_mock::(); + T::MarketCommons::push_market(market).unwrap(); + + let mut initial_items: Vec> = Vec::new(); + for i in 1..=k { + let owner = account("outcomes_owner", i, 0); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(i.into()), + owner, + amount: 1_000_000_000u128.saturated_into(), + }); + } + + GlobalDisputes::::start_global_dispute( + &market_id, + initial_items.as_slice(), + ) + .unwrap(); let mut owners = Vec::new(); for i in 1..=o { @@ -302,51 +414,61 @@ benchmarks! { owners.push(owner); } let owners = BoundedVec::try_from(owners.clone()).unwrap(); + let winner_outcome = OutcomeReport::Scalar(0); - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(0), - is_finished: true, - outcome_info: OutcomeInfo { - outcome_sum: 42u128.saturated_into(), - owners, - }, + let possession = Possession::Shared { owners }; + let outcome_info = OutcomeInfo { + outcome_sum: 42u128.saturated_into(), + possession, }; - >::insert(market_id, winner_info); + >::insert(market_id, winner_outcome.clone(), outcome_info); + + let possession = Possession::Shared { owners: Default::default() }; + let outcome_info = OutcomeInfo { + outcome_sum: 42u128.saturated_into(), + possession, + }; + let gd_info = GlobalDisputeInfo {winner_outcome, status: GdStatus::Finished, outcome_info}; + >::insert(market_id, gd_info); let caller: T::AccountId = whitelisted_caller(); let outcome = OutcomeReport::Scalar(20); - let reward_account = GlobalDisputes::::reward_account(&market_id); - assert!(T::Currency::free_balance(&reward_account) == 0u128.saturated_into()); - deposit::(&caller); - }: { - >::reward_outcome_owner(RawOrigin::Signed(caller.clone()).into(), market_id) - .unwrap(); - } verify { - assert_last_event::(Event::OutcomeOwnersRewardedWithNoFunds:: { market_id }.into()); + }: _(RawOrigin::Signed(caller.clone()), market_id) + verify { + assert!(>::iter_prefix(market_id).next().is_none()); + assert_last_event::(Event::OutcomesFullyCleaned:: { market_id }.into()); } - purge_outcomes { + refund_vote_fees { // RemoveKeysLimit - 2 to ensure that we actually fully clean and return at the end - let k in 1..(T::RemoveKeysLimit::get() - 2); + // at least two voting outcomes + let k in 2..(T::RemoveKeysLimit::get() - 2); let o in 1..T::MaxOwners::get(); let market_id: MarketIdOf = 0u128.saturated_into(); + let market = market_mock::(); + T::MarketCommons::push_market(market).unwrap(); + let mut initial_items: Vec> = Vec::new(); for i in 1..=k { let owner = account("outcomes_owner", i, 0); - GlobalDisputes::::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(i.into()), - &owner, - 1_000_000_000u128.saturated_into(), - ) - .unwrap(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(i.into()), + owner, + amount: 1_000_000_000u128.saturated_into(), + }); } + GlobalDisputes::::start_global_dispute( + &market_id, + initial_items.as_slice(), + ) + .unwrap(); + let mut owners = Vec::new(); for i in 1..=o { let owner = account("winners_owner", i, 0); @@ -355,18 +477,20 @@ benchmarks! { let owners = BoundedVec::try_from(owners.clone()).unwrap(); let winner_outcome = OutcomeReport::Scalar(0); + let possession = Possession::Shared { owners }; let outcome_info = OutcomeInfo { outcome_sum: 42u128.saturated_into(), - owners + possession, }; >::insert(market_id, winner_outcome.clone(), outcome_info); + let possession = Possession::Shared { owners: Default::default() }; let outcome_info = OutcomeInfo { outcome_sum: 42u128.saturated_into(), - owners: Default::default() + possession, }; - let winner_info = WinnerInfo {outcome: winner_outcome, is_finished: true, outcome_info}; - >::insert(market_id, winner_info); + let gd_info = GlobalDisputeInfo {winner_outcome, status: GdStatus::Destroyed, outcome_info}; + >::insert(market_id, gd_info); let caller: T::AccountId = whitelisted_caller(); diff --git a/zrml/global-disputes/src/global_disputes_pallet_api.rs b/zrml/global-disputes/src/global_disputes_pallet_api.rs index 26682c768..28dc58e5e 100644 --- a/zrml/global-disputes/src/global_disputes_pallet_api.rs +++ b/zrml/global-disputes/src/global_disputes_pallet_api.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -17,46 +17,32 @@ extern crate alloc; -use alloc::vec::Vec; -use sp_runtime::DispatchResult; +use crate::types::InitialItem; +use sp_runtime::DispatchError; use zeitgeist_primitives::types::OutcomeReport; /// The trait to initiate and resolve the global disputes. -pub trait GlobalDisputesPalletApi { - /// Push a voting outcome for one global dispute. - /// - /// # Arguments - /// - `market_id` - The id of the market. - /// - `outcome` - The voting outcome to push. - /// - `owner` - The owner of the outcome. - /// - `initial_vote_balance` - The initial vote amount for the specified outcome. - /// - /// # Returns - /// - /// Returns the dispute mechanism's report if available, otherwise `None`. If `None` is - /// returned, this means that the dispute could not be resolved. - fn push_voting_outcome( - market_id: &MarketId, - outcome: OutcomeReport, - owner: &AccountId, - initial_vote_balance: Balance, - ) -> DispatchResult; +pub trait GlobalDisputesPalletApi { + /// Return the `AddOutcomePeriod` parameter. + fn get_add_outcome_period() -> BlockNumber; + + /// Return the `GdVotingPeriod` parameter. + fn get_vote_period() -> BlockNumber; - /// Get the information about a voting outcome for a global dispute. + /// Start a global dispute. /// /// # Arguments /// - `market_id` - The id of the market. - /// - `outcome` - The voting outcome to get. - /// - /// # Returns - /// - /// Returns the information stored for a particular outcome. - /// - outcome_sum - The current sum of all locks on this outcome. - /// - owners - The vector of owners of the outcome. - fn get_voting_outcome_info( + /// - `initial_items` - The initial vote options (outcome, owner, amount) + /// to add to the global dispute. One initial item consists of the vote outcome, + /// the owner of the outcome who is rewarded in case of a win, + /// and the initial vote amount for this outcome. + /// It is required to add at least two unique outcomes. + /// In case of a duplicated outcome, the owner and amount is added to the pre-existing outcome. + fn start_global_dispute( market_id: &MarketId, - outcome: &OutcomeReport, - ) -> Option<(Balance, Vec)>; + initial_items: &[InitialItem], + ) -> Result; /// Determine the winner of a global dispute. /// @@ -68,17 +54,19 @@ pub trait GlobalDisputesPalletApi { /// Returns the winning outcome. fn determine_voting_winner(market_id: &MarketId) -> Option; - /// Check if global dispute started. + /// Check if a global dispute exists for the specified market. + fn does_exist(market_id: &MarketId) -> bool; + + /// Check if global dispute is active. + /// This call is useful to check if a global dispute is ready for a destruction. /// /// # Arguments /// - `market_id` - The id of the market. - fn is_started(market_id: &MarketId) -> bool; + fn is_active(market_id: &MarketId) -> bool; - /// Check if a global dispute has not already been started. + /// Destroy a global dispute and allow to return all funds of the participants. /// /// # Arguments /// - `market_id` - The id of the market. - fn is_not_started(market_id: &MarketId) -> bool { - !Self::is_started(market_id) - } + fn destroy_global_dispute(market_id: &MarketId) -> Result<(), DispatchError>; } diff --git a/zrml/global-disputes/src/lib.rs b/zrml/global-disputes/src/lib.rs index e5968f693..e2ba21e7e 100644 --- a/zrml/global-disputes/src/lib.rs +++ b/zrml/global-disputes/src/lib.rs @@ -18,19 +18,26 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + mod benchmarks; mod global_disputes_pallet_api; +pub mod migrations; mod mock; mod tests; pub mod types; +mod utils; pub mod weights; pub use global_disputes_pallet_api::GlobalDisputesPalletApi; pub use pallet::*; +pub type PossessionOf = crate::types::Possession, BalanceOf, OwnerInfoOf>; +pub type InitialItemOf = crate::types::InitialItem, BalanceOf>; + #[frame_support::pallet] mod pallet { - use crate::{types::*, weights::WeightInfoZeitgeist, GlobalDisputesPalletApi}; + use crate::{types::*, weights::WeightInfoZeitgeist, GlobalDisputesPalletApi, InitialItemOf}; use core::marker::PhantomData; use frame_support::{ ensure, log, @@ -40,26 +47,63 @@ mod pallet { sp_runtime::traits::StaticLookup, traits::{ Currency, ExistenceRequirement, Get, IsType, LockIdentifier, LockableCurrency, - WithdrawReasons, + StorageVersion, WithdrawReasons, }, Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use sp_runtime::{ traits::{AccountIdConversion, CheckedDiv, Saturating, Zero}, - DispatchResult, + DispatchError, DispatchResult, }; use sp_std::{vec, vec::Vec}; - use zeitgeist_primitives::types::OutcomeReport; + use zeitgeist_primitives::{traits::DisputeResolutionApi, types::OutcomeReport}; use zrml_market_commons::MarketCommonsPalletApi; + pub(crate) type BalanceOf = <::Currency as Currency>>::Balance; + pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; + pub(crate) type MarketIdOf = + <::MarketCommons as MarketCommonsPalletApi>::MarketId; + + pub type AccountIdOf = ::AccountId; + + pub(crate) type OwnerInfoOf = BoundedVec, ::MaxOwners>; + pub type OutcomeInfoOf = OutcomeInfo, BalanceOf, OwnerInfoOf>; + pub type GlobalDisputeInfoOf = GlobalDisputeInfo< + AccountIdOf, + BalanceOf, + OwnerInfoOf, + ::BlockNumber, + >; + + type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; + pub type LockInfoOf = + BoundedVec<(MarketIdOf, BalanceOf), ::MaxGlobalDisputeVotes>; + + // TODO(#968): to remove after the storage migration + pub type WinnerInfoOf = OldWinnerInfo, OwnerInfoOf>; + + /// The current storage version. + const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + #[pallet::config] pub trait Config: frame_system::Config { + /// The time period in which the addition of new outcomes are allowed. + #[pallet::constant] + type AddOutcomePeriod: Get; + /// The currency implementation used to lock tokens for voting. type Currency: LockableCurrency; type RuntimeEvent: From> + IsType<::RuntimeEvent>; + type DisputeResolution: DisputeResolutionApi< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; + /// The vote lock identifier. #[pallet::constant] type GlobalDisputeLockId: Get; @@ -69,17 +113,21 @@ mod pallet { type GlobalDisputesPalletId: Get; /// To reference the market id type. - type MarketCommons: MarketCommonsPalletApi; + type MarketCommons: MarketCommonsPalletApi< + AccountId = Self::AccountId, + Currency = Self::Currency, + BlockNumber = Self::BlockNumber, + >; /// The maximum numbers of distinct markets /// on which one account can simultaneously vote on outcomes. - /// Otherwise users can just keep voting on different global disputes and never unlock. /// When the user unlocks, the user has again `MaxGlobalDisputeVotes` number of votes. + /// This constant is useful to limit the number of for-loop iterations (weight constraints). #[pallet::constant] type MaxGlobalDisputeVotes: Get; /// The maximum number of owners - /// for a voting outcome for private API calls of `push_voting_outcome`. + /// for a voting outcome for private API calls of `push_vote_outcome`. #[pallet::constant] type MaxOwners: Get; @@ -91,6 +139,10 @@ mod pallet { #[pallet::constant] type RemoveKeysLimit: Get; + /// The time period in which votes are allowed. + #[pallet::constant] + type GdVotingPeriod: Get; + /// The fee required to add a voting outcome. #[pallet::constant] type VotingOutcomeFee: Get>; @@ -98,19 +150,8 @@ mod pallet { type WeightInfo: WeightInfoZeitgeist; } - pub(crate) type BalanceOf = <::Currency as Currency>>::Balance; - pub(crate) type MarketIdOf = - <::MarketCommons as MarketCommonsPalletApi>::MarketId; - pub type AccountIdOf = ::AccountId; - - pub type OutcomeInfoOf = OutcomeInfo, OwnerInfoOf>; - pub type WinnerInfoOf = WinnerInfo, OwnerInfoOf>; - type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; - type OwnerInfoOf = BoundedVec, ::MaxOwners>; - pub type LockInfoOf = - BoundedVec<(MarketIdOf, BalanceOf), ::MaxGlobalDisputeVotes>; - #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(PhantomData); /// All highest lock information (vote id, outcome index and locked balance) @@ -134,7 +175,12 @@ mod pallet { >; /// Maps the market id to all information - /// about the winner outcome and if the global dispute is finished. + /// about the global dispute. + #[pallet::storage] + pub type GlobalDisputesInfo = + StorageMap<_, Twox64Concat, MarketIdOf, GlobalDisputeInfoOf, OptionQuery>; + + // TODO(#986): to remove after the storage migration #[pallet::storage] pub type Winners = StorageMap<_, Twox64Concat, MarketIdOf, WinnerInfoOf, OptionQuery>; @@ -153,10 +199,10 @@ mod pallet { }, /// The winner of the global dispute system is determined. GlobalDisputeWinnerDetermined { market_id: MarketIdOf }, - /// No funds could be spent as reward to the outcome owner(s). - OutcomeOwnersRewardedWithNoFunds { market_id: MarketIdOf }, - /// The outcome owner has been rewarded. + /// The outcome owners have been rewarded. OutcomeOwnersRewarded { market_id: MarketIdOf, owners: Vec> }, + /// The outcome owner has been rewarded. + OutcomeOwnerRewarded { market_id: MarketIdOf, owner: AccountIdOf }, /// The outcomes storage item is partially cleaned. OutcomesPartiallyCleaned { market_id: MarketIdOf }, /// The outcomes storage item is fully cleaned. @@ -172,26 +218,40 @@ mod pallet { #[pallet::error] pub enum Error { - /// Sender tried to vote with an amount below a defined minium. + /// Sender tried to vote with an amount below a defined minimum. AmountTooLow, - /// The global dispute period is already over and the winner is determined. - GlobalDisputeAlreadyFinished, + /// The global dispute status is invalid for this operation. + InvalidGlobalDisputeStatus, /// Sender does not have enough funds for the vote on an outcome. InsufficientAmount, /// The maximum amount of owners is reached. MaxOwnersReached, + /// The maximum number of votes for this account is reached. + MaxVotesReached, + /// The amount in the reward pot is zero. + NoFundsToReward, /// No global dispute present at the moment. - NoGlobalDisputeStarted, + GlobalDisputeNotFound, /// The voting outcome has been already added. OutcomeAlreadyExists, /// The outcome specified is not present in the voting outcomes. OutcomeDoesNotExist, - /// The global dispute period is not over yet. The winner is not yet determined. - UnfinishedGlobalDispute, - /// The maximum number of votes for this account is reached. - MaxVotesReached, + /// Submitted outcome does not match market type. + OutcomeMismatch, /// The outcomes are not fully cleaned yet. OutcomesNotFullyCleaned, + /// Only a shared possession is allowed. + SharedPossessionRequired, + /// The global dispute period is not over yet. The winner is not yet determined. + UnfinishedGlobalDispute, + /// The period in which outcomes can be added is over. + AddOutcomePeriodIsOver, + /// It is not inside the period in which votes are allowed. + NotInGdVotingPeriod, + /// The operation requires a global dispute in a destroyed state. + GlobalDisputeNotDestroyed, + /// The global dispute was already started. + GlobalDisputeAlreadyExists, } #[pallet::call] @@ -219,9 +279,17 @@ mod pallet { ) -> DispatchResultWithPostInfo { let owner = ensure_signed(origin)?; - let winner_info = - >::get(market_id).ok_or(Error::::NoGlobalDisputeStarted)?; - ensure!(!winner_info.is_finished, Error::::GlobalDisputeAlreadyFinished); + let market = T::MarketCommons::market(&market_id)?; + ensure!(market.matches_outcome_report(&outcome), Error::::OutcomeMismatch); + + let gd_info = + >::get(market_id).ok_or(Error::::GlobalDisputeNotFound)?; + let now = >::block_number(); + if let GdStatus::Active { add_outcome_end, vote_end: _ } = gd_info.status { + ensure!(now <= add_outcome_end, Error::::AddOutcomePeriodIsOver); + } else { + return Err(Error::::InvalidGlobalDisputeStatus.into()); + } ensure!( !>::contains_key(market_id, &outcome), @@ -230,17 +298,20 @@ mod pallet { let voting_outcome_fee = T::VotingOutcomeFee::get(); - Self::push_voting_outcome(&market_id, outcome.clone(), &owner, voting_outcome_fee)?; - let reward_account = Self::reward_account(&market_id); T::Currency::transfer( &owner, &reward_account, voting_outcome_fee, - ExistenceRequirement::AllowDeath, + ExistenceRequirement::KeepAlive, )?; + let possession = Possession::Paid { owner: owner.clone(), fee: voting_outcome_fee }; + let outcome_info = OutcomeInfo { outcome_sum: voting_outcome_fee, possession }; + Self::update_winner(&market_id, &outcome, outcome_info.clone()); + >::insert(market_id, outcome.clone(), outcome_info); + Self::deposit_event(Event::AddedVotingOutcome { market_id, owner, outcome }); // charge weight for successfully have no owners in Winners // this is the case, because owners are not inserted @@ -248,6 +319,64 @@ mod pallet { Ok((Some(T::WeightInfo::add_vote_outcome(0u32))).into()) } + /// Return the voting outcome fees in case the global dispute was destroyed. + /// + /// # Arguments + /// + /// - `market_id`: The id of the market. + /// + /// # Weight + /// + /// Complexity: `O(n)`, + /// where `n` is the number of all existing outcomes for a global dispute. + #[pallet::call_index(5)] + #[pallet::weight(T::WeightInfo::refund_vote_fees( + T::RemoveKeysLimit::get(), + T::MaxOwners::get(), + ))] + #[frame_support::transactional] + pub fn refund_vote_fees( + origin: OriginFor, + #[pallet::compact] market_id: MarketIdOf, + ) -> DispatchResultWithPostInfo { + ensure_signed(origin)?; + + let gd_info = + >::get(market_id).ok_or(Error::::GlobalDisputeNotFound)?; + ensure!(gd_info.status == GdStatus::Destroyed, Error::::GlobalDisputeNotDestroyed); + + let mut owners_len = 0u32; + let mut removed_keys_amount = 0u32; + for (_, outcome_info) in + >::drain_prefix(market_id).take(T::RemoveKeysLimit::get() as usize) + { + match outcome_info.possession { + Possession::Paid { owner, fee } => { + let res = T::Currency::transfer( + &Self::reward_account(&market_id), + &owner, + fee, + ExistenceRequirement::AllowDeath, + ); + debug_assert!(res.is_ok()); + } + Possession::Shared { owners } => { + owners_len = owners_len.saturating_add(owners.len() as u32); + } + } + removed_keys_amount = removed_keys_amount.saturating_add(1u32); + } + + if >::iter_prefix(market_id).next().is_none() { + Self::deposit_event(Event::OutcomesFullyCleaned { market_id }); + } else { + Self::deposit_event(Event::OutcomesPartiallyCleaned { market_id }); + } + + // weight for max owners, because we don't know + Ok((Some(T::WeightInfo::refund_vote_fees(removed_keys_amount, owners_len))).into()) + } + /// Purge all outcomes to allow the winning outcome owner(s) to get their reward. /// Fails if the global dispute is not concluded yet. /// @@ -271,28 +400,31 @@ mod pallet { ) -> DispatchResultWithPostInfo { ensure_signed(origin)?; - let mut winner_info = - >::get(market_id).ok_or(Error::::NoGlobalDisputeStarted)?; - ensure!(winner_info.is_finished, Error::::UnfinishedGlobalDispute); + let mut gd_info = + >::get(market_id).ok_or(Error::::GlobalDisputeNotFound)?; + ensure!(gd_info.status == GdStatus::Finished, Error::::UnfinishedGlobalDispute); let winning_outcome: Option> = - >::get(market_id, &winner_info.outcome); + >::take(market_id, &gd_info.winner_outcome); let mut owners_len = 0u32; - // move the winning outcome info to Winners before it gets drained + // move the winning outcome info to GlobalDisputesInfo before it gets drained if let Some(outcome_info) = winning_outcome { - owners_len = outcome_info.owners.len() as u32; - // storage write is needed here in case, - // that the first call of reward_outcome_owner doesn't reward the owners - // this can happen if there are more than RemoveKeysLimit keys to remove - winner_info.outcome_info = outcome_info; - >::insert(market_id, winner_info); + if let Possession::Shared { owners } = &outcome_info.possession { + owners_len = owners.len() as u32; + } + // storage write is needed in case to save the owners + // of the winning outcome before they are drained + gd_info.outcome_info = outcome_info; + >::insert(market_id, gd_info); } let mut removed_keys_amount = 0u32; - for (_, i) in + for (_, outcome_info) in >::drain_prefix(market_id).take(T::RemoveKeysLimit::get() as usize) { - owners_len = owners_len.max(i.owners.len() as u32); + if let Possession::Shared { owners } = outcome_info.possession { + owners_len = owners_len.saturating_add(owners.len() as u32); + } removed_keys_amount = removed_keys_amount.saturating_add(1u32); } @@ -317,11 +449,8 @@ mod pallet { /// /// Complexity: `O(n)`, where `n` is the number of owners for the winning outcome. #[pallet::call_index(2)] - #[pallet::weight( - T::WeightInfo::reward_outcome_owner_no_funds(T::MaxOwners::get()).max( - T::WeightInfo::reward_outcome_owner_with_funds(T::MaxOwners::get()), - ) - )] + #[pallet::weight(T::WeightInfo::reward_outcome_owner_paid_possession() + .max(T::WeightInfo::reward_outcome_owner_shared_possession(T::MaxOwners::get())))] #[frame_support::transactional] pub fn reward_outcome_owner( origin: OriginFor, @@ -334,56 +463,28 @@ mod pallet { >::OutcomesNotFullyCleaned ); - let winner_info = - >::get(market_id).ok_or(Error::::NoGlobalDisputeStarted)?; - ensure!(winner_info.is_finished, Error::::UnfinishedGlobalDispute); + let gd_info = + >::get(market_id).ok_or(Error::::GlobalDisputeNotFound)?; + ensure!(gd_info.status == GdStatus::Finished, Error::::UnfinishedGlobalDispute); let reward_account = Self::reward_account(&market_id); let reward_account_free_balance = T::Currency::free_balance(&reward_account); - let owners_len = winner_info.outcome_info.owners.len() as u32; - - if reward_account_free_balance.is_zero() { - Self::deposit_event(Event::OutcomeOwnersRewardedWithNoFunds { market_id }); - // return early case if there is no reward - return Ok((Some(T::WeightInfo::reward_outcome_owner_no_funds(owners_len))).into()); - } - - let mut remainder = reward_account_free_balance; - let owners_len_in_balance: BalanceOf = >::from(owners_len); - if let Some(reward_per_each) = - reward_account_free_balance.checked_div(&owners_len_in_balance) - { - for winner in winner_info.outcome_info.owners.iter() { - // *Should* always be equal to `reward_per_each` - let reward = remainder.min(reward_per_each); - remainder = remainder.saturating_sub(reward); - // Reward the loosing funds to the winners - let res = T::Currency::transfer( - &reward_account, - winner, - reward, - ExistenceRequirement::AllowDeath, - ); - // not really much we can do if it fails - debug_assert!( - res.is_ok(), - "Global Disputes: Rewarding a outcome owner failed." - ); - } - } else { - log::error!( - "Global Disputes: There should be always at least one owner for a voting \ - outcome." - ); - debug_assert!(false); + ensure!(!reward_account_free_balance.is_zero(), Error::::NoFundsToReward); + + match gd_info.outcome_info.possession { + Possession::Shared { owners } => Self::reward_shared_possession( + market_id, + reward_account, + reward_account_free_balance, + owners, + ), + Possession::Paid { owner, fee: _ } => Self::reward_paid_possession( + market_id, + reward_account, + reward_account_free_balance, + owner, + ), } - - Self::deposit_event(Event::OutcomeOwnersRewarded { - market_id, - owners: winner_info.outcome_info.owners.to_vec(), - }); - - Ok((Some(T::WeightInfo::reward_outcome_owner_with_funds(owners_len))).into()) } /// Vote on existing voting outcomes by locking native tokens. @@ -416,13 +517,21 @@ mod pallet { ensure!(amount <= voter_free_balance, Error::::InsufficientAmount); ensure!(amount >= T::MinOutcomeVoteAmount::get(), Error::::AmountTooLow); - let winner_info = - >::get(market_id).ok_or(Error::::NoGlobalDisputeStarted)?; - ensure!(!winner_info.is_finished, Error::::GlobalDisputeAlreadyFinished); + let gd_info = + >::get(market_id).ok_or(Error::::GlobalDisputeNotFound)?; + let now = >::block_number(); + if let GdStatus::Active { add_outcome_end, vote_end } = gd_info.status { + ensure!(add_outcome_end < now && now <= vote_end, Error::::NotInGdVotingPeriod); + } else { + return Err(Error::::InvalidGlobalDisputeStatus.into()); + } let mut outcome_info = >::get(market_id, &outcome).ok_or(Error::::OutcomeDoesNotExist)?; - let outcome_owners_len = outcome_info.owners.len() as u32; + let outcome_owners_len = match outcome_info.possession { + Possession::Shared { ref owners } => owners.len() as u32, + Possession::Paid { .. } => 1u32, + }; // The `outcome_sum` never decreases (only increases) to allow // caching the outcome with the highest `outcome_sum`. @@ -431,7 +540,7 @@ mod pallet { // than the second highest `outcome_sum`. let add_to_outcome_sum = |a| { outcome_info.outcome_sum = outcome_info.outcome_sum.saturating_add(a); - Self::update_winner(&market_id, &outcome, outcome_info.outcome_sum); + Self::update_winner(&market_id, &outcome, outcome_info.clone()); >::insert(market_id, &outcome, outcome_info); }; @@ -475,7 +584,7 @@ mod pallet { Ok(Some(T::WeightInfo::vote_on_outcome(outcome_owners_len, vote_lock_counter)).into()) } - /// Return all locked native tokens in a global dispute. + /// Return all locked native tokens from a finished or destroyed global dispute. /// Fails if the global dispute is not concluded yet. /// /// # Arguments @@ -509,13 +618,13 @@ mod pallet { let mut lock_info = >::get(&voter); let vote_lock_counter = lock_info.len() as u32; // Inside retain we follow these rules: - // 1. Remove all locks from resolved (/ finished) global disputes. + // 1. Remove all locks from resolved (/ finished / destroyed) global disputes. // 2. Then find the maximum lock from all unresolved global disputes. lock_info.retain(|&(market_id, locked_balance)| { // weight component MaxOwners comes from querying the winner information - match >::get(market_id) { - Some(winner_info) => { - if winner_info.is_finished { + match >::get(market_id) { + Some(gd_info) => { + if matches!(gd_info.status, GdStatus::Finished | GdStatus::Destroyed) { false } else { lock_needed = lock_needed.max(locked_balance); @@ -567,79 +676,110 @@ mod pallet { T::GlobalDisputesPalletId::get().into_sub_account_truncating(market_id) } - fn update_winner(market_id: &MarketIdOf, outcome: &OutcomeReport, amount: BalanceOf) { - >::mutate(market_id, |highest: &mut Option>| { - *highest = Some(highest.clone().map_or( - WinnerInfo::new(outcome.clone(), amount), - |prev_winner_info| { - if amount >= prev_winner_info.outcome_info.outcome_sum { - WinnerInfo::new(outcome.clone(), amount) - } else { - prev_winner_info - } - }, - )); + fn update_winner( + market_id: &MarketIdOf, + outcome: &OutcomeReport, + outcome_info: OutcomeInfoOf, + ) { + let amount = outcome_info.outcome_sum; + >::mutate( + market_id, + |highest: &mut Option>| { + *highest = Some(highest.clone().map_or( + // if never a highest was present set the first here + GlobalDisputeInfo::new(outcome.clone(), outcome_info.possession, amount), + |mut prev_gd_info| { + if amount >= prev_gd_info.outcome_info.outcome_sum { + prev_gd_info.update_winner(outcome.clone(), amount); + prev_gd_info + } else { + prev_gd_info + } + }, + )); + }, + ); + } + + fn reward_shared_possession( + market_id: MarketIdOf, + reward_account: AccountIdOf, + reward: BalanceOf, + owners: OwnerInfoOf, + ) -> DispatchResultWithPostInfo { + let mut remainder = reward; + let owners_len = owners.len() as u32; + let owners_len_in_balance: BalanceOf = >::from(owners_len); + if let Some(reward_per_each) = reward.checked_div(&owners_len_in_balance) { + for winner in owners.iter() { + // *Should* always be equal to `reward_per_each` + let reward = remainder.min(reward_per_each); + remainder = remainder.saturating_sub(reward); + // Reward the losing funds to the winners + let res = T::Currency::transfer( + &reward_account, + winner, + reward, + ExistenceRequirement::AllowDeath, + ); + // not really much we can do if it fails + debug_assert!( + res.is_ok(), + "Global Disputes: Rewarding a outcome owner failed." + ); + } + } else { + log::error!( + "Global Disputes: There should be always at least one owner for a voting \ + outcome. This can also happen if reward is smaller than owners_len." + ); + debug_assert!(false); + } + Self::deposit_event(Event::OutcomeOwnersRewarded { + market_id, + owners: owners.into_inner(), }); + Ok((Some(T::WeightInfo::reward_outcome_owner_shared_possession(owners_len))).into()) + } + + fn reward_paid_possession( + market_id: MarketIdOf, + reward_account: AccountIdOf, + reward: BalanceOf, + owner: AccountIdOf, + ) -> DispatchResultWithPostInfo { + let res = T::Currency::transfer( + &reward_account, + &owner, + reward, + ExistenceRequirement::AllowDeath, + ); + // not really much we can do if it fails + debug_assert!(res.is_ok(), "Global Disputes: Rewarding a outcome owner failed."); + Self::deposit_event(Event::OutcomeOwnerRewarded { market_id, owner }); + Ok((Some(T::WeightInfo::reward_outcome_owner_paid_possession())).into()) } } - impl GlobalDisputesPalletApi, AccountIdOf, BalanceOf> for Pallet + impl GlobalDisputesPalletApi, AccountIdOf, BalanceOf, T::BlockNumber> + for Pallet where T: Config, { - fn push_voting_outcome( - market_id: &MarketIdOf, - outcome: OutcomeReport, - owner: &T::AccountId, - initial_vote_balance: BalanceOf, - ) -> DispatchResult { - match >::get(market_id) { - Some(winner_info) if winner_info.is_finished => { - return Err(Error::::GlobalDisputeAlreadyFinished.into()); - } - _ => (), - } - match >::get(market_id, &outcome) { - Some(mut outcome_info) => { - let outcome_sum = outcome_info.outcome_sum.saturating_add(initial_vote_balance); - outcome_info.outcome_sum = outcome_sum; - outcome_info - .owners - .try_push(owner.clone()) - .map_err(|_| Error::::MaxOwnersReached)?; - Self::update_winner(market_id, &outcome, outcome_sum); - >::insert(market_id, outcome, outcome_info); - } - None => { - // adding one item to BoundedVec can not fail - if let Ok(owners) = BoundedVec::try_from(vec![owner.clone()]) { - Self::update_winner(market_id, &outcome, initial_vote_balance); - let outcome_info = - OutcomeInfo { outcome_sum: initial_vote_balance, owners }; - >::insert(market_id, outcome, outcome_info); - } else { - log::error!("Global Disputes: Could not construct a bounded vector."); - debug_assert!(false); - } - } - } - Ok(()) + fn get_add_outcome_period() -> T::BlockNumber { + T::AddOutcomePeriod::get() } - fn get_voting_outcome_info( - market_id: &MarketIdOf, - outcome: &OutcomeReport, - ) -> Option<(BalanceOf, Vec>)> { - >::get(market_id, outcome) - .map(|outcome_info| (outcome_info.outcome_sum, outcome_info.owners.into_inner())) + fn get_vote_period() -> T::BlockNumber { + T::GdVotingPeriod::get() } fn determine_voting_winner(market_id: &MarketIdOf) -> Option { - match >::get(market_id) { - Some(mut winner_info) => { - winner_info.is_finished = true; - let winner_outcome = winner_info.outcome.clone(); - >::insert(market_id, winner_info); + match >::get(market_id) { + Some(mut gd_info) => { + gd_info.status = GdStatus::Finished; + let winner_outcome = gd_info.winner_outcome.clone(); + >::insert(market_id, gd_info); Self::deposit_event(Event::GlobalDisputeWinnerDetermined { market_id: *market_id, }); @@ -649,8 +789,90 @@ mod pallet { } } - fn is_started(market_id: &MarketIdOf) -> bool { - >::get(market_id).is_some() + fn does_exist(market_id: &MarketIdOf) -> bool { + >::get(market_id).is_some() + } + + fn is_active(market_id: &MarketIdOf) -> bool { + if let Some(gd_info) = >::get(market_id) { + if let GdStatus::Active { add_outcome_end: _, vote_end: _ } = gd_info.status { + return true; + } + } + false + } + + fn start_global_dispute( + market_id: &MarketIdOf, + initial_items: &[InitialItemOf], + ) -> Result { + let market = T::MarketCommons::market(market_id)?; + + ensure!( + >::get(market_id).is_none(), + Error::::GlobalDisputeAlreadyExists + ); + + for InitialItem { outcome, owner, amount } in initial_items { + ensure!(market.matches_outcome_report(outcome), Error::::OutcomeMismatch); + + match >::get(market_id, outcome) { + Some(mut outcome_info) => { + let outcome_sum = outcome_info.outcome_sum.saturating_add(*amount); + outcome_info.outcome_sum = outcome_sum; + let mut owners = outcome_info + .possession + .get_shared_owners() + .ok_or(Error::::SharedPossessionRequired)?; + owners.try_push(owner.clone()).map_err(|_| Error::::MaxOwnersReached)?; + outcome_info.possession = Possession::Shared { owners }; + Self::update_winner(market_id, outcome, outcome_info.clone()); + >::insert(market_id, outcome, outcome_info); + } + None => { + // adding one item to BoundedVec can not fail + if let Ok(owners) = BoundedVec::try_from(vec![owner.clone()]) { + let possession = Possession::Shared { owners }; + let outcome_info = OutcomeInfo { outcome_sum: *amount, possession }; + Self::update_winner(market_id, outcome, outcome_info.clone()); + >::insert(market_id, outcome, outcome_info); + } else { + log::error!("Global Disputes: Could not construct a bounded vector."); + debug_assert!(false); + } + } + } + } + + let now = >::block_number(); + let add_outcome_end = now.saturating_add(T::AddOutcomePeriod::get()); + let vote_end = add_outcome_end.saturating_add(T::GdVotingPeriod::get()); + let ids_len = T::DisputeResolution::add_auto_resolve(market_id, vote_end)?; + + >::try_mutate(market_id, |gd_info| -> DispatchResult { + let mut raw_gd_info = gd_info.as_mut().ok_or(Error::::GlobalDisputeNotFound)?; + raw_gd_info.status = GdStatus::Active { add_outcome_end, vote_end }; + *gd_info = Some(raw_gd_info.clone()); + Ok(()) + })?; + + Ok(ids_len) + } + + fn destroy_global_dispute(market_id: &MarketIdOf) -> Result<(), DispatchError> { + >::try_mutate(market_id, |gd_info| { + let mut raw_gd_info = gd_info.as_mut().ok_or(Error::::GlobalDisputeNotFound)?; + + // in case the global dispute is already finished nothing needs to be done + if let GdStatus::Active { add_outcome_end: _, vote_end } = raw_gd_info.status { + T::DisputeResolution::remove_auto_resolve(market_id, vote_end); + + raw_gd_info.status = GdStatus::Destroyed; + *gd_info = Some(raw_gd_info.clone()); + } + + Ok(()) + }) } } } diff --git a/zrml/global-disputes/src/migrations.rs b/zrml/global-disputes/src/migrations.rs new file mode 100644 index 000000000..597b46789 --- /dev/null +++ b/zrml/global-disputes/src/migrations.rs @@ -0,0 +1,383 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2021-2022 Zeitgeist PM LLC. +// +// This file is part of Zeitgeist. +// +// Zeitgeist 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. +// +// Zeitgeist 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 Zeitgeist. If not, see . + +extern crate alloc; + +use crate::{types::*, Config, Pallet as GDPallet, *}; +#[cfg(feature = "try-runtime")] +use alloc::vec::Vec; +use frame_support::{ + dispatch::Weight, + log, + pallet_prelude::PhantomData, + traits::{Get, OnRuntimeUpgrade, StorageVersion}, +}; +use sp_runtime::traits::Saturating; + +#[cfg(feature = "try-runtime")] +use alloc::collections::BTreeMap; +#[cfg(feature = "try-runtime")] +use parity_scale_codec::{Decode, Encode}; +#[cfg(feature = "try-runtime")] +use scale_info::prelude::format; + +const GD_REQUIRED_STORAGE_VERSION: u16 = 0; +const GD_NEXT_STORAGE_VERSION: u16 = 1; + +pub struct ModifyGlobalDisputesStructures(PhantomData); + +impl OnRuntimeUpgrade + for ModifyGlobalDisputesStructures +{ + fn on_runtime_upgrade() -> Weight + where + T: Config, + { + let mut total_weight = T::DbWeight::get().reads(1); + let gd_version = StorageVersion::get::>(); + if gd_version != GD_REQUIRED_STORAGE_VERSION { + log::info!( + "ModifyGlobalDisputesStructures: global disputes version is {:?}, require {:?};", + gd_version, + GD_REQUIRED_STORAGE_VERSION, + ); + return total_weight; + } + log::info!("ModifyGlobalDisputesStructures: Starting..."); + + for (market_id, winner_info) in crate::Winners::::drain() { + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + + let owners = winner_info.outcome_info.owners; + let owners_len = owners.len(); + let possession = match owners_len { + 1usize => Possession::Paid { + owner: owners + .get(0) + .expect("Owners len is 1, but could not get this owner.") + .clone(), + fee: T::VotingOutcomeFee::get(), + }, + _ => Possession::Shared { owners }, + }; + + let outcome_info = + OutcomeInfo { outcome_sum: winner_info.outcome_info.outcome_sum, possession }; + let gd_info = GlobalDisputeInfo { + winner_outcome: winner_info.outcome, + outcome_info, + status: GdStatus::Finished, + }; + crate::GlobalDisputesInfo::::insert(market_id, gd_info); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); + } + + let mut translated = 0u64; + Outcomes::::translate::, OwnerInfoOf>, _>( + |_key1, _key2, old_value| { + translated.saturating_inc(); + + let owners = old_value.owners; + let owners_len = owners.len(); + let possession = match owners_len { + 1usize => Possession::Paid { + owner: owners + .get(0) + .expect("Owners len is 1, but could not get this owner.") + .clone(), + fee: T::VotingOutcomeFee::get(), + }, + _ => Possession::Shared { owners }, + }; + + let new_value = OutcomeInfo { outcome_sum: old_value.outcome_sum, possession }; + + Some(new_value) + }, + ); + log::info!("ModifyGlobalDisputesStructures: Upgraded {} outcomes.", translated); + total_weight = total_weight + .saturating_add(T::DbWeight::get().reads_writes(translated + 1, translated + 1)); + + StorageVersion::new(GD_NEXT_STORAGE_VERSION).put::>(); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); + log::info!("ModifyGlobalDisputesStructures: Done!"); + total_weight + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + let old_winners = crate::Winners::::iter() + .collect::, OldWinnerInfo, OwnerInfoOf>>>(); + Ok(old_winners.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(previous_state: Vec) -> Result<(), &'static str> { + let mut markets_count = 0_u32; + let old_winners: BTreeMap, OldWinnerInfo, OwnerInfoOf>> = + Decode::decode(&mut &previous_state[..]) + .expect("Failed to decode state: Invalid state"); + for (market_id, gd_info) in crate::GlobalDisputesInfo::::iter() { + let GlobalDisputeInfo { winner_outcome, outcome_info, status } = gd_info; + + let winner_info: &OldWinnerInfo, OwnerInfoOf> = old_winners + .get(&market_id) + .expect(&format!("Market {:?} not found", market_id)[..]); + + assert_eq!(winner_outcome, winner_info.outcome); + assert_eq!(status, GdStatus::Finished); + + let owners = winner_info.outcome_info.owners.clone(); + let owners_len = owners.len(); + + let possession = match owners_len { + 1usize => Possession::Paid { + owner: owners + .get(0) + .expect("Owners len is 1, but could not get this owner.") + .clone(), + fee: T::VotingOutcomeFee::get(), + }, + _ => Possession::Shared { owners }, + }; + + let outcome_info_expected = + OutcomeInfo { outcome_sum: winner_info.outcome_info.outcome_sum, possession }; + assert_eq!(outcome_info, outcome_info_expected); + + markets_count += 1_u32; + } + let old_markets_count = old_winners.len() as u32; + assert_eq!(markets_count, old_markets_count); + + // empty Winners storage map + assert!(crate::Winners::::iter().next().is_none()); + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::mock::{ExtBuilder, Runtime, ALICE, BOB}; + use frame_support::{ + migration::{get_storage_value, put_storage_value}, + BoundedVec, + }; + use sp_runtime::traits::SaturatedConversion; + use zeitgeist_primitives::{ + constants::mock::VotingOutcomeFee, + types::{MarketId, OutcomeReport}, + }; + + const GLOBAL_DISPUTES: &[u8] = b"GlobalDisputes"; + const GD_OUTCOMES: &[u8] = b"Outcomes"; + + type OldOutcomeInfoOf = OldOutcomeInfo, OwnerInfoOf>; + + #[test] + fn on_runtime_upgrade_increments_the_storage_versions() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + let gd_version = StorageVersion::get::>(); + assert_eq!(gd_version, GD_NEXT_STORAGE_VERSION); + }); + } + + #[test] + fn on_runtime_sets_new_global_disputes_storage_paid() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + + let market_id = 0u128; + + let outcome_sum = 42u128.saturated_into::>(); + let owners = BoundedVec::try_from(vec![ALICE]).unwrap(); + + let outcome_info = OldOutcomeInfo { outcome_sum, owners }; + let outcome = OutcomeReport::Categorical(42u16); + let winner_info = + OldWinnerInfo { outcome: outcome.clone(), outcome_info, is_finished: true }; + + crate::Winners::::insert(market_id, winner_info); + + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + + let possession = Possession::Paid { owner: ALICE, fee: VotingOutcomeFee::get() }; + + let new_outcome_info = OutcomeInfo { outcome_sum, possession }; + + let expected = GlobalDisputeInfo { + winner_outcome: outcome, + outcome_info: new_outcome_info, + status: GdStatus::Finished, + }; + + let actual = crate::GlobalDisputesInfo::::get(market_id).unwrap(); + assert_eq!(expected, actual); + + assert!(crate::Winners::::iter().next().is_none()); + }); + } + + #[test] + fn on_runtime_sets_new_global_disputes_storage_shared() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + + let market_id = 0u128; + + let outcome_sum = 42u128.saturated_into::>(); + let owners = BoundedVec::try_from(vec![ALICE, BOB]).unwrap(); + + let outcome_info = OldOutcomeInfo { outcome_sum, owners: owners.clone() }; + let outcome = OutcomeReport::Categorical(42u16); + let winner_info = + OldWinnerInfo { outcome: outcome.clone(), outcome_info, is_finished: true }; + + crate::Winners::::insert(market_id, winner_info); + + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + + let possession = Possession::Shared { owners }; + + let new_outcome_info = OutcomeInfo { outcome_sum, possession }; + + let expected = GlobalDisputeInfo { + winner_outcome: outcome, + outcome_info: new_outcome_info, + status: GdStatus::Finished, + }; + + let actual = crate::GlobalDisputesInfo::::get(market_id).unwrap(); + assert_eq!(expected, actual); + + assert!(crate::Winners::::iter().next().is_none()); + }); + } + + #[test] + fn on_runtime_sets_new_outcomes_storage_value_shared() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + + let outcome = OutcomeReport::Categorical(0u16); + let hash = + crate::Outcomes::::hashed_key_for::(0, outcome); + + let outcome_sum = 42u128.saturated_into::>(); + let owners = BoundedVec::try_from(vec![ALICE, BOB]).unwrap(); + + let outcome_info = OldOutcomeInfo { outcome_sum, owners: owners.clone() }; + + put_storage_value::>( + GLOBAL_DISPUTES, + GD_OUTCOMES, + &hash, + outcome_info, + ); + + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + + let possession = Possession::Shared { owners }; + let expected = OutcomeInfo { outcome_sum, possession }; + + let actual = frame_support::migration::get_storage_value::>( + GLOBAL_DISPUTES, + GD_OUTCOMES, + &hash, + ) + .unwrap(); + assert_eq!(expected, actual); + }); + } + + #[test] + fn on_runtime_sets_new_outcomes_storage_value_paid() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + + let outcome = OutcomeReport::Categorical(0u16); + let hash = + crate::Outcomes::::hashed_key_for::(0, outcome); + + let outcome_sum = 42u128.saturated_into::>(); + let owners = BoundedVec::try_from(vec![ALICE]).unwrap(); + + let outcome_info = OldOutcomeInfo { outcome_sum, owners }; + + put_storage_value::>( + GLOBAL_DISPUTES, + GD_OUTCOMES, + &hash, + outcome_info, + ); + + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + + let possession = Possession::Paid { owner: ALICE, fee: VotingOutcomeFee::get() }; + let expected = OutcomeInfo { outcome_sum, possession }; + + let actual = frame_support::migration::get_storage_value::>( + GLOBAL_DISPUTES, + GD_OUTCOMES, + &hash, + ) + .unwrap(); + assert_eq!(expected, actual); + }); + } + + #[test] + fn on_runtime_is_noop_if_versions_are_not_correct() { + ExtBuilder::default().build().execute_with(|| { + // storage migration already executed (storage version is incremented already) + StorageVersion::new(GD_NEXT_STORAGE_VERSION).put::>(); + + let outcome = OutcomeReport::Categorical(0u16); + let hash = + crate::Outcomes::::hashed_key_for::(0, outcome); + + let outcome_info = OldOutcomeInfo { + outcome_sum: 0u128.saturated_into::>(), + owners: BoundedVec::try_from(vec![ALICE]).unwrap(), + }; + + put_storage_value::>( + GLOBAL_DISPUTES, + GD_OUTCOMES, + &hash, + outcome_info, + ); + + ModifyGlobalDisputesStructures::::on_runtime_upgrade(); + + // no changes should have been made, because the storage version was already incremented + assert!( + get_storage_value::>(GLOBAL_DISPUTES, GD_OUTCOMES, &hash) + .is_none() + ); + }); + } + + fn set_up_chain() { + StorageVersion::new(GD_REQUIRED_STORAGE_VERSION).put::>(); + } +} diff --git a/zrml/global-disputes/src/mock.rs b/zrml/global-disputes/src/mock.rs index 82750e2ed..3f73f1ee2 100644 --- a/zrml/global-disputes/src/mock.rs +++ b/zrml/global-disputes/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -18,19 +18,26 @@ #![cfg(test)] use crate::{self as zrml_global_disputes}; -use frame_support::{construct_runtime, parameter_types, traits::Everything}; +use frame_support::{ + construct_runtime, + pallet_prelude::{DispatchError, Weight}, + parameter_types, + traits::Everything, +}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; use zeitgeist_primitives::{ constants::mock::{ - BlockHashCount, GlobalDisputeLockId, GlobalDisputesPalletId, MaxReserves, - MinOutcomeVoteAmount, MinimumPeriod, PmPalletId, RemoveKeysLimit, VotingOutcomeFee, BASE, + AddOutcomePeriod, BlockHashCount, GdVotingPeriod, GlobalDisputeLockId, + GlobalDisputesPalletId, MaxReserves, MinOutcomeVoteAmount, MinimumPeriod, PmPalletId, + RemoveKeysLimit, VotingOutcomeFee, BASE, }, + traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, + AccountIdTest, Asset, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketId, + Moment, UncheckedExtrinsicTest, }, }; @@ -56,13 +63,54 @@ construct_runtime!( } ); +// NoopResolution implements DisputeResolutionApi with no-ops. +pub struct NoopResolution; + +impl DisputeResolutionApi for NoopResolution { + type AccountId = AccountIdTest; + type Balance = Balance; + type BlockNumber = BlockNumber; + type MarketId = MarketId; + type Moment = Moment; + + fn resolve( + _market_id: &Self::MarketId, + _market: &Market< + Self::AccountId, + Self::Balance, + Self::BlockNumber, + Self::Moment, + Asset, + >, + ) -> Result { + Ok(Weight::zero()) + } + + fn add_auto_resolve( + _market_id: &Self::MarketId, + _resolve_at: Self::BlockNumber, + ) -> Result { + Ok(0u32) + } + + fn auto_resolve_exists(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> bool { + false + } + + fn remove_auto_resolve(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> u32 { + 0u32 + } +} + parameter_types! { pub const MaxGlobalDisputeVotes: u32 = 50; pub const MaxOwners: u32 = 10; } impl crate::Config for Runtime { + type AddOutcomePeriod = AddOutcomePeriod; type Currency = Balances; + type DisputeResolution = NoopResolution; type RuntimeEvent = RuntimeEvent; type GlobalDisputeLockId = GlobalDisputeLockId; type GlobalDisputesPalletId = GlobalDisputesPalletId; @@ -71,6 +119,7 @@ impl crate::Config for Runtime { type MaxOwners = MaxOwners; type MinOutcomeVoteAmount = MinOutcomeVoteAmount; type RemoveKeysLimit = RemoveKeysLimit; + type GdVotingPeriod = GdVotingPeriod; type VotingOutcomeFee = VotingOutcomeFee; type WeightInfo = crate::weights::WeightInfo; } diff --git a/zrml/global-disputes/src/tests.rs b/zrml/global-disputes/src/tests.rs index d3efbfd30..bd861221b 100644 --- a/zrml/global-disputes/src/tests.rs +++ b/zrml/global-disputes/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -20,8 +20,9 @@ use crate::{ global_disputes_pallet_api::GlobalDisputesPalletApi, mock::*, - types::{OutcomeInfo, WinnerInfo}, - Error, Event, Locks, MarketIdOf, Outcomes, Winners, + types::{GdStatus, GlobalDisputeInfo, InitialItem, OutcomeInfo, Possession}, + utils::market_mock, + BalanceOf, Error, Event, GlobalDisputesInfo, InitialItemOf, Locks, MarketIdOf, Outcomes, }; use frame_support::{ assert_noop, assert_ok, @@ -29,11 +30,15 @@ use frame_support::{ BoundedVec, }; use pallet_balances::{BalanceLock, Error as BalancesError}; -use sp_runtime::traits::Zero; +use sp_runtime::{traits::Zero, SaturatedConversion}; +use test_case::test_case; use zeitgeist_primitives::{ - constants::mock::{GlobalDisputeLockId, MinOutcomeVoteAmount, VotingOutcomeFee, BASE}, - types::OutcomeReport, + constants::mock::{ + GlobalDisputeLockId, MinOutcomeVoteAmount, RemoveKeysLimit, VotingOutcomeFee, BASE, + }, + types::{BlockNumber, OutcomeReport}, }; +use zrml_market_commons::{Error as MarketError, Markets}; const SETUP_AMOUNT: u128 = 100 * BASE; @@ -41,17 +46,20 @@ fn the_lock(amount: u128) -> BalanceLock { BalanceLock { id: GlobalDisputeLockId::get(), amount, reasons: pallet_balances::Reasons::Misc } } -fn setup_vote_outcomes_with_hundred(market_id: &MarketIdOf) { - GlobalDisputes::push_voting_outcome(market_id, OutcomeReport::Scalar(0), &ALICE, SETUP_AMOUNT) - .unwrap(); - - GlobalDisputes::push_voting_outcome(market_id, OutcomeReport::Scalar(20), &ALICE, SETUP_AMOUNT) - .unwrap(); - GlobalDisputes::push_voting_outcome(market_id, OutcomeReport::Scalar(40), &ALICE, SETUP_AMOUNT) - .unwrap(); +fn get_initial_items() -> Vec> { + vec![ + InitialItem { outcome: OutcomeReport::Scalar(0), owner: ALICE, amount: SETUP_AMOUNT }, + InitialItem { outcome: OutcomeReport::Scalar(20), owner: ALICE, amount: SETUP_AMOUNT }, + InitialItem { outcome: OutcomeReport::Scalar(40), owner: ALICE, amount: SETUP_AMOUNT }, + InitialItem { outcome: OutcomeReport::Scalar(60), owner: ALICE, amount: SETUP_AMOUNT }, + ] +} - GlobalDisputes::push_voting_outcome(market_id, OutcomeReport::Scalar(60), &ALICE, SETUP_AMOUNT) - .unwrap(); +fn set_vote_period() { + let now = >::block_number(); + >::set_block_number( + now + ::AddOutcomePeriod::get() + 1, + ); } fn check_outcome_sum( @@ -63,7 +71,7 @@ fn check_outcome_sum( >::get(market_id, outcome).unwrap(), OutcomeInfo { outcome_sum: SETUP_AMOUNT + post_setup_amount, - owners: BoundedVec::try_from(vec![ALICE]).unwrap() + possession: Possession::Shared { owners: BoundedVec::try_from(vec![ALICE]).unwrap() } } ); } @@ -72,26 +80,25 @@ fn check_outcome_sum( fn add_vote_outcome_works() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + let free_balance_alice_before = Balances::free_balance(ALICE); let free_balance_reward_account = Balances::free_balance(GlobalDisputes::reward_account(&market_id)); assert_ok!(GlobalDisputes::add_vote_outcome( RuntimeOrigin::signed(ALICE), market_id, - OutcomeReport::Scalar(20), + OutcomeReport::Scalar(80), )); System::assert_last_event( Event::::AddedVotingOutcome { market_id, owner: ALICE, - outcome: OutcomeReport::Scalar(20), + outcome: OutcomeReport::Scalar(80), } .into(), ); @@ -106,28 +113,316 @@ fn add_vote_outcome_works() { }); } +#[test_case(GdStatus::Finished; "finished")] +#[test_case(GdStatus::Destroyed; "destroyed")] +fn is_active_works(status: GdStatus) { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + assert!(!GlobalDisputes::is_active(&market_id)); + + let outcome_info = OutcomeInfo { + outcome_sum: 0, + possession: Possession::Shared { owners: BoundedVec::try_from(vec![ALICE]).unwrap() }, + }; + >::insert( + market_id, + GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(0), + outcome_info: outcome_info.clone(), + status, + }, + ); + + assert!(!GlobalDisputes::is_active(&market_id)); + + >::insert( + market_id, + GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(0), + outcome_info, + status: GdStatus::Active { add_outcome_end: 0, vote_end: 0 }, + }, + ); + + assert!(GlobalDisputes::is_active(&market_id)); + }); +} + +#[test] +fn destroy_global_dispute_works() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + assert_ok!(GlobalDisputes::destroy_global_dispute(&market_id)); + + assert_eq!( + >::get(market_id).unwrap().status, + GdStatus::Destroyed + ); + }); +} + +#[test] +fn start_global_dispute_works() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + let outcome_info = OutcomeInfo { + outcome_sum: SETUP_AMOUNT, + possession: Possession::Shared { owners: BoundedVec::try_from(vec![ALICE]).unwrap() }, + }; + assert_eq!( + >::get(market_id).unwrap(), + GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(60), + outcome_info, + status: GdStatus::Active { add_outcome_end: 21, vote_end: 161 }, + } + ); + }); +} + +#[test] +fn start_global_dispute_fails_if_outcome_mismatch() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = vec![ + InitialItem { outcome: OutcomeReport::Scalar(0), owner: ALICE, amount: SETUP_AMOUNT }, + InitialItem { outcome: OutcomeReport::Scalar(20), owner: ALICE, amount: SETUP_AMOUNT }, + // categorical outcome mismatch + InitialItem { + outcome: OutcomeReport::Categorical(40), + owner: ALICE, + amount: SETUP_AMOUNT, + }, + InitialItem { outcome: OutcomeReport::Scalar(60), owner: ALICE, amount: SETUP_AMOUNT }, + ]; + assert_eq!( + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()), + Err(Error::::OutcomeMismatch.into()) + ); + }); +} + +#[test] +fn start_global_dispute_fails_if_already_exists() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()).unwrap(); + assert_eq!( + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()), + Err(Error::::GlobalDisputeAlreadyExists.into()) + ); + }); +} + +#[test] +fn start_global_dispute_fails_if_max_owner_reached() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let mut initial_items = Vec::new(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(0), + owner: 0u128, + amount: SETUP_AMOUNT, + }); + for i in 0..MaxOwners::get() + 1 { + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(42), + owner: i.into(), + amount: SETUP_AMOUNT, + }); + } + + assert_eq!( + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()), + Err(Error::::MaxOwnersReached.into()) + ); + }); +} + +#[test] +fn start_global_dispute_fails_if_shared_possession_required() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let outcome_info = OutcomeInfo { + outcome_sum: SETUP_AMOUNT, + possession: Possession::Paid { owner: ALICE, fee: VotingOutcomeFee::get() }, + }; + >::insert(market_id, OutcomeReport::Scalar(0), outcome_info); + + let mut initial_items = Vec::new(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(0), + owner: 0u128, + amount: SETUP_AMOUNT, + }); + for i in 0..MaxOwners::get() + 1 { + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(42), + owner: i.into(), + amount: SETUP_AMOUNT, + }); + } + + assert_eq!( + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()), + Err(Error::::SharedPossessionRequired.into()) + ); + }); +} + +#[test] +fn start_global_dispute_adds_owners_for_existing_outcome() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let mut initial_items = Vec::new(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(0), + owner: 0u128, + amount: SETUP_AMOUNT, + }); + for i in 0..MaxOwners::get() { + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(42), + owner: i.into(), + amount: SETUP_AMOUNT, + }); + } + + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + let outcome_info = >::get(market_id, OutcomeReport::Scalar(42)).unwrap(); + assert_eq!( + outcome_info.possession, + Possession::Shared { owners: vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9].try_into().unwrap() } + ); + }); +} + +#[test] +fn start_global_dispute_updates_to_highest_winner() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let mut initial_items = Vec::new(); + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(0), + owner: 0u128, + amount: SETUP_AMOUNT, + }); + for i in 0..MaxOwners::get() { + initial_items.push(InitialItem { + outcome: OutcomeReport::Scalar(42 + i.saturated_into::()), + owner: i.into(), + amount: SETUP_AMOUNT + i.saturated_into::(), + }); + } + + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + let gd_info = >::get(market_id).unwrap(); + assert_eq!(gd_info.outcome_info.outcome_sum, SETUP_AMOUNT + 9); + assert_eq!(gd_info.winner_outcome, OutcomeReport::Scalar(51)); + }); +} + +#[test] +fn add_vote_outcome_fails_with_outcome_mismatch() { + ExtBuilder::default().build().execute_with(|| { + // create scalar market + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + assert_noop!( + GlobalDisputes::add_vote_outcome( + RuntimeOrigin::signed(ALICE), + market_id, + OutcomeReport::Categorical(0u16), + ), + Error::::OutcomeMismatch + ); + }); +} + +#[test] +fn add_vote_outcome_fails_with_non_existing_market() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + assert_noop!( + GlobalDisputes::add_vote_outcome( + RuntimeOrigin::signed(ALICE), + market_id, + OutcomeReport::Scalar(80), + ), + MarketError::::MarketDoesNotExist + ); + }); +} + #[test] fn add_vote_outcome_fails_if_no_global_dispute_present() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); assert_noop!( GlobalDisputes::add_vote_outcome( RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), ), - Error::::NoGlobalDisputeStarted + Error::::GlobalDisputeNotFound ); }); } -#[test] -fn add_vote_outcome_fails_if_global_dispute_finished() { +#[test_case(GdStatus::Finished; "finished")] +#[test_case(GdStatus::Destroyed; "destroyed")] +fn add_vote_outcome_fails_if_global_dispute_is_in_wrong_state(status: GdStatus) { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - let mut winner_info = WinnerInfo::new(OutcomeReport::Scalar(0), 10 * BASE); - winner_info.is_finished = true; - >::insert(market_id, winner_info); + let market = market_mock::(); + Markets::::insert(market_id, market); + let possession = Possession::Shared { owners: BoundedVec::try_from(vec![ALICE]).unwrap() }; + let mut gd_info = GlobalDisputeInfo::new(OutcomeReport::Scalar(0), possession, 10 * BASE); + gd_info.status = status; + >::insert(market_id, gd_info); assert_noop!( GlobalDisputes::add_vote_outcome( @@ -135,7 +430,7 @@ fn add_vote_outcome_fails_if_global_dispute_finished() { market_id, OutcomeReport::Scalar(20), ), - Error::::GlobalDisputeAlreadyFinished + Error::::InvalidGlobalDisputeStatus ); }); } @@ -144,17 +439,18 @@ fn add_vote_outcome_fails_if_global_dispute_finished() { fn add_vote_outcome_fails_if_outcome_already_exists() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); >::insert( market_id, OutcomeReport::Scalar(20), - OutcomeInfo { outcome_sum: Zero::zero(), owners: Default::default() }, + OutcomeInfo { + outcome_sum: Zero::zero(), + possession: Possession::Shared { owners: Default::default() }, + }, ); assert_noop!( GlobalDisputes::add_vote_outcome( @@ -171,18 +467,17 @@ fn add_vote_outcome_fails_if_outcome_already_exists() { fn add_vote_outcome_fails_if_balance_too_low() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + assert_noop!( GlobalDisputes::add_vote_outcome( RuntimeOrigin::signed(POOR_PAUL), market_id, - OutcomeReport::Scalar(20), + OutcomeReport::Scalar(80), ), BalancesError::::InsufficientBalance ); @@ -198,19 +493,24 @@ fn reward_outcome_owner_works_for_multiple_owners() { OutcomeReport::Scalar(20), OutcomeInfo { outcome_sum: Zero::zero(), - owners: BoundedVec::try_from(vec![ALICE, BOB, CHARLIE]).unwrap(), + possession: Possession::Shared { + owners: BoundedVec::try_from(vec![ALICE, BOB, CHARLIE]).unwrap(), + }, }, ); let _ = Balances::deposit_creating( &GlobalDisputes::reward_account(&market_id), 3 * VotingOutcomeFee::get(), ); - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(20), - is_finished: true, - outcome_info: OutcomeInfo { outcome_sum: 10 * BASE, owners: Default::default() }, + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(20), + status: GdStatus::Finished, + outcome_info: OutcomeInfo { + outcome_sum: 10 * BASE, + possession: Possession::Shared { owners: Default::default() }, + }, }; - >::insert(market_id, winner_info); + >::insert(market_id, gd_info); let free_balance_alice_before = Balances::free_balance(ALICE); let free_balance_bob_before = Balances::free_balance(BOB); @@ -252,17 +552,22 @@ fn reward_outcome_owner_has_dust() { OutcomeReport::Scalar(20), OutcomeInfo { outcome_sum: Zero::zero(), - owners: BoundedVec::try_from(vec![ALICE, BOB, CHARLIE, EVE, POOR_PAUL, DAVE]) - .unwrap(), + possession: Possession::Shared { + owners: BoundedVec::try_from(vec![ALICE, BOB, CHARLIE, EVE, POOR_PAUL, DAVE]) + .unwrap(), + }, }, ); let _ = Balances::deposit_creating(&GlobalDisputes::reward_account(&market_id), 100 * BASE); - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(20), - is_finished: true, - outcome_info: OutcomeInfo { outcome_sum: 10 * BASE, owners: Default::default() }, + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(20), + status: GdStatus::Finished, + outcome_info: OutcomeInfo { + outcome_sum: 10 * BASE, + possession: Possession::Shared { owners: Default::default() }, + }, }; - >::insert(market_id, winner_info); + >::insert(market_id, gd_info); assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); @@ -283,19 +588,24 @@ fn reward_outcome_owner_works_for_one_owner() { OutcomeReport::Scalar(20), OutcomeInfo { outcome_sum: Zero::zero(), - owners: BoundedVec::try_from(vec![ALICE]).unwrap(), + possession: Possession::Shared { + owners: BoundedVec::try_from(vec![ALICE]).unwrap(), + }, }, ); let _ = Balances::deposit_creating( &GlobalDisputes::reward_account(&market_id), 3 * VotingOutcomeFee::get(), ); - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(20), - is_finished: true, - outcome_info: OutcomeInfo { outcome_sum: 10 * BASE, owners: Default::default() }, + let gd_info = GlobalDisputeInfo { + winner_outcome: OutcomeReport::Scalar(20), + status: GdStatus::Finished, + outcome_info: OutcomeInfo { + outcome_sum: 10 * BASE, + possession: Possession::Shared { owners: BoundedVec::try_from(vec![]).unwrap() }, + }, }; - >::insert(market_id, winner_info); + >::insert(market_id, gd_info); assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); @@ -318,76 +628,15 @@ fn reward_outcome_owner_works_for_one_owner() { }); } -#[test] -fn reward_outcome_owner_works_for_no_reward_funds() { - ExtBuilder::default().build().execute_with(|| { - let market_id = 0u128; - - setup_vote_outcomes_with_hundred(&market_id); - - let winner_info = WinnerInfo { - outcome: OutcomeReport::Scalar(20), - is_finished: true, - outcome_info: OutcomeInfo { outcome_sum: 10 * BASE, owners: Default::default() }, - }; - >::insert(market_id, winner_info); - - assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); - - System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - - let free_balance_alice_before = Balances::free_balance(ALICE); - - let reward_account_free_balance = - Balances::free_balance(GlobalDisputes::reward_account(&market_id)); - // this case happens, when add_vote_outcome wasn't called - // so no loosers, who provided the VotingOutcomeFee - assert!(reward_account_free_balance.is_zero()); - - assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id)); - - System::assert_last_event( - Event::::OutcomeOwnersRewardedWithNoFunds { market_id }.into(), - ); - - assert_eq!(Balances::free_balance(ALICE), free_balance_alice_before); - assert!(Balances::free_balance(GlobalDisputes::reward_account(&market_id)).is_zero()); - assert!(>::iter_prefix(market_id).next().is_none()); - }); -} - #[test] fn vote_fails_if_amount_below_min_outcome_vote_amount() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(20), - &ALICE, - 20 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(40), - &ALICE, - 30 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(60), - &ALICE, - 40 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); assert_noop!( GlobalDisputes::vote_on_outcome( @@ -405,20 +654,12 @@ fn vote_fails_if_amount_below_min_outcome_vote_amount() { fn vote_fails_for_insufficient_funds() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(20), - &ALICE, - 20 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + // Paul does not have 50 * BASE assert_noop!( GlobalDisputes::vote_on_outcome( @@ -436,8 +677,13 @@ fn vote_fails_for_insufficient_funds() { fn determine_voting_winner_sets_the_last_outcome_for_same_vote_balances_as_the_canonical_outcome() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); - setup_vote_outcomes_with_hundred(&market_id); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -481,8 +727,13 @@ fn determine_voting_winner_sets_the_last_outcome_for_same_vote_balances_as_the_c fn vote_on_outcome_check_event() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(EVE), @@ -507,6 +758,8 @@ fn vote_on_outcome_check_event() { fn reserve_before_init_vote_outcome_is_not_allowed_for_voting() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); let disputor = &ALICE; let free_balance_disputor_before = Balances::free_balance(disputor); @@ -519,21 +772,22 @@ fn reserve_before_init_vote_outcome_is_not_allowed_for_voting() { free_balance_disputor_before - reserved_balance_disputor ); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - reserved_balance_disputor, - ) - .unwrap(); + let initial_items = vec![ + InitialItem { + outcome: OutcomeReport::Scalar(0), + owner: ALICE, + amount: reserved_balance_disputor, + }, + InitialItem { + outcome: OutcomeReport::Scalar(20), + owner: ALICE, + amount: reserved_balance_disputor * 2, + }, + ]; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(20), - &ALICE, - reserved_balance_disputor * 2, - ) - .unwrap(); + GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice()).unwrap(); + + set_vote_period(); assert_noop!( GlobalDisputes::vote_on_outcome( @@ -565,8 +819,13 @@ fn reserve_before_init_vote_outcome_is_not_allowed_for_voting() { fn transfer_fails_with_fully_locked_balance() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); - setup_vote_outcomes_with_hundred(&market_id); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); let disputor = &ALICE; let free_balance_disputor_before = Balances::free_balance(disputor); @@ -597,8 +856,13 @@ fn transfer_fails_with_fully_locked_balance() { fn reserve_fails_with_fully_locked_balance() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); let disputor = &ALICE; let free_balance_disputor_before = Balances::free_balance(disputor); @@ -629,8 +893,13 @@ fn reserve_fails_with_fully_locked_balance() { fn determine_voting_winner_works_four_outcome_votes() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); - setup_vote_outcomes_with_hundred(&market_id); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -668,7 +937,10 @@ fn determine_voting_winner_works_four_outcome_votes() { OutcomeReport::Scalar(40) ); - assert!(>::get(market_id).unwrap().is_finished); + assert_eq!( + >::get(market_id).unwrap().status, + GdStatus::Finished + ); }); } @@ -676,8 +948,13 @@ fn determine_voting_winner_works_four_outcome_votes() { fn determine_voting_winner_works_three_outcome_votes() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -720,8 +997,13 @@ fn determine_voting_winner_works_three_outcome_votes() { fn determine_voting_winner_works_two_outcome_votes() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); - setup_vote_outcomes_with_hundred(&market_id); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -764,8 +1046,13 @@ fn determine_voting_winner_works_two_outcome_votes() { fn determine_voting_winner_works_with_accumulated_votes_for_alice() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -819,11 +1106,16 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { } #[test] -fn reward_outcome_owner_cleans_outcome_info() { +fn purge_outcomes_fully_cleaned_works() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); - setup_vote_outcomes_with_hundred(&market_id); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -852,9 +1144,102 @@ fn reward_outcome_owner_cleans_outcome_info() { System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(BOB), market_id,)); + assert_eq!(>::iter_prefix(market_id).next(), None); + }); +} + +#[test] +fn purge_outcomes_partially_cleaned_works() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let mut initial_items = Vec::new(); + for i in 0..(2 * RemoveKeysLimit::get()) { + initial_items.push(InitialItem { + owner: ALICE, + outcome: OutcomeReport::Scalar(i.into()), + amount: SETUP_AMOUNT, + }); + } + + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + assert!(GlobalDisputes::determine_voting_winner(&market_id).is_some()); + + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); + + System::assert_last_event(Event::::OutcomesPartiallyCleaned { market_id }.into()); + + assert!(>::iter_prefix(market_id).next().is_some()); + + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); + + System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); + + assert_eq!(>::iter_prefix(market_id).next(), None); + }); +} + +#[test] +fn refund_vote_fees_works() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, &market); + + let pushed_outcome_1 = 0; + let pushed_outcome_2 = 20; + + let initial_items = vec![ + InitialItem { + owner: ALICE, + outcome: OutcomeReport::Scalar(pushed_outcome_1), + amount: SETUP_AMOUNT, + }, + InitialItem { + owner: ALICE, + outcome: OutcomeReport::Scalar(pushed_outcome_2), + amount: SETUP_AMOUNT, + }, + ]; + + let offset = pushed_outcome_1.max(pushed_outcome_2) + 1; + + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + let mut overall_fees = >::zero(); + // minus 2 because of the above push_vote_outcome calls + for i in 0..(2 * RemoveKeysLimit::get() - 2) { + assert_ok!(GlobalDisputes::add_vote_outcome( + RuntimeOrigin::signed(ALICE), + market_id, + // offset to not conflict with pushed outcomes + OutcomeReport::Scalar(offset + i as u128), + )); + overall_fees = overall_fees.saturating_add(VotingOutcomeFee::get()); + } + + assert_ok!(GlobalDisputes::destroy_global_dispute(&market_id)); + + let alice_free_balance_before = Balances::free_balance(ALICE); + assert_ok!(GlobalDisputes::refund_vote_fees(RuntimeOrigin::signed(ALICE), market_id,)); + + System::assert_last_event(Event::::OutcomesPartiallyCleaned { market_id }.into()); + + assert!(>::iter_prefix(market_id).next().is_some()); + + assert_ok!(GlobalDisputes::refund_vote_fees(RuntimeOrigin::signed(ALICE), market_id,)); + + System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); assert_eq!(>::iter_prefix(market_id).next(), None); + + assert_eq!( + Balances::free_balance(ALICE), + alice_free_balance_before.saturating_add(overall_fees) + ); }); } @@ -862,8 +1247,13 @@ fn reward_outcome_owner_cleans_outcome_info() { fn unlock_clears_lock_info() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); assert_ok!(GlobalDisputes::vote_on_outcome( RuntimeOrigin::signed(ALICE), @@ -886,34 +1276,19 @@ fn unlock_clears_lock_info() { fn vote_fails_if_outcome_does_not_exist() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(0), - &ALICE, - 10 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(20), - &ALICE, - 20 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(40), - &ALICE, - 30 * BASE, - ) - .unwrap(); - GlobalDisputes::push_voting_outcome( - &market_id, - OutcomeReport::Scalar(60), - &ALICE, - 40 * BASE, - ) - .unwrap(); + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = vec![ + InitialItem { owner: ALICE, outcome: OutcomeReport::Scalar(0), amount: 10 * BASE }, + InitialItem { owner: ALICE, outcome: OutcomeReport::Scalar(20), amount: 20 * BASE }, + InitialItem { owner: ALICE, outcome: OutcomeReport::Scalar(40), amount: 30 * BASE }, + InitialItem { owner: ALICE, outcome: OutcomeReport::Scalar(60), amount: 40 * BASE }, + ]; + + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); + + set_vote_period(); assert_noop!( GlobalDisputes::vote_on_outcome( @@ -931,8 +1306,13 @@ fn vote_fails_if_outcome_does_not_exist() { fn locking_works_for_one_market() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; + let market = market_mock::(); + Markets::::insert(market_id, market); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id); + set_vote_period(); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); @@ -1017,10 +1397,19 @@ fn locking_works_for_one_market() { fn locking_works_for_two_markets_with_stronger_first_unlock() { ExtBuilder::default().build().execute_with(|| { let market_id_1 = 0u128; + let market_1 = market_mock::(); + Markets::::insert(market_id_1, market_1); + let market_id_2 = 1u128; + let market_2 = market_mock::(); + Markets::::insert(market_id_2, market_2); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id_1, initial_items.as_slice())); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id_2, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id_1); - setup_vote_outcomes_with_hundred(&market_id_2); + set_vote_period(); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); @@ -1107,10 +1496,19 @@ fn locking_works_for_two_markets_with_stronger_first_unlock() { fn locking_works_for_two_markets_with_weaker_first_unlock() { ExtBuilder::default().build().execute_with(|| { let market_id_1 = 0u128; + let market_1 = market_mock::(); + Markets::::insert(market_id_1, market_1); + let market_id_2 = 1u128; + let market_2 = market_mock::(); + Markets::::insert(market_id_2, market_2); + + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id_1, initial_items.as_slice())); + let initial_items = get_initial_items(); + assert_ok!(GlobalDisputes::start_global_dispute(&market_id_2, initial_items.as_slice())); - setup_vote_outcomes_with_hundred(&market_id_1); - setup_vote_outcomes_with_hundred(&market_id_2); + set_vote_period(); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); diff --git a/zrml/global-disputes/src/types.rs b/zrml/global-disputes/src/types.rs index 63b7c42e7..10c83a49b 100644 --- a/zrml/global-disputes/src/types.rs +++ b/zrml/global-disputes/src/types.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -19,9 +19,85 @@ use frame_support::pallet_prelude::{Decode, Encode, MaxEncodedLen, TypeInfo}; use sp_runtime::traits::Saturating; use zeitgeist_primitives::types::OutcomeReport; +/// The original voting outcome owner information. +#[derive(Debug, TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] +pub enum Possession { + /// The outcome is owned by a single account. + /// This happens due to the call to `add_vote_outcome`. + Paid { owner: AccountId, fee: Balance }, + /// The outcome is owned by multiple accounts. + /// When a global dispute is triggered, these are the owners of the initially added outcomes. + Shared { owners: OwnerInfo }, +} + +impl Possession { + pub fn get_shared_owners(self) -> Option { + match self { + Possession::Shared { owners } => Some(owners), + _ => None, + } + } +} + /// The information about a voting outcome of a global dispute. #[derive(Debug, TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] -pub struct OutcomeInfo { +pub struct OutcomeInfo { + /// The current sum of all locks on this outcome. + pub outcome_sum: Balance, + /// The information about the owner(s) and optionally additional fee. + pub possession: Possession, +} + +/// The general information about the global dispute. +#[derive(Debug, TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] +pub struct GlobalDisputeInfo { + /// The outcome which is in the lead. + pub winner_outcome: OutcomeReport, + /// The information about the winning outcome. + pub outcome_info: OutcomeInfo, + /// The current status of the global dispute. + pub status: GdStatus, +} + +impl + GlobalDisputeInfo +{ + pub fn new( + outcome: OutcomeReport, + possession: Possession, + vote_sum: Balance, + ) -> Self { + let outcome_info = OutcomeInfo { outcome_sum: vote_sum, possession }; + // `add_outcome_end` and `vote_end` gets set in `start_global_dispute` + let status = + GdStatus::Active { add_outcome_end: Default::default(), vote_end: Default::default() }; + GlobalDisputeInfo { winner_outcome: outcome, status, outcome_info } + } + + pub fn update_winner(&mut self, outcome: OutcomeReport, vote_sum: Balance) { + self.winner_outcome = outcome; + self.outcome_info.outcome_sum = vote_sum; + } +} + +/// The current status of the global dispute. +#[derive(TypeInfo, Debug, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] +pub enum GdStatus { + /// The global dispute is in progress. + /// The block number `add_outcome_end`, when the addition of new outcomes is over. + /// The block number `vote_end`, when the global dispute voting period is over. + Active { add_outcome_end: BlockNumber, vote_end: BlockNumber }, + /// The global dispute is finished. + Finished, + /// The global dispute is destroyed. + Destroyed, +} + +// TODO(#986): to remove after the storage migration + +/// The information about a voting outcome of a global dispute. +#[derive(Debug, TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] +pub struct OldOutcomeInfo { /// The current sum of all locks on this outcome. pub outcome_sum: Balance, /// The vector of owners of the outcome. @@ -30,18 +106,28 @@ pub struct OutcomeInfo { /// The information about the current highest winning outcome. #[derive(TypeInfo, Decode, Encode, MaxEncodedLen, Clone, PartialEq, Eq)] -pub struct WinnerInfo { +pub struct OldWinnerInfo { /// The outcome, which is in the lead. pub outcome: OutcomeReport, /// The information about the winning outcome. - pub outcome_info: OutcomeInfo, + pub outcome_info: OldOutcomeInfo, /// Check, if the global dispute is finished. pub is_finished: bool, } -impl WinnerInfo { +impl OldWinnerInfo { pub fn new(outcome: OutcomeReport, vote_sum: Balance) -> Self { - let outcome_info = OutcomeInfo { outcome_sum: vote_sum, owners: Default::default() }; - WinnerInfo { outcome, is_finished: false, outcome_info } + let outcome_info = OldOutcomeInfo { outcome_sum: vote_sum, owners: Default::default() }; + OldWinnerInfo { outcome, is_finished: false, outcome_info } } } + +/// An initial vote outcome item with the outcome owner and the initial vote amount. +pub struct InitialItem { + /// The outcome which is added as initial global dispute vote possibility. + pub outcome: OutcomeReport, + /// The owner of the outcome. This account is rewarded in case the outcome is the winning one. + pub owner: AccountId, + /// The vote amount at the start of the global dispute. + pub amount: Balance, +} diff --git a/zrml/global-disputes/src/utils.rs b/zrml/global-disputes/src/utils.rs new file mode 100644 index 000000000..fd0fc7bbb --- /dev/null +++ b/zrml/global-disputes/src/utils.rs @@ -0,0 +1,63 @@ +// Copyright 2023 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist 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. +// +// Zeitgeist 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 Zeitgeist. If not, see . + +#![cfg(any(feature = "runtime-benchmarks", test))] + +use crate::*; +use frame_support::traits::Currency; + +type CurrencyOf = + <::MarketCommons as zrml_market_commons::MarketCommonsPalletApi>::Currency; +type BalanceOf = as Currency<::AccountId>>::Balance; +type MarketOf = zeitgeist_primitives::types::Market< + ::AccountId, + BalanceOf, + ::BlockNumber, + MomentOf, + zeitgeist_primitives::types::Asset>, +>; + +pub(crate) fn market_mock() -> MarketOf +where + T: crate::Config, +{ + use frame_support::traits::Get; + use sp_runtime::traits::AccountIdConversion; + use zeitgeist_primitives::types::ScoringRule; + + zeitgeist_primitives::types::Market { + base_asset: zeitgeist_primitives::types::Asset::Ztg, + creation: zeitgeist_primitives::types::MarketCreation::Permissionless, + creator_fee: 0, + creator: T::GlobalDisputesPalletId::get().into_account_truncating(), + market_type: zeitgeist_primitives::types::MarketType::Scalar(0..=u128::MAX), + dispute_mechanism: zeitgeist_primitives::types::MarketDisputeMechanism::SimpleDisputes, + metadata: Default::default(), + oracle: T::GlobalDisputesPalletId::get().into_account_truncating(), + period: zeitgeist_primitives::types::MarketPeriod::Block(Default::default()), + deadlines: zeitgeist_primitives::types::Deadlines { + grace_period: 1_u32.into(), + oracle_duration: 1_u32.into(), + dispute_duration: 1_u32.into(), + }, + report: None, + resolved_outcome: None, + scoring_rule: ScoringRule::CPMM, + status: zeitgeist_primitives::types::MarketStatus::Disputed, + bonds: Default::default(), + } +} diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index 50fea5dce..d5fbdcaa2 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -23,7 +23,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/zeitgeist +// ./target/release/zeitgeist // benchmark // pallet // --chain=dev @@ -34,8 +34,8 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --template=./misc/weight_template.hbs // --output=./zrml/global-disputes/src/weights.rs +// --template=./misc/weight_template.hbs #![allow(unused_parens)] #![allow(unused_imports)] @@ -50,15 +50,16 @@ pub trait WeightInfoZeitgeist { fn unlock_vote_balance_set(l: u32, o: u32) -> Weight; fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight; fn add_vote_outcome(w: u32) -> Weight; - fn reward_outcome_owner_with_funds(o: u32) -> Weight; - fn reward_outcome_owner_no_funds(o: u32) -> Weight; + fn reward_outcome_owner_shared_possession(o: u32) -> Weight; + fn reward_outcome_owner_paid_possession() -> Weight; fn purge_outcomes(k: u32, o: u32) -> Weight; + fn refund_vote_fees(k: u32, o: u32) -> Weight; } /// Weight functions for zrml_global_disputes (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - // Storage: GlobalDisputes Winners (r:1 w:1) + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) @@ -72,7 +73,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:0) - // Storage: GlobalDisputes Winners (r:5 w:0) + // Storage: GlobalDisputes GlobalDisputesInfo (r:5 w:0) fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { Weight::from_ref_time(54_445_996) // Standard Error: 8_942 @@ -86,7 +87,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:0) - // Storage: GlobalDisputes Winners (r:5 w:0) + // Storage: GlobalDisputes GlobalDisputesInfo (r:5 w:0) fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { Weight::from_ref_time(61_165_913) // Standard Error: 9_374 @@ -97,7 +98,8 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: GlobalDisputes Winners (r:1 w:1) + // Storage: MarketCommons Markets (r:1 w:0) + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: System Account (r:1 w:1) fn add_vote_outcome(_w: u32) -> Weight { @@ -106,24 +108,26 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().writes(3)) } // Storage: GlobalDisputes Outcomes (r:1 w:0) - // Storage: GlobalDisputes Winners (r:1 w:0) + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) // Storage: System Account (r:2 w:2) - fn reward_outcome_owner_with_funds(o: u32) -> Weight { - Weight::from_ref_time(86_274_827) - // Standard Error: 107_080 - .saturating_add(Weight::from_ref_time(31_467_061).saturating_mul(o.into())) + fn reward_outcome_owner_shared_possession(o: u32) -> Weight { + Weight::from_ref_time(36_741_000) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(22_017_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(o.into()))) } // Storage: GlobalDisputes Outcomes (r:1 w:0) - // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: System Account (r:1 w:0) - fn reward_outcome_owner_no_funds(_o: u32) -> Weight { - Weight::from_ref_time(54_754_528).saturating_add(T::DbWeight::get().reads(3)) + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) + // Storage: System Account (r:2 w:2) + fn reward_outcome_owner_paid_possession() -> Weight { + Weight::from_ref_time(56_000_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: GlobalDisputes Winners (r:1 w:1) + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:3 w:2) fn purge_outcomes(k: u32, _o: u32) -> Weight { Weight::from_ref_time(168_932_238) @@ -134,4 +138,15 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) } + // Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) + // Storage: GlobalDisputes Outcomes (r:3 w:2) + fn refund_vote_fees(k: u32, _o: u32) -> Weight { + Weight::from_ref_time(31_076_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(13_543_000).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) + } } diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index ba92228c5..1aa167f22 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -45,6 +45,7 @@ use zeitgeist_primitives::{ }, }; use zrml_authorized::Pallet as AuthorizedPallet; +use zrml_global_disputes::GlobalDisputesPalletApi; use zrml_market_commons::MarketCommonsPalletApi; use frame_support::{traits::Hooks, BoundedVec}; @@ -850,10 +851,13 @@ benchmarks! { >::set_block_number(appeal_end - 1u64.saturated_into::()); let now = >::block_number(); - let global_dispute_end = now + T::GlobalDisputePeriod::get(); + + let add_outcome_end = now + + ::GlobalDisputes::get_add_outcome_period(); + let vote_end = add_outcome_end + ::GlobalDisputes::get_vote_period(); // the complexity depends on MarketIdsPerDisputeBlock at the current block // this is because a variable number of market ids need to be decoded from the storage - MarketIdsPerDisputeBlock::::insert(global_dispute_end, market_ids_1); + MarketIdsPerDisputeBlock::::insert(vote_end, market_ids_1); let call = Call::::start_global_dispute { market_id }; }: { diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index cd24f8884..28b190afa 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -70,7 +70,7 @@ mod pallet { ScoringRule, SubsidyUntil, }, }; - use zrml_global_disputes::GlobalDisputesPalletApi; + use zrml_global_disputes::{types::InitialItem, GlobalDisputesPalletApi}; use zrml_liquidity_mining::LiquidityMiningPalletApi; use zrml_market_commons::MarketCommonsPalletApi; @@ -97,6 +97,7 @@ mod pallet { pub type CacheSize = ConstU32<64>; pub type EditReason = BoundedVec::MaxEditReasonLen>; pub type RejectReason = BoundedVec::MaxRejectReasonLen>; + type InitialItemOf = InitialItem<::AccountId, BalanceOf>; macro_rules! impl_unreserve_bond { ($fn_name:ident, $bond_type:ident) => { @@ -342,6 +343,10 @@ mod pallet { MarketIdsForEdit::::remove(market_id); } + if T::GlobalDisputes::is_active(&market_id) { + T::GlobalDisputes::destroy_global_dispute(&market_id)?; + } + // NOTE: Currently we don't clean up outcome assets. // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. T::AssetManager::slash( @@ -1446,7 +1451,10 @@ mod pallet { ensure_signed(origin)?; let market = >::market(&market_id)?; - ensure!(market.status == MarketStatus::Disputed, Error::::InvalidMarketStatus); + ensure!( + matches!(market.status, MarketStatus::Disputed | MarketStatus::Reported), + Error::::InvalidMarketStatus + ); ensure!( matches!(market.dispute_mechanism, MarketDisputeMechanism::Court), @@ -1454,8 +1462,8 @@ mod pallet { ); ensure!( - T::GlobalDisputes::is_not_started(&market_id), - Error::::GlobalDisputeAlreadyStarted + !T::GlobalDisputes::does_exist(&market_id), + Error::::GlobalDisputeExistsAlready ); let report = market.report.as_ref().ok_or(Error::::MarketIsNotReported)?; @@ -1482,43 +1490,47 @@ mod pallet { } }; - T::GlobalDisputes::push_voting_outcome( - &market_id, - report.outcome.clone(), - &report.by, - >::zero(), - )?; + let mut initial_items: Vec> = Vec::new(); + + initial_items.push(InitialItemOf:: { + outcome: report.outcome.clone(), + owner: report.by.clone(), + amount: >::zero(), + }); let gd_items = res_1.result; // push vote outcomes other than the report outcome for GlobalDisputeItem { outcome, owner, initial_vote_amount } in gd_items { - T::GlobalDisputes::push_voting_outcome( - &market_id, + initial_items.push(InitialItemOf:: { outcome, - &owner, - initial_vote_amount, - )?; + owner, + amount: initial_vote_amount, + }); } // ensure, that global disputes controls the resolution now // it does not end after the dispute period now, but after the global dispute end + // ignore first of tuple because we always have max disputes let (_, ids_len_2) = Self::clear_auto_resolve(&market_id)?; - let now = >::block_number(); - let global_dispute_end = now.saturating_add(T::GlobalDisputePeriod::get()); - let market_ids_len = >::try_mutate( - global_dispute_end, - |ids| -> Result { - ids.try_push(market_id).map_err(|_| >::StorageOverflow)?; - Ok(ids.len() as u32) - }, - )?; + if market.status == MarketStatus::Reported { + // this is the case that a dispute can not be initiated, + // because court has not enough juror and delegator stake (dispute errors) + >::mutate_market(&market_id, |m| { + m.status = MarketStatus::Disputed; + Ok(()) + })?; + } + + // global disputes uses DisputeResolution API to control its resolution + let ids_len_1 = + T::GlobalDisputes::start_global_dispute(&market_id, initial_items.as_slice())?; Self::deposit_event(Event::GlobalDisputeStarted(market_id)); - Ok(Some(T::WeightInfo::start_global_dispute(market_ids_len, ids_len_2)).into()) + Ok(Some(T::WeightInfo::start_global_dispute(ids_len_1, ids_len_2)).into()) } } @@ -1587,10 +1599,12 @@ mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// See [`GlobalDisputesPalletApi`]. - type GlobalDisputes: GlobalDisputesPalletApi, Self::AccountId, BalanceOf>; - - /// The number of blocks the global dispute period remains open. - type GlobalDisputePeriod: Get; + type GlobalDisputes: GlobalDisputesPalletApi< + MarketIdOf, + Self::AccountId, + BalanceOf, + Self::BlockNumber, + >; type LiquidityMining: LiquidityMiningPalletApi< AccountId = Self::AccountId, @@ -1794,12 +1808,12 @@ mod pallet { OracleDurationGreaterThanMaxOracleDuration, /// The weights length has to be equal to the assets length. WeightsLenMustEqualAssetsLen, - /// The start of the global dispute for this market happened already. - GlobalDisputeAlreadyStarted, /// Provided base_asset is not allowed to be used as base_asset. InvalidBaseAsset, /// A foreign asset in not registered in AssetRegistry. UnregisteredForeignAsset, + /// The start of the global dispute for this market happened already. + GlobalDisputeExistsAlready, } #[pallet::event] diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index ac75cfe9a..f7807b67a 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -57,8 +57,8 @@ use zeitgeist_primitives::{ }; use zeitgeist_primitives::constants::mock::{ - GlobalDisputeLockId, GlobalDisputePeriod, GlobalDisputesPalletId, MaxGlobalDisputeVotes, - MaxOwners, MinOutcomeVoteAmount, RemoveKeysLimit, VotingOutcomeFee, + AddOutcomePeriod, GdVotingPeriod, GlobalDisputeLockId, GlobalDisputesPalletId, + MaxGlobalDisputeVotes, MaxOwners, MinOutcomeVoteAmount, RemoveKeysLimit, VotingOutcomeFee, }; use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV}; @@ -124,7 +124,6 @@ impl crate::Config for Runtime { type DisputeBond = DisputeBond; type RuntimeEvent = RuntimeEvent; type GlobalDisputes = GlobalDisputes; - type GlobalDisputePeriod = GlobalDisputePeriod; type LiquidityMining = LiquidityMining; type MaxCategories = MaxCategories; type MaxDisputes = MaxDisputes; @@ -314,7 +313,9 @@ impl zrml_simple_disputes::Config for Runtime { } impl zrml_global_disputes::Config for Runtime { + type AddOutcomePeriod = AddOutcomePeriod; type RuntimeEvent = RuntimeEvent; + type DisputeResolution = prediction_markets::Pallet; type MarketCommons = MarketCommons; type Currency = Balances; type GlobalDisputeLockId = GlobalDisputeLockId; @@ -323,6 +324,7 @@ impl zrml_global_disputes::Config for Runtime { type MaxOwners = MaxOwners; type MinOutcomeVoteAmount = MinOutcomeVoteAmount; type RemoveKeysLimit = RemoveKeysLimit; + type GdVotingPeriod = GdVotingPeriod; type VotingOutcomeFee = VotingOutcomeFee; type WeightInfo = zrml_global_disputes::weights::WeightInfo; } diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index ef76e330d..2269a8455 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -50,7 +50,10 @@ use zeitgeist_primitives::{ Moment, MultiHash, OutcomeReport, PoolStatus, ScalarPosition, ScoringRule, }, }; -use zrml_global_disputes::GlobalDisputesPalletApi; +use zrml_global_disputes::{ + types::{OutcomeInfo, Possession}, + GlobalDisputesPalletApi, Outcomes, PossessionOf, +}; use zrml_market_commons::MarketCommonsPalletApi; use zrml_swaps::Pools; const LIQUIDITY: u128 = 100 * BASE; @@ -3447,7 +3450,6 @@ fn it_appeals_a_court_market_to_global_dispute() { OutcomeReport::Categorical(0) )); - let dispute_block = report_at; assert_ok!(PredictionMarkets::dispute(RuntimeOrigin::signed(CHARLIE), market_id,)); for _ in 0..(MaxAppeals::get() - 1) { @@ -3472,27 +3474,33 @@ fn it_appeals_a_court_market_to_global_dispute() { CError::::MaxAppealsReached ); - assert!(!GlobalDisputes::is_started(&market_id)); + assert!(!GlobalDisputes::does_exist(&market_id)); assert_ok!(PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(BOB), market_id)); let now = >::block_number(); - assert!(GlobalDisputes::is_started(&market_id)); + assert!(GlobalDisputes::does_exist(&market_id)); System::assert_last_event(Event::GlobalDisputeStarted(market_id).into()); - // remove_last_dispute_from_market_ids_per_dispute_block works - let removable_market_ids = MarketIdsPerDisputeBlock::::get(dispute_block); - assert_eq!(removable_market_ids.len(), 0); - - let market_ids = MarketIdsPerDisputeBlock::::get( - now + ::GlobalDisputePeriod::get(), + // report check + let possession: PossessionOf = + Possession::Shared { owners: frame_support::BoundedVec::try_from(vec![BOB]).unwrap() }; + let outcome_info = OutcomeInfo { outcome_sum: Zero::zero(), possession }; + assert_eq!( + Outcomes::::get(market_id, &OutcomeReport::Categorical(0)).unwrap(), + outcome_info ); + + let add_outcome_end = now + GlobalDisputes::get_add_outcome_period(); + let vote_end = add_outcome_end + GlobalDisputes::get_vote_period(); + let market_ids = MarketIdsPerDisputeBlock::::get(vote_end); assert_eq!(market_ids, vec![market_id]); + assert!(GlobalDisputes::is_active(&market_id)); assert_noop!( PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(CHARLIE), market_id), - Error::::GlobalDisputeAlreadyStarted + Error::::GlobalDisputeExistsAlready ); }; ExtBuilder::default().build().execute_with(|| {