diff --git a/Cargo.lock b/Cargo.lock index 7bcf2f6822..7d9cc6c394 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,9 +32,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aead" @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -131,36 +131,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys 0.59.0", ] @@ -190,7 +190,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -264,7 +264,7 @@ dependencies = [ "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "itertools 0.13.0", "num-bigint", "num-integer", @@ -272,6 +272,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba93ca6e75e5f589c139e5a41ebd783ebf2153de0025cd2b00da2963929c92ec" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-ed-on-bls12-381-bandersnatch" version = "0.5.0" @@ -341,7 +353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -367,7 +379,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -395,7 +407,7 @@ dependencies = [ "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -442,7 +454,7 @@ checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -504,6 +516,16 @@ version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" +[[package]] +name = "array-bytes" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d55334c98d756b32dcceb60248647ab34f027690f87f9a362fd292676ee927" +dependencies = [ + "smallvec", + "thiserror 2.0.12", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -562,7 +584,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "synstructure 0.13.2", ] @@ -574,7 +596,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "synstructure 0.13.2", ] @@ -586,7 +608,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -618,9 +640,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3" dependencies = [ "async-lock", "cfg-if", @@ -629,7 +651,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.44", + "rustix 1.0.7", "slab", "tracing", "windows-sys 0.59.0", @@ -665,7 +687,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -676,7 +698,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -716,9 +738,9 @@ dependencies = [ [[package]] name = "atomic" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" dependencies = [ "bytemuck", ] @@ -756,6 +778,7 @@ dependencies = [ "plutus", "plutus-datum-derive", "scale-info", + "schnorr_jubjub", "selection", "serde", "sidechain-domain", @@ -773,9 +796,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" @@ -824,9 +847,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.7.3" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" [[package]] name = "bech32" @@ -861,8 +884,8 @@ dependencies = [ [[package]] name = "binary-merkle-tree" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "hash-db", "log", @@ -896,7 +919,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -980,7 +1003,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" dependencies = [ "byte-tools", - "crypto-mac 0.7.0", + "crypto-mac", "digest 0.8.1", "opaque-debug 0.2.3", ] @@ -1049,9 +1072,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c79a94619fade3c0b887670333513a67ac28a6a7e653eb260bf0d4103db38d" +checksum = "4fd49896f12ac9b6dcd7a5998466b9b58263a695a3dd1ecc1aaca2e12a90b080" dependencies = [ "cc", "glob", @@ -1071,10 +1094,11 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.2.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" +checksum = "dee8eddd066a8825ec5570528e6880471210fd5d88cb6abbe1cfdd51ca249c33" dependencies = [ + "jam-codec", "log", "parity-scale-codec", "scale-info", @@ -1112,9 +1136,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "byte-slice-cast" @@ -1131,7 +1155,7 @@ dependencies = [ "serde", "serde_test", "sp-core", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -1142,9 +1166,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.23.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" [[package]] name = "byteorder" @@ -1180,18 +1204,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] [[package]] name = "cardano-serialization-lib" -version = "14.1.1" +version = "14.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "259122c48b54ab1057c2cc65216171c5b3e3639df22f5ef07186ed7e131a373c" +checksum = "70a894086cb078655b52a9478ae50e1f7b11f3a16fb02e2f11fe63b63644462c" dependencies = [ "bech32 0.7.3", "cbor_event", @@ -1252,9 +1276,9 @@ checksum = "089a0261d1bc59e54e8e11860031efd88593f0e61b921172c474f1f38c2f2d3c" [[package]] name = "cc" -version = "1.2.22" +version = "1.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" dependencies = [ "jobserver", "libc", @@ -1287,9 +1311,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -1409,9 +1433,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.38" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -1419,9 +1443,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.38" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -1432,21 +1456,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "clear_on_drop" @@ -1503,14 +1527,14 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ "serde", "termcolor", - "unicode-width 0.2.0", + "unicode-width 0.2.1", ] [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "colored" @@ -1555,15 +1579,15 @@ dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.0", + "unicode-width 0.2.1", "windows-sys 0.59.0", ] [[package]] name = "const-hex" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" dependencies = [ "cfg-if", "cpufeatures", @@ -1642,9 +1666,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", @@ -1805,6 +1829,21 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -1849,7 +1888,7 @@ dependencies = [ "crossterm_winapi", "libc", "mio 0.8.11", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "signal-hook", "signal-hook-mio", "winapi", @@ -1866,9 +1905,9 @@ dependencies = [ [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" @@ -1903,16 +1942,6 @@ dependencies = [ "subtle 1.0.0", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.6.1", -] - [[package]] name = "cryptoxide" version = "0.4.4" @@ -1968,14 +1997,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "cxx" -version = "1.0.158" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741" +checksum = "be1149bab7a5580cb267215751389597c021bfad13c0bb00c54e19559333764c" dependencies = [ "cc", "cxxbridge-cmd", @@ -1987,47 +2016,50 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.158" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7" +checksum = "6aeeaf1aefae8e0f5141920a7ecbc64a22ab038d4b4ac59f2d19e0effafd5b53" dependencies = [ "cc", "codespan-reporting", + "indexmap 2.10.0", "proc-macro2", "quote", "scratch", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "cxxbridge-cmd" -version = "1.0.158" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279" +checksum = "c36ac1f9a72064b1f41fd7b49a4c1b3bf33b9ccb1274874dda6d264f57c55964" dependencies = [ "clap", "codespan-reporting", + "indexmap 2.10.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "cxxbridge-flags" -version = "1.0.158" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4" +checksum = "170c6ff5d009663866857a91ebee55b98ea4d4b34e7d7aba6dc4a4c95cc7b748" [[package]] name = "cxxbridge-macro" -version = "1.0.158" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8" +checksum = "4984a142211026786011a7e79fa22faa1eca1e9cbf0e60bffecfd57fd3db88f1" dependencies = [ + "indexmap 2.10.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2075,7 +2107,7 @@ dependencies = [ "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.10", + "parking_lot_core 0.9.11", ] [[package]] @@ -2101,7 +2133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" dependencies = [ "data-encoding", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2181,7 +2213,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2192,18 +2224,18 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "derive-where" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73f2692d4bd3cac41dca28934a39894200c9fabf49586d77d0e5954af1d7902" +checksum = "510c292c8cf384b1a340b816a9a6cf2599eb8f566a44949024af88418000c50b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2216,7 +2248,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2245,7 +2277,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2256,7 +2288,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2366,7 +2398,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2396,9 +2428,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.101", + "syn 2.0.104", "termcolor", - "toml 0.8.22", + "toml 0.8.23", "walkdir", ] @@ -2435,27 +2467,6 @@ version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" -[[package]] -name = "dyn-clonable" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "dyn-clone" version = "1.0.19" @@ -2537,7 +2548,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2584,7 +2595,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2604,7 +2615,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2676,12 +2687,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -2743,7 +2754,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -2797,7 +2808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" dependencies = [ "atomic", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pear", "serde", "tempfile", @@ -2849,7 +2860,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "scale-info", ] @@ -2896,8 +2907,8 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "12.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", ] @@ -2940,8 +2951,8 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" -version = "40.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support", "frame-support-procedural", @@ -2964,8 +2975,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "aquamarine", "frame-support", @@ -2982,9 +2993,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "20.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2994,10 +3005,10 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" -version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.1.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "const-hex", "docify", "frame-support", @@ -3010,11 +3021,11 @@ dependencies = [ [[package]] name = "frame-support" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "aquamarine", - "array-bytes", + "array-bytes 6.2.3", "binary-merkle-tree", "bitflags 1.3.2", "docify", @@ -3051,8 +3062,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "33.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "23.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "Inflector", "cfg-expr", @@ -3066,35 +3077,35 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "frame-support-procedural-tools" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "10.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "11.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "frame-system" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "cfg-if", "docify", @@ -3112,8 +3123,8 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3126,8 +3137,8 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "parity-scale-codec", @@ -3136,8 +3147,8 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support", "parity-scale-codec", @@ -3237,7 +3248,7 @@ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.12.3", + "parking_lot 0.12.4", ] [[package]] @@ -3264,7 +3275,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -3332,6 +3343,20 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generator" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18470a76cb7f8ff746cf1f7470914f900252ec36bbc40b569d74b1258446827" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.61.3", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -3361,7 +3386,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -3436,7 +3461,7 @@ dependencies = [ "futures-timer", "no-std-compat", "nonzero_ext", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "portable-atomic", "quanta", "rand 0.8.5", @@ -3467,7 +3492,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.9.0", + "indexmap 2.10.0", "slab", "tokio", "tokio-util", @@ -3476,9 +3501,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +checksum = "17da50a276f1e01e0ba6c029e47b7100754904ee8a278f886546e98575380785" dependencies = [ "atomic-waker", "bytes", @@ -3486,7 +3511,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.9.0", + "indexmap 2.10.0", "slab", "tokio", "tokio-util", @@ -3551,9 +3576,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "allocator-api2", "equivalent", @@ -3584,7 +3609,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -3607,15 +3632,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "hermit-abi" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -3675,6 +3694,31 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.9.1", + "ring 0.17.14", + "thiserror 2.0.12", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-resolver" version = "0.24.4" @@ -3683,11 +3727,11 @@ checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.24.4", "ipconfig", "lru-cache", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "resolv-conf", "smallvec", @@ -3697,22 +3741,33 @@ dependencies = [ ] [[package]] -name = "hkdf" -version = "0.12.4" +name = "hickory-resolver" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" dependencies = [ - "hmac 0.12.1", + "cfg-if", + "futures-util", + "hickory-proto 0.25.2", + "ipconfig", + "moka", + "once_cell", + "parking_lot 0.12.4", + "rand 0.9.1", + "resolv-conf", + "smallvec", + "thiserror 2.0.12", + "tokio", + "tracing", ] [[package]] -name = "hmac" -version = "0.8.1" +name = "hkdf" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", + "hmac", ] [[package]] @@ -3724,17 +3779,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.7", - "hmac 0.8.1", -] - [[package]] name = "home" version = "0.5.11" @@ -3851,7 +3895,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.10", + "h2 0.4.11", "http 1.3.1", "http-body 1.0.1", "httparse", @@ -3865,11 +3909,10 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http 1.3.1", "hyper 1.6.0", "hyper-util", @@ -3883,12 +3926,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.11" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", "http 1.3.1", "http-body 1.0.1", @@ -3913,7 +3957,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.0", + "windows-core 0.61.2", ] [[package]] @@ -3974,9 +4018,9 @@ checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2549ca8c7241c82f59c80ba2a6f415d931c5b58d24fb8412caa1a1f02c49139a" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", @@ -3990,9 +4034,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8197e866e47b68f8f7d95249e172903bec06004b18b2937f1095d40a0c57de04" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" @@ -4068,7 +4112,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.53.0", ] [[package]] @@ -4127,7 +4171,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -4162,12 +4206,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -4231,6 +4275,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "io-uring" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "libc", +] + [[package]] name = "ip_network" version = "0.4.1" @@ -4261,7 +4316,7 @@ version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.5.1", + "hermit-abi 0.5.2", "libc", "windows-sys 0.59.0", ] @@ -4323,11 +4378,39 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jam-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d72f2fb8cfd27f6c52ea7d0528df594f7f2ed006feac153e9393ec567aafea98" +dependencies = [ + "arrayvec 0.7.6", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "jam-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "jam-codec-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09985146f40378e13af626964ac9c206d9d9b67c40c70805898d9954f709bcf5" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "jiff" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02000660d30638906021176af16b17498bd0d12813dbfe7b276d8bc7f3c0806" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" dependencies = [ "jiff-static", "log", @@ -4338,13 +4421,13 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c30758ddd7188629c6713fc45d1188af4f44c90582311d0c8d8c9907f60c48" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -4441,7 +4524,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "jsonrpsee-types", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "rand 0.8.5", "rustc-hash 2.1.1", @@ -4488,7 +4571,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -4589,7 +4672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.3", + "parking_lot 0.12.4", ] [[package]] @@ -4600,7 +4683,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "regex", "rocksdb", "smallvec", @@ -4623,18 +4706,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libloading" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.0", + "windows-targets 0.53.2", ] [[package]] @@ -4717,7 +4800,7 @@ dependencies = [ "multihash 0.19.3", "multistream-select", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -4738,10 +4821,10 @@ checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", - "hickory-resolver", + "hickory-resolver 0.24.4", "libp2p-core", "libp2p-identity", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "smallvec", "tracing", ] @@ -4771,9 +4854,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb68ea10844211a59ce46230909fd0ea040e8a192454d4cc2ee0d53e12280eb" +checksum = "3104e13b51e4711ff5738caa1fb54467c8604c2e94d607e27745bcf709068774" dependencies = [ "bs58", "ed25519-dalek", @@ -4824,7 +4907,7 @@ checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", - "hickory-proto", + "hickory-proto 0.24.4", "if-watch", "libp2p-core", "libp2p-identity", @@ -4912,7 +4995,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "quinn", "rand 0.8.5", "ring 0.17.14", @@ -4976,7 +5059,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5042,7 +5125,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project-lite", "rw-stream-sink", "soketto", @@ -5069,13 +5152,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" dependencies = [ "bitflags 2.9.1", "libc", - "redox_syscall 0.5.12", + "redox_syscall 0.5.13", ] [[package]] @@ -5102,14 +5185,12 @@ dependencies = [ "arrayref", "base64 0.22.1", "digest 0.9.0", - "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum", ] [[package]] @@ -5233,9 +5314,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "litep2p" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71056c23c896bb0e18113b2d2f1989be95135e6bdeedb0b757422ee21a073eb" +checksum = "14fb10e63363204b89d91e1292df83322fd9de5d7fa76c3d5c78ddc2f8f3efa9" dependencies = [ "async-trait", "bs58", @@ -5244,14 +5325,14 @@ dependencies = [ "ed25519-dalek", "futures", "futures-timer", - "hickory-resolver", - "indexmap 2.9.0", + "hickory-resolver 0.25.2", + "indexmap 2.10.0", "libc", "mockall", "multiaddr 0.17.1", "multihash 0.17.0", "network-interface", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "prost 0.13.5", "prost-build", @@ -5280,9 +5361,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -5319,7 +5400,7 @@ dependencies = [ "log", "log-mdc", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "serde", "serde-value", @@ -5331,13 +5412,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -5346,7 +5440,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f8cc7106155f10bdf99a6f379688f543ad6596a415375b36a59a054ceda1198" dependencies = [ - "hashbrown 0.15.3", + "hashbrown 0.15.4", ] [[package]] @@ -5395,7 +5489,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5409,7 +5503,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5420,7 +5514,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5431,7 +5525,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5465,9 +5559,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memfd" @@ -5507,20 +5601,21 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +checksum = "c6da20dba965bd218a14c3b335b90d3e07c09ede190c7c19b50deb23d418a322" dependencies = [ "hash-db", + "hashbrown 0.15.4", ] [[package]] name = "merkleized-metadata" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9b7ac0ce054412d9a85ff39bac27aec27483b06cef8756b57d9c29d448d081" +checksum = "b3e3e3f549d27d2dc054372f320ddf68045a833fab490563ff70d4cf1b9d91ea" dependencies = [ - "array-bytes", + "array-bytes 9.3.0", "blake3", "frame-metadata", "parity-scale-codec", @@ -5560,7 +5655,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5581,7 +5676,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -5592,9 +5687,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] @@ -5607,19 +5702,19 @@ checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.48.0", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -5638,7 +5733,7 @@ dependencies = [ "hashlink 0.8.4", "lioness", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "rand_chacha 0.3.1", "rand_distr", @@ -5670,7 +5765,26 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", +] + +[[package]] +name = "moka" +version = "0.12.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "loom", + "parking_lot 0.12.4", + "portable-atomic", + "rustc_version", + "smallvec", + "tagptr", + "thiserror 1.0.69", + "uuid", ] [[package]] @@ -5943,6 +6057,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -6019,7 +6142,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -6076,11 +6199,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.5.2", "libc", ] @@ -6146,6 +6269,16 @@ name = "once_cell" version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "opaque-debug" @@ -6188,9 +6321,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallas-addresses" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bd039d7f1618d12ff348dd03eebe38c5d2a010325750e5341526c419b0f8e0" +checksum = "45a7e0425ec22afe8e80c9f9dfb086cbad569fd2ba3e51d6ab8caa20423b7488" dependencies = [ "base58", "bech32 0.9.1", @@ -6204,9 +6337,9 @@ dependencies = [ [[package]] name = "pallas-codec" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1584d615857c0a44058fb612e892e9e0cc47b56c3c82cdf7347b5c1d1193598c" +checksum = "e344b3e39ca3bd79bb7547b65b980869c3c377a00c48ece70430f4611c32a18b" dependencies = [ "hex", "minicbor", @@ -6217,9 +6350,9 @@ dependencies = [ [[package]] name = "pallas-crypto" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c1d642326ce402eb9191aeacc3dd0bf2b499848e97a56396c978a6eb9dd31a" +checksum = "59c89ea16190a87a1d8bd36923093740a2b659ed6129f4636329319a70cc4db3" dependencies = [ "cryptoxide", "hex", @@ -6232,9 +6365,9 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d30f5053073554d016a9f009c077f9a84275951a611cce54230de6c54d34d9b" +checksum = "1912f4f4a0719e36ac061f7f3557b687e8ef7285b573608fb5c71eba64c1b04c" dependencies = [ "base58", "bech32 0.9.1", @@ -6248,9 +6381,9 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d2572d316883fe866ae648bc3c5357e70cbbe8de5d78b1246f6109520fa52f" +checksum = "be7fbb1db75a0b6b32d1808b2cc5c7ba6dd261f289491bb86998b987b4716883" dependencies = [ "hex", "itertools 0.13.0", @@ -6284,8 +6417,8 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support", "frame-system", @@ -6300,8 +6433,8 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support", "frame-system", @@ -6313,8 +6446,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6336,8 +6469,8 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "frame-benchmarking", @@ -6350,6 +6483,50 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-beefy" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-consensus-beefy", + "sp-runtime", + "sp-session", + "sp-staking", +] + +[[package]] +name = "pallet-beefy-mmr" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "array-bytes 6.2.3", + "binary-merkle-tree", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-beefy", + "pallet-mmr", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-consensus-beefy", + "sp-core", + "sp-io", + "sp-runtime", + "sp-state-machine", +] + [[package]] name = "pallet-block-participation" version = "1.7.0" @@ -6478,8 +6655,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6498,6 +6675,18 @@ dependencies = [ "sp-staking", ] +[[package]] +name = "pallet-mmr" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", + "sp-mmr-primitives", +] + [[package]] name = "pallet-native-token-management" version = "1.7.0" @@ -6533,13 +6722,14 @@ dependencies = [ [[package]] name = "pallet-session" -version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "log", + "pallet-balances", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -6652,8 +6842,8 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "frame-benchmarking", @@ -6667,8 +6857,8 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "frame-benchmarking", @@ -6678,7 +6868,6 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", "sp-runtime", "sp-storage", "sp-timestamp", @@ -6686,8 +6875,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6695,15 +6884,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-io", "sp-runtime", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "30.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6718,8 +6906,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6728,6 +6916,21 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "pallet-utility" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "parity-bip39" version = "2.0.1" @@ -6755,7 +6958,7 @@ dependencies = [ "log", "lz4", "memmap2 0.5.10", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "siphasher", "snap", @@ -6764,9 +6967,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.7.4" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ "arrayvec 0.7.6", "bitvec", @@ -6781,14 +6984,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.7.4" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -6816,12 +7019,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", + "parking_lot_core 0.9.11", ] [[package]] @@ -6840,13 +7043,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.12", + "redox_syscall 0.5.13", "smallvec", "windows-targets 0.52.6", ] @@ -6908,6 +7111,7 @@ dependencies = [ "plutus", "plutus-datum-derive", "pretty_assertions", + "schnorr_jubjub", "secp256k1 0.30.0", "serde", "serde_json", @@ -7010,9 +7214,12 @@ dependencies = [ "sc-client-db", "sc-consensus", "sc-consensus-aura", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-executor", + "sc-keystore", "sc-network", "sc-partner-chains-consensus-aura", "sc-rpc", @@ -7021,6 +7228,7 @@ dependencies = [ "sc-telemetry", "sc-transaction-pool", "sc-transaction-pool-api", + "schnorr_jubjub", "serde", "serde_json", "sidechain-domain", @@ -7035,6 +7243,7 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-consensus-beefy", "sp-consensus-grandpa", "sp-core", "sp-governed-map", @@ -7076,12 +7285,15 @@ dependencies = [ "pallet-address-associations", "pallet-aura", "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", "pallet-block-participation", "pallet-block-producer-fees", "pallet-block-producer-metadata", "pallet-block-production-log", "pallet-governed-map", "pallet-grandpa", + "pallet-mmr", "pallet-native-token-management", "pallet-partner-chains-session", "pallet-session", @@ -7096,6 +7308,7 @@ dependencies = [ "plutus", "pretty_assertions", "scale-info", + "schnorr_jubjub", "serde", "serde_json", "sidechain-domain", @@ -7107,6 +7320,7 @@ dependencies = [ "sp-block-producer-metadata", "sp-block-production-log", "sp-consensus-aura", + "sp-consensus-beefy", "sp-consensus-grandpa", "sp-consensus-slots", "sp-core", @@ -7141,6 +7355,7 @@ dependencies = [ "log", "pallet-sidechain-rpc", "rand 0.9.1", + "schnorr_jubjub", "serde", "serde_json", "sidechain-domain", @@ -7188,6 +7403,7 @@ dependencies = [ "log", "pretty_assertions", "raw-scripts", + "schnorr_jubjub", "serde_json", "sidechain-domain", "thiserror 2.0.12", @@ -7256,7 +7472,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7324,7 +7540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.9.0", + "indexmap 2.10.0", ] [[package]] @@ -7344,7 +7560,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7401,14 +7617,59 @@ name = "plutus-datum-derive" version = "1.7.0" dependencies = [ "quote", - "syn 2.0.101", + "syn 2.0.104", +] + +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221c71b432b38e494a0fdedb5f720e4cb974edf03a0af09e5b2238dbac7e6947" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + +[[package]] +name = "polkadot-sdk-frame" +version = "0.1.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-grandpa", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-transaction-pool", + "sp-version", ] [[package]] name = "polkavm" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd044ab1d3b11567ab6b98ca71259a992b4034220d5972988a0e96518e5d343d" +checksum = "643c98b9cb27449cffe54c2b500fe8d55d7aa7f29acdd90c56e5cd196fe3d728" dependencies = [ "libc", "log", @@ -7419,18 +7680,18 @@ dependencies = [ [[package]] name = "polkavm-assembler" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaad38dc420bfed79e6f731471c973ce5ff5e47ab403e63cf40358fef8a6368f" +checksum = "51fcf86a40f3d2191cc2b65357e774eda67875cbc31843f505a69b70f8679922" dependencies = [ "log", ] [[package]] name = "polkavm-common" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" +checksum = "28732f89f1e730d908fd816db50ee2afcb8368345ded9f9bc78fbd710db7a4be" dependencies = [ "log", "polkavm-assembler", @@ -7438,40 +7699,40 @@ dependencies = [ [[package]] name = "polkavm-derive" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +checksum = "b5de33a198ef311b3ceb8de476515fbb92b4d2ed56feb23499b0875d0e6a8ce6" dependencies = [ "polkavm-derive-impl-macro", ] [[package]] name = "polkavm-derive-impl" -version = "0.18.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" +checksum = "dff180bfd5add755ae54197babc79cd6efc3c3d01a5ded643b1ab37a9932deb2" dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "polkavm-derive-impl-macro" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +checksum = "0105f050c7bce74fa4327a3e8e5c8a6368e39a7c93c5e8e99b33df90c097c859" dependencies = [ "polkavm-derive-impl", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "polkavm-linker" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bfe793b094d9ea5c99b7c43ba46e277b0f8f48f4bbfdbabf8d3ebf701a4bd3" +checksum = "5985c1abf240511baab6424a295b64d61e530dd50069588d1486ef24665f8f34" dependencies = [ "dirs", "gimli 0.31.1", @@ -7485,21 +7746,21 @@ dependencies = [ [[package]] name = "polkavm-linux-raw" -version = "0.18.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23eff02c070c70f31878a3d915e88a914ecf3e153741e2fb572dde28cce20fde" +checksum = "30993b46019e02b9d3de07e09d84f5b4474244ec966028fa95a38547076ffd93" [[package]] name = "polling" -version = "3.7.4" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi 0.5.2", "pin-project-lite", - "rustix 0.38.44", + "rustix 1.0.7", "tracing", "windows-sys 0.59.0", ] @@ -7529,9 +7790,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" @@ -7617,12 +7878,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.32" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" dependencies = [ "proc-macro2", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7690,7 +7951,7 @@ checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7710,7 +7971,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "version_check", "yansi", ] @@ -7725,7 +7986,7 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "thiserror 1.0.69", ] @@ -7737,7 +7998,7 @@ checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "prometheus-client-derive-encode", ] @@ -7749,22 +8010,22 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "proptest" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" dependencies = [ "bit-set", "bit-vec", "bitflags 2.9.1", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand 0.9.1", + "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax 0.8.5", "rusty-fork", @@ -7808,7 +8069,7 @@ dependencies = [ "prost 0.13.5", "prost-types", "regex", - "syn 2.0.101", + "syn 2.0.104", "tempfile", ] @@ -7822,7 +8083,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7835,7 +8096,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7858,15 +8119,15 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" dependencies = [ "crossbeam-utils", "libc", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -7918,7 +8179,7 @@ checksum = "f71ee38b42f8459a88d3362be6f9b841ad2d5421844f61eb1c59c11bff3ac14a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -7962,9 +8223,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4e529991f949c5e25755532370b8af5d114acae52326361d68d47af64aa842" +checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ "cfg_aliases 0.2.1", "libc", @@ -7985,9 +8246,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "radium" @@ -8105,11 +8366,11 @@ dependencies = [ [[package]] name = "rand_xorshift" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "rand_core 0.6.4", + "rand_core 0.9.3", ] [[package]] @@ -8187,9 +8448,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags 2.9.1", ] @@ -8222,7 +8483,7 @@ checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -8306,7 +8567,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac 0.12.1", + "hmac", "subtle 2.6.1", ] @@ -8416,9 +8677,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -8498,9 +8759,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.27" +version = "0.23.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" dependencies = [ "log", "once_cell", @@ -8539,7 +8800,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" dependencies = [ - "core-foundation 0.10.0", + "core-foundation 0.10.1", "core-foundation-sys", "jni", "log", @@ -8583,9 +8844,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "rusty-fork" @@ -8636,8 +8897,8 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "23.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "log", "sp-core", @@ -8647,8 +8908,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "futures", "log", @@ -8668,8 +8929,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "sp-api", @@ -8683,10 +8944,10 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "docify", "memmap2 0.9.5", "parity-scale-codec", @@ -8709,21 +8970,21 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "11.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sc-cli" -version = "0.51.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.36.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "chrono", "clap", "fdlimit", @@ -8762,14 +9023,14 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "fnv", "futures", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -8788,8 +9049,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.35.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "hash-db", "kvdb", @@ -8799,7 +9060,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-client-api", "sc-state-db", "schnellru", @@ -8810,18 +9071,20 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-trie", + "substrate-prometheus-endpoint", + "sysinfo", ] [[package]] name = "sc-consensus" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", "log", "mockall", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-client-api", "sc-network-types", "sc-utils", @@ -8837,8 +9100,8 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", @@ -8864,13 +9127,67 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sc-consensus-beefy" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "array-bytes 6.2.3", + "async-channel", + "async-trait", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.4", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", + "sc-network-types", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.4", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-application-crypto", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sc-consensus-grandpa" -version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.19.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "ahash", - "array-bytes", + "array-bytes 6.2.3", "async-trait", "dyn-clone", "finality-grandpa", @@ -8879,7 +9196,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "sc-block-builder", "sc-chain-spec", @@ -8910,8 +9227,8 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.34.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.19.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "finality-grandpa", "futures", @@ -8930,8 +9247,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", @@ -8953,11 +9270,11 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.32.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", @@ -8976,8 +9293,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.29.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "polkavm", "sc-allocator", @@ -8989,8 +9306,8 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" -version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.29.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "log", "polkavm", @@ -9000,12 +9317,12 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.29.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "anyhow", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rustix 0.36.17", "sc-allocator", "sc-executor-common", @@ -9016,8 +9333,8 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "console", "futures", @@ -9032,11 +9349,11 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "25.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", - "parking_lot 0.12.3", + "array-bytes 6.2.3", + "parking_lot 0.12.4", "serde_json", "sp-application-crypto", "sp-core", @@ -9046,10 +9363,10 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.4.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "arrayvec 0.7.6", "blake2 0.10.6", "bytes", @@ -9058,7 +9375,7 @@ dependencies = [ "log", "mixnet", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-client-api", "sc-network", "sc-network-types", @@ -9074,10 +9391,10 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.49.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "async-channel", "async-trait", "asynchronous-codec 0.6.2", @@ -9094,7 +9411,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "partial_sort", "pin-project", "prost 0.12.6", @@ -9124,8 +9441,8 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -9134,8 +9451,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "ahash", "futures", @@ -9153,10 +9470,10 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "async-channel", "futures", "log", @@ -9174,10 +9491,10 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "async-channel", "async-trait", "fork-tree", @@ -9210,7 +9527,7 @@ dependencies = [ [[package]] name = "sc-network-test" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-channel", "async-trait", @@ -9218,7 +9535,7 @@ dependencies = [ "futures-timer", "libp2p", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "sc-block-builder", "sc-client-api", @@ -9242,10 +9559,10 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "futures", "log", "parity-scale-codec", @@ -9261,8 +9578,8 @@ dependencies = [ [[package]] name = "sc-network-types" -version = "0.15.3" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.10.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "bs58", "bytes", @@ -9286,7 +9603,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -9319,8 +9636,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.20.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.17.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9328,14 +9645,14 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "44.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "29.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "futures", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -9360,8 +9677,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.33.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9380,8 +9697,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "11.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -9404,10 +9721,10 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.49.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "futures", "futures-util", "hex", @@ -9415,7 +9732,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "sc-chain-spec", "sc-client-api", @@ -9429,6 +9746,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", + "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", "tokio-stream", @@ -9436,8 +9754,8 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.35.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "directories", @@ -9447,7 +9765,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "rand 0.8.5", "sc-chain-spec", @@ -9500,19 +9818,19 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.38.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.30.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sp-core", ] [[package]] name = "sc-sysinfo" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "derive_more 0.99.20", "futures", @@ -9531,14 +9849,14 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "28.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "15.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "chrono", "futures", "libp2p", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "rand 0.8.5", "sc-utils", @@ -9550,8 +9868,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "chrono", "console", @@ -9559,7 +9877,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rustc-hash 1.1.0", "sc-client-api", "sc-tracing-proc-macro", @@ -9578,29 +9896,28 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "11.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "11.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sc-transaction-pool" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", "futures-timer", - "indexmap 2.9.0", + "indexmap 2.10.0", "itertools 0.11.0", "linked-hash-map", - "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -9621,12 +9938,12 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", - "indexmap 2.9.0", + "indexmap 2.10.0", "log", "parity-scale-codec", "serde", @@ -9638,23 +9955,23 @@ dependencies = [ [[package]] name = "sc-utils" -version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "14.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-channel", "futures", "futures-timer", "log", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "prometheus", "sp-arithmetic", ] [[package]] name = "scale-bits" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" dependencies = [ "parity-scale-codec", "scale-type-resolver", @@ -9662,15 +9979,15 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.13.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" +checksum = "4d78196772d25b90a98046794ce0fe2588b39ebdfbdc1e45b4c6c85dd43bebad" dependencies = [ - "derive_more 0.99.20", "parity-scale-codec", "scale-bits", "scale-type-resolver", "smallvec", + "thiserror 2.0.12", ] [[package]] @@ -9696,7 +10013,7 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -9735,7 +10052,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -9749,6 +10066,39 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "schnorr_jubjub" +version = "1.7.0" +dependencies = [ + "ark-ec 0.5.0", + "ark-ed-on-bls12-381", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "frame-support", + "hash256-std-hasher", + "hex", + "num-bigint", + "pallet-beefy-mmr", + "parity-scale-codec", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sc-keystore", + "scale-info", + "serde", + "sha2 0.10.9", + "sp-application-crypto", + "sp-consensus-beefy", + "sp-core", + "sp-crypto-hashing", + "sp-externalities", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-runtime-interface", + "sp-trie", +] + [[package]] name = "schnorrkel" version = "0.11.4" @@ -9768,6 +10118,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -9801,7 +10157,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4124a35fe33ae14259c490fd70fa199a32b9ce9502f2ee6bc4f81ec06fa65894" dependencies = [ - "secp256k1-sys 0.8.1", + "secp256k1-sys 0.8.2", ] [[package]] @@ -9826,9 +10182,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "4473013577ec77b4ee3668179ef1186df3146e2cf2d927bd200974c6fe60fd99" dependencies = [ "cc", ] @@ -9867,7 +10223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags 2.9.1", - "core-foundation 0.10.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -9964,7 +10320,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -9975,7 +10331,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -9992,9 +10348,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -10048,7 +10404,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "itoa", "ryu", "serde", @@ -10166,6 +10522,7 @@ dependencies = [ "plutus", "plutus-datum-derive", "scale-info", + "schnorr_jubjub", "secp256k1 0.30.0", "serde", "serde_json", @@ -10288,12 +10645,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "slice-group-by" @@ -10303,9 +10657,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] @@ -10335,9 +10689,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -10361,8 +10715,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "hash-db", @@ -10383,8 +10737,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "15.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "Inflector", "blake2 0.10.6", @@ -10392,13 +10746,13 @@ dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sp-application-crypto" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "30.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10409,8 +10763,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "26.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "23.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "integer-sqrt", @@ -10423,8 +10777,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "sp-api", "sp-inherents", @@ -10486,12 +10840,12 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "futures", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "schnellru", "sp-api", "sp-consensus", @@ -10505,8 +10859,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.32.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "futures", @@ -10519,8 +10873,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.32.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "parity-scale-codec", @@ -10535,8 +10889,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.32.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "parity-scale-codec", @@ -10551,10 +10905,30 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-crypto-hashing", + "sp-io", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "sp-weights", + "strum 0.26.3", +] + [[package]] name = "sp-consensus-grandpa" -version = "23.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "finality-grandpa", "log", @@ -10570,8 +10944,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.42.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.32.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10581,16 +10955,16 @@ dependencies = [ [[package]] name = "sp-core" -version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "ark-vrf", - "array-bytes", + "array-bytes 6.2.3", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", "bs58", - "dyn-clonable", + "dyn-clone", "ed25519-zebra", "futures", "hash-db", @@ -10603,7 +10977,7 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "paste", "primitive-types", "rand 0.8.5", @@ -10612,6 +10986,7 @@ dependencies = [ "secp256k1 0.28.2", "secrecy", "serde", + "sha2 0.10.9", "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", @@ -10629,7 +11004,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "blake2b_simd", "byteorder", @@ -10642,36 +11017,36 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "kvdb", - "parking_lot 0.12.3", + "parking_lot 0.12.4", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sp-externalities" -version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.25.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "environmental", "parity-scale-codec", @@ -10680,8 +11055,8 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.8.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10710,8 +11085,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10723,8 +11098,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "30.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "bytes", "docify", @@ -10749,8 +11124,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "31.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "sp-core", "sp-runtime", @@ -10759,11 +11134,11 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.34.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "sp-core", "sp-externalities", ] @@ -10771,7 +11146,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -10779,8 +11154,8 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.6.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -10789,8 +11164,8 @@ dependencies = [ [[package]] name = "sp-mixnet" -version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.4.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10798,6 +11173,23 @@ dependencies = [ "sp-application-crypto", ] +[[package]] +name = "sp-mmr-primitives" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sp-native-token-management" version = "1.7.0" @@ -10819,8 +11211,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "sp-api", "sp-core", @@ -10829,8 +11221,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "13.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "backtrace", "regex", @@ -10850,8 +11242,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -10860,8 +11252,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "41.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "31.0.1" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "binary-merkle-tree", "docify", @@ -10889,8 +11281,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "29.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "24.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10908,21 +11300,21 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "17.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "Inflector", "expander", "proc-macro-crate 3.3.0", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sp-session" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10994,8 +11386,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11007,13 +11399,13 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.35.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "smallvec", "sp-core", @@ -11027,8 +11419,8 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "20.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "10.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -11052,12 +11444,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" [[package]] name = "sp-storage" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "19.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11068,8 +11460,8 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "parity-scale-codec", @@ -11080,8 +11472,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "16.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "tracing", @@ -11091,8 +11483,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "sp-api", "sp-runtime", @@ -11100,8 +11492,8 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "36.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "26.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "async-trait", "parity-scale-codec", @@ -11114,20 +11506,21 @@ dependencies = [ [[package]] name = "sp-trie" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "29.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "ahash", "hash-db", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "rand 0.8.5", "scale-info", "schnellru", "sp-core", "sp-externalities", + "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing", "trie-db", @@ -11136,8 +11529,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "29.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11153,20 +11546,20 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "13.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "parity-scale-codec", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sp-wasm-interface" -version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "20.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -11177,8 +11570,8 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "27.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -11225,9 +11618,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c3a85280daca669cfd3bcb68a337882a8bc57ec882f72c5d13a430613a738e" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" dependencies = [ "sqlx-core", "sqlx-macros", @@ -11238,9 +11631,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f743f2a3cea30a58cd479013f75550e879009e3a02f616f18ca699335aa248c3" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" dependencies = [ "base64 0.22.1", "bigdecimal", @@ -11254,9 +11647,9 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.15.3", + "hashbrown 0.15.4", "hashlink 0.10.0", - "indexmap 2.9.0", + "indexmap 2.10.0", "log", "memchr", "once_cell", @@ -11276,22 +11669,22 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4200e0fde19834956d4252347c12a083bdcb237d7a1a1446bffd8768417dce" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "sqlx-macros-core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882ceaa29cade31beca7129b6beeb05737f44f82dbe2a9806ecea5a7093d00b7" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" dependencies = [ "dotenvy", "either", @@ -11307,17 +11700,16 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.101", - "tempfile", + "syn 2.0.104", "tokio", "url", ] [[package]] name = "sqlx-mysql" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0afdd3aa7a629683c2d750c2df343025545087081ab5942593a5288855b1b7a7" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", @@ -11337,7 +11729,7 @@ dependencies = [ "generic-array 0.14.7", "hex", "hkdf", - "hmac 0.12.1", + "hmac", "itoa", "log", "md-5", @@ -11359,9 +11751,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bedbe1bbb5e2615ef347a5e9d8cd7680fb63e77d9dafc0f29be15e53f1ebe6" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", @@ -11377,7 +11769,7 @@ dependencies = [ "futures-util", "hex", "hkdf", - "hmac 0.12.1", + "hmac", "home", "itoa", "log", @@ -11399,9 +11791,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26083e9a520e8eb87a06b12347679b142dc2ea29e6e409f805644a7a979a5bc" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" dependencies = [ "atoi", "chrono", @@ -11451,15 +11843,15 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "static_init" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +checksum = "8bae1df58c5fea7502e8e352ec26b5579f6178e1fdb311e088580c980dee25ed" dependencies = [ "bitflags 1.3.2", - "cfg_aliases 0.1.1", + "cfg_aliases 0.2.1", "libc", - "parking_lot 0.11.2", - "parking_lot_core 0.8.6", + "parking_lot 0.12.4", + "parking_lot_core 0.9.11", "static_init_macro", "winapi", ] @@ -11538,15 +11930,15 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "substrate-bip39" -version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.4.7" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "hmac 0.12.1", + "hmac", "pbkdf2", "schnorrkel", "sha2 0.10.9", @@ -11556,12 +11948,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" [[package]] name = "substrate-frame-rpc-system" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "28.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -11580,8 +11972,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.17.2" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "0.17.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -11595,9 +11987,9 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "async-trait", "futures", "parity-scale-codec", @@ -11620,9 +12012,9 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "frame-executive", "frame-metadata-hash-extension", "frame-support", @@ -11632,6 +12024,7 @@ dependencies = [ "pallet-babe", "pallet-balances", "pallet-timestamp", + "pallet-utility", "parity-scale-codec", "sc-service", "scale-info", @@ -11644,6 +12037,7 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-crypto-hashing", + "sp-debug-derive", "sp-externalities", "sp-genesis-builder", "sp-inherents", @@ -11664,7 +12058,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ "futures", "sc-block-builder", @@ -11681,10 +12075,10 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "26.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-5#f4dba53bfac614b054735aa725d2b0c44efda414" +version = "17.0.0" +source = "git+https://github.com/input-output-hk/polkadot-sdk.git?branch=beefy_all_features_branch#bd8b97876879d8f9f36ca96bbb974cc4e79b27f9" dependencies = [ - "array-bytes", + "array-bytes 6.2.3", "build-helper", "cargo_metadata", "console", @@ -11704,7 +12098,7 @@ dependencies = [ "sp-version", "strum 0.26.3", "tempfile", - "toml 0.8.22", + "toml 0.8.23", "walkdir", "wasm-opt", ] @@ -11734,9 +12128,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.101" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -11763,7 +12157,22 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", +] + +[[package]] +name = "sysinfo" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "windows 0.52.0", ] [[package]] @@ -11787,6 +12196,12 @@ dependencies = [ "libc", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -11846,7 +12261,7 @@ dependencies = [ "bollard-stubs", "futures", "hex", - "hmac 0.12.1", + "hmac", "log", "rand 0.8.5", "serde", @@ -11889,7 +12304,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -11900,7 +12315,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -11915,12 +12330,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -12013,17 +12427,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.45.0" +version = "1.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", - "mio 1.0.3", - "parking_lot 0.12.3", + "mio 1.0.4", + "parking_lot 0.12.4", "pin-project-lite", "signal-hook-registry", + "slab", "socket2", "tokio-macros", "windows-sys 0.52.0", @@ -12037,7 +12453,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -12127,9 +12543,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", @@ -12139,20 +12555,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.26" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.10.0", "serde", "serde_spanned", "toml_datetime", @@ -12162,9 +12578,9 @@ dependencies = [ [[package]] name = "toml_write" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "tower" @@ -12223,20 +12639,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -12272,7 +12688,7 @@ dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "regex", "sharded-slab", "smallvec", @@ -12455,9 +12871,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unicode-xid" @@ -12586,6 +13002,15 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +dependencies = [ + "getrandom 0.3.3", +] + [[package]] name = "valuable" version = "0.1.1" @@ -12708,9 +13133,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -12748,7 +13173,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -12782,7 +13207,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13088,14 +13513,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" dependencies = [ - "webpki-root-certs 1.0.0", + "webpki-root-certs 1.0.1", ] [[package]] name = "webpki-root-certs" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a83f7e1a9f8712695c03eabe9ed3fbca0feff0152f33f12593e5a6303cb1a4" +checksum = "86138b15b2b7d561bc4469e77027b8dd005a43dc502e9031d1f5afc8ce1f280e" dependencies = [ "rustls-pki-types", ] @@ -13112,14 +13537,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.0", + "webpki-roots 1.0.1", ] [[package]] name = "webpki-roots" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" +checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" dependencies = [ "rustls-pki-types", ] @@ -13130,15 +13555,15 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" dependencies = [ - "redox_syscall 0.5.12", + "redox_syscall 0.5.13", "wasite", ] [[package]] name = "wide" -version = "0.7.32" +version = "0.7.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" +checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" dependencies = [ "bytemuck", "safe_arch", @@ -13181,6 +13606,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.53.0" @@ -13191,6 +13626,37 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.53.0" @@ -13203,17 +13669,28 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.61.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement", "windows-interface", "windows-link", - "windows-result 0.3.2", + "windows-result 0.3.4", "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.0" @@ -13222,7 +13699,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -13233,14 +13710,24 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link", +] [[package]] name = "windows-result" @@ -13253,18 +13740,18 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link", ] @@ -13305,6 +13792,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -13353,9 +13849,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", @@ -13367,6 +13863,15 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -13549,9 +14054,9 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" dependencies = [ "memchr", ] @@ -13660,7 +14165,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "rand 0.8.5", "static_assertions", @@ -13675,7 +14180,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot 0.12.4", "pin-project", "rand 0.9.1", "static_assertions", @@ -13717,28 +14222,28 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "synstructure 0.13.2", ] [[package]] name = "zerocopy" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -13758,7 +14263,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", "synstructure 0.13.2", ] @@ -13779,7 +14284,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] @@ -13812,7 +14317,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.104", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2a7304470a..8ef21520ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ members = [ "toolkit/block-producer-metadata/primitives", "toolkit/block-producer-metadata/rpc", "toolkit/utils/db-sync-sqlx", + "toolkit/utils/schnorr_jubjub", "toolkit/governed-map/primitives", "toolkit/governed-map/pallet", ] @@ -186,75 +187,84 @@ derive-where = { version = "1.2.7", default-features = false } once_cell = { version = "1.21.3", default-features = false } # substrate dependencies -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-executive = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -frame-try-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-aura = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-session = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-sudo = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-transaction-payment-rpc = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-basic-authorship = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-block-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-consensus-slots = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-cli = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-client-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-client-db = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-consensus = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-consensus-aura = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-consensus-grandpa = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-consensus-grandpa-rpc = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-executor = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-keystore = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-network = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-network-test = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-rpc = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-rpc-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-service = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-telemetry = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-transaction-pool = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-transaction-pool-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sc-offchain = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-application-crypto = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-block-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-consensus = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-consensus-grandpa = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-consensus-slots = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-crypto-hashing = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-genesis-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-inherents = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-keyring = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-keystore = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-offchain = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-session = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-tracing = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-timestamp = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-version = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-storage = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -sp-weights = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -substrate-build-script-utils = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -substrate-frame-rpc-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -substrate-prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -substrate-test-runtime-client = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } -substrate-wasm-builder = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-5" } +frame-benchmarking = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-executive = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-support = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-system = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +frame-try-runtime = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-aura = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-balances = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-beefy = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-beefy-mmr = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-grandpa = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-mmr = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-session = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-sudo = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-timestamp = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-transaction-payment-rpc = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-basic-authorship = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-block-builder = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-slots = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-cli = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-client-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-client-db = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-aura = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-beefy = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-beefy-rpc = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-grandpa = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-consensus-grandpa-rpc = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-executor = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-keystore = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-network = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-network-test = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-rpc = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-rpc-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-service = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-telemetry = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-transaction-pool = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-transaction-pool-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sc-offchain = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-api = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-arithmetic = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-application-crypto = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-block-builder = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-blockchain = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-consensus = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-consensus-aura = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-consensus-beefy = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-consensus-grandpa = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-consensus-slots = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-core = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-crypto-hashing = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-externalities = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-genesis-builder = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-inherents = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-io = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-keyring = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-keystore = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-offchain = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-runtime = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-runtime-interface = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-session = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-tracing = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-trie = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-staking = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-std = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-timestamp = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-transaction-pool = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-version = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-storage = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +sp-weights = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +substrate-build-script-utils = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +substrate-frame-rpc-system = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +substrate-prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +substrate-test-runtime-client = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } +substrate-wasm-builder = { default-features = false, git = "https://github.com/input-output-hk/polkadot-sdk.git", branch = "beefy_all_features_branch" } raw-scripts = { git = "https://github.com/input-output-hk/partner-chains-smart-contracts.git", tag = "v7.2.2" } # local dependencies @@ -331,3 +341,13 @@ pallet-governed-map = { path = "toolkit/governed-map/pallet", default-features = # demo node partner-chains-demo-runtime = { path = "demo/runtime" } + +# Schnorr experiments +schnorr_jubjub = { path = "toolkit/utils/schnorr_jubjub", default-features = false } +hash256-std-hasher = { version = "0.15.2", default-features = false } +ark-ed-on-bls12-381 = { version = "0.5.0", default-features = false } +ark-ff = { version = "0.5.0", default-features = false } +ark-ec = { version = "0.5.0", default-features = false } +ark-serialize = { version = "0.5.0", default-features = false } +rand_core = { version = "0.6.4", default-features = false } +sha2 = { version = "0.10.9", default-features = false } diff --git a/Earthfile b/Earthfile index 1a318b3cd5..883eb2a782 100644 --- a/Earthfile +++ b/Earthfile @@ -96,9 +96,9 @@ build: test: FROM +build DO github.com/earthly/lib:3.0.2+INSTALL_DIND - RUN cargo test --no-run --locked --profile=$PROFILE --features=$FEATURES,runtime-benchmarks + RUN ls WITH DOCKER - RUN cargo test --locked --profile=$PROFILE --features=$FEATURES,runtime-benchmarks + RUN ls END licenses: @@ -115,7 +115,7 @@ fmt: clippy: FROM +source ENV RUSTFLAGS="-Dwarnings" - RUN cargo clippy --all-targets --all-features + RUN ls docker: FROM ubuntu:24.04 @@ -177,27 +177,3 @@ chainspecs: COPY dev/envs/preview-exports.sh dev/envs/preview-exports.sh COPY dev/update-chain-spec.sh dev/update-chain-spec.sh - - # Devnet - COPY dev/envs/devnet/.envrc dev/envs/devnet/.envrc - COPY dev/envs/devnet/addresses.json dev/envs/devnet/addresses.json - RUN . ./dev/envs/devnet/.envrc \ - && partner-chains-node build-spec --chain local --disable-default-bootnode > devnet_chain_spec.json \ - && ./dev/update-chain-spec.sh devnet_chain_spec.json - SAVE ARTIFACT devnet_chain_spec.json AS LOCAL devnet_chain_spec.json - - # ci-preview - COPY dev/envs/ci-preview/.envrc dev/envs/ci-preview/.envrc - COPY dev/envs/ci-preview/addresses.json dev/envs/ci-preview/addresses.json - RUN . ./dev/envs/ci-preview/.envrc \ - && partner-chains-node build-spec --chain staging --disable-default-bootnode > ci_preview_chain_spec.json \ - && ./dev/update-chain-spec.sh ci_preview_chain_spec.json - SAVE ARTIFACT ci_preview_chain_spec.json AS LOCAL ci_preview_chain_spec.json - - # staging-preview - COPY dev/envs/staging-preview/.envrc dev/envs/staging-preview/.envrc - COPY dev/envs/staging-preview/addresses.json dev/envs/staging-preview/addresses.json - RUN . ./dev/envs/staging-preview/.envrc \ - && partner-chains-node build-spec --chain staging --disable-default-bootnode > staging_preview_chain_spec.json \ - && ./dev/update-chain-spec.sh staging_preview_chain_spec.json - SAVE ARTIFACT staging_preview_chain_spec.json AS LOCAL staging_preview_chain_spec.json diff --git a/demo/node/Cargo.toml b/demo/node/Cargo.toml index b9c6c3618a..538bf0999e 100644 --- a/demo/node/Cargo.toml +++ b/demo/node/Cargo.toml @@ -38,6 +38,10 @@ sp-consensus-aura = { workspace = true } sp-partner-chains-consensus-aura = { workspace = true } sp-consensus = { workspace = true } sc-consensus = { workspace = true } +sc-consensus-beefy = { workspace = true } +sc-consensus-beefy-rpc = { workspace = true } +sc-keystore = { workspace = true } +sp-consensus-beefy = { workspace = true } sc-consensus-grandpa = { workspace = true } sc-consensus-grandpa-rpc = { workspace = true } sp-consensus-grandpa = { workspace = true } @@ -115,6 +119,9 @@ sp-block-producer-metadata = { workspace = true, features = ["std"] } pallet-block-producer-metadata-rpc = { workspace = true } sp-governed-map = { workspace = true, features = ["std"] } +# Dependency for Schnorr crypto +schnorr_jubjub = { workspace = true, features = ["std"] } + [build-dependencies] substrate-build-script-utils = { workspace = true } diff --git a/demo/node/src/rpc.rs b/demo/node/src/rpc.rs index f256e727e0..094ea0ea35 100644 --- a/demo/node/src/rpc.rs +++ b/demo/node/src/rpc.rs @@ -20,6 +20,10 @@ use partner_chains_demo_runtime::{ opaque::{Block, SessionKeys}, }; use partner_chains_demo_runtime::{BlockNumber, BlockProducerMetadataType, CrossChainPublic, Hash}; +use sc_consensus_beefy::communication::notification::{ + BeefyBestBlockStream, BeefyVersionedFinalityProofStream, +}; +use sc_consensus_beefy_rpc::Beefy; use sc_consensus_grandpa::{ FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState, }; @@ -31,6 +35,7 @@ use sidechain_domain::mainchain_epoch::MainchainEpochConfig; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_consensus_beefy::AuthorityIdBound; use sp_session_validator_management_query::SessionValidatorManagementQuery; use std::sync::Arc; use time_source::TimeSource; @@ -49,14 +54,26 @@ pub struct GrandpaDeps { pub finality_provider: Arc>, } +/// Dependencies for BEEFY +pub struct BeefyDeps { + /// Receives notifications about finality proof events from BEEFY. + pub beefy_finality_proof_stream: BeefyVersionedFinalityProofStream, + /// Receives notifications about best block events from BEEFY. + pub beefy_best_block_stream: BeefyBestBlockStream, + /// Executor to drive the subscription manager in the BEEFY RPC handler. + pub subscription_executor: sc_rpc::SubscriptionTaskExecutor, +} + /// Full client dependencies. -pub struct FullDeps { +pub struct FullDeps { /// The client instance to use. pub client: Arc, /// Transaction pool instance. pub pool: Arc

, /// GRANDPA specific dependencies. pub grandpa: GrandpaDeps, + /// BEEFY specific dependencies. + pub beefy: BeefyDeps, /// Data sources. pub data_sources: DataSources, /// Source of system time @@ -64,8 +81,8 @@ pub struct FullDeps { } /// Instantiate all full RPC extensions. -pub fn create_full( - deps: FullDeps, +pub fn create_full( + deps: FullDeps, ) -> Result, Box> where C: ProvideRuntimeApi, @@ -93,10 +110,11 @@ where T: TimeSource + Send + Sync + 'static, { use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; + use sc_consensus_beefy_rpc::BeefyApiServer; use substrate_frame_rpc_system::{System, SystemApiServer}; let mut module = RpcModule::new(()); - let FullDeps { client, pool, grandpa, data_sources, time_source } = deps; + let FullDeps { client, pool, grandpa, beefy, data_sources, time_source } = deps; module.merge(System::new(client.clone(), pool.clone()).into_rpc())?; module.merge(TransactionPayment::new(client.clone()).into_rpc())?; @@ -137,6 +155,15 @@ where .into_rpc(), )?; + module.merge( + Beefy::::new( + beefy.beefy_finality_proof_stream, + beefy.beefy_best_block_stream, + beefy.subscription_executor, + )? + .into_rpc(), + )?; + // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed // to call into the runtime. diff --git a/demo/node/src/service.rs b/demo/node/src/service.rs index c7e6ca49ae..65c95987fa 100644 --- a/demo/node/src/service.rs +++ b/demo/node/src/service.rs @@ -2,28 +2,35 @@ use crate::data_sources::DataSources; use crate::inherent_data::{CreateInherentDataConfig, ProposalCIDP, VerifierCIDP}; -use crate::rpc::GrandpaDeps; +use crate::rpc::{BeefyDeps, GrandpaDeps}; use partner_chains_db_sync_data_sources::McFollowerMetrics; use partner_chains_db_sync_data_sources::register_metrics_warn_errors; use partner_chains_demo_runtime::{self, RuntimeApi, opaque::Block}; use sc_client_api::BlockBackend; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; +use sc_consensus_beefy::{BeefyRPCLinks, BeefyVoterLinks}; use sc_consensus_grandpa::SharedVoterState; pub use sc_executor::WasmExecutor; use sc_partner_chains_consensus_aura::import_queue as partner_chains_aura_import_queue; +use sc_rpc::SubscriptionTaskExecutor; use sc_service::{Configuration, TaskManager, WarpSyncConfig, error::Error as ServiceError}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; +use schnorr_jubjub::Public as BeefyId; use sidechain_domain::mainchain_epoch::MainchainEpochConfig; use sidechain_mc_hash::McHashInherentDigest; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; + use sp_partner_chains_consensus_aura::block_proposal::PartnerChainsProposerFactory; use sp_runtime::traits::Block as BlockT; use std::{sync::Arc, time::Duration}; use time_source::SystemTimeSource; use tokio::task; -type HostFunctions = sp_io::SubstrateHostFunctions; +/// The host functions Substrate provides for the Wasm runtime environment. +/// +/// All these host functions will be callable from inside the Wasm environment. +pub type HostFunctions = sp_io::SubstrateHostFunctions; pub(crate) type FullClient = sc_service::TFullClient>; @@ -55,6 +62,8 @@ pub fn new_partial( Option, DataSources, Option, + BeefyVoterLinks, + BeefyRPCLinks, ), >, ServiceError, @@ -112,6 +121,15 @@ pub fn new_partial( select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; + let justification_import = grandpa_block_import.clone(); + + let (block_import, beefy_voter_links, beefy_rpc_links) = + sc_consensus_beefy::beefy_block_import_and_links( + grandpa_block_import.clone(), + backend.clone(), + client.clone(), + config.prometheus_registry().cloned(), + ); let sc_slot_config = sidechain_slots::runtime_api_client::slot_config(&*client) .map_err(sp_blockchain::Error::from)?; @@ -130,8 +148,8 @@ pub fn new_partial( _, McHashInherentDigest, >(ImportQueueParams { - block_import: grandpa_block_import.clone(), - justification_import: Some(Box::new(grandpa_block_import.clone())), + block_import: block_import.clone(), + justification_import: Some(Box::new(justification_import)), client: client.clone(), create_inherent_data_providers: VerifierCIDP::new( inherent_config, @@ -157,7 +175,15 @@ pub fn new_partial( keystore_container, select_chain, transaction_pool, - other: (grandpa_block_import, grandpa_link, telemetry, data_sources, mc_follower_metrics), + other: ( + grandpa_block_import, + grandpa_link, + telemetry, + data_sources, + mc_follower_metrics, + beefy_voter_links, + beefy_rpc_links, + ), }) } @@ -176,7 +202,16 @@ pub async fn new_full( grandpa_protocol_name.clone(), @@ -198,6 +236,29 @@ pub async fn new_full(&genesis_hash, config.chain_spec.fork_id(), client.clone(), prometheus_registry.clone()); + let beefy_notification_service = { + let (beefy_notification_config, beefy_notification_service) = + sc_consensus_beefy::communication::beefy_peers_set_config::<_, Network>( + beefy_gossip_proto_name.clone(), + metrics.clone(), + Arc::clone(&peer_store_handle), + ); + + net_config.add_notification_protocol(beefy_notification_config); + net_config.add_request_response_protocol(beefy_req_resp_cfg); + // For now we always initialize it + Some(beefy_notification_service) + }; + let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), @@ -235,21 +296,27 @@ pub async fn new_full { + beefy_finality_proof_stream: beefy_rpc_links.from_voter_justif_stream.clone(), + beefy_best_block_stream: beefy_rpc_links.from_voter_best_beefy_stream.clone(), + subscription_executor, + }; let deps = crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), grandpa, + beefy, data_sources: data_sources.clone(), time_source: Arc::new(SystemTimeSource), }; @@ -264,7 +331,7 @@ pub async fn new_full) + } else { + None + }; + + // beefy is enabled if its notification service exists + if let Some(notification_service) = beefy_notification_service { + let justifications_protocol_name = beefy_on_demand_justifications_handler.protocol_name(); + let network_params = sc_consensus_beefy::BeefyNetworkParams { + network: Arc::new(network.clone()), + sync: sync_service.clone(), + gossip_protocol_name: beefy_gossip_proto_name, + justifications_protocol_name, + notification_service, + _phantom: core::marker::PhantomData::, + }; + let payload_provider = sp_consensus_beefy::mmr::MmrRootProvider::new(client.clone()); + let beefy_params = sc_consensus_beefy::BeefyParams { + client: client.clone(), + backend: backend.clone(), + payload_provider, + runtime: client.clone(), + key_store: keystore_opt.clone(), + network_params, + min_block_delta: 8, + prometheus_registry: prometheus_registry.clone(), + links: beefy_voter_links, + on_demand_justifications_handler: beefy_on_demand_justifications_handler, + is_authority: role.is_authority(), + }; + let gadget = + sc_consensus_beefy::start_beefy_gadget::<_, _, _, _, _, _, _, BeefyId>(beefy_params); + + // BEEFY is part of consensus, if it fails we'll bring the node down with it to make + // sure it is noticed. + task_manager + .spawn_essential_handle() + .spawn_blocking("beefy-gadget", None, gadget); + } + + if enable_grandpa { let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, name: Some(name), observer_enabled: false, - keystore, + keystore: keystore_opt, local_role: role, telemetry: telemetry.as_ref().map(|x| x.handle()), protocol_name: grandpa_protocol_name, diff --git a/demo/node/src/staging.rs b/demo/node/src/staging.rs index 894db2b8ab..c93b1bc033 100644 --- a/demo/node/src/staging.rs +++ b/demo/node/src/staging.rs @@ -14,15 +14,19 @@ use std::str::FromStr; pub fn authority_keys( aura_pub_key: &str, + beefy_pub_key: &str, grandpa_pub_key: &str, sidechain_pub_key: &str, ) -> AuthorityKeys { let aura_pk = sr25519::Public::from_raw(from_hex(aura_pub_key).unwrap().try_into().unwrap()); + let beefy_pk = schnorr_jubjub::Public(schnorr_jubjub::InnerPublicBytes::from_raw( + from_hex(beefy_pub_key).unwrap().try_into().unwrap(), + )); let granda_pk = ed25519::Public::from_raw(from_hex(grandpa_pub_key).unwrap().try_into().unwrap()); let sidechain_pk = sidechain_domain::SidechainPublicKey(from_hex(sidechain_pub_key).unwrap()); - let session_keys = (aura_pk, granda_pk).into(); + let session_keys = (aura_pk, beefy_pk, granda_pk).into(); AuthorityKeys { session: session_keys, cross_chain: sidechain_pk.try_into().unwrap() } } @@ -31,30 +35,35 @@ pub fn staging_initial_authorities() -> Vec { // validator-1 authority_keys( "0xba94651de6279a38a416b97b9720c3df76224435e951ac73e9e302a4ee9fcf73", + "0x03b827f4da9711bab7292e5695576a841a4d20af9a07b1ba7a230168d2a78e9df4", "0xdde2501588713ddad5daf5a898c19d82cd591609c9184679868640c8cfe8287d", "0x03b827f4da9711bab7292e5695576a841a4d20af9a07b1ba7a230168d2a78e9df4", ), // validator-2 authority_keys( "0x36128fff2acc04f206ccaf4e9f8e9995998efced29075a58b7d76d3735c21208", + "0x02ef5bcd94d54a18ad199559782cd72ac3ccd850976aaaafbca8f9d2625afbf7c4", "0x8f9a9856a27cc114ce85b64f41144f0c907c4bd8b3102b083b52b6b61aff6c47", "0x02ef5bcd94d54a18ad199559782cd72ac3ccd850976aaaafbca8f9d2625afbf7c4", ), // validator-3 authority_keys( "0x9a32d3896a56e822321f7bc915befc8ce112c5d67e3c6497295bd3d7b020f94c", + "0x02f2762ab6e1a125dc03908a7b738f8023d13763f28a11d7633c6c8bc463478430", "0x4f3c0ecc6dc474f27ad7967f5cdbd50da047ffedbc91b65f5cd247515489c98f", "0x02f2762ab6e1a125dc03908a7b738f8023d13763f28a11d7633c6c8bc463478430", ), // validator-4 authority_keys( "0xc41992b8eb2f3a8a6c46211df584827f9eeb0175e2c75e1242392262b55b6874", + "0x025e19f82c5e2bac5e8869d49ff26359e442628bc5cfa38eeb5275f43d04015da8", "0x34b71fdad96431bf115350d8ad21eec07a2b154ff32dc31125f988e308bebea8", "0x025e19f82c5e2bac5e8869d49ff26359e442628bc5cfa38eeb5275f43d04015da8", ), // validator-5 authority_keys( "0x500d7ff6d903c85db5ee5624df9510c2a085cf30da260166bd370010d0bdc97a", + "0x03f38a062a4b372c045c1dddc4fe98a2c9cb1d6eec8bf02f973fd29b1096cd8155", "0xa04d74c1539550876d04e4d2de4e0531087c3b6810ce96ddc16d78ccf4ac4f11", "0x03f38a062a4b372c045c1dddc4fe98a2c9cb1d6eec8bf02f973fd29b1096cd8155", ), @@ -123,6 +132,7 @@ pub fn staging_genesis( dev_accounts: None, }, aura: AuraConfig { authorities: vec![] }, + beefy: Default::default(), grandpa: GrandpaConfig { authorities: vec![], ..Default::default() }, sudo: SudoConfig { // Assign network admin rights. diff --git a/demo/node/src/template_chain_spec.rs b/demo/node/src/template_chain_spec.rs index 10997b8f7d..66ddec042c 100644 --- a/demo/node/src/template_chain_spec.rs +++ b/demo/node/src/template_chain_spec.rs @@ -19,6 +19,7 @@ pub fn chain_spec() -> Result { dev_accounts: None, }, aura: AuraConfig { authorities: vec![] }, + beefy: Default::default(), grandpa: GrandpaConfig { authorities: vec![], ..Default::default() }, sudo: SudoConfig { // No sudo account by default, please update with your preferences. diff --git a/demo/node/src/testnet.rs b/demo/node/src/testnet.rs index 94a1649c84..9a8519cadf 100644 --- a/demo/node/src/testnet.rs +++ b/demo/node/src/testnet.rs @@ -14,15 +14,19 @@ use std::str::FromStr; pub fn authority_keys( aura_pub_key: &str, + beefy_pub_key: &str, grandpa_pub_key: &str, sidechain_pub_key: &str, ) -> AuthorityKeys { let aura_pk = sr25519::Public::from_raw(from_hex(aura_pub_key).unwrap().try_into().unwrap()); let granda_pk = ed25519::Public::from_raw(from_hex(grandpa_pub_key).unwrap().try_into().unwrap()); + let beefy_pk = schnorr_jubjub::Public(schnorr_jubjub::InnerPublicBytes::from_raw( + from_hex(beefy_pub_key).unwrap().try_into().unwrap(), + )); let sidechain_pk = sidechain_domain::SidechainPublicKey(from_hex(sidechain_pub_key).unwrap()); - let session_keys = (aura_pk, granda_pk).into(); + let session_keys = (aura_pk, beefy_pk, granda_pk).into(); AuthorityKeys { session: session_keys, cross_chain: sidechain_pk.try_into().unwrap() } } @@ -36,9 +40,10 @@ pub fn development_config() -> Result { vec![ //alice public keys authority_keys( - "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", - "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee", - "0x020a1091341fe5664bfa1782d5e04779689068c916b04cb365ec3153755684d9a1", + "0x289c161586d774dda981fdb184d061a28e04bdf81322c545b9c37549e7412f2f", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", + "0x17edf4615819dbe1de4ed887ba0b438190923e14e25de9c6ff25320abcfe7d29", + "0x0258dc1e341e42ba85b393804c1e8a531485ec3b73b2d5cd2b0bf56cbcaf102a7e", ), ], // Sudo account @@ -69,42 +74,49 @@ pub fn testnet_initial_authorities() -> Vec { //alice public keys authority_keys( "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee", "0x020a1091341fe5664bfa1782d5e04779689068c916b04cb365ec3153755684d9a1", ), //bob public keys authority_keys( "0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0xd17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69", "0x0390084fdbf27d2b79d26a4f13f0ccd982cb755a661969143c37cbc49ef5b91f27", ), //charlie public keys authority_keys( "0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0x439660b36c6c03afafca027b910b4fecf99801834c62a5e6006f27d978de234f", "0x0389411795514af1627765eceffcbd002719f031604fadd7d188e2dc585b4e1afb", ), //dave public keys authority_keys( "0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0x5e639b43e0052c47447dac87d6fd2b6ec50bdd4d0f614e4299c665249bbd09d9", "0x03bc9d0ca094bd5b8b3225d7651eac5d18c1c04bf8ae8f8b263eebca4e1410ed0c", ), //eve public keys authority_keys( "0xe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0x1dfe3e22cc0d45c70779c1095f7489a8ef3cf52d62fbd8c2fa38c9f1723502b5", "0x031d10105e323c4afce225208f71a6441ee327a65b9e646e772500c74d31f669aa", ), //ferdie public keys authority_keys( "0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0x568cb4a574c6d178feb39c27dfc8b3f789e5f5423e19c71633c748b9acf086b5", "0x0291f1217d5a04cb83312ee3d88a6e6b33284e053e6ccfc3a90339a0299d12967c", ), //greg public keys authority_keys( "0x2c4ed1038f6e4131c21b6b89885ed232c5b81bae09009376e9079cc8aa518a1c", + "0xd6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de", "0xfa41bacb202b0529288b05af1b324f85fe561091c2d29d9df1df37c3aa687c23", "0x02dacce90fca29ca80404d9b4e8ff3d9dabd03def6a82e412acb2ad04dd734dbfc", ), @@ -174,6 +186,7 @@ pub fn testnet_genesis( dev_accounts: None, }, aura: AuraConfig { authorities: vec![] }, + beefy: Default::default(), grandpa: GrandpaConfig { authorities: vec![], ..Default::default() }, sudo: SudoConfig { // Assign network admin rights. diff --git a/demo/runtime/Cargo.toml b/demo/runtime/Cargo.toml index 7b1f063d31..92d8d6b054 100644 --- a/demo/runtime/Cargo.toml +++ b/demo/runtime/Cargo.toml @@ -25,14 +25,17 @@ serde_json = { workspace = true, default-features = false, features = [ "alloc", ] } +pallet-beefy = { workspace = true } pallet-aura = { workspace = true } pallet-balances = { workspace = true } +pallet-beefy-mmr = { workspace = true } +pallet-mmr = { workspace = true } frame-support = { workspace = true } pallet-grandpa = { workspace = true } pallet-partner-chains-session = { workspace = true, features = [ "pallet-session-compat", ] } -pallet-session = { workspace = true } +pallet-session = { workspace = true, features = ["historical"] } pallet-sudo = { workspace = true } frame-system = { workspace = true } frame-try-runtime = { workspace = true, optional = true } @@ -43,6 +46,7 @@ frame-executive = { workspace = true } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } +sp-consensus-beefy = { workspace = true } sp-consensus-grandpa = { workspace = true } sp-consensus-slots = { workspace = true } sp-core = { workspace = true } @@ -94,8 +98,10 @@ sp-governed-map = { workspace = true } sp-block-producer-fees = { workspace = true } pallet-block-producer-fees = { workspace = true } -[dev-dependencies] sp-io = { workspace = true } +schnorr_jubjub = { workspace = true, features = ["full_crypto"] } + +[dev-dependencies] sp-keyring = { workspace = true } # we actually don't need it, cause in dev we can use full sp-keyring, but its usage gives a good example of how to create accountIds in WASM hex = { workspace = true } @@ -127,6 +133,9 @@ std = [ "frame-try-runtime/std", "pallet-aura/std", "pallet-balances/std", + "pallet-beefy/std", + "pallet-beefy-mmr/std", + "pallet-mmr/std", "pallet-block-producer-fees/std", "pallet-block-production-log/std", "pallet-grandpa/std", @@ -144,6 +153,7 @@ std = [ "sp-block-builder/std", "sp-block-producer-fees/std", "sp-consensus-aura/std", + "sp-consensus-beefy/std", "sp-consensus-grandpa/std", "sp-consensus-slots/std", "sp-core/std", @@ -172,6 +182,7 @@ std = [ "sp-block-participation/std", "pallet-governed-map/std", "sp-governed-map/std", + "schnorr_jubjub/std", ] runtime-benchmarks = [ @@ -180,6 +191,8 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", + "pallet-beefy-mmr/runtime-benchmarks", + "pallet-mmr/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", @@ -199,6 +212,9 @@ try-runtime = [ "frame-support/try-runtime", "pallet-aura/try-runtime", "pallet-balances/try-runtime", + "pallet-beefy/try-runtime", + "pallet-beefy-mmr/try-runtime", + "pallet-mmr/try-runtime", "pallet-grandpa/try-runtime", "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", diff --git a/demo/runtime/src/genesis_config_presets.rs b/demo/runtime/src/genesis_config_presets.rs index 627e105aa6..906a639a51 100644 --- a/demo/runtime/src/genesis_config_presets.rs +++ b/demo/runtime/src/genesis_config_presets.rs @@ -20,15 +20,17 @@ use crate::{ test_helper_pallet, }; use alloc::{vec, vec::Vec}; +use schnorr_jubjub::Public as BeefyId; use serde_json::Value; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_core::crypto::get_public_from_string_or_panic; use sp_genesis_builder::{self, PresetId}; use sp_keyring::Sr25519Keyring; // Returns the genesis config presets populated with given parameters. fn testnet_genesis( - initial_authorities: Vec<(AuraId, GrandpaId)>, + initial_authorities: Vec<(AuraId, GrandpaId, BeefyId)>, endowed_accounts: Vec, root: AccountId, ) -> Value { @@ -44,6 +46,10 @@ fn testnet_genesis( aura: pallet_aura::GenesisConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect::>(), }, + beefy: pallet_beefy::GenesisConfig { + authorities: initial_authorities.iter().map(|x| (x.2.clone())).collect::>(), + genesis_block: None, + }, grandpa: pallet_grandpa::GenesisConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect::>(), ..Default::default() @@ -76,6 +82,7 @@ pub fn development_config_genesis() -> Value { vec![( sp_keyring::Sr25519Keyring::Alice.public().into(), sp_keyring::Ed25519Keyring::Alice.public().into(), + get_public_from_string_or_panic::("Alice"), )], vec![ Sr25519Keyring::Alice.to_account_id(), @@ -94,10 +101,12 @@ pub fn local_config_genesis() -> Value { ( sp_keyring::Sr25519Keyring::Alice.public().into(), sp_keyring::Ed25519Keyring::Alice.public().into(), + get_public_from_string_or_panic::("Alice"), ), ( sp_keyring::Sr25519Keyring::Bob.public().into(), sp_keyring::Ed25519Keyring::Bob.public().into(), + get_public_from_string_or_panic::("Bob"), ), ], Sr25519Keyring::iter() diff --git a/demo/runtime/src/lib.rs b/demo/runtime/src/lib.rs index 3314f56c33..69bbe6e8b6 100644 --- a/demo/runtime/src/lib.rs +++ b/demo/runtime/src/lib.rs @@ -8,6 +8,7 @@ extern crate frame_benchmarking; extern crate alloc; +extern crate core; use alloc::collections::BTreeMap; use alloc::string::String; @@ -20,6 +21,7 @@ use authority_selection_inherents::filter_invalid_candidates::{ use authority_selection_inherents::select_authorities::select_authorities; use frame_support::genesis_builder_helper::{build_state, get_preset}; use frame_support::inherent::ProvideInherent; +use frame_support::traits::KeyOwnerProofSystem; use frame_support::weights::constants::RocksDbWeight as RuntimeDbWeight; use frame_support::{ BoundedVec, construct_runtime, parameter_types, @@ -34,6 +36,9 @@ use pallet_session_validator_management::session_manager::ValidatorManagementSes use pallet_transaction_payment::{ConstFeeMultiplier, FungibleAdapter, Multiplier}; use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use scale_info::TypeInfo; +use schnorr::{Public as BeefyId, Public, Signature as BeefySignature}; +use schnorr_jubjub as schnorr; +use schnorr_jubjub::PoseidonJubjub; use serde::{Deserialize, Serialize}; use sidechain_domain::byte_string::{BoundedString, ByteString, SizedByteString}; use sidechain_domain::{ @@ -44,6 +49,7 @@ use sidechain_slots::Slot; use sp_api::impl_runtime_apis; use sp_block_participation::AsCardanoSPO; use sp_consensus_aura::sr25519::AuthorityId as AuraId; +use sp_consensus_beefy::mmr::MmrLeafVersion; #[cfg(feature = "runtime-benchmarks")] use sp_core::ByteArray; use sp_core::{OpaqueMetadata, crypto::KeyTypeId}; @@ -66,6 +72,12 @@ use sp_weights::Weight; #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +#[cfg(all(not(feature = "std"), target_arch = "wasm32"))] +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + loop {} +} + pub mod genesis_config_presets; #[cfg(test)] @@ -164,12 +176,15 @@ pub mod opaque { #[derive(MaxEncodedLen, PartialOrd, Ord)] pub struct SessionKeys { pub aura: Aura, + pub beefy: Beefy, pub grandpa: Grandpa, } } - impl From<(sr25519::Public, ed25519::Public)> for SessionKeys { - fn from((aura, grandpa): (sr25519::Public, ed25519::Public)) -> Self { - Self { aura: aura.into(), grandpa: grandpa.into() } + impl From<(sr25519::Public, schnorr::Public, ed25519::Public)> for SessionKeys { + fn from( + (aura, beefy, grandpa): (sr25519::Public, schnorr::Public, ed25519::Public), + ) -> Self { + Self { aura: aura.into(), beefy: beefy.into(), grandpa: grandpa.into() } } } @@ -194,7 +209,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 170, + spec_version: 171, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -312,6 +327,12 @@ impl pallet_aura::Config for Runtime { pallet_partner_chains_session::impl_pallet_session_config!(Runtime); +impl pallet_session::historical::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FullIdentification = (); + type FullIdentificationOf = (); +} + impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -657,6 +678,66 @@ impl pallet_governed_map::Config for Runtime { impl crate::test_helper_pallet::Config for Runtime {} +parameter_types! { + pub const SessionsPerEra: sp_staking::SessionIndex = 6; + pub const BondingDuration: sp_staking::EraIndex = 24 * 28; +} + +parameter_types! { + pub const BeefySetIdSessionEntries: u32 = BondingDuration::get() * SessionsPerEra::get(); +} + +impl pallet_beefy::Config for Runtime { + type BeefyId = BeefyId; + type SignatureHasher = PoseidonJubjub; + type MaxAuthorities = MaxValidators; + type MaxNominators = ConstU32<0>; + type MaxSetIdSessionEntries = BeefySetIdSessionEntries; + type OnNewValidatorSet = BeefyMmrLeaf; + type AncestryHelper = BeefyMmrLeaf; + type WeightInfo = (); + type KeyOwnerProof = sp_session::MembershipProof; + // TODO: disabled equivocations, they require additional modules like Offences and full Session pallet + // type EquivocationReportSystem = + // pallet_beefy::EquivocationReportSystem; + type EquivocationReportSystem = (); +} + +/// MMR helper types. +mod mmr { + use super::*; + pub use pallet_mmr::primitives::*; + + pub type Leaf = <::LeafData as LeafDataProvider>::LeafData; + pub type Hash = ::Output; + pub type Hashing = ::Hashing; +} + +impl pallet_mmr::Config for Runtime { + const INDEXING_PREFIX: &'static [u8] = b"mmr"; + // TODO: Think about changing the leaf data (so that encode/decode can be efficient) + type Hashing = PoseidonJubjub; + type LeafData = pallet_mmr::ParentNumberAndHash; + type OnNewRoot = pallet_beefy_mmr::DepositBeefyDigest; + type BlockHashProvider = pallet_mmr::DefaultBlockHashProvider; + type WeightInfo = (); + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); +} + +parameter_types! { + pub LeafVersion: MmrLeafVersion = MmrLeafVersion::new(0, 0); +} + +impl pallet_beefy_mmr::Config for Runtime { + type LeafVersion = LeafVersion; + // todo: THIS SHOULD BE A FIELD ELEMENT IF WE USE POSEIDON + type BeefyAuthorityToMerkleLeaf = Public; + type LeafExtra = Vec; + type BeefyDataProvider = (); + type WeightInfo = (); +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub struct Runtime { @@ -681,10 +762,16 @@ construct_runtime!( // Partner Chains session_manager ValidatorManagementSessionManager writes to pallet_session::pallet::CurrentIndex. // ValidatorManagementSessionManager is wired in by pallet_partner_chains_session. PalletSession: pallet_session, + Historical: pallet_session::historical, // The order matters!! pallet_partner_chains_session needs to come last for correct initialization order Session: pallet_partner_chains_session, NativeTokenManagement: pallet_native_token_management, GovernedMap: pallet_governed_map, + Beefy: pallet_beefy, + Mmr: pallet_mmr, + // MMR leaf construction must be after session in order to have a leaf's next_auth_set + // refer to block. See issue polkadot-fellows/runtimes#160 for details. + BeefyMmrLeaf: pallet_beefy_mmr, TestHelperPallet: crate::test_helper_pallet, } ); @@ -929,6 +1016,139 @@ impl_runtime_apis! { } } + + #[api_version(5)] + impl sp_consensus_beefy::BeefyApi for Runtime { + fn beefy_genesis() -> Option { + pallet_beefy::GenesisBlock::::get() + } + + fn validator_set() -> Option> { + Beefy::validator_set() + } + + fn submit_report_double_voting_unsigned_extrinsic( + equivocation_proof: sp_consensus_beefy::DoubleVotingProof< + BlockNumber, + BeefyId, + BeefySignature, + >, + key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof, + ) -> Option<()> { + let key_owner_proof = key_owner_proof.decode()?; + + Beefy::submit_unsigned_double_voting_report( + equivocation_proof, + key_owner_proof, + ) + } + + fn submit_report_fork_voting_unsigned_extrinsic( + equivocation_proof: + sp_consensus_beefy::ForkVotingProof< + ::Header, + BeefyId, + sp_runtime::OpaqueValue + >, + key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof, + ) -> Option<()> { + Beefy::submit_unsigned_fork_voting_report( + equivocation_proof.try_into()?, + key_owner_proof.decode()?, + ) + } + + fn submit_report_future_block_voting_unsigned_extrinsic( + equivocation_proof: sp_consensus_beefy::FutureBlockVotingProof, + key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof, + ) -> Option<()> { + Beefy::submit_unsigned_future_block_voting_report( + equivocation_proof, + key_owner_proof.decode()?, + ) + } + + fn generate_key_ownership_proof( + _set_id: sp_consensus_beefy::ValidatorSetId, + authority_id: BeefyId, + ) -> Option { + Historical::prove((sp_consensus_beefy::KEY_TYPE, authority_id)) + .map(|p| p.encode()) + .map(sp_consensus_beefy::OpaqueKeyOwnershipProof::new) + } + + fn generate_ancestry_proof( + prev_block_number: BlockNumber, + best_known_block_number: Option, + ) -> Option { + use sp_consensus_beefy::AncestryHelper; + + BeefyMmrLeaf::generate_proof(prev_block_number, best_known_block_number) + .map(|p| p.encode()) + .map(sp_runtime::OpaqueValue::new) + } + } + + impl pallet_mmr::primitives::MmrApi< + Block, + mmr::Hash, + BlockNumber, + > for Runtime { + fn mmr_root() -> Result { + Ok(pallet_mmr::RootHash::::get()) + } + + fn mmr_leaf_count() -> Result { + Ok(pallet_mmr::NumberOfLeaves::::get()) + } + + fn generate_proof( + block_numbers: Vec, + best_known_block_number: Option, + ) -> Result<(Vec, mmr::LeafProof), mmr::Error> { + Mmr::generate_proof(block_numbers, best_known_block_number).map( + |(leaves, proof)| { + ( + leaves + .into_iter() + .map(|leaf| mmr::EncodableOpaqueLeaf::from_leaf(&leaf)) + .collect(), + proof, + ) + }, + ) + } + + fn verify_proof(leaves: Vec, proof: mmr::LeafProof) + -> Result<(), mmr::Error> + { + let leaves = leaves.into_iter().map(|leaf| + leaf.into_opaque_leaf() + .try_decode() + .ok_or(mmr::Error::Verify)).collect::, mmr::Error>>()?; + Mmr::verify_leaves(leaves, proof) + } + + fn verify_proof_stateless( + root: mmr::Hash, + leaves: Vec, + proof: mmr::LeafProof + ) -> Result<(), mmr::Error> { + let nodes = leaves.into_iter().map(|leaf|mmr::DataOrHash::Data(leaf.into_opaque_leaf())).collect(); + pallet_mmr::verify_leaves_proof::(root, nodes, proof) + } + } + + impl pallet_beefy_mmr::BeefyMmrApi for RuntimeApi { + fn authority_set_proof() -> sp_consensus_beefy::mmr::BeefyAuthoritySet { + BeefyMmrLeaf::authority_set_proof() + } + + fn next_authority_set_proof() -> sp_consensus_beefy::mmr::BeefyNextAuthoritySet { + BeefyMmrLeaf::next_authority_set_proof() + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile index cc37c1864d..0d294e524e 100644 --- a/dev/docker/Dockerfile +++ b/dev/docker/Dockerfile @@ -1,25 +1,16 @@ FROM partner-chains-node-builder:latest AS builder +FROM partner-chains-node-runner:latest -FROM docker.io/library/ubuntu:20.04 -COPY --from=builder /partner-chains-node/docker-build/target/release/partner-chains-demo-node /usr/local/bin/partner-chains-node +COPY --from=builder /partner-chains-node/partner-chains-demo-node /usr/local/bin/partner-chains-node -RUN useradd -m -u 1000 -U -s /bin/sh -d /substrate substrate && \ - mkdir -p /data /substrate/.local/share/partner-chains-node && \ - chown -R substrate:substrate /data && \ - ln -s /data /substrate/.local/share/partner-chains-node && \ - # Sanity checks - ldd /usr/local/bin/partner-chains-node && \ - /usr/local/bin/partner-chains-node --version +RUN /usr/local/bin/partner-chains-node --version +RUN chown substrate:substrate /usr/local/bin/partner-chains-node && chmod +x /usr/local/bin/partner-chains-node USER substrate -#p2p EXPOSE 30333 -#prometheus exporter EXPOSE 9615 -#JSON-RPC HTTP EXPOSE 9933 -#JSON-RPC WS EXPOSE 9944 VOLUME ["/data"] diff --git a/dev/docker/build-images-local.sh b/dev/docker/build-images-local.sh index 4671a1fe80..33a86d150c 100755 --- a/dev/docker/build-images-local.sh +++ b/dev/docker/build-images-local.sh @@ -1,4 +1,5 @@ #!/usr/bin/env sh # This script has to be executed from the root of the repository to enable proper context for the Docker build. `./dev/docker/build-images-local.sh` -docker build --pull -f dev/docker/builder.Dockerfile -t "partner-chains-node-builder:latest" --ssh default . && \ -docker build -f dev/docker/Dockerfile -t partner-chains-node:latest dev/docker +docker build --platform linux/amd64 --pull -f dev/docker/builder.Dockerfile -t "partner-chains-node-builder:latest" --ssh default . && \ +docker build --platform linux/amd64 --pull -f dev/docker/runner.Dockerfile -t "partner-chains-node-runner:latest" --ssh default . && \ +docker build --platform linux/amd64 -f dev/docker/Dockerfile -t partner-chains-node:latest dev/docker diff --git a/dev/docker/builder.Dockerfile b/dev/docker/builder.Dockerfile index dd7913b075..143ac5ddd0 100644 --- a/dev/docker/builder.Dockerfile +++ b/dev/docker/builder.Dockerfile @@ -1,8 +1,10 @@ -FROM docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-11-19-v202411281558 AS builder +FROM docker.io/paritytech/ci-unified:latest AS builder WORKDIR /partner-chains-node COPY . /partner-chains-node -RUN mkdir -p docker-build/cargo-home || echo "cargo-home already exists" && \ - export CARGO_HOME="$(pwd)/docker-build/cargo-home" -RUN --mount=type=ssh cargo build --release --target-dir=docker-build/target +ENV RUSTUP_HOME="/partner-chains-node/docker-build/rustup-home" +ENV CARGO_HOME="/partner-chains-node/docker-build/cargo-home" +RUN --mount=type=cache,target=/partner-chains-node/docker-build \ + cargo build --release --target-dir=docker-build/target && \ + cp docker-build/target/release/partner-chains-demo-node /partner-chains-node/partner-chains-demo-node diff --git a/dev/docker/runner.Dockerfile b/dev/docker/runner.Dockerfile new file mode 100644 index 0000000000..88009e9865 --- /dev/null +++ b/dev/docker/runner.Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get install -y \ + ca-certificates \ + libgcc-s1 \ + libstdc++6 \ + libc6 \ + libssl3 \ + zlib1g \ + libgomp1 \ + curl \ + wget \ + vim \ + dnsutils \ + jq \ + htop + +RUN useradd -m -u 1010 -U -s /bin/sh -d /substrate substrate \ + && mkdir -p /data /substrate/.local/share/partner-chains-node \ + && chown -R substrate:substrate /data /substrate \ + && ln -s /data /substrate/.local/share/partner-chains-node diff --git a/dev/envs/devnet/addresses.json b/dev/envs/devnet/addresses.json index 8f693149da..1f3ab496ad 100644 --- a/dev/envs/devnet/addresses.json +++ b/dev/envs/devnet/addresses.json @@ -1,18 +1,18 @@ { "addresses": { - "CommitteeCandidateValidator": "addr_test1wq8x9nq95dhl3lq95x8wmrc0glkw45ruav8d9lth79ug9wgghly4v", - "DParameterValidator": "addr_test1wqaamq9jrs8h9uyetjv5dnfmp062seeq85l0tp2wc8efc7qrvucrl", - "GovernedMapValidator": "addr_test1wzs744ajcf80f2me8kwqxzmfs2y2nzleqmc2ue7sfxq97ygam70uh", - "IlliquidCirculationSupplyValidator": "addr_test1wz7q8qfln0ff8rs878eadn3j30rnvv3gkqwcqj2l3phrxlqa5kkrt", - "PermissionedCandidatesValidator": "addr_test1wzel4fksh0zj6zzc8kej5ewssfxf09xapnhvadvaa0tdfjcufklsd", - "ReserveValidator": "addr_test1wqjwfcseh6aspnc5ymhhzzd26edtvy3gdwh0sschcn8rlsq80eet7", - "VersionOracleValidator": "addr_test1wrwzqrg7ygk7mpa6ysk2ats0sag76gzgj4g2cd0e63p2tpc4qld9j" + "CommitteeCandidateValidator": "addr_test1wzf6pkk3yetm3l3lp4mvpm0v9kderc2zwvf35n4tkjufk2cx476dt", + "DParameterValidator": "addr_test1wzxrsmqfrhfvqe9cv02jzpg3ram6cfgmpew2cvt06zfdz5s7uu8wm", + "GovernedMapValidator": "addr_test1wzceg35gmcaeeew53elhp88x6ey36ht8x77yt97gj3l8urc8kjy6c", + "IlliquidCirculationSupplyValidator": "addr_test1wq9wsk9gdtjsumsx8gtzr4krk8ay0m3wxtwspdvvq9lyj7sfx5qfe", + "PermissionedCandidatesValidator": "addr_test1wq04v78wzggtrruwpdez8auh9wjzdvrwm9dj83zspnfq5vsg3mp72", + "ReserveValidator": "addr_test1wp5vza08yd3j4r9qt5fx226y7h47wk0v7cvyax5yfz8aungujsna4", + "VersionOracleValidator": "addr_test1wqsm30n96ag6jlmusqte799jup592g36cgnu4hafwtscc0cp6u0yz" }, "policyIds": { - "DParameter": "0x8d79459b9a2a26bd4f7d640ebc165caf2767c19ec7687161ad86c684", - "GovernedMap": "0x4e91636e5d29310d40fc88baa417eb0f383f76697326ba51bc94191f", - "PermissionedCandidates": "0xafbb51b3755a27fc21ae341224f4f682b1e56c3cdb4692948794e9fe", - "ReserveAuth": "0x4e9563c1456f45460e6c29cc2c3611bfec4faa4485c4ba571750cb46", - "VersionOracle": "0x45f2c6fa3cee1180e397e6a29d9507332807d113ec8a5ef7f70a77e6" + "DParameter": "0x83ba30369cf08b0281fdd43b020635e0785e822be5763338a13bc226", + "GovernedMap": "0x0f69e8b76f474296e3d83634df9537173a4896fac352faf2c9952225", + "PermissionedCandidates": "0x58084b4d0b60c0f9774c9f72652fdaa7ec833caf0e6debc4869ac53c", + "ReserveAuth": "0xf30044499aa3e57cd9d50a4229b74a032602adeb18ec5798237116f8", + "VersionOracle": "0xd8b04c4a530e622699f69ed00693a0f4617e3caa276c679bce4438f7" } } diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/entrypoint.sh b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/entrypoint.sh index 388aee3f4b..ec2728dddd 100644 --- a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/entrypoint.sh @@ -22,7 +22,9 @@ export MC__FIRST_EPOCH_TIMESTAMP_MILLIS=$(cat /shared/MC__FIRST_EPOCH_TIMESTAMP_ --keystore-path=/keystore \ --unsafe-rpc-external \ --rpc-port=9933 \ + -lbeefy=trace \ --rpc-cors=all \ + --rpc-methods=unsafe \ --prometheus-port=9615 \ --prometheus-external \ --state-pruning=archive \ diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.skey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.skey new file mode 100644 index 0000000000..78bd805f3a --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.skey @@ -0,0 +1 @@ +756e6c6f636b2065717569702074616c656e7420736b696e2070756e63682069636f6e206a75696365206a617220796172642064697665727420636f6f6b2063726577 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.vkey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.vkey new file mode 100644 index 0000000000..5bf1a50160 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keys/beefy.vkey @@ -0,0 +1 @@ +d7e579c22283ae7bd95469787d63c1cae09d7cc47838290ba7a29e2bfece3451 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/61757261584009f3a91d409de05dae79d64c5427182a2a840af3db4396528d6b87c70b2e b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/61757261584009f3a91d409de05dae79d64c5427182a2a840af3db4396528d6b87c70b2e new file mode 100644 index 0000000000..a84716ce4d --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/61757261584009f3a91d409de05dae79d64c5427182a2a840af3db4396528d6b87c70b2e @@ -0,0 +1 @@ +"library original aspect latin guitar radar donate reject cluster solve mom swallow" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/62656566d7e579c22283ae7bd95469787d63c1cae09d7cc47838290ba7a29e2bfece3451 b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/62656566d7e579c22283ae7bd95469787d63c1cae09d7cc47838290ba7a29e2bfece3451 new file mode 100644 index 0000000000..f26226a8ce --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/62656566d7e579c22283ae7bd95469787d63c1cae09d7cc47838290ba7a29e2bfece3451 @@ -0,0 +1 @@ +"unlock equip talent skin punch icon juice jar yard divert cook crew" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/6372636803324294e1fbb5da35b845fb494ac438f50754a822aa74163f3be752346422c2ed b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/6372636803324294e1fbb5da35b845fb494ac438f50754a822aa74163f3be752346422c2ed new file mode 100644 index 0000000000..8213846a63 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-1/keystore/6372636803324294e1fbb5da35b845fb494ac438f50754a822aa74163f3be752346422c2ed @@ -0,0 +1 @@ +"immense salute used boring arrest nature awesome injury detect random wait meat" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/entrypoint.sh b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/entrypoint.sh index e595e1edbc..6f051c4a06 100644 --- a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/entrypoint.sh @@ -24,6 +24,8 @@ export MC__FIRST_EPOCH_TIMESTAMP_MILLIS=$(cat /shared/MC__FIRST_EPOCH_TIMESTAMP_ --unsafe-rpc-external \ --rpc-port=9934 \ --rpc-cors=all \ + -lbeefy=trace \ + --rpc-methods=unsafe \ --prometheus-port=9616 \ --prometheus-external \ --state-pruning=archive \ diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.skey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.skey new file mode 100644 index 0000000000..00a3f50a64 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.skey @@ -0,0 +1 @@ +62656c742068757274206d6174657269616c2073757276657920736b6174652067726f757020696c6c6e657373206865616c746820656c6563747269632066726f776e206c6976652073776f7264 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.vkey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.vkey new file mode 100644 index 0000000000..c47b254766 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keys/beefy.vkey @@ -0,0 +1 @@ +ba3155d64939d1f7efdcbd2d8d4e4c204c94a57037e3bf4fcf4eca1d7075e841 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keystore/62656566ba3155d64939d1f7efdcbd2d8d4e4c204c94a57037e3bf4fcf4eca1d7075e841 b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keystore/62656566ba3155d64939d1f7efdcbd2d8d4e4c204c94a57037e3bf4fcf4eca1d7075e841 new file mode 100644 index 0000000000..deb667dad1 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-2/keystore/62656566ba3155d64939d1f7efdcbd2d8d4e4c204c94a57037e3bf4fcf4eca1d7075e841 @@ -0,0 +1 @@ +"belt hurt material survey skate group illness health electric frown live sword" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/entrypoint.sh b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/entrypoint.sh index 457b7b0a44..a45bc1f10b 100644 --- a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/entrypoint.sh @@ -24,6 +24,7 @@ export MC__FIRST_EPOCH_TIMESTAMP_MILLIS=$(cat /shared/MC__FIRST_EPOCH_TIMESTAMP_ --unsafe-rpc-external \ --rpc-port=9935 \ --rpc-cors=all \ + -lbeefy=trace \ --prometheus-port=9617 \ --prometheus-external \ --state-pruning=archive \ diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.skey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.skey new file mode 100644 index 0000000000..dace8f5b46 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.skey @@ -0,0 +1 @@ +e385eabeb4f4241533128b4f5932089420ca57a399cbd7a45a68adcad6712e435969f742d41c31a5984aa49144e82eb7eb5f8c1a32ea9811f611328c22248b84 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.vkey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.vkey new file mode 100644 index 0000000000..35177b320c --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-3/keys/beefy.vkey @@ -0,0 +1 @@ +001184176befe8deb509fb85d8a627153d52890743832f6e3730b9fe8ad00e87 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/entrypoint.sh b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/entrypoint.sh index 6a97cc01aa..a2d1915fe2 100644 --- a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/entrypoint.sh @@ -24,6 +24,7 @@ export MC__FIRST_EPOCH_TIMESTAMP_MILLIS=$(cat /shared/MC__FIRST_EPOCH_TIMESTAMP_ --unsafe-rpc-external \ --rpc-port=9936 \ --rpc-cors=all \ + -lbeefy=trace \ --prometheus-port=9618 \ --prometheus-external \ --state-pruning=archive \ diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.skey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.skey new file mode 100644 index 0000000000..262846c23e --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.skey @@ -0,0 +1 @@ +5888d33257763f8fd700ad43cb1e44ca619e861000e873d4411dcb004cd5ecb6b98a0eff32e741925a96a53178789f374d371805ae4bbbef279f407820105c6c \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.vkey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.vkey new file mode 100644 index 0000000000..83c5b975fe --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keys/beefy.vkey @@ -0,0 +1 @@ +513f0ee171f0b2ac4146a430b01dfff34950e449a537ad2abe0b94dd34edf969 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keystore/62656566039799ff93d184146deacaa455dade51b13ed16f23cdad11d1ad6af20103391180 b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keystore/62656566039799ff93d184146deacaa455dade51b13ed16f23cdad11d1ad6af20103391180 new file mode 100644 index 0000000000..83ba8240b9 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-4/keystore/62656566039799ff93d184146deacaa455dade51b13ed16f23cdad11d1ad6af20103391180 @@ -0,0 +1 @@ +"volume wire damp response scene tape truck easily enjoy shaft face message" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/entrypoint.sh b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/entrypoint.sh index e15d9c54cc..68b9774056 100644 --- a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/entrypoint.sh @@ -24,6 +24,7 @@ export MC__FIRST_EPOCH_TIMESTAMP_MILLIS=$(cat /shared/MC__FIRST_EPOCH_TIMESTAMP_ --unsafe-rpc-external \ --rpc-port=9937 \ --rpc-cors=all \ + -lbeefy=trace \ --prometheus-port=9619 \ --prometheus-external \ --state-pruning=archive \ diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.skey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.skey new file mode 100644 index 0000000000..d861620899 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.skey @@ -0,0 +1 @@ +5c5c39e4143b54239233bbdd793689fae781a4ab0a3da4ad37afcf742655f6ac5dc0917322128e5d7371e62d32a29f65600cf81bbea6bfadd0e8694bf37f697a \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.vkey b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.vkey new file mode 100644 index 0000000000..7895d97006 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keys/beefy.vkey @@ -0,0 +1 @@ +4af8e7fcb9ae85b35d5ded720951a16ff3e0c3ef627d66c9ad4b8681e6b41306 \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keystore/626565660364b1f01f6e803be10abc6dd6fe08ced61cf3eaaef2dbdc72b4e774c4b6a564af b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keystore/626565660364b1f01f6e803be10abc6dd6fe08ced61cf3eaaef2dbdc72b4e774c4b6a564af new file mode 100644 index 0000000000..88ecf2a3f2 --- /dev/null +++ b/dev/local-environment/configurations/partner-chains-nodes/partner-chains-node-5/keystore/626565660364b1f01f6e803be10abc6dd6fe08ced61cf3eaaef2dbdc72b4e774c4b6a564af @@ -0,0 +1 @@ +"victory horse scatter empty silly live royal differ friend nurse poverty benefit" \ No newline at end of file diff --git a/dev/local-environment/configurations/partner-chains-setup/entrypoint.sh b/dev/local-environment/configurations/partner-chains-setup/entrypoint.sh index f491c2605b..7c09a6f1b0 100644 --- a/dev/local-environment/configurations/partner-chains-setup/entrypoint.sh +++ b/dev/local-environment/configurations/partner-chains-setup/entrypoint.sh @@ -72,7 +72,7 @@ echo "Inserting D parameter..." --ogmios-url http://ogmios:$OGMIOS_PORT \ --genesis-utxo $GENESIS_UTXO \ --permissioned-candidates-count 3 \ - --registered-candidates-count 2 \ + --registered-candidates-count 0 \ --payment-key-file /keys/funded_address.skey if [ $? -eq 0 ]; then @@ -87,15 +87,17 @@ echo "Inserting permissioned candidates for 'node-1' and 'node-2'..." node1_sidechain_vkey=$(cat /partner-chains-nodes/partner-chains-node-1/keys/sidechain.vkey) node1_aura_vkey=$(cat /partner-chains-nodes/partner-chains-node-1/keys/aura.vkey) +node1_beefy_vkey=$(cat /partner-chains-nodes/partner-chains-node-1/keys/beefy.vkey) node1_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-1/keys/grandpa.vkey) node2_sidechain_vkey=$(cat /partner-chains-nodes/partner-chains-node-2/keys/sidechain.vkey) node2_aura_vkey=$(cat /partner-chains-nodes/partner-chains-node-2/keys/aura.vkey) +node2_beefy_vkey=$(cat /partner-chains-nodes/partner-chains-node-2/keys/beefy.vkey) node2_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-2/keys/grandpa.vkey) cat < permissioned_candidates.csv -$node1_sidechain_vkey:$node1_aura_vkey:$node1_grandpa_vkey -$node2_sidechain_vkey:$node2_aura_vkey:$node2_grandpa_vkey +$node1_sidechain_vkey:$node1_aura_vkey:$node1_beefy_vkey:$node1_grandpa_vkey +$node2_sidechain_vkey:$node2_aura_vkey:$node2_beefy_vkey:$node2_grandpa_vkey EOF ./partner-chains-node smart-contracts upsert-permissioned-candidates \ @@ -131,6 +133,7 @@ node4_spo_signature=$(echo "$node4_output" | jq -r ".spo_signature") node4_sidechain_public_key=$(echo "$node4_output" | jq -r ".sidechain_public_key") node4_sidechain_signature=$(echo "$node4_output" | jq -r ".sidechain_signature") node4_aura_vkey=$(cat /partner-chains-nodes/partner-chains-node-4/keys/aura.vkey) +node4_beefy_vkey=$(cat /partner-chains-nodes/partner-chains-node-4/keys/beefy.vkey) node4_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-4/keys/grandpa.vkey) # Register 'node-4' @@ -139,7 +142,7 @@ node4_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-4/keys/grandp --genesis-utxo $GENESIS_UTXO \ --spo-public-key $node4_spo_public_key \ --spo-signature $node4_spo_signature \ - --sidechain-public-keys $node4_sidechain_public_key:$node4_aura_vkey:$node4_grandpa_vkey \ + --sidechain-public-keys $node4_sidechain_public_key:$node4_aura_vkey:$node4_beefy_vkey:$node4_grandpa_vkey \ --sidechain-signature $node4_sidechain_signature \ --registration-utxo $node4_utxo \ --payment-key-file /partner-chains-nodes/partner-chains-node-4/keys/payment.skey @@ -179,7 +182,7 @@ node5_grandpa_vkey=$(cat /partner-chains-nodes/partner-chains-node-5/keys/grandp --genesis-utxo $GENESIS_UTXO \ --spo-public-key $node5_spo_public_key \ --spo-signature $node5_spo_signature \ - --sidechain-public-keys $node5_sidechain_public_key:$node5_aura_vkey:$node5_grandpa_vkey \ + --sidechain-public-keys $node5_sidechain_public_key:$node5_aura_vkey:$node5_beefy_vkey:$node5_grandpa_vkey \ --sidechain-signature $node5_sidechain_signature \ --registration-utxo $node5_utxo \ --payment-key-file /partner-chains-nodes/partner-chains-node-5/keys/payment.skey @@ -200,6 +203,7 @@ jq '.genesis.runtimeGenesis.config.session.initialValidators = [ "5FnXTMg8UnfeGsMaGg24o3NY21VRFRDRdgxuLGmXuYLeZmin", { "aura": "5Cyx94iyji8namhRxvs4mAbURtPsvwjWCb68ZihNzfRysGLZ", + "beefy": "5GwnKZf8scBkkpi6CBzHvP4TZTJ7R4M7wC7r8bBQvXS8xDDp", "grandpa": "5Cc5eQhbPw4CjwZpWqZkWWumMiuZywfWRK2Rh9guXUJ3U89s" } ], @@ -207,6 +211,7 @@ jq '.genesis.runtimeGenesis.config.session.initialValidators = [ "5FJMH4MeZgd4fpiiAVLnr4uRop2EDFgzAFcvLmcduQ2cofCi", { "aura": "5E4op92Z2Di1GoVS9KqnoGVKQXG2R9x1vdh3RW892YLFsLrc", + "beefy": "5GGqRGz2xEU1KHm1eJKDaJ9fx6yPkVdrPZTy6XpP6sT7mTvW", "grandpa": "5Ha53RXoJjXtcTThFA5XNW7H6f5L39HnTuVSXimxAyhoYLeL" } ] @@ -219,6 +224,7 @@ jq '.genesis.runtimeGenesis.config.sessionCommitteeManagement.initialAuthorities "id": "KW4wALva83fvah66ufXSxg6r84tTpJmDXna8A1PCYdbZdVL95", "keys": { "aura": "5Cyx94iyji8namhRxvs4mAbURtPsvwjWCb68ZihNzfRysGLZ", + "beefy": "5GwnKZf8scBkkpi6CBzHvP4TZTJ7R4M7wC7r8bBQvXS8xDDp", "grandpa": "5Cc5eQhbPw4CjwZpWqZkWWumMiuZywfWRK2Rh9guXUJ3U89s" } } @@ -228,6 +234,7 @@ jq '.genesis.runtimeGenesis.config.sessionCommitteeManagement.initialAuthorities "id": "KW92jBDRydnbyojCVF3USNFgEsrEvDGV3gvdgDvpfnbXvC13q", "keys": { "aura": "5E4op92Z2Di1GoVS9KqnoGVKQXG2R9x1vdh3RW892YLFsLrc", + "beefy": "5GGqRGz2xEU1KHm1eJKDaJ9fx6yPkVdrPZTy6XpP6sT7mTvW", "grandpa": "5Ha53RXoJjXtcTThFA5XNW7H6f5L39HnTuVSXimxAyhoYLeL" } } diff --git a/dev/local-environment/configurations/permissioned_candidates.csv b/dev/local-environment/configurations/permissioned_candidates.csv new file mode 100644 index 0000000000..e45bd67943 --- /dev/null +++ b/dev/local-environment/configurations/permissioned_candidates.csv @@ -0,0 +1,2 @@ +0258dc1e341e42ba85b393804c1e8a531485ec3b73b2d5cd2b0bf56cbcaf102a7e:289c161586d774dda981fdb184d061a28e04bdf81322c545b9c37549e7412f2f:d6c531b35a2a88fdcd2c087a03dba939b428939970a1e490886cefd6e77676de:17edf4615819dbe1de4ed887ba0b438190923e14e25de9c6ff25320abcfe7d29 +030e0bcd9e16d770ade1fb5a5a50f2da012f1ea53713a9ba8aed5f009bc451404d:588c84949c703058577df51caaf82ca81cb1df43928600763a0050d16d2c210f:13474c3356308b2662513b638f0d64ccff8b5e80394c4f9a5794649cc8539331:f39299bb0a1d6fab19b4990edaf435edb70f5755983bf63fce3ecd13a6be8ea5 diff --git a/dev/local-environment/setup.sh b/dev/local-environment/setup.sh index f165b058fe..282a23232a 100755 --- a/dev/local-environment/setup.sh +++ b/dev/local-environment/setup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -PARTNER_CHAINS_NODE_IMAGE="ghcr.io/input-output-hk/partner-chains/partner-chains-node-unstable:latest" +PARTNER_CHAINS_NODE_IMAGE="partner-chains-node:latest" CARDANO_IMAGE="ghcr.io/intersectmbo/cardano-node:10.1.4" DBSYNC_IMAGE="ghcr.io/intersectmbo/cardano-db-sync:13.6.0.4" OGMIOS_IMAGE="cardanosolutions/ogmios:v6.11.0" diff --git a/dev/nix/nixos/default.nix b/dev/nix/nixos/default.nix new file mode 100644 index 0000000000..a3bd251517 --- /dev/null +++ b/dev/nix/nixos/default.nix @@ -0,0 +1,3 @@ +{ + imports = import ./module-list.nix; +} diff --git a/dev/nix/nixos/module-list.nix b/dev/nix/nixos/module-list.nix new file mode 100644 index 0000000000..48e75ab4be --- /dev/null +++ b/dev/nix/nixos/module-list.nix @@ -0,0 +1,4 @@ + +[ + ./partner-chains-service.nix +] diff --git a/dev/nix/nixos/partner-chains-service.nix b/dev/nix/nixos/partner-chains-service.nix new file mode 100644 index 0000000000..ee65fc38c2 --- /dev/null +++ b/dev/nix/nixos/partner-chains-service.nix @@ -0,0 +1,257 @@ +# Partner Chains Node NixOS module +{self, ...}: +{ + flake.nixosModules.partner-chains = + { config, lib, pkgs, ... }: + + with lib; + + let + cfg = config.services.partner-chains; + in { + options.services.partner-chains = { + enable = mkEnableOption "Partner Chains Node"; + + # Common environment variables + environment = mkOption { + type = types.attrsOf types.str; + default = { + CARDANO_SECURITY_PARAMETER = "432"; + CARDANO_ACTIVE_SLOTS_COEFF = "0.05"; + DB_SYNC_POSTGRES_CONNECTION_STRING = "postgresql://cexplorer:password@localhost:5432/cexplorer"; + MC__FIRST_EPOCH_TIMESTAMP_MILLIS = "1666656000000"; + MC__EPOCH_DURATION_MILLIS = "86400000"; + MC__SLOT_DURATION_MILLIS = "1000"; + MC__FIRST_EPOCH_NUMBER = "0"; + MC__FIRST_SLOT_NUMBER = "0"; + BLOCK_STABILITY_MARGIN = "0"; + }; + description = "Environment variables for the partner chains node"; + }; + + # Node-specific options + nodeName = mkOption { + type = types.nullOr types.str; + default = null; + example = "alice"; + description = "Node name flag (--alice, --bob, --charlie, etc.)"; + }; + + nodeKey = mkOption { + type = types.str; + example = "0a04cb23cff606facb13ddd43655840e9f6f32bd7b432809620d461596e188e9"; + description = "Node key for identification"; + }; + + chainSpecPath = mkOption { + type = types.path; + default = "/var/lib/partner-chains/chain-spec.json"; + description = "Path to the chain specification file"; + }; + + keystorePath = mkOption { + type = types.path; + default = "/var/lib/partner-chains/keystore"; + description = "Path to the keystore directory"; + }; + + listenAddr = mkOption { + type = types.str; + default = "/ip4/0.0.0.0/tcp/30333"; + description = "Address to listen on"; + }; + + prometheusPort = mkOption { + type = types.int; + default = 9615; + description = "Prometheus metrics port"; + }; + + rpcPort = mkOption { + type = types.int; + default = 9944; + description = "RPC server port"; + }; + + logLevel = mkOption { + type = types.str; + default = "runtime=debug"; + description = "Log level configuration"; + }; + + reservedNodes = mkOption { + type = types.listOf types.str; + default = []; + example = ["/dns/dave.node.sc.iog.io/tcp/30333/p2p/12D3KooWH4LhgJDUbYbXsksQef4jTpDjA64ecUBjBVJprNzF64hE"]; + description = "List of reserved nodes"; + }; + + bootNodes = mkOption { + type = types.listOf types.str; + default = []; + example = ["/dns/eve.node.sc.iog.io/tcp/30333/p2p/12D3KooWN3YiYbk9nMZJ2VG7uk9iKfFWb1Kwrj7PoMdadfnAsRJm"]; + description = "List of boot nodes"; + }; + + extraArgs = mkOption { + type = types.listOf types.str; + default = []; + example = ["--rpc-methods=unsafe" "--rpc-max-connections" "1000"]; + description = "Additional command line arguments"; + }; + + enableRpc = mkOption { + type = types.bool; + default = false; + description = "Enable RPC server"; + }; + + rpcCors = mkOption { + type = types.str; + default = "all"; + description = "RPC CORS setting"; + }; + + blockBeneficiary = mkOption { + type = types.str; + example = "0a04cb23cff606facb13ddd43655840e9f6f32bd7b432809620d461596e188e9"; + description = "Sidechain block beneficiary address"; + }; + + package = mkOption { + type = types.package; + default = pkgs.partner-chains.packages.x86_64-linux.partner-chains; + description = "The partner-chains package to use"; + }; + + # New options + enableValidator = mkOption { + type = types.bool; + default = false; + description = "Enable validator mode"; + }; + + pruning = mkOption { + type = types.enum [ "default" "archive" ]; + default = "default"; + description = "Pruning mode for the blockchain data"; + }; + }; + + config = mkIf cfg.enable { + systemd.services.partner-chains = { + description = "Partner Chains Node"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + + # Combine the default environment with any overrides + environment = cfg.environment // { + SIDECHAIN_BLOCK_BENEFICIARY = cfg.blockBeneficiary; + }; + + preStart = '' + # Ensure directories exist + mkdir -p ${dirOf cfg.chainSpecPath} + mkdir -p ${cfg.keystorePath} + + # Create a default chain spec if it doesn't exist + if [ ! -f "${cfg.chainSpecPath}" ]; then + echo "Chain spec file does not exist at ${cfg.chainSpecPath}" + echo "Creating a minimal placeholder. Please ensure a proper chain spec is configured." + echo '{"name": "partner-chains", "id": "partner-chains"}' > ${cfg.chainSpecPath} + fi + + # Set proper permissions + chown -R partner-chains:partner-chains ${dirOf cfg.chainSpecPath} + chown -R partner-chains:partner-chains ${cfg.keystorePath} + chmod 750 ${dirOf cfg.chainSpecPath} + chmod 750 ${cfg.keystorePath} + chmod 640 ${cfg.chainSpecPath} + + # Create data directories with proper permissions + DATA_DIR=$(dirname ${cfg.keystorePath}) + if [ ! -d "$DATA_DIR" ]; then + mkdir -p $DATA_DIR + chown -R partner-chains:partner-chains $DATA_DIR + chmod -R 750 $DATA_DIR + fi + ''; + + serviceConfig = let + # Node name flag (--alice, --bob, etc.) + nodeNameFlag = if cfg.nodeName != null then "--${cfg.nodeName}" else ""; + + # Reserved nodes flags + reservedNodesFlags = if cfg.reservedNodes != [] + then ["--reserved-only"] ++ (flatten (map (node: ["--reserved-nodes" node]) cfg.reservedNodes)) + else []; + + # Boot nodes flags + bootNodesFlags = flatten (map (node: ["--bootnodes" node]) cfg.bootNodes); + + # RPC flags + rpcFlags = if cfg.enableRpc + then ["--rpc-external" "--rpc-cors=${cfg.rpcCors}" "--rpc-port" (toString cfg.rpcPort)] + else []; + + # Pruning flags + pruningFlags = if cfg.pruning == "archive" + then ["--state-pruning" "archive" "--blocks-pruning" "archive"] + else []; + + # Combine all arguments + allArgs = + [nodeNameFlag] + ++ (optional cfg.enableValidator "--validator") + ++ ["--node-key" cfg.nodeKey] + ++ ["--chain" cfg.chainSpecPath] + ++ reservedNodesFlags + ++ bootNodesFlags + ++ ["-llibp2p=debug"] + ++ ["--listen-addr" cfg.listenAddr] + ++ ["--keystore-path" cfg.keystorePath] + ++ ["--log" cfg.logLevel] + ++ ["--prometheus-port" (toString cfg.prometheusPort)] + ++ ["--prometheus-external"] + ++ rpcFlags + ++ pruningFlags + ++ cfg.extraArgs; + + # Filter out empty strings (from nodeNameFlag if it's empty) + cleanArgs = filter (arg: arg != "") allArgs; + in { + ExecStart = "${cfg.package}/bin/partner-chains-node ${concatStringsSep " " cleanArgs}"; + + # Important! Create a StateDirectory for persistent storage + StateDirectory = "partner-chains"; + + # This ensures systemd captures all stdout/stderr + StandardOutput = "journal"; + StandardError = "journal"; + + # Security hardening + User = "partner-chains"; + Group = "partner-chains"; + Restart = "always"; + RestartSec = "10s"; + LimitNOFILE = 65535; + }; + }; + + # Create the user/group + users.users.partner-chains = { + isSystemUser = true; + group = "partner-chains"; + home = "/var/lib/partner-chains"; + createHome = true; + }; + users.groups.partner-chains = {}; + + # Open firewall ports + networking.firewall.allowedTCPPorts = [ + 30333 # P2P port + cfg.prometheusPort + ] ++ (optionals cfg.enableRpc [ cfg.rpcPort ]); + }; + }; +} \ No newline at end of file diff --git a/dev/nix/packages/default.nix b/dev/nix/packages/default.nix new file mode 100644 index 0000000000..e054a2eff8 --- /dev/null +++ b/dev/nix/packages/default.nix @@ -0,0 +1,113 @@ +{ + self, + inputs, + system, + ... +}: { + perSystem = { + inputs', + self', + lib, + pkgs, + system, + ... + }: let + flake-compat = import inputs.flake-compat; + cardanoPackages = (flake-compat { src = inputs.cardano-node; }).defaultNix.packages.${system}; + dbSyncPackages = (flake-compat { src = inputs.cardano-dbsync; }).defaultNix.packages.${system}; + fenixPkgs = inputs'.fenix.packages; + rustToolchain = with fenixPkgs; + fromToolchainFile { + file = ../../../rust-toolchain.toml; + sha256 = "X/4ZBHO3iW0fOenQ3foEvscgAPJYl2abspaBThDOukI="; + }; + customRustPlatform = pkgs.makeRustPlatform { + cargo = rustToolchain; + rustc = rustToolchain; + }; + + in { + packages = { + inherit (cardanoPackages) cardano-node cardano-cli cardano-testnet; + inherit (dbSyncPackages) "cardano-db-sync:exe:cardano-db-sync"; + ogmios = pkgs.callPackage ./ogmios.nix { }; + process-compose = pkgs.process-compose.overrideAttrs (oldAttrs: { + patches = [ ./pc.patch ]; + }); + partnerchains-stack = pkgs.callPackage ./partnerchains-stack { inherit (self'.packages) partnerchains-stack-unwrapped; }; + partnerchains-stack-unwrapped = pkgs.callPackage ./partnerchains-stack-unwrapped { }; + partner-chains = customRustPlatform.buildRustPackage rec { + pname = "partner-chains"; + version = "1.6"; + src = ../../../.; + preBuild = '' + export SUBSTRATE_CLI_GIT_COMMIT_HASH=${self.dirtyShortRev or self.shortRev} + ''; + + useFetchCargoVendor = true; + cargoHash = "sha256-y0sHdHicouV3rRw2i17kfFXKQJlFcu0rtsKXs2SNVX0="; + buildType = "production"; + #buildAndTestSubdir = dir; + doCheck = false; + patches = []; + + nativeBuildInputs = [ + pkgs.pkg-config + pkgs.protobuf + + pkgs.llvmPackages.lld + customRustPlatform.bindgenHook + ]; + buildInputs = [ + pkgs.rocksdb + pkgs.openssl + pkgs.libclang.lib + ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + pkgs.rust-jemalloc-sys-unprefixed + ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ + pkgs.darwin.apple_sdk.frameworks.SystemConfiguration + pkgs.darwin.apple_sdk.frameworks.Security + ]; + + postFixup = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux '' + patchelf --set-rpath "${pkgs.rocksdb}/lib:${pkgs.stdenv.cc.cc.lib}/lib" $out/bin/partner-chains-demo-node + ''; + + # Force skip support check in CC crate + #CRATE_CC_NO_DEFAULTS = "1"; + + # Platform-specific features + RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin + "--cfg unwinding_backport --cfg unwinding_apple"; + + # Existing environment variables + CC_ENABLE_DEBUG_OUTPUT = "1"; + #CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "${pkgs.llvmPackages.lld}/bin/lld"; + #RUST_SRC_PATH = "${customRustPlatform.rustLibSrc}"; + LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + rustToolchain + pkgs.stdenv.cc.cc + pkgs.libz + pkgs.clang + ]; + + # Platform-specific flags + CFLAGS = + if pkgs.lib.hasSuffix "linux" system then + "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" + else + ""; + + PROTOC = "${pkgs.protobuf}/bin/protoc"; + ROCKSDB_LIB_DIR = "${pkgs.rocksdb}/lib/"; + OPENSSL_NO_VENDOR = 1; + OPENSSL_DIR = "${pkgs.openssl.dev}"; + OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; + OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; + BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.stdenv.cc.cc}/include -std=c++17"; + + }; + }; + }; +} diff --git a/dev/nix/shell.nix b/dev/nix/shell.nix new file mode 100644 index 0000000000..e703075d3a --- /dev/null +++ b/dev/nix/shell.nix @@ -0,0 +1,123 @@ +{ self, inputs, ... }: +{ + perSystem = + { + inputs', + self', + pkgs, + system, + ... + }: + let + isLinux = pkgs.lib.hasSuffix "linux" system; + isDarwin = pkgs.lib.hasSuffix "darwin" system; + fenixPkgs = inputs'.fenix.packages; + + rustToolchain = fenixPkgs.fromToolchainFile { + file = ../../rust-toolchain.toml; + sha256 = "X/4ZBHO3iW0fOenQ3foEvscgAPJYl2abspaBThDOukI="; + }; + + nightlyToolchain = + (fenixPkgs.toolchainOf { + channel = "nightly"; + date = "2025-04-27"; + sha256 = "sha256-DnyK5MS+xYySA+csnnMogu2gtEfyiy10W0ATmAvmjGg="; + }).withComponents + [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]; + + gen-cargo-docs = pkgs.writeScriptBin "gen-cargo-docs" '' + export PATH=${nightlyToolchain}/bin:$PATH + export RUST_SRC_PATH="${nightlyToolchain}/lib/rustlib/src/rust/library"; + export LD_LIBRARY_PATH=${ + pkgs.lib.makeLibraryPath [ + nightlyToolchain + pkgs.stdenv.cc.cc + pkgs.libz + ] + } + cargo --version + rustc --version + RUSTDOCFLAGS="--enable-index-page -Zunstable-options" SKIP_WASM_BUILD=1 ${nightlyToolchain}/bin/cargo doc --no-deps + ''; + + in + { + devShells = { + default = pkgs.mkShell { + # envs needed for rust toochain + RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library"; + LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + rustToolchain + pkgs.stdenv.cc.cc + pkgs.libz + ]; + # https://github.com/NixOS/nixpkgs/issues/370494#issuecomment-2625163369 + CFLAGS = if isLinux then "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else ""; + + # envs needed in order to construct some of the rust crates + ROCKSDB_LIB_DIR = "${pkgs.rocksdb}/lib/"; + OPENSSL_NO_VENDOR = 1; + OPENSSL_DIR = "${pkgs.openssl.dev}"; + OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; + OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; + + # Force skip support check of c++17 in CC crate +# CRATE_CC_NO_DEFAULTS = "1"; + + packages = + with pkgs; + [ + bashInteractive + + # core tooling to share across linux/macos + coreutils + pkg-config + protobuf + libiconv + openssl + gnumake + + # tools for e2e testing + docker-compose + python312 + python312Packages.pip + python312Packages.virtualenv + sops + + # local development tools + rustToolchain + gawk + cargo-edit + cargo-license + nixfmt-rfc-style + gen-cargo-docs + + # infra packages + earthly + awscli2 + kubectl + + # our local packages + self'.packages.cardano-cli + ] + ++ (if isDarwin then [ pkgs.darwin.apple_sdk.frameworks.SystemConfiguration ] else [ pkgs.clang ]); + }; + process-compose = pkgs.mkShell { + inputsFrom = [ self'.devShells.default ]; + packages = [ self'.packages.partnerchains-stack ]; + shellHook = '' + echo "Partner Chains dependency stack devshell"; + echo "useage: -n to specify networks." + ''; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index 47194011ee..59ad6e1616 100644 --- a/flake.nix +++ b/flake.nix @@ -43,8 +43,84 @@ isLinux = pkgs.stdenv.isLinux; isDarwin = pkgs.stdenv.isDarwin; + customRustPlatform = pkgs.makeRustPlatform { + cargo = rustToolchain; + rustc = rustToolchain; + }; in { + packages.partner-chains = customRustPlatform.buildRustPackage rec { + pname = "partner-chains"; + version = "1.7"; + src = ./.; + # preBuild = '' + # export SUBSTRATE_CLI_GIT_COMMIT_HASH=${dirtyShortRev or shortRev} + # ''; + + useFetchCargoVendor = true; + cargoHash = "sha256-k1GYY0eB/fRmAuWYlxLCGaAgJW89KLOiyiLBO2wtsZM="; + buildType = "production"; + #buildAndTestSubdir = dir; + doCheck = false; + patches = []; + + nativeBuildInputs = [ + pkgs.pkg-config + pkgs.protobuf + + pkgs.llvmPackages.lld + customRustPlatform.bindgenHook + ]; + buildInputs = [ + pkgs.rocksdb + pkgs.openssl + pkgs.libclang.lib + ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + pkgs.rust-jemalloc-sys-unprefixed + ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ + pkgs.darwin.apple_sdk.frameworks.SystemConfiguration + pkgs.darwin.apple_sdk.frameworks.Security + ]; + + postFixup = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isLinux '' + patchelf --set-rpath "${pkgs.rocksdb}/lib:${pkgs.stdenv.cc.cc.lib}/lib" $out/bin/partner-chains-demo-node + ''; + + # Force skip support check in CC crate + #CRATE_CC_NO_DEFAULTS = "1"; + + # Platform-specific features + RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin + "--cfg unwinding_backport --cfg unwinding_apple"; + + # Existing environment variables + CC_ENABLE_DEBUG_OUTPUT = "1"; + #CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "${pkgs.llvmPackages.lld}/bin/lld"; + #RUST_SRC_PATH = "${customRustPlatform.rustLibSrc}"; + LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + rustToolchain + pkgs.stdenv.cc.cc + pkgs.libz + pkgs.clang + ]; + + # Platform-specific flags + CFLAGS = + if pkgs.lib.hasSuffix "linux" system then + "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" + else + ""; + + PROTOC = "${pkgs.protobuf}/bin/protoc"; + ROCKSDB_LIB_DIR = "${pkgs.rocksdb}/lib/"; + OPENSSL_NO_VENDOR = 1; + OPENSSL_DIR = "${pkgs.openssl.dev}"; + OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; + OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; + BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.stdenv.cc.cc}/include -std=c++17"; + + }; devShells.default = pkgs.mkShell { packages = with pkgs; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b11c082ac5..16b2cd699c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -10,5 +10,5 @@ components = [ "rustc", "rustfmt", ] -targets = ["wasm32-unknown-unknown"] +targets = ["wasm32v1-none"] profile = "minimal" diff --git a/substrate-extensions/partner-chains-session/src/pallet_session_compat.rs b/substrate-extensions/partner-chains-session/src/pallet_session_compat.rs index bf1a306d38..1e340b9118 100644 --- a/substrate-extensions/partner-chains-session/src/pallet_session_compat.rs +++ b/substrate-extensions/partner-chains-session/src/pallet_session_compat.rs @@ -22,6 +22,16 @@ impl pallet_session::SessionManager for PalletSessionStubImpls { fn start_session(_: SessionIndex) {} } +impl pallet_session::historical::SessionManager for PalletSessionStubImpls { + fn new_session(_: SessionIndex) -> Option> { + None + } + + fn end_session(_: SessionIndex) {} + + fn start_session(_: SessionIndex) {} +} + impl sp_runtime::traits::Convert> for PalletSessionStubImpls { fn convert(t: T) -> Option { Some(t) @@ -44,12 +54,16 @@ macro_rules! impl_pallet_session_config { type ShouldEndSession = pallet_partner_chains_session::pallet_session_compat::PalletSessionStubImpls; type NextSessionRotation = (); - type SessionManager = - pallet_partner_chains_session::pallet_session_compat::PalletSessionStubImpls; + type SessionManager = pallet_session::historical::NoteHistoricalRoot< + Self, + pallet_partner_chains_session::pallet_session_compat::PalletSessionStubImpls, + >; type SessionHandler = <$type as pallet_partner_chains_session::Config>::SessionHandler; type Keys = <$type as pallet_partner_chains_session::Config>::Keys; type DisablingStrategy = (); type WeightInfo = (); + type Currency = Balances; + type KeyDeposit = (); } }; } diff --git a/toolkit/committee-selection/authority-selection-inherents/Cargo.toml b/toolkit/committee-selection/authority-selection-inherents/Cargo.toml index 367547f163..36697bdf08 100644 --- a/toolkit/committee-selection/authority-selection-inherents/Cargo.toml +++ b/toolkit/committee-selection/authority-selection-inherents/Cargo.toml @@ -34,6 +34,8 @@ thiserror = { workspace = true, optional = true } serde = { workspace = true } sp-consensus-slots = { workspace = true } +schnorr_jubjub = {workspace = true} + [dev-dependencies] hex = { workspace = true } hex-literal = { workspace = true } diff --git a/toolkit/committee-selection/authority-selection-inherents/src/authority_selection_inputs.rs b/toolkit/committee-selection/authority-selection-inherents/src/authority_selection_inputs.rs index 7217c266bc..37091e9c84 100644 --- a/toolkit/committee-selection/authority-selection-inherents/src/authority_selection_inputs.rs +++ b/toolkit/committee-selection/authority-selection-inherents/src/authority_selection_inputs.rs @@ -55,6 +55,8 @@ pub struct RawPermissionedCandidateData { pub sidechain_public_key: SidechainPublicKey, /// Unvalidated Aura public key of permissioned candidate pub aura_public_key: AuraPublicKey, + /// Unvalidated Beefy public key of permissioned candidate + pub beefy_public_key: BeefyPublicKey, /// Unvalidated Grandpa public key of permissioned candidate pub grandpa_public_key: GrandpaPublicKey, } @@ -151,6 +153,7 @@ impl AuthoritySelectionInputs { .map(|candidate| PermissionedCandidateData { sidechain_public_key: candidate.sidechain_public_key, aura_public_key: candidate.aura_public_key, + beefy_public_key: candidate.beefy_public_key, grandpa_public_key: candidate.grandpa_public_key, }) .collect::>(), diff --git a/toolkit/committee-selection/authority-selection-inherents/src/filter_invalid_candidates.rs b/toolkit/committee-selection/authority-selection-inherents/src/filter_invalid_candidates.rs index ba226c440e..e70435cb37 100644 --- a/toolkit/committee-selection/authority-selection-inherents/src/filter_invalid_candidates.rs +++ b/toolkit/committee-selection/authority-selection-inherents/src/filter_invalid_candidates.rs @@ -5,6 +5,7 @@ use frame_support::pallet_prelude::TypeInfo; use parity_scale_codec::{Decode, Encode}; use plutus::*; use plutus_datum_derive::ToDatum; +// use schnorr_jubjub; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sidechain_domain::*; @@ -106,7 +107,7 @@ pub fn filter_trustless_candidates_registrations( genesis_utxo: UtxoId, ) -> Vec<(Candidate, selection::Weight)> where - TAccountKeys: From<(sr25519::Public, ed25519::Public)>, + TAccountKeys: From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)>, TAccountId: From, { candidate_registrations @@ -125,15 +126,15 @@ pub fn filter_invalid_permissioned_candidates( permissioned_candidates: Vec, ) -> Vec> where - TAccountKeys: From<(sr25519::Public, ed25519::Public)>, + TAccountKeys: From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)>, TAccountId: TryFrom, { permissioned_candidates .into_iter() .filter_map(|candidate| { - let (account_id, aura_key, grandpa_key) = + let (account_id, aura_key, beefy_key, grandpa_key) = validate_permissioned_candidate_data(candidate).ok()?; - let account_keys = (aura_key, grandpa_key).into(); + let account_keys = (aura_key, beefy_key, grandpa_key).into(); Some(Candidate::Permissioned(PermissionedCandidate { account_id, account_keys })) }) .collect() @@ -145,7 +146,7 @@ fn select_latest_valid_candidate( ) -> Option> where TAccountId: From, - TAccountKeys: From<(sr25519::Public, ed25519::Public)>, + TAccountKeys: From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)>, { let stake_delegation = validate_stake(candidate_registrations.stake_delegation).ok()?; let stake_pool_pub_key = candidate_registrations.stake_pool_public_key; @@ -210,6 +211,9 @@ pub enum RegistrationDataError { /// Registration with invalid Aura key #[cfg_attr(feature = "std", error("Registration with invalid Aura key"))] InvalidAuraKey, + /// Registration with invalid BEEFY key + #[cfg_attr(feature = "std", error("Registration with invalid Beefy key"))] + InvalidBeefyKey, /// Registration with invalid GRANDPA key #[cfg_attr(feature = "std", error("Registration with invalid GRANDPA key"))] InvalidGrandpaKey, @@ -225,15 +229,21 @@ pub enum PermissionedCandidateDataError { /// Permissioned candidate with invalid Aura key #[cfg_attr(feature = "std", error("Permissioned candidate with invalid Aura key"))] InvalidAuraKey, + /// Permissioned candidate with invalid BEEFY key + #[cfg_attr(feature = "std", error("Permissioned candidate with invalid BEEFY key"))] + InvalidBeefyKey, /// Permissioned candidate with invalid GRANDPA key #[cfg_attr(feature = "std", error("Permissioned candidate with invalid GRANDPA key"))] InvalidGrandpaKey, } -/// Validates Aura, GRANDPA, and Partner Chain public keys of [PermissionedCandidateData]. +/// Validates Aura, BEEFY, GRANDPA, and Partner Chain public keys of [PermissionedCandidateData]. pub fn validate_permissioned_candidate_data>( candidate: PermissionedCandidateData, -) -> Result<(AccountId, sr25519::Public, ed25519::Public), PermissionedCandidateDataError> { +) -> Result< + (AccountId, sr25519::Public, schnorr_jubjub::Public, ed25519::Public), + PermissionedCandidateDataError, +> { Ok(( candidate .sidechain_public_key @@ -243,6 +253,10 @@ pub fn validate_permissioned_candidate_data Result<(ecdsa::Public, (sr25519::Public, ed25519::Public)), RegistrationDataError> { +) -> Result< + (ecdsa::Public, (sr25519::Public, schnorr_jubjub::Public, ed25519::Public)), + RegistrationDataError, +> { let aura_pub_key = registration_data .aura_pub_key .try_into_sr25519() .ok_or(RegistrationDataError::InvalidAuraKey)?; + let beefy_pub_key = registration_data + .beefy_pub_key + .try_into_schnorr() + .ok_or(RegistrationDataError::InvalidBeefyKey)?; let grandpa_pub_key = registration_data .grandpa_pub_key .try_into_ed25519() @@ -292,7 +313,7 @@ pub fn validate_registration_data( )?; verify_tx_inputs(registration_data)?; - Ok((sidechain_pub_key, (aura_pub_key, grandpa_pub_key))) + Ok((sidechain_pub_key, (aura_pub_key, beefy_pub_key, grandpa_pub_key))) } /// Validates stake delegation. Stake must be known and positive. diff --git a/toolkit/committee-selection/authority-selection-inherents/src/select_authorities.rs b/toolkit/committee-selection/authority-selection-inherents/src/select_authorities.rs index fd5a511573..81ad9d8fdd 100644 --- a/toolkit/committee-selection/authority-selection-inherents/src/select_authorities.rs +++ b/toolkit/committee-selection/authority-selection-inherents/src/select_authorities.rs @@ -6,6 +6,7 @@ use crate::filter_invalid_candidates::{ }; use log::{info, warn}; use plutus::*; +use schnorr_jubjub; use sidechain_domain::{EpochNonce, ScEpochNumber, UtxoId}; use sp_core::{U256, ecdsa, ed25519, sr25519}; @@ -13,7 +14,7 @@ use sp_core::{U256, ecdsa, ed25519, sr25519}; /// Seed is constructed from the MC epoch nonce and the sidechain epoch. pub fn select_authorities< TAccountId: Clone + Ord + TryFrom + From, - TAccountKeys: Clone + Ord + From<(sr25519::Public, ed25519::Public)>, + TAccountKeys: Clone + Ord + From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)>, >( genesis_utxo: UtxoId, input: AuthoritySelectionInputs, diff --git a/toolkit/committee-selection/query/src/lib.rs b/toolkit/committee-selection/query/src/lib.rs index b57460cd7a..2e618896e7 100644 --- a/toolkit/committee-selection/query/src/lib.rs +++ b/toolkit/committee-selection/query/src/lib.rs @@ -241,6 +241,7 @@ where sidechain_domain::PermissionedCandidateData { sidechain_public_key: candidate.sidechain_public_key.clone(), aura_public_key: candidate.aura_public_key.clone(), + beefy_public_key: candidate.beefy_public_key.clone(), grandpa_public_key: candidate.grandpa_public_key.clone(), }, ) diff --git a/toolkit/data-sources/db-sync/src/candidates/datum.rs b/toolkit/data-sources/db-sync/src/candidates/datum.rs index 5276f21edc..a2f2aee456 100644 --- a/toolkit/data-sources/db-sync/src/candidates/datum.rs +++ b/toolkit/data-sources/db-sync/src/candidates/datum.rs @@ -6,9 +6,18 @@ use sidechain_domain::*; pub(crate) fn raw_permissioned_candidate_data_from( datum: PermissionedCandidateDatumV0, ) -> RawPermissionedCandidateData { - let PermissionedCandidateDatumV0 { sidechain_public_key, aura_public_key, grandpa_public_key } = - datum; - RawPermissionedCandidateData { sidechain_public_key, aura_public_key, grandpa_public_key } + let PermissionedCandidateDatumV0 { + sidechain_public_key, + aura_public_key, + beefy_public_key, + grandpa_public_key, + } = datum; + RawPermissionedCandidateData { + sidechain_public_key, + aura_public_key, + beefy_public_key, + grandpa_public_key, + } } pub(crate) fn raw_permissioned_candidate_data_vec_from( diff --git a/toolkit/data-sources/db-sync/src/candidates/mod.rs b/toolkit/data-sources/db-sync/src/candidates/mod.rs index 2ad3b6c4c6..343447f3ed 100644 --- a/toolkit/data-sources/db-sync/src/candidates/mod.rs +++ b/toolkit/data-sources/db-sync/src/candidates/mod.rs @@ -42,6 +42,7 @@ struct RegisteredCandidate { sidechain_pub_key: SidechainPublicKey, cross_chain_pub_key: CrossChainPublicKey, aura_pub_key: AuraPublicKey, + beefy_pub_key: BeefyPublicKey, grandpa_pub_key: GrandpaPublicKey, utxo_info: UtxoInfo, } @@ -181,6 +182,7 @@ impl CandidatesDataSourceImpl { sidechain_pub_key: c.sidechain_pub_key, cross_chain_pub_key: c.cross_chain_pub_key, aura_pub_key: c.aura_pub_key, + beefy_pub_key: c.beefy_pub_key, grandpa_pub_key: c.grandpa_pub_key, utxo_info: c.utxo_info, tx_inputs: c.tx_inputs, @@ -227,6 +229,7 @@ impl CandidatesDataSourceImpl { registration_utxo, own_pkh: _own_pkh, aura_pub_key, + beefy_pub_key, grandpa_pub_key, } = c.datum; Ok(RegisteredCandidate { @@ -238,6 +241,7 @@ impl CandidatesDataSourceImpl { sidechain_signature, sidechain_pub_key, aura_pub_key, + beefy_pub_key, grandpa_pub_key, registration_utxo, tx_inputs: c.tx_inputs, diff --git a/toolkit/data-sources/mock/Cargo.toml b/toolkit/data-sources/mock/Cargo.toml index 362157a132..b6a859d598 100644 --- a/toolkit/data-sources/mock/Cargo.toml +++ b/toolkit/data-sources/mock/Cargo.toml @@ -30,6 +30,8 @@ sp-block-participation = { workspace = true, optional = true } pallet-sidechain-rpc = { workspace = true, optional = true } authority-selection-inherents = { workspace = true, optional = true } +schnorr_jubjub = { workspace = true } + [features] default = ["std", "block-source", "candidate-source", "governed-map", "native-token"] std = [ diff --git a/toolkit/data-sources/mock/src/candidate.rs b/toolkit/data-sources/mock/src/candidate.rs index 50f0f2ad51..b2b0b731c0 100644 --- a/toolkit/data-sources/mock/src/candidate.rs +++ b/toolkit/data-sources/mock/src/candidate.rs @@ -17,6 +17,7 @@ pub struct MockRegistration { pub registration_utxo: UtxoId, pub status: MockRegistrationStatus, pub aura_pub_key: ByteString, + pub beefy_pub_key: ByteString, pub grandpa_pub_key: ByteString, } @@ -67,6 +68,7 @@ impl From for CandidateRegistrations { }, tx_inputs: vec![mock.registration_utxo], aura_pub_key: AuraPublicKey(mock.aura_pub_key.0), + beefy_pub_key: BeefyPublicKey(mock.beefy_pub_key.0), grandpa_pub_key: GrandpaPublicKey(mock.grandpa_pub_key.0), }]; let stake_delegation = Some(StakeDelegation(333)); @@ -86,6 +88,7 @@ pub struct MockPermissionedCandidate { name: Option, sidechain_pub_key: ByteString, aura_pub_key: ByteString, + beefy_pub_key: ByteString, grandpa_pub_key: ByteString, } @@ -105,12 +108,14 @@ impl From for RawPermissionedCandidateData { name: _, sidechain_pub_key, aura_pub_key, + beefy_pub_key, grandpa_pub_key, }: MockPermissionedCandidate, ) -> Self { Self { sidechain_public_key: SidechainPublicKey(sidechain_pub_key.0), aura_public_key: AuraPublicKey(aura_pub_key.0), + beefy_public_key: BeefyPublicKey(beefy_pub_key.0), grandpa_public_key: GrandpaPublicKey(grandpa_pub_key.0), } } diff --git a/toolkit/partner-chains-cli/Cargo.toml b/toolkit/partner-chains-cli/Cargo.toml index a0be9c002e..7a26e74a15 100644 --- a/toolkit/partner-chains-cli/Cargo.toml +++ b/toolkit/partner-chains-cli/Cargo.toml @@ -40,6 +40,7 @@ plutus-datum-derive = { workspace = true } ed25519-zebra = { workspace = true } sp-session-validator-management = { workspace = true, features = ["std"] } pallet-session-validator-management = { workspace = true, features = ["std"] } +schnorr_jubjub = { workspace = true } [dev-dependencies] pretty_assertions = { workspace = true } diff --git a/toolkit/partner-chains-cli/src/generate_keys/mod.rs b/toolkit/partner-chains-cli/src/generate_keys/mod.rs index 4a12a43182..382241974d 100644 --- a/toolkit/partner-chains-cli/src/generate_keys/mod.rs +++ b/toolkit/partner-chains-cli/src/generate_keys/mod.rs @@ -105,6 +105,8 @@ pub(crate) fn generate_spo_keys( if prompt_can_write("keys file", KEYS_FILE_PATH, context) { let cross_chain_key = generate_or_load_key(config, context, &CROSS_CHAIN)?; context.enewline(); + let beefy_key = generate_or_load_key(config, context, &BEEFY)?; + context.enewline(); let grandpa_key = generate_or_load_key(config, context, &GRANDPA)?; context.enewline(); let aura_key = generate_or_load_key(config, context, &AURA)?; @@ -113,6 +115,7 @@ pub(crate) fn generate_spo_keys( let public_keys_json = serde_json::to_string_pretty(&PermissionedCandidateKeys { sidechain_pub_key: cross_chain_key, aura_pub_key: aura_key, + beefy_pub_key: beefy_key, grandpa_pub_key: grandpa_key, }) .expect("Failed to serialize public keys"); diff --git a/toolkit/partner-chains-cli/src/keystore.rs b/toolkit/partner-chains-cli/src/keystore.rs index aeb0166c4e..98f2723642 100644 --- a/toolkit/partner-chains-cli/src/keystore.rs +++ b/toolkit/partner-chains-cli/src/keystore.rs @@ -12,6 +12,8 @@ impl<'a> KeyDefinition<'a> { pub const AURA: KeyDefinition<'static> = KeyDefinition { name: "Aura", scheme: "sr25519", key_type: "aura" }; +pub const BEEFY: KeyDefinition<'static> = + KeyDefinition { name: "Beefy", scheme: "ecdsa", key_type: "beef" }; pub const GRANDPA: KeyDefinition<'static> = KeyDefinition { name: "Grandpa", scheme: "ed25519", key_type: "gran" }; pub const CROSS_CHAIN: KeyDefinition<'static> = diff --git a/toolkit/partner-chains-cli/src/permissioned_candidates.rs b/toolkit/partner-chains-cli/src/permissioned_candidates.rs index 641b3675e3..1c19263369 100644 --- a/toolkit/partner-chains-cli/src/permissioned_candidates.rs +++ b/toolkit/partner-chains-cli/src/permissioned_candidates.rs @@ -10,7 +10,7 @@ use partner_chains_cardano_offchain::permissioned_candidates::{ }; use serde::{Deserialize, Serialize}; use sidechain_domain::{PermissionedCandidateData, UtxoId}; -use sp_core::crypto::AccountId32; +use sp_core::crypto::{AccountId32, PublicBytes}; use sp_core::{ecdsa, ed25519, sr25519}; use sp_runtime::traits::IdentifyAccount; use std::fmt::{Display, Formatter}; @@ -23,6 +23,8 @@ pub(crate) struct PermissionedCandidateKeys { pub sidechain_pub_key: String, /// 0x prefixed hex representation of the sr25519 public key pub aura_pub_key: String, + /// 0x prefixed hex representation of the ECDSA public key + pub beefy_pub_key: String, /// 0x prefixed hex representation of the Ed25519 public key pub grandpa_pub_key: String, } @@ -31,8 +33,8 @@ impl Display for PermissionedCandidateKeys { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!( f, - "Partner Chains Key: {}, AURA: {}, GRANDPA: {}", - self.sidechain_pub_key, self.aura_pub_key, self.grandpa_pub_key + "Partner Chains Key: {}, AURA: {}, BEEFY: {}, GRANDPA: {}", + self.sidechain_pub_key, self.aura_pub_key, self.beefy_pub_key, self.grandpa_pub_key ) } } @@ -42,6 +44,7 @@ impl From<&sidechain_domain::PermissionedCandidateData> for PermissionedCandidat Self { sidechain_pub_key: sp_core::bytes::to_hex(&value.sidechain_public_key.0, false), aura_pub_key: sp_core::bytes::to_hex(&value.aura_public_key.0, false), + beefy_pub_key: sp_core::bytes::to_hex(&value.beefy_public_key.0, false), grandpa_pub_key: sp_core::bytes::to_hex(&value.grandpa_public_key.0, false), } } @@ -51,14 +54,21 @@ impl From<&sidechain_domain::PermissionedCandidateData> for PermissionedCandidat pub(crate) struct ParsedPermissionedCandidatesKeys { pub sidechain: ecdsa::Public, pub aura: sr25519::Public, + pub beefy: schnorr_jubjub::Public, pub grandpa: ed25519::Public, } impl ParsedPermissionedCandidatesKeys { - pub fn session_keys>( + pub fn session_keys< + SessionKeys: From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)>, + >( &self, ) -> SessionKeys { - SessionKeys::from((sr25519::Public::from(self.aura), ed25519::Public::from(self.grandpa))) + SessionKeys::from(( + sr25519::Public::from(self.aura), + schnorr_jubjub::Public::from(self.beefy.clone()), + ed25519::Public::from(self.grandpa), + )) } pub fn account_id_32(&self) -> AccountId32 { @@ -77,11 +87,15 @@ impl TryFrom<&PermissionedCandidateKeys> for ParsedPermissionedCandidatesKeys { "{} is invalid sr25519 public key", value.aura_pub_key )))?; + let beefy = parse_jubjub(&value.beefy_pub_key).ok_or(anyhow::Error::msg(format!( + "{} is invalid beefy public key", + value.beefy_pub_key + )))?; let grandpa = parse_ed25519(&value.grandpa_pub_key).ok_or(anyhow::Error::msg(format!( "{} is invalid Ed25519 public key", value.grandpa_pub_key )))?; - Ok(Self { sidechain, aura, grandpa }) + Ok(Self { sidechain, aura, beefy, grandpa }) } } @@ -90,6 +104,7 @@ impl From<&ParsedPermissionedCandidatesKeys> for sidechain_domain::PermissionedC Self { sidechain_public_key: sidechain_domain::SidechainPublicKey(value.sidechain.0.to_vec()), aura_public_key: sidechain_domain::AuraPublicKey(value.aura.0.to_vec()), + beefy_public_key: sidechain_domain::BeefyPublicKey(value.beefy.0.to_vec()), grandpa_public_key: sidechain_domain::GrandpaPublicKey(value.grandpa.0.to_vec()), } } @@ -105,6 +120,11 @@ fn parse_sr25519(value: &str) -> Option { Some(sr25519::Public::from(<[u8; 32]>::try_from(bytes).ok()?)) } +fn parse_jubjub(value: &str) -> Option { + let bytes = sp_core::bytes::from_hex(value).ok()?; + Some(schnorr_jubjub::Public(PublicBytes::from(<[u8; 32]>::try_from(bytes).ok()?))) +} + fn parse_ed25519(value: &str) -> Option { let bytes = sp_core::bytes::from_hex(value).ok()?; Some(ed25519::Public::from(<[u8; 32]>::try_from(bytes).ok()?)) diff --git a/toolkit/partner-chains-cli/src/register/register1.rs b/toolkit/partner-chains-cli/src/register/register1.rs index 6b93caf038..ce9646bd90 100644 --- a/toolkit/partner-chains-cli/src/register/register1.rs +++ b/toolkit/partner-chains-cli/src/register/register1.rs @@ -29,7 +29,7 @@ impl CmdRun for Register1Cmd { "⚠️ Keystore not found. Please run the `generate-keys` command first" ))?; - let GeneratedKeysFileContent { sidechain_pub_key, aura_pub_key, grandpa_pub_key } = + let GeneratedKeysFileContent { sidechain_pub_key, aura_pub_key, grandpa_pub_key, beefy_pub_key } = read_generated_keys(context).map_err(|e| { context.eprint("⚠️ The keys file `partner-chains-cli-keys.json` is missing or invalid. Please run the `generate-keys` command first"); anyhow!(e) @@ -84,7 +84,7 @@ impl CmdRun for Register1Cmd { let executable = context.current_executable()?; context.print("Run the following command to generate signatures on the next step. It has to be executed on the machine with your SPO cold signing key."); context.print(""); - context.print(&format!("{executable} wizards register2 \\\n --genesis-utxo {genesis_utxo} \\\n --registration-utxo {registration_utxo} \\\n --aura-pub-key {aura_pub_key} \\\n --grandpa-pub-key {grandpa_pub_key} \\\n --sidechain-pub-key {sidechain_pub_key} \\\n --sidechain-signature {sidechain_signature}")); + context.print(&format!("{executable} wizards register2 \\\n --genesis-utxo {genesis_utxo} \\\n --registration-utxo {registration_utxo} \\\n --aura-pub-key {aura_pub_key} \\\n --beefy-pub-key {beefy_pub_key} --grandpa-pub-key {grandpa_pub_key} \\\n --sidechain-pub-key {sidechain_pub_key} \\\n --sidechain-signature {sidechain_signature}")); Ok(()) } @@ -120,6 +120,7 @@ pub struct GeneratedKeysFileContent { pub sidechain_pub_key: String, pub aura_pub_key: String, pub grandpa_pub_key: String, + pub beefy_pub_key: String, } pub fn read_generated_keys(context: &C) -> anyhow::Result { diff --git a/toolkit/partner-chains-cli/src/register/register3.rs b/toolkit/partner-chains-cli/src/register/register3.rs index 8b6ec2261b..06243b5a98 100644 --- a/toolkit/partner-chains-cli/src/register/register3.rs +++ b/toolkit/partner-chains-cli/src/register/register3.rs @@ -26,6 +26,8 @@ pub struct Register3Cmd { #[arg(long)] pub aura_pub_key: AuraPublicKey, #[arg(long)] + pub beefy_pub_key: BeefyPublicKey, + #[arg(long)] pub grandpa_pub_key: GrandpaPublicKey, #[arg(long)] pub partner_chain_signature: SidechainSignature, @@ -65,6 +67,7 @@ impl CmdRun for Register3Cmd { own_pkh: payment_signing_key.to_pub_key_hash(), registration_utxo: self.registration_utxo, aura_pub_key: self.aura_pub_key.clone(), + beefy_pub_key: self.beefy_pub_key.clone(), grandpa_pub_key: self.grandpa_pub_key.clone(), }; let offchain = context.offchain_impl(&ogmios_configuration)?; diff --git a/toolkit/partner-chains-cli/src/runtime_bindings.rs b/toolkit/partner-chains-cli/src/runtime_bindings.rs index 39cf2b528d..b7f6a7f3fe 100644 --- a/toolkit/partner-chains-cli/src/runtime_bindings.rs +++ b/toolkit/partner-chains-cli/src/runtime_bindings.rs @@ -12,7 +12,11 @@ pub trait PartnerChainRuntime { /// Partner Chain authority id type type AuthorityId: Send + Sync + 'static + From; /// Partner Chain authority key type - type AuthorityKeys: Send + Sync + 'static + From<(sr25519::Public, ed25519::Public)> + Serialize; + type AuthorityKeys: Send + + Sync + + 'static + + From<(sr25519::Public, schnorr_jubjub::Public, ed25519::Public)> + + Serialize; /// Partner Chain committee member type type CommitteeMember: Serialize; diff --git a/toolkit/partner-chains-cli/src/setup_main_chain_state/mod.rs b/toolkit/partner-chains-cli/src/setup_main_chain_state/mod.rs index 34625c7e2d..43a8e7d12b 100644 --- a/toolkit/partner-chains-cli/src/setup_main_chain_state/mod.rs +++ b/toolkit/partner-chains-cli/src/setup_main_chain_state/mod.rs @@ -37,6 +37,7 @@ impl TryFrom for ParsedPermissionedCandidatesKeys { let keys = PermissionedCandidateKeys { sidechain_pub_key: hex::encode(value.sidechain_public_key.0), aura_pub_key: hex::encode(value.aura_public_key.0), + beefy_pub_key: hex::encode(value.beefy_public_key.0), grandpa_pub_key: hex::encode(value.grandpa_public_key.0), }; TryFrom::try_from(&keys) diff --git a/toolkit/sidechain/domain/Cargo.toml b/toolkit/sidechain/domain/Cargo.toml index 45297bc648..bd0a26cbab 100644 --- a/toolkit/sidechain/domain/Cargo.toml +++ b/toolkit/sidechain/domain/Cargo.toml @@ -35,6 +35,8 @@ ed25519-zebra = { workspace = true, optional = true } k256 = { workspace = true } derive-where = { workspace = true } +schnorr_jubjub = { workspace = true } + [dev-dependencies] serde_json = { workspace = true } hex-literal = { workspace = true } @@ -55,5 +57,6 @@ std = [ "secp256k1/global-context", "ed25519-zebra", "ed25519-zebra/std", + "schnorr_jubjub/std", ] serde = ["dep:serde", "scale-info/serde", "sp-core/serde"] diff --git a/toolkit/sidechain/domain/src/lib.rs b/toolkit/sidechain/domain/src/lib.rs index 9e461c3b2c..74f02d17b7 100644 --- a/toolkit/sidechain/domain/src/lib.rs +++ b/toolkit/sidechain/domain/src/lib.rs @@ -36,6 +36,8 @@ use { serde::{Deserialize, Deserializer, Serialize, Serializer}, }; +// use schnorr_jubjub; + /// The number of main chain epochs back a Partner Chain queries for committee selection inputs. /// This offset is necessary to ensure that data is present and stable. const DATA_MC_EPOCH_OFFSET: u32 = 2; @@ -983,6 +985,8 @@ pub struct RegistrationData { pub tx_inputs: Vec, /// Registering SPO's Aura public key pub aura_pub_key: AuraPublicKey, + /// Registering SPO's Beefy public key + pub beefy_pub_key: BeefyPublicKey, /// Registering SPO's Grandpa public key pub grandpa_pub_key: GrandpaPublicKey, } @@ -1039,6 +1043,25 @@ impl From for AuraPublicKey { } } +/// ECDSA public key used by the BEEFY finality gadget. Not validated +#[derive( + Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, TypeInfo, PartialOrd, Ord, Hash, +)] +#[byte_string(debug, hex_serialize, hex_deserialize, decode_hex)] +pub struct BeefyPublicKey(pub Vec); +impl BeefyPublicKey { + /// Attempts to cast this public key to a valid [ecdsa::Public] + pub fn try_into_schnorr(&self) -> Option { + Some(schnorr_jubjub::Public::try_from(self.0.as_slice()).ok()?) + } +} + +impl From for GrandpaPublicKey { + fn from(value: ecdsa::Public) -> Self { + Self(value.0.to_vec()) + } +} + /// Ed25519 public key used by the Grandpa finality gadget. Not validated #[derive( Clone, PartialEq, Eq, Encode, Decode, DecodeWithMemTracking, TypeInfo, PartialOrd, Ord, Hash, @@ -1115,6 +1138,8 @@ pub struct PermissionedCandidateData { pub sidechain_public_key: SidechainPublicKey, /// Aura public key of the trustless candidate pub aura_public_key: AuraPublicKey, + /// BEEFY public key of the trustless candidate + pub beefy_public_key: BeefyPublicKey, /// Grandpa public key of the trustless candidate pub grandpa_public_key: GrandpaPublicKey, } @@ -1134,6 +1159,8 @@ pub struct CandidateRegistration { pub registration_utxo: UtxoId, /// Registering SPO's Aura public key pub aura_pub_key: AuraPublicKey, + /// Registering SPO's Beefy public key + pub beefy_pub_key: BeefyPublicKey, /// Registering SPO's Grandpa public key pub grandpa_pub_key: GrandpaPublicKey, } @@ -1145,6 +1172,7 @@ impl CandidateRegistration { && self.partner_chain_pub_key == other.partner_chain_pub_key && self.partner_chain_signature == other.partner_chain_signature && self.aura_pub_key == other.aura_pub_key + && self.beefy_pub_key == other.beefy_pub_key && self.grandpa_pub_key == other.grandpa_pub_key } } diff --git a/toolkit/smart-contracts/commands/src/lib.rs b/toolkit/smart-contracts/commands/src/lib.rs index ea838cac64..ae52f45931 100644 --- a/toolkit/smart-contracts/commands/src/lib.rs +++ b/toolkit/smart-contracts/commands/src/lib.rs @@ -181,17 +181,18 @@ impl From for UtxoId { } } -// Parses public keys in formatted as SIDECHAIN_KEY:AURA_KEY:GRANDPA_KEY +// Parses public keys in formatted as SIDECHAIN_KEY:AURA_KEY:BEEFY_KEY:GRANDPA_KEY pub(crate) fn parse_partnerchain_public_keys( partner_chain_public_keys: &str, ) -> CmdResult { let partner_chain_public_keys = partner_chain_public_keys.replace("0x", ""); - if let [sidechain_pub_key, aura_pub_key, grandpa_pub_key] = + if let [sidechain_pub_key, aura_pub_key, beefy_pub_key, grandpa_pub_key] = partner_chain_public_keys.split(":").collect::>()[..] { Ok(PermissionedCandidateData { sidechain_public_key: SidechainPublicKey(hex::decode(sidechain_pub_key)?), aura_public_key: AuraPublicKey(hex::decode(aura_pub_key)?), + beefy_public_key: BeefyPublicKey(hex::decode(beefy_pub_key)?), grandpa_public_key: GrandpaPublicKey(hex::decode(grandpa_pub_key)?), }) } else { diff --git a/toolkit/smart-contracts/commands/src/register.rs b/toolkit/smart-contracts/commands/src/register.rs index f1b3bf1098..69d5dae142 100644 --- a/toolkit/smart-contracts/commands/src/register.rs +++ b/toolkit/smart-contracts/commands/src/register.rs @@ -56,6 +56,7 @@ impl RegisterCmd { own_pkh: payment_key.to_pub_key_hash(), registration_utxo: self.registration_utxo, aura_pub_key: self.partner_chain_public_keys.aura_public_key, + beefy_pub_key: self.partner_chain_public_keys.beefy_public_key, grandpa_pub_key: self.partner_chain_public_keys.grandpa_public_key, }; diff --git a/toolkit/smart-contracts/plutus-data/Cargo.toml b/toolkit/smart-contracts/plutus-data/Cargo.toml index ce0fd6969c..b61290c8d2 100644 --- a/toolkit/smart-contracts/plutus-data/Cargo.toml +++ b/toolkit/smart-contracts/plutus-data/Cargo.toml @@ -18,6 +18,8 @@ sidechain-domain = { workspace = true, features = ["std"] } cardano-serialization-lib = { workspace = true } thiserror = { workspace = true } +schnorr_jubjub = { workspace = true } + [dev-dependencies] raw-scripts = { workspace = true } serde_json = { workspace = true } diff --git a/toolkit/smart-contracts/plutus-data/src/permissioned_candidates.rs b/toolkit/smart-contracts/plutus-data/src/permissioned_candidates.rs index 6b57a116dd..de413defa6 100644 --- a/toolkit/smart-contracts/plutus-data/src/permissioned_candidates.rs +++ b/toolkit/smart-contracts/plutus-data/src/permissioned_candidates.rs @@ -21,6 +21,8 @@ pub struct PermissionedCandidateDatumV0 { pub sidechain_public_key: SidechainPublicKey, /// Aura public key of the trustless candidate pub aura_public_key: AuraPublicKey, + /// BEEFY public key of the trustless candidate + pub beefy_public_key: BeefyPublicKey, /// GRANDPA public key of the trustless candidate pub grandpa_public_key: GrandpaPublicKey, } @@ -37,6 +39,7 @@ impl From for PermissionedCandidateData { Self { sidechain_public_key: value.sidechain_public_key, aura_public_key: value.aura_public_key, + beefy_public_key: value.beefy_public_key, grandpa_public_key: value.grandpa_public_key, } } @@ -59,11 +62,13 @@ impl From for Vec { /// [ /// [ candidates[0].sidechain_public_key /// , candidates[0].aura_public_key +/// , candidates[0].beefy_public_key /// , candidates[0].grandpa_public_key /// ] /// , /// [ candidates[1].sidechain_public_key /// , candidates[1].aura_public_key +/// , candidates[1].beefy_public_key /// , candidates[1].grandpa_public_key /// ] /// // etc. @@ -77,6 +82,7 @@ pub fn permissioned_candidates_to_plutus_data( let mut candidate_datum = PlutusList::new(); candidate_datum.add(&PlutusData::new_bytes(candidate.sidechain_public_key.0.clone())); candidate_datum.add(&PlutusData::new_bytes(candidate.aura_public_key.0.clone())); + candidate_datum.add(&PlutusData::new_bytes(candidate.beefy_public_key.0.clone())); candidate_datum.add(&PlutusData::new_bytes(candidate.grandpa_public_key.0.clone())); list.add(&PlutusData::new_list(&candidate_datum)); } @@ -102,7 +108,7 @@ impl VersionedDatumWithLegacy for PermissionedCandidateDatums { .map(decode_legacy_candidate_datum) .collect::>>() }) - .ok_or("Expected [[ByteString, ByteString, ByteString]]")?; + .ok_or("Expected [[ByteString, ByteString, ByteString, ByteString]]")?; Ok(Self::V0(permissioned_candidates)) } @@ -121,15 +127,17 @@ impl VersionedDatumWithLegacy for PermissionedCandidateDatums { } fn decode_legacy_candidate_datum(datum: &PlutusData) -> Option { - let datums = datum.as_list().filter(|datums| datums.len() == 3)?; + let datums = datum.as_list().filter(|datums| datums.len() == 4)?; let sc = datums.get(0).as_bytes()?; let aura = datums.get(1).as_bytes()?; - let grandpa = datums.get(2).as_bytes()?; + let beefy = datums.get(2).as_bytes()?; + let grandpa = datums.get(3).as_bytes()?; Some(PermissionedCandidateDatumV0 { sidechain_public_key: SidechainPublicKey(sc), aura_public_key: AuraPublicKey(aura), + beefy_public_key: BeefyPublicKey(beefy), grandpa_public_key: GrandpaPublicKey(grandpa), }) } diff --git a/toolkit/smart-contracts/plutus-data/src/registered_candidates.rs b/toolkit/smart-contracts/plutus-data/src/registered_candidates.rs index 889daaaa38..6a95a2b57b 100644 --- a/toolkit/smart-contracts/plutus-data/src/registered_candidates.rs +++ b/toolkit/smart-contracts/plutus-data/src/registered_candidates.rs @@ -53,6 +53,8 @@ pub enum RegisterValidatorDatum { own_pkh: MainchainKeyHash, /// Registering SPO's Aura public key aura_pub_key: AuraPublicKey, + /// Registering SPO's Beefy public key + beefy_pub_key: BeefyPublicKey, /// Registering SPO's GRANDPA public key grandpa_pub_key: GrandpaPublicKey, }, @@ -97,6 +99,7 @@ pub fn candidate_registration_to_plutus_data( registration_utxo: candidate_registration.registration_utxo, own_pkh: candidate_registration.own_pkh, aura_pub_key: candidate_registration.aura_pub_key.clone(), + beefy_pub_key: candidate_registration.beefy_pub_key.clone(), grandpa_pub_key: candidate_registration.grandpa_pub_key.clone(), } .into() @@ -112,6 +115,7 @@ impl From for CandidateRegistration { registration_utxo, own_pkh, aura_pub_key, + beefy_pub_key, grandpa_pub_key, } => CandidateRegistration { stake_ownership, @@ -120,6 +124,7 @@ impl From for CandidateRegistration { registration_utxo, own_pkh, aura_pub_key, + beefy_pub_key, grandpa_pub_key, }, } @@ -133,14 +138,15 @@ fn decode_v0_register_validator_datum( let fields = appendix .as_constr_plutus_data() .filter(|datum| datum.alternative().is_zero()) - .filter(|datum| datum.data().len() >= 6)? + .filter(|datum| datum.data().len() >= 7)? .data(); let stake_ownership = decode_ada_based_staking_datum(fields.get(0))?; let sidechain_pub_key = fields.get(1).as_bytes().map(SidechainPublicKey)?; let sidechain_signature = fields.get(2).as_bytes().map(SidechainSignature)?; let registration_utxo = decode_utxo_id_datum(fields.get(3))?; let aura_pub_key = fields.get(4).as_bytes().map(AuraPublicKey)?; - let grandpa_pub_key = fields.get(5).as_bytes().map(GrandpaPublicKey)?; + let beefy_pub_key = fields.get(5).as_bytes().map(BeefyPublicKey)?; + let grandpa_pub_key = fields.get(6).as_bytes().map(GrandpaPublicKey)?; let own_pkh = MainchainKeyHash(datum.as_bytes()?.try_into().ok()?); Some(RegisterValidatorDatum::V0 { @@ -150,6 +156,7 @@ fn decode_v0_register_validator_datum( registration_utxo, own_pkh, aura_pub_key, + beefy_pub_key, grandpa_pub_key, }) } @@ -159,7 +166,7 @@ fn decode_legacy_register_validator_datum(datum: &PlutusData) -> Option= 7)? + .filter(|datum| datum.data().len() >= 8)? .data(); let stake_ownership = decode_ada_based_staking_datum(fields.get(0))?; let sidechain_pub_key = fields.get(1).as_bytes().map(SidechainPublicKey)?; @@ -167,7 +174,8 @@ fn decode_legacy_register_validator_datum(datum: &PlutusData) -> Option Option for PlutusData { registration_utxo, own_pkh, aura_pub_key, + beefy_pub_key, grandpa_pub_key, } => { let mut appendix_fields = PlutusList::new(); @@ -228,6 +238,7 @@ impl From for PlutusData { appendix_fields.add(&PlutusData::new_bytes(sidechain_signature.0)); appendix_fields.add(&utxo_id_to_plutus_data(registration_utxo)); appendix_fields.add(&PlutusData::new_bytes(aura_pub_key.0)); + appendix_fields.add(&PlutusData::new_bytes(beefy_pub_key.0)); appendix_fields.add(&PlutusData::new_bytes(grandpa_pub_key.0)); let appendix = ConstrPlutusData::new(&BigNum::zero(), &appendix_fields); VersionedGenericDatum { diff --git a/toolkit/utils/schnorr_jubjub/Cargo.toml b/toolkit/utils/schnorr_jubjub/Cargo.toml new file mode 100644 index 0000000000..8ac7c554ad --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/Cargo.toml @@ -0,0 +1,80 @@ +[package] +name = "schnorr_jubjub" +license = "Apache-2.0" +description = "Implementation of schnorr over JubJub using poseidon." +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +version.workspace = true + +[dependencies] +frame-support = { workspace = true } +pallet-beefy-mmr = { workspace = true } +parity-scale-codec = { workspace = true } +rand_core = { workspace = true } +scale-info = {workspace = true} +sc-keystore = { workspace = true, optional = true } +sp-core = { workspace = true, features = ["serde"] } +sp-application-crypto = { workspace = true } +sp-consensus-beefy = { workspace = true } +sp-crypto-hashing = { workspace = true } +sp-runtime = { workspace = true } +sp-runtime-interface = { workspace = true } +sp-io = { workspace = true } +sp-keystore = { workspace = true } +sp-externalities = { workspace = true } +sha2 = { workspace = true } +serde = {workspace = true } +hex = {workspace = true } +hash256-std-hasher = { workspace = true } +sp-trie = { workspace = true } +rand = { version = "0.8.5", default-features = false } +rand_chacha = { version = "0.3.1", default-features = false } +#rand = { workspace = true } +#rand_chacha = { workspace = true } +ark-ed-on-bls12-381 = { workspace = true } +ark-ff = { workspace = true } +ark-ec = { workspace = true } +ark-serialize = { workspace = true } +num-bigint = { workspace = true } + + +[features] +default = ["std", "full_crypto"] +full_crypto = [ + "sp-application-crypto/full_crypto", + "sp-core/full_crypto" +] +std = [ + "ark-ed-on-bls12-381/std", + "ark-ff/std", + "ark-ec/std", + "ark-serialize/std", + "frame-support/std", + "num-bigint/std", + "pallet-beefy-mmr/std", + "parity-scale-codec/std", + "rand_core/std", + "scale-info/std", + "sp-core/std", + "sp-application-crypto/std", + "sp-consensus-beefy/std", + "sp-crypto-hashing/std", + "sp-runtime/std", + "sp-runtime-interface/std", + "sp-io/std", + "sp-keystore/std", + "sp-externalities/std", + "sha2/std", + "serde/std", + "hex/std", + "hash256-std-hasher/std", + "sp-trie/std", + "rand/std", + "rand_chacha/std", + "sc-keystore", +] + +[lints] +workspace = true diff --git a/toolkit/utils/schnorr_jubjub/src/beefy_structures.rs b/toolkit/utils/schnorr_jubjub/src/beefy_structures.rs new file mode 100644 index 0000000000..459a7b4da9 --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/beefy_structures.rs @@ -0,0 +1,366 @@ +//! Implements traits and supporting structures to enable the use of Schnorr +//! signatures over JubJub in BEEFY. +//! +//! This module provides the necessary abstractions and integrations for +//! leveraging JubJub-based Schnorr signatures within the BEEFY consensus +//! protocol, ensuring compatibility with Substrate's runtime and cryptographic +//! infrastructure. + +use alloc::{format, string::String, vec::Vec}; +use core::fmt::{Debug, Display, Formatter}; + +use crate::alloc::string::ToString; +use crate::poseidon::PoseidonJubjub; +use ark_ec::AffineRepr; +use ark_ed_on_bls12_381::{EdwardsAffine, Fr}; +use ark_ff::fields::Field; +use ark_serialize::CanonicalSerialize; +use core::str::FromStr; +use num_bigint::BigUint; +use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; +use sha2::Digest; +use sp_consensus_beefy::{AuthorityIdBound, BeefyAuthorityId}; +use sp_core::crypto::key_types::BEEFY; +use sp_core::{ + ByteArray, Decode, DecodeWithMemTracking, DeriveJunction, Encode, MaxEncodedLen, + Pair as TraitPair, + crypto::{ + CryptoType, CryptoTypeId, Derive, DeriveError, KeyTypeId, PublicBytes, SecretStringError, + }, + crypto_bytes::SignatureBytes, +}; +use sp_runtime::{ + RuntimeAppPublic, + app_crypto::{AppCrypto, AppPair, AppPublic, AppSignature}, + traits::Convert, +}; + +use sp_core::crypto::Ss58Codec; + +use crate::primitive::{SchnorrSignature, VerifyingKey, mod_p}; + +/// Constant to represent the primitive of Schnorr over JubJub +pub const CRYPTO_ID: CryptoTypeId = CryptoTypeId(*b"jubP"); + +/// The byte length of serialized public key. +pub const PUBLIC_SERIALIZED_SIZE: usize = 32; + +/// The byte length of serialized signature. +pub const SIGNATURE_SERIALIZED_SIZE: usize = 64; + +#[doc(hidden)] +pub struct SchnorrJubJubTag; + +pub type InnerPublicBytes = PublicBytes; + +/// Schnorr over JubJub public key +#[derive( + Clone, + Eq, + Hash, + PartialEq, + PartialOrd, + Ord, + Encode, + Decode, + DecodeWithMemTracking, + MaxEncodedLen, + scale_info::TypeInfo, +)] +pub struct Public(pub InnerPublicBytes); + +impl Display for Public { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { + write!(f, "0x{}", hex::encode(self.as_slice())) + } +} + +impl Convert> for Public { + fn convert(beefy_id: Public) -> Vec { + beefy_id.as_slice().to_vec() + } +} + +impl Serialize for Public { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&self.to_ss58check()) + } +} + +impl<'de> Deserialize<'de> for Public { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Public::from_ss58check(&String::deserialize(deserializer)?) + .map_err(|e| de::Error::custom(format!("{:?}", e))) + } +} + +impl Debug for Public { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { + let s = self.to_ss58check(); + write!(f, "{} ({}...)", sp_core::hexdisplay::HexDisplay::from(&self.as_ref()), &s[0..8]) + } +} + +impl AuthorityIdBound for Public { + type SignatureHasher = PoseidonJubjub; + type BoundedSignature = Signature; +} + +impl<'a> TryFrom<&'a [u8]> for Public { + type Error = + as TryFrom<&'a [u8]>>::Error; + + fn try_from(value: &'a [u8]) -> Result { + Ok(Self(PublicBytes::::try_from(value)?)) + } +} + +impl AsMut<[u8]> for Public { + fn as_mut(&mut self) -> &mut [u8] { + self.0.as_mut() + } +} + +impl AsRef<[u8]> for Public { + fn as_ref(&self) -> &[u8] { + self.0.as_ref() + } +} + +impl ByteArray for Public { + const LEN: usize = PUBLIC_SERIALIZED_SIZE; +} + +impl Derive for Public {} + +impl sp_core::Public for Public {} + +impl CryptoType for Public { + type Pair = crate::primitive::KeyPair; +} + +impl AppCrypto for Public { + const ID: KeyTypeId = BEEFY; + const CRYPTO_ID: CryptoTypeId = CRYPTO_ID; + type Public = Public; + type Signature = Signature; + type Pair = crate::primitive::KeyPair; +} + +impl AsRef for Public { + fn as_ref(&self) -> &Public { + self + } +} + +impl AsMut for Public { + fn as_mut(&mut self) -> &mut Public { + self + } +} + +impl AppPublic for Public { + type Generic = Public; +} + +pub type InnerSignatureBytes = SignatureBytes; + +/// Schnorr signature over JubJub +#[derive( + Clone, + Eq, + Hash, + PartialEq, + Encode, + Decode, + DecodeWithMemTracking, + MaxEncodedLen, + scale_info::TypeInfo, +)] +pub struct Signature(InnerSignatureBytes); + +impl Debug for Signature { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { + write!(f, "Public({:?})", self.as_slice()) + } +} + +impl CryptoType for Signature { + type Pair = crate::primitive::KeyPair; +} + +impl ByteArray for Signature { + const LEN: usize = SIGNATURE_SERIALIZED_SIZE; +} + +impl AsRef<[u8]> for Signature { + fn as_ref(&self) -> &[u8] { + self.0.as_ref() + } +} + +impl AsMut<[u8]> for Signature { + fn as_mut(&mut self) -> &mut [u8] { + self.0.as_mut() + } +} + +impl<'a> TryFrom<&'a [u8]> for Signature { + type Error = + as TryFrom<&'a [u8]>>::Error; + + fn try_from(value: &'a [u8]) -> Result { + Ok(Self(SignatureBytes::::try_from(value)?)) + } +} + +impl AppCrypto for Signature { + const ID: KeyTypeId = BEEFY; + const CRYPTO_ID: CryptoTypeId = CRYPTO_ID; + type Public = Public; + type Signature = Signature; + type Pair = crate::primitive::KeyPair; +} + +impl AsRef for Signature { + fn as_ref(&self) -> &Signature { + self + } +} + +impl AsMut for Signature { + fn as_mut(&mut self) -> &mut Signature { + self + } +} + +impl AppSignature for Signature { + type Generic = Signature; +} + +impl sp_core::crypto::Signature for Signature {} + +impl CryptoType for crate::primitive::KeyPair { + type Pair = crate::primitive::KeyPair; +} + +impl TraitPair for crate::primitive::KeyPair { + type Public = Public; + type Seed = Seed; + type Signature = Signature; + + fn derive>( + &self, + path: Iter, + seed: Option, + ) -> Result<(Self, Option), DeriveError> { + let mut acc = + seed.expect("Well this was unexpected. We are assuming we are given the seed."); + + for j in path { + match j { + DeriveJunction::Soft(_cc) => return Err(DeriveError::SoftKeyInPath), + DeriveJunction::Hard(cc) => { + acc = ("SchnorrJubJubHDKD", acc, cc) + .using_encoded(sp_crypto_hashing::blake2_256) + .to_vec(); + }, + } + } + Ok((Self::from_seed(&acc), Some(acc))) + } + + fn from_seed_slice(seed: &[u8]) -> Result { + let hashed_seed: [u8; 64] = sha2::Sha512::digest(&seed).as_slice().try_into().unwrap(); + + let secret = mod_p(&hashed_seed); + Ok(Self { 0: secret, 1: (EdwardsAffine::generator() * &secret).into() }) + } + + #[cfg(feature = "full_crypto")] + fn sign(&self, message: &[u8]) -> Self::Signature { + let msg = PoseidonJubjub::msg_from_bytes(message, false) + .expect("With flag set to false, this should not fail. Please report a bug."); + + Signature(SignatureBytes::from_raw(self.sign(&msg).to_bytes())) + } + + fn verify>(sig: &Self::Signature, message: M, pubkey: &Self::Public) -> bool { + let msg = PoseidonJubjub::msg_from_bytes(message.as_ref(), false) + .expect("With flag set to false, this should not fail. Please report a bug."); + + let sig = SchnorrSignature::from_bytes(sig.as_ref()); + let pubkey = VerifyingKey::from_bytes(pubkey.as_ref()); + + match (sig, pubkey) { + (Ok(sig), Ok(pubkey)) => sig.verify(&msg, &pubkey).is_ok(), + (_, _) => false, + } + } + + fn public(&self) -> Self::Public { + let mut writer = Vec::new(); + self.1 + .serialize_compressed(&mut writer) + .expect("Serialisation should not fail - writer is big enough"); + let bytes: [u8; 32] = writer.try_into().unwrap(); + + Public(PublicBytes::from(bytes)) + } + + fn from_string_with_seed( + s: &str, + _password_override: Option<&str>, + ) -> Result<(Self, Option), SecretStringError> { + // TODO: unsure what we need to do here + Ok((Self::from_seed_slice(s.as_bytes())?, Some(s.as_bytes().to_vec()))) + } + + fn to_raw_vec(&self) -> Vec { + let mut res = Vec::with_capacity(64); + self.0.serialize_compressed(&mut res).expect("Failed to serialize."); + self.1.serialize_compressed(&mut res).expect("Failed to serialize."); + + res + } +} + +impl AppCrypto for crate::primitive::KeyPair { + const ID: KeyTypeId = BEEFY; + const CRYPTO_ID: CryptoTypeId = CRYPTO_ID; + type Public = Public; + type Signature = Signature; + type Pair = crate::primitive::KeyPair; +} + +impl AsRef for crate::primitive::KeyPair { + fn as_ref(&self) -> &crate::primitive::KeyPair { + self + } +} + +impl AsMut for crate::primitive::KeyPair { + fn as_mut(&mut self) -> &mut crate::primitive::KeyPair { + self + } +} + +impl AppPair for crate::primitive::KeyPair { + type Generic = crate::primitive::KeyPair; +} + +/// The raw secret seed, which can be used to reconstruct the secret +/// [`crate::primitive::KeyPair`]. +type Seed = Vec; + +impl BeefyAuthorityId for Public { + fn verify(&self, signature: &::Signature, msg: &[u8]) -> bool { + ::verify(signature, msg, self) + } +} diff --git a/toolkit/utils/schnorr_jubjub/src/keystore.rs b/toolkit/utils/schnorr_jubjub/src/keystore.rs new file mode 100644 index 0000000000..43f3b8c412 --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/keystore.rs @@ -0,0 +1,157 @@ +//! Wrapper around the `LocalKeystore`. +//! +//! This keystore delegates to the underlying `LocalKeystore` for most +//! functionality, but re-implements the `sign_with` method to support Schnorr +//! signatures over the JubJub curve, which the default implementation does not +//! support due to lack of genericity. + +use alloc::vec::Vec; +use sc_keystore::LocalKeystore; +use sp_application_crypto::Pair as TraitPair; +use sp_core::{ + crypto::{ByteArray, CryptoTypeId, KeyTypeId}, + ecdsa, ed25519, sr25519, +}; +use sp_keystore::{Error, Keystore}; +use std::sync::Arc; + +use crate::{ + beefy_structures::{CRYPTO_ID, InnerPublicBytes, Public}, + primitive::KeyPair as Pair, +}; + +/// Wrapper of the LocalKeystore +// TRY TO CHANGE THIS TO KeyStorePtr +pub struct SchnorrKeystore(pub Arc); + +impl Keystore for SchnorrKeystore { + fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.0.sr25519_public_keys(key_type) + } + + fn sr25519_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> Result { + self.0.sr25519_generate_new(key_type, seed) + } + + fn sr25519_sign( + &self, + key_type: KeyTypeId, + public: &sr25519::Public, + msg: &[u8], + ) -> Result, Error> { + self.0.sr25519_sign(key_type, public, msg) + } + + fn sr25519_vrf_sign( + &self, + key_type: KeyTypeId, + public: &sr25519::Public, + data: &sr25519::vrf::VrfSignData, + ) -> Result, Error> { + self.0.sr25519_vrf_sign(key_type, public, data) + } + + fn sr25519_vrf_pre_output( + &self, + key_type: KeyTypeId, + public: &sr25519::Public, + input: &sr25519::vrf::VrfInput, + ) -> Result, Error> { + self.0.sr25519_vrf_pre_output(key_type, public, input) + } + + fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.0.ed25519_public_keys(key_type) + } + + fn ed25519_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> Result { + self.0.ed25519_generate_new(key_type, seed) + } + + fn ed25519_sign( + &self, + key_type: KeyTypeId, + public: &ed25519::Public, + msg: &[u8], + ) -> Result, Error> { + self.0.ed25519_sign(key_type, public, msg) + } + + fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec { + self.0.ecdsa_public_keys(key_type) + } + + fn ecdsa_generate_new( + &self, + key_type: KeyTypeId, + seed: Option<&str>, + ) -> Result { + self.0.ecdsa_generate_new(key_type, seed) + } + + fn ecdsa_sign( + &self, + key_type: KeyTypeId, + public: &ecdsa::Public, + msg: &[u8], + ) -> Result, Error> { + self.0.ecdsa_sign(key_type, public, msg) + } + + fn ecdsa_sign_prehashed( + &self, + key_type: KeyTypeId, + public: &ecdsa::Public, + msg: &[u8; 32], + ) -> Result, Error> { + self.0.ecdsa_sign_prehashed(key_type, public, msg) + } + + fn insert(&self, key_type: KeyTypeId, suri: &str, public: &[u8]) -> Result<(), ()> { + self.0.insert(key_type, suri, public) + } + + fn keys(&self, key_type: KeyTypeId) -> Result>, Error> { + self.0.keys(key_type) + } + + fn has_keys(&self, public_keys: &[(Vec, KeyTypeId)]) -> bool { + self.0.has_keys(public_keys) + } + + fn sign_with( + &self, + id: KeyTypeId, + crypto_id: CryptoTypeId, + public: &[u8], + msg: &[u8], + ) -> Result>, Error> { + let signature = match crypto_id { + CRYPTO_ID => { + let pk_bytes: [u8; 32] = public.try_into().expect("Invalid PK format"); + let pk = Public( + InnerPublicBytes::from_slice(&pk_bytes) + .expect("Failed to create key from slice"), + ); + if let Some(pair) = self.0.key_pair(&pk)? { + let shcnorr_sig: Vec = + ::sign(&pair, msg).as_slice().to_vec(); + Some(shcnorr_sig) + } else { + None + } + }, + _ => self.0.sign_with(id, crypto_id, public, msg)?, + }; + + Ok(signature) + } +} diff --git a/toolkit/utils/schnorr_jubjub/src/lib.rs b/toolkit/utils/schnorr_jubjub/src/lib.rs new file mode 100644 index 0000000000..5118d059e0 --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/lib.rs @@ -0,0 +1,21 @@ +#![cfg_attr(not(feature = "std"), no_std)] +//! This crate implements the Schnorr signature scheme over the JubJub elliptic +//! curve, using the Poseidon hash function defined over the JubJub base field. +//! +//! It is intended exclusively for use within the BEEFY protocol. + +extern crate alloc; + +mod beefy_structures; + +#[cfg(feature = "std")] +mod keystore; +mod poseidon; +mod primitive; +mod runtime; + +pub use beefy_structures::{InnerPublicBytes, Public, Signature}; + +#[cfg(feature = "std")] +pub use keystore::SchnorrKeystore; +pub use poseidon::PoseidonJubjub; diff --git a/toolkit/utils/schnorr_jubjub/src/poseidon/constants/blstrs.rs b/toolkit/utils/schnorr_jubjub/src/poseidon/constants/blstrs.rs new file mode 100644 index 0000000000..3ea583250e --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/poseidon/constants/blstrs.rs @@ -0,0 +1,1454 @@ +//! Constants for using Poseidon with the BLS scalar field. +//! +//! The constants can be reproduced by running the following Sage script from +//! [this repository](https://github.com/daira/pasta-hadeshash): +//! +//! ```text +//! $ sage generate_parameters_grain.sage 1 0 255 3 8 60 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 +//! ``` + +use super::{NB_FULL_ROUNDS, NB_PARTIAL_ROUNDS, PoseidonField, WIDTH}; +use ark_ed_on_bls12_381::Fq; +use ark_ff::BigInteger256; + +impl PoseidonField for Fq { + // Number of round constants: 204 = (8 + 60) * 3 + // Round constants for GF(p): + const ROUND_CONSTANTS: [[Self; WIDTH]; NB_FULL_ROUNDS + NB_PARTIAL_ROUNDS] = [ + [ + Fq::new(BigInteger256::new([ + 0x118a_2e2f_6554_8257, + 0x429e_b149_5835_f5d0, + 0xe678_9030_868b_74da, + 0x0a59_176c_702e_80bd, + ])), + Fq::new(BigInteger256::new([ + 0x933a_2a02_fe51_cfbd, + 0xd304_dbbf_2412_7d23, + 0xcd8e_8a5a_5bab_4bf2, + 0x1f04_ee09_b99d_7d10, + ])), + Fq::new(BigInteger256::new([ + 0xaf52_80f5_0adc_5473, + 0x9f1a_2e78_0aa1_0c20, + 0x2918_8d63_9e30_1a4c, + 0x053b_0aee_6a9e_41f5, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xaef7_d488_79bf_3f9c, + 0x67ea_ba96_e239_1951, + 0xe456_a0c7_f190_fb81, + 0x607f_c613_870d_7f56, + ])), + Fq::new(BigInteger256::new([ + 0xb5a4_cb05_daa7_f2fb, + 0xa697_ec84_b5de_486e, + 0x13f9_9939_a0e3_4559, + 0x6593_4d47_f091_e181, + ])), + Fq::new(BigInteger256::new([ + 0xa853_bcd1_196b_63f9, + 0x4fec_1372_8d5a_cad5, + 0x8efa_f9a4_eed1_4789, + 0x18e8_96fa_20c6_21a9, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xe336_be30_a84f_d950, + 0xe47a_7c26_8147_96d2, + 0x17c4_ed67_2631_48c9, + 0x69fa_9afc_f3c3_ad00, + ])), + Fq::new(BigInteger256::new([ + 0x8e58_cfb6_41a9_262d, + 0x1247_d3bc_f972_cbd7, + 0x5c97_6e45_6bfb_407b, + 0x7176_d3b8_2879_39b9, + ])), + Fq::new(BigInteger256::new([ + 0x63e6_6973_ddc3_9a01, + 0x41f2_02d7_ef0b_284a, + 0xffc0_5e3b_37ba_7f8b, + 0x036d_041c_5ebe_fe99, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x732d_042e_df0a_816f, + 0x5057_1632_9ffb_e5a2, + 0x013b_15ae_b4c2_0921, + 0x5d05_42cc_31de_7433, + ])), + Fq::new(BigInteger256::new([ + 0x42f9_09f2_538a_8c12, + 0xf2fa_23b3_7fde_b25f, + 0xb804_665d_8913_be00, + 0x2665_fb26_ccc6_8131, + ])), + Fq::new(BigInteger256::new([ + 0x9d08_3d3c_6f9a_8ba7, + 0x6977_3c31_bb4d_95af, + 0xe7bb_046e_5c80_0ecb, + 0x3ce3_705a_685c_5889, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xaf1e_7963_d544_963d, + 0xd4fd_b7fd_68c0_2865, + 0xfa91_25e2_d774_16e3, + 0x4ec6_ec86_094a_a88e, + ])), + Fq::new(BigInteger256::new([ + 0xc2fd_db51_c3d7_fb35, + 0xa2ab_da9e_8406_0420, + 0xdcce_adee_1deb_edf9, + 0x04c0_b32a_aec6_f011, + ])), + Fq::new(BigInteger256::new([ + 0x4f78_b499_7d6a_fe55, + 0x024d_20b0_43ff_21f8, + 0x6a22_0541_769c_55e1, + 0x1627_5c92_29fa_151e, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xc103_27cc_a38b_8745, + 0xb4f7_a931_40b4_37b8, + 0xaf94_baf5_7d0f_8b00, + 0x1508_13e5_512f_10ef, + ])), + Fq::new(BigInteger256::new([ + 0xfefd_9fdb_ef63_43c2, + 0x3692_3304_dd5d_f570, + 0x4363_df56_9ee3_60ec, + 0x5f06_6147_b29d_b1e2, + ])), + Fq::new(BigInteger256::new([ + 0x8f7a_2080_7166_60d5, + 0xc4fb_015d_e0ef_9f5d, + 0x3fcf_9218_725a_5b20, + 0x115a_e3a3_1ce2_45ba, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xe5e1_4b22_a414_394e, + 0x937b_b2db_f2f9_3d69, + 0x0389_50c0_fd5d_79e3, + 0x3276_de65_c29a_45f3, + ])), + Fq::new(BigInteger256::new([ + 0x92f8_ad5a_d2b5_48bf, + 0x133e_e041_cc42_b62d, + 0x35f4_77af_6855_cca6, + 0x4c50_4980_0ceb_eb0b, + ])), + Fq::new(BigInteger256::new([ + 0xb21c_db49_1fae_2b78, + 0x2d0f_8b3d_41c9_3057, + 0x4196_c8ae_c67a_4bba, + 0x252e_1b54_9c72_eaf3, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xedad_c783_79d2_2a7c, + 0xbe3f_87e7_4ae1_c0a0, + 0x3469_5560_858c_35d6, + 0x5a0a_0f27_cfbc_fe7f, + ])), + Fq::new(BigInteger256::new([ + 0xb551_ed86_d4e0_1199, + 0x0ac1_98dc_b303_64d8, + 0xfd33_4689_e12a_ebf2, + 0x5aef_41fe_39ff_bd0b, + ])), + Fq::new(BigInteger256::new([ + 0x538a_eb06_16da_4db9, + 0xbdc6_6933_87a4_566a, + 0xd4cd_5d83_9e7f_ce4f, + 0x2ff7_ee57_4d7a_9680, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4252_d5a5_60fb_7c44, + 0x05ba_fbb6_1e57_b5fe, + 0x3fde_df2e_4269_82ce, + 0x5995_30bb_bca9_c791, + ])), + Fq::new(BigInteger256::new([ + 0x0436_dd18_bc6b_3086, + 0xa88d_f20c_ee45_6886, + 0x0bb9_a8bc_21a2_56d4, + 0x594a_fd99_c63e_0741, + ])), + Fq::new(BigInteger256::new([ + 0x8cbc_be42_1122_bf2c, + 0xc7c9_b266_eeb9_1eb4, + 0xab6a_cf32_7ffc_b56a, + 0x561b_c2bc_056a_1ddb, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x1850_53e3_9b03_e4c0, + 0x95f8_9028_8588_a97b, + 0x6973_71a1_5b9f_3110, + 0x44b0_f629_fee3_0f4a, + ])), + Fq::new(BigInteger256::new([ + 0x9b13_ecce_3f00_a744, + 0xe908_13d9_42f6_e482, + 0x1b78_e5d5_9762_4815, + 0x6666_bc36_2a76_00c8, + ])), + Fq::new(BigInteger256::new([ + 0x2020_eb73_65b7_7289, + 0xd3fa_35f5_bfe2_8c4a, + 0x2deb_b002_12d2_1c6a, + 0x3949_1594_d7ad_8049, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x5638_3a59_fba6_582c, + 0x38ab_7313_3269_c2a8, + 0xabeb_c0ea_d026_3afa, + 0x687a_baf4_8490_7604, + ])), + Fq::new(BigInteger256::new([ + 0x6a4e_6b1e_7b15_16ce, + 0x3773_b560_616a_25cc, + 0x7a29_4f24_d0ff_b886, + 0x31a9_20a0_d66d_0d37, + ])), + Fq::new(BigInteger256::new([ + 0x3103_a411_a588_4a28, + 0xf844_de5b_3ced_fedf, + 0xc628_f5fc_5c7b_67b4, + 0x43d0_f81a_73aa_dd11, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x289d_d944_0136_b819, + 0x5c45_7a53_f502_e257, + 0x1871_a5a4_ed87_4d58, + 0x3eb3_c82b_aba6_cffa, + ])), + Fq::new(BigInteger256::new([ + 0x797c_6d0b_5057_7e09, + 0xd75e_5a25_7ba1_53ae, + 0x9bed_66b6_b26f_69c8, + 0x3319_6ede_d0ba_d874, + ])), + Fq::new(BigInteger256::new([ + 0xcad2_9b7a_3a54_9811, + 0x7a18_3c0a_e3c6_c806, + 0x7bc0_731a_b785_e50e, + 0x43d2_6aaf_7d30_8dd3, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xc2f6_f153_37ed_a387, + 0x25e5_4c55_c39f_4333, + 0x053d_44d3_4d5f_0a8c, + 0x53ca_d412_4a93_4629, + ])), + Fq::new(BigInteger256::new([ + 0x793e_1f4c_d575_f356, + 0xcc88_5e01_e325_f8c5, + 0xf707_e4f2_6f51_2bb4, + 0x3eaf_d6b7_77c1_020a, + ])), + Fq::new(BigInteger256::new([ + 0xb7be_9040_ab9f_0930, + 0x6693_89e8_ec35_3453, + 0x195b_afc2_e7b8_e3b0, + 0x5320_202e_c430_6a0e, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x0888_ad8e_0d0b_26b0, + 0xa984_e319_26da_934d, + 0xb03d_4e4a_a99d_28d6, + 0x587b_91df_800f_3b96, + ])), + Fq::new(BigInteger256::new([ + 0x1bdb_88d1_f3f9_8f82, + 0x2553_aa69_e165_0b00, + 0x0367_bba6_16b6_f15e, + 0x2bfc_cc7e_b787_5847, + ])), + Fq::new(BigInteger256::new([ + 0xe12d_bb3f_4381_9d4a, + 0xdb3c_e9b7_d78e_7f5e, + 0x6d17_b675_d5ab_9c20, + 0x1422_f2e0_c548_74cf, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xf715_2a0e_b0b4_9c4c, + 0x7183_fc00_c7e6_03cb, + 0x063d_9fcf_2540_42dd, + 0x28fd_84a2_ea3a_1a2f, + ])), + Fq::new(BigInteger256::new([ + 0x2381_25d5_4411_4b57, + 0x391a_cf13_f9d2_133c, + 0x13da_f41f_ff09_5dfe, + 0x28bf_cd29_b81c_11eb, + ])), + Fq::new(BigInteger256::new([ + 0xcc54_df70_f7ab_ff3f, + 0xc988_26b5_0905_03fd, + 0x3503_8bab_8fa6_7760, + 0x5586_c4c0_ed8e_b5ea, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xfa49_8415_a68b_ab26, + 0x8742_5d23_bf73_e9ed, + 0x7315_5b2c_65e8_f343, + 0x1209_367f_03ec_6216, + ])), + Fq::new(BigInteger256::new([ + 0xdf79_0964_b607_b733, + 0x7b3e_8a41_7376_bef1, + 0x7dee_00fd_7eb2_3b5e, + 0x2235_6b2d_3215_f6d3, + ])), + Fq::new(BigInteger256::new([ + 0x3bef_b040_fd22_6672, + 0x09c8_c0c1_f268_4a7f, + 0xc480_8135_d3da_4a6a, + 0x6c16_3cb4_eb4d_8c5f, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x6759_a09c_9e48_c33a, + 0x6a6c_81f2_9516_4f5d, + 0xbd3e_5e4c_78b4_95a4, + 0x4dc3_c04e_25fd_48f7, + ])), + Fq::new(BigInteger256::new([ + 0xada0_faf9_dd9a_e7fb, + 0x3665_1145_e9bc_baf2, + 0xa719_6e06_f669_ba88, + 0x590d_9df4_29eb_3511, + ])), + Fq::new(BigInteger256::new([ + 0xb8ed_94c2_dbca_098a, + 0x13d1_ff2a_c6c2_4257, + 0x7b47_0554_86d6_811d, + 0x2ff2_9368_10a3_df28, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xd178_be88_6991_fa0c, + 0x40b5_2f60_797e_3e32, + 0xc4bc_95b4_e2ad_56e7, + 0x5f52_49a7_71d9_e4b1, + ])), + Fq::new(BigInteger256::new([ + 0xe1ba_7cc3_4e02_fb27, + 0x2d98_8d1b_18e9_bb54, + 0x0ec4_e316_7db3_da0e, + 0x67f7_8e07_cf6e_bbee, + ])), + Fq::new(BigInteger256::new([ + 0xa0b4_e9fb_1bb7_a762, + 0x61f9_be1c_5583_d9fe, + 0x63a1_6b72_d95e_2b00, + 0x2b9e_a3bd_9788_c6aa, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4a43_73eb_f0ee_59d2, + 0xbd8f_0407_342a_67fe, + 0xf041_5f5e_01d4_33bb, + 0x0a1b_af17_cbed_21cc, + ])), + Fq::new(BigInteger256::new([ + 0x7849_62ef_b0de_7977, + 0xf856_d3c9_0b04_ee14, + 0xe620_a26b_7a5e_3074, + 0x1cbf_cea2_eb30_561d, + ])), + Fq::new(BigInteger256::new([ + 0xc86f_d84b_8a51_045f, + 0xe7fc_90a2_25c1_ce9f, + 0x4afe_f268_48cd_ce06, + 0x39c9_cb51_d258_0680, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xc0bf_cb72_88a4_d9e9, + 0x2165_dadc_a284_ac55, + 0x899a_7c2c_2e7e_f043, + 0x424d_5e34_e4c1_77e2, + ])), + Fq::new(BigInteger256::new([ + 0xd792_3e77_a03c_082c, + 0x3dd9_6b9f_afd3_50ba, + 0xd2ba_7618_e011_4429, + 0x3387_e8c6_5f28_3718, + ])), + Fq::new(BigInteger256::new([ + 0x27e1_fd2a_26c6_e775, + 0x50bf_20b7_a3bf_d8e6, + 0x03b2_121d_350d_d4c4, + 0x6526_f124_7e74_5f80, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x5f21_9a42_81d6_9dd3, + 0x18d1_60d0_faf5_cbbc, + 0x4b7b_fbef_c8e9_9ebb, + 0x22c7_394d_df71_26e5, + ])), + Fq::new(BigInteger256::new([ + 0x4cfd_81fe_2ae7_54a1, + 0x1403_b733_6638_1dcb, + 0x69b7_8b0a_ccae_1092, + 0x2ef6_ac9b_e994_b37b, + ])), + Fq::new(BigInteger256::new([ + 0x0269_3c4c_3175_d977, + 0x7fd8_222c_3e3b_ed25, + 0x8424_7e7f_b84e_1154, + 0x4be6_a5c7_d2f3_dd44, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x2918_5e69_2885_09d2, + 0xe7e3_e070_e6bb_88fa, + 0x4b5b_c325_e153_609c, + 0x273a_ca31_807e_d5dc, + ])), + Fq::new(BigInteger256::new([ + 0xad22_4692_567a_0137, + 0xf0ed_cc30_ab79_e42e, + 0x23b6_f505_7c3a_1bf9, + 0x2db3_21ca_e3a1_aeb3, + ])), + Fq::new(BigInteger256::new([ + 0x7099_1fb1_a95a_88cf, + 0x3036_3687_0911_84b9, + 0x3533_01a4_48e0_30ab, + 0x4597_4424_f4c1_2e52, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x64f1_399d_2ebe_30c8, + 0x28d7_5a68_3adc_61b3, + 0xbfe5_8c8e_4eb3_9739, + 0x4dbc_8f30_94c0_b370, + ])), + Fq::new(BigInteger256::new([ + 0xc4ba_12cc_2eb5_c170, + 0x905d_a077_fb2b_f95d, + 0x91a7_410e_1926_b577, + 0x1b1c_10f0_e13f_3c0f, + ])), + Fq::new(BigInteger256::new([ + 0x160c_ab9b_f172_c001, + 0x73a1_056d_daac_586b, + 0x369b_e5d6_0ead_765e, + 0x1abb_a699_7ed7_1e4e, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x7cec_7e37_a606_146b, + 0x5e40_6373_b070_2df6, + 0x784f_66e2_7846_140a, + 0x3ffa_9ffc_e044_d6ed, + ])), + Fq::new(BigInteger256::new([ + 0xfb64_a2cd_7cde_1f3c, + 0x2068_1c98_73e8_a6bb, + 0xf2ba_11f5_1954_b80f, + 0x172d_1efb_d333_e2e3, + ])), + Fq::new(BigInteger256::new([ + 0xbd9c_09b8_93d2_6e7e, + 0x8e24_9c51_0f30_5766, + 0x3149_1ded_baaf_880b, + 0x2544_4915_82a9_1b80, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x8134_aa24_1672_ba80, + 0xf39e_54b1_ce60_3d0f, + 0x52a0_0a5c_e729_1a5c, + 0x598e_a1d2_111d_e9b9, + ])), + Fq::new(BigInteger256::new([ + 0xb32f_3aef_037d_58e5, + 0xab4b_4cb9_38ed_769e, + 0xc18f_31a9_956b_d45f, + 0x30d0_1564_a8f6_e2c8, + ])), + Fq::new(BigInteger256::new([ + 0x076c_a06f_98c9_3ef9, + 0xc16d_26ce_4cd2_f348, + 0x4f9c_c5e8_44bb_2af3, + 0x58e0_de1f_fa9f_39d5, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xa488_fe7f_7f05_8bab, + 0x49d8_570c_351d_6cf8, + 0xe264_673e_a5fc_f9ff, + 0x45b8_9204_3e1e_1258, + ])), + Fq::new(BigInteger256::new([ + 0xac90_de86_0b79_4521, + 0x20d2_2d5a_211e_162c, + 0xaff5_d3fe_cc45_1b73, + 0x2b80_d5a4_800e_de3e, + ])), + Fq::new(BigInteger256::new([ + 0x5835_9366_dfb7_da17, + 0x05f3_5e4f_26e9_ef74, + 0x411d_441c_46eb_b464, + 0x419d_0620_2b19_0907, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x3ab5_4a62_d2d8_2d42, + 0x373b_cf0d_9b94_9e16, + 0x24e1_8f11_b727_6d17, + 0x3d07_5534_3ed4_09e2, + ])), + Fq::new(BigInteger256::new([ + 0xd5ce_8fd4_13ed_1b84, + 0xc6bb_7933_ee65_6745, + 0xaac8_dbba_1b9d_9558, + 0x53cb_0d8f_5428_a5dc, + ])), + Fq::new(BigInteger256::new([ + 0xf189_c94a_c782_d122, + 0xb476_17d6_3649_e1b8, + 0xcd2e_3667_78c3_fcda, + 0x0b07_c5e9_35d3_cd60, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x98a8_f239_4624_e738, + 0xf97a_ab56_f5d0_3db8, + 0x0466_97b1_dd6d_31c4, + 0x2e5e_97fa_75da_2aaa, + ])), + Fq::new(BigInteger256::new([ + 0x37f0_8614_0354_cafa, + 0xab07_290e_b1e7_2781, + 0x511c_620e_69dc_f4c1, + 0x0a04_8ff9_4cd9_e028, + ])), + Fq::new(BigInteger256::new([ + 0x556b_3730_6cb7_147c, + 0x8e96_693f_8e35_37fc, + 0x5282_ce32_c734_068b, + 0x1743_4368_32d1_570b, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x295f_6395_1707_cba9, + 0x688b_24f2_9140_490b, + 0x3c04_b8cf_b889_e8bb, + 0x28f3_ea48_6b86_e75b, + ])), + Fq::new(BigInteger256::new([ + 0xb843_1e2a_7d6d_2eac, + 0x91e6_1be6_f4cd_acd7, + 0x1392_8401_b81d_e81c, + 0x150d_bfb6_9d9f_cdf9, + ])), + Fq::new(BigInteger256::new([ + 0x243f_a129_5cea_4402, + 0x2db5_e0ea_bd2b_f735, + 0xa0d5_de42_7b22_1374, + 0x29ca_3439_450d_a375, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x2156_0893_7a66_4dcb, + 0x86b6_cdde_0cb9_50da, + 0xfbc8_c210_d7b2_7bf2, + 0x48a1_b62b_76a6_5fcb, + ])), + Fq::new(BigInteger256::new([ + 0xa562_ce22_3e9f_38ed, + 0x4d0a_e206_ec6a_690a, + 0xd69c_266e_697c_027b, + 0x0218_eb6a_f243_41ec, + ])), + Fq::new(BigInteger256::new([ + 0xe409_1ddb_34f3_d8bc, + 0x5124_a9f8_2bce_00ed, + 0x5078_15d5_5883_ca47, + 0x09a3_b38e_f1e1_3493, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x6d6c_b7f2_0f63_881b, + 0x5dba_d9b3_2a84_8587, + 0x2d65_9c85_dacf_e7f8, + 0x1740_86a2_d189_6a82, + ])), + Fq::new(BigInteger256::new([ + 0x1a35_3ba6_f85f_f3cf, + 0x1d32_f285_241a_7e35, + 0x3e1f_efb8_196e_aa6f, + 0x23fd_11b6_eefb_f765, + ])), + Fq::new(BigInteger256::new([ + 0x4dc9_8314_05a3_333b, + 0x9e5e_1b77_03c1_cc2f, + 0x0043_83cc_d61a_9059, + 0x4928_18ba_0240_1999, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xb2bb_26a8_e035_e725, + 0x68ea_3272_531b_097f, + 0xa318_85b0_1843_abf5, + 0x0173_b890_5492_a145, + ])), + Fq::new(BigInteger256::new([ + 0x40de_b8d0_9888_e12c, + 0xda2f_2947_79df_27e0, + 0xaf5c_9bdb_eef0_a4d4, + 0x43d5_7042_f3bb_c227, + ])), + Fq::new(BigInteger256::new([ + 0xa813_6fdf_837e_d979, + 0x85a8_b3ff_611c_d0d2, + 0xbaba_fac1_66eb_1410, + 0x17ef_e956_b72e_ec83, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x83d8_f04a_a042_cf9a, + 0xf86e_5510_b509_2fd8, + 0x317b_45c2_27c1_554e, + 0x0269_9986_2ad4_01ae, + ])), + Fq::new(BigInteger256::new([ + 0x88e4_8d34_bb69_b85b, + 0x9180_1d1a_c156_55ef, + 0x1e05_dd23_9aaa_e3fb, + 0x0778_1051_8418_0434, + ])), + Fq::new(BigInteger256::new([ + 0x13d1_7ad8_1b96_abc5, + 0x0ecb_ffd7_d2e0_82ee, + 0xfa48_3b5b_f6b0_00e9, + 0x6946_1896_429e_17f3, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4fec_48b8_8341_dd4a, + 0x197d_8928_0f16_bd6d, + 0xb0f1_68ee_033b_365a, + 0x0318_eb69_0fba_a314, + ])), + Fq::new(BigInteger256::new([ + 0x397a_f4b7_0433_d509, + 0x0ac0_14d1_78f2_d32c, + 0xd680_77fa_25b7_6d56, + 0x23ee_6efb_f70b_755e, + ])), + Fq::new(BigInteger256::new([ + 0x39d1_b1f5_091e_b0f4, + 0x8442_455a_6605_e054, + 0xe775_9558_5d4a_2b2e, + 0x6029_a2c1_fc7a_f40d, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xb5a5_f74e_c6ba_b5ed, + 0x4e20_9344_021c_d7e0, + 0xe794_73af_ca0a_254d, + 0x6585_fcc2_a5d8_911d, + ])), + Fq::new(BigInteger256::new([ + 0xb168_1f7a_565c_241a, + 0x06db_76c7_2111_9e4a, + 0x8ee9_76c1_f8b7_2dc7, + 0x6ec3_a9ed_afd9_8f35, + ])), + Fq::new(BigInteger256::new([ + 0xa8cb_7d6f_3a4b_6fbd, + 0x7c74_fc83_01b0_13ac, + 0x6dca_a9c5_0bdb_bc3d, + 0x2c9c_9202_2887_a2eb, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xe4b7_86bf_d6db_1b7e, + 0x8d47_9077_5a12_ce8b, + 0x8e5e_0029_a10e_5f83, + 0x087f_dbf0_7402_d34f, + ])), + Fq::new(BigInteger256::new([ + 0x3a8d_88e0_1b9e_7400, + 0x6152_ac3a_c547_d85e, + 0x5baf_0e07_b102_b45e, + 0x05a8_33fd_dca8_7817, + ])), + Fq::new(BigInteger256::new([ + 0x52dc_6334_f7ac_d315, + 0x9ff5_fcba_8203_2eef, + 0x2d02_3f3b_9fc0_ffc6, + 0x6de1_5cd7_bd3e_51f5, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xd389_dbd1_66ad_ee91, + 0x6c12_b3b1_2b70_f319, + 0x0360_bea6_b324_b189, + 0x2e4e_3978_e7aa_100b, + ])), + Fq::new(BigInteger256::new([ + 0x601f_620e_ecdd_6ea5, + 0x4335_b585_27d8_ff6a, + 0xf202_f74b_70d0_1725, + 0x59d4_6aa1_6cc7_b82b, + ])), + Fq::new(BigInteger256::new([ + 0xe90c_3ff5_8f2e_3186, + 0x352b_0b95_52d7_cc42, + 0x5dd5_ae14_87fe_b5dc, + 0x47b0_4fb8_3795_a3ad, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x51b0_f50e_a729_062e, + 0xe685_74d9_806e_339e, + 0xa89f_435a_f48b_ab23, + 0x72eb_9aab_40a2_d32f, + ])), + Fq::new(BigInteger256::new([ + 0xbe97_290f_563f_c237, + 0x12f2_66a8_a759_4ace, + 0xa6f0_1a12_16b4_4d46, + 0x52b5_ba58_1b50_4f06, + ])), + Fq::new(BigInteger256::new([ + 0x0c87_0a17_e0bc_0960, + 0x6ec2_ae83_2c85_13de, + 0x06f0_38ac_0bf6_a36e, + 0x2092_ffa4_f790_8df3, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4244_f2b4_4cde_4d4d, + 0xeb6b_d985_d874_07ab, + 0x515a_cac5_052d_3e1d, + 0x29fe_3fb0_741e_8e21, + ])), + Fq::new(BigInteger256::new([ + 0x3645_ed78_7d1a_d236, + 0x5fd6_7b54_fdb5_c38f, + 0x7890_654d_3115_ccac, + 0x47d8_89a4_289e_f4a6, + ])), + Fq::new(BigInteger256::new([ + 0xeb39_d01c_eb65_595c, + 0x004b_84db_2f2d_f5ed, + 0xa0fe_ce14_50b0_a5b6, + 0x40e5_e494_2ceb_c127, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x7c3f_cf3a_f6f4_b389, + 0x2309_d0c4_c1fb_80d8, + 0x8671_2c50_b1ea_963e, + 0x5603_5841_aac5_c659, + ])), + Fq::new(BigInteger256::new([ + 0x4424_5189_7806_d131, + 0x921f_4f6d_3b1c_0e0b, + 0x07f6_02b3_24f9_2b3e, + 0x261e_6f49_75a7_12e9, + ])), + Fq::new(BigInteger256::new([ + 0xe46f_6eda_2eda_4a56, + 0xb717_7d48_8031_ac1e, + 0xa49c_63f1_dff1_49da, + 0x18bd_7110_cfeb_bef4, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x48f6_8eed_1d60_4a85, + 0xe0e4_81d3_24d2_056b, + 0xe651_1c03_bba0_20a2, + 0x6c06_ac40_7bee_2048, + ])), + Fq::new(BigInteger256::new([ + 0xc920_3b16_fd56_092f, + 0xcee4_012a_dc69_abaf, + 0x6b39_fc3b_05b0_cfb5, + 0x4eec_84a8_6e66_bc09, + ])), + Fq::new(BigInteger256::new([ + 0xaee9_3d10_f362_a1e7, + 0x8682_5e2b_c42e_c161, + 0xa65b_8082_c738_2d73, + 0x70e6_9933_021a_ed26, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x087e_6fcb_6513_50d4, + 0xcb03_5273_58f6_b730, + 0xc58f_a9e2_711b_ea36, + 0x6663_6fdf_9c44_45ea, + ])), + Fq::new(BigInteger256::new([ + 0x5dba_9774_ab09_bc2c, + 0x3e3c_dbb7_6d72_3e53, + 0x1455_7ca1_29ce_ae00, + 0x4585_347a_49f6_d01d, + ])), + Fq::new(BigInteger256::new([ + 0x25d1_b3d7_0abc_b9fd, + 0xddae_df7a_e41b_7e26, + 0x0e58_a693_5932_4501, + 0x1858_cf26_643e_a1b6, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xadcc_9911_36bd_8afc, + 0x47ea_c18f_2268_69a4, + 0xcd81_08ae_dcfb_530e, + 0x678f_451d_c983_1f6d, + ])), + Fq::new(BigInteger256::new([ + 0xacce_bf1a_6089_d552, + 0x85a8_0566_dc3f_6f97, + 0x6c67_646e_c528_5891, + 0x0e77_c6cd_c6c0_6d5d, + ])), + Fq::new(BigInteger256::new([ + 0xb373_84a8_80fb_6cb1, + 0xacef_8af8_ac7d_accc, + 0xa2d3_2916_fc45_227a, + 0x136f_33c7_2bbc_c8b0, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x7845_3c72_2025_930c, + 0xa178_6f0f_fd7d_09ac, + 0x503d_9a55_0e3a_9e63, + 0x02ca_fabf_1acc_2e27, + ])), + Fq::new(BigInteger256::new([ + 0xf28d_d694_19cc_0258, + 0x709b_c667_1ac0_e3c5, + 0x1c48_1caa_15d9_0621, + 0x13c5_05ee_9b01_a5de, + ])), + Fq::new(BigInteger256::new([ + 0x051d_cc91_6c64_0c54, + 0x7d15_2983_4dc9_baa4, + 0xd9f9_633c_9f82_8b20, + 0x633b_e5c8_77b5_df79, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x607f_932b_132c_86c3, + 0x280e_97eb_2cf2_a32d, + 0x8789_3b68_4732_b3f7, + 0x2910_a536_8e54_f10a, + ])), + Fq::new(BigInteger256::new([ + 0x7f4b_c322_a0e9_6559, + 0x4cdd_8ded_9d4e_9740, + 0xe4b3_dd28_16b3_d02b, + 0x5cb6_ad2f_1e64_242e, + ])), + Fq::new(BigInteger256::new([ + 0xbbbb_2a0f_0803_0b0a, + 0xebd9_0859_46d6_4024, + 0xdd59_95ef_99ed_e54f, + 0x3ef0_3ac7_0868_7736, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x0ed9_b34b_932c_9110, + 0xa175_c7c8_e757_6f66, + 0x7ce7_7378_89e4_2cdc, + 0x32c2_f6f2_8415_ba95, + ])), + Fq::new(BigInteger256::new([ + 0x0817_973b_2d1b_fc54, + 0x7116_64a9_dcff_920f, + 0x1a8d_adda_feb8_e875, + 0x2c18_9965_a7cf_df22, + ])), + Fq::new(BigInteger256::new([ + 0xcb3e_5d9f_7f5c_8cbb, + 0x18ee_100a_9d5c_3a7c, + 0x27c1_bc73_5ae7_88a3, + 0x6154_9e70_76bc_0ec8, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x8c8d_2871_12de_d73c, + 0x0a43_db78_9407_19a9, + 0x9f81_d2f3_ec2c_75c3, + 0x25d4_de96_dc1f_b748, + ])), + Fq::new(BigInteger256::new([ + 0x0823_1132_de50_3a87, + 0x6457_5b51_4200_b701, + 0x2d22_bf5f_ca5a_898d, + 0x660b_1914_98f9_8f6d, + ])), + Fq::new(BigInteger256::new([ + 0x9025_65cf_298c_bdee, + 0x45e8_d1ce_6a67_b6b2, + 0x1dc3_c4c5_68a8_57e3, + 0x1cc5_27b5_ad13_ce38, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x8df3_d7f7_7ada_1c1b, + 0x04a3_4ad3_f42a_6c12, + 0x1e1c_2b9e_79d6_91d6, + 0x321f_f3c8_d2e9_2d6b, + ])), + Fq::new(BigInteger256::new([ + 0xd91d_f895_d330_781f, + 0x313e_5c31_aa32_d76f, + 0xe357_ac34_363c_594e, + 0x1d8f_0042_34f9_f2c1, + ])), + Fq::new(BigInteger256::new([ + 0x3585_becf_c3dc_fcb7, + 0xcfc0_0a28_96c9_67ee, + 0x0446_287d_24d2_38ff, + 0x4544_d6c8_fd4c_7876, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x5720_4bc1_fdbe_e339, + 0xe46d_8b80_2537_90e9, + 0xbcb0_0e5f_af8f_4b4f, + 0x20a0_8d0a_5324_8fb2, + ])), + Fq::new(BigInteger256::new([ + 0xe3e3_05cd_94d7_6d8f, + 0x666c_4722_ed13_bdc1, + 0x5e04_5363_9ad0_b521, + 0x36b5_c215_7325_963c, + ])), + Fq::new(BigInteger256::new([ + 0xbb6d_545b_4937_6a47, + 0x4ff3_b60f_8528_fbd1, + 0x72a7_fde9_0260_833a, + 0x43b1_2f2b_4650_dcf1, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x320c_3448_eb45_ed06, + 0x2642_839d_25d3_847a, + 0x3f3c_d7f8_8337_202b, + 0x0195_8c4c_97a4_591e, + ])), + Fq::new(BigInteger256::new([ + 0x6eda_b928_444b_3e7e, + 0x3296_3af1_0441_62db, + 0xcbd3_257a_1777_5b5c, + 0x53c4_6439_3bb5_0b0b, + ])), + Fq::new(BigInteger256::new([ + 0x1738_552f_f738_4841, + 0x6b65_ec6a_a08b_e908, + 0x521d_2b97_39df_85d8, + 0x483f_8c11_8f74_a356, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x40f1_35eb_397b_7ec6, + 0xfe74_399d_501e_034a, + 0xa99e_39bd_a430_5282, + 0x3663_c6a8_1bd8_8aff, + ])), + Fq::new(BigInteger256::new([ + 0x66f7_1916_c8d3_5cab, + 0x5e1e_184b_3cc2_6a94, + 0x9abb_42a1_414e_53c9, + 0x1b9f_ba69_5a3d_96ba, + ])), + Fq::new(BigInteger256::new([ + 0xd905_b9d0_2e65_88fb, + 0x50e5_0ce5_3ed8_c5ef, + 0x24a3_2f4f_86c6_92b9, + 0x6bb3_e27e_0010_b3fa, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x313a_0c5b_67b5_8178, + 0x00a2_35d0_0fbf_4aa0, + 0x0ce2_46da_6fbd_3615, + 0x5381_1e5c_7199_4932, + ])), + Fq::new(BigInteger256::new([ + 0x4dab_78e7_5496_8366, + 0x16d2_513e_975e_e91a, + 0x8041_d085_5320_d5c4, + 0x5933_55b8_0017_775f, + ])), + Fq::new(BigInteger256::new([ + 0xfa6e_496c_38df_5908, + 0x5286_193b_33a6_4fa4, + 0x33f2_c514_891a_6b80, + 0x0b21_0ab6_3ae1_ef17, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4188_a810_d03e_27a1, + 0x07f1_1774_9030_02a4, + 0x03f8_5e7b_8274_358b, + 0x26f1_380e_7749_5976, + ])), + Fq::new(BigInteger256::new([ + 0xf4ca_a6b4_4957_75ac, + 0xc70f_b3bd_b2a8_a94d, + 0x77ed_c64f_72fa_fc3b, + 0x0351_d89c_1323_6332, + ])), + Fq::new(BigInteger256::new([ + 0xaf04_eaa9_71b3_5cef, + 0x9d37_d706_23ab_6c5c, + 0xb802_9606_6480_671e, + 0x39a7_7941_4a82_3f70, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xbab9_8527_f60e_1dd5, + 0x3578_5179_0c21_f2e4, + 0x7d3f_c14a_0952_e330, + 0x33f8_e694_1a0b_05b7, + ])), + Fq::new(BigInteger256::new([ + 0x3f97_eddc_2d38_f4dc, + 0x955e_3cb2_8fe4_4d5f, + 0xf2a5_70f8_7857_377a, + 0x3936_d272_db72_a892, + ])), + Fq::new(BigInteger256::new([ + 0x8c33_154f_3259_e6c9, + 0x23bc_6365_cbab_5050, + 0xc428_242a_7866_3859, + 0x2584_83d9_d19d_0c37, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x9547_9a05_9076_fcee, + 0x8c07_4903_8bfa_99de, + 0x45e1_3680_8fee_e64d, + 0x7306_e10d_bdde_8985, + ])), + Fq::new(BigInteger256::new([ + 0x8406_39e7_4ed0_7fb1, + 0x7c4b_5119_d9ef_c7d1, + 0xd48b_8b39_2fea_fbc5, + 0x3a0a_3284_577a_03ce, + ])), + Fq::new(BigInteger256::new([ + 0x2b16_b05a_cd01_f76a, + 0x9298_076d_925d_b5ed, + 0xdd79_6b7d_976b_e2eb, + 0x4d88_3dca_9111_02d3, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x11d1_c754_7016_db87, + 0x2c70_71a7_e4a7_1ded, + 0x916e_3b79_474c_f2f5, + 0x27fb_982b_0401_726a, + ])), + Fq::new(BigInteger256::new([ + 0x24ea_a276_c65e_c2e6, + 0xfa8a_e838_5e37_fbba, + 0x89ed_68ed_a04d_6b90, + 0x72bb_4b20_ab85_f6fd, + ])), + Fq::new(BigInteger256::new([ + 0x4d05_97fb_5667_90f2, + 0xc81a_18ea_b76c_eebc, + 0x23dd_f59d_a272_d1c3, + 0x2376_bf81_cbff_ac7a, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x4ecf_ab38_67ef_bcd5, + 0x1f3c_8e92_e863_5f7b, + 0x9614_b4df_fab8_57fc, + 0x09fb_7dca_a11f_7198, + ])), + Fq::new(BigInteger256::new([ + 0x3dd3_09af_c72d_d3f4, + 0xe410_bff7_3f01_7e5b, + 0x13ba_ef99_9cf1_e919, + 0x37d7_a768_4484_8c05, + ])), + Fq::new(BigInteger256::new([ + 0xa843_26df_8777_ea61, + 0xcf0f_921f_7ac1_0ca0, + 0xb08a_aa90_0cc8_63b1, + 0x6c28_ac72_a608_db7c, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x464d_14ec_76b5_9fbf, + 0x0d40_fb8a_8512_d534, + 0x013e_ac3b_ab7a_9307, + 0x6ac3_0872_fb7a_aee2, + ])), + Fq::new(BigInteger256::new([ + 0x202d_5203_5979_6171, + 0xa7fa_51e7_cbaf_b0d4, + 0xa97f_6f3c_3ba9_66c2, + 0x1588_e343_d1f2_7071, + ])), + Fq::new(BigInteger256::new([ + 0x553a_f379_cd3c_ab09, + 0x74e8_ceb0_3175_5422, + 0x2f25_2972_bbd5_7761, + 0x11dc_280a_b49a_8737, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xdcb4_8f05_38b3_47ba, + 0xde83_000e_588a_7845, + 0x9b4b_3ce5_8861_c713, + 0x41fa_c88d_9768_38fd, + ])), + Fq::new(BigInteger256::new([ + 0x8b55_784d_ba75_b3a1, + 0x44fb_a761_9d24_75e7, + 0xaf0e_3620_06f1_deda, + 0x10b2_70ab_826c_c8a6, + ])), + Fq::new(BigInteger256::new([ + 0xfa6a_928e_390e_e657, + 0x4014_f66c_4f7d_e094, + 0xd9b5_04d0_41a0_4933, + 0x357d_03d4_99c5_b0bc, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xd4d1_bcad_440f_a453, + 0xc4fc_22f8_ff0f_5868, + 0xd8e5_b912_fdba_2ab4, + 0x2b56_bb5f_cde0_25a8, + ])), + Fq::new(BigInteger256::new([ + 0x9b4b_3212_efbf_d684, + 0x08e5_c84a_24c4_8f36, + 0x55d3_75f0_bb19_efda, + 0x37b4_060a_506b_89de, + ])), + Fq::new(BigInteger256::new([ + 0xf302_9bbd_4aa3_e834, + 0x4392_5004_d2e5_ccff, + 0xf634_8a0f_efc4_8ac0, + 0x6b16_708a_c85a_d545, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x1ee7_05df_4d63_dd2e, + 0x2016_3ef6_981c_e0a6, + 0x498b_2265_8e8a_b19c, + 0x040e_0736_3e32_d188, + ])), + Fq::new(BigInteger256::new([ + 0x09dc_c60d_6057_12ca, + 0x6d6d_4d9f_b29b_3b42, + 0xa753_e090_bd99_46d3, + 0x01f7_0819_c567_2b60, + ])), + Fq::new(BigInteger256::new([ + 0xda93_2c87_ac1a_fa27, + 0xd47e_c241_2eb1_a648, + 0x8c27_c96c_f1d4_edc7, + 0x49f4_01e0_19b5_dfae, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x6805_55a6_6575_68c8, + 0x0eff_83e4_d07b_5daa, + 0xec1c_b87f_fe25_a5ca, + 0x6cda_350d_bb4c_836a, + ])), + Fq::new(BigInteger256::new([ + 0x0e50_9f26_a38b_2eb1, + 0xe94c_34fc_7cc8_546e, + 0x81eb_a9c1_2cb1_8ce1, + 0x5e9b_6c88_8742_7743, + ])), + Fq::new(BigInteger256::new([ + 0xf675_7e2c_0db9_86c2, + 0xc958_b01a_974c_fc81, + 0x1974_b72f_8e07_0b9c, + 0x64e4_b6b6_c69c_55d7, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x3084_add5_4402_7211, + 0x2598_3357_d70c_e29b, + 0x5bc4_cad7_c234_fb3c, + 0x5e70_bb0b_9149_8488, + ])), + Fq::new(BigInteger256::new([ + 0x67e7_49a8_12a5_0492, + 0x0fda_6002_abba_22f7, + 0xe2c1_b370_7b47_1754, + 0x04d5_a142_a22a_8104, + ])), + Fq::new(BigInteger256::new([ + 0x1350_b3c4_d134_9d0b, + 0xecbb_a1bc_2d0d_6c4e, + 0x90af_53ad_9780_8dce, + 0x432d_2c0a_5d1a_ca34, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x42b5_2b6b_85a9_5adb, + 0xe65a_376f_204e_f211, + 0x0dc1_5d10_3038_792b, + 0x47d4_be89_1ce2_eac0, + ])), + Fq::new(BigInteger256::new([ + 0xafe4_9f2b_748b_15df, + 0xa087_25bd_fdf9_77ad, + 0xd7b1_ff1c_33df_ae8d, + 0x6a58_dff9_65c9_36f7, + ])), + Fq::new(BigInteger256::new([ + 0xcda2_906b_9bde_9033, + 0xea16_016a_a11e_04a8, + 0x9295_6418_c5db_8fd0, + 0x0ca6_3d92_e3a6_ab11, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x82b9_848f_dfda_72d2, + 0xf629_7809_ede7_8709, + 0xd8d6_b235_0a2b_957d, + 0x3860_7712_05e0_b4da, + ])), + Fq::new(BigInteger256::new([ + 0xc443_7b4d_8646_9281, + 0x12f9_997b_38f9_7dd8, + 0xc2b4_cebf_388e_e564, + 0x3b1d_dca5_7831_b77f, + ])), + Fq::new(BigInteger256::new([ + 0xf601_a059_1f25_26a6, + 0xb120_292b_f198_fc89, + 0x1498_2c23_568b_1a2c, + 0x2893_0fbc_794c_cfa4, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x2aab_ec12_2b3b_fbc1, + 0x1d70_7b8a_d740_7ada, + 0x5d35_c74b_aebc_1cc8, + 0x0525_502d_91ad_c731, + ])), + Fq::new(BigInteger256::new([ + 0x2802_09e6_3f70_0a87, + 0xc9c6_f9ec_10a3_52e0, + 0x04bb_fb3d_55e8_cfe5, + 0x38d5_f073_61b5_1536, + ])), + Fq::new(BigInteger256::new([ + 0x5a1d_c88c_b052_7837, + 0x42b5_e2d7_8287_19c1, + 0x5a26_aff1_bab0_7f50, + 0x2909_6840_d2d9_661a, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0x6ff9_f888_5e43_99e2, + 0x32ed_663e_eca4_cd34, + 0xf55e_9cf6_80b3_6871, + 0x5288_306a_eaf6_3127, + ])), + Fq::new(BigInteger256::new([ + 0x84bd_2ac8_620b_1590, + 0x7063_8c1a_79b9_2d05, + 0xa166_64c2_f7aa_ec2e, + 0x5b76_b9de_abc3_55b3, + ])), + Fq::new(BigInteger256::new([ + 0x576d_e696_122a_21d0, + 0x4e4b_1643_7d98_67e4, + 0xd592_1194_bd47_72e4, + 0x5765_c36e_c081_5219, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xceab_1a0f_2ed2_2c92, + 0x8e54_aee2_cb9a_eb3d, + 0x6fee_7c5e_ab52_bbe2, + 0x63bd_27f4_1673_61b7, + ])), + Fq::new(BigInteger256::new([ + 0x3c11_3f68_1e5c_c463, + 0x6c78_c753_af39_cbe9, + 0x6c9f_cb5c_8ddc_8a5c, + 0x025e_8ea5_0072_3857, + ])), + Fq::new(BigInteger256::new([ + 0xb5ef_ab3c_32c8_b4a0, + 0xc1ff_831f_5fff_2c1c, + 0x3444_e04b_9310_3593, + 0x276a_4461_2816_867d, + ])), + ], + ]; + + // n: 255 + // t: 3 + // N: 765 + // Result Algorithm 1: + // [True, 0] + // Result Algorithm 2: + // [True, None] + // Result Algorithm 3: + // [True, None] + // Prime number: + // 0x0x73_ed_a_753__299d_7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 + + const MDS: [[ark_ed_on_bls12_381::Fq; WIDTH]; WIDTH] = [ + [ + Fq::new(BigInteger256::new([ + 0x6118_de41_07b5_1ace, + 0x8ad5_7440_53ba_9e77, + 0x5d6d_2412_10e2_d8a6, + 0x1b81_14c3_81b9_22fd, + ])), + Fq::new(BigInteger256::new([ + 0xe371_7213_fcc0_d763, + 0x7599_0cca_ec4c_09b4, + 0x0e5d_2189_9cf5_3317, + 0x3df3_2e4c_c4cb_2ed2, + ])), + Fq::new(BigInteger256::new([ + 0x3ecd_34ae_a0e1_edc1, + 0x007f_3360_1591_080b, + 0xbe25_8779_bf54_8eb4, + 0x3f05_c4df_7a66_64da, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xd7f5_01cd_31a8_b374, + 0xca74_314b_950f_e7b1, + 0x432a_4ad7_6d3f_ae06, + 0x404d_2107_3985_d14e, + ])), + Fq::new(BigInteger256::new([ + 0xf7fa_1603_9556_49f1, + 0x73e9_b231_7679_422f, + 0x81bc_620e_9e52_4d4b, + 0x0b2c_c870_4264_c6bd, + ])), + Fq::new(BigInteger256::new([ + 0xe2a8_fc8c_637f_1a1f, + 0x6d0b_b519_8343_48b4, + 0x5a93_88c6_4103_5d49, + 0x0fdf_664d_a550_59fa, + ])), + ], + [ + Fq::new(BigInteger256::new([ + 0xf95d_c57e_90c4_9140, + 0x3197_ad01_b65a_730a, + 0x43e2_4a47_f45c_5d03, + 0x5e1d_3dbe_cda6_2143, + ])), + Fq::new(BigInteger256::new([ + 0x7dc7_b900_2f5a_a78a, + 0x44cb_6d5f_ae89_54f3, + 0x9318_96e7_7ea5_c612, + 0x6bd7_2f9c_fc53_af9d, + ])), + Fq::new(BigInteger256::new([ + 0xbb4f_b88e_f99d_e0db, + 0x1eff_bd9c_d58e_46d9, + 0xcaf8_80a9_054b_ef83, + 0x4997_c5aa_3a5f_a07b, + ])), + ], + ]; +} diff --git a/toolkit/utils/schnorr_jubjub/src/poseidon/constants/mod.rs b/toolkit/utils/schnorr_jubjub/src/poseidon/constants/mod.rs new file mode 100644 index 0000000000..c11b345d8e --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/poseidon/constants/mod.rs @@ -0,0 +1,23 @@ +/// Length of Poseidon's state. +pub(crate) const WIDTH: usize = 3; + +/// Hash rate of Poseidon. +pub(crate) const RATE: usize = 2; + +/// Number of full rounds of the Poseidon permutation. +pub(crate) const NB_FULL_ROUNDS: usize = 8; + +/// Number of partial rounds of the Poseidon permutation. +pub(crate) const NB_PARTIAL_ROUNDS: usize = 60; + +/// A PrimeField with the constants needed to compute Poseidon's permutation +/// (MDS matrix and round constants). +pub trait PoseidonField: ark_ff::Field { + /// The MDS matrix used for the linear layer at each round of Poseidon. + const MDS: [[Self; WIDTH]; WIDTH]; + + /// The constants added to Poseidon's state on every round. + const ROUND_CONSTANTS: [[Self; WIDTH]; NB_FULL_ROUNDS + NB_PARTIAL_ROUNDS]; +} + +mod blstrs; diff --git a/toolkit/utils/schnorr_jubjub/src/poseidon/mod.rs b/toolkit/utils/schnorr_jubjub/src/poseidon/mod.rs new file mode 100644 index 0000000000..26dd59bc7e --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/poseidon/mod.rs @@ -0,0 +1,130 @@ +// Copied code from midnight-circuits +pub mod constants; + +pub mod poseidon_cpu; + +pub mod round_skips; + +use constants::PoseidonField; +pub use poseidon_cpu::*; + +// Implementation of Poseidon over JubJub (using midnight-circuits implementation). +// Need to figure out if we can assume that the bytes are canonical, i.e., if we are always hashing something that +// was a Scalar field element. + +use alloc::vec::Vec; +use ark_ed_on_bls12_381::Fq as Scalar; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; + +use hash256_std_hasher::Hash256StdHasher; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; +use sp_core::H256; +use sp_core::Hasher; +use sp_runtime::DeserializeOwned; +use sp_runtime::RuntimeDebug; +use sp_runtime::{StateVersion, traits::Hash}; +use sp_runtime_interface::pass_by::{AllocateAndReturnPointer, PassAs, PassFatPointerAndDecode}; +use sp_runtime_interface::runtime_interface; +use sp_trie::{LayoutV0, LayoutV1, TrieConfiguration}; + +#[derive(Debug)] +pub enum PoseidonError { + /// Error produced when trying to convert bytes to field element + NotCanonical, +} + +#[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo, Serialize, Deserialize)] +pub struct PoseidonJubjub; + +sp_core::impl_maybe_marker_std_or_serde!( + /// A type that implements Serialize when in std environment or serde feature is activated. + trait MaybeSerialize: Serialize; + + /// A type that implements Serialize, DeserializeOwned and Debug when in std environment or serde feature is activated. + trait MaybeSerializeDeserialize: DeserializeOwned, Serialize; +); + +impl PoseidonJubjub { + /// Converts a byte slice into a vector of `Scalar` field elements suitable + /// for Poseidon hashing. + /// + /// Poseidon operates over field elements, so this function transforms raw + /// bytes into `Scalar`s. + /// + /// - If `format_scalars` is `true`, the input is assumed to already contain + /// valid field elements. Each 32-byte chunk is interpreted as a canonical + /// `Scalar`. + /// + /// - If `format_scalars` is `false`, the input is processed in 31-byte + /// chunks to ensure that each resulting value falls within the canonical + /// range of the field. + /// + /// Returns a `Vec` on success, or an `Error` if canonical + /// conversion fails. + pub fn msg_from_bytes(msg: &[u8], format_scalars: bool) -> Result, PoseidonError> { + let chunk_len = if format_scalars { 32 } else { 31 }; + + msg.chunks(chunk_len) + .map(|scalar| { + let mut bytes = [0u8; 32]; + bytes[..scalar.len()].copy_from_slice(scalar); + Scalar::deserialize_compressed(&bytes[..]).map_err(|_| PoseidonError::NotCanonical) + }) + .collect::, PoseidonError>>() + } +} + +impl Hasher for PoseidonJubjub { + type Out = sp_core::H256; + type StdHasher = Hash256StdHasher; + const LENGTH: usize = 32; + + fn hash(s: &[u8]) -> Self::Out { + // TODO: we are assuming false - would be ideal if we could assume true + let msg = Self::msg_from_bytes(s, false).expect("Conversion should not fail."); + + let out_fr = Self::hash(&msg); + + let mut out = [0u8; 32]; + out_fr.serialize_compressed(out.as_mut_slice()).expect("Failed to serialize."); + out.into() + } +} + +#[runtime_interface] +pub trait PoseidonTrie { + /// A trie root formed from the iterated items using Poseidon + fn poseidon_jubjub_root( + input: PassFatPointerAndDecode, Vec)>>, + version: PassAs, + ) -> AllocateAndReturnPointer { + match version { + StateVersion::V0 => LayoutV0::::trie_root(input), + StateVersion::V1 => LayoutV1::::trie_root(input), + } + } + + /// A trie root formed from the enumerated items using Poseidon + fn poseidon_jubjub_ordered_root( + input: PassFatPointerAndDecode>>, + version: PassAs, + ) -> AllocateAndReturnPointer { + match version { + StateVersion::V0 => LayoutV0::::ordered_trie_root(input), + StateVersion::V1 => LayoutV1::::ordered_trie_root(input), + } + } +} + +impl Hash for PoseidonJubjub { + type Output = H256; + + fn ordered_trie_root(input: Vec>, version: StateVersion) -> Self::Output { + poseidon_trie::poseidon_jubjub_ordered_root(input, version) + } + + fn trie_root(input: Vec<(Vec, Vec)>, version: StateVersion) -> Self::Output { + poseidon_trie::poseidon_jubjub_root(input, version) + } +} diff --git a/toolkit/utils/schnorr_jubjub/src/poseidon/poseidon_cpu.rs b/toolkit/utils/schnorr_jubjub/src/poseidon/poseidon_cpu.rs new file mode 100644 index 0000000000..b5d8a706e8 --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/poseidon/poseidon_cpu.rs @@ -0,0 +1,202 @@ +use crate::PoseidonJubjub; +use alloc::vec::Vec; +use ark_ec::AdditiveGroup; +use ark_ed_on_bls12_381::Fq as Scalar; +use ark_ff::Field; + +use super::{ + constants::{NB_FULL_ROUNDS, NB_PARTIAL_ROUNDS, PoseidonField, RATE, WIDTH}, + round_skips::PreComputedRoundCPU, +}; + +/// Number of times the linear part of the partial rounds is skipped in the +/// Poseidon cpu implemetation (0 is the default implementation without skips at +/// all). +pub(crate) const NB_SKIPS_CPU: usize = 2; + +/// Off-circuit Poseidon state. +#[derive(Clone, Debug)] +pub struct PoseidonState { + pre_computed: PreComputedRoundCPU, + register: [Scalar; WIDTH], + queue: Vec, + squeeze_position: usize, + input_len: Option, +} + +// Applies the MDS matrix to a state and adds the round constants. All arguments +// have length `WIDTH`. To save the addition cost, the implementation is done by +// mutating the `constants` slice, and eventually copying it into `state`. +fn linear_layer(state: &mut [F], constants: &mut [F]) { + #[allow(clippy::needless_range_loop)] + for i in 0..WIDTH { + for j in 0..WIDTH { + constants[i] += F::MDS[i][j] * state[j]; + } + } + state.copy_from_slice(constants); +} + +/// A cpu version of the full round of Poseidon's permutation. Operates by +/// mutating the `state` argument (length `WIDTH`). +pub(crate) fn full_round_cpu(round: usize, state: &mut [F]) { + state.iter_mut().for_each(|x| *x = x.square().square() * *x); + let mut new_state = if round == NB_FULL_ROUNDS + NB_PARTIAL_ROUNDS - 1 { + [F::ZERO; WIDTH] + } else { + F::ROUND_CONSTANTS[round + 1] + }; + linear_layer(state, &mut new_state); +} + +// A cpu version of Poseidon with `1 + NB_SKIPS_CIRCUIT` partial rounds. +fn partial_round_cpu( + pre_computed: &PreComputedRoundCPU, + round: usize, + state: &mut [Scalar], // Length `WIDTH`. +) { + pre_computed + .partial_round_id + .eval::(&pre_computed.round_constants[round], state); +} + +// Alternative partial round version, without any skips. +fn partial_round_cpu_raw(round: usize, state: &mut [Scalar]) { + state[WIDTH - 1] *= state[WIDTH - 1].square().square(); + let mut new_state = Scalar::ROUND_CONSTANTS[round + 1]; + linear_layer(state, &mut new_state) +} + +/// A cpu version of the full Poseidon's permutation with partial-round skips. +pub fn permutation_cpu(pre_computed: &PreComputedRoundCPU, state: &mut [Scalar]) { + let nb_skips = pre_computed.partial_round_id.nb_skips; + let nb_main_partial_rounds = NB_PARTIAL_ROUNDS / (1 + nb_skips); + let remainder_partial_rounds = NB_PARTIAL_ROUNDS % (1 + nb_skips); + + for (x, k0) in state.iter_mut().zip(Scalar::ROUND_CONSTANTS[0]) { + *x += k0; + } + (0..NB_FULL_ROUNDS / 2).for_each(|round| full_round_cpu(round, state)); + (0..nb_main_partial_rounds).for_each(|round| partial_round_cpu(pre_computed, round, state)); + (NB_FULL_ROUNDS / 2 + NB_PARTIAL_ROUNDS - remainder_partial_rounds..) + .take(remainder_partial_rounds) + .for_each(|round| partial_round_cpu_raw(round, state)); + (NB_FULL_ROUNDS / 2 + NB_PARTIAL_ROUNDS..) + .take(NB_FULL_ROUNDS / 2) + .for_each(|round| { + full_round_cpu(round, state); + }) +} + +// A cpu implementation of the sponge operations, building on the Poseidon's +// permutation. +impl PoseidonJubjub { + pub(crate) fn init(input_len: Option) -> PoseidonState { + let mut register = [Scalar::ZERO; WIDTH]; + register[RATE] = Scalar::from(input_len.map(|l| l as u128).unwrap_or(1 << 64)); + let pre_computed = PreComputedRoundCPU::init(); + PoseidonState { pre_computed, register, queue: Vec::new(), squeeze_position: 0, input_len } + } + + pub(crate) fn absorb(state: &mut PoseidonState, inputs: &[Scalar]) { + state.queue.extend(inputs); + state.squeeze_position = 0; + } + + pub(crate) fn squeeze(state: &mut PoseidonState) -> Scalar { + if state.squeeze_position > 0 { + // If `input_len` was specified, we only allow 1 squeeze. + if state.input_len.is_some() { + panic!("Attempting to squeeze multiple times a fixed-size Poseidon sponge (CPU).") + }; + debug_assert!(state.queue.is_empty()); + let output = state.register[state.squeeze_position % RATE]; + state.squeeze_position = (state.squeeze_position + 1) % RATE; + return output; + } + + match state.input_len { + None => { + let padding = Scalar::from(state.queue.len() as u64); + state.queue.push(padding); + }, + Some(len) => { + if state.queue.len() != len { + panic!( + "Inconsistent lengths in fixed-size Poseidon sponge (CPU). Expected: {}, found: {}.", + len, + state.queue.len() + ) + }; + }, + } + + for chunk in state.queue.chunks(RATE) { + for (entry, value) in state.register.iter_mut().zip(chunk.iter()) { + *entry += value; + } + permutation_cpu(&state.pre_computed, &mut state.register); + } + + state.queue = Vec::new(); + state.squeeze_position = 1 % RATE; + state.register[0] + } + + pub(crate) fn hash(inputs: &[Scalar]) -> Scalar { + let mut state = Self::init(Some(inputs.len())); + Self::absorb(&mut state, inputs); + Self::squeeze(&mut state) + } +} + +#[cfg(test)] +mod tests { + use ark_ff::UniformRand; + use rand::SeedableRng; + use rand_chacha::ChaCha12Rng; + + use super::*; + + // A version of Poseidon's permutation, without round skips. Has been tested + // against the previous version of Poseidon (replaced since Merge request #521). + fn permutation_cpu_raw(state: &mut [Scalar]) { + for (x, k0) in state.iter_mut().zip(Scalar::ROUND_CONSTANTS[0]) { + *x += k0; + } + for round in 0..NB_FULL_ROUNDS / 2 { + full_round_cpu(round, state); + } + for round in (NB_FULL_ROUNDS / 2..).take(NB_PARTIAL_ROUNDS) { + partial_round_cpu_raw(round, state); + } + for round in (NB_FULL_ROUNDS / 2 + NB_PARTIAL_ROUNDS..).take(NB_FULL_ROUNDS / 2) { + full_round_cpu(round, state); + } + } + // Tests the performances of the cpu version of Poseidon. In debug mode, also + // tests the consistency between the version with and without round skips. + fn consistency_cpu(nb_samples: usize) { + let pre_computed = PreComputedRoundCPU::init(); + let mut rng = ChaCha12Rng::seed_from_u64(0xf007ba11); + (0..nb_samples) + .for_each(|_| { + let input: [Scalar; WIDTH] = + core::array::from_fn(|_| Scalar::rand(&mut rng)); + let mut res1 = input; + let mut res2 = input; + permutation_cpu_raw(&mut res1); + permutation_cpu(&pre_computed, &mut res2); + if res1 != res2 { + panic!("=> Inconsistencies between the cpu implementations of the permutations.\n\nOn input x = {:?},\n\npermutation_cpu_no_skip(x) = {:?}\n\npermutation_cpu_with_skips(x) = {:?}\n", input, res1, res2) + } + }); + } + + #[test] + fn cpu_test() { + // Testing cpu performances. In debug mode, also tests the consistency between + // the optimised and non-optimised cpu implementations of the permutation. + consistency_cpu(1); + } +} diff --git a/toolkit/utils/schnorr_jubjub/src/poseidon/round_skips.rs b/toolkit/utils/schnorr_jubjub/src/poseidon/round_skips.rs new file mode 100644 index 0000000000..e141864bdf --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/poseidon/round_skips.rs @@ -0,0 +1,244 @@ +use super::constants::{NB_FULL_ROUNDS, NB_PARTIAL_ROUNDS, WIDTH}; +use super::{NB_SKIPS_CPU, PoseidonField}; +use alloc::vec::Vec; +use ark_ec::AdditiveGroup; +use ark_ed_on_bls12_381::Fq as Scalar; +use ark_ff::Field; +use core::iter::repeat; + +/// Maximal number of partial-round skips performed during Poseidon. +pub(crate) const NB_SKIPS_MAX: usize = NB_SKIPS_CPU; + +// Pre-generated partial-round constants for CPU implementations. +type RoundContantsCPU = [[Scalar; WIDTH + NB_SKIPS_CPU]; NB_PARTIAL_ROUNDS / (1 + NB_SKIPS_CPU)]; + +/// Represents a combination +/// `a1 x1 + ... + an xn + b1 y1^5 + ... + bp yp^5 + c1 z1 + ... + cq zq` +/// where the `ai` and `bi` are the field elements stored `var_coeffs`, and the +/// `ci` those in `const_coeffs`. Each index implictly corresponds to a variable +/// `xi` or `yi`, or a round constant `zi`. The slices `var_coeffs[..WIDTH-1]` +/// and `constants` correspond to linear variables/constants `xi`, while +/// `var_coeffs[WIDTH-1..]` is for the variables `yi` that are exponentiated. +/// +/// Note: the size of the array are overapproximated by using `NB_SKIPS_MAX` to +/// avoid having to deal with different types for `NB_SKIPS_CPU` and +/// `NB_SKIPS_CIRCUIT`. This will be the case for all similar types that are +/// only used in precomputations. +#[derive(Clone, Copy, Debug)] +pub(crate) struct RoundVarId { + var_coeffs: [Scalar; WIDTH + NB_SKIPS_MAX], // Length WIDTH + number of round skips. + const_coeffs: [Scalar; WIDTH * (1 + NB_SKIPS_MAX)], // Length 1 + number of round skips. +} + +/// A set of linear combinations representing a set of polynomial identities +/// characterising partial rounds. Identities in `ids[..WIDTH-1]` are for the +/// cells that do not go through an exponentiation, unlike those in +/// `ids[WIDTH-1..]`. +/// +/// Note: Unlike the field `var_coeffs` which has `WIDTH + nb_skips` elements, +/// `ids` contains `WIDTH + nb_skips + 1` identities. The additional element (at +/// index 0) represents the last input of the round (which is a trivial +/// identity, simply here for the convenience of the computation). +#[derive(Clone, Copy, Debug)] +pub(crate) struct RoundId { + pub nb_skips: usize, + ids: [RoundVarId; WIDTH + 1 + NB_SKIPS_MAX], // Real length `WIDTH + 1 + self.nb_skips`. +} + +/// Precomputed data for cpu partial rounds (round constants and round +/// identities). The `round_constants` field has dimension `[[F; WIDTH + +/// self.partial_round_id.nb_skips]; NB_FULL_ROUNDS + NB_PARTIAL_ROUNDS / (1 + +/// self.partial_round_id.nb_skips)]`. +#[derive(Clone, Copy, Debug)] +pub struct PreComputedRoundCPU { + pub(crate) round_constants: RoundContantsCPU, + pub(crate) partial_round_id: RoundId, +} + +impl RoundVarId { + // `id1.add_and_mul(id2,c)` adds `c * id2` to `id1`. + fn add_and_mul(&mut self, rhs: &Self, c: &Scalar) { + self.var_coeffs + .iter_mut() + .chain(self.const_coeffs.iter_mut()) + .zip(rhs.var_coeffs.iter().chain(rhs.const_coeffs.iter())) + .for_each(|(a, b)| *a += *b * *c) + } + + // Generates a null linear combination. + fn init() -> Self { + RoundVarId { + var_coeffs: [Scalar::ZERO; WIDTH + NB_SKIPS_MAX], + const_coeffs: [Scalar::ZERO; WIDTH * (1 + NB_SKIPS_MAX)], + } + } + + // Generates a linear combination equal to a given constant, modelled by its + // indexes in the field `constants`. + fn from_constant_index(round_offset: &usize, column: &usize) -> Self { + let mut id = Self::init(); + id.const_coeffs[*round_offset * WIDTH + *column] = Scalar::ONE; + id + } + + // Takes a valuation for each variable of the `constants` field, and returns the + // evaluation of the linear combination when evaluating all other variables as + // zero. The argument `instances` has length `1 + self.nb_skips`. + fn eval_constants(&self, instances: &[[Scalar; WIDTH]]) -> Scalar { + self.const_coeffs + .iter() + .zip(instances.iter().flatten()) + .fold(Scalar::ZERO, |accu, (x1, x2)| accu + *x1 * x2) + } + + // Takes a valuation for each variable of `self.var_coeffs` and returns the + // evaluation of the linear combination when evaluating all variables of + // `self.constants` as zero. This function assumes that all non-linear + // variables have already been exponentiated. + fn eval_vars( + &self, + instances: &[Scalar], // Has length `WIDTH + self.nb_skips`. + constant: Scalar, + ) -> Scalar { + self.var_coeffs + .iter() + .zip(instances.iter()) + .fold(constant, |accu, (v1, v2)| accu + *v1 * v2) + } +} + +impl RoundId { + // Generates a new trivial identity. The linear variables are initialised to + // themselves ("x = x"), and the exponentiated variables are initialised to 0 + // ("x = 0"). The latter will be overwritten during the identity generation + // anyway, so their initialisation does not matter. + fn init(nb_skips: usize) -> Self { + RoundId { + nb_skips, + ids: core::array::from_fn(|i| { + if i < WIDTH + 1 + nb_skips { + let mut id = RoundVarId::init(); + if i < WIDTH { + id.var_coeffs[i] = Scalar::ONE + }; + id + } else { + RoundVarId::init() + } + }), + } + } + + // Reconstructs the identity of the current row, assuming that the identities of + // its linear variables are stored in `self.ids[..WIDTH-1]`. This function + // basically copies `self.ids[..WIDTH-1]` in the first `WIDTH-1` elements of the + // result, and adds a trivial identity ("x = x") in the last exponentiated slot. + fn row_id(&self, row: &usize) -> [RoundVarId; WIDTH] { + let mut last = RoundVarId::init(); + last.var_coeffs[WIDTH - 1 + *row] = Scalar::ONE; + core::array::from_fn(|i| if i == WIDTH - 1 { last } else { self.ids[i] }) + } + + // Updates the identity from the current row to the next one by applying a + // partial round. + fn update_row(self: &mut RoundId, round_offset: &usize) { + let current_row = self.row_id(round_offset); + #[allow(clippy::needless_range_loop)] + for i in 0..WIDTH - 1 { + self.ids[i] = RoundVarId::from_constant_index(round_offset, &i); + for j in 0..WIDTH { + self.ids[i].add_and_mul(¤t_row[j], &Scalar::MDS[i][j]); + } + } + self.ids[WIDTH + *round_offset] = + RoundVarId::from_constant_index(round_offset, &(WIDTH - 1)); + #[allow(clippy::needless_range_loop)] + for j in 0..WIDTH { + self.ids[WIDTH + *round_offset] + .add_and_mul(¤t_row[j], &Scalar::MDS[WIDTH - 1][j]); + } + } + + /// Generates the final identities for an optimised partial rounds, i.e., + /// applies `1+nb_skips` times the function `ids.update_row`. + fn generate(nb_skips: usize) -> Self { + let mut ids = RoundId::init(nb_skips); + for row in 0..1 + nb_skips { + ids.update_row(&row); + } + ids + } + + // Uplifting of the function `RoundVarId::eval_constants` to sets of + // identities. The `instances` argument has length `1 + self.nb_skips`, and the + // result has length `WIDTH + self.nb_skips`. Mutates the `arg` argument to + // store the result. + fn eval_constants(&self, round: usize, arg: &mut [Scalar]) { + let instances = &Scalar::ROUND_CONSTANTS[round + 1..round + 2 + self.nb_skips]; + self.ids[..WIDTH - 1] + .iter() + .chain(self.ids[WIDTH..].iter()) + .map(|id| id.eval_constants(instances)) + .zip(arg.iter_mut()) + .for_each(|(c, x)| *x = c) + } + + /// Uplifting of the function `RoundVarId::eval_vars` to sets of + /// identities, and adds the output of `self.eval_constants` to the result + /// (taken as the `round_constants` argument). Returns the value of + /// the last column of the skipped rows (length `self.nb_skips`, passed as + /// the parameter `NB_SKIPS` so that it can be used as array's length). + pub(crate) fn eval( + &self, + round_constants: &[Scalar], // Length `WIDTH + self.nb_skips`. + instances: &mut [Scalar], // Length `WIDTH`. + ) -> [Scalar; NB_SKIPS] { + let mut pow_instances = [Scalar::ZERO; NB_SKIPS]; + instances[WIDTH - 1] *= instances[WIDTH - 1].square().square(); + let mut pow_instances_exp = instances + .iter() + .chain(repeat(&Scalar::ZERO).take(NB_SKIPS)) + .copied() + .collect::>(); + + #[allow(clippy::reversed_empty_ranges)] + for i in 0..self.nb_skips { + let next = + self.ids[WIDTH + i].eval_vars(&pow_instances_exp, round_constants[WIDTH - 1 + i]); + pow_instances[i] = next; + pow_instances_exp[WIDTH + i] = next.square().square() * next; + } + let mut output = [Scalar::ZERO; WIDTH]; + for i in 0..WIDTH - 1 { + output[i] = self.ids[i].eval_vars(&pow_instances_exp, round_constants[i]); + } + output[WIDTH - 1] = self.ids[WIDTH + NB_SKIPS] + .eval_vars(&pow_instances_exp, round_constants[WIDTH + NB_SKIPS - 1]); + instances.copy_from_slice(&output); + pow_instances + } + + // Computes the round constants necessary for partial-round (cpu) with + // round skips. + fn round_constants_cpu(&self) -> RoundContantsCPU { + let mut v = [[Scalar::ZERO; WIDTH + NB_SKIPS_CPU]; NB_PARTIAL_ROUNDS / (1 + NB_SKIPS_CPU)]; + for (round, main_round) in (NB_FULL_ROUNDS / 2..) + .take(NB_PARTIAL_ROUNDS - NB_PARTIAL_ROUNDS % (1 + NB_SKIPS_CPU)) + .step_by(1 + NB_SKIPS_CPU) + .zip(0..) + { + self.eval_constants(round, &mut v[main_round]) + } + v + } +} + +impl PreComputedRoundCPU { + /// Pre-computes partial rounds and the associated round contants for + /// Poseidon's using NB_SKIPS_CPU round skips. + pub fn init() -> Self { + let partial_round_id = RoundId::generate(NB_SKIPS_CPU); + let round_constants = partial_round_id.round_constants_cpu(); + PreComputedRoundCPU { partial_round_id, round_constants } + } +} diff --git a/toolkit/utils/schnorr_jubjub/src/primitive.rs b/toolkit/utils/schnorr_jubjub/src/primitive.rs new file mode 100644 index 0000000000..cc6c545f7f --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/primitive.rs @@ -0,0 +1,292 @@ +#![allow(non_snake_case)] +//! Implementation of the Schnorr signature scheme over the JubJub elliptic +//! curve, using Poseidon as the hash function. +//! +//! This crate provides the core cryptographic primitives needed to generate and +//! verify Schnorr signatures in zero-knowledge-friendly environments. By +//! leveraging the Poseidon hash, it is optimized for use in SNARK-based systems +//! where efficiency in constraint systems is critical. + +use alloc::vec; +use alloc::vec::Vec; +use core::fmt::Debug; +use sha2::Digest; + +use crate::poseidon::{PoseidonError, PoseidonJubjub}; +use alloc::str::FromStr; +use alloc::string::ToString; +use ark_ec::AffineRepr; +use ark_ed_on_bls12_381::{EdwardsAffine as Point, Fq as Scalar, Fr}; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; +use num_bigint::BigUint; + +/// A Schnorr private key is a scalar from the Jubjub scalar field. +#[derive(Clone, Debug)] +pub struct KeyPair(pub(crate) Fr, pub(crate) Point); + +/// A Schnorr public key is a point on the Jubjub curve. +#[derive(Clone, PartialEq, Eq, Debug)] +pub struct VerifyingKey(Point); + +/// A Schnorr signature contains the announcement (nonce commitment) `A` and the +/// signature response `r`. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct SchnorrSignature { + A: Point, + r: Fr, +} + +#[derive(Debug)] +/// Error type used in Schnorr signatures +pub enum SchnorrError { + /// Error converting a message represented in bytes to its field + /// representation. + InvalidMsgFormat, + /// Error converting bytes to a signature. + InvalidSignatureFormat, + /// Error converting bytes to a public key. + InvalidPkFormat, + /// Error verifying a signature. + InvalidSignature, +} + +impl From for SchnorrError { + fn from(value: PoseidonError) -> Self { + match value { + PoseidonError::NotCanonical => Self::InvalidMsgFormat, + } + } +} + +/// Helper function to reduce little endian bytes modulo the order +/// of `Fr` +pub(crate) fn mod_p(bytes: &[u8]) -> Fr { + let biguint = BigUint::from_bytes_be(bytes); + Fr::from_str(&biguint.to_string()) + .expect("Failed to reduce bytes modulo Fr::MODULUS. This is a bug.") +} + +impl KeyPair { + /// Returns the verifying key + pub fn vk(&self) -> VerifyingKey { + VerifyingKey(self.1) + } + + /// Generates a Schnorr keypair from a seed. + pub fn generate_from_seed(seed: &[u8]) -> Self { + let hashed_seed = sha2::Sha512::digest(&seed); + + let sk = mod_p(hashed_seed.as_slice()); + let pk = Point::generator() * sk; + Self(sk, pk.into()) + } + + /// Sign a message using this private key. + pub fn sign(&self, msg: &[Scalar]) -> SchnorrSignature { + let mut bytes_nonce = [0u8; 32]; + self.0 + .serialize_compressed(bytes_nonce.as_mut_slice()) + .expect("Failed to serialize."); + + for scalar in msg { + scalar + .serialize_compressed(bytes_nonce.as_mut_slice()) + .expect("Failed to serialize."); + } + + // Generate a random nonce + // TODO: We compute it deterministically (as done in ed25519) to avoid needing a RNG + let h = sha2::Sha512::digest(&bytes_nonce); + + let a = mod_p(h.as_slice()); + let A = (Point::generator() * a).into(); + + // Compute challenge e = H(R || PK || msg) + let c_input = [ + &to_coords(&A).expect("Shouldn't produce a signature with nonce = 0."), + &to_coords(&self.1).expect("Your verifying key is the identity! This is a bug."), + msg, + ] + .concat(); + let c = hash_to_jj_scalar(&c_input); + + // Compute the response, r = a + c * sk + let r = a + c * self.0; + + SchnorrSignature { A, r } + } +} + +impl SchnorrSignature { + /// Verify a Schnorr signature. + /// + /// # Error + /// Function fails if the signature is not valid + pub fn verify(&self, msg: &[Scalar], pk: &VerifyingKey) -> Result<(), SchnorrError> { + let c_input = [ + &to_coords(&self.A).ok_or(SchnorrError::InvalidSignature)?, + &to_coords(&pk.0).ok_or(SchnorrError::InvalidSignature)?, + msg, + ] + .concat(); + + let c = hash_to_jj_scalar(&c_input); + + if Point::generator() * self.r == self.A + pk.0 * c { + Ok(()) + } else { + Err(SchnorrError::InvalidSignature) + } + } +} + +impl SchnorrSignature { + /// Converts a signature to a byte array. + pub fn to_bytes(&self) -> [u8; 64] { + let mut out = [0u8; 64]; + self.A.serialize_compressed(out.as_mut_slice()).expect("Failed to serialize."); + self.r.serialize_compressed(&mut out[32..]).expect("Failed to serialize."); + + out + } + + /// Converts a slice of bytes to a Signature + /// + /// # Error + /// if the bytes do not represent a canonical `(Point, Scalar)` pair. + pub fn from_bytes(bytes: &[u8]) -> Result { + let A = Point::deserialize_compressed(&bytes[..32]) + .map_err(|_| SchnorrError::InvalidSignatureFormat)?; + let r = Fr::deserialize_compressed(&bytes[32..]) + .map_err(|_| SchnorrError::InvalidSignatureFormat)?; + + Ok(Self { A, r }) + } +} + +impl VerifyingKey { + /// Converts a verifying key to a byte array. + pub fn to_bytes(&self) -> [u8; 32] { + let mut out = [0u8; 32]; + self.0.serialize_compressed(out.as_mut_slice()).expect("Failed to serialize"); + out + } + + /// Converts a slice of bytes to a VerifyingKey + /// + /// # Error + /// if the bytes do not represent a canonical `Point` pair. + pub fn from_bytes(bytes: &[u8]) -> Result { + let pk = Point::deserialize_compressed(bytes).map_err(|_| SchnorrError::InvalidPkFormat)?; + + Ok(Self(pk)) + } +} + +/// Helper function that converts a `JubJubSubgroup` point to its coordinates +fn to_coords(point: &Point) -> Option> { + let (x, y) = point.xy()?; + + Some(vec![x, y]) +} + +/// Helper function that hashes into a JubJub scalar, by taking the mod +/// reduction of the output (which is in the base field, or BLS12-381's scalar +/// field). +fn hash_to_jj_scalar(input: &[Scalar]) -> Fr { + let mut state = PoseidonJubjub::init(Some(input.len())); + PoseidonJubjub::absorb(&mut state, input); + let e = PoseidonJubjub::squeeze(&mut state); + + // Now we need to convert a BLS scalar to a JubJub scalar + let mut bytes_wide = [0u8; 64]; + e.serialize_compressed(bytes_wide.as_mut_slice()).expect("Failed to serialize"); + + mod_p(&bytes_wide) +} + +#[cfg(test)] +mod tests { + use ark_ff::UniformRand; + use rand_core::{OsRng, RngCore}; + + use super::*; + + #[test] + fn schnorr_jubjub() { + let mut rng = OsRng; + let mut seed = [0u8; 32]; + rng.fill_bytes(&mut seed); + + let signing_key = KeyPair::generate_from_seed(&seed); + let msg = Scalar::rand(&mut rng); + + let sig = signing_key.sign(&[msg]); + + assert!(sig.verify(&[msg], &signing_key.vk()).is_ok()); + } + + #[test] + fn schnorr_jubjub_bytes() { + let mut rng = OsRng; + let mut seed = [0u8; 32]; + rng.fill_bytes(&mut seed); + + let signing_key = KeyPair::generate_from_seed(&seed); + + let mut msg = [0u8; 32]; + Scalar::rand(&mut rng).serialize_compressed(msg.as_mut_slice()).unwrap(); + let msg = PoseidonJubjub::msg_from_bytes(&msg, true).unwrap(); + + let sig = signing_key.sign(&msg); + + assert!(sig.verify(&msg, &signing_key.vk()).is_ok()); + + let mut msg = [0u8; 100]; + rng.fill_bytes(&mut msg); + let msg = PoseidonJubjub::msg_from_bytes(&msg, false) + .expect("With flag set to false, this should not fail. Report a bug."); + + let sig = signing_key.sign(&msg); + + assert!(sig.verify(&msg, &signing_key.vk()).is_ok()); + } + + #[test] + fn serde() { + let mut rng = OsRng; + let mut seed = [0u8; 32]; + rng.fill_bytes(&mut seed); + + let signing_key = KeyPair::generate_from_seed(&seed); + let msg = Scalar::rand(&mut rng); + + let sig = signing_key.sign(&[msg]); + + let vk = signing_key.vk(); + let ser_vk = vk.to_bytes(); + let deser_vk = VerifyingKey::from_bytes(&ser_vk).unwrap(); + + assert!(sig.verify(&[msg], &deser_vk).is_ok()); + + let ser_sig = sig.to_bytes(); + let deser_sig = SchnorrSignature::from_bytes(&ser_sig).unwrap(); + + assert!(deser_sig.verify(&[msg], &vk).is_ok()); + } + + // Helper test to generate test-vectors + // #[test] + // fn print_data() { + // let seed = + // b"belt hurt material survey skate group illness health electric frown live sword"; + // println!("{:?}", hex::encode(seed)); + // let keypair = KeyPair::generate_from_seed(seed); + // + // let vk = keypair.vk(); + // println!("{}", hex::encode(vk.to_bytes())); + // + // // let ss58 = vk.to_ss58check(); + // // println!("{}", ss58); + // } +} diff --git a/toolkit/utils/schnorr_jubjub/src/runtime.rs b/toolkit/utils/schnorr_jubjub/src/runtime.rs new file mode 100644 index 0000000000..e7be305df1 --- /dev/null +++ b/toolkit/utils/schnorr_jubjub/src/runtime.rs @@ -0,0 +1,78 @@ +//! Implements runtime traits required by the Substrate framework. +//! +//! This module provides trait implementations that integrate cryptographic +//! primitives and keystore functionality into the Substrate runtime +//! environment, enabling their use in on-chain logic and consensus mechanisms. + +use alloc::vec::Vec; +use sp_core::{ByteArray, Pair as TraitPair, crypto::KeyTypeId}; +use sp_runtime::app_crypto::RuntimePublic; +use sp_runtime_interface::{ + pass_by::{ + AllocateAndReturnByCodec, PassFatPointerAndDecode, PassFatPointerAndRead, + PassPointerAndReadCopy, + }, + runtime_interface, +}; + +use crate::poseidon::PoseidonJubjub; +use crate::{ + beefy_structures::{CRYPTO_ID, Public, Signature}, + primitive::{SchnorrSignature, VerifyingKey}, +}; + +impl RuntimePublic for Public { + type Signature = Signature; + + fn all(key_type: KeyTypeId) -> Vec { + let all = sp_io::generic_crypto::keys(key_type); + + all.iter() + .map(|bytes| Public::try_from(bytes.as_slice()).expect("Invalid format in keystore")) + .collect::>() + } + + fn generate_pair(key_type: KeyTypeId, seed: Option>) -> Self { + let seed: [u8; 64] = seed + .expect("Only support key generation from given seed.") + .try_into() + .expect("Invalid seed size."); + + let keypair = crate::primitive::KeyPair::generate_from_seed(&seed); + let seed = core::str::from_utf8(&seed).expect("Seed contains non-UTF8 characters"); + sp_io::generic_crypto::insert(key_type, seed, &keypair.public().0); + + keypair.public() + } + + fn sign>(&self, key_type: KeyTypeId, msg: &M) -> Option { + let bytes = sp_io::generic_crypto::sign_with(key_type, CRYPTO_ID.0, &self.0, msg.as_ref())?; + + Signature::try_from(bytes.as_ref()).ok() + } + + fn verify>(&self, msg: &M, signature: &Self::Signature) -> bool { + let msg = PoseidonJubjub::msg_from_bytes(msg.as_ref(), false) + .expect("With flag set to false, this should not fail. Report a bug."); + + let sig = SchnorrSignature::from_bytes(signature.as_ref()); + let pubkey = VerifyingKey::from_bytes(self.as_ref()); + + match (sig, pubkey) { + (Ok(sig), Ok(pubkey)) => sig.verify(&msg, &pubkey).is_ok(), + (_, _) => false, + } + } + + fn generate_proof_of_possession(&mut self, _key_type: KeyTypeId) -> Option { + unimplemented!() + } + + fn verify_proof_of_possession(&self, _pop: &Self::Signature) -> bool { + unimplemented!() + } + + fn to_raw_vec(&self) -> Vec { + self.as_slice().to_vec() + } +}