diff --git a/Cargo.lock b/Cargo.lock index 65578627f9..5b49d3ec79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.0", + "gimli 0.31.1", ] [[package]] @@ -77,7 +77,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom", + "getrandom 0.2.16", "once_cell", "version_check", ] @@ -89,10 +89,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.16", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -127,9 +127,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -142,43 +142,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "approx" @@ -200,7 +201,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -293,7 +294,7 @@ dependencies = [ "blake2 0.10.6", "derivative", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.9", "tracing", ] @@ -567,7 +568,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -583,7 +584,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -607,8 +608,8 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", - "synstructure 0.13.1", + "syn 2.0.101", + "synstructure 0.13.2", ] [[package]] @@ -630,7 +631,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -652,9 +653,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -663,7 +664,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.37", + "rustix 0.38.44", "slab", "tracing", "windows-sys 0.59.0", @@ -675,20 +676,20 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -732,13 +733,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -753,11 +754,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.1", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object 0.36.4", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -794,9 +795,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bincode" @@ -819,13 +820,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.22", + "prettyplease 0.2.32", "proc-macro2", "quote", "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -852,9 +853,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bitvec" @@ -891,9 +892,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", @@ -902,9 +903,9 @@ dependencies = [ [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "e90f7deecfac93095eb874a40febd69427776e24e1bd7f87f33ac62d6f0174df" dependencies = [ "arrayref", "arrayvec", @@ -913,9 +914,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.4" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -944,9 +945,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" dependencies = [ "log", "parity-scale-codec", @@ -980,15 +981,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "byte-tools" @@ -998,9 +999,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" [[package]] name = "byteorder" @@ -1010,18 +1011,17 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bzip2-sys" -version = "0.1.11+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -1046,9 +1046,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -1061,10 +1061,10 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.26", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1075,9 +1075,9 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ "jobserver", "libc", @@ -1150,9 +1150,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1160,7 +1160,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -1222,9 +1222,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -1232,9 +1232,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -1245,37 +1245,38 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codespan-reporting" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ + "serde", "termcolor", "unicode-width", ] [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" @@ -1289,12 +1290,11 @@ dependencies = [ [[package]] name = "comfy-table" -version = "7.1.1" +version = "7.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" +checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" dependencies = [ - "strum 0.26.3", - "strum_macros 0.26.4", + "unicode-segmentation", "unicode-width", ] @@ -1315,15 +1315,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "unicode-width", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1347,11 +1347,31 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom", + "getrandom 0.2.16", "once_cell", "tiny-keccak", ] +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.3.1" @@ -1406,9 +1426,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1537,9 +1557,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1565,15 +1585,15 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" @@ -1595,7 +1615,7 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core", - "typenum 1.17.0", + "typenum 1.18.0", ] [[package]] @@ -1651,58 +1671,73 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "cxx" -version = "1.0.128" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ccead7d199d584d139148b04b4a368d1ec7556a1d9ea2548febb1b9d49f9a4" +checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741" dependencies = [ "cc", + "cxxbridge-cmd", "cxxbridge-flags", "cxxbridge-macro", + "foldhash", "link-cplusplus", ] [[package]] name = "cxx-build" -version = "1.0.128" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77953e99f01508f89f55c494bfa867171ef3a6c8cea03d26975368f2121a5c1" +checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7" dependencies = [ "cc", "codespan-reporting", - "once_cell", "proc-macro2", "quote", "scratch", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279" +dependencies = [ + "clap", + "codespan-reporting", + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] name = "cxxbridge-flags" -version = "1.0.128" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65777e06cc48f0cb0152024c77d6cf9e4bdb4408e7b48bea993d42fa0f5b02b6" +checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4" [[package]] name = "cxxbridge-macro" -version = "1.0.128" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98532a60dedaebc4848cb2cba5023337cc9ea3af16a5b062633fabfd9f18fb60" +checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "rustversion", + "syn 2.0.101", ] [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ "darling_core", "darling_macro", @@ -1710,27 +1745,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -1748,15 +1783,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "data-encoding-macro" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +checksum = "47ce6c96ea0102f01122a185683611bd5ac8d99e62bc59dd12e6bda344ee673d" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1764,19 +1799,19 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.13" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.101", ] [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "zeroize", @@ -1812,9 +1847,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", "serde", @@ -1839,20 +1874,40 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -1941,23 +1996,23 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "docify" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" dependencies = [ "common-path", "derive-syn-parse", @@ -1965,9 +2020,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.101", "termcolor", - "toml 0.8.19", + "toml 0.8.22", "walkdir", ] @@ -1985,15 +2040,15 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dtoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" [[package]] name = "dyn-clonable" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" dependencies = [ "dyn-clonable-impl", "dyn-clone", @@ -2001,20 +2056,20 @@ dependencies = [ [[package]] name = "dyn-clonable-impl" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.101", ] [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "ecdsa" @@ -2051,7 +2106,7 @@ dependencies = [ "ed25519", "rand_core", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "subtle 2.6.1", "zeroize", ] @@ -2067,15 +2122,15 @@ dependencies = [ "hashbrown 0.14.5", "hex", "rand_core", - "sha2 0.10.8", + "sha2 0.10.9", "zeroize", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ "serde", ] @@ -2102,9 +2157,9 @@ dependencies = [ [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enum-as-inner" @@ -2127,27 +2182,27 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -2171,18 +2226,18 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2193,9 +2248,9 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] @@ -2226,12 +2281,12 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom", "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", - "primitive-types", + "impl-serde 0.4.0", + "primitive-types 0.12.2", "scale-info", - "uint", + "uint 0.9.5", ] [[package]] @@ -2242,9 +2297,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -2253,11 +2308,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "pin-project-lite", ] @@ -2275,7 +2330,7 @@ dependencies = [ "evm-runtime", "log", "parity-scale-codec", - "primitive-types", + "primitive-types 0.12.2", "rlp", "scale-info", "serde", @@ -2289,7 +2344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1da6cedc5cedb4208e59467106db0d1f50db01b920920589f8e672c02fdc04f" dependencies = [ "parity-scale-codec", - "primitive-types", + "primitive-types 0.12.2", "scale-info", "serde", ] @@ -2303,7 +2358,7 @@ dependencies = [ "environmental", "evm-core", "evm-runtime", - "primitive-types", + "primitive-types 0.12.2", ] [[package]] @@ -2315,7 +2370,7 @@ dependencies = [ "auto_impl", "environmental", "evm-core", - "primitive-types", + "primitive-types 0.12.2", "sha3", ] @@ -2337,10 +2392,10 @@ dependencies = [ "blake2 0.10.6", "file-guard", "fs-err", - "prettyplease 0.2.22", + "prettyplease 0.2.32", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -2357,9 +2412,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fc-api" @@ -2386,7 +2441,7 @@ dependencies = [ "sp-block-builder", "sp-consensus", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2492,7 +2547,7 @@ dependencies = [ "sp-storage 21.0.0", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -2535,14 +2590,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core", "subtle 2.6.1", @@ -2588,9 +2643,9 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" +checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc" dependencies = [ "either", "futures", @@ -2648,9 +2703,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "foreign-types" @@ -2691,7 +2746,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ "nonempty", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2700,7 +2755,7 @@ version = "1.0.0-dev" source = "git+https://github.com/opentensor/frontier?rev=635bdac882#635bdac882333afed827053f31ef56ab739f7a2e" dependencies = [ "hex", - "impl-serde", + "impl-serde 0.4.0", "libsecp256k1", "log", "parity-scale-codec", @@ -2790,9 +2845,9 @@ dependencies = [ [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" @@ -2864,7 +2919,7 @@ dependencies = [ "sp-storage 21.0.0", "sp-trie", "sp-wasm-interface 21.0.1", - "thiserror", + "thiserror 1.0.69", "thousands", ] @@ -2967,11 +3022,11 @@ dependencies = [ "frame-support-procedural-tools 13.0.0", "itertools 0.11.0", "macro_magic", - "proc-macro-warning 1.0.2", + "proc-macro-warning 1.84.1", "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -2981,10 +3036,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" dependencies = [ "frame-support-procedural-tools-derive 11.0.0", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -2993,10 +3048,10 @@ version = "13.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ "frame-support-procedural-tools-derive 12.0.0", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3007,7 +3062,7 @@ checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3017,7 +3072,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3172,9 +3227,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "futures-core", "pin-project-lite", @@ -3188,7 +3243,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3252,7 +3307,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.17.0", + "typenum 1.18.0", ] [[package]] @@ -3261,7 +3316,7 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.17.0", + "typenum 1.18.0", "version_check", "zeroize", ] @@ -3278,13 +3333,25 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", - "wasi", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -3330,15 +3397,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "governor" @@ -3383,7 +3450,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -3392,17 +3459,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.6.0", + "http 1.3.1", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -3426,7 +3493,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3474,9 +3541,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" dependencies = [ "allocator-api2", "equivalent", @@ -3494,11 +3561,11 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.3", ] [[package]] @@ -3525,6 +3592,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hermit-abi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" + [[package]] name = "hex" version = "0.4.3" @@ -3587,22 +3660,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "hostname" -version = "0.3.1" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "libc", - "match_cfg", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3618,9 +3680,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -3645,27 +3707,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.3.1", ] [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", - "http 1.1.0", + "futures-core", + "http 1.3.1", "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -3675,15 +3737,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -3696,7 +3758,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -3705,15 +3767,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.9", + "http 1.3.1", "http-body 1.0.1", "httparse", "httpdate", @@ -3731,7 +3793,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.32", "log", "rustls 0.21.12", "rustls-native-certs", @@ -3741,15 +3803,15 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.3.1", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.6.0", "pin-project-lite", "tokio", "tower-service", @@ -3757,16 +3819,17 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core 0.61.0", ] [[package]] @@ -3778,6 +3841,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -3807,12 +3988,23 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -3827,9 +4019,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ "async-io", "core-foundation", @@ -3838,6 +4030,10 @@ dependencies = [ "if-addrs", "ipnet", "log", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", + "netlink-sys", "rtnetlink", "system-configuration", "tokio", @@ -3855,7 +4051,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.32", "log", "rand", "tokio", @@ -3872,6 +4068,26 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + [[package]] name = "impl-rlp" version = "0.3.0" @@ -3890,15 +4106,24 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.101", ] [[package]] @@ -3933,19 +4158,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.3", ] [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "generic-array 0.14.7", ] @@ -3991,7 +4216,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.7", + "socket2 0.5.9", "widestring", "windows-sys 0.48.0", "winreg", @@ -3999,19 +4224,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi 0.5.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4049,33 +4274,35 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.2", "libc", ] [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "jsonrpsee" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" +checksum = "37b26c20e2178756451cfeb0661fb74c47dd5988cb7e3939de7e9241fd604d42" dependencies = [ "jsonrpsee-core", "jsonrpsee-proc-macros", @@ -4087,51 +4314,51 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2882f6f8acb9fdaec7cefc4fd607119a9bd709831df7d7672a1d3b644628280" +checksum = "456196007ca3a14db478346f58c7238028d55ee15c1df15115596e411ff27925" dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", + "http 1.3.1", "http-body 1.0.1", "http-body-util", "jsonrpsee-types", "parking_lot 0.12.3", "rand", - "rustc-hash 2.0.0", + "rustc-hash 2.1.1", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06c01ae0007548e73412c08e2285ffe5d723195bf268bce67b1b77c3bb2a14d" +checksum = "5e65763c942dfc9358146571911b0cd1c361c2d63e2d2305622d40d36376ca80" dependencies = [ "heck 0.5.0", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "jsonrpsee-server" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ad8ddc14be1d4290cd68046e7d1d37acd408efed6d3ca08aefcc3ad6da069c" +checksum = "55e363146da18e50ad2b51a0a7925fc423137a0b1371af8235b1c231a0647328" dependencies = [ "futures-util", - "http 1.1.0", + "http 1.3.1", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.6.0", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -4140,7 +4367,7 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-util", @@ -4150,14 +4377,14 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.7" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a178c60086f24cc35bb82f57c651d0d25d99c4742b4d335de04e97fa1f08a8a1" +checksum = "08a8e70baf945b6b5752fc8eb38c918a48f1234daf11355e07106d963f860089" dependencies = [ - "http 1.1.0", + "http 1.3.1", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4171,7 +4398,7 @@ dependencies = [ "elliptic-curve", "once_cell", "serdect", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] @@ -4236,15 +4463,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", @@ -4252,9 +4479,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "c9627da5196e5d8ed0b0495e61e518847578da83483c37288316d9b2e03a7f72" [[package]] name = "libp2p" @@ -4266,7 +4493,7 @@ dependencies = [ "either", "futures", "futures-timer", - "getrandom", + "getrandom 0.2.16", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -4290,7 +4517,7 @@ dependencies = [ "multiaddr 0.18.2", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4331,7 +4558,7 @@ dependencies = [ "libp2p-identity", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.3", "multistream-select", "once_cell", "parking_lot 0.12.3", @@ -4340,7 +4567,7 @@ dependencies = [ "rand", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.7.2", "void", ] @@ -4380,24 +4607,24 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "smallvec", - "thiserror", + "thiserror 1.0.69", "void", ] [[package]] name = "libp2p-identity" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +checksum = "fbb68ea10844211a59ce46230909fd0ea040e8a192454d4cc2ee0d53e12280eb" dependencies = [ "bs58 0.5.1", "ed25519-dalek", "hkdf", - "multihash 0.19.2", + "multihash 0.19.3", "quick-protobuf", "rand", - "sha2 0.10.8", - "thiserror", + "sha2 0.10.9", + "thiserror 2.0.12", "tracing", "zeroize", ] @@ -4423,10 +4650,10 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "rand", - "sha2 0.10.8", + "sha2 0.10.9", "smallvec", - "thiserror", - "uint", + "thiserror 1.0.69", + "uint 0.9.5", "unsigned-varint 0.7.2", "void", ] @@ -4446,7 +4673,7 @@ dependencies = [ "log", "rand", "smallvec", - "socket2 0.5.7", + "socket2 0.5.9", "tokio", "trust-dns-proto 0.22.0", "void", @@ -4482,14 +4709,14 @@ dependencies = [ "libp2p-identity", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.3", "once_cell", "quick-protobuf", "rand", - "sha2 0.10.8", + "sha2 0.10.9", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.69", "x25519-dalek", "zeroize", ] @@ -4531,8 +4758,8 @@ dependencies = [ "rand", "ring 0.16.20", "rustls 0.21.12", - "socket2 0.5.7", - "thiserror", + "socket2 0.5.9", + "thiserror 1.0.69", "tokio", ] @@ -4587,7 +4814,7 @@ dependencies = [ "proc-macro-warning 0.4.2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -4603,7 +4830,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.7", + "socket2 0.5.9", "tokio", ] @@ -4621,7 +4848,7 @@ dependencies = [ "ring 0.16.20", "rustls 0.21.12", "rustls-webpki", - "thiserror", + "thiserror 1.0.69", "x509-parser 0.15.1", "yasna", ] @@ -4672,7 +4899,7 @@ dependencies = [ "pin-project-lite", "rw-stream-sink", "soketto", - "thiserror", + "thiserror 1.0.69", "url", "webpki-roots", ] @@ -4686,7 +4913,7 @@ dependencies = [ "futures", "libp2p-core", "log", - "thiserror", + "thiserror 1.0.69", "yamux", ] @@ -4696,9 +4923,9 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.11", ] [[package]] @@ -4732,7 +4959,7 @@ dependencies = [ "rand", "serde", "sha2 0.9.9", - "typenum 1.17.0", + "typenum 1.18.0", ] [[package]] @@ -4777,9 +5004,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "pkg-config", @@ -4788,9 +5015,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212" dependencies = [ "cc", ] @@ -4803,18 +5030,18 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" dependencies = [ "linked-hash-map", ] [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "a9eda9dcf4f2a99787827661f312ac3219292549c2ee992bf9a6248ffb066bf7" dependencies = [ "nalgebra", ] @@ -4827,9 +5054,15 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lioness" @@ -4843,6 +5076,12 @@ dependencies = [ "keystream", ] +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + [[package]] name = "litep2p" version = "0.6.2" @@ -4857,7 +5096,7 @@ dependencies = [ "futures", "futures-timer", "hex-literal", - "indexmap 2.6.0", + "indexmap 2.9.0", "libc", "mockall 0.12.1", "multiaddr 0.17.1", @@ -4874,21 +5113,21 @@ dependencies = [ "ring 0.16.20", "rustls 0.20.9", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "simple-dns", "smallvec", "snow", - "socket2 0.5.7", + "socket2 0.5.9", "static_assertions", "str0m", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-tungstenite", "tokio-util", "tracing", "trust-dns-resolver", - "uint", + "uint 0.9.5", "unsigned-varint 0.8.0", "url", "webpki", @@ -4910,9 +5149,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -4929,7 +5168,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.3", ] [[package]] @@ -4943,9 +5182,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.28.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ "lz4-sys", ] @@ -4978,7 +5217,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -4992,7 +5231,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5003,7 +5242,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5014,15 +5253,9 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.90", + "syn 2.0.101", ] -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.1.0" @@ -5060,7 +5293,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.37", + "rustix 0.38.44", ] [[package]] @@ -5133,22 +5366,21 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -5173,7 +5405,7 @@ dependencies = [ "rand_chacha", "rand_distr", "subtle 2.6.1", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -5203,7 +5435,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive 0.12.1", - "predicates 3.1.2", + "predicates 3.1.3", "predicates-tree", ] @@ -5228,7 +5460,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5261,7 +5493,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.2", + "multihash 0.19.3", "percent-encoding", "serde", "static_assertions", @@ -5292,7 +5524,7 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "unsigned-varint 0.7.2", ] @@ -5309,16 +5541,16 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "unsigned-varint 0.7.2", ] [[package]] name = "multihash" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" +checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" dependencies = [ "core2", "unsigned-varint 0.8.0", @@ -5344,6 +5576,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multistream-select" version = "0.13.0" @@ -5360,29 +5598,17 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.6" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" dependencies = [ "approx", "matrixmultiply", - "nalgebra-macros", "num-complex", "num-rational", "num-traits", "simba", - "typenum 1.17.0", -] - -[[package]] -name = "nalgebra-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", + "typenum 1.18.0", ] [[package]] @@ -5396,9 +5622,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -5426,21 +5652,20 @@ dependencies = [ [[package]] name = "netlink-packet-core" -version = "0.4.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" dependencies = [ "anyhow", "byteorder", - "libc", "netlink-packet-utils", ] [[package]] name = "netlink-packet-route" -version = "0.12.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -5459,29 +5684,28 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "netlink-proto" -version = "0.10.0" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" dependencies = [ "bytes", "futures", "log", "netlink-packet-core", "netlink-sys", - "thiserror", - "tokio", + "thiserror 2.0.12", ] [[package]] name = "netlink-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "futures", @@ -5498,15 +5722,15 @@ checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" dependencies = [ "cc", "libc", - "thiserror", + "thiserror 1.0.69", "winapi", ] [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -5598,7 +5822,7 @@ dependencies = [ "subtensor-custom-rpc", "subtensor-custom-rpc-runtime-api", "subtensor-runtime-common", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5619,7 +5843,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "getrandom", + "getrandom 0.2.16", "hex", "log", "pallet-admin-utils", @@ -5657,7 +5881,7 @@ dependencies = [ "rand_chacha", "scale-info", "serde_json", - "sha2 0.10.8", + "sha2 0.10.9", "smallvec", "sp-api", "sp-block-builder", @@ -5842,10 +6066,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5871,9 +6095,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -5898,12 +6122,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -5923,7 +6144,7 @@ version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "cfg-if", "foreign-types", "libc", @@ -5940,29 +6161,29 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.5.0+3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.107" +version = "0.9.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" dependencies = [ "cc", "libc", @@ -6103,7 +6324,7 @@ dependencies = [ "parity-scale-codec", "rand_chacha", "scale-info", - "sha2 0.10.8", + "sha2 0.10.9", "sp-core", "sp-io", "sp-runtime", @@ -6152,7 +6373,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sha2 0.10.8", + "sha2 0.10.9", "sp-ark-bls12-381", "sp-core", "sp-io", @@ -6498,7 +6719,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_with", - "sha2 0.10.8", + "sha2 0.10.9", "share-pool", "sp-core", "sp-io", @@ -6659,29 +6880,31 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", "bytes", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.101", ] [[package]] @@ -6697,7 +6920,7 @@ dependencies = [ "lru 0.8.1", "parity-util-mem-derive", "parking_lot 0.12.3", - "primitive-types", + "primitive-types 0.12.2", "smallvec", "winapi", ] @@ -6768,7 +6991,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.11", "smallvec", "windows-targets 0.52.6", ] @@ -6829,20 +7052,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.12", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" dependencies = [ "pest", "pest_generator", @@ -6850,26 +7073,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" dependencies = [ "once_cell", "pest", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] @@ -6879,34 +7102,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.9.0", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -6926,9 +7149,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkavm" @@ -6939,7 +7162,7 @@ dependencies = [ "libc", "log", "polkavm-assembler", - "polkavm-common", + "polkavm-common 0.9.0", "polkavm-linux-raw", ] @@ -6961,13 +7184,28 @@ dependencies = [ "log", ] +[[package]] +name = "polkavm-common" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" + [[package]] name = "polkavm-derive" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.9.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +dependencies = [ + "polkavm-derive-impl-macro 0.18.0", ] [[package]] @@ -6976,10 +7214,22 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ - "polkavm-common", + "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" +dependencies = [ + "polkavm-common 0.18.0", + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -6988,8 +7238,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ - "polkavm-derive-impl", - "syn 2.0.90", + "polkavm-derive-impl 0.9.0", + "syn 2.0.101", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +dependencies = [ + "polkavm-derive-impl 0.18.1", + "syn 2.0.101", ] [[package]] @@ -7002,7 +7262,7 @@ dependencies = [ "hashbrown 0.14.5", "log", "object 0.32.2", - "polkavm-common", + "polkavm-common 0.9.0", "regalloc2 0.9.3", "rustc-demangle", ] @@ -7015,15 +7275,15 @@ checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.37", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] @@ -7053,9 +7313,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "powerfmt" @@ -7065,11 +7325,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy", + "zerocopy 0.8.25", ] [[package]] @@ -7103,7 +7363,7 @@ source = "git+https://github.com/opentensor/frontier?rev=635bdac882#635bdac88233 dependencies = [ "case", "num_enum", - "prettyplease 0.2.22", + "prettyplease 0.2.32", "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", @@ -7126,9 +7386,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "predicates-core", @@ -7136,15 +7396,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -7162,12 +7422,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -7177,11 +7437,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", - "uint", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.1", + "impl-num-traits", + "uint 0.10.0", ] [[package]] @@ -7190,15 +7462,15 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "thiserror", + "thiserror 1.0.69", "toml 0.5.11", ] [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -7235,25 +7507,25 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "proc-macro-warning" -version = "1.0.2" +version = "1.84.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -7269,12 +7541,12 @@ dependencies = [ "frame-support-procedural-tools 10.0.0", "itertools 0.10.5", "macro_magic", - "proc-macro-warning 1.0.2", + "proc-macro-warning 1.84.1", "proc-macro2", "quote", "regex", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -7288,7 +7560,7 @@ dependencies = [ "lazy_static", "memchr", "parking_lot 0.12.3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -7311,7 +7583,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -7345,7 +7617,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", "prettyplease 0.1.25", "prost 0.11.9", @@ -7366,14 +7638,14 @@ dependencies = [ "heck 0.5.0", "itertools 0.12.1", "log", - "multimap", + "multimap 0.10.0", "once_cell", "petgraph", - "prettyplease 0.2.22", + "prettyplease 0.2.32", "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.101", "tempfile", ] @@ -7400,7 +7672,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -7423,34 +7695,28 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] [[package]] name = "quanta" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", "winapi", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quick-protobuf" version = "0.8.1" @@ -7469,7 +7735,7 @@ dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.7.2", ] @@ -7485,7 +7751,7 @@ dependencies = [ "quinn-udp 0.3.2", "rustc-hash 1.1.0", "rustls 0.20.9", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "webpki", @@ -7504,7 +7770,7 @@ dependencies = [ "quinn-udp 0.4.1", "rustc-hash 1.1.0", "rustls 0.21.12", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -7521,7 +7787,7 @@ dependencies = [ "rustc-hash 1.1.0", "rustls 0.20.9", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", "webpki", @@ -7539,7 +7805,7 @@ dependencies = [ "rustc-hash 1.1.0", "rustls 0.21.12", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -7565,20 +7831,26 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.7", + "socket2 0.5.9", "tracing", "windows-sys 0.48.0", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -7612,7 +7884,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", ] [[package]] @@ -7636,11 +7908,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "11.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -7692,11 +7964,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -7705,29 +7977,29 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "ref-cast" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -7757,13 +8029,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -7778,9 +8050,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -7801,13 +8073,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "resolv-conf" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] +checksum = "fc7c8f7f733062b66dc1c63f9db168ac0b97a9210e247fa90fdc9ad08f51b302" [[package]] name = "rfc6979" @@ -7836,13 +8104,13 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.16", "libc", "untrusted 0.9.0", "windows-sys 0.52.0", @@ -7897,38 +8165,41 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.3.1" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +checksum = "66d4c8b64f049c6721ec8ccec37ddfc3d641c4a7fca57e8f2a89de509c73df39" dependencies = [ "libc", "rtoolbox", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "rtnetlink" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +checksum = "7a552eb82d19f38c3beed3f786bd23aa434ceb9ac43ab44419ca6d67a7e186c0" dependencies = [ "futures", "log", + "netlink-packet-core", "netlink-packet-route", + "netlink-packet-utils", "netlink-proto", + "netlink-sys", "nix", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "rtoolbox" -version = "0.0.2" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +checksum = "a7cc970b249fbe527d6e02e0a227762c9108b2f49d81094fe357ffc6d14d7f6f" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -7945,9 +8216,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc-hex" @@ -7970,7 +8241,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.26", ] [[package]] @@ -7998,15 +8269,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", ] [[package]] @@ -8027,7 +8311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.13", + "ring 0.17.14", "rustls-webpki", "sct", ] @@ -8059,15 +8343,15 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.13", + "ring 0.17.14", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rw-stream-sink" @@ -8082,9 +8366,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "safe-math" @@ -8106,9 +8390,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -8130,7 +8414,7 @@ dependencies = [ "log", "sp-core", "sp-wasm-interface 21.0.1", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8202,10 +8486,10 @@ name = "sc-chain-spec-derive" version = "12.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -8245,7 +8529,7 @@ dependencies = [ "sp-panic-handler", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -8323,7 +8607,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8352,7 +8636,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8388,7 +8672,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8445,7 +8729,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8465,7 +8749,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8500,7 +8784,7 @@ dependencies = [ "sp-runtime", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8558,7 +8842,7 @@ dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface 21.0.1", - "thiserror", + "thiserror 1.0.69", "wasm-instrument", ] @@ -8619,7 +8903,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8648,7 +8932,7 @@ dependencies = [ "sp-keystore", "sp-mixnet", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8693,7 +8977,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "unsigned-varint 0.7.2", @@ -8757,7 +9041,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8792,7 +9076,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -8827,9 +9111,9 @@ dependencies = [ "litep2p", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.3", "rand", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -8843,7 +9127,7 @@ dependencies = [ "fnv", "futures", "futures-timer", - "hyper 0.14.30", + "hyper 0.14.32", "hyper-rustls", "log", "num_cpus", @@ -8925,7 +9209,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8937,9 +9221,9 @@ dependencies = [ "forwarded-header-value", "futures", "governor", - "http 1.1.0", + "http 1.3.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.6.0", "ip_network", "jsonrpsee", "log", @@ -8979,7 +9263,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -9042,7 +9326,7 @@ dependencies = [ "static_init", "substrate-prometheus-endpoint", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "tracing-futures", @@ -9064,7 +9348,7 @@ name = "sc-sysinfo" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "derive_more", + "derive_more 0.99.20", "futures", "libc", "log", @@ -9096,7 +9380,7 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-timer", ] @@ -9123,10 +9407,10 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-tracing 17.0.1", - "thiserror", + "thiserror 1.0.69", "tracing", "tracing-log", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.19", ] [[package]] @@ -9134,10 +9418,10 @@ name = "sc-tracing-proc-macro" version = "11.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -9164,7 +9448,7 @@ dependencies = [ "sp-tracing 17.0.1", "sp-transaction-pool", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9180,7 +9464,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9214,7 +9498,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ - "derive_more", + "derive_more 0.99.20", "parity-scale-codec", "scale-bits", "scale-type-resolver", @@ -9223,13 +9507,13 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ "bitvec", "cfg-if", - "derive_more", + "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", "serde", @@ -9237,14 +9521,14 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.101", ] [[package]] @@ -9255,18 +9539,18 @@ checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash 0.8.11", "cfg-if", @@ -9287,7 +9571,7 @@ dependencies = [ "merlin", "rand_core", "serde_bytes", - "sha2 0.10.8", + "sha2 0.10.9", "subtle 2.6.1", "zeroize", ] @@ -9300,9 +9584,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52" [[package]] name = "sct" @@ -9310,7 +9594,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.13", + "ring 0.17.14", "untrusted 0.9.0", ] @@ -9326,7 +9610,7 @@ dependencies = [ "log", "rand", "slab", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9377,7 +9661,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "core-foundation", "core-foundation-sys", "libc", @@ -9386,9 +9670,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -9414,9 +9698,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -9435,9 +9719,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -9453,9 +9737,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", ] @@ -9472,20 +9756,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -9539,7 +9823,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -9599,9 +9883,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -9644,9 +9928,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] @@ -9663,9 +9947,9 @@ dependencies = [ [[package]] name = "simba" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" dependencies = [ "approx", "num-complex", @@ -9680,7 +9964,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", ] [[package]] @@ -9712,9 +9996,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "snap" @@ -9733,9 +10017,9 @@ dependencies = [ "chacha20poly1305", "curve25519-dalek", "rand_core", - "ring 0.17.13", + "ring 0.17.14", "rustc_version 0.4.1", - "sha2 0.10.8", + "sha2 0.10.9", "subtle 2.6.1", ] @@ -9751,9 +10035,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -9761,14 +10045,14 @@ dependencies = [ [[package]] name = "soketto" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" dependencies = [ "base64 0.22.1", "bytes", "futures", - "http 1.1.0", + "http 1.3.1", "httparse", "log", "rand", @@ -9794,7 +10078,7 @@ dependencies = [ "sp-state-machine", "sp-trie", "sp-version", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9805,10 +10089,10 @@ dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -9840,7 +10124,7 @@ dependencies = [ [[package]] name = "sp-ark-bls12-381" version = "0.4.2" -source = "git+https://github.com/paritytech/substrate-curves#caa2eed74beb885dd07c7db5f916f2281dad818f" +source = "git+https://github.com/paritytech/substrate-curves#f08093a5f7c32778eae1295430ec064dccd062a6" dependencies = [ "ark-bls12-381-ext", "sp-crypto-ec-utils 0.10.0", @@ -9871,7 +10155,7 @@ dependencies = [ "sp-database", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -9887,7 +10171,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9967,7 +10251,7 @@ dependencies = [ "futures", "hash-db", "hash256-std-hasher", - "impl-serde", + "impl-serde 0.4.0", "itertools 0.11.0", "k256", "libsecp256k1", @@ -9977,7 +10261,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "primitive-types", + "primitive-types 0.12.2", "rand", "scale-info", "schnorrkel", @@ -9992,7 +10276,7 @@ dependencies = [ "sp-storage 21.0.0", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.69", "tracing", "w3f-bls", "zeroize", @@ -10001,7 +10285,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -10047,7 +10331,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "twox-hash", ] @@ -10060,7 +10344,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "twox-hash", ] @@ -10072,7 +10356,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -10091,23 +10375,23 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "environmental", "parity-scale-codec", @@ -10146,7 +10430,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -10160,7 +10444,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.9.1", "rustversion", "secp256k1", "sp-core", @@ -10201,7 +10485,7 @@ name = "sp-maybe-compressed-blob" version = "11.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "thiserror", + "thiserror 1.0.69", "zstd 0.12.4", ] @@ -10285,13 +10569,13 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.18.0", + "primitive-types 0.13.1", "sp-externalities 0.25.0", "sp-runtime-interface-proc-macro 17.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", @@ -10309,8 +10593,8 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.9.1", + "primitive-types 0.12.2", "sp-externalities 0.29.0", "sp-runtime-interface-proc-macro 18.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", @@ -10323,14 +10607,14 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -10340,10 +10624,10 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -10388,7 +10672,7 @@ dependencies = [ "sp-externalities 0.29.0", "sp-panic-handler", "sp-trie", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db", ] @@ -10405,7 +10689,7 @@ dependencies = [ "parity-scale-codec", "rand", "scale-info", - "sha2 0.10.8", + "sha2 0.10.9", "sp-api", "sp-application-crypto", "sp-core", @@ -10413,7 +10697,7 @@ dependencies = [ "sp-externalities 0.29.0", "sp-runtime", "sp-runtime-interface 28.0.0", - "thiserror", + "thiserror 1.0.69", "x25519-dalek", ] @@ -10425,14 +10709,14 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ - "impl-serde", + "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", @@ -10444,7 +10728,7 @@ name = "sp-storage" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "impl-serde", + "impl-serde 0.4.0", "parity-scale-codec", "ref-cast", "serde", @@ -10460,18 +10744,18 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.19", ] [[package]] @@ -10482,7 +10766,7 @@ dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.3.18", + "tracing-subscriber 0.3.19", ] [[package]] @@ -10525,7 +10809,7 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities 0.29.0", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db", "trie-root", @@ -10536,7 +10820,7 @@ name = "sp-version" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "impl-serde", + "impl-serde 0.4.0", "parity-scale-codec", "parity-wasm", "scale-info", @@ -10545,7 +10829,7 @@ dependencies = [ "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", "sp-version-proc-macro", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -10556,13 +10840,13 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#03f3c2991d1175913bf9d66e0e5b54e543a34ca4" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10630,21 +10914,11 @@ dependencies = [ "der", ] -[[package]] -name = "sqlformat" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" -dependencies = [ - "nom", - "unicode_categories", -] - [[package]] name = "sqlx" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" +checksum = "f3c3a85280daca669cfd3bcb68a337882a8bc57ec882f72c5d13a430613a738e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -10653,37 +10927,32 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" +checksum = "f743f2a3cea30a58cd479013f75550e879009e3a02f616f18ca699335aa248c3" dependencies = [ - "atoi", - "byteorder", + "base64 0.22.1", "bytes", "crc", "crossbeam-queue", "either", - "event-listener 5.3.1", - "futures-channel", + "event-listener 5.4.0", "futures-core", "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.14.5", - "hashlink 0.9.1", - "hex", - "indexmap 2.6.0", + "hashbrown 0.15.3", + "hashlink 0.10.0", + "indexmap 2.9.0", "log", "memchr", "native-tls", "once_cell", - "paste", "percent-encoding", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "smallvec", - "sqlformat", - "thiserror", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -10692,22 +10961,22 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +checksum = "7f4200e0fde19834956d4252347c12a083bdcb237d7a1a1446bffd8768417dce" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "sqlx-macros-core" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" +checksum = "882ceaa29cade31beca7129b6beeb05737f44f82dbe2a9806ecea5a7093d00b7" dependencies = [ "dotenvy", "either", @@ -10718,10 +10987,10 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2 0.10.8", + "sha2 0.10.9", "sqlx-core", "sqlx-sqlite", - "syn 2.0.90", + "syn 2.0.101", "tempfile", "tokio", "url", @@ -10729,9 +10998,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +checksum = "c26083e9a520e8eb87a06b12347679b142dc2ea29e6e409f805644a7a979a5bc" dependencies = [ "atoi", "flume", @@ -10746,15 +11015,16 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", + "thiserror 2.0.12", "tracing", "url", ] [[package]] name = "ss58-registry" -version = "1.50.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43fce22ed1df64d04b262351c8f9d5c6da4f76f79f25ad15529792f893fad25d" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" dependencies = [ "Inflector", "num-format", @@ -10813,9 +11083,9 @@ dependencies = [ [[package]] name = "static_init_macro" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +checksum = "1389c88ddd739ec6d3f8f83343764a0e944cd23cfbf126a9796a714b0b6edd6f" dependencies = [ "cfg_aliases", "memchr", @@ -10840,7 +11110,7 @@ dependencies = [ "sctp-proto", "serde", "sha-1", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -10888,7 +11158,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -10899,7 +11169,7 @@ dependencies = [ "hmac 0.12.1", "pbkdf2", "schnorrkel", - "sha2 0.10.8", + "sha2 0.10.9", "zeroize", ] @@ -10945,11 +11215,11 @@ version = "0.17.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ "http-body-util", - "hyper 1.5.0", + "hyper 1.6.0", "hyper-util", "log", "prometheus", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -10977,7 +11247,7 @@ dependencies = [ "sp-version", "strum 0.26.3", "tempfile", - "toml 0.8.19", + "toml 0.8.22", "walkdir", "wasm-opt", ] @@ -10992,7 +11262,7 @@ dependencies = [ "quote", "rayon", "subtensor-linting", - "syn 2.0.90", + "syn 2.0.101", "walkdir", ] @@ -11030,7 +11300,7 @@ dependencies = [ "proc-macro2", "procedural-fork", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -11040,7 +11310,7 @@ dependencies = [ "ahash 0.8.11", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -11084,7 +11354,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "semver 1.0.23", + "semver 1.0.26", "toml_edit", ] @@ -11113,9 +11383,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -11136,31 +11406,31 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -11180,14 +11450,14 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.3.2", "once_cell", - "rustix 0.38.37", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -11202,38 +11472,58 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 0.38.37", + "rustix 1.0.7", "windows-sys 0.59.0", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] [[package]] name = "thiserror" -version = "1.0.64" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -11273,9 +11563,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -11288,15 +11578,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -11311,11 +11601,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -11349,7 +11649,7 @@ dependencies = [ "serde", "serde_cbor", "serde_json", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", "w3f-bls", ] @@ -11367,7 +11667,7 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2 0.5.9", "tokio-macros", "windows-sys 0.52.0", ] @@ -11380,7 +11680,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -11395,9 +11695,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -11422,9 +11722,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -11445,9 +11745,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" dependencies = [ "serde", "serde_spanned", @@ -11457,26 +11757,33 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", + "toml_write", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" + [[package]] name = "tower" version = "0.4.13" @@ -11498,9 +11805,9 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.0", "bytes", - "http 1.1.0", + "http 1.3.1", "http-body 1.0.1", "http-body-util", "pin-project-lite", @@ -11522,9 +11829,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -11534,20 +11841,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -11585,9 +11892,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -11643,7 +11950,7 @@ dependencies = [ "rand", "smallvec", "socket2 0.4.10", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -11668,7 +11975,7 @@ dependencies = [ "once_cell", "rand", "smallvec", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -11690,7 +11997,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "trust-dns-proto 0.23.2", @@ -11723,7 +12030,7 @@ dependencies = [ "rand", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -11751,9 +12058,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ucd-trie" @@ -11773,17 +12080,29 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicode-bidi" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" @@ -11794,11 +12113,17 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unicode-xid" @@ -11806,12 +12131,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - [[package]] name = "universal-hash" version = "0.5.1" @@ -11858,12 +12177,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", ] @@ -11873,6 +12192,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -11881,9 +12212,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -11921,9 +12252,9 @@ dependencies = [ "rand", "rand_chacha", "rand_core", - "sha2 0.10.8", + "sha2 0.10.9", "sha3", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -11952,49 +12283,59 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12002,22 +12343,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-instrument" @@ -12039,7 +12383,7 @@ dependencies = [ "strum 0.24.1", "strum_macros 0.24.3", "tempfile", - "thiserror", + "thiserror 1.0.69", "wasm-opt-cxx-sys", "wasm-opt-sys", ] @@ -12144,7 +12488,7 @@ dependencies = [ "log", "rustix 0.36.17", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "toml 0.5.11", "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", @@ -12166,7 +12510,7 @@ dependencies = [ "log", "object 0.30.4", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", @@ -12201,7 +12545,7 @@ dependencies = [ "object 0.30.4", "serde", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser", "wasmtime-types", ] @@ -12284,15 +12628,15 @@ checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", - "thiserror", + "thiserror 1.0.69", "wasmparser", ] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -12304,7 +12648,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.13", + "ring 0.17.14", "untrusted 0.9.0", ] @@ -12323,14 +12667,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.37", + "rustix 0.38.44", ] [[package]] name = "wide" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" +checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" dependencies = [ "bytemuck", "safe_arch", @@ -12338,9 +12682,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" [[package]] name = "winapi" @@ -12375,32 +12719,92 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows-core 0.53.0", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ - "windows-targets 0.48.5", + "windows-result 0.1.2", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result 0.3.2", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -12632,9 +13036,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" dependencies = [ "memchr", ] @@ -12649,6 +13053,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -12683,7 +13108,7 @@ dependencies = [ "nom", "oid-registry 0.6.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -12700,7 +13125,7 @@ dependencies = [ "nom", "oid-registry 0.7.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -12712,14 +13137,14 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "xml-rs" -version = "0.8.22" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "xmltree" @@ -12754,14 +13179,46 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure 0.13.2", +] + [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive 0.8.25", ] [[package]] @@ -12772,7 +13229,39 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure 0.13.2", ] [[package]] @@ -12792,7 +13281,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -12835,9 +13346,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/docs/consensus.md b/docs/consensus.md index 881b465b48..c3a04c380f 100644 --- a/docs/consensus.md +++ b/docs/consensus.md @@ -17,6 +17,8 @@ Community oversight (as in Steemit) must identify wrongful downvoting, but only High-volume, on-demand generative content (as in Bittensor) demands automated evaluation and divide-and-conquer validation, but introduces subjectivity both in the automated value measures and mutually exclusive task subsets across subnet validators. A coalition of validators can collude to skew scoring of subnet servers in their favour, which is harder to detect because of the inherent subjectivity. Existing consensus mechanisms will fail to deter reward manipulation for such high-volume subjective utility networks, so the need for a more sophisticated consensus arises. +--- + ### Consensus Mechanism Yuma Consensus guarantees long-term network honesty despite persistent adversarial presence in high-volume subjective utility networks. It directly penalizes selfish scoring by down-correction to the majority consensus and slashing of cabal voting stake, and also penalizes low-scoring of honest servers via forfeited validator rewards when cabals don’t score at consensus. @@ -31,6 +33,8 @@ Yuma Consensus is adversarially-resilient when majority stake is honest, via sta **Cabal sets high self-weight**: Cabal servers with poor utility will receive low weights from majority stake, and high self-weight from minority cabals will then get reduced to the low consensus. This means that minority cabals lose voting power as penalty for unfair voting while still receiving low consensus weight despite high self-weight. This consensus mechanism thus protects against selfish weighting if the majority stake is honest. +--- + ### Game-theoretic framework #### Preliminaries @@ -112,6 +116,64 @@ let mut ema_bonds: Vec> = mat_ema( &bonds_delta, &bonds, alpha ); / let mut dividends: Vec = inplace_normalize(matmul_transpose( &ema_bonds, &incentive )); // Validator reward ``` +--- + +### Monte Carlo simulations + +We consider a two-team game between (protagonist) honest stake ($0.5< S_H\le 1$) and (adversarial) cabal stake ($1 - S_H$), with $|H|$ honest and $|C|$ cabal players, that have $S_H = \sum_{i\in H}S_i$ honest stake and $1-S_H = \sum_{i\in C}S_i$ cabal stake. + +#### Network sizing + +A network size of $N=|H|+|C|=(|H_V|+|H_S|)+(|C_V|+|C_S|)=512$ and validator count of $|H_V|+|C_V|=64$ is considered for consensus guarantee experiments, and the honest/cabal ratio $|H|/N=S_H$ reflects the honest stake ratio $S_H$, but modifying extremes to ensure that each subset has at least one validator and at least one server. + +#### Stake sampling + +For the Monte Carlo simulations we use Gaussian distributions for stake and weight assignments, and ensure that the honest/cabal ratios are met. Note that stake is only assigned to validator nodes $H_V$ and $C_V$ and not servers. + +Firstly, we sample initial validator ($i\in H_V\cup C_V$) stake values $S'_i \sim \mathcal{N}(1,\sigma_S^{2})$ with a typical $\sigma_S=0.3$ standard deviation, followed by clamping to avoid negative stake: + +$$S'_i = \begin{cases} +x & \text{if } x \sim \mathcal{N}(1, \sigma_S^2), x \ge 0 \\ +0 & \text{if } x \sim \mathcal{N}(1, \sigma_S^2), x < 0 +\end{cases}$$ + +Then we normalize each honest/cabal subset and multiply by its stake proportion, which thus gives an overall normalized stake and the correct stake ratio for each subset: + +$$S_{i\in H_V} = S_H \cdot S'\_i \left/ \sum_{k\in H_V} S'\_k\right.\qquad\qquad S_{i\in C_V} = (1-S_H)\cdot S'\_i \left/ \sum_{k\in C_V}S'\_k\right.$$ + +#### Weight sampling + +Similarly, we randomize the weights that validators $H_V,C_V$ set on servers $H_S,C_S$. +Specifically, honest players $i\in H$ set $W_H = \sum_{j\in H}W_{ij}$ self-weight and $1-W_H = \sum_{j\in C}W_{ij}$ weight on cabal players, while cabal players $i\in C$ set $W_C = \sum_{j\in C}W_{ij}$ self-weight and $1-W_C = \sum_{j\in H}W_{ij}$ weight on honest players. + +We firstly sample initial weights $W'_{ij} \sim \mathcal{N}(1,\sigma_W^{2})$ with various standard deviations ranging in $0\ge\sigma_W\ge0.4$, but then clamping to avoid negative weights: + +$$W'_{ij} = \begin{cases} +x & \text{if } x \sim \mathcal{N}(1, \sigma_S^2), x \geq 0 \\ +0 & \text{if } x \sim \mathcal{N}(1, \sigma_S^2), x < 0 +\end{cases}$$ + +Weight setting between the two subsets forms quadrants $H_V\rightarrow H_S$, $H_V\rightarrow C_S$, $C_V\rightarrow H_S$, and $C_V\rightarrow C_S$, so we ensure those weight ratios are met by normalizing each weight subset and multiplying by the corresponding quadrant ratio: + +$$W_{i\in H_V, j\in H_S} = W_H\cdot W'\_{ij} \left/ \sum_{k\in H_S}W'\_{ik}\right.\qquad\qquad W_{i\in H_V, j\in C_S} = (1-W_H)\cdot W'\_{ij} \left/ \sum_{k\in C_S}W'\_{ik}\right.$$ + +$$W_{i\in C_V, j\in H_S} = (1-W_C)\cdot W'\_{ij} \left/ \sum_{k\in H_S}W'\_{ik}\right.\qquad\qquad W_{i\in C_V, j\in C_S} = W_C\cdot W'\_{ij} \left/ \sum_{k\in C_S}W'\_{ik}\right.$$ + +#### Emission calculation + +Given the simulation parameters of the network size, validator count, a defined major/honest stake $S_H$, a defined major/honest utility $W_H$, and a defined minor/cabal self-weight $W_C$, we have now instantiated the network with randomly sampled stake and weights and can proceed with an emission calculation. + +We calculate the consensus $\overline{W_j} = \arg \max_w \left( \sum_i S_i \cdot \left\lbrace W_{ij} \ge w \right\rbrace \ge \kappa \right)$ for each server $j$, and calculate consensus-clipped weights $\overline{W_{ij}} = \min( W_{ij}, \overline{W_j} )$. This then gives us the adjusted weights that offers a measure of protection against reward manipulation. + +To calculate emissions for this epoch, we firstly calculate server rank $R_j = \sum_i S_i \cdot \overline{W_{ij}}$ then incentive $I_j = R_j / \sum_k R_k$, as well as validator bonds $\Delta B_{ij} = S_i \cdot \widetilde{W_{ij}} \left/ \left( \sum_k S_k \cdot \widetilde{W_{kj}} \right) \right.$ and rewards $D_i = \sum_j B_{ij} \cdot I_j$. + +Then we add up server incentive and validator bonds over honest nodes to obtain honest emission $E_H = \xi \cdot D_{i\in H} + (1-\xi) \cdot I_{i\in H}$ with a typical validator reward ratio of $\xi=0.5$. +The objective is to prove major stake retention $S_H\ge E_H$ for a single epoch, which by extension proves retention over many epochs due to additive nature of EMA bonds, so we do not bother with validator EMA bonds in these experiments. + +The honest objective $S_H\le E_H$ at least retains scoring power $S_H$ over all action transitions in the game, otherwise when $E_H\le S_H$ honest emission will erode to 0 over time, despite a starting condition of $0.5\lt S_H$. + +--- + ### Consensus guarantees Yuma Consensus guarantees honest majority stake retention $S_H\le E_H$ even under worst-case adversarial attacks, given sufficiently large honest utility $W_H$. The specific honest stake and utility pairs that delineate the guarantees are complicated by natural variances inside large realistic networks. Therefore, we use extensive random sampling simulations (Monte Carlo studies) of large realistic networks and subject them to varying degrees of adversarial attacks, and calculate comprehensive consensus guarantees under representative conditions. @@ -124,9 +186,9 @@ The x-axis is major self-weight and the y-axis is minor self-weight, and each co Major/honest self-weight $W_H$ is the true honest utility, while minor/cabal self-weight $W_C$ is an arbitrary value a self-serving coalition may self-report.

- - - + + +

To understand how we construct these plots, let us first consider contour plot for a single major/honest stake setting $S_H=0.6$. Here each contour value is the honest emission $E_H$, and we highlight at (1) the specific contour $E_H=0.6$ that matches the honest stake. This means that any weight setting on contour $E_H=S_H=0.6$ will retain honest stake, while any setting to the right of it will grow honest stake. @@ -138,18 +200,20 @@ A compound plot then combines all the highlighted $S_H=E_H$ contours from indivi Retention graphs like these comprehensively capture consensus guarantees across all primary conditions, and we utilize these to analyze the effect of consensus hyperparameters. Subtensor integration tests run Monte Carlo simulations of large realistic networks under adversarial conditions, and constructs retention profiles to confirm consensus guarantees of the actual blockchain implementation. -Retention profiles are reproducible by running [`_map_consensus_guarantees`](../pallets/subtensor/tests/epoch.rs) (decorate with `#[test]`). +Retention profiles are reproducible by running test [`map_consensus_guarantees()`](../pallets/subtensor/src/tests/consensus.rs) and plotting with [`map_consensus.py`](../scripts/map_consensus.py). ```bash -RUST_BACKTRACE=1 SKIP_WASM_BUILD=1 cargo test -- _map_consensus_guarantees --exact --nocapture > consensus.txt +RUST_BACKTRACE=1 SKIP_WASM_BUILD=1 RUSTFLAGS="-C opt-level=3" cargo test --manifest-path=pallets/subtensor/Cargo.toml -- tests::consensus::map_consensus_guarantees --exact --nocapture > consensus.txt + +python scripts/map_consensus.py consensus.txt ``` #### Subjectivity variance Yuma Consensus corrects reward manipulation in subjective utility networks, but the extent of subjectivity influences the exact consensus guarantees. In particular, we expect lower subjectivity to offer improved guarantees since there is stronger consensus. However, for higher variance in assigned weights it is easier to hide reward manipulation, we then expect poorer guarantees.

- - - + + +

We assume normally distributed weights originating from a particular side, either honest or cabal, then we modify the weight deviation magnitude $\sigma(W)$ in terms of the mean weight $\mu(W)$. @@ -167,9 +231,9 @@ Increasing $\kappa$ demands greater honest stake, e.g. when $\kappa=0.6$ there i Hence $\kappa=0.5$ is typically the most sensible setting.

- - - + + +

#### Bonds penalty (β) @@ -179,9 +243,9 @@ Lower-stake validators may experience lower service priority, which can result i Full bonds penalty $\beta=1$ may not be desired, due to the presence of non-adversarial cases like these.

- - - + + +

We expect that greater bonds penalty will penalize out-of-consensus validators more, which means less emission going to cabals. Comprehensive simulation with $\beta = 0$, $0.5$, and $1$ respectively show 78%, 76%, and 73% honest utility requirement. This confirms the expectation, that greater bonds penalty means greater inflation going to the honest majority. @@ -191,10 +255,110 @@ Subnet servers need incentive to deliver high utility, and subnet validators nee We expect that more emission going to validators will improve security guarantees, since self-serving validation can then be economically disincentivized.

- - - + + +

We set validation reward ratio at $\xi=0$, $0.25$, and $0.5$ and respectively observe 82%, 78%, 73% honest utility requirement for 60% honest stake preservation. -This means that network security improves as the validation reward ratio is increased, although a significant server incentive ratio still needs to be maintained to ensure overall high utility. \ No newline at end of file +This means that network security improves as the validation reward ratio is increased, although a significant server incentive ratio still needs to be maintained to ensure overall high utility. + +--- + +### Reproduce Consensus Plots (Runpod) + +This guide demonstrates how to reproduce consensus retention profile plots on a minimal Runpod CPU instance. + +#### 1. Deploy Runpod Instance + +Navigate to https://www.runpod.io/console/deploy and select the following: + +* **Pod Type:** CPU Pod, CPU5 (5.7 GHz • DDR5 RAM • NVMe) or equivalent. +* **Instance Configuration:** Compute-Optimized ($0.07/hr, 2 vCPUs, 4GB RAM). + +**Important:** Edit the template and set "Container Disk (Temporary)" to 20GB. This ensures sufficient disk space for the process. + +Retrieve the connection details, including the SSH command and port, under "Connect" -> "SSH over exposed TCP". You can optionally enable Jupyter access (`8888:localhost:8888`) if desired. Connect to your instance via SSH: + +```bash +ssh -L 8888:localhost:8888 root@ -p -i ~/.ssh/id_ed25519 # Replace placeholders +``` + +#### 2. Set up the Environment + +1. **Start a `tmux` session for persistence:** + + ```bash + tmux + ``` + +2. **Update system packages and install prerequisites (Python, Rust, and dependencies):** + + ```bash + sudo apt-get update && sudo apt install -y build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler python3 python3-pip \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && source ~/.cargo/env && rustup default stable && rustup update \ + && rustup target add wasm32-unknown-unknown \ + && rustup toolchain install nightly \ + && rustup target add --toolchain nightly wasm32-unknown-unknown + + ``` + +3. **Clone the Subtensor repository and checkout the relevant branch:** + + ```bash + git clone https://github.com/opentensor/subtensor.git + cd subtensor + git checkout main + + ``` + + +#### 3. Simulate Networks and Generate Data + +The Subtensor integration tests simulate large, realistic networks under adversarial conditions to generate retention profiles that validate the blockchain's consensus guarantees. Building takes about 10 minutes, and the actual test itself another 15 minutes approximately. + + +```bash +RUST_BACKTRACE=1 SKIP_WASM_BUILD=1 RUSTFLAGS="-C opt-level=3" cargo test --manifest-path=pallets/subtensor/Cargo.toml -- tests::consensus::map_consensus_guarantees --exact --nocapture > consensus.txt +``` +This command runs the `map_consensus_guarantees` test and saves the output to `consensus.txt`. Replace `` with a float e.g. 1.0 (100% bonds penalty). + +#### 4. Generate Contour Plots + +1. **Create a Python virtual environment and install necessary libraries:** + + ```bash + python3 -m venv .venv + source .venv/bin/activate + pip install numpy matplotlib jupyterlab + + ``` + +2. **Run the plotting script:** + + ```bash + python3 scripts/map_consensus.py consensus.txt + ``` + This generates an SVG file named `consensus_plot.svg` in the current directory. + + +#### 5. Explore and Modify (Optional) + +You can use Jupyter-lab to interactively explore and modify the generated plots: + +1. **Start Jupyter-lab (on VPS):** + ```bash + jupyter-lab --allow-root --port=8888 + ``` + +2. **Connect to Jupyter:** Open the provided URL (e.g., `http://localhost:8888/tree?token=...`) in your local workstation web browser. + +3. **Modify the plotting script:** Edit `scripts/map_consensus.py` to customize the plots, otherwise download the SVG file. + + +#### Disclaimer + +> This reproduction procedure is provided as a guide and may require adjustments depending on your specific VPS environment and configuration. While every effort has been made to ensure accuracy and completeness, variations in system setup, software versions, or network conditions could affect the results. +> +> Please exercise caution when executing commands with root privileges and ensure you understand the potential implications before proceeding. The author assumes no responsibility for any issues arising from the use of this procedure. If you encounter problems or have suggestions for improvement, please open an issue on this repository. diff --git a/evm-tests/src/contracts/subnet.ts b/evm-tests/src/contracts/subnet.ts index 9b6fe00596..9ddc2da873 100644 --- a/evm-tests/src/contracts/subnet.ts +++ b/evm-tests/src/contracts/subnet.ts @@ -572,6 +572,25 @@ export const ISubnetABI = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "uint16", + name: "netuid", + type: "uint16", + }, + ], + name: "getYuma3Enabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -886,4 +905,4 @@ export const ISubnetABI = [ stateMutability: "payable", type: "function" }, -]; \ No newline at end of file +]; diff --git a/evm-tests/test/subnet.precompile.hyperparameter.test.ts b/evm-tests/test/subnet.precompile.hyperparameter.test.ts index e7b5a1ee0d..cfd5d6d6d2 100644 --- a/evm-tests/test/subnet.precompile.hyperparameter.test.ts +++ b/evm-tests/test/subnet.precompile.hyperparameter.test.ts @@ -79,7 +79,7 @@ describe("Test the Subnet precompile contract", () => { }) - // minDifficulty hyperparameter + // minDifficulty hyperparameter // // disabled: only by sudo // @@ -471,6 +471,26 @@ describe("Test the Subnet precompile contract", () => { assert.equal(valueFromContract, onchainValue); }) + it("Can set yuma3Enabled hyperparameter", async () => + { + const totalNetwork = await api.query.SubtensorModule.TotalNetworks.getValue() + const contract = new ethers.Contract(ISUBNET_ADDRESS, ISubnetABI, wallet); + const netuid = totalNetwork - 1; + + const newValue = true; + const tx = await contract.setYuma3Enabled(netuid, newValue); + await tx.wait(); + + let onchainValue = await api.query.SubtensorModule.Yuma3Enabled.getValue(netuid) + + let valueFromContract = Boolean( + await contract.getYuma3Enabled(netuid) + ); + assert.equal(valueFromContract, newValue) + assert.equal(valueFromContract, onchainValue); + }) + + it("Can set alphaValues parameter", async () => { const totalNetwork = await api.query.SubtensorModule.TotalNetworks.getValue() const contract = new ethers.Contract(ISUBNET_ADDRESS, ISubnetABI, wallet); @@ -509,4 +529,4 @@ describe("Test the Subnet precompile contract", () => { assert.equal(valueFromContract, newValue) assert.equal(valueFromContract, onchainValue); }) -}) \ No newline at end of file +}) diff --git a/hyperparameters.md b/hyperparameters.md index c8d2ce1106..049ace84d2 100644 --- a/hyperparameters.md +++ b/hyperparameters.md @@ -7,6 +7,7 @@ TxRateLimit: u64 = 1; // [1 @ 64,888] ### netuid 1 (text_prompting) ```rust Rho: u16 = 10; +AlphaSigmoidSteepness: u16 = 10.0 Kappa: u16 = 32_767; // 0.5 = 65535/2 MaxAllowedUids: u16 = 1024; Issuance: u64 = 0; @@ -46,6 +47,7 @@ WeightsSetRateLimit: u64 = 100; ### netuid 3 (causallmnext) ```rust Rho: u16 = 10; +AlphaSigmoidSteepness: u16 = 10.0 Kappa: u16 = 32_767; // 0.5 = 65535/2 MaxAllowedUids: u16 = 4096; Issuance: u64 = 0; diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index 419e5bf06b..9d978061a1 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -1486,6 +1486,61 @@ pub mod pallet { Ok(()) } + /// + /// + /// # Arguments + /// * `origin` - The origin of the call, which must be the root account. + /// * `netuid` - The unique identifier for the subnet. + /// * `steepness` - The new steepness for the alpha sigmoid function. + /// + /// # Errors + /// * `BadOrigin` - If the caller is not the root account. + /// # Weight + /// Weight is handled by the `#[pallet::weight]` attribute. + #[pallet::call_index(68)] + #[pallet::weight((0, DispatchClass::Operational, Pays::No))] + pub fn sudo_set_alpha_sigmoid_steepness( + origin: OriginFor, + netuid: u16, + steepness: u16, + ) -> DispatchResult { + ensure_root(origin)?; + pallet_subtensor::Pallet::::set_alpha_sigmoid_steepness(netuid, steepness); + + log::debug!( + "AlphaSigmoidSteepnessSet( netuid: {:?}, steepness: {:?} )", + netuid, + steepness + ); + Ok(()) + } + + /// Enables or disables Yuma3 for a given subnet. + /// + /// # Parameters + /// - `origin`: The origin of the call, which must be the root account or subnet owner. + /// - `netuid`: The unique identifier for the subnet. + /// - `enabled`: A boolean flag to enable or disable Yuma3. + /// + /// # Weight + /// This function has a fixed weight of 0 and is classified as an operational transaction that does not incur any fees. + #[pallet::call_index(69)] + #[pallet::weight((0, DispatchClass::Operational, Pays::No))] + pub fn sudo_set_yuma3_enabled( + origin: OriginFor, + netuid: u16, + enabled: bool, + ) -> DispatchResult { + pallet_subtensor::Pallet::::ensure_subnet_owner_or_root(origin, netuid)?; + pallet_subtensor::Pallet::::set_yuma3_enabled(netuid, enabled); + log::debug!( + "Yuma3EnableToggled( netuid: {:?}, Enabled: {:?} ) ", + netuid, + enabled + ); + Ok(()) + } + /// Sets or updates the hotkey account associated with the owner of a specific subnet. /// /// This function allows either the root origin or the current subnet owner to set or update diff --git a/pallets/admin-utils/src/tests/mock.rs b/pallets/admin-utils/src/tests/mock.rs index 99c11b7165..1fade2a6d5 100644 --- a/pallets/admin-utils/src/tests/mock.rs +++ b/pallets/admin-utils/src/tests/mock.rs @@ -80,6 +80,7 @@ parameter_types! { pub const TransactionByteFee: Balance = 100; pub const SDebug:u64 = 1; pub const InitialRho: u16 = 30; + pub const InitialAlphaSigmoidSteepness: u16 = 10; pub const InitialKappa: u16 = 32_767; pub const InitialTempo: u16 = 0; pub const SelfOwnership: u64 = 2; @@ -129,6 +130,7 @@ parameter_types! { pub const InitialAlphaHigh: u16 = 58982; // Represents 0.9 as per the production default pub const InitialAlphaLow: u16 = 45875; // Represents 0.7 as per the production default pub const InitialLiquidAlphaOn: bool = false; // Default value for LiquidAlphaOn + pub const InitialYuma3On: bool = false; // Default value for Yuma3On // pub const InitialHotkeyEmissionTempo: u64 = 1; // (DEPRECATED) // pub const InitialNetworkMaxStake: u64 = u64::MAX; // (DEPRECATED) pub const InitialColdkeySwapScheduleDuration: u64 = 5 * 24 * 60 * 60 / 12; // 5 days @@ -157,6 +159,7 @@ impl pallet_subtensor::Config for Test { type InitialAdjustmentAlpha = InitialAdjustmentAlpha; type InitialTargetRegistrationsPerInterval = InitialTargetRegistrationsPerInterval; type InitialRho = InitialRho; + type InitialAlphaSigmoidSteepness = InitialAlphaSigmoidSteepness; type InitialKappa = InitialKappa; type InitialMaxAllowedUids = InitialMaxAllowedUids; type InitialValidatorPruneLen = InitialValidatorPruneLen; @@ -195,6 +198,7 @@ impl pallet_subtensor::Config for Test { type AlphaHigh = InitialAlphaHigh; type AlphaLow = InitialAlphaLow; type LiquidAlphaOn = InitialLiquidAlphaOn; + type Yuma3On = InitialYuma3On; type Preimages = (); type InitialColdkeySwapScheduleDuration = InitialColdkeySwapScheduleDuration; type InitialDissolveNetworkScheduleDuration = InitialDissolveNetworkScheduleDuration; diff --git a/pallets/subtensor/src/epoch/math.rs b/pallets/subtensor/src/epoch/math.rs index b4f23ced83..5898ced70c 100644 --- a/pallets/subtensor/src/epoch/math.rs +++ b/pallets/subtensor/src/epoch/math.rs @@ -55,6 +55,11 @@ pub fn u16_proportion_to_fixed(x: u16) -> I32F32 { I32F32::saturating_from_num(x).safe_div(I32F32::saturating_from_num(u16::MAX)) } +#[allow(dead_code)] +pub fn fixed_to_fixed_u16_proportion(x: I32F32) -> I32F32 { + x.safe_div(I32F32::saturating_from_num(u16::MAX)) +} + #[allow(dead_code)] pub fn fixed_proportion_to_u16(x: I32F32) -> u16 { fixed_to_u16(x.saturating_mul(I32F32::saturating_from_num(u16::MAX))) @@ -80,11 +85,6 @@ pub fn vec_fixed64_to_u64(vec: Vec) -> Vec { vec.into_iter().map(fixed64_to_u64).collect() } -#[allow(dead_code)] -pub fn vec_u16_proportions_to_fixed(vec: Vec) -> Vec { - vec.into_iter().map(u16_proportion_to_fixed).collect() -} - #[allow(dead_code)] pub fn vec_fixed_proportions_to_u16(vec: Vec) -> Vec { vec.into_iter().map(fixed_proportion_to_u16).collect() @@ -1207,6 +1207,46 @@ pub fn interpolate_sparse( result } +// Element-wise product of two vectors. +#[allow(dead_code)] +pub fn vec_mul(a: &[I32F32], b: &[I32F32]) -> Vec { + a.iter() + .zip(b.iter()) + .map(|(x, y)| x.checked_mul(*y).unwrap_or_default()) + .collect() +} + +// Element-wise product of matrix and vector +pub fn mat_vec_mul(matrix: &[Vec], vector: &[I32F32]) -> Vec> { + let Some(first_row) = matrix.first() else { + return vec![vec![]]; + }; + if first_row.is_empty() { + return vec![vec![]]; + } + matrix.iter().map(|row| vec_mul(row, vector)).collect() +} + +// Element-wise product of matrix and vector +#[allow(dead_code, clippy::indexing_slicing)] +pub fn mat_vec_mul_sparse( + matrix: &[Vec<(u16, I32F32)>], + vector: &[I32F32], +) -> Vec> { + let mut result: Vec> = vec![vec![]; matrix.len()]; + for (i, matrix_row) in matrix.iter().enumerate() { + for (j, value) in matrix_row.iter() { + if let Some(vector_value) = vector.get(*j as usize) { + let new_value = value.saturating_mul(*vector_value); + if new_value != I32F32::saturating_from_num(0.0) { + result[i].push((*j, new_value)); + } + } + } + } + result +} + // Element-wise product of two matrices. #[allow(dead_code)] pub fn hadamard(mat1: &[Vec], mat2: &[Vec]) -> Vec> { @@ -1259,6 +1299,20 @@ pub fn hadamard_sparse( result } +/// Clamp the input value between high and low. +/// Note: assumes high > low +pub fn clamp_value(value: I32F32, low: I32F32, high: I32F32) -> I32F32 { + // First, clamp the value to ensure it does not exceed the upper bound (high). + // If the value is greater than 'high', it will be set to 'high'. + // otherwise it remains unchanged. + value + .min(I32F32::from_num(high)) + // Next, clamp the value to ensure it does not go below the lower bound (_low). + // If the value (after the first clamping) is less than 'low', it will be set to 'low'. + // otherwise it remains unchanged. + .max(I32F32::from_num(low)) +} + // Return matrix exponential moving average: `alpha * a_ij + one_minus_alpha * b_ij`. // `alpha` is the EMA coefficient, how much to add of the new observation, typically small, // higher alpha discounts older observations faster. @@ -1319,144 +1373,117 @@ pub fn mat_ema_sparse( result } -// Return sparse matrix only with elements >= threshold of an input sparse matrix. -#[allow(dead_code)] -pub fn sparse_threshold(w: &[Vec<(u16, I32F32)>], threshold: I32F32) -> Vec> { - w.iter() - .map(|row| { - row.iter() - .filter(|(_, weight)| *weight >= threshold) - .copied() - .collect() - }) - .collect() -} - /// Calculates the exponential moving average (EMA) for a sparse matrix using dynamic alpha values. #[allow(dead_code)] -pub fn mat_ema_alpha_vec_sparse( +pub fn mat_ema_alpha_sparse( new: &[Vec<(u16, I32F32)>], old: &[Vec<(u16, I32F32)>], - alpha: &[I32F32], + alpha: &[Vec], ) -> Vec> { - // Ensure the new and old matrices have the same number of rows. + // Ensure dimensions match. assert!(new.len() == old.len()); - let n = new.len(); // Assume square matrix, rows=cols + assert!(new.len() == alpha.len()); + + // The output vector of rows. + let mut result: Vec> = Vec::with_capacity(new.len()); let zero: I32F32 = I32F32::saturating_from_num(0.0); - let mut result: Vec> = vec![vec![]; n]; + let one = I32F32::saturating_from_num(1.0); // Iterate over each row of the matrices. - for (i, (new_row, old_row)) in new.iter().zip(old).enumerate() { + for ((new_row, old_row), alpha_row) in new.iter().zip(old).zip(alpha) { // Initialize a row of zeros for the result matrix. - let mut row: Vec = vec![zero; n]; + let mut decayed_values: Vec = vec![zero; alpha_row.len()]; - // Process the new matrix values. - for (j, value) in new_row.iter() { - // Retrieve the alpha value for the current column. - let alpha_val: I32F32 = alpha.get(*j as usize).copied().unwrap_or(zero); - // Compute the EMA component for the new value using saturating multiplication. - if let Some(row_val) = row.get_mut(*j as usize) { - *row_val = alpha_val.saturating_mul(*value); - } - log::trace!( - "new[{}][{}] * alpha[{}] = {} * {} = {}", - i, - j, - j, - value, - alpha_val, - row.get(*j as usize).unwrap_or(&zero) - ); - } + let mut result_row: Vec<(u16, I32F32)> = Vec::new(); // Process the old matrix values. - for (j, value) in old_row.iter() { - // Retrieve the alpha value for the current column. - let alpha_val: I32F32 = alpha.get(*j as usize).copied().unwrap_or(zero); - // Calculate the complement of the alpha value using saturating subtraction. - let one_minus_alpha: I32F32 = - I32F32::saturating_from_num(1.0).saturating_sub(alpha_val); - // Compute the EMA component for the old value and add it to the row using saturating operations. - if let Some(row_val) = row.get_mut(*j as usize) { - *row_val = row_val.saturating_add(one_minus_alpha.saturating_mul(*value)); + for (j, old_val) in old_row.iter() { + if let (Some(alpha_val), Some(decayed_val)) = ( + alpha_row.get(*j as usize), + decayed_values.get_mut(*j as usize), + ) { + // Calculate the complement of the alpha value + let one_minus_alpha = one.saturating_sub(*alpha_val); + // Bonds_decayed = Bonds * (1 - alpha) + *decayed_val = one_minus_alpha.saturating_mul(*old_val); } - log::trace!( - "old[{}][{}] * (1 - alpha[{}]) = {} * {} = {}", - i, - j, - j, - value, - one_minus_alpha, - one_minus_alpha.saturating_mul(*value) - ); } - // Collect the non-zero values into the result matrix. - for (j, value) in row.iter().enumerate() { - if *value > zero { - if let Some(result_row) = result.get_mut(i) { - result_row.push((j as u16, *value)); - log::trace!("result[{}][{}] = {}", i, j, value); + // Process the new matrix values. + for (j, new_val) in new_row.iter() { + if let (Some(alpha_val), Some(decayed_val)) = + (alpha_row.get(*j as usize), decayed_values.get(*j as usize)) + { + // Each validator can increase bonds by at most clamped_alpha per epoch towards the cap + // Validators allocate their purchase across miners based on weights + let purchase_increment = alpha_val.saturating_mul(*new_val).max(zero); + let result_val = decayed_val.saturating_add(purchase_increment).min(one); + + if result_val > zero { + result_row.push((*j, result_val)); } } } + result.push(result_row); } // Return the computed EMA sparse matrix. result } -/// Return matrix exponential moving average: `alpha_j * a_ij + one_minus_alpha_j * b_ij`. -/// `alpha_` is the EMA coefficient passed as a vector per column. +/// Calculates the exponential moving average (EMA) for a dense matrix using dynamic alpha values. #[allow(dead_code)] -pub fn mat_ema_alpha_vec( - new: &[Vec], - old: &[Vec], - alpha: &[I32F32], +pub fn mat_ema_alpha( + new: &[Vec], // Weights + old: &[Vec], // Bonds + alpha: &[Vec], ) -> Vec> { // Check if the new matrix is empty or its first row is empty. if new.is_empty() || new.first().is_none_or(|row| row.is_empty()) { return vec![vec![]; 1]; } - // Ensure the dimensions of the new and old matrices match. + // Ensure the dimensions of the new, old and alpha matrices match. assert!(new.len() == old.len()); - assert!(new.first().map_or(0, |row| row.len()) == alpha.len()); + assert!(new.len() == alpha.len()); // Initialize the result matrix with zeros, having the same dimensions as the new matrix. - let mut result: Vec> = - vec![ - vec![I32F32::saturating_from_num(0.0); new.first().map_or(0, |row| row.len())]; - new.len() - ]; + let zero: I32F32 = I32F32::saturating_from_num(0.0); + let one = I32F32::saturating_from_num(1.0); + + let mut result: Vec> = Vec::with_capacity(new.len()); // Iterate over each row of the matrices. - for (i, (new_row, old_row)) in new.iter().zip(old).enumerate() { - // Ensure the current row of the new and old matrices have the same length. + for ((new_row, old_row), alpha_row) in new.iter().zip(old).zip(alpha) { assert!(new_row.len() == old_row.len()); + assert!(new_row.len() == alpha_row.len()); + let mut result_row: Vec = Vec::new(); // Iterate over each column of the current row. - for (j, &alpha_val) in alpha.iter().enumerate().take(new_row.len()) { - // Calculate the complement of the alpha value using saturating subtraction. - let one_minus_alpha = I32F32::saturating_from_num(1.0).saturating_sub(alpha_val); - + for j in 0..new_row.len() { // Compute the EMA for the current element using saturating operations. - if let (Some(new_val), Some(old_val), Some(result_val)) = ( - new_row.get(j), - old_row.get(j), - result.get_mut(i).and_then(|row| row.get_mut(j)), - ) { - *result_val = alpha_val - .saturating_mul(*new_val) - .saturating_add(one_minus_alpha.saturating_mul(*old_val)); + if let (Some(new_val), Some(old_val), Some(alpha_val)) = + (new_row.get(j), old_row.get(j), alpha_row.get(j)) + { + // Calculate the complement of the alpha value + let one_minus_alpha = one.saturating_sub(*alpha_val); + + // Bonds_decayed = Bonds * (1 - alpha) + let decayed_val = one_minus_alpha.saturating_mul(*old_val); + + // Each validator can increase bonds by at most clamped_alpha per epoch towards the cap + // Validators allocate their purchase across miners based on weights + let purchase_increment = alpha_val.saturating_mul(*new_val).max(zero); + let result_val = decayed_val.saturating_add(purchase_increment).min(one); + result_row.push(result_val); } } + result.push(result_row); } // Return the computed EMA matrix. result } - /// Return the quantile of a vector of I32F32 values. pub fn quantile(data: &[I32F32], quantile: f64) -> I32F32 { // Clone the input data to avoid modifying the original vector. diff --git a/pallets/subtensor/src/epoch/run_epoch.rs b/pallets/subtensor/src/epoch/run_epoch.rs index 62027f9636..667ffc17f9 100644 --- a/pallets/subtensor/src/epoch/run_epoch.rs +++ b/pallets/subtensor/src/epoch/run_epoch.rs @@ -12,7 +12,7 @@ impl Pallet { pub fn epoch_dense(netuid: u16, rao_emission: u64) -> Vec<(T::AccountId, u64, u64)> { // Get subnetwork size. let n: u16 = Self::get_subnetwork_n(netuid); - log::trace!("n:\n{:?}\n", n); + log::trace!("n: {:?}", n); // ====================== // == Active & updated == @@ -20,7 +20,7 @@ impl Pallet { // Get current block. let current_block: u64 = Self::get_current_block_as_u64(); - log::trace!("current_block:\n{:?}\n", current_block); + log::trace!("current_block: {:?}", current_block); // Get tempo. let tempo: u64 = Self::get_tempo(netuid).into(); @@ -28,25 +28,25 @@ impl Pallet { // Get activity cutoff. let activity_cutoff: u64 = Self::get_activity_cutoff(netuid) as u64; - log::trace!("activity_cutoff:\n{:?}\n", activity_cutoff); + log::trace!("activity_cutoff: {:?}", activity_cutoff); // Last update vector. let last_update: Vec = Self::get_last_update(netuid); - log::trace!("Last update:\n{:?}\n", &last_update); + log::trace!("Last update: {:?}", &last_update); // Inactive mask. let inactive: Vec = last_update .iter() .map(|updated| updated.saturating_add(activity_cutoff) < current_block) .collect(); - log::trace!("Inactive:\n{:?}\n", inactive.clone()); + log::trace!("Inactive: {:?}", inactive.clone()); // Logical negation of inactive. let active: Vec = inactive.iter().map(|&b| !b).collect(); // Block at registration vector (block when each neuron was most recently registered). let block_at_registration: Vec = Self::get_block_at_registration(netuid); - log::trace!("Block at registration:\n{:?}\n", &block_at_registration); + log::trace!("Block at registration: {:?}", &block_at_registration); // Outdated matrix, outdated_ij=True if i has last updated (weights) after j has last registered. let outdated: Vec> = last_update @@ -58,7 +58,7 @@ impl Pallet { .collect() }) .collect(); - log::trace!("Outdated:\n{:?}\n", &outdated); + log::trace!("Outdated: {:?}", &outdated); // Recently registered matrix, recently_ij=True if last_tempo was *before* j was last registered. // Mask if: the last tempo block happened *before* the registration block @@ -68,7 +68,7 @@ impl Pallet { .iter() .map(|registered| last_tempo <= *registered) .collect(); - log::trace!("Recently registered:\n{:?}\n", &recently_registered); + log::trace!("Recently registered: {:?}", &recently_registered); // =========== // == Stake == @@ -84,7 +84,7 @@ impl Pallet { Self::get_stake_weights_for_network(netuid); inplace_normalize_64(&mut total_stake); let stake: Vec = vec_fixed64_to_fixed32(total_stake); - log::trace!("S:\n{:?}\n", &stake); + log::trace!("S: {:?}", &stake); // ======================= // == Validator permits == @@ -119,7 +119,7 @@ impl Pallet { // Normalize active stake. inplace_normalize(&mut active_stake); - log::trace!("S:\n{:?}\n", &active_stake); + log::trace!("S: {:?}", &active_stake); // ============= // == Weights == @@ -130,7 +130,7 @@ impl Pallet { // Access network weights row unnormalized. let mut weights: Vec> = Self::get_weights(netuid); - log::trace!("W:\n{:?}\n", &weights); + log::trace!("W: {:?}", &weights); // Mask weights that are not from permitted validators. inplace_mask_rows(&validator_forbids, &mut weights); @@ -144,15 +144,15 @@ impl Pallet { } inplace_mask_diag(&mut weights); - log::trace!("W (permit+diag):\n{:?}\n", &weights); + log::trace!("W (permit+diag): {:?}", &weights); // Mask outdated weights: remove weights referring to deregistered neurons. inplace_mask_matrix(&outdated, &mut weights); - log::trace!("W (permit+diag+outdate):\n{:?}\n", &weights); + log::trace!("W (permit+diag+outdate): {:?}", &weights); // Normalize remaining weights. inplace_row_normalize(&mut weights); - log::trace!("W (mask+norm):\n{:?}\n", &weights); + log::trace!("W (mask+norm): {:?}", &weights); // ================================ // == Consensus, Validator Trust == @@ -183,7 +183,7 @@ impl Pallet { inplace_normalize(&mut ranks); let incentive: Vec = ranks.clone(); - log::trace!("I:\n{:?}\n", &incentive); + log::trace!("I: {:?}", &incentive); // ========================= // == Bonds and Dividends == @@ -197,26 +197,61 @@ impl Pallet { let weights_for_bonds: Vec> = interpolate(&weights, &clipped_weights, bonds_penalty); - // Access network bonds. - let mut bonds: Vec> = Self::get_bonds(netuid); - // Remove bonds referring to neurons that have registered since last tempo. - inplace_mask_cols(&recently_registered, &mut bonds); // mask recently registered bonds - inplace_col_normalize(&mut bonds); // sum_i b_ij = 1 - log::trace!("B:\n{:?}\n", &bonds); - - // Compute bonds delta column normalized. - let mut bonds_delta: Vec> = row_hadamard(&weights_for_bonds, &active_stake); // ΔB = Wâ—¦S - inplace_col_normalize(&mut bonds_delta); // sum_i b_ij = 1 - log::trace!("ΔB:\n{:?}\n", &bonds_delta); - // Compute the Exponential Moving Average (EMA) of bonds. - let mut ema_bonds = Self::compute_ema_bonds(netuid, consensus.clone(), bonds_delta, bonds); - inplace_col_normalize(&mut ema_bonds); // sum_i b_ij = 1 - log::trace!("emaB:\n{:?}\n", &ema_bonds); - - // Compute dividends: d_i = SUM(j) b_ij * inc_j - let mut dividends: Vec = matmul_transpose(&ema_bonds, &incentive); - inplace_normalize(&mut dividends); - log::trace!("D:\n{:?}\n", ÷nds); + let mut dividends: Vec; + let mut ema_bonds: Vec>; + if Yuma3On::::get(netuid) { + // Access network bonds. + let mut bonds: Vec> = Self::get_bonds_fixed_proportion(netuid); + inplace_mask_cols(&recently_registered, &mut bonds); // mask outdated bonds + log::trace!("B: {:?}", &bonds); + + // Compute the Exponential Moving Average (EMA) of bonds. + ema_bonds = Self::compute_bonds(netuid, &weights_for_bonds, &bonds, &consensus); + log::trace!("emaB: {:?}", &ema_bonds); + + // Normalize EMA bonds. + let mut ema_bonds_norm = ema_bonds.clone(); + inplace_col_normalize(&mut ema_bonds_norm); + log::trace!("emaB norm: {:?}", &ema_bonds_norm); + + // # === Dividend Calculation=== + let total_bonds_per_validator: Vec = + row_sum(&mat_vec_mul(&ema_bonds_norm, &incentive)); + log::trace!( + "total_bonds_per_validator: {:?}", + &total_bonds_per_validator + ); + + dividends = vec_mul(&total_bonds_per_validator, &active_stake); + inplace_normalize(&mut dividends); + log::trace!("D: {:?}", ÷nds); + } else { + // original Yuma - liquid alpha disabled + // Access network bonds. + let mut bonds: Vec> = Self::get_bonds(netuid); + // Remove bonds referring to neurons that have registered since last tempo. + inplace_mask_cols(&recently_registered, &mut bonds); // mask recently registered bonds + inplace_col_normalize(&mut bonds); // sum_i b_ij = 1 + log::trace!("B: {:?}", &bonds); + + // Compute bonds delta column normalized. + let mut bonds_delta: Vec> = row_hadamard(&weights_for_bonds, &active_stake); // ΔB = Wâ—¦S + inplace_col_normalize(&mut bonds_delta); // sum_i b_ij = 1 + log::trace!("ΔB: {:?}", &bonds_delta); + + // Compute the Exponential Moving Average (EMA) of bonds. + ema_bonds = Self::compute_ema_bonds_normal(&bonds_delta, &bonds, netuid); + inplace_col_normalize(&mut ema_bonds); // sum_i b_ij = 1 + log::trace!("emaB: {:?}", &ema_bonds); + + // Compute dividends: d_i = SUM(j) b_ij * inc_j + dividends = matmul_transpose(&ema_bonds, &incentive); + inplace_normalize(&mut dividends); + log::trace!("Dividends: {:?}", ÷nds); + + // Column max-upscale EMA bonds for storage: max_i w_ij = 1. + inplace_col_max_upscale(&mut ema_bonds); + } // ================================= // == Emission and Pruning scores == @@ -341,8 +376,6 @@ impl Pallet { ValidatorTrust::::insert(netuid, cloned_validator_trust); ValidatorPermit::::insert(netuid, new_validator_permits.clone()); - // Column max-upscale EMA bonds for storage: max_i w_ij = 1. - inplace_col_max_upscale(&mut ema_bonds); new_validator_permits .iter() .zip(validator_permits) @@ -476,7 +509,7 @@ impl Pallet { // Normalize active stake. inplace_normalize(&mut active_stake); - log::debug!("Active Stake:\n{:?}\n", &active_stake); + log::trace!("Active Stake: {:?}", &active_stake); // ============= // == Weights == @@ -545,7 +578,7 @@ impl Pallet { // Compute server trust: ratio of rank after vs. rank before. let trust: Vec = vecdiv(&ranks, &preranks); // range: I32F32(0, 1) - log::trace!("T: {:?}", &trust); + log::trace!("Trust: {:?}", &trust); inplace_normalize(&mut ranks); // range: I32F32(0, 1) let incentive: Vec = ranks.clone(); @@ -563,47 +596,92 @@ impl Pallet { let weights_for_bonds: Vec> = interpolate_sparse(&weights, &clipped_weights, n, bonds_penalty); - // Access network bonds. - let mut bonds: Vec> = Self::get_bonds_sparse(netuid); - log::trace!("B: {:?}", &bonds); + let mut dividends: Vec; + let mut ema_bonds: Vec>; + if Yuma3On::::get(netuid) { + // Access network bonds. + let mut bonds = Self::get_bonds_sparse_fixed_proportion(netuid); + log::trace!("Bonds: {:?}", &bonds); + + // Remove bonds referring to neurons that have registered since last tempo. + // Mask if: the last tempo block happened *before* the registration block + // ==> last_tempo <= registered + let last_tempo: u64 = current_block.saturating_sub(tempo); + bonds = scalar_vec_mask_sparse_matrix( + &bonds, + last_tempo, + &block_at_registration, + &|last_tempo, registered| last_tempo <= registered, + ); + log::trace!("Bonds: (mask) {:?}", &bonds); + + // Compute the Exponential Moving Average (EMA) of bonds. + log::trace!("weights_for_bonds: {:?}", &weights_for_bonds); + ema_bonds = Self::compute_bonds_sparse(netuid, &weights_for_bonds, &bonds, &consensus); + log::trace!("emaB: {:?}", &ema_bonds); + + // Normalize EMA bonds. + let mut ema_bonds_norm = ema_bonds.clone(); + inplace_col_normalize_sparse(&mut ema_bonds_norm, n); // sum_i b_ij = 1 + log::trace!("emaB norm: {:?}", &ema_bonds_norm); + + // # === Dividend Calculation=== + let total_bonds_per_validator: Vec = + row_sum_sparse(&mat_vec_mul_sparse(&ema_bonds_norm, &incentive)); + log::trace!( + "total_bonds_per_validator: {:?}", + &total_bonds_per_validator + ); - // Remove bonds referring to neurons that have registered since last tempo. - // Mask if: the last tempo block happened *before* the registration block - // ==> last_tempo <= registered - let last_tempo: u64 = current_block.saturating_sub(tempo); - bonds = scalar_vec_mask_sparse_matrix( - &bonds, - last_tempo, - &block_at_registration, - &|last_tempo, registered| last_tempo <= registered, - ); - log::trace!("B (outdatedmask): {:?}", &bonds); - - // Normalize remaining bonds: sum_i b_ij = 1. - inplace_col_normalize_sparse(&mut bonds, n); - log::trace!("B (mask+norm): {:?}", &bonds); - - // Compute bonds delta column normalized. - let mut bonds_delta: Vec> = - row_hadamard_sparse(&weights_for_bonds, &active_stake); // ΔB = Wâ—¦S (outdated W masked) - log::trace!("ΔB: {:?}", &bonds_delta); - - // Normalize bonds delta. - inplace_col_normalize_sparse(&mut bonds_delta, n); // sum_i b_ij = 1 - log::trace!("ΔB (norm): {:?}", &bonds_delta); - - // Compute the Exponential Moving Average (EMA) of bonds. - let mut ema_bonds = - Self::compute_ema_bonds_sparse(netuid, consensus.clone(), bonds_delta, bonds); - // Normalize EMA bonds. - inplace_col_normalize_sparse(&mut ema_bonds, n); // sum_i b_ij = 1 - log::trace!("Exponential Moving Average Bonds: {:?}", &ema_bonds); - - // Compute dividends: d_i = SUM(j) b_ij * inc_j. - // range: I32F32(0, 1) - let mut dividends: Vec = matmul_transpose_sparse(&ema_bonds, &incentive); - inplace_normalize(&mut dividends); - log::trace!("Dividends: {:?}", ÷nds); + dividends = vec_mul(&total_bonds_per_validator, &active_stake); + inplace_normalize(&mut dividends); + log::trace!("Dividends: {:?}", ÷nds); + } else { + // original Yuma - liquid alpha disabled + // Access network bonds. + let mut bonds: Vec> = Self::get_bonds_sparse(netuid); + log::trace!("B: {:?}", &bonds); + + // Remove bonds referring to neurons that have registered since last tempo. + // Mask if: the last tempo block happened *before* the registration block + // ==> last_tempo <= registered + let last_tempo: u64 = current_block.saturating_sub(tempo); + bonds = scalar_vec_mask_sparse_matrix( + &bonds, + last_tempo, + &block_at_registration, + &|last_tempo, registered| last_tempo <= registered, + ); + log::trace!("B (outdatedmask): {:?}", &bonds); + + // Normalize remaining bonds: sum_i b_ij = 1. + inplace_col_normalize_sparse(&mut bonds, n); + log::trace!("B (mask+norm): {:?}", &bonds); + + // Compute bonds delta column normalized. + let mut bonds_delta: Vec> = + row_hadamard_sparse(&weights_for_bonds, &active_stake); // ΔB = Wâ—¦S (outdated W masked) + log::trace!("ΔB: {:?}", &bonds_delta); + + // Normalize bonds delta. + inplace_col_normalize_sparse(&mut bonds_delta, n); // sum_i b_ij = 1 + log::trace!("ΔB (norm): {:?}", &bonds_delta); + + // Compute the Exponential Moving Average (EMA) of bonds. + ema_bonds = Self::compute_ema_bonds_normal_sparse(&bonds_delta, &bonds, netuid); + // Normalize EMA bonds. + inplace_col_normalize_sparse(&mut ema_bonds, n); // sum_i b_ij = 1 + log::trace!("Exponential Moving Average Bonds: {:?}", &ema_bonds); + + // Compute dividends: d_i = SUM(j) b_ij * inc_j. + // range: I32F32(0, 1) + dividends = matmul_transpose_sparse(&ema_bonds, &incentive); + inplace_normalize(&mut dividends); + log::trace!("Dividends: {:?}", ÷nds); + + // Column max-upscale EMA bonds for storage: max_i w_ij = 1. + inplace_col_max_upscale_sparse(&mut ema_bonds, n); + } // ================================= // == Emission and Pruning scores == @@ -734,8 +812,6 @@ impl Pallet { ValidatorTrust::::insert(netuid, cloned_validator_trust); ValidatorPermit::::insert(netuid, new_validator_permits.clone()); - // Column max-upscale EMA bonds for storage: max_i w_ij = 1. - inplace_col_max_upscale_sparse(&mut ema_bonds, n); new_validator_permits .iter() .zip(validator_permits) @@ -848,7 +924,7 @@ impl Pallet { bonds .get_mut(uid_i as usize) .expect("uid_i is filtered to be less than n; qed") - .push((uid_j, I32F32::saturating_from_num(bonds_ij))); + .push((uid_j, u16_to_fixed(bonds_ij))); } } bonds @@ -868,186 +944,30 @@ impl Pallet { .expect("uid_i has been filtered to be less than n; qed") .get_mut(uid_j as usize) .expect("uid_j has been filtered to be less than n; qed") = - I32F32::saturating_from_num(bonds_ij); + u16_to_fixed(bonds_ij); } } bonds } - /// Calculate the logistic function parameters 'a' and 'b' based on alpha and consensus values. - /// - /// # Args: - /// * `alpha_high` - The high alpha value. - /// * `alpha_low` - The low alpha value. - /// * `consensus_high` - The high consensus value. - /// * `consensus_low` - The low consensus value. - /// - /// # Returns: - /// A tuple containing the slope 'a' and intercept 'b' for the logistic function. - pub fn calculate_logistic_params( - alpha_high: I32F32, - alpha_low: I32F32, - consensus_high: I32F32, - consensus_low: I32F32, - ) -> (I32F32, I32F32) { - log::trace!("alpha_high: {:?}", alpha_high); - log::trace!("alpha_low: {:?}", alpha_low); - log::trace!("consensus_high: {:?}", consensus_high); - log::trace!("consensus_low: {:?}", consensus_low); - // Check for division by zero - // extra caution to ensure we never divide by zero - if consensus_high <= consensus_low || alpha_low == 0 || alpha_high == 0 { - // Return 0 for both 'a' and 'b' when consensus values are equal - return ( - I32F32::saturating_from_num(0.0), - I32F32::saturating_from_num(0.0), - ); - } - - // Calculate the slope 'a' of the logistic function. - // a = (ln((1 / alpha_high - 1)) - ln((1 / alpha_low - 1))) / (consensus_low - consensus_high) - let a = (safe_ln( - (I32F32::saturating_from_num(1.0).safe_div(alpha_high)) - .saturating_sub(I32F32::saturating_from_num(1.0)), - ) - .saturating_sub(safe_ln( - (I32F32::saturating_from_num(1.0).safe_div(alpha_low)) - .saturating_sub(I32F32::saturating_from_num(1.0)), - ))) - .safe_div(consensus_low.saturating_sub(consensus_high)); - log::trace!("a: {:?}", a); - - // Calculate the intercept 'b' of the logistic function. - // b = ln((1 / alpha_low - 1)) + a * consensus_low - let b = safe_ln( - (I32F32::saturating_from_num(1.0).safe_div(alpha_low)) - .saturating_sub(I32F32::saturating_from_num(1.0)), - ) - .saturating_add(a.saturating_mul(consensus_low)); - log::trace!("b: {:?}", b); - - // Return the calculated slope 'a' and intercept 'b'. - (a, b) - } - - /// Compute the alpha values using the logistic function parameters 'a' and 'b'. - /// - /// # Args: - /// * `consensus` - A vector of consensus values. - /// * `a` - The slope of the logistic function. - /// * `b` - The intercept of the logistic function. - /// - /// # Returns: - /// A vector of computed alpha values. - pub fn compute_alpha_values(consensus: &[I32F32], a: I32F32, b: I32F32) -> Vec { - // Compute the alpha values for each consensus value. - let alpha: Vec = consensus - .iter() - .map(|c| { - // Calculate the exponent value for the logistic function. - // exp_val = exp(b - a * c) - let exp_val = safe_exp(b.saturating_sub(a.saturating_mul(*c))); - - // Compute the alpha value using the logistic function formula. - // alpha = 1 / (1 + exp_val) - I32F32::saturating_from_num(1.0) - .safe_div(I32F32::saturating_from_num(1.0).saturating_add(exp_val)) - }) - .collect(); - - // Log the computed alpha values for debugging purposes. - log::trace!("alpha: {:?}", alpha); - - // Return the computed alpha values. - alpha - } - - /// Clamp the alpha values between alpha_high and alpha_low. - /// - /// # Args: - /// * `alpha` - A vector of alpha values. - /// * `alpha_high` - The high alpha value. - /// * `alpha_low` - The low alpha value. - /// - /// # Returns: - /// A vector of clamped alpha values. - pub fn clamp_alpha_values( - alpha: Vec, - alpha_high: I32F32, - alpha_low: I32F32, - ) -> Vec { - let clamped_alpha: Vec = alpha - .iter() - .map(|a| { - // First, clamp the value to ensure it does not exceed the upper bound (alpha_high). - // If 'a' is greater than 'alpha_high', it will be set to 'alpha_high'. - // If 'a' is less than or equal to 'alpha_high', it remains unchanged. - let clamped_a = a - .min(&alpha_high) - // Next, clamp the value to ensure it does not go below the lower bound (alpha_low). - // If the value (after the first clamping) is less than 'alpha_low', it will be set to 'alpha_low'. - // If the value is greater than or equal to 'alpha_low', it remains unchanged. - .max(&alpha_low); - // Return the clamped value. - *clamped_a - }) - .collect(); - log::trace!("alpha_clamped: {:?}", clamped_alpha); - clamped_alpha - } - - /// Compute the Exponential Moving Average (EMA) of bonds using the clamped alpha values for a sparse matrix. - /// - /// # Args: - /// * `bonds_delta` - A vector of bond deltas. - /// * `bonds` - A vector of bonds. - /// * `alpha` - A vector of clamped alpha values. - /// - /// # Returns: - /// A vector of EMA bonds. - pub fn compute_ema_bonds_with_liquid_alpha_sparse( - bonds_delta: &[Vec<(u16, I32F32)>], - bonds: &[Vec<(u16, I32F32)>], - alpha: Vec, - ) -> Vec> { - // Compute the Exponential Moving Average (EMA) of bonds using the provided clamped alpha values. - let ema_bonds = mat_ema_alpha_vec_sparse(bonds_delta, bonds, &alpha); - - // Log the computed EMA bonds for debugging purposes. - log::trace!( - "Exponential Moving Average Bonds Liquid Alpha: {:?}", - ema_bonds - ); - - // Return the computed EMA bonds. - ema_bonds + pub fn get_bonds_fixed_proportion(netuid: u16) -> Vec> { + let mut bonds = Self::get_bonds(netuid); + bonds.iter_mut().for_each(|bonds_row| { + bonds_row + .iter_mut() + .for_each(|bond| *bond = fixed_to_fixed_u16_proportion(*bond)); + }); + bonds } - /// Compute the Exponential Moving Average (EMA) of bonds using the clamped alpha values. - /// - /// # Args: - /// * `bonds_delta` - A vector of bond deltas. - /// * `bonds` - A vector of bonds. - /// * `alpha` - A vector of clamped alpha values. - /// - /// # Returns: - /// A vector of EMA bonds. - pub fn compute_ema_bonds_with_liquid_alpha( - bonds_delta: &[Vec], - bonds: &[Vec], - alpha: Vec, - ) -> Vec> { - // Compute the Exponential Moving Average (EMA) of bonds using the provided clamped alpha values. - let ema_bonds = mat_ema_alpha_vec(bonds_delta, bonds, &alpha); - - // Log the computed EMA bonds for debugging purposes. - log::trace!( - "Exponential Moving Average Bonds Liquid Alpha: {:?}", - ema_bonds - ); - - // Return the computed EMA bonds. - ema_bonds + pub fn get_bonds_sparse_fixed_proportion(netuid: u16) -> Vec> { + let mut bonds = Self::get_bonds_sparse(netuid); + bonds.iter_mut().for_each(|bonds_row| { + bonds_row + .iter_mut() + .for_each(|(_, bond)| *bond = fixed_to_fixed_u16_proportion(*bond)); + }); + bonds } /// Compute the Exponential Moving Average (EMA) of bonds using a normal alpha value for a sparse matrix. @@ -1118,93 +1038,63 @@ impl Pallet { ema_bonds } - /// Compute the Exponential Moving Average (EMA) of bonds based on the Liquid Alpha setting for a sparse matrix. + /// Compute the Exponential Moving Average (EMA) of bonds based on the Liquid Alpha setting /// /// # Args: /// * `netuid` - The network ID. - /// * `consensus` - A vector of consensus values. - /// * `bonds_delta` - A vector of bond deltas. + /// * `weights` - A vector of weights. /// * `bonds` - A vector of bonds. + /// * `consensus` - A vector of consensus values. + /// * `active_stake` - A vector of active stake values. /// /// # Returns: /// A vector of EMA bonds. - pub fn compute_ema_bonds_sparse( + pub fn compute_bonds( netuid: u16, - consensus: Vec, - bonds_delta: Vec>, - bonds: Vec>, - ) -> Vec> { + weights: &[Vec], // weights_for_bonds + bonds: &[Vec], + consensus: &[I32F32], + ) -> Vec> { // Check if Liquid Alpha is enabled, consensus is not empty, and contains non-zero values. - // This way we avoid the quantil function panic. if LiquidAlphaOn::::get(netuid) && !consensus.is_empty() && consensus .iter() .any(|&c| c != I32F32::saturating_from_num(0)) { - // Calculate the 75th percentile (high) and 25th percentile (low) of the consensus values. - let consensus_high = quantile(&consensus, 0.75); - let consensus_low = quantile(&consensus, 0.25); - // Further check if the high and low consensus values meet the required conditions. - if (consensus_high > consensus_low) || consensus_high != 0 || consensus_low < 0 { - // if (consensus_high > consensus_low) || consensus_high != 0) || consensus_low != 0 { - // if (consensus_high > consensus_low) || consensus_low != 0 { - log::trace!("Using Liquid Alpha"); - - // Get the high and low alpha values for the network. - let (alpha_low, alpha_high): (I32F32, I32F32) = Self::get_alpha_values_32(netuid); - log::trace!("alpha_low: {:?} alpha_high: {:?}", alpha_low, alpha_high); - - // Calculate the logistic function parameters 'a' and 'b' based on alpha and consensus values. - let (a, b) = Self::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Compute the alpha values using the logistic function parameters. - let alpha = Self::compute_alpha_values(&consensus, a, b); - - // Clamp the alpha values between alpha_high and alpha_low. - let clamped_alpha = Self::clamp_alpha_values(alpha, alpha_high, alpha_low); - - // Compute the Exponential Moving Average (EMA) of bonds using the clamped alpha values. - Self::compute_ema_bonds_with_liquid_alpha_sparse( - &bonds_delta, - &bonds, - clamped_alpha, - ) - } else { - log::trace!("Using Bonds Moving Average"); + // Liquid Alpha is enabled, compute the liquid alphas matrix. + let alphas: Vec> = + Self::compute_liquid_alpha_values(netuid, weights, bonds, consensus); + log::trace!("alphas: {:?}", &alphas); - // Compute the EMA of bonds using a normal alpha value. - Self::compute_ema_bonds_normal_sparse(&bonds_delta, &bonds, netuid) - } + // Compute the Exponential Moving Average (EMA) of bonds using the provided clamped alpha values. + mat_ema_alpha(weights, bonds, &alphas) } else { - log::trace!("Using Bonds Moving Average"); + // Liquid Alpha is disabled, compute the liquid alpha value. + let alpha: I32F32 = Self::compute_disabled_liquid_alpha(netuid); - // Compute the EMA of bonds using a normal alpha value. - Self::compute_ema_bonds_normal_sparse(&bonds_delta, &bonds, netuid) + // Compute the Exponential Moving Average (EMA) of bonds using the calculated alpha value. + mat_ema(weights, bonds, alpha) } } - /// Compute the Exponential Moving Average (EMA) of bonds based on the Liquid Alpha setting. + /// Compute the Exponential Moving Average (EMA) of bonds based on the Liquid Alpha setting for a sparse matrix. /// /// # Args: /// * `netuid` - The network ID. - /// * `consensus` - A vector of consensus values. - /// * `bonds_delta` - A vector of bond deltas. + /// * `weights` - A vector of weights. /// * `bonds` - A vector of bonds. + /// * `consensus` - A vector of consensus values. + /// * `active_stake` - A vector of active stake values. /// /// # Returns: /// A vector of EMA bonds. - pub fn compute_ema_bonds( + pub fn compute_bonds_sparse( netuid: u16, - consensus: Vec, - bonds_delta: Vec>, - bonds: Vec>, - ) -> Vec> { + weights: &[Vec<(u16, I32F32)>], + bonds: &[Vec<(u16, I32F32)>], + consensus: &[I32F32], + ) -> Vec> { // Check if Liquid Alpha is enabled, consensus is not empty, and contains non-zero values. if LiquidAlphaOn::::get(netuid) && !consensus.is_empty() @@ -1212,46 +1102,181 @@ impl Pallet { .iter() .any(|&c| c != I32F32::saturating_from_num(0)) { - // Calculate the 75th percentile (high) and 25th percentile (low) of the consensus values. - let consensus_high = quantile(&consensus, 0.75); - let consensus_low = quantile(&consensus, 0.25); + // Liquid Alpha is enabled, compute the liquid alphas matrix. + let alphas: Vec> = + Self::compute_liquid_alpha_values_sparse(netuid, weights, bonds, consensus); + log::trace!("alphas: {:?}", &alphas); - // Further check if the high and low consensus values meet the required conditions. - if (consensus_high > consensus_low) || consensus_high != 0 || consensus_low < 0 { - log::trace!("Using Liquid Alpha"); + // Compute the Exponential Moving Average (EMA) of bonds using the provided clamped alpha values. + mat_ema_alpha_sparse(weights, bonds, &alphas) + } else { + // Liquid Alpha is disabled, compute the liquid alpha value. + let alpha: I32F32 = Self::compute_disabled_liquid_alpha(netuid); - // Get the high and low alpha values for the network. - let (alpha_low, alpha_high): (I32F32, I32F32) = Self::get_alpha_values_32(netuid); - log::trace!("alpha_low: {:?} alpha_high: {:?}", alpha_low, alpha_high); + // Compute the Exponential Moving Average (EMA) of bonds using the calculated alpha value. + mat_ema_sparse(weights, bonds, alpha) + } + } - // Calculate the logistic function parameters 'a' and 'b' based on alpha and consensus values. - let (a, b) = Self::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); + /// Compute liquid alphas matrix + /// There is a separate alpha param for each validator-miner binding + /// + /// # Args: + /// * `netuid` - The network ID. + /// * `weights` - A vector of weights. + /// * `bonds` - A vector of bonds. + /// * `consensus` - A vector of consensus values. + /// + /// # Returns: + /// A matrix of alphas + pub fn compute_liquid_alpha_values( + netuid: u16, + weights: &[Vec], // current epoch weights + bonds: &[Vec], // previous epoch bonds + consensus: &[I32F32], // previous epoch consensus weights + ) -> Vec> { + assert!(weights.len() == bonds.len()); - // Compute the alpha values using the logistic function parameters. - let alpha = Self::compute_alpha_values(&consensus, a, b); + // Get the high and low alpha values for the network. + let alpha_sigmoid_steepness: I32F32 = Self::get_alpha_sigmoid_steepness(netuid); + let (alpha_low, alpha_high): (I32F32, I32F32) = Self::get_alpha_values_32(netuid); - // Clamp the alpha values between alpha_high and alpha_low. - let clamped_alpha = Self::clamp_alpha_values(alpha, alpha_high, alpha_low); + let mut alphas = Vec::new(); - // Compute the Exponential Moving Average (EMA) of bonds using the clamped alpha values. - Self::compute_ema_bonds_with_liquid_alpha(&bonds_delta, &bonds, clamped_alpha) - } else { - log::trace!("Using Bonds Moving Average"); + for (w_row, b_row) in weights.iter().zip(bonds.iter()) { + let mut row_alphas = Vec::new(); - // Compute the EMA of bonds using a normal alpha value. - Self::compute_ema_bonds_normal(&bonds_delta, &bonds, netuid) + for ((weight, bond), consensus_val) in + w_row.iter().zip(b_row.iter()).zip(consensus.iter()) + { + let alpha = Self::alpha_sigmoid( + *consensus_val, + *weight, + *bond, + alpha_low, + alpha_high, + alpha_sigmoid_steepness, + ); + row_alphas.push(alpha); } - } else { - log::trace!("Using Bonds Moving Average"); + alphas.push(row_alphas); + } + alphas + } - // Compute the EMA of bonds using a normal alpha value. - Self::compute_ema_bonds_normal(&bonds_delta, &bonds, netuid) + /// Compute liquid alphas sparse matrix + /// There is a separate alpha param for each validator-miner binding + /// + /// # Args: + /// * `netuid` - The network ID. + /// * `weights` - A vector of weights. + /// * `bonds` - A vector of bonds. + /// * `consensus` - A vector of consensus values. + /// + /// # Returns: + /// A dense matrix of alphas + pub fn compute_liquid_alpha_values_sparse( + netuid: u16, + weights: &[Vec<(u16, I32F32)>], // current epoch weights + bonds: &[Vec<(u16, I32F32)>], // previous epoch bonds + consensus: &[I32F32], // previous epoch consensus weights + ) -> Vec> { + assert!(weights.len() == bonds.len()); + + let alpha_sigmoid_steepness: I32F32 = Self::get_alpha_sigmoid_steepness(netuid); + let (alpha_low, alpha_high): (I32F32, I32F32) = Self::get_alpha_values_32(netuid); + + let mut alphas = Vec::with_capacity(consensus.len()); + let zero = I32F32::from_num(0.0); + + // iterate over rows + for (w_row, b_row) in weights.iter().zip(bonds.iter()) { + let mut row_alphas = Vec::with_capacity(w_row.len()); + let mut w_iter = w_row.iter().peekable(); + let mut b_iter = b_row.iter().peekable(); + for (j_pos, consensus_val) in consensus.iter().enumerate() { + let j = j_pos as u16; + + let mut weight = zero; + while let Some(&&(i, val)) = w_iter.peek() { + if i < j { + w_iter.next(); + } else { + if i == j { + weight = val; + } + break; + } + } + + let mut bond = zero; + while let Some(&&(i, val)) = b_iter.peek() { + if i < j { + b_iter.next(); + } else { + if i == j { + bond = val; + } + break; + } + } + + let alpha = Self::alpha_sigmoid( + *consensus_val, + weight, + bond, + alpha_low, + alpha_high, + alpha_sigmoid_steepness, + ); + row_alphas.push(alpha); + } + alphas.push(row_alphas); } + alphas + } + + /// Helper function to compute the alpha value using a sigmoid function. + pub fn alpha_sigmoid( + consensus: I32F32, + weight: I32F32, + bond: I32F32, + alpha_low: I32F32, + alpha_high: I32F32, + alpha_sigmoid_steepness: I32F32, + ) -> I32F32 { + let zero = I32F32::from_num(0.0); + let one = I32F32::from_num(1.0); + + let diff_buy = clamp_value(weight.saturating_sub(consensus), zero, one); + let diff_sell = clamp_value(bond.saturating_sub(weight), zero, one); + let combined_diff = if weight >= bond { diff_buy } else { diff_sell }; + + // sigmoid = 1. / (1. + e^(-steepness * (combined_diff - 0.5))) + let sigmoid = one.saturating_div( + one.saturating_add(safe_exp( + I32F32::from_num(-1).saturating_mul( + alpha_sigmoid_steepness + .saturating_mul(combined_diff.saturating_sub(I32F32::from_num(0.5))), + ), + )), + ); + let alpha = + alpha_low.saturating_add(sigmoid.saturating_mul(alpha_high.saturating_sub(alpha_low))); + + clamp_value(alpha, alpha_low, alpha_high) + } + + pub fn compute_disabled_liquid_alpha(netuid: u16) -> I32F32 { + // Retrieve the bonds moving average for the given network ID and scale it down. + let bonds_moving_average: I64F64 = I64F64::from_num(Self::get_bonds_moving_average(netuid)) + .saturating_div(I64F64::from_num(1_000_000)); + + // Calculate the alpha value for the EMA calculation. + // Alpha is derived by subtracting the scaled bonds moving average from 1. + let alpha: I32F32 = + I32F32::from_num(1).saturating_sub(I32F32::from_num(bonds_moving_average)); + alpha } pub fn do_set_alpha_values( diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 2e0b479c0f..8bbdce1ae0 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -641,6 +641,11 @@ pub mod pallet { T::InitialRho::get() } #[pallet::type_value] + /// Default value for alpha sigmoid steepness. + pub fn DefaultAlphaSigmoidSteepness() -> u16 { + T::InitialAlphaSigmoidSteepness::get() + } + #[pallet::type_value] /// Default value for kappa parameter. pub fn DefaultKappa() -> u16 { T::InitialKappa::get() @@ -800,6 +805,11 @@ pub mod pallet { false } #[pallet::type_value] + /// -- ITEM (switches liquid alpha on) + pub fn DefaultYuma3() -> bool { + false + } + #[pallet::type_value] /// (alpha_low: 0.7, alpha_high: 0.9) pub fn DefaultAlphaValues() -> (u16, u16) { (45875, 58982) @@ -1293,6 +1303,10 @@ pub mod pallet { /// --- MAP ( netuid ) --> Rho pub type Rho = StorageMap<_, Identity, u16, u16, ValueQuery, DefaultRho>; #[pallet::storage] + /// --- MAP ( netuid ) --> AlphaSigmoidSteepness + pub type AlphaSigmoidSteepness = + StorageMap<_, Identity, u16, u16, ValueQuery, DefaultAlphaSigmoidSteepness>; + #[pallet::storage] /// --- MAP ( netuid ) --> Kappa pub type Kappa = StorageMap<_, Identity, u16, u16, ValueQuery, DefaultKappa>; #[pallet::storage] @@ -1422,6 +1436,9 @@ pub mod pallet { pub type LiquidAlphaOn = StorageMap<_, Blake2_128Concat, u16, bool, ValueQuery, DefaultLiquidAlpha>; #[pallet::storage] + /// --- MAP ( netuid ) --> Whether or not Yuma3 is enabled + pub type Yuma3On = StorageMap<_, Blake2_128Concat, u16, bool, ValueQuery, DefaultYuma3>; + #[pallet::storage] /// MAP ( netuid ) --> (alpha_low, alpha_high) pub type AlphaValues = StorageMap<_, Identity, u16, (u16, u16), ValueQuery, DefaultAlphaValues>; diff --git a/pallets/subtensor/src/macros/config.rs b/pallets/subtensor/src/macros/config.rs index cf4d97b65b..628e3609af 100644 --- a/pallets/subtensor/src/macros/config.rs +++ b/pallets/subtensor/src/macros/config.rs @@ -102,6 +102,9 @@ mod config { /// Rho constant. #[pallet::constant] type InitialRho: Get; + /// AlphaSigmoidSteepness constant. + #[pallet::constant] + type InitialAlphaSigmoidSteepness: Get; /// Kappa constant. #[pallet::constant] type InitialKappa: Get; @@ -195,6 +198,8 @@ mod config { /// A flag to indicate if Liquid Alpha is enabled. #[pallet::constant] type LiquidAlphaOn: Get; + /// A flag to indicate if Yuma3 is enabled. + type Yuma3On: Get; // /// Initial hotkey emission tempo. // #[pallet::constant] // type InitialHotkeyEmissionTempo: Get; diff --git a/pallets/subtensor/src/macros/events.rs b/pallets/subtensor/src/macros/events.rs index ccbfed9eff..aab82b22ce 100644 --- a/pallets/subtensor/src/macros/events.rs +++ b/pallets/subtensor/src/macros/events.rs @@ -67,6 +67,8 @@ mod events { ActivityCutoffSet(u16, u16), /// Rho value is set. RhoSet(u16, u16), + /// steepness of the sigmoid used to compute alpha values. + AlphaSigmoidSteepnessSet(u16, u16), /// Kappa is set for a subnet. KappaSet(u16, u16), /// minimum allowed weight is set for a subnet. diff --git a/pallets/subtensor/src/tests/consensus.rs b/pallets/subtensor/src/tests/consensus.rs new file mode 100644 index 0000000000..2e576572cc --- /dev/null +++ b/pallets/subtensor/src/tests/consensus.rs @@ -0,0 +1,546 @@ +#![allow( + clippy::arithmetic_side_effects, + clippy::indexing_slicing, + clippy::unwrap_used +)] + +use super::mock::*; +use crate::*; + +use frame_support::assert_ok; +use rand::{Rng, SeedableRng, distributions::Uniform, rngs::StdRng, seq::SliceRandom, thread_rng}; +use sp_core::U256; +use std::time::Instant; +use substrate_fixed::transcendental::{PI, cos, ln, sqrt}; +use substrate_fixed::types::{I32F32, I64F64}; + +pub fn fixed(val: f32) -> I32F32 { + I32F32::from_num(val) +} + +pub fn fixed_to_u16(x: I32F32) -> u16 { + x.to_num::() +} + +pub fn fixed_proportion_to_u16(x: I32F32) -> u16 { + fixed_to_u16(x * I32F32::from_num(u16::MAX)) +} + +// Normalizes (sum to 1 except 0) the input vector directly in-place. +#[allow(dead_code)] +pub fn inplace_normalize(x: &mut [I32F32]) { + let x_sum: I32F32 = x.iter().sum(); + if x_sum == I32F32::from_num(0.0_f32) { + return; + } + for i in x.iter_mut() { + *i /= x_sum; + } +} + +// Inplace normalize the passed positive integer weights so that they sum to u16 max value. +fn normalize_weights(mut weights: Vec) -> Vec { + let sum: u64 = weights.iter().map(|x| *x as u64).sum(); + if sum == 0 { + return weights; + } + weights.iter_mut().for_each(|x| { + *x = (*x as u64 * u16::MAX as u64 / sum) as u16; + }); + weights +} + +// Return as usize an I32F32 ratio of a usize input, avoiding the 0% and 100% extremes. +fn non_extreme_fixed_ratio(ratio: I32F32, total: usize) -> usize { + if total == 0 { + return total; + } + let mut subset: usize = (ratio * I32F32::from_num(total)).to_num::(); + if subset == 0 { + subset = 1; + } else if subset == total { + subset = total - 1; + } + subset +} + +// Box-Muller Transform converting two uniform random samples to a normal random sample. +fn normal(size: usize, rng: &mut StdRng, dist: &Uniform) -> Vec { + let max: I32F32 = I32F32::from_num(u16::MAX); + let two: I32F32 = I32F32::from_num(2); + let eps: I32F32 = I32F32::from_num(0.000001); + let pi: I32F32 = I32F32::from_num(PI); + + let uniform_u16: Vec = (0..(2 * size)).map(|_| rng.sample(dist)).collect(); + let uniform: Vec = uniform_u16 + .iter() + .map(|&x| I32F32::from_num(x) / max) + .collect(); + let mut normal: Vec = vec![I32F32::from_num(0); size]; + + for i in 0..size { + let u1: I32F32 = uniform[i] + eps; + let u2: I32F32 = uniform[i + size] + eps; + normal[i] = sqrt::(-two * ln::(u1).expect("")).expect("") + * cos(two * pi * u2); + } + normal +} + +// Returns validators and servers uids with either blockwise, regular, or random interleaving. +fn distribute_nodes( + validators_n: usize, + network_n: usize, + interleave: usize, +) -> (Vec, Vec) { + let mut validators: Vec = vec![]; + let mut servers: Vec = vec![]; + + if interleave == 0 { + // blockwise [validator_block, server_block] + validators = (0..validators_n as u16).collect(); + servers = (validators_n as u16..network_n as u16).collect(); + } else if interleave == 1 { + // regular interleaving [val, srv, srv, ..., srv, val, srv, srv, ..., srv, val, srv, ..., srv] + (validators, servers) = (0..network_n as u16) + .collect::>() + .iter() + .partition(|&i| *i as usize % (network_n / validators_n) == 0); + } else if interleave == 2 { + // random interleaving + let mut permuted_uids: Vec = (0..network_n as u16).collect(); + permuted_uids.shuffle(&mut thread_rng()); + validators = permuted_uids[0..validators_n].into(); + servers = permuted_uids[validators_n..network_n].into(); + } + + (validators, servers) +} + +#[allow(dead_code)] +fn uid_stats(netuid: u16, uid: u16) { + log::info!( + "stake: {:?}", + SubtensorModule::get_total_stake_for_hotkey(&(U256::from(uid))) + ); + log::info!("rank: {:?}", SubtensorModule::get_rank_for_uid(netuid, uid)); + log::info!( + "trust: {:?}", + SubtensorModule::get_trust_for_uid(netuid, uid) + ); + log::info!( + "consensus: {:?}", + SubtensorModule::get_consensus_for_uid(netuid, uid) + ); + log::info!( + "incentive: {:?}", + SubtensorModule::get_incentive_for_uid(netuid, uid) + ); + log::info!( + "dividend: {:?}", + SubtensorModule::get_dividends_for_uid(netuid, uid) + ); + log::info!( + "emission: {:?}", + SubtensorModule::get_emission_for_uid(netuid, uid) + ); +} + +#[allow(clippy::too_many_arguments)] +fn init_run_epochs( + netuid: u16, + n: u16, + validators: &[u16], + servers: &[u16], + epochs: u16, + stake_per_validator: u64, + server_self: bool, + input_stake: &[u64], + use_input_stake: bool, + input_weights: &[Vec<(u16, u16)>], + use_input_weights: bool, + random_weights: bool, + random_seed: u64, + sparse: bool, + bonds_penalty: u16, +) { + // === Create the network + add_network(netuid, u16::MAX - 1, 0); // set higher tempo to avoid built-in epoch, then manual epoch instead + + // === Set bonds penalty + SubtensorModule::set_bonds_penalty(netuid, bonds_penalty); + + // === Register uids + SubtensorModule::set_max_allowed_uids(netuid, n); + for key in 0..n { + let stake = if use_input_stake { + input_stake[key as usize] + } else if validators.contains(&key) { + stake_per_validator + } else { + // only validators receive stake + 0 + }; + + // let stake: u64 = 1; // alternative test: all nodes receive stake, should be same outcome, except stake + SubtensorModule::add_balance_to_coldkey_account(&(U256::from(key)), stake); + SubtensorModule::append_neuron(netuid, &(U256::from(key)), 0); + SubtensorModule::increase_stake_for_hotkey_and_coldkey_on_subnet( + &U256::from(key), + &U256::from(key), + netuid, + stake, + ); + } + assert_eq!(SubtensorModule::get_subnetwork_n(netuid), n); + + // === Issue validator permits + SubtensorModule::set_max_allowed_validators(netuid, validators.len() as u16); + assert_eq!( + SubtensorModule::get_max_allowed_validators(netuid), + validators.len() as u16 + ); + SubtensorModule::epoch(netuid, 1_000_000_000); // run first epoch to set allowed validators + run_to_block(1); // run to next block to ensure weights are set on nodes after their registration block + + // === Set weights + let mut rng = StdRng::seed_from_u64(random_seed); // constant seed so weights over multiple runs are equal + let range = Uniform::new(0, u16::MAX); + let mut weights: Vec = vec![u16::MAX / n; servers.len()]; + for uid in validators { + if random_weights { + weights = (0..servers.len()).map(|_| rng.sample(range)).collect(); + weights = normalize_weights(weights); + // assert_eq!(weights.iter().map(|x| *x as u64).sum::(), u16::MAX as u64); // normalized weight sum not always u16::MAX + } + if use_input_weights { + let sparse_weights = input_weights[*uid as usize].clone(); + weights = sparse_weights.iter().map(|(_, w)| *w).collect(); + let srvs: Vec = sparse_weights.iter().map(|(s, _)| *s).collect(); + assert_ok!(SubtensorModule::set_weights( + RuntimeOrigin::signed(U256::from(*uid as u64)), + netuid, + srvs, + weights.clone(), + 0 + )); + } else { + assert_ok!(SubtensorModule::set_weights( + RuntimeOrigin::signed(U256::from(*uid as u64)), + netuid, + servers.to_vec(), + weights.clone(), + 0 + )); + } + } + if server_self { + for uid in servers { + assert_ok!(SubtensorModule::set_weights( + RuntimeOrigin::signed(U256::from(*uid as u64)), + netuid, + vec![*uid], + vec![u16::MAX], + 0 + )); // server self-weight + } + } + + // === Run the epochs. + log::info!("Start {epochs} epoch(s)"); + let start = Instant::now(); + for _ in 0..epochs { + if sparse { + SubtensorModule::epoch(netuid, 1_000_000_000); + } else { + SubtensorModule::epoch_dense(netuid, 1_000_000_000); + } + } + let duration = start.elapsed(); + log::info!( + "Time elapsed in (sparse={sparse}) epoch() is: {:?}", + duration + ); + + // let bonds = SubtensorModule::get_bonds( netuid ); + // for (uid, node) in [ (validators[0], "validator"), (servers[0], "server") ] { + // log::info!("\n{node}" ); + // uid_stats(netuid, uid); + // log::info!("bonds: {:?} (on validator), {:?} (on server)", bonds[uid as usize][0], bonds[uid as usize][servers[0] as usize]); + // } +} + +// Generate a random graph that is split into a major and minor set, each setting specific weight on itself and the complement on the other. +fn split_graph( + major_stake: I32F32, + major_weight: I32F32, + minor_weight: I32F32, + weight_stddev: I32F32, + validators_n: usize, + network_n: usize, + interleave: usize, +) -> ( + Vec, + Vec, + Vec, + Vec, + Vec, + Vec, + Vec, + Vec>, + I32F32, +) { + let servers_n: usize = network_n - validators_n; + let major_servers_n: usize = non_extreme_fixed_ratio(major_stake, servers_n); + let major_validators_n: usize = non_extreme_fixed_ratio(major_stake, validators_n); + + let (validators, servers) = distribute_nodes(validators_n, network_n, interleave); + let major_validators: Vec = (0..major_validators_n).map(|i| validators[i]).collect(); + let minor_validators: Vec = (major_validators_n..validators_n) + .map(|i| validators[i]) + .collect(); + let major_servers: Vec = (0..major_servers_n).map(|i| servers[i]).collect(); + let minor_servers: Vec = (major_servers_n..servers_n).map(|i| servers[i]).collect(); + + let zero: I32F32 = I32F32::from_num(0); + let one: I32F32 = I32F32::from_num(1); + let stddev: I32F32 = I32F32::from_num(0.3); + let total_stake: I64F64 = I64F64::from_num(21_000_000_000_000_000_u64); + let mut rng = StdRng::seed_from_u64(0); // constant seed so weights over multiple runs are equal + let dist = Uniform::new(0, u16::MAX); + + let mut stake: Vec = vec![0; network_n]; + let mut stake_fixed: Vec = vec![zero; network_n]; + for (ratio, vals) in [ + (major_stake, &major_validators), + (one - major_stake, &minor_validators), + ] { + let mut sample: Vec = normal(vals.len(), &mut rng, &dist) + .iter() + .map(|x: &I32F32| { + let v: I32F32 = (stddev * x) + one; + if v < zero { zero } else { v } + }) + .collect(); + inplace_normalize(&mut sample); + for (i, &val) in vals.iter().enumerate() { + stake[val as usize] = + (I64F64::from_num(ratio) * I64F64::from_num(sample[i]) * total_stake) + .to_num::(); + stake_fixed[val as usize] = + I32F32::from_num(I64F64::from_num(ratio) * I64F64::from_num(sample[i])); + } + } + + let mut weights: Vec> = vec![vec![]; network_n]; + let mut weights_fixed: Vec> = vec![vec![zero; network_n]; network_n]; + for (first, second, vals) in [ + (major_weight, one - major_weight, &major_validators), + (one - minor_weight, minor_weight, &minor_validators), + ] { + for &val in vals { + for (weight, srvs) in [(first, &major_servers), (second, &minor_servers)] { + let mut sample: Vec = normal(srvs.len(), &mut rng, &dist) + .iter() + .map(|x: &I32F32| { + let v: I32F32 = (weight_stddev * x) + one; + if v < zero { zero } else { v } + }) + .collect(); + inplace_normalize(&mut sample); + + for (i, &srv) in srvs.iter().enumerate() { + weights[val as usize].push((srv, fixed_proportion_to_u16(weight * sample[i]))); + weights_fixed[val as usize][srv as usize] = weight * sample[i]; + } + } + inplace_normalize(&mut weights_fixed[val as usize]); + } + } + + inplace_normalize(&mut stake_fixed); + + // Calculate stake-weighted mean per server + let mut weight_mean: Vec = vec![zero; network_n]; + for val in 0..network_n { + if stake_fixed[val] > zero { + for (srv, weight_mean_row) in weight_mean.iter_mut().enumerate().take(network_n) { + *weight_mean_row += stake_fixed[val] * weights_fixed[val][srv]; + } + } + } + + // Calculate stake-weighted absolute standard deviation + let mut weight_dev: Vec = vec![zero; network_n]; + for val in 0..network_n { + if stake_fixed[val] > zero { + for srv in 0..network_n { + weight_dev[srv] += + stake_fixed[val] * (weight_mean[srv] - weights_fixed[val][srv]).abs(); + } + } + } + + // Calculate rank-weighted mean of weight_dev + let avg_weight_dev: I32F32 = + weight_dev.iter().sum::() / weight_mean.iter().sum::(); + + ( + validators, + servers, + major_validators, + minor_validators, + major_servers, + minor_servers, + stake, + weights, + avg_weight_dev, + ) +} + +// Test consensus guarantees with an epoch on a graph with 4096 nodes, of which the first 128 are validators, the graph is split into a major and minor set, each setting specific weight on itself and the complement on the other. Asserts that the major emission ratio >= major stake ratio. +// #[test] +// fn test_consensus_guarantees() { +// let netuid: u16 = 0; +// let network_n: u16 = 512; +// let validators_n: u16 = 64; +// let epochs: u16 = 1; +// let interleave = 2; +// log::info!("test_consensus_guarantees ({network_n:?}, {validators_n:?} validators)"); +// for (major_stake, major_weight, minor_weight, weight_stddev) in [ +// (0.51, 1., 1., 0.001), +// (0.51, 0.03, 0., 0.001), +// (0.51, 0.51, 0.49, 0.001), +// (0.51, 0.51, 1., 0.001), +// (0.51, 0.61, 0.8, 0.1), +// (0.6, 0.67, 0.65, 0.2), +// (0.6, 0.74, 0.77, 0.4), +// (0.6, 0.76, 0.8, 0.4), +// (0.6, 0.76, 1., 0.4), +// (0.6, 0.92, 1., 0.4), +// (0.6, 0.94, 1., 0.4), +// (0.65, 0.78, 0.85, 0.6), +// (0.7, 0.81, 0.85, 0.8), +// (0.7, 0.83, 0.85, 1.), +// ] { +// let ( +// validators, +// servers, +// major_validators, +// minor_validators, +// major_servers, +// minor_servers, +// stake, +// weights, +// _avg_weight_dev, +// ) = split_graph( +// fixed(major_stake), +// fixed(major_weight), +// fixed(minor_weight), +// fixed(weight_stddev), +// validators_n as usize, +// network_n as usize, +// interleave as usize, +// ); + +// new_test_ext(1).execute_with(|| { +// init_run_epochs( +// netuid, +// network_n, +// &validators, +// &servers, +// epochs, +// 1, +// true, +// &stake, +// true, +// &weights, +// true, +// false, +// 0, +// false, +// ); + +// let mut major_emission: I64F64 = I64F64::from_num(0); +// let mut minor_emission: I64F64 = I64F64::from_num(0); +// for set in [major_validators, major_servers] { +// for uid in set { +// major_emission += +// I64F64::from_num(SubtensorModule::get_emission_for_uid(netuid, uid)); +// } +// } +// for set in [minor_validators, minor_servers] { +// for uid in set { +// minor_emission += +// I64F64::from_num(SubtensorModule::get_emission_for_uid(netuid, uid)); +// } +// } +// let major_ratio: I32F32 = +// I32F32::from_num(major_emission / (major_emission + minor_emission)); +// assert!(major_stake <= major_ratio); +// }); +// } +// } + +// Map the retention graph for consensus guarantees with an single epoch on a graph with 512 nodes, of which the first 64 are validators, the graph is split into a major and minor set, each setting specific weight on itself and the complement on the other. +#[test] +fn map_consensus_guarantees() { + let netuid: u16 = 1; + let network_n: u16 = 512; + let validators_n: u16 = 64; + let epochs: u16 = 1; + let interleave = 0; + let weight_stddev: I32F32 = fixed(0.4); + let bonds_penalty: u16 = + (std::env::args().nth(2).unwrap().parse::().unwrap() * f32::from(u16::MAX - 1)) as u16; + println!("["); + for _major_stake in [0.51, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.99] { + let major_stake: I32F32 = I32F32::from_num(_major_stake); + for _major_weight in 0..51 { + let major_weight: I32F32 = I32F32::from_num(50 - _major_weight) / I32F32::from_num(50); + for _minor_weight in 0..51 { + let minor_weight: I32F32 = + I32F32::from_num(50 - _minor_weight) / I32F32::from_num(50); + let ( + validators, + servers, + major_validators, + minor_validators, + major_servers, + minor_servers, + stake, + weights, + avg_weight_dev, + ) = split_graph( + major_stake, + major_weight, + minor_weight, + weight_stddev, + validators_n as usize, + network_n as usize, + interleave as usize, + ); + + new_test_ext(1).execute_with(|| { + init_run_epochs(netuid, network_n, &validators, &servers, epochs, 1, true, &stake, true, &weights, true, false, 0, true, bonds_penalty); + + let mut major_emission: I64F64 = I64F64::from_num(0); + let mut minor_emission: I64F64 = I64F64::from_num(0); + for set in [major_validators, major_servers] { + for uid in set { + major_emission += I64F64::from_num(SubtensorModule::get_emission_for_uid( netuid, uid )); + } + } + for set in [minor_validators, minor_servers] { + for uid in set { + minor_emission += I64F64::from_num(SubtensorModule::get_emission_for_uid( netuid, uid )); + } + } + let major_ratio: I32F32 = I32F32::from_num(major_emission / (major_emission + minor_emission)); + println!("[{major_stake}, {major_weight:.2}, {minor_weight:.2}, {avg_weight_dev:.3}, {major_ratio:.3}], "); + }); + } + } + } + println!("]"); +} diff --git a/pallets/subtensor/src/tests/epoch.rs b/pallets/subtensor/src/tests/epoch.rs index e4b2f02574..69c78c3909 100644 --- a/pallets/subtensor/src/tests/epoch.rs +++ b/pallets/subtensor/src/tests/epoch.rs @@ -5,7 +5,7 @@ )] use super::mock::*; -use crate::epoch::math::safe_exp; +use crate::epoch::math::{fixed, u16_proportion_to_fixed}; use crate::*; use approx::assert_abs_diff_eq; @@ -983,7 +983,7 @@ fn test_512_graph_random_weights() { // }); // } -// Test bonds exponential moving average over a sequence of epochs. +// Test bonds exponential moving average over a sequence of epochs - no liquid alpha #[test] fn test_bonds() { new_test_ext(1).execute_with(|| { @@ -1287,223 +1287,6 @@ fn test_bonds() { }); } -// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --package pallet-subtensor --lib -- tests::epoch::test_512_graph_random_weights --exact --show-output --nocapture -#[test] -fn test_bonds_with_liquid_alpha() { - new_test_ext(1).execute_with(|| { - let sparse: bool = true; - let n: u16 = 8; - let netuid: u16 = 1; - let tempo: u16 = 1; - let max_stake: u64 = 4; - let stakes: Vec = vec![1, 2, 3, 4, 0, 0, 0, 0]; - let block_number = System::block_number(); - add_network(netuid, tempo, 0); - SubtensorModule::set_max_allowed_uids(netuid, n); - SubtensorModule::set_max_registrations_per_block(netuid, n); - SubtensorModule::set_target_registrations_per_interval(netuid, n); - SubtensorModule::set_weights_set_rate_limit(netuid, 0); - SubtensorModule::set_min_allowed_weights(netuid, 1); - SubtensorModule::set_max_weight_limit(netuid, u16::MAX); - - // Register validators and servers - for key in 0..n as u64 { - SubtensorModule::add_balance_to_coldkey_account(&U256::from(key), max_stake); - let (nonce, work): (u64, Vec) = SubtensorModule::create_work_for_block_number( - netuid, - block_number, - key * 1_000_000, - &U256::from(key), - ); - assert_ok!(SubtensorModule::register( - RuntimeOrigin::signed(U256::from(key)), - netuid, - block_number, - nonce, - work, - U256::from(key), - U256::from(key) - )); - SubtensorModule::increase_stake_for_hotkey_and_coldkey_on_subnet( - &U256::from(key), - &U256::from(key), - netuid, - stakes[key as usize], - ); - } - - // Initilize with first epoch - SubtensorModule::epoch(netuid, 1_000_000_000); - next_block_no_epoch(netuid); - - // Set weights - for uid in 0..(n / 2) { - SubtensorModule::set_validator_permit_for_uid(netuid, uid, true); - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(uid)), - netuid, - ((n / 2)..n).collect(), - vec![u16::MAX / 4, u16::MAX / 2, (u16::MAX / 4) * 3, u16::MAX], - 0 - )); - } - - // Enable Liquid Alpha - SubtensorModule::set_liquid_alpha_enabled(netuid, true); - // Run epoch with Liquid Alpha - if sparse { - SubtensorModule::epoch(netuid, 1_000_000_000); - } else { - SubtensorModule::epoch_dense(netuid, 1_000_000_000); - } - - // Check bonds and emissions - let bonds = SubtensorModule::get_bonds(netuid); - - /* n: 8 - current_block: 2; activity_cutoff: 5000; - Last update: [1, 1, 1, 1, 0, 0, 0, 0] - activity_cutoff: 5000 - Last update: [2, 2, 2, 2, 1, 1, 1, 1] - Inactive: [false, false, false, false, false, false, false, false] - Block at registration: [1, 1, 1, 1, 1, 1, 1, 1] - hotkeys: [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7)] - Stake: [1, 2, 3, 4, 0, 0, 0, 0] - Normalised Stake: [0.0999999999, 0.2, 0.2999999998, 0.4, 0, 0, 0, 0] - validator_permits: [true, true, true, true, true, true, true, true] - max_allowed_validators: 8 - new_validator_permits: [true, true, true, true, true, true, true, true] - Active Stake: [0.0999999999, 0.2, 0.2999999998, 0.4, 0, 0, 0, 0] - Weights: [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit+diag): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit+diag+outdate): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (mask+norm): [[(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []] - Ranks (before): [0, 0, 0, 0, 0.099997558, 0.2000012202, 0.2999926745, 0.4000085443] - Consensus: [0, 0, 0, 0, 0.0999975584, 0.2000012207, 0.2999926754, 0.400008545] - Weights: [[(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []] - Validator Trust: [0.9999999995, 0.9999999995, 0.9999999995, 0.9999999995, 0, 0, 0, 0] - Ranks (after): [0, 0, 0, 0, 0.099997558, 0.2000012202, 0.2999926745, 0.4000085443] - T: [0, 0, 0, 0, 1, 1, 1, 1] - Incentive (=Rank): [0, 0, 0, 0, 0.0999975582, 0.2000012207, 0, 0.0999975582, 0.2000012207, 0.2999926752, 0.4000085455] - B: [[], [], [], [], [], [], [], []] - B (outdatedmask): [[], [], [], [], [], [], [], []] - B (mask+norm): [[], [], [], [], [], [], [], []] - ΔB: [[(4, 0.0099997558), (5, 0.020000122), (6, 0.0299992673), (7, 0.0400008543)], [(4, 0.0199995115), (5, 0.040000244), (6, 0.0599985349), (7, 0.0800017088)], [(4, 0.0299992673), (5, 0.060000366), (6, 0.0899978024), (7, 0.1200025633)], [(4, 0.0399990233), (5, 0.080000488), (6, 0.11999707), (7, 0.1600034179)], [], [], [], []] - ΔB (norm): [[(4, 0.0999999996), (5, 0.0999999999), (6, 0.0999999994), (7, 0.0999999996)], [(4, 0.1999999995), (5, 0.2), (6, 0.1999999997), (7, 0.1999999997)], [(4, 0.299999999), (5, 0.2999999998), (6, 0.3), (7, 0.3)], [(4, 0.4000000013), (5, 0.4), (6, 0.4000000004), (7, 0.4000000001)], [], [], [], []] - Exponential Moving Average Bonds Liquid Alpha: [[(4, 0.0499983232), (5, 0.0899999999), (6, 0.0899999994), (7, 0.0899999996)], [(4, 0.0999966469), (5, 0.18), (6, 0.1799999997), (7, 0.1799999997)], [(4, 0.1499949703), (5, 0.2699999998), (6, 0.2699999998), (7, 0.2699999998)], [(4, 0.199993295), (5, 0.3599999999), (6, 0.36), (7, 0.3599999999)], [], [], [], []] - Exponential Moving Average Bonds: [[(4, 0.0999999992), (5, 0.0999999999), (6, 0.0999999994), (7, 0.0999999996)], [(4, 0.1999999995), (5, 0.2), (6, 0.1999999997), (7, 0.1999999997)], [(4, 0.2999999993), (5, 0.2999999998), (6, 0.3), (7, 0.3)], [(4, 0.4000000015), (5, 0.4), (6, 0.4000000004), (7, 0.4000000001)], [], [], [], []] - Dividends: [0.0999999994, 0.1999999997, 0.3, 0.4000000006, 0, 0, 0, 0] - Normalized Server Emission: [0, 0, 0, 0, 0.049998779, 0.1000006103, 0.1499963375, 0.2000042726] - Server Emission: [0, 0, 0, 0, 49998779, 100000610, 149996337, 200004272] - Normalized Validator Emission: [0.0499999996, 0.0999999999, 0.15, 0.2000000002, 0, 0, 0, 0] - Validator Emission: [49999999, 99999999, 149999999, 200000000, 0, 0, 0, 0] - Normalized Combined Emission: [0.0499999996, 0.0999999999, 0.15, 0.2000000002, 0.049998779, 0.1000006103, 0.1499963375, 0.2000042726] - Combined Emission: [49999999, 99999999, 149999999, 200000000, 49998779, 100000610, 149996337, 200004272] - Pruning Scores: [0.0499999996, 0.0999999999, 0.15, 0.2000000002, 0.049998779, 0.1000006103, 0.1499963375, 0.2000042726] - */ - - // Expected bonds calculations - // For uid 0: - // Initial weights: [0.25, 0.5, 0.75, 1.0] - // Active stake: [1, 2, 3, 4] - // ΔB = Wâ—¦S = [0.25*1, 0.5*2, 0.75*3, 1.0*4] = [0.25, 1.0, 2.25, 4.0] - // Normalize ΔB: [0.25/7.5, 1.0/7.5, 2.25/7.5, 4.0/7.5] = [0.0333, 0.1333, 0.3, 0.5333] - // Final bonds for netuid: [16383, 32767, 49151, 65535] - - assert_eq!(bonds[0][4], 16383); // Note: Calculated as explained above - assert_eq!(bonds[1][4], 32767); // Note: Calculated as explained above - assert_eq!(bonds[2][4], 49151); // Note: Calculated as explained above - assert_eq!(bonds[3][4], 65535); // Note: Calculated as explained above - - // === Set self-weight only on val1 - let uid = 0; - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(uid)), - netuid, - vec![uid], - vec![u16::MAX], - 0 - )); - next_block_no_epoch(netuid); - if sparse { - SubtensorModule::epoch(netuid, 1_000_000_000); - } else { - SubtensorModule::epoch_dense(netuid, 1_000_000_000); - } - - let bonds = SubtensorModule::get_bonds(netuid); - assert_eq!(bonds[0][4], 2862); - assert_eq!(bonds[1][4], 32767); - assert_eq!(bonds[2][4], 49151); - assert_eq!(bonds[3][4], 65535); - - // === Set self-weight only on val2 - let uid = 1; - assert_ok!(SubtensorModule::set_weights( - RuntimeOrigin::signed(U256::from(uid)), - netuid, - vec![uid], - vec![u16::MAX], - 0 - )); - next_block_no_epoch(netuid); - if sparse { - SubtensorModule::epoch(netuid, 1_000_000_000); - } else { - SubtensorModule::epoch_dense(netuid, 1_000_000_000); - } - let bonds = SubtensorModule::get_bonds(netuid); - - /* n: 8 - current_block: 4; activity_cutoff: 5000; - Last update: [2, 3, 2, 2, 1, 1, 1, 1] - Inactive: [false, false, false, false, false, false, false, false] - Block at registration: [1, 1, 1, 1, 1, 1, 1, 1] - hotkeys: [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7)] - Stake: [1, 2, 3, 4, 0, 0, 0, 0] - Normalised Stake: [0.0999999999, 0.2, 0.2999999998, 0.4, 0, 0, 0, 0] - validator_permits: [true, true, true, true, true, true, true, true] - max_allowed_validators: 64 - new_validator_permits: [true, true, true, true, true, true, true, true] - Active Stake: [0.0999999999, 0.2, 0.2999999998, 0.4, 0, 0, 0, 0] - Weights: [[(0, 65535)], [(1, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit): [[(0, 65535)], [(1, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit+diag): [[], [], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (permit+diag+outdate): [[], [], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []] - Weights (mask+norm): [[], [], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []] - Ranks (before): [0, 0, 0, 0, 0.0699982906, 0.1400008542, 0.2099948723, 0.2800059812] - Consensus: [0, 0, 0, 0, 0.0999975584, 0.2000012207, 0.2999926754, 0.400008545] - Weights: [[], [], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []] - Validator Trust: [0, 0, 0.9999999995, 0.9999999995, 0, 0, 0, 0] - Ranks (after): [0, 0, 0, 0, 0.0699982906, 0.1400008542, 0.2099948723, 0.2800059812] - T: [0, 0, 0, 0, 1, 1, 1, 1] - Incentive (=Rank): [0, 0, 0, 0, 0.0999975582, 0.2000012207, 0.2999926754, 0.4000085455] - B: [[(4, 7760), (5, 1489), (6, 1489), (7, 1489)], [(4, 32767), (5, 32767), (6, 32767), (7, 32767)], [(4, 49151), (5, 49151), (6, 49151), (7, 49151)], [(4, 65535), (5, 65535), (6, 65535), (7, 65535)], [], [], [], []] - B (outdatedmask): [[(4, 7760), (5, 1489), (6, 1489), (7, 1489)], [(4, 32767), (5, 32767), (6, 32767), (7, 32767)], [(4, 49151), (5, 49151), (6, 49151), (7, 49151)], [(4, 65535), (5, 65535), (6, 65535), (7, 65535)], [], [], [], []] - B (mask+norm): [[(4, 0.0499958121), (5, 0.00999718), (6, 0.00999718), (7, 0.00999718)], [(4, 0.211109894), (5, 0.2199983886), (6, 0.2199983886), (7, 0.2199983886)], [(4, 0.3166680625), (5, 0.3300009398), (6, 0.3300009398), (7, 0.3300009398)], [(4, 0.4222262308), (5, 0.4400034912), (6, 0.4400034912), (7, 0.4400034912)], [], [], [], []] - ΔB: [[], [], [(4, 0.0299992673), (5, 0.060000366), (6, 0.0899978024), (7, 0.1200025633)], [(4, 0.0399990233), (5, 0.080000488), (6, 0.11999707), (7, 0.1600034179)], [], [], [], []] - ΔB (norm): [[], [], [(4, 0.428571427), (5, 0.4285714284), (6, 0.4285714284), (7, 0.4285714284)], [(4, 0.5714285728), (5, 0.5714285714), (6, 0.5714285714), (7, 0.5714285714)], [], [], [], []] - Exponential Moving Average Bonds Liquid Alpha: [[(4, 0.024998744), (5, 0.000999718), (6, 0.000999718), (7, 0.000999718)], [(4, 0.105558486), (5, 0.0219998388), (6, 0.0219998388), (7, 0.0219998388)], [(4, 0.3726178685), (5, 0.4187143792), (6, 0.4187143792), (7, 0.4187143792)], [(4, 0.4968249004), (5, 0.5582860631), (6, 0.5582860631), (7, 0.5582860631)], [], [], [], []] - Exponential Moving Average Bonds: [[(4, 0.024998744), (5, 0.000999718), (6, 0.000999718), (7, 0.000999718)], [(4, 0.105558486), (5, 0.0219998388), (6, 0.0219998388), (7, 0.0219998388)], [(4, 0.3726178687), (5, 0.4187143794), (6, 0.4187143794), (7, 0.4187143794)], [(4, 0.4968249009), (5, 0.5582860636), (6, 0.5582860636), (7, 0.5582860636)], [], [], [], []] - Dividends: [0.0033995616, 0.030355499, 0.4141048414, 0.5521400978, 0, 0, 0, 0] - Normalized Server Emission: [0, 0, 0, 0, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726] - Server Emission: [0, 0, 0, 0, 49998779, 100000610, 149996337, 200004272] - Normalized Validator Emission: [0.0016997808, 0.0151777493, 0.2070524206, 0.2760700488, 0, 0, 0, 0] - Validator Emission: [1699780, 15177749, 207052420, 276070048, 0, 0, 0, 0] - Normalized Combined Emission: [0.0016997808, 0.0151777493, 0.2070524206, 0.2760700488, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726] - Combined Emission: [1699780, 15177749, 207052420, 276070048, 49998779, 100000610, 149996337, 200004272] - Pruning Scores: [0.0016997808, 0.0151777493, 0.2070524206, 0.2760700488, 0.049998779, 0.1000006103, 0.1499963377, 0.2000042726] - */ - - assert_eq!(bonds[0][4], 435); - assert_eq!(bonds[1][4], 4985); - assert_eq!(bonds[2][4], 49151); - assert_eq!(bonds[3][4], 65535); - }); -} - -// #[test] fn test_set_alpha_disabled() { new_test_ext(1).execute_with(|| { @@ -1995,7 +1778,7 @@ fn test_zero_weights() { S: [1, 0]; S (mask): [1, 0]; S (mask+norm): [1, 0]; Block at registration: [0, 0] W: [[], []]; W (diagmask): [[], []]; W (diag+outdatemask): [[], []]; W (mask+norm): [[], []] R: [0, 0]; W (threshold): [[], []]; T: [0, 0]; C: [0.006693358, 0.006693358]; I: [0, 0] - B: [[], []]; B (outdatedmask): [[], []]; B (mask+norm): [[], []]; + B: [[], []]; B (mask+norm): [[], []]; ΔB: [[], []]; ΔB (norm): [[], []]; emaB: [[], []]; D: [0, 0] E: [1000000000, 0]; P: [1, 0] */ for validator in 0..(n / 2) { @@ -2031,7 +1814,7 @@ fn test_zero_weights() { W: [[], [(1, 1)]] W (diagmask): [[], []]; W (diag+outdatemask): [[], []]; W (mask+norm): [[], []] R: [0, 0]; W (threshold): [[], []]; T: [0, 0]; C: [0.006693358, 0.006693358]; I: [0, 0] - B: [[], []]: B (outdatedmask): [[], []]; B (mask+norm): [[], []] + B: [[], []]: B (mask+norm): [[], []] ΔB: [[], []]; ΔB (norm): [[], []]; emaB: [[], []]; D: [0, 0] E: [1000000000, 0]; P: [1, 0] */ for validator in 0..(n / 2) { @@ -2086,7 +1869,7 @@ fn test_zero_weights() { S: [1, 0]; S (mask): [1, 0]; S (mask+norm): [1, 0]; Block at registration: [0, 2]; W: [[(1, 1)], []]; W (diagmask): [[(1, 1)], []]; W (diag+outdatemask): [[], []]; W (mask+norm): [[], []]; R: [0, 0]; W (threshold): [[], []]; T: [0, 0]; C: [0.006693358, 0.006693358]; I: [0, 0]; - B: [[], []]; B (outdatedmask): [[], []]; B (mask+norm): [[], []]; + B: [[], []]; B (mask+norm): [[], []]; ΔB: [[], []]; ΔB (norm): [[], []]; emaB: [[], []]; D: [0, 0]; E: [1000000000, 0]; P: [1, 0] */ for validator in 0..(n / 2) { @@ -2120,7 +1903,7 @@ fn test_zero_weights() { S: [1, 0]; S (mask): [1, 0]; S (mask+norm): [1, 0]; Block at registration: [0, 2]; W: [[(1, 1)], []]; W (diagmask): [[(1, 1)], []]; W (diag+outdatemask): [[(1, 1)], []]; W (mask+norm): [[(1, 1)], []]; R: [0, 1]; W (threshold): [[(1, 1)], []]; T: [0, 1]; C: [0.006693358, 0.9933076561]; I: [0, 1]; - B: [[], []]; B (outdatedmask): [[], []]; B (mask+norm): [[], []]; + B: [[], []]; B (mask+norm): [[], []]; ΔB: [[(1, 1)], []]; ΔB (norm): [[(1, 1)], []]; emaB: [[(1, 1)], []]; D: [1, 0]; emaB (max-upscale): [[(1, 1)], []] E: [500000000, 500000000]; P: [0.5, 0.5] */ for validator in 0..n { @@ -2438,333 +2221,6 @@ fn test_validator_permits() { } } -#[test] -fn test_compute_alpha_values() { - // Define the consensus values. - let consensus = vec![ - I32F32::from_num(0.1), - I32F32::from_num(0.5), - I32F32::from_num(0.9), - ]; - // Define the logistic function parameters 'a' and 'b'. - let a = I32F32::from_num(1.0); - let b = I32F32::from_num(0.0); - - // Compute the alpha values using the function. - let alpha = SubtensorModule::compute_alpha_values(&consensus, a, b); - - // Ensure the length of the alpha vector matches the consensus vector. - assert_eq!(alpha.len(), consensus.len()); - - // Manually compute the expected alpha values for each consensus value. - // The logistic function is: 1 / (1 + exp(b - a * c)) - // where c is the consensus value. - - // For consensus[0] = 0.1: - // exp_val = exp(0.0 - 1.0 * 0.1) = exp(-0.1) - // alpha[0] = 1 / (1 + exp(-0.1)) ~ 0.9048374180359595 - let exp_val_0 = I32F32::from_num(0.9048374180359595); - let expected_alpha_0 = I32F32::from_num(1.0) / (I32F32::from_num(1.0) + exp_val_0); - - // For consensus[1] = 0.5: - // exp_val = exp(0.0 - 1.0 * 0.5) = exp(-0.5) - // alpha[1] = 1 / (1 + exp(-0.5)) ~ 0.6065306597126334 - let exp_val_1 = I32F32::from_num(0.6065306597126334); - let expected_alpha_1 = I32F32::from_num(1.0) / (I32F32::from_num(1.0) + exp_val_1); - - // For consensus[2] = 0.9: - // exp_val = exp(0.0 - 1.0 * 0.9) = exp(-0.9) - // alpha[2] = 1 / (1 + exp(-0.9)) ~ 0.4065696597405991 - let exp_val_2 = I32F32::from_num(0.4065696597405991); - let expected_alpha_2 = I32F32::from_num(1.0) / (I32F32::from_num(1.0) + exp_val_2); - - // Define an epsilon for approximate equality checks. - let epsilon = I32F32::from_num(1e-6); - - // Assert that the computed alpha values match the expected values within the epsilon. - assert_approx_eq(alpha[0], expected_alpha_0, epsilon); - assert_approx_eq(alpha[1], expected_alpha_1, epsilon); - assert_approx_eq(alpha[2], expected_alpha_2, epsilon); -} - -#[test] -fn test_compute_alpha_values_256_miners() { - // Define the consensus values for 256 miners. - let consensus: Vec = (0..256) - .map(|i| I32F32::from_num(i as f32 / 255.0)) - .collect(); - // Define the logistic function parameters 'a' and 'b'. - let a = I32F32::from_num(1.0); - let b = I32F32::from_num(0.0); - - // Compute the alpha values using the function. - let alpha = SubtensorModule::compute_alpha_values(&consensus, a, b); - - // Ensure the length of the alpha vector matches the consensus vector. - assert_eq!(alpha.len(), consensus.len()); - - // Define an epsilon for approximate equality checks. - let epsilon = I32F32::from_num(1e-6); - - for (i, &c) in consensus.iter().enumerate() { - // Use saturating subtraction and multiplication - let exponent = b - (a * c); - - // Use safe_exp instead of exp - let exp_val = safe_exp(exponent); - - // Use saturating addition and division - let expected_alpha = I32F32::from_num(1.0) / (I32F32::from_num(1.0) + exp_val); - - // Assert that the computed alpha values match the expected values within the epsilon. - assert_approx_eq(alpha[i], expected_alpha, epsilon); - } -} - -#[test] -fn test_clamp_alpha_values() { - // Define the alpha values. - let alpha = vec![ - I32F32::from_num(0.1), - I32F32::from_num(0.5), - I32F32::from_num(0.9), - ]; - // Define the high and low clamping values. - let alpha_high = I32F32::from_num(0.8); - let alpha_low = I32F32::from_num(0.2); - - // Compute the clamped alpha values using the function. - let clamped_alpha = SubtensorModule::clamp_alpha_values(alpha.clone(), alpha_high, alpha_low); - - // Ensure the length of the clamped alpha vector matches the original alpha vector. - assert_eq!(clamped_alpha.len(), alpha.len()); - - // Manually compute the expected clamped alpha values for each alpha value. - // The clamping logic is: max(alpha_low, min(alpha_high, a)) - - // For alpha[0] = 0.1: - // clamped_a = max(0.2, min(0.8, 0.1)) = max(0.2, 0.1) = 0.2 - let expected_clamped_alpha_0 = I32F32::from_num(0.2); - - // For alpha[1] = 0.5: - // clamped_a = max(0.2, min(0.8, 0.5)) = max(0.2, 0.5) = 0.5 - let expected_clamped_alpha_1 = I32F32::from_num(0.5); - - // For alpha[2] = 0.9: - // clamped_a = max(0.2, min(0.8, 0.9)) = max(0.2, 0.8) = 0.8 - let expected_clamped_alpha_2 = I32F32::from_num(0.8); - - // Assert that the computed clamped alpha values match the expected values. - assert_eq!(clamped_alpha[0], expected_clamped_alpha_0); - assert_eq!(clamped_alpha[1], expected_clamped_alpha_1); - assert_eq!(clamped_alpha[2], expected_clamped_alpha_2); -} - -#[test] -fn test_calculate_logistic_params() { - // Define test inputs - let alpha_high = I32F32::from_num(0.9); - let alpha_low = I32F32::from_num(0.1); - let consensus_high = I32F32::from_num(0.8); - let consensus_low = I32F32::from_num(0.2); - - // Expected values - // a = (ln((1 / alpha_high - 1)) - ln((1 / alpha_low - 1))) / (consensus_low - consensus_high) - // = (ln((1 / 0.9 - 1)) - ln((1 / 0.1 - 1))) / (0.2 - 0.8) - // = (ln(0.1111) - ln(9)) / -0.6 - // = (-2.1972 - 2.1972) / -0.6 - // = -4.3944 / -0.6 - // = 7.324 - let expected_a = I32F32::from_num(7.324); - - // b = ln((1 / alpha_low - 1)) + a * consensus_low - // = ln((1 / 0.1 - 1)) + 7.324 * 0.2 - // = ln(9) + 1.4648 - // = 2.1972 + 1.4648 - // = 3.662 - let expected_b = I32F32::from_num(3.662); - - // Call the function - let (a, b) = SubtensorModule::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Assert the results - assert!( - (a - expected_a).abs() < I32F32::from_num(0.001), - "Expected a: {:?}, got: {:?}", - expected_a, - a - ); - assert!( - (b - expected_b).abs() < I32F32::from_num(0.001), - "Expected b: {:?}, got: {:?}", - expected_b, - b - ); -} - -#[test] -fn test_calculate_logistic_params_edge_cases() { - // Edge Case 1: Alpha values at their boundaries (0 and 1) - let alpha_high = I32F32::from_num(1.0); - let alpha_low = I32F32::from_num(0.0); - let consensus_high = I32F32::from_num(0.8); - let consensus_low = I32F32::from_num(0.2); - - // Call the function - let (a, b) = SubtensorModule::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Assert the results - assert_eq!(a, I32F32::from_num(0.0), "Expected a to be 0, got: {:?}", a); - assert_eq!(b, I32F32::from_num(0.0), "Expected b to be 0, got: {:?}", b); - - // Edge Case 2: Consensus values at their boundaries (0 and 1) - let alpha_high = I32F32::from_num(0.9); - let alpha_low = I32F32::from_num(0.1); - let consensus_high = I32F32::from_num(1.0); - let consensus_low = I32F32::from_num(0.0); - - // Call the function - let (a, b) = SubtensorModule::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Expected values - // a = (ln((1 / 0.9 - 1)) - ln((1 / 0.1 - 1))) / (0.0 - 1.0) - // = (ln(0.1111) - ln(9)) / -1.0 - // = (-2.1972 - 2.1972) / -1.0 - // = -4.3944 / -1.0 - // = 4.3944 - let expected_a = I32F32::from_num(4.3944); - - // b = ln((1 / 0.1 - 1)) + a * 0.0 - // = ln(9) + 0 - // = 2.1972 - let expected_b = I32F32::from_num(2.1972); - - // Assert the results - assert!( - (a - expected_a).abs() < I32F32::from_num(0.001), - "Expected a: {:?}, got: {:?}", - expected_a, - a - ); - assert!( - (b - expected_b).abs() < I32F32::from_num(0.001), - "Expected b: {:?}, got: {:?}", - expected_b, - b - ); - - // Edge Case 3: Alpha values being equal - let alpha_high = I32F32::from_num(0.5); - let alpha_low = I32F32::from_num(0.5); - let consensus_high = I32F32::from_num(0.8); - let consensus_low = I32F32::from_num(0.2); - - // Call the function - let (a, b) = SubtensorModule::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Assert the results - assert_eq!(a, I32F32::from_num(0.0), "Expected a to be 0, got: {:?}", a); - assert_eq!(b, I32F32::from_num(0.0), "Expected b to be 0, got: {:?}", b); - - // Edge Case 4: Consensus values being equal - let alpha_high = I32F32::from_num(0.9); - let alpha_low = I32F32::from_num(0.1); - let consensus_high = I32F32::from_num(0.5); - let consensus_low = I32F32::from_num(0.5); - - // Call the function - let (a, b) = SubtensorModule::calculate_logistic_params( - alpha_high, - alpha_low, - consensus_high, - consensus_low, - ); - - // Assert the results - assert_eq!(a, I32F32::from_num(0.0), "Expected a to be 0, got: {:?}", a); - assert_eq!(b, I32F32::from_num(0.0), "Expected b to be 0, got: {:?}", b); -} - -#[test] -fn test_compute_ema_bonds_with_liquid_alpha_sparse() { - // Define test inputs - let bonds_delta = vec![ - vec![(0, I32F32::from_num(0.1)), (1, I32F32::from_num(0.2))], - vec![(0, I32F32::from_num(0.3)), (1, I32F32::from_num(0.4))], - ]; - let bonds = vec![ - vec![(0, I32F32::from_num(0.5)), (1, I32F32::from_num(0.6))], - vec![(0, I32F32::from_num(0.7)), (1, I32F32::from_num(0.8))], - ]; - let alpha = vec![I32F32::from_num(0.9), I32F32::from_num(0.8)]; - - // Expected values - // EMA calculation for each bond: - // EMA = alpha * bond_delta + (1 - alpha) * bond - // For bond (0, 0): - // EMA = 0.9 * 0.1 + (1 - 0.9) * 0.5 = 0.09 + 0.05 = 0.14 - // For bond (0, 1): - // EMA = 0.8 * 0.2 + (1 - 0.8) * 0.6 = 0.16 + 0.12 = 0.28 - // For bond (1, 0): - // EMA = 0.9 * 0.3 + (1 - 0.9) * 0.7 = 0.27 + 0.07 = 0.34 - // For bond (1, 1): - // EMA = 0.8 * 0.4 + (1 - 0.8) * 0.8 = 0.32 + 0.16 = 0.48 - let expected_ema_bonds = vec![ - vec![(0, I32F32::from_num(0.14)), (1, I32F32::from_num(0.28))], - vec![(0, I32F32::from_num(0.34)), (1, I32F32::from_num(0.48))], - ]; - - // Call the function - let ema_bonds = - SubtensorModule::compute_ema_bonds_with_liquid_alpha_sparse(&bonds_delta, &bonds, alpha); - - // Assert the results with an epsilon for approximate equality - let epsilon = I32F32::from_num(1e-6); - assert_approx_eq_vec_of_vec(&ema_bonds, &expected_ema_bonds, epsilon); -} - -#[test] -fn test_compute_ema_bonds_with_liquid_alpha_sparse_empty() { - // Test with empty inputs - let bonds_delta: Vec> = vec![]; - let bonds: Vec> = vec![]; - let alpha: Vec = vec![]; - - // Expected values: Empty Vec - let expected_ema_bonds: Vec> = vec![]; - - // Call the function - let ema_bonds = - SubtensorModule::compute_ema_bonds_with_liquid_alpha_sparse(&bonds_delta, &bonds, alpha); - - // Assert the results - assert_eq!( - ema_bonds, expected_ema_bonds, - "Expected EMA bonds: {:?}, got: {:?}", - expected_ema_bonds, ema_bonds - ); -} - #[test] fn test_get_set_alpha() { new_test_ext(1).execute_with(|| { @@ -3171,29 +2627,708 @@ pub fn assert_approx_eq(left: I32F32, right: I32F32, epsilon: I32F32) { } } -/// Helper function to assert approximate equality of two vectors of vectors of tuples. -fn assert_approx_eq_vec_of_vec( - left: &[Vec<(u16, I32F32)>], - right: &[Vec<(u16, I32F32)>], - epsilon: I32F32, -) { - assert_eq!(left.len(), right.len(), "Vectors have different lengths"); - for (left_row, right_row) in left.iter().zip(right.iter()) { - assert_eq!( - left_row.len(), - right_row.len(), - "Rows have different lengths" +// test Yuma 3 scenarios over a sequence of epochs. +fn setup_yuma_3_scenario(netuid: u16, n: u16, sparse: bool, max_stake: u64, stakes: Vec) { + let block_number = System::block_number(); + let tempo: u16 = 1; // high tempo to skip automatic epochs in on_initialize, use manual epochs instead + add_network(netuid, tempo, 0); + + SubtensorModule::set_max_allowed_uids(netuid, n); + assert_eq!(SubtensorModule::get_max_allowed_uids(netuid), n); + SubtensorModule::set_max_registrations_per_block(netuid, n); + SubtensorModule::set_target_registrations_per_interval(netuid, n); + SubtensorModule::set_weights_set_rate_limit(netuid, 0); + SubtensorModule::set_min_allowed_weights(netuid, 1); + SubtensorModule::set_max_weight_limit(netuid, u16::MAX); + SubtensorModule::set_bonds_penalty(netuid, 0); + SubtensorModule::set_alpha_sigmoid_steepness(netuid, 10); + SubtensorModule::set_bonds_moving_average(netuid, 975_000); + + // === Register + for key in 0..n as u64 { + SubtensorModule::add_balance_to_coldkey_account(&U256::from(key), max_stake); + let (nonce, work): (u64, Vec) = SubtensorModule::create_work_for_block_number( + netuid, + block_number, + key * 1_000_000, + &U256::from(key), ); - for ((left_idx, left_val), (right_idx, right_val)) in left_row.iter().zip(right_row.iter()) - { - assert_eq!(left_idx, right_idx, "Indices are different"); - assert!( - (left_val - right_val).abs() < epsilon, - "Values are different: left = {:?}, right = {:?}, epsilon = {:?}", - left_val, - right_val, - epsilon - ); + assert_ok!(SubtensorModule::register( + <::RuntimeOrigin>::signed(U256::from(key)), + netuid, + block_number, + nonce, + work, + U256::from(key), + U256::from(key) + )); + SubtensorModule::increase_stake_for_hotkey_and_coldkey_on_subnet( + &U256::from(key), + &U256::from(key), + netuid, + stakes[key as usize], + ); + } + assert_eq!(SubtensorModule::get_max_allowed_uids(netuid), n); + assert_eq!(SubtensorModule::get_subnetwork_n(netuid), n); + + // Enable Liquid Alpha + SubtensorModule::set_kappa(netuid, u16::MAX / 2); + SubtensorModule::set_liquid_alpha_enabled(netuid, true); + SubtensorModule::set_alpha_values_32(netuid, I32F32::from_num(0.1), I32F32::from_num(0.3)); + + // Enable Yuma3 + SubtensorModule::set_yuma3_enabled(netuid, true); + + // === Issue validator permits + SubtensorModule::set_max_allowed_validators(netuid, 3); + + // run first epoch to set allowed validators + // run to next block to ensure weights are set on nodes after their registration block + run_epoch(netuid, sparse); +} + +fn run_epoch(netuid: u16, sparse: bool) { + next_block_no_epoch(netuid); + if sparse { + SubtensorModule::epoch(netuid, 1_000_000_000); + } else { + SubtensorModule::epoch_dense(netuid, 1_000_000_000); + } +} + +fn run_epoch_and_check_bonds_dividends( + netuid: u16, + sparse: bool, + target_bonds: &[Vec], + target_dividends: &[f32], +) { + run_epoch(netuid, sparse); + let bonds = SubtensorModule::get_bonds_fixed_proportion(netuid); + let dividends = SubtensorModule::get_dividends(netuid); + + let epsilon = I32F32::from_num(1e-3); + // Check the bonds + for (bond, target_bond) in bonds.iter().zip(target_bonds.iter()) { + // skip the 3 validators + for (b, t) in bond.iter().zip(target_bond.iter().skip(3)) { + assert_approx_eq(*b, fixed(*t), epsilon); } } + // Check the dividends + for (dividend, target_dividend) in dividends.iter().zip(target_dividends.iter()) { + assert_approx_eq( + u16_proportion_to_fixed(*dividend), + fixed(*target_dividend), + epsilon, + ); + } +} + +fn set_yuma_3_weights(netuid: u16, weights: Vec>, indices: Vec) { + for (uid, weight) in weights.iter().enumerate() { + assert_ok!(SubtensorModule::set_weights( + RuntimeOrigin::signed(U256::from(uid as u64)), + netuid, + indices.clone(), + weight.to_vec(), + 0 + )); + } +} + +#[test] +fn test_yuma_3_kappa_moves_first() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let n: u16 = 5; // 3 validators, 2 servers + let netuid: u16 = 1; + let max_stake: u64 = 8; + + // Validator A: kappa / Big validator (0.8) - moves first + // Validator B: Small eager validator (0.1) - moves second + // Validator C: Small lazy validator (0.1) - moves last + let stakes: Vec = vec![8, 1, 1, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + let targets_bonds = [ + vec![ + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + ], + vec![ + vec![0.0908, 0.1013], + vec![0.3697, 0.0000], + vec![0.3697, 0.0000], + ], + vec![ + vec![0.0815, 0.1924], + vec![0.3170, 0.1013], + vec![0.5580, 0.0000], + ], + vec![ + vec![0.0731, 0.2742], + vec![0.2765, 0.1924], + vec![0.4306, 0.1013], + ], + vec![ + vec![0.0656, 0.3478], + vec![0.2435, 0.2742], + vec![0.3589, 0.1924], + ], + vec![ + vec![0.0588, 0.4139], + vec![0.2157, 0.3478], + vec![0.3089, 0.2742], + ], + ]; + + let targets_dividends = [ + vec![0.8000, 0.1000, 0.1000, 0.0000, 0.0000], + vec![1.0000, 0.0000, 0.0000, 0.0000, 0.0000], + vec![0.9382, 0.0618, 0.0000, 0.0000, 0.0000], + vec![0.8819, 0.0773, 0.0407, 0.0000, 0.0000], + vec![0.8564, 0.0844, 0.0592, 0.0000, 0.0000], + vec![0.8418, 0.0884, 0.0697, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 0 => { + // Initially, consensus is achieved by all Validators + set_yuma_3_weights(netuid, vec![vec![u16::MAX, 0]; 3], vec![3, 4]); + } + 1 => { + // Validator A -> Server 2 + // Validator B -> Server 1 + // Validator C -> Server 1 + set_yuma_3_weights( + netuid, + vec![vec![0, u16::MAX], vec![u16::MAX, 0], vec![u16::MAX, 0]], + vec![3, 4], + ); + } + 2 => { + // Validator A -> Server 2 + // Validator B -> Server 2 + // Validator C -> Server 1 + set_yuma_3_weights( + netuid, + vec![vec![0, u16::MAX], vec![0, u16::MAX], vec![u16::MAX, 0]], + vec![3, 4], + ); + } + 3 => { + // Subsequent epochs All validators -> Server 2 + set_yuma_3_weights(netuid, vec![vec![0, u16::MAX]; 3], vec![3, 4]); + } + _ => {} + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } +} + +#[test] +fn test_yuma_3_kappa_moves_second() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let n: u16 = 5; // 3 validators, 2 servers + let netuid: u16 = 1; + let max_stake: u64 = 8; + + // Validator A: kappa / Big validator (0.8) - moves second + // Validator B: Small eager validator (0.1) - moves first + // Validator C: Small lazy validator (0.1) - moves last + let stakes: Vec = vec![8, 1, 1, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + let targets_bonds = [ + vec![ + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + ], + vec![ + vec![0.1924, 0.0000], + vec![0.0908, 0.2987], + vec![0.1924, 0.0000], + ], + vec![ + vec![0.1715, 0.1013], + vec![0.0815, 0.3697], + vec![0.4336, 0.0000], + ], + vec![ + vec![0.1531, 0.1924], + vec![0.0731, 0.4336], + vec![0.3608, 0.1013], + ], + vec![ + vec![0.1369, 0.2742], + vec![0.0656, 0.4910], + vec![0.3103, 0.1924], + ], + vec![ + vec![0.1225, 0.3478], + vec![0.0588, 0.5426], + vec![0.2712, 0.2742], + ], + ]; + let targets_dividends = [ + vec![0.8000, 0.1000, 0.1000, 0.0000, 0.0000], + vec![0.8446, 0.0498, 0.1056, 0.0000, 0.0000], + vec![0.6868, 0.3132, 0.0000, 0.0000, 0.0000], + vec![0.7421, 0.2090, 0.0489, 0.0000, 0.0000], + vec![0.7625, 0.1706, 0.0669, 0.0000, 0.0000], + vec![0.7730, 0.1508, 0.0762, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 0 => { + // Initially, consensus is achieved by all Validators + set_yuma_3_weights(netuid, vec![vec![u16::MAX, 0]; 3], vec![3, 4]); + } + 1 => { + // Validator A -> Server 1 + // Validator B -> Server 2 + // Validator C -> Server 1 + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX, 0], vec![0, u16::MAX], vec![u16::MAX, 0]], + vec![3, 4], + ); + } + 2 => { + // Validator A -> Server 2 + // Validator B -> Server 2 + // Validator C -> Server 1 + set_yuma_3_weights( + netuid, + vec![vec![0, u16::MAX], vec![0, u16::MAX], vec![u16::MAX, 0]], + vec![3, 4], + ); + } + 3 => { + // Subsequent epochs All validators -> Server 2 + set_yuma_3_weights(netuid, vec![vec![0, u16::MAX]; 3], vec![3, 4]); + } + _ => {} + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } +} + +#[test] +fn test_yuma_3_kappa_moves_last() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let n: u16 = 5; // 3 validators, 2 servers + let netuid: u16 = 1; + let max_stake: u64 = 8; + + // Validator A: kappa / Big validator (0.8) - moves last + // Validator B: Small eager validator (0.1) - moves first + // Validator C: Small lazy validator (0.1) - moves second + let stakes: Vec = vec![8, 1, 1, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + let targets_bonds = [ + vec![ + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + ], + vec![ + vec![0.1924, 0.0000], + vec![0.0908, 0.2987], + vec![0.1924, 0.0000], + ], + vec![ + vec![0.2742, 0.0000], + vec![0.0815, 0.5081], + vec![0.1715, 0.2987], + ], + vec![ + vec![0.2416, 0.1013], + vec![0.0731, 0.5580], + vec![0.1531, 0.3697], + ], + vec![ + vec![0.2141, 0.1924], + vec![0.0656, 0.6028], + vec![0.1369, 0.4336], + ], + vec![ + vec![0.1903, 0.2742], + vec![0.0588, 0.6430], + vec![0.1225, 0.4910], + ], + ]; + let targets_dividends = [ + vec![0.8000, 0.1000, 0.1000, 0.0000, 0.0000], + vec![0.8446, 0.0498, 0.1056, 0.0000, 0.0000], + vec![0.8966, 0.0333, 0.0701, 0.0000, 0.0000], + vec![0.4663, 0.3210, 0.2127, 0.0000, 0.0000], + vec![0.5976, 0.2340, 0.1683, 0.0000, 0.0000], + vec![0.6592, 0.1932, 0.1475, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 0 => { + // Initially, consensus is achieved by all Validators + set_yuma_3_weights(netuid, vec![vec![u16::MAX, 0]; 3], vec![3, 4]); + } + 1 => { + // Validator A -> Server 1 + // Validator B -> Server 2 + // Validator C -> Server 1 + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX, 0], vec![0, u16::MAX], vec![u16::MAX, 0]], + vec![3, 4], + ); + } + 2 => { + // Validator A -> Server 1 + // Validator B -> Server 2 + // Validator C -> Server 2 + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX, 0], vec![0, u16::MAX], vec![0, u16::MAX]], + vec![3, 4], + ); + } + 3 => { + // Subsequent epochs All validators -> Server 2 + set_yuma_3_weights(netuid, vec![vec![0, u16::MAX]; 3], vec![3, 4]); + } + _ => {} + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } +} + +#[test] +fn test_yuma_3_one_epoch_switch() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let n: u16 = 5; // 3 validators, 2 servers + let netuid: u16 = 1; + let max_stake: u64 = 8; + + // Equal stake validators + let stakes: Vec = vec![33, 33, 34, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + + let targets_bonds = [ + vec![ + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + vec![0.1013, 0.0000], + ], + vec![ + vec![0.1924, 0.0000], + vec![0.1924, 0.0000], + vec![0.1924, 0.0000], + ], + vec![ + vec![0.2742, 0.0000], + vec![0.2742, 0.0000], + vec![0.1715, 0.2987], + ], + vec![ + vec![0.3478, 0.0000], + vec![0.3478, 0.0000], + vec![0.2554, 0.2618], + ], + vec![ + vec![0.4139, 0.0000], + vec![0.4139, 0.0000], + vec![0.3309, 0.2312], + ], + vec![ + vec![0.4733, 0.0000], + vec![0.4733, 0.0000], + vec![0.3987, 0.2051], + ], + ]; + let targets_dividends = [ + vec![0.3300, 0.3300, 0.3400, 0.0000, 0.0000], + vec![0.3300, 0.3300, 0.3400, 0.0000, 0.0000], + vec![0.3782, 0.3782, 0.2436, 0.0000, 0.0000], + vec![0.3628, 0.3628, 0.2745, 0.0000, 0.0000], + vec![0.3541, 0.3541, 0.2917, 0.0000, 0.0000], + vec![0.3487, 0.3487, 0.3026, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 2 => { + // Validator A -> Server 1 + // Validator B -> Server 1 + // Validator C -> Server 2 + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX, 0], vec![u16::MAX, 0], vec![0, u16::MAX]], + vec![3, 4], + ); + } + _ => { + // All validators -> Server 1 + set_yuma_3_weights(netuid, vec![vec![u16::MAX, 0]; 3], vec![3, 4]); + } + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } +} + +#[test] +fn test_yuma_3_liquid_alpha_disabled() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let n: u16 = 5; // 3 validators, 2 servers + let max_stake: u64 = 8; + + // Equal stake validators + let stakes: Vec = vec![33, 33, 34, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + + // disable liquid alpha + SubtensorModule::set_liquid_alpha_enabled(netuid, false); + + let targets_bonds = [ + vec![ + vec![0.0000, 0.0250, 0.0000], + vec![0.0000, 0.0250, 0.0000], + vec![0.0000, 0.0250, 0.0000], + ], + vec![ + vec![0.0000, 0.0494, 0.0000], + vec![0.0000, 0.0494, 0.0000], + vec![0.0000, 0.0494, 0.0000], + ], + vec![ + vec![0.0000, 0.0731, 0.0000], + vec![0.0000, 0.0731, 0.0000], + vec![0.0000, 0.0481, 0.0250], + ], + vec![ + vec![0.0000, 0.0963, 0.0000], + vec![0.0000, 0.0963, 0.0000], + vec![0.0000, 0.0719, 0.0244], + ], + vec![ + vec![0.0000, 0.1189, 0.0000], + vec![0.0000, 0.1189, 0.0000], + vec![0.0000, 0.0951, 0.0238], + ], + vec![ + vec![0.0000, 0.1409, 0.0000], + vec![0.0000, 0.1409, 0.0000], + vec![0.0000, 0.1178, 0.0232], + ], + ]; + let targets_dividends = [ + vec![0.3300, 0.3300, 0.3400, 0.0000, 0.0000], + vec![0.3300, 0.3300, 0.3400, 0.0000, 0.0000], + vec![0.3734, 0.3734, 0.2532, 0.0000, 0.0000], + vec![0.3611, 0.3611, 0.2779, 0.0000, 0.0000], + vec![0.3541, 0.3541, 0.2919, 0.0000, 0.0000], + vec![0.3495, 0.3495, 0.3009, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 2 => { + // Validator A -> Server 1 + // Validator B -> Server 1 + // Validator C -> Server 2 + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX, 0], vec![u16::MAX, 0], vec![0, u16::MAX]], + vec![3, 4], + ); + } + _ => { + // All validators -> Server 1 + set_yuma_3_weights(netuid, vec![vec![u16::MAX, 0]; 3], vec![3, 4]); + } + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } +} + +#[test] +fn test_yuma_3_stable_miner() { + for sparse in [true, false].iter() { + new_test_ext(1).execute_with(|| { + let netuid: u16 = 1; + let n: u16 = 6; // 3 validators, 3 servers + let max_stake: u64 = 8; + + // Validator A: kappa / Big validator (0.8) + // Validator B: Small eager validator (0.1) + // Validator C: Small lazy validator (0.1) + let stakes: Vec = vec![8, 1, 1, 0, 0, 0]; + + setup_yuma_3_scenario(netuid, n, *sparse, max_stake, stakes); + let targets_bonds = [ + vec![ + vec![0.0507, 0.0000, 0.0507], + vec![0.0507, 0.0000, 0.0507], + vec![0.0507, 0.0000, 0.0507], + ], + vec![ + vec![0.0962, 0.0000, 0.0962], + vec![0.0455, 0.1000, 0.0962], + vec![0.0962, 0.0000, 0.0962], + ], + vec![ + vec![0.0863, 0.0507, 0.1371], + vec![0.0408, 0.1405, 0.1371], + vec![0.1770, 0.0000, 0.1371], + ], + vec![ + vec![0.0774, 0.0962, 0.1739], + vec![0.0367, 0.1770, 0.1739], + vec![0.1579, 0.0507, 0.1739], + ], + vec![ + vec![0.0694, 0.1371, 0.2069], + vec![0.0329, 0.2097, 0.2069], + vec![0.1411, 0.0962, 0.2069], + ], + vec![ + vec![0.0623, 0.1739, 0.2366], + vec![0.0296, 0.2391, 0.2366], + vec![0.1263, 0.1371, 0.2366], + ], + ]; + let targets_dividends = [ + vec![0.8000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000], + vec![0.8226, 0.0745, 0.1028, 0.0000, 0.0000, 0.0000], + vec![0.7750, 0.1685, 0.0565, 0.0000, 0.0000, 0.0000], + vec![0.7864, 0.1372, 0.0764, 0.0000, 0.0000, 0.0000], + vec![0.7912, 0.1241, 0.0847, 0.0000, 0.0000, 0.0000], + vec![0.7937, 0.1173, 0.0890, 0.0000, 0.0000, 0.0000], + ]; + + for (epoch, (target_bonds, target_dividends)) in targets_bonds + .iter() + .zip(targets_dividends.iter()) + .enumerate() + { + match epoch { + 0 => { + // all validators 0.5 for first and third server + set_yuma_3_weights( + netuid, + vec![vec![u16::MAX / 2, 0, u16::MAX / 2]; 3], + vec![3, 4, 5], + ); + } + 1 => { + // one of small validators moves 0.5 to seconds server + set_yuma_3_weights( + netuid, + vec![ + vec![u16::MAX / 2, 0, u16::MAX / 2], + vec![0, u16::MAX / 2, u16::MAX / 2], + vec![u16::MAX / 2, 0, u16::MAX / 2], + ], + vec![3, 4, 5], + ); + } + 2 => { + // big validator follows + set_yuma_3_weights( + netuid, + vec![ + vec![0, u16::MAX / 2, u16::MAX / 2], + vec![0, u16::MAX / 2, u16::MAX / 2], + vec![u16::MAX / 2, 0, u16::MAX / 2], + ], + vec![3, 4, 5], + ); + } + 3 => { + // Subsequent epochs all validators have moves + set_yuma_3_weights( + netuid, + vec![vec![0, u16::MAX / 2, u16::MAX / 2]; 3], + vec![3, 4, 5], + ); + } + _ => {} + }; + run_epoch_and_check_bonds_dividends( + netuid, + *sparse, + target_bonds, + target_dividends, + ); + } + }) + } } diff --git a/pallets/subtensor/src/tests/math.rs b/pallets/subtensor/src/tests/math.rs index c70da2c9d2..01e02742b7 100644 --- a/pallets/subtensor/src/tests/math.rs +++ b/pallets/subtensor/src/tests/math.rs @@ -1221,42 +1221,59 @@ fn test_math_vec_mask_sparse_matrix() { } #[test] -fn test_math_scalar_vec_mask_sparse_matrix() { - let vector: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9.]; - let target: Vec = vec![0., 2., 3., 0., 5., 6., 0., 8., 9.]; - let mat = vec_to_sparse_mat_fixed(&vector, 3, false); - let scalar: u64 = 1; - let masking_vector: Vec = vec![1, 4, 7]; - let result = scalar_vec_mask_sparse_matrix(&mat, scalar, &masking_vector, &|a, b| a == b); - assert_sparse_mat_compare( - &result, - &vec_to_sparse_mat_fixed(&target, 3, false), - I32F32::from_num(0), - ); +fn test_math_vec_mul() { + let vector: Vec = vec_to_fixed(&[1., 2., 3., 4.]); + let target: Vec = vec_to_fixed(&[1., 4., 9., 16.]); + let result = vec_mul(&vector, &vector); + assert_vec_compare(&result, &target, I32F32::from_num(0)); + let vector_empty: Vec = vec_to_fixed(&[]); + let result = vec_mul(&vector_empty, &vector); + let target: Vec = vec![]; + assert_vec_compare(&result, &target, I32F32::from_num(0)); + let vector_zero: Vec = vec_to_fixed(&[0., 0., 0., 0., 0., 0., 0., 0.]); + let result = vec_mul(&vector_zero, &vector); + let target: Vec = vec![I32F32::from_num(0); 4]; + assert_vec_compare(&result, &target, I32F32::from_num(0)); +} - let vector: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9.]; - let target: Vec = vec![1., 2., 0., 4., 5., 0., 7., 8., 0.]; - let mat = vec_to_sparse_mat_fixed(&vector, 3, false); - let scalar: u64 = 5; - let masking_vector: Vec = vec![1, 4, 7]; - let result = scalar_vec_mask_sparse_matrix(&mat, scalar, &masking_vector, &|a, b| a <= b); - assert_sparse_mat_compare( - &result, - &vec_to_sparse_mat_fixed(&target, 3, false), - I32F32::from_num(0), - ); +#[test] +fn test_math_mat_vec_mul() { + let matrix: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; + let matrix = vec_to_mat_fixed(&matrix, 4, false); + let vector: Vec = vec_to_fixed(&[1., 2., 3.]); + let target: Vec = vec![1., 4., 9., 4., 10., 18., 7., 16., 27., 10., 22., 36.]; + let target = vec_to_mat_fixed(&target, 4, false); + let result = mat_vec_mul(&matrix, &vector); + assert_mat_compare(&result, &target, I32F32::from_num(0)); + let vector_one: Vec = vec_to_fixed(&[1., 0., 0.]); + let target: Vec = vec![1., 0., 0., 4., 0., 0., 7., 0., 0., 10., 0., 0.]; + let target = vec_to_mat_fixed(&target, 4, false); + let result = mat_vec_mul(&matrix, &vector_one); + assert_mat_compare(&result, &target, I32F32::from_num(0)); + let vector_empty: Vec = vec_to_fixed(&[]); + let result = mat_vec_mul(&matrix, &vector_empty); + let target: Vec> = vec![vec![]; 4]; + assert_mat_compare(&result, &target, I32F32::from_num(0)); +} - let vector: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9.]; - let target: Vec = vec![0., 0., 3., 0., 0., 6., 0., 0., 9.]; - let mat = vec_to_sparse_mat_fixed(&vector, 3, false); - let scalar: u64 = 5; - let masking_vector: Vec = vec![1, 4, 7]; - let result = scalar_vec_mask_sparse_matrix(&mat, scalar, &masking_vector, &|a, b| a >= b); - assert_sparse_mat_compare( - &result, - &vec_to_sparse_mat_fixed(&target, 3, false), - I32F32::from_num(0), - ); +#[test] +fn test_math_mat_vec_mul_sparse() { + let matrix: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; + let matrix = vec_to_sparse_mat_fixed(&matrix, 4, false); + let vector: Vec = vec_to_fixed(&[1., 2., 3.]); + let target: Vec = vec![1., 4., 9., 4., 10., 18., 7., 16., 27., 10., 22., 36.]; + let target = vec_to_sparse_mat_fixed(&target, 4, false); + let result = mat_vec_mul_sparse(&matrix, &vector); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(0)); + let vector_one: Vec = vec_to_fixed(&[1., 0., 0.]); + let target: Vec = vec![1., 0., 0., 4., 0., 0., 7., 0., 0., 10., 0., 0.]; + let target = vec_to_sparse_mat_fixed(&target, 4, false); + let result = mat_vec_mul_sparse(&matrix, &vector_one); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(0)); + let vector_empty: Vec = vec_to_fixed(&[]); + let result = mat_vec_mul_sparse(&matrix, &vector_empty); + let target = vec![vec![]; 4]; + assert_sparse_mat_compare(&result, &target, I32F32::from_num(0)); } #[test] @@ -2133,89 +2150,116 @@ fn test_math_hadamard_sparse() { } #[test] -fn test_math_mat_ema() { - let old: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; - let new: Vec = vec![ - 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., +fn test_math_mat_ema_alpha() { + let old: Vec = vec![ + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, ]; + let new: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; let target: Vec = vec![ - 1.9, 3.8, 5.7, 7.6, 9.5, 11.4, 13.3, 15.2, 17.1, 19., 20.9, 22.8, + 0.19, 0.38, 1., 0.436, 0.545, 0.6539, 0.763, 0.8719, 0.981, 1., 1., 1., ]; + let old = vec_to_mat_fixed(&old, 4, false); let new = vec_to_mat_fixed(&new, 4, false); let target = vec_to_mat_fixed(&target, 4, false); - let result = mat_ema(&new, &old, I32F32::from_num(0.1)); - assert_mat_compare(&result, &target, I32F32::from_num(0.000001)); - let old: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha(&new, &old, &alphas); + assert_mat_compare(&result, &target, I32F32::from_num(1e-4)); + let old: Vec = vec![ + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, + ]; let new: Vec = vec![ 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., ]; - let target: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; + let target: Vec = vec![ + 0.10, 0.2, 1., 0.0399, 0.05, 0.0599, 0.07, 0.07999, 0.09, 0.1, 0.10999, 0.11999, + ]; let old = vec_to_mat_fixed(&old, 4, false); let new = vec_to_mat_fixed(&new, 4, false); let target = vec_to_mat_fixed(&target, 4, false); - let result = mat_ema(&new, &old, I32F32::from_num(0)); - assert_mat_compare(&result, &target, I32F32::from_num(0.000001)); - let old: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; + let alphas = vec_to_mat_fixed(&[0.; 12], 4, false); + let result = mat_ema_alpha(&new, &old, &alphas); + assert_mat_compare(&result, &target, I32F32::from_num(1e-4)); + let old: Vec = vec![ + 0.001, 0.002, 0.003, 0.004, 0.05, 0.006, 0.007, 0.008, 0.009, 0.010, 0.011, 0.012, + ]; let new: Vec = vec![ - 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, ]; let target: Vec = vec![ - 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., + 0.10, 0.2, 1., 0.0399, 0.05, 0.0599, 0.07, 0.07999, 0.09, 0.1, 0.10999, 0.11999, ]; + let old = vec_to_mat_fixed(&old, 4, false); let new = vec_to_mat_fixed(&new, 4, false); let target = vec_to_mat_fixed(&target, 4, false); - let result = mat_ema(&new, &old, I32F32::from_num(1)); - assert_mat_compare(&result, &target, I32F32::from_num(0.000001)); + let alphas = vec_to_mat_fixed(&[1.; 12], 4, false); + let result = mat_ema_alpha(&new, &old, &alphas); + assert_mat_compare(&result, &target, I32F32::from_num(1e-4)); } #[test] -fn test_math_sparse_mat_ema() { - let old: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; - let new: Vec = vec![ - 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., 110., 120., +fn test_math_sparse_mat_ema_alpha() { + let old: Vec = vec![ + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, ]; + let new: Vec = vec![1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12.]; let target: Vec = vec![ - 1.9, 3.8, 5.7, 7.6, 9.5, 11.4, 13.3, 15.2, 17.1, 19., 20.9, 22.8, + 0.19, 0.38, 1., 0.43599, 0.545, 0.65399, 0.763, 0.87199, 0.981, 1., 1., 1., ]; let old = vec_to_sparse_mat_fixed(&old, 4, false); let new = vec_to_sparse_mat_fixed(&new, 4, false); let target = vec_to_sparse_mat_fixed(&target, 4, false); - let result = mat_ema_sparse(&new, &old, I32F32::from_num(0.1)); - assert_sparse_mat_compare(&result, &target, I32F32::from_num(0.000001)); - let old: Vec = vec![0., 2., 3., 4., 0., 6., 7., 8., 0., 10., 11., 12.]; - let new: Vec = vec![10., 20., 0., 40., 0., 60., 0., 80., 90., 100., 110., 120.]; - let target: Vec = vec![1., 3.8, 2.7, 7.6, 0., 11.4, 6.3, 15.2, 9., 19., 20.9, 22.8]; + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha_sparse(&new, &old, &alphas); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(1e-4)); + let old: Vec = vec![ + 0.001, 0.002, 0.003, 0.004, 0.05, 0.006, 0.007, 0.008, 0.009, 0.010, 0.011, 0.012, + ]; + let new: Vec = vec![ + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, + ]; + let target: Vec = vec![ + 0.0109, 0.0218, 0.30270, 0.007599, 0.05, 0.01139, 0.0133, 0.01519, 0.017, 0.01899, 0.02089, + 0.0227, + ]; let old = vec_to_sparse_mat_fixed(&old, 4, false); let new = vec_to_sparse_mat_fixed(&new, 4, false); let target = vec_to_sparse_mat_fixed(&target, 4, false); - let result = mat_ema_sparse(&new, &old, I32F32::from_num(0.1)); - assert_sparse_mat_compare(&result, &target, I32F32::from_num(0.000001)); + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha_sparse(&new, &old, &alphas); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(1e-4)); let old: Vec = vec![0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]; - let new: Vec = vec![10., 20., 0., 40., 0., 60., 0., 80., 90., 100., 110., 120.]; - let target: Vec = vec![1., 2., 0., 4., 0., 6., 0., 8., 9., 10., 11., 12.]; + let new: Vec = vec![ + 0.1, 0.2, 3., 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, + ]; + let target: Vec = vec![ + 0.01, 0.02, 0.3, 0.00399, 0.005, 0.00599, 0.007, 0.00799, 0.009, 0.01, 0.011, 0.01199, + ]; let old = vec_to_sparse_mat_fixed(&old, 4, false); let new = vec_to_sparse_mat_fixed(&new, 4, false); let target = vec_to_sparse_mat_fixed(&target, 4, false); - let result = mat_ema_sparse(&new, &old, I32F32::from_num(0.1)); - assert_sparse_mat_compare(&result, &target, I32F32::from_num(0.000001)); + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha_sparse(&new, &old, &alphas); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(1e-4)); let old: Vec = vec![0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]; let new: Vec = vec![0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]; let target: Vec = vec![0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]; let old = vec_to_sparse_mat_fixed(&old, 4, false); let new = vec_to_sparse_mat_fixed(&new, 4, false); let target = vec_to_sparse_mat_fixed(&target, 4, false); - let result = mat_ema_sparse(&new, &old, I32F32::from_num(0.1)); - assert_sparse_mat_compare(&result, &target, I32F32::from_num(0.000001)); + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha_sparse(&new, &old, &alphas); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(1e-4)); let old: Vec = vec![1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]; let new: Vec = vec![0., 0., 0., 0., 2., 0., 0., 0., 0., 0., 0., 0.]; - let target: Vec = vec![0.9, 0., 0., 0., 0.2, 0., 0., 0., 0., 0., 0., 0.]; + let target: Vec = vec![0.0, 0., 0., 0., 0.2, 0., 0., 0., 0., 0., 0., 0.]; let old = vec_to_sparse_mat_fixed(&old, 4, false); let new = vec_to_sparse_mat_fixed(&new, 4, false); let target = vec_to_sparse_mat_fixed(&target, 4, false); - let result = mat_ema_sparse(&new, &old, I32F32::from_num(0.1)); - assert_sparse_mat_compare(&result, &target, I32F32::from_num(0.000001)); + let alphas = vec_to_mat_fixed(&[0.1; 12], 4, false); + let result = mat_ema_alpha_sparse(&new, &old, &alphas); + assert_sparse_mat_compare(&result, &target, I32F32::from_num(1e-1)); } #[test] @@ -2505,25 +2549,25 @@ fn test_checked_sum() { } #[test] -fn test_mat_ema_alpha_vec_sparse_empty() { +fn test_mat_ema_alpha_sparse_empty() { let new: Vec> = Vec::new(); let old: Vec> = Vec::new(); - let alpha: Vec = Vec::new(); - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); + let alpha: Vec> = Vec::new(); + let result = mat_ema_alpha_sparse(&new, &old, &alpha); assert_eq!(result, Vec::>::new()); } #[test] -fn test_mat_ema_alpha_vec_sparse_single_element() { +fn test_mat_ema_alpha_sparse_single_element() { let new: Vec> = vec![vec![(0, I32F32::from_num(1.0))]]; let old: Vec> = vec![vec![(0, I32F32::from_num(2.0))]]; - let alpha: Vec = vec![I32F32::from_num(0.5)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); - assert_eq!(result, vec![vec![(0, I32F32::from_num(1.5))]]); + let alpha = vec![vec![I32F32::from_num(0.5)]]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); + assert_eq!(result, vec![vec![(0, I32F32::from_num(1.0))]]); } #[test] -fn test_mat_ema_alpha_vec_sparse_multiple_elements() { +fn test_mat_ema_alpha_sparse_multiple_elements() { let new: Vec> = vec![ vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(2.0))], vec![(0, I32F32::from_num(3.0)), (1, I32F32::from_num(4.0))], @@ -2532,35 +2576,35 @@ fn test_mat_ema_alpha_vec_sparse_multiple_elements() { vec![(0, I32F32::from_num(5.0)), (1, I32F32::from_num(6.0))], vec![(0, I32F32::from_num(7.0)), (1, I32F32::from_num(8.0))], ]; - let alpha: Vec = vec![I32F32::from_num(0.1), I32F32::from_num(0.2)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); + let alpha = vec![vec![I32F32::from_num(0.1), I32F32::from_num(0.2)]; 2]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); let expected = vec![ - vec![(0, I32F32::from_num(4.6)), (1, I32F32::from_num(5.2))], - vec![(0, I32F32::from_num(6.6)), (1, I32F32::from_num(7.2))], + vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(1.0))], + vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(1.0))], ]; assert_sparse_mat_compare(&result, &expected, I32F32::from_num(0.000001)); } #[test] -fn test_mat_ema_alpha_vec_sparse_zero_alpha() { +fn test_mat_ema_alpha_sparse_zero_alpha() { let new: Vec> = vec![vec![(0, I32F32::from_num(1.0))]]; let old: Vec> = vec![vec![(0, I32F32::from_num(2.0))]]; - let alpha: Vec = vec![I32F32::from_num(0.0)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); - assert_eq!(result, vec![vec![(0, I32F32::from_num(2.0))]]); + let alpha = vec![vec![I32F32::from_num(0.1), I32F32::from_num(0.0)]]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); + assert_eq!(result, vec![vec![(0, I32F32::from_num(1.0))]]); } #[test] -fn test_mat_ema_alpha_vec_sparse_one_alpha() { +fn test_mat_ema_alpha_sparse_one_alpha() { let new: Vec> = vec![vec![(0, I32F32::from_num(1.0))]]; let old: Vec> = vec![vec![(0, I32F32::from_num(2.0))]]; - let alpha: Vec = vec![I32F32::from_num(1.0)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); + let alpha = vec![vec![I32F32::from_num(1.0), I32F32::from_num(0.0)]]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); assert_eq!(result, vec![vec![(0, I32F32::from_num(1.0))]]); } #[test] -fn test_mat_ema_alpha_vec_sparse_mixed_alpha() { +fn test_mat_ema_alpha_sparse_mixed_alpha() { let new: Vec> = vec![ vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(2.0))], vec![(0, I32F32::from_num(3.0)), (1, I32F32::from_num(4.0))], @@ -2569,20 +2613,20 @@ fn test_mat_ema_alpha_vec_sparse_mixed_alpha() { vec![(0, I32F32::from_num(5.0)), (1, I32F32::from_num(6.0))], vec![(0, I32F32::from_num(7.0)), (1, I32F32::from_num(8.0))], ]; - let alpha: Vec = vec![I32F32::from_num(0.3), I32F32::from_num(0.7)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); + let alpha = vec![vec![I32F32::from_num(0.3), I32F32::from_num(0.7)]; 2]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); assert_sparse_mat_compare( &result, &[ - vec![(0, I32F32::from_num(3.8)), (1, I32F32::from_num(3.2))], - vec![(0, I32F32::from_num(5.8)), (1, I32F32::from_num(5.2))], + vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(1.0))], + vec![(0, I32F32::from_num(1.0)), (1, I32F32::from_num(1.0))], ], I32F32::from_num(0.000001), ); } #[test] -fn test_mat_ema_alpha_vec_sparse_sparse_matrix() { +fn test_mat_ema_alpha_sparse_sparse_matrix() { let new: Vec> = vec![ vec![(0, I32F32::from_num(1.0))], vec![(1, I32F32::from_num(4.0))], @@ -2591,77 +2635,114 @@ fn test_mat_ema_alpha_vec_sparse_sparse_matrix() { vec![(0, I32F32::from_num(5.0))], vec![(1, I32F32::from_num(8.0))], ]; - let alpha: Vec = vec![I32F32::from_num(0.5), I32F32::from_num(0.5)]; - let result = mat_ema_alpha_vec_sparse(&new, &old, &alpha); + let alpha = vec![vec![I32F32::from_num(0.5), I32F32::from_num(0.5)]; 2]; + let result = mat_ema_alpha_sparse(&new, &old, &alpha); assert_eq!( result, vec![ - vec![(0, I32F32::from_num(3.0))], - vec![(1, I32F32::from_num(6.0))] + vec![(0, I32F32::from_num(1.0))], + vec![(1, I32F32::from_num(1.0))] ] ); } #[test] -fn test_mat_ema_alpha_vec_basic() { +fn test_mat_ema_alpha_basic() { let new = mat_to_fixed(&[vec![1.0, 2.0, 3.0], vec![4.0, 5.0, 6.0]]); let old = mat_to_fixed(&[vec![0.5, 1.5, 2.5], vec![3.5, 4.5, 5.5]]); let alpha = vec![ - I32F32::from_num(0.5), - I32F32::from_num(0.5), - I32F32::from_num(0.5), + vec![ + I32F32::from_num(0.5), + I32F32::from_num(0.5), + I32F32::from_num(0.5), + ]; + 2 ]; - let expected = mat_to_fixed(&[vec![0.75, 1.75, 2.75], vec![3.75, 4.75, 5.75]]); - let result = mat_ema_alpha_vec(&new, &old, &alpha); + let expected = mat_to_fixed(&[vec![0.75, 1.0, 1.0], vec![1.0, 1.0, 1.0]]); + let result = mat_ema_alpha(&new, &old, &alpha); assert_eq!(result, expected); } #[test] -fn test_mat_ema_alpha_vec_varying_alpha() { +fn test_mat_ema_alpha_varying_alpha() { let new = mat_to_fixed(&[vec![1.0, 2.0, 3.0], vec![4.0, 5.0, 6.0]]); let old = mat_to_fixed(&[vec![0.5, 1.5, 2.5], vec![3.5, 4.5, 5.5]]); let alpha = vec![ - I32F32::from_num(0.2), - I32F32::from_num(0.5), - I32F32::from_num(0.8), + vec![ + I32F32::from_num(0.2), + I32F32::from_num(0.5), + I32F32::from_num(0.8), + ]; + 2 ]; - let expected = mat_to_fixed(&[vec![0.6, 1.75, 2.9], vec![3.6, 4.75, 5.9]]); - let result = mat_ema_alpha_vec(&new, &old, &alpha); + let expected = mat_to_fixed(&[vec![0.6, 1.0, 1.0], vec![1.0, 1.0, 1.0]]); + let result = mat_ema_alpha(&new, &old, &alpha); assert_mat_approx_eq(&result, &expected, I32F32::from_num(1e-6)); } #[test] -fn test_mat_ema_alpha_vec_empty_matrices() { +fn test_mat_ema_alpha_sparse_varying_alpha() { + let weights = vec![ + vec![(0, I32F32::from_num(0.1)), (1, I32F32::from_num(0.2))], + vec![(0, I32F32::from_num(0.3)), (1, I32F32::from_num(0.4))], + ]; + let bonds = vec![ + vec![(0, I32F32::from_num(0.5)), (1, I32F32::from_num(0.6))], + vec![(0, I32F32::from_num(0.7)), (1, I32F32::from_num(0.8))], + ]; + let alpha = vec![ + vec![I32F32::from_num(0.9), I32F32::from_num(0.8)], + vec![I32F32::from_num(0.5), I32F32::from_num(0.7)], + ]; + + let expected = vec![ + vec![(0, I32F32::from_num(0.14)), (1, I32F32::from_num(0.28))], + vec![ + (0, I32F32::from_num(0.499999)), + (1, I32F32::from_num(0.519999)), + ], + ]; + + let result = mat_ema_alpha_sparse(&weights, &bonds, &alpha); + // Assert the results with an epsilon for approximate equality + assert_sparse_mat_compare(&result, &expected, I32F32::from_num(1e-6)); +} + +#[test] +fn test_mat_ema_alpha_empty_matrices() { let new: Vec> = vec![]; let old: Vec> = vec![]; - let alpha: Vec = vec![]; + let alpha = vec![]; let expected: Vec> = vec![vec![]; 1]; - let result = mat_ema_alpha_vec(&new, &old, &alpha); + let result = mat_ema_alpha(&new, &old, &alpha); assert_eq!(result, expected); } #[test] -fn test_mat_ema_alpha_vec_single_element() { +fn test_mat_ema_alpha_single_element() { let new = mat_to_fixed(&[vec![1.0]]); let old = mat_to_fixed(&[vec![0.5]]); - let alpha = vec![I32F32::from_num(0.5)]; + let alpha = vec![vec![I32F32::from_num(0.5)]]; let expected = mat_to_fixed(&[vec![0.75]]); - let result = mat_ema_alpha_vec(&new, &old, &alpha); + let result = mat_ema_alpha(&new, &old, &alpha); assert_eq!(result, expected); } // TODO: (@sd): Should these be non panicking? #[test] #[should_panic(expected = "assertion failed")] -fn test_mat_ema_alpha_vec_mismatched_dimensions() { +fn test_mat_ema_alpha_mismatched_dimensions() { let new = mat_to_fixed(&[vec![1.0, 2.0], vec![3.0, 4.0]]); let old = mat_to_fixed(&[vec![1.0, 2.0, 3.0], vec![4.0, 5.0, 6.0]]); let alpha = vec![ - I32F32::from_num(0.5), - I32F32::from_num(0.5), - I32F32::from_num(0.5), + vec![ + I32F32::from_num(0.5), + I32F32::from_num(0.5), + I32F32::from_num(0.5), + ]; + 2 ]; - let _result = mat_ema_alpha_vec(&new, &old, &alpha); + let _result = mat_ema_alpha(&new, &old, &alpha); } #[test] diff --git a/pallets/subtensor/src/tests/mock.rs b/pallets/subtensor/src/tests/mock.rs index a8ab96be8c..fbc3a6b2e5 100644 --- a/pallets/subtensor/src/tests/mock.rs +++ b/pallets/subtensor/src/tests/mock.rs @@ -132,6 +132,7 @@ parameter_types! { pub const TransactionByteFee: Balance = 100; pub const SDebug:u64 = 1; pub const InitialRho: u16 = 30; + pub const InitialAlphaSigmoidSteepness: u16 = 10; pub const InitialKappa: u16 = 32_767; pub const InitialTempo: u16 = 360; pub const SelfOwnership: u64 = 2; @@ -180,6 +181,7 @@ parameter_types! { pub const InitialAlphaHigh: u16 = 58982; // Represents 0.9 as per the production default pub const InitialAlphaLow: u16 = 45875; // Represents 0.7 as per the production default pub const InitialLiquidAlphaOn: bool = false; // Default value for LiquidAlphaOn + pub const InitialYuma3On: bool = false; // Default value for Yuma3On // pub const InitialNetworkMaxStake: u64 = u64::MAX; // (DEPRECATED) pub const InitialColdkeySwapScheduleDuration: u64 = 5 * 24 * 60 * 60 / 12; // Default as 5 days pub const InitialDissolveNetworkScheduleDuration: u64 = 5 * 24 * 60 * 60 / 12; // Default as 5 days @@ -366,6 +368,7 @@ impl crate::Config for Test { type InitialAdjustmentAlpha = InitialAdjustmentAlpha; type InitialTargetRegistrationsPerInterval = InitialTargetRegistrationsPerInterval; type InitialRho = InitialRho; + type InitialAlphaSigmoidSteepness = InitialAlphaSigmoidSteepness; type InitialKappa = InitialKappa; type InitialMaxAllowedUids = InitialMaxAllowedUids; type InitialValidatorPruneLen = InitialValidatorPruneLen; @@ -404,6 +407,7 @@ impl crate::Config for Test { type AlphaHigh = InitialAlphaHigh; type AlphaLow = InitialAlphaLow; type LiquidAlphaOn = InitialLiquidAlphaOn; + type Yuma3On = InitialYuma3On; type Preimages = Preimage; type InitialColdkeySwapScheduleDuration = InitialColdkeySwapScheduleDuration; type InitialDissolveNetworkScheduleDuration = InitialDissolveNetworkScheduleDuration; diff --git a/pallets/subtensor/src/tests/mod.rs b/pallets/subtensor/src/tests/mod.rs index ce891e5615..161749a923 100644 --- a/pallets/subtensor/src/tests/mod.rs +++ b/pallets/subtensor/src/tests/mod.rs @@ -1,6 +1,7 @@ mod batch_tx; mod children; mod coinbase; +mod consensus; mod delegate_info; mod difficulty; mod emission; diff --git a/pallets/subtensor/src/utils/misc.rs b/pallets/subtensor/src/utils/misc.rs index b375cc66e4..caea51d285 100644 --- a/pallets/subtensor/src/utils/misc.rs +++ b/pallets/subtensor/src/utils/misc.rs @@ -671,6 +671,12 @@ impl Pallet { AlphaValues::::get(netuid) } + pub fn set_alpha_values_32(netuid: u16, low: I32F32, high: I32F32) { + let low = (low.saturating_mul(I32F32::saturating_from_num(u16::MAX))).to_num::(); + let high = (high.saturating_mul(I32F32::saturating_from_num(u16::MAX))).to_num::(); + AlphaValues::::insert(netuid, (low, high)); + } + pub fn get_alpha_values_32(netuid: u16) -> (I32F32, I32F32) { let (alpha_low, alpha_high): (u16, u16) = AlphaValues::::get(netuid); let converted_low = @@ -681,6 +687,14 @@ impl Pallet { (converted_low, converted_high) } + pub fn set_alpha_sigmoid_steepness(netuid: u16, steepness: u16) { + AlphaSigmoidSteepness::::insert(netuid, steepness); + } + pub fn get_alpha_sigmoid_steepness(netuid: u16) -> I32F32 { + let alpha = AlphaSigmoidSteepness::::get(netuid); + I32F32::saturating_from_num(alpha) + } + pub fn set_liquid_alpha_enabled(netuid: u16, enabled: bool) { LiquidAlphaOn::::set(netuid, enabled); } @@ -689,6 +703,14 @@ impl Pallet { LiquidAlphaOn::::get(netuid) } + pub fn set_yuma3_enabled(netuid: u16, enabled: bool) { + Yuma3On::::set(netuid, enabled); + } + + pub fn get_yuma3_enabled(netuid: u16) -> bool { + Yuma3On::::get(netuid) + } + /// Set the duration for coldkey swap /// /// # Arguments diff --git a/precompiles/src/solidity/subnet.abi b/precompiles/src/solidity/subnet.abi index e2a3e569da..a2849a0cbe 100644 --- a/precompiles/src/solidity/subnet.abi +++ b/precompiles/src/solidity/subnet.abi @@ -194,6 +194,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + } + ], + "name": "getYuma3Enabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -668,6 +687,24 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "netuid", + "type": "uint16" + }, + { + "internalType": "bool", + "name": "yuma3Enabled", + "type": "bool" + } + ], + "name": "setYuma3Enabled", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/precompiles/src/solidity/subnet.sol b/precompiles/src/solidity/subnet.sol index d5ef0916d9..2fa9d3f550 100644 --- a/precompiles/src/solidity/subnet.sol +++ b/precompiles/src/solidity/subnet.sol @@ -152,6 +152,13 @@ interface ISubnet { bool liquidAlphaEnabled ) external payable; + function getYuma3Enabled(uint16 netuid) external view returns (bool); + + function setYuma3Enabled( + uint16 netuid, + bool yuma3Enabled + ) external payable; + function getAlphaValues( uint16 netuid ) external view returns (uint16, uint16); diff --git a/precompiles/src/subnet.rs b/precompiles/src/subnet.rs index cf2b71bcd2..7d4dd175e3 100644 --- a/precompiles/src/subnet.rs +++ b/precompiles/src/subnet.rs @@ -327,6 +327,12 @@ where Ok(pallet_subtensor::Rho::::get(netuid)) } + #[precompile::public("getAlphaSigmoidSteepness(uint16)")] + #[precompile::view] + fn get_alpha_sigmoid_steepness(_: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { + Ok(pallet_subtensor::AlphaSigmoidSteepness::::get(netuid)) + } + #[precompile::public("setRho(uint16,uint16)")] #[precompile::payable] fn set_rho(handle: &mut impl PrecompileHandle, netuid: u16, rho: u16) -> EvmResult<()> { @@ -338,6 +344,22 @@ where ) } + #[precompile::public("setAlphaSigmoidSteepness(uint16,uint16)")] + #[precompile::payable] + fn set_alpha_sigmoid_steepness( + handle: &mut impl PrecompileHandle, + netuid: u16, + steepness: u16, + ) -> EvmResult<()> { + let call = + pallet_admin_utils::Call::::sudo_set_alpha_sigmoid_steepness { netuid, steepness }; + + handle.try_dispatch_runtime_call::( + call, + RawOrigin::Signed(handle.caller_account_id::()), + ) + } + #[precompile::public("getActivityCutoff(uint16)")] #[precompile::view] fn get_activity_cutoff(_: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { @@ -549,6 +571,27 @@ where ) } + #[precompile::public("getYuma3Enabled(uint16)")] + #[precompile::view] + fn get_yuma3_enabled(_: &mut impl PrecompileHandle, netuid: u16) -> EvmResult { + Ok(pallet_subtensor::Yuma3On::::get(netuid)) + } + + #[precompile::public("setYuma3Enabled(uint16,bool)")] + #[precompile::payable] + fn set_yuma3_enabled( + handle: &mut impl PrecompileHandle, + netuid: u16, + enabled: bool, + ) -> EvmResult<()> { + let call = pallet_admin_utils::Call::::sudo_set_yuma3_enabled { netuid, enabled }; + + handle.try_dispatch_runtime_call::( + call, + RawOrigin::Signed(handle.caller_account_id::()), + ) + } + #[precompile::public("getAlphaValues(uint16)")] #[precompile::view] fn get_alpha_values(_: &mut impl PrecompileHandle, netuid: u16) -> EvmResult<(u16, u16)> { diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a7a89608c9..6d0c6fa8c8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1024,6 +1024,7 @@ pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = 5; // Configure the pallet subtensor. parameter_types! { pub const SubtensorInitialRho: u16 = 10; + pub const SubtensorInitialAlphaSigmoidSteepness: u16 = 1000; pub const SubtensorInitialKappa: u16 = 32_767; // 0.5 = 65535/2 pub const SubtensorInitialMaxAllowedUids: u16 = 4096; pub const SubtensorInitialIssuance: u64 = 0; @@ -1072,6 +1073,7 @@ parameter_types! { pub const InitialAlphaHigh: u16 = 58982; // Represents 0.9 as per the production default pub const InitialAlphaLow: u16 = 45875; // Represents 0.7 as per the production default pub const InitialLiquidAlphaOn: bool = false; // Default value for LiquidAlphaOn + pub const InitialYuma3On: bool = false; // Default value for Yuma3On // pub const SubtensorInitialNetworkMaxStake: u64 = u64::MAX; // (DEPRECATED) pub const InitialColdkeySwapScheduleDuration: BlockNumber = 5 * 24 * 60 * 60 / 12; // 5 days pub const InitialDissolveNetworkScheduleDuration: BlockNumber = 5 * 24 * 60 * 60 / 12; // 5 days @@ -1094,6 +1096,7 @@ impl pallet_subtensor::Config for Runtime { type TriumvirateInterface = TriumvirateVotes; type Scheduler = Scheduler; type InitialRho = SubtensorInitialRho; + type InitialAlphaSigmoidSteepness = SubtensorInitialAlphaSigmoidSteepness; type InitialKappa = SubtensorInitialKappa; type InitialMaxAllowedUids = SubtensorInitialMaxAllowedUids; type InitialBondsMovingAverage = SubtensorInitialBondsMovingAverage; @@ -1141,6 +1144,7 @@ impl pallet_subtensor::Config for Runtime { type AlphaHigh = InitialAlphaHigh; type AlphaLow = InitialAlphaLow; type LiquidAlphaOn = InitialLiquidAlphaOn; + type Yuma3On = InitialYuma3On; type InitialTaoWeight = SubtensorInitialTaoWeight; type Preimages = Preimage; type InitialColdkeySwapScheduleDuration = InitialColdkeySwapScheduleDuration; diff --git a/scripts/map_consensus.py b/scripts/map_consensus.py new file mode 100644 index 0000000000..1d09207bf3 --- /dev/null +++ b/scripts/map_consensus.py @@ -0,0 +1,144 @@ +import re +import sys +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.pyplot import cm + + +def extract_data(filepath): + """ + Extracts the emission data from a text file. + + Args: + filepath: Path to the data file. + + Returns: + A list of lists containing the numerical data, or None if an error occurs. + """ + try: + with open(filepath, "r") as f: + content = f.read() + except FileNotFoundError: + print(f"Error: File not found at {filepath}") + return None + + # Regular expression to extract data rows. Matches strings like "[0.51, 1.00, 1.00, ...]" + # Explanation: + # \[ Matches the opening square bracket. + # (?: ... ) Non-capturing group. + # [0-9.]+ Matches one or more digits or decimal points. + # ,\s* Matches a comma followed by zero or more whitespace characters. + # + Matches the previous group (number and comma) one or more times. + # [0-9.]+ Matches the last number in the list. + # \] Matches the closing square bracket. + + list_pattern = ( + r"\[(?:[0-9.]+,\s*)+[0-9.]+\]" + ) # Regular expression to match data rows + matches = re.findall(list_pattern, content) + + if not matches: + print("Error: No matching data found in the file.") + return None + + data = [] + for match in matches: + try: + # Extract numerical values from the matched string. + # 1. match[1:-1]: Removes the square brackets from the beginning and end. + # 2. .split(','): Splits the string into a list of strings at each comma. + # 3. [float(x.strip()) for x in ...]: Converts each string to a float + # after removing leading/trailing whitespace. + + row = [float(x.strip()) for x in match[1:-1].split(",")] + data.append(row) + except ValueError: + print(f"Warning: Skipping invalid data row: {match}") + + return data + + +def visualize_data(emission_data, output_filename="consensus_plot.svg"): + """ + Generates and saves a contour plot of the retention map. + + Args: + emission_data: The extracted emission data. + output_filename: The name of the output SVG file. + """ + major_ratios = {} + avg_weight_devs = {} + + # Process the data to organize it by major stake + for ( + major_stake, + major_weight, + minor_weight, + avg_weight_dev, + major_ratio, + ) in emission_data: + major_stake_str = f"{major_stake:.2f}" + maj_idx, min_idx = int(round(50 * major_weight)), int(round(50 * minor_weight)) + + avg_weight_devs.setdefault(major_stake_str, np.zeros((51, 51))) + avg_weight_devs[major_stake_str][maj_idx][min_idx] = avg_weight_dev + + major_ratios.setdefault(major_stake_str, np.zeros((51, 51))) + major_ratios[major_stake_str][maj_idx][min_idx] = major_ratio + + # Create the meshgrid for the contour plot + x = np.linspace(0, 1, 51) + y = np.linspace(0, 1, 51) + x, y = np.meshgrid(x, y, indexing="ij") + + # Set up the plot + fig = plt.figure(figsize=(6, 6), dpi=70) + ax = fig.gca() + ax.set_xticks(np.arange(0, 1, 0.05)) + ax.set_yticks(np.arange(0, 1.0, 0.05)) + ax.set_xticklabels([f"{_:.2f}"[1:] for _ in np.arange(0, 1.0, 0.05)]) + plt.grid(linestyle="dotted", color=[0.85, 0.85, 0.85]) + + # Define stakes and colors for contour lines + isolate = ["0.60"] # Stakes to highlight + stakes = [0.51, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.99] + colors = cm.viridis(np.linspace(0, 1, len(stakes) + 1)) + + # Create contour lines for each stake + for i, stake in enumerate(stakes): + contours = plt.contour( + x, + y, + major_ratios[f"{stake:.2f}"], + levels=[0.0, stake], + colors=[colors[i + 1]], + ) + if f"{stake:.2f}" in isolate: + contours.collections[1].set_linewidth(3) # Highlight isolated stake + plt.clabel(contours, inline=True, fontsize=10) + + # Add title and labels + plt.title(f"Major emission [$stake_{{maj}}=emission_{{maj}}$ retention lines]") + plt.ylabel("Minor self-weight") + plt.xlabel("Major self-weight") + + # Save the plot + plt.savefig(output_filename, format="svg") + print(f"Plot saved to {output_filename}") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print( + "Usage: python scripts/map_consensus.py [optional_output_filename]" + ) + sys.exit(1) + + filepath = sys.argv[1] + output_filename = "consensus_plot.svg" # Default output filename + if len(sys.argv) >= 3: + output_filename = sys.argv[2] # Optional output filename + + extracted_data = extract_data(filepath) + if extracted_data: + visualize_data(extracted_data, output_filename)