diff --git a/Cargo.lock b/Cargo.lock index 50fd9134..d5cf5844 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2033,36 +2033,36 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0920ef6863433fa28ece7e53925be4cd39a913adba2dc3738f4edd182f76d168" +checksum = "81a2690ac71eccd7d461d890cf27e0e2315f607cae33962bfd830ddaabf47c14" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8990a217e2529a378af1daf4f8afa889f928f07ebbde6ae2f058ae60e40e2c20" +checksum = "8b5bce8e2b3df5842dd46c75c1ea2be08605d15eef736ef26b643fe4879baa1d" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62225596b687f69a42c038485a28369badc186cb7c74bd9436eeec9f539011b1" +checksum = "4547729bf44512baeb3c32b51f72e35848b285ed2c47ccf66e0c4e456e33fd28" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c23914fc4062558650a6f0d8c1846c97b541215a291fdeabc85f68bdc9bbcca3" +checksum = "b18af34e43a5e32680668790536479b02815827c2a23b4653eca302854c6dfd3" dependencies = [ "serde", "serde_derive", @@ -2070,9 +2070,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a238b2f7e7ec077eb170145fa15fd8b3d0f36cc83d8e354e29ca550f339ca7" +checksum = "c8441e97c85a48e7e9611fb57c592f28e39800fd944f0b2ad773fe15e7f7c5b3" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -2097,9 +2097,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315ddcc2512513a9d66455ec89bb70ae5498cb472f5ed990230536f4cd5c011" +checksum = "4488710ada4f13b6a70a3870eab717768ce7fe3030d544b856e1c32189ca1e75" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -2110,24 +2110,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6acea40ef860f28cb36eaad479e26556c1e538b0a66fc44598cf1b1689393d" +checksum = "e0b76e4f4aeb6ce69a166046a8d26452e5b43568df1ebdc17c7e4ad278b380e4" [[package]] name = "cranelift-control" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2af895da90761cfda4a4445960554fcec971e637882eda5a87337d993fe1b9" +checksum = "a015955e26dd19cdf9fbbb88ec57468877f82f0cbf2858da5dcd7222a0fc5bc8" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8c542c856feb50d504e4fc0526b3db3a514f882a9f68f956164531517828ab" +checksum = "defcb55924447ab5b45e1587c1f23a239e1933d21257687a5d4adc5be8ea217c" dependencies = [ "cranelift-bitset", "serde", @@ -2136,9 +2136,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9996dd9c20929c03360fe0c4edf3594c0cbb94525bdbfa04b6bb639ec14573c7" +checksum = "ddb2862d5f1bbfd3be73afb02f5bc4267195f050cb33b01c609b0d95b3584b44" dependencies = [ "cranelift-codegen", "log", @@ -2148,15 +2148,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928b8dccad51b9e0ffe54accbd617da900239439b13d48f0f122ab61105ca6ad" +checksum = "e9b52d2ad05a86c4dd84e87ad0d40e4db9406bec671450fe223321abef377cfa" [[package]] name = "cranelift-native" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f75ef0a6a2efed3a2a14812318e28dc82c214eab5399c13d70878e2f88947b5" +checksum = "ec4a23e24afffe8001617af9720eda68c296a4bc618b5de54dbb15b0d1ebcc3e" dependencies = [ "cranelift-codegen", "libc", @@ -2165,9 +2165,9 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.123.2" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673bd6d1c83cb41d60afb140a1474ef6caf1a3e02f3820fc522aefbc93ac67d6" +checksum = "14f99257b0c0c5c9cf9b1a8a57a52d88da92a8eca892264770b8fdc971bc1fee" [[package]] name = "crc" @@ -2477,6 +2477,15 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + [[package]] name = "der" version = "0.7.10" @@ -3190,7 +3199,7 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", ] @@ -3223,7 +3232,7 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" version = "41.0.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support", "frame-support-procedural", @@ -3246,7 +3255,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "41.0.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support", "frame-system", @@ -3262,7 +3271,7 @@ dependencies = [ [[package]] name = "frame-support" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -3295,7 +3304,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "34.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "Inflector", "cfg-expr", @@ -3314,7 +3323,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -3326,7 +3335,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "proc-macro2", "quote", @@ -3336,7 +3345,7 @@ dependencies = [ [[package]] name = "frame-system" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "cfg-if", "frame-support", @@ -3353,7 +3362,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.47.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support", "parity-scale-codec", @@ -3535,6 +3544,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.9.4", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "generalized-bulletproofs" version = "0.1.0" @@ -4366,6 +4397,26 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] + [[package]] name = "jobserver" version = "0.1.34" @@ -6118,7 +6169,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support", "frame-system", @@ -6130,7 +6181,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6151,7 +6202,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6171,7 +6222,18 @@ dependencies = [ [[package]] name = "pallet-session" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session-original", + "parity-scale-codec", +] + +[[package]] +name = "pallet-session-original" +version = "41.0.0" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-support", "frame-system", @@ -6191,7 +6253,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6795,9 +6857,9 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e2d31146038fd9e62bfa331db057aca325d5ca10451a9fe341356cead7da53" +checksum = "8f7159de445954dbe57b9203601251a01fea463ee36d1a89a0aeccc7c5325776" dependencies = [ "cranelift-bitset", "log", @@ -6807,9 +6869,9 @@ dependencies = [ [[package]] name = "pulley-macros" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb9fdafaca625f9ea8cfa793364ea1bdd32d306cff18f166b00ddaa61ecbb27" +checksum = "da6890d68b9b1ad87612dd8b7df836a53261df8223295a39a46e63a905a352f2" dependencies = [ "proc-macro2", "quote", @@ -7116,9 +7178,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.12.2" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" +checksum = "efd8138ce7c3d7c13be4f61893154b5d711bd798d2d7be3ecb8dcc7e7a06ca98" dependencies = [ "allocator-api2", "bumpalo", @@ -7656,7 +7718,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "32.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "log", "sp-core", @@ -7667,7 +7729,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.51.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -7698,7 +7760,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "futures", "log", @@ -7719,7 +7781,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.45.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "sp-api", @@ -7734,7 +7796,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "44.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "parity-scale-codec", @@ -7758,7 +7820,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -7769,7 +7831,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.53.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "chrono", @@ -7810,7 +7872,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "fnv", "futures", @@ -7836,7 +7898,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.47.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "hash-db", "kvdb", @@ -7863,7 +7925,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -7886,7 +7948,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.51.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "fork-tree", @@ -7922,7 +7984,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7935,7 +7997,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.36.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "ahash", "array-bytes", @@ -7979,7 +8041,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -8002,7 +8064,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.43.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "parking_lot", @@ -8024,7 +8086,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.39.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -8036,7 +8098,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.39.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "anyhow", "log", @@ -8052,7 +8114,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "console", "futures", @@ -8068,7 +8130,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "36.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "parking_lot", @@ -8082,7 +8144,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.51.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "async-channel", @@ -8128,7 +8190,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.49.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -8138,7 +8200,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.51.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "ahash", "futures", @@ -8157,7 +8219,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "async-channel", @@ -8178,7 +8240,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "async-channel", @@ -8213,7 +8275,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "futures", @@ -8232,7 +8294,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.17.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "bs58", "bytes", @@ -8253,7 +8315,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.20.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8262,7 +8324,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "46.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "futures", "jsonrpsee", @@ -8292,7 +8354,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.50.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -8310,7 +8372,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "23.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -8334,7 +8396,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.51.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "futures", @@ -8367,7 +8429,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.52.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "directories", @@ -8429,7 +8491,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.39.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "log", "parity-scale-codec", @@ -8440,7 +8502,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "43.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "derive_more 1.0.0", "futures", @@ -8460,7 +8522,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "29.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "chrono", "futures", @@ -8479,7 +8541,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "chrono", "console", @@ -8506,7 +8568,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.1.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -8517,7 +8579,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "40.1.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -8547,7 +8609,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -8564,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "19.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-channel", "futures", @@ -9698,6 +9760,10 @@ dependencies = [ "frame-executive", "frame-support", "frame-system", + "pallet-babe", + "pallet-grandpa", + "pallet-session", + "pallet-timestamp", "parity-scale-codec", "serai-abi", "serai-coins-pallet", @@ -9707,6 +9773,7 @@ dependencies = [ "sp-api", "sp-core", "sp-runtime", + "sp-session", "sp-version", "substrate-wasm-builder", ] @@ -10124,7 +10191,7 @@ dependencies = [ [[package]] name = "sp-api" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "hash-db", "log", @@ -10143,7 +10210,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "23.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "Inflector", "blake2 0.10.6", @@ -10157,7 +10224,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "41.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "serde", @@ -10168,7 +10235,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "27.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "integer-sqrt", "num-traits", @@ -10180,7 +10247,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "sp-api", @@ -10190,7 +10257,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "sp-api", "sp-inherents", @@ -10200,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "futures", "parity-scale-codec", @@ -10219,7 +10286,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.43.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "futures", @@ -10233,7 +10300,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.43.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "parity-scale-codec", @@ -10250,7 +10317,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "24.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "finality-grandpa", "log", @@ -10266,7 +10333,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.43.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "serde", @@ -10276,7 +10343,7 @@ dependencies = [ [[package]] name = "sp-core" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -10314,7 +10381,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "blake2b_simd", "byteorder", @@ -10327,7 +10394,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "quote", "sp-crypto-hashing", @@ -10337,7 +10404,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "kvdb", "parking_lot", @@ -10346,7 +10413,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "proc-macro2", "quote", @@ -10356,7 +10423,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "environmental", "parity-scale-codec", @@ -10366,7 +10433,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.18.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "sp-api", @@ -10375,7 +10442,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10387,7 +10454,7 @@ dependencies = [ [[package]] name = "sp-io" version = "41.0.1" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "bytes", "log", @@ -10408,7 +10475,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "42.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "sp-core", "sp-runtime", @@ -10418,7 +10485,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.43.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "parking_lot", @@ -10429,7 +10496,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "thiserror 2.0.16", "zstd", @@ -10438,7 +10505,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "sp-api", "sp-core", @@ -10448,7 +10515,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.2" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "backtrace", "regex", @@ -10457,7 +10524,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "35.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "rustc-hash", "serde", @@ -10467,7 +10534,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "42.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "either", "hash256-std-hasher", @@ -10491,7 +10558,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "30.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "bytes", "parity-scale-codec", @@ -10505,7 +10572,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "19.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "Inflector", "expander", @@ -10518,7 +10585,7 @@ dependencies = [ [[package]] name = "sp-session" version = "39.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "sp-api", @@ -10531,7 +10598,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "39.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -10543,7 +10610,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.46.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "hash-db", "log", @@ -10563,12 +10630,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10580,7 +10647,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "async-trait", "parity-scale-codec", @@ -10592,7 +10659,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.1.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "tracing", @@ -10603,7 +10670,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "37.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "sp-api", "sp-runtime", @@ -10612,7 +10679,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "ahash", "foldhash 0.1.5", @@ -10636,7 +10703,7 @@ dependencies = [ [[package]] name = "sp-version" version = "40.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10652,7 +10719,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -10664,7 +10731,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "22.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10676,7 +10743,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "32.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -10825,7 +10892,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.6" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "http-body-util", "hyper", @@ -10839,7 +10906,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "27.0.0" -source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=16336c737dbe833e9d138a256af99698aba637c7#16336c737dbe833e9d138a256af99698aba637c7" +source = "git+https://github.com/serai-dex/patch-polkadot-sdk?rev=ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9#ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" dependencies = [ "cargo_metadata", "console", @@ -11745,9 +11812,9 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c" dependencies = [ "leb128fmt", "wasmparser", @@ -11804,9 +11871,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" +checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0" dependencies = [ "bitflags 2.9.4", "hashbrown 0.15.5", @@ -11817,9 +11884,9 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.236.1" +version = "0.239.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" +checksum = "b3981f3d51f39f24f5fc90f93049a90f08dbbca8deba602cd46bb8ca67a94718" dependencies = [ "anyhow", "termcolor", @@ -11828,18 +11895,21 @@ dependencies = [ [[package]] name = "wasmtime" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3e1fab634681494213138ea3a18e958e5ea99da13a4a01a4b870d51a41680b" +checksum = "aa7ab136a5ffcba0924aa0ec30fd6b867ae1559dda6d8598edd910fc13637581" dependencies = [ "addr2line 0.25.1", "anyhow", + "async-trait", "bitflags 2.9.4", "bumpalo", "cc", "cfg-if", + "fxprof-processed-profile", "hashbrown 0.15.5", "indexmap 2.11.4", + "ittapi", "libc", "log", "mach2", @@ -11852,6 +11922,7 @@ dependencies = [ "rustix", "serde", "serde_derive", + "serde_json", "smallvec", "target-lexicon", "wasmparser", @@ -11871,9 +11942,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6750e519977953a018fe994aada7e02510aea4babb03310aa5f5b4145b6e6577" +checksum = "77f27634b6956288419c7ca96e7b845c4a60e401ed5094575b0c7c7d9fcd3257" dependencies = [ "anyhow", "cranelift-bitset", @@ -11894,18 +11965,18 @@ dependencies = [ [[package]] name = "wasmtime-internal-asm-macros" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbf38adac6e81d5c0326e8fd25f80450e3038f2fc103afd3c5cc8b83d5dd78b" +checksum = "fe8fa44de0bc99734251dca61754f6ea4899b6442439f3ededd8c4d5fd7ff1d5" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-internal-cache" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c9085d8c04cc294612d743e2f355382b39250de4bd20bf4b0b0b7c0ae7067a" +checksum = "4be24fe2e182d88ca5318990ae8fd7df1cd40245cdcf38e185f9b35fbcc479c2" dependencies = [ "anyhow", "base64", @@ -11923,9 +11994,9 @@ dependencies = [ [[package]] name = "wasmtime-internal-cranelift" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85b8ba128525bff91b89ac8a97755136a4fb0fb59df5ffb7539dd646455d441" +checksum = "aff25d5a2e6e1ddc6bf2657ab1041531c49d4d5cdf389ebdf75e48f875ff3e55" dependencies = [ "anyhow", "cfg-if", @@ -11945,14 +12016,15 @@ dependencies = [ "wasmparser", "wasmtime-environ", "wasmtime-internal-math", + "wasmtime-internal-unwinder", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-fiber" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c566f5137de1f55339df8a236a5ec89698b466a3d33f9cc07823a58a3f85e16" +checksum = "8a6c5c1a489b7ff051eb08d940b768bcce963258c87b54bfe4ce0a41fc7a1eed" dependencies = [ "anyhow", "cc", @@ -11966,19 +12038,21 @@ dependencies = [ [[package]] name = "wasmtime-internal-jit-debug" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03f0b11f8fe4d456feac11e7e9dc6f02ddb34d4f6a1912775dbc63c5bdd5670" +checksum = "1d13fd1cf8f7e175775a611d0520c4f20dbf9b2d51a8a38da03576bb35097c4b" dependencies = [ "cc", + "object 0.37.3", + "rustix", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71aeb74f9b3fd9225319c723e59832a77a674b0c899ba9795f9b2130a6d1b167" +checksum = "c0484c08f1f6e40f20052c278b7526447725c95a1bd11eaae34c1cffa641d8f4" dependencies = [ "anyhow", "cfg-if", @@ -11988,24 +12062,24 @@ dependencies = [ [[package]] name = "wasmtime-internal-math" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d5dad8a609c6cc47a5f265f13b52e347e893450a69641af082b8a276043fa7" +checksum = "b7b3389ad3d1281036f62fcd05e5817d9521b08d8143cbf9060843caa0ef5b8d" dependencies = [ "libm", ] [[package]] name = "wasmtime-internal-slab" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d152a7b875d62e395bfe0ae7d12e7b47cd332eb380353cce3eb831f9843731d" +checksum = "41364714f23643bbc4df28ab4f63573c48a6f2d6b841a74cdb98380b7e4d3682" [[package]] name = "wasmtime-internal-unwinder" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aaacc0fea00293f7af7e6c25cef74b7d213ebbe7560c86305eec15fc318fab8" +checksum = "123f311442d35895fd17505b73cbc07501b62804f0f6303aac548274b5d81095" dependencies = [ "anyhow", "cfg-if", @@ -12016,9 +12090,9 @@ dependencies = [ [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "36.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61c7f75326434944cc5f3b75409a063fa37e537f6247f00f0f733679f0be406" +checksum = "abf48613033d168512acc287b22e256fc6d39f21e78de2d96b2ab24d8d6b8840" dependencies = [ "proc-macro2", "quote", diff --git a/substrate/abi/Cargo.toml b/substrate/abi/Cargo.toml index d822faee..4239caa8 100644 --- a/substrate/abi/Cargo.toml +++ b/substrate/abi/Cargo.toml @@ -22,12 +22,12 @@ workspace = true borsh = { version = "1", default-features = false, features = ["derive", "de_strict_order"] } bitvec = { version = "1", default-features = false, features = ["alloc"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serde = { version = "1", default-features = false, features = ["derive"], optional = true } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"], optional = true } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, features = ["serde"], optional = true } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, features = ["serde"], optional = true } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, optional = true } serai-primitives = { path = "../primitives", version = "0.1", default-features = false } diff --git a/substrate/abi/src/signals.rs b/substrate/abi/src/signals.rs index b9d2faaf..c5a4c632 100644 --- a/substrate/abi/src/signals.rs +++ b/substrate/abi/src/signals.rs @@ -47,6 +47,8 @@ pub enum Call { stand_against { /// The signal to stand against. signal: Signal, + /// The network this validator is standing against the signal on behalf of. + with_network: NetworkId, }, } diff --git a/substrate/abi/src/validator_sets.rs b/substrate/abi/src/validator_sets.rs index a8a22c35..42576328 100644 --- a/substrate/abi/src/validator_sets.rs +++ b/substrate/abi/src/validator_sets.rs @@ -13,8 +13,8 @@ use serai_primitives::{ pub enum Call { /// Set the keys for a validator set. set_keys { - /// The validator set which is setting their keys. - validator_set: ExternalValidatorSet, + /// The network whose latest decided validator set is setting their keys.. + network: ExternalNetworkId, /// The keys being set. key_pair: KeyPair, /// The participants in the validator set who signed off on these keys. @@ -29,8 +29,8 @@ pub enum Call { }, /// Report a validator set's slashes onto Serai. report_slashes { - /// The validator set which is setting their keys. - validator_set: ExternalValidatorSet, + /// The network whose latest retired validator set is reporting their slashes. + network: ExternalNetworkId, /// The slashes they're reporting. slashes: SlashReport, /// The signature confirming the validity of this slash report. diff --git a/substrate/client/Cargo.toml b/substrate/client/Cargo.toml index 1b8a5afd..9dd32dec 100644 --- a/substrate/client/Cargo.toml +++ b/substrate/client/Cargo.toml @@ -31,9 +31,9 @@ serde_json = { version = "1", optional = true } serai-abi = { path = "../abi", version = "0.1" } multiaddr = { version = "0.18", optional = true } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", optional = true } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", optional = true } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", optional = true } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", optional = true } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", optional = true } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", optional = true } async-lock = "3" diff --git a/substrate/coins/Cargo.toml b/substrate/coins/Cargo.toml index 344f7c76..42217546 100644 --- a/substrate/coins/Cargo.toml +++ b/substrate/coins/Cargo.toml @@ -18,10 +18,10 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } serai-core-pallet = { path = "../core", default-features = false } @@ -29,7 +29,7 @@ serai-core-pallet = { path = "../core", default-features = false } [dev-dependencies] borsh = { version = "1", default-features = false, features = ["std", "derive", "de_strict_order"] } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, features = ["std"] } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, features = ["std"] } [features] std = [ diff --git a/substrate/coins/src/lib.rs b/substrate/coins/src/lib.rs index 87777b52..58e4f818 100644 --- a/substrate/coins/src/lib.rs +++ b/substrate/coins/src/lib.rs @@ -49,10 +49,12 @@ mod pallet { /// The instance used to represent coins on the Serai network. /// /// This would either be SRI itself or the sriXYZ coins swappable via pools. + #[derive(Default)] pub struct CoinsInstance; /// The instance used to represent liquidity tokens on the Serai network. /// /// Coin::XYZ would be considered as the liquidity token for the Coin::SRI - Coin::XYZ pool. + #[derive(Default)] pub struct LiquidityTokensInstance; /// The configuration of this pallet. @@ -66,7 +68,7 @@ mod pallet { /// The genesis state to use for this pallet. #[pallet::genesis_config] - #[derive(Clone, PartialEq, Eq, Debug, Encode, Decode)] + #[derive(Clone, Debug)] pub struct GenesisConfig, I: 'static = ()> { /// The balances to initiate the state with. /// @@ -76,10 +78,9 @@ mod pallet { /// PhantomData to bind `I`. pub _instance: PhantomData, } - impl, I: 'static> Default for GenesisConfig { fn default() -> Self { - GenesisConfig { accounts: Default::default(), _instance: Default::default() } + Self { accounts: Default::default(), _instance: PhantomData } } } diff --git a/substrate/core/Cargo.toml b/substrate/core/Cargo.toml index 9fbf3949..f6d5594f 100644 --- a/substrate/core/Cargo.toml +++ b/substrate/core/Cargo.toml @@ -20,10 +20,10 @@ borsh = { version = "1", default-features = false, features = ["derive", "de_str scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } diff --git a/substrate/dex/Cargo.toml b/substrate/dex/Cargo.toml index a5dce0b5..006648ff 100644 --- a/substrate/dex/Cargo.toml +++ b/substrate/dex/Cargo.toml @@ -21,15 +21,15 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-benchmarking = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, optional = true } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-benchmarking = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, optional = true } coins-pallet = { package = "serai-coins-pallet", path = "../coins", default-features = false } diff --git a/substrate/economic-security/Cargo.toml b/substrate/economic-security/Cargo.toml index c7c7bc7c..0f0c1b4b 100644 --- a/substrate/economic-security/Cargo.toml +++ b/substrate/economic-security/Cargo.toml @@ -21,8 +21,8 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } dex-pallet = { package = "serai-dex-pallet", path = "../dex", default-features = false } coins-pallet = { package = "serai-coins-pallet", path = "../coins", default-features = false } @@ -30,16 +30,16 @@ coins-pallet = { package = "serai-coins-pallet", path = "../coins", default-feat serai-primitives = { path = "../primitives", default-features = false } [dev-dependencies] -pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets", default-features = false } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } [features] std = [ diff --git a/substrate/emissions/Cargo.toml b/substrate/emissions/Cargo.toml index c13abec1..6ab235b5 100644 --- a/substrate/emissions/Cargo.toml +++ b/substrate/emissions/Cargo.toml @@ -21,11 +21,11 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } coins-pallet = { package = "serai-coins-pallet", path = "../coins", default-features = false } validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets", default-features = false } diff --git a/substrate/genesis-liquidity/Cargo.toml b/substrate/genesis-liquidity/Cargo.toml index 277c4884..e01dd169 100644 --- a/substrate/genesis-liquidity/Cargo.toml +++ b/substrate/genesis-liquidity/Cargo.toml @@ -21,12 +21,12 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } dex-pallet = { package = "serai-dex-pallet", path = "../dex", default-features = false } coins-pallet = { package = "serai-coins-pallet", path = "../coins", default-features = false } diff --git a/substrate/in-instructions/Cargo.toml b/substrate/in-instructions/Cargo.toml index 90636df1..c031cc11 100644 --- a/substrate/in-instructions/Cargo.toml +++ b/substrate/in-instructions/Cargo.toml @@ -24,14 +24,14 @@ bitvec = { version = "1", default-features = false, features = ["alloc"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } -sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-std = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-primitives = { path = "../primitives", default-features = false } @@ -42,9 +42,9 @@ genesis-liquidity-pallet = { package = "serai-genesis-liquidity-pallet", path = emissions-pallet = { package = "serai-emissions-pallet", path = "../emissions", default-features = false } [dev-dependencies] -pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } economic-security-pallet = { package = "serai-economic-security-pallet", path = "../economic-security", default-features = false } diff --git a/substrate/node/Cargo.toml b/substrate/node/Cargo.toml index c9f91b63..42691b38 100644 --- a/substrate/node/Cargo.toml +++ b/substrate/node/Cargo.toml @@ -34,16 +34,16 @@ secq256k1 = { path = "../../crypto/secq256k1" } libp2p = "0.56" -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-keystore = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-blockchain = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-block-builder = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sp-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-keystore = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-blockchain = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-block-builder = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sp-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } -frame-benchmarking = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } +frame-benchmarking = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } serai-runtime = { path = "../runtime", features = ["std"] } @@ -55,24 +55,24 @@ jsonrpsee = { version = "0.24", features = ["server"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sc-transaction-pool = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-transaction-pool-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-basic-authorship = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-executor = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-service = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-client-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-network-common = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-network = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sc-transaction-pool = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-transaction-pool-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-basic-authorship = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-executor = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-service = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-client-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-network-common = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-network = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -sc-consensus = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-consensus-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-authority-discovery = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } +sc-consensus = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-consensus-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-consensus-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-authority-discovery = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } -sc-telemetry = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } -sc-cli = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false, features = ["rocksdb"] } +sc-telemetry = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } +sc-cli = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false, features = ["rocksdb"] } -sc-rpc-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } +sc-rpc-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } serai-env = { path = "../../common/env" } diff --git a/substrate/primitives/Cargo.toml b/substrate/primitives/Cargo.toml index 4120997a..9d528677 100644 --- a/substrate/primitives/Cargo.toml +++ b/substrate/primitives/Cargo.toml @@ -21,7 +21,7 @@ borsh = { version = "1", default-features = false, features = ["derive", "de_str bitvec = { version = "1", default-features = false, features = ["alloc"] } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"], optional = true } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } ciphersuite = { path = "../../crypto/ciphersuite", default-features = false, features = ["alloc"] } schnorr-signatures = { path = "../../crypto/schnorr", default-features = false } diff --git a/substrate/runtime/Cargo.toml b/substrate/runtime/Cargo.toml index f40de0af..24107297 100644 --- a/substrate/runtime/Cargo.toml +++ b/substrate/runtime/Cargo.toml @@ -20,16 +20,22 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-version = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-session = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-version = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-runtime = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-executive = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-executive = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } + +pallet-timestamp = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-session = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-core-pallet = { path = "../core", default-features = false } serai-coins-pallet = { path = "../coins", default-features = false } @@ -37,13 +43,14 @@ serai-validator-sets-pallet = { path = "../validator-sets", default-features = f serai-signals-pallet = { path = "../signals", default-features = false } [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7" } +substrate-wasm-builder = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9" } [features] std = [ "scale/std", "sp-core/std", + "sp-session/std", "sp-version/std", "sp-runtime/std", "sp-api/std", @@ -54,6 +61,10 @@ std = [ "frame-support/std", "frame-executive/std", + "pallet-session/std", + "pallet-babe/std", + "pallet-grandpa/std", + "serai-core-pallet/std", "serai-coins-pallet/std", "serai-validator-sets-pallet/std", @@ -69,6 +80,10 @@ try-runtime = [ "frame-support/try-runtime", "frame-executive/try-runtime", + "pallet-session/try-runtime", + "pallet-babe/try-runtime", + "pallet-grandpa/try-runtime", + "serai-core-pallet/try-runtime", "serai-coins-pallet/try-runtime", "serai-validator-sets-pallet/try-runtime", @@ -81,6 +96,10 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + + "pallet-session/runtime-benchmarks", "serai-core-pallet/runtime-benchmarks", "serai-coins-pallet/runtime-benchmarks", "serai-validator-sets-pallet/runtime-benchmarks", diff --git a/substrate/runtime/src/lib.rs b/substrate/runtime/src/lib.rs index 7e82f4ec..ff1a456b 100644 --- a/substrate/runtime/src/lib.rs +++ b/substrate/runtime/src/lib.rs @@ -8,13 +8,17 @@ extern crate alloc; use alloc::borrow::Cow; -use sp_core::sr25519::Public; +use sp_core::{ConstU32, ConstU64, sr25519::Public}; use sp_runtime::{Perbill, Weight}; use sp_version::RuntimeVersion; -#[rustfmt::skip] use serai_abi::{ - primitives::address::SeraiAddress, SubstrateHeader as Header, SubstrateBlock, + primitives::{ + network_id::{ExternalNetworkId, NetworkId}, + balance::{Amount, ExternalBalance}, + address::SeraiAddress, + }, + SubstrateHeader as Header, SubstrateBlock, }; use serai_coins_pallet::{CoinsInstance, LiquidityTokensInstance}; @@ -79,13 +83,22 @@ mod runtime { pub type Coins = serai_coins_pallet::Pallet; #[runtime::pallet_index(3)] - pub type LiquidityTokens = serai_coins_pallet::Pallet; - - #[runtime::pallet_index(4)] pub type ValidatorSets = serai_validator_sets_pallet::Pallet; - #[runtime::pallet_index(5)] + #[runtime::pallet_index(4)] pub type Signals = serai_signals_pallet::Pallet; + + #[runtime::pallet_index(5)] + pub type LiquidityTokens = serai_coins_pallet::Pallet; + + #[runtime::pallet_index(0xfd)] + pub type Session = pallet_session::Pallet; + + #[runtime::pallet_index(0xfe)] + pub type Babe = pallet_babe::Pallet; + + #[runtime::pallet_index(0xff)] + pub type Grandpa = pallet_grandpa::Pallet; } impl frame_system::Config for Runtime { @@ -104,7 +117,7 @@ impl frame_system::Config for Runtime { type Block = Block; // Don't track old block hashes within the System pallet // We use not a number -> hash index, but a hash -> () index, in our own pallet - type BlockHashCount = sp_core::ConstU64<1>; + type BlockHashCount = ConstU64<1>; type DbWeight = frame_support::weights::constants::RocksDbWeight; type Version = Version; type PalletInfo = PalletInfo; @@ -118,7 +131,7 @@ impl frame_system::Config for Runtime { // We don't invoke any hooks on-set-code as we don't perform upgrades via the blockchain yet via // nodes, ensuring everyone who upgrades consents to the rules they upgrade to type OnSetCode = (); - type MaxConsumers = sp_core::ConstU32<{ u32::MAX }>; + type MaxConsumers = ConstU32<{ u32::MAX }>; // No migrations set type SingleBlockMigrations = (); type MultiBlockMigrator = (); @@ -133,15 +146,84 @@ impl serai_core_pallet::Config for Runtime {} impl serai_coins_pallet::Config for Runtime { type AllowMint = serai_coins_pallet::AlwaysAllowMint; // TODO } -impl serai_coins_pallet::Config for Runtime { - type AllowMint = serai_coins_pallet::AlwaysAllowMint; + +#[doc(hidden)] +pub struct EconomicSecurity; // TODO +impl serai_abi::economic_security::EconomicSecurity for EconomicSecurity { + fn achieved_economic_security(_network: ExternalNetworkId) -> bool { + false + } + fn sri_value(_balance: ExternalBalance) -> Amount { + Amount(0) + } } impl serai_validator_sets_pallet::Config for Runtime { type ShouldEndSession = Babe; + type EconomicSecurity = EconomicSecurity; } impl serai_signals_pallet::Config for Runtime { - type RetirementValidityDuration = sp_core::ConstU64<0>; // TODO - type RetirementLockInDuration = sp_core::ConstU64<0>; // TODO + type RetirementValidityDuration = ConstU64<0>; // TODO + type RetirementLockInDuration = ConstU64<0>; // TODO +} +impl serai_coins_pallet::Config for Runtime { + type AllowMint = serai_coins_pallet::AlwaysAllowMint; +} + +/* + `pallet-babe` requires we implement `pallet-timestamp` for the associated constants. It does not + actually require we offer the timestamp pallet however, and we don't as we follow our methodology + (using the block header for timestamps, not an inherent transaction). + + TODO: Set timestamp when executing a block. +*/ +impl pallet_timestamp::Config for Runtime { + type Moment = u64; + type OnTimestampSet = Babe; + type MinimumPeriod = ConstU64<0>; // TODO + type WeightInfo = (); +} + +#[doc(hidden)] +pub struct GetCurrentSessionForSubstrate; +impl pallet_session::GetCurrentSessionForSubstrate for GetCurrentSessionForSubstrate { + fn get() -> u32 { + serai_validator_sets_pallet::Pallet::::current_session(NetworkId::Serai) + .map(|session| session.0) + .unwrap_or(0) + } +} +impl pallet_session::Config for Runtime { + type Session = GetCurrentSessionForSubstrate; +} + +type MaxAuthorities = + ConstU32<{ serai_abi::primitives::validator_sets::KeyShares::MAX_PER_SET_U32 }>; +impl pallet_babe::Config for Runtime { + type EpochDuration = ConstU64<0>; // TODO + + type ExpectedBlockTime = ConstU64<0>; // TODO + type EpochChangeTrigger = pallet_babe::ExternalTrigger; + + type WeightInfo = (); + type MaxAuthorities = MaxAuthorities; + type MaxNominators = ConstU32<1>; + + // TODO: https://github.com/serai-dex/serai/issues/657 + type DisabledValidators = (); + type KeyOwnerProof = sp_session::MembershipProof; + type EquivocationReportSystem = (); +} +impl pallet_grandpa::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + + type WeightInfo = (); + type MaxAuthorities = MaxAuthorities; + type MaxNominators = ConstU32<1>; + + // TODO: https://github.com/serai-dex/serai/issues/657 + type MaxSetIdSessionEntries = ConstU64<0>; + type KeyOwnerProof = sp_session::MembershipProof; + type EquivocationReportSystem = (); } impl From> for RuntimeOrigin { @@ -158,36 +240,54 @@ impl From for RuntimeCall { match call { serai_abi::Call::Coins(call) => { use serai_abi::coins::Call; - match call { - Call::transfer { to, coins } => { - RuntimeCall::Coins(serai_coins_pallet::Call::transfer { to: to.into(), coins }) - } - Call::burn { coins } => RuntimeCall::Coins(serai_coins_pallet::Call::burn { coins }), + use serai_coins_pallet::Call as Scall; + RuntimeCall::Coins(match call { + Call::transfer { to, coins } => Scall::transfer { to: to.into(), coins }, + Call::burn { coins } => Scall::burn { coins }, Call::burn_with_instruction { instruction } => { - RuntimeCall::Coins(serai_coins_pallet::Call::burn_with_instruction { instruction }) + Scall::burn_with_instruction { instruction } } - } + }) } serai_abi::Call::ValidatorSets(call) => { use serai_abi::validator_sets::Call; - match call { - Call::set_keys { .. } | - Call::report_slashes { .. } | - Call::set_embedded_elliptic_curve_keys { .. } | - Call::allocate { .. } | - Call::deallocate { .. } | - Call::claim_deallocation { .. } => todo!("TODO"), - } + use serai_validator_sets_pallet::Call as Scall; + RuntimeCall::ValidatorSets(match call { + Call::set_keys { network, key_pair, signature_participants, signature } => { + Scall::set_keys { network, key_pair, signature_participants, signature } + } + Call::report_slashes { network, slashes, signature } => { + Scall::report_slashes { network, slashes, signature } + } + Call::set_embedded_elliptic_curve_keys { keys } => { + Scall::set_embedded_elliptic_curve_keys { keys } + } + Call::allocate { network, amount } => Scall::allocate { network, amount }, + Call::deallocate { network, amount } => Scall::deallocate { network, amount }, + Call::claim_deallocation { deallocation } => Scall::claim_deallocation { + network: deallocation.network, + session: deallocation.session, + }, + }) } serai_abi::Call::Signals(call) => { use serai_abi::signals::Call; - match call { - Call::register_retirement_signal { .. } | - Call::revoke_retirement_signal { .. } | - Call::favor { .. } | - Call::revoke_favor { .. } | - Call::stand_against { .. } => todo!("TODO"), - } + use serai_signals_pallet::Call as Scall; + RuntimeCall::Signals(match call { + Call::register_retirement_signal { in_favor_of } => { + Scall::register_retirement_signal { in_favor_of } + } + Call::revoke_retirement_signal { was_in_favor_of } => { + Scall::revoke_retirement_signal { retirement_signal: was_in_favor_of } + } + Call::favor { signal, with_network } => Scall::favor { signal, with_network }, + Call::revoke_favor { signal, with_network } => { + Scall::revoke_favor { signal, with_network } + } + Call::stand_against { signal, with_network } => { + Scall::stand_against { signal, with_network } + } + }) } serai_abi::Call::Dex(call) => { use serai_abi::dex::Call; @@ -331,9 +431,6 @@ pub use in_instructions_pallet as in_instructions; pub use signals_pallet as signals; -pub use pallet_babe as babe; -pub use pallet_grandpa as grandpa; - pub use genesis_liquidity_pallet as genesis_liquidity; pub use emissions_pallet as emissions; @@ -492,43 +589,9 @@ impl pallet_authorship::Config for Runtime { type EventHandler = (); } -// Maximum number of authorities per session. -pub type MaxAuthorities = ConstU32<{ validator_sets::primitives::MAX_KEY_SHARES_PER_SET_U32 }>; - /// Longevity of an offence report. pub type ReportLongevity = ::EpochDuration; -impl babe::Config for Runtime { - #[cfg(feature = "fast-epoch")] - type EpochDuration = ConstU64<{ FAST_EPOCH_DURATION }>; - - #[cfg(not(feature = "fast-epoch"))] - type EpochDuration = ConstU64<{ 4 * 7 * DAYS }>; - - type ExpectedBlockTime = ConstU64<{ TARGET_BLOCK_TIME * 1000 }>; - type EpochChangeTrigger = babe::ExternalTrigger; - type DisabledValidators = ValidatorSets; - - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - - type KeyOwnerProof = MembershipProof; - type EquivocationReportSystem = - babe::EquivocationReportSystem; -} - -impl grandpa::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - - type MaxSetIdSessionEntries = ConstU64<0>; - type KeyOwnerProof = MembershipProof; - type EquivocationReportSystem = - grandpa::EquivocationReportSystem; -} - construct_runtime!( pub enum Runtime { System: system exclude_parts { Call }, diff --git a/substrate/signals/Cargo.toml b/substrate/signals/Cargo.toml index 3f2a53c5..bd9453fc 100644 --- a/substrate/signals/Cargo.toml +++ b/substrate/signals/Cargo.toml @@ -21,10 +21,10 @@ workspace = true [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } diff --git a/substrate/signals/src/lib.rs b/substrate/signals/src/lib.rs index 96e46248..ff26e293 100644 --- a/substrate/signals/src/lib.rs +++ b/substrate/signals/src/lib.rs @@ -36,13 +36,13 @@ pub mod pallet { } #[pallet::genesis_config] - #[derive(Debug, Encode, Decode)] + #[derive(Clone, Debug)] pub struct GenesisConfig { _config: PhantomData, } impl Default for GenesisConfig { fn default() -> Self { - GenesisConfig { _config: PhantomData } + Self { _config: PhantomData } } } #[pallet::genesis_build] @@ -221,20 +221,16 @@ pub mod pallet { fn revoke_favor_internal( validator: T::AccountId, signal: Signal, - for_network: NetworkId, + with_network: NetworkId, ) -> DispatchResult { - if !Favors::::contains_key((signal, for_network), validator) { + if !Favors::::contains_key((signal, with_network), validator) { Err::<(), _>(Error::::RevokingNonExistentFavor)?; } - Favors::::remove((signal, for_network), validator); - Core::::emit_event(Event::FavorRevoked { - signal, - by: validator.into(), - with_network: for_network, - }); + Favors::::remove((signal, with_network), validator); + Core::::emit_event(Event::FavorRevoked { signal, by: validator.into(), with_network }); // Update the tally for this network - Self::tally_for_network(signal, for_network); + Self::tally_for_network(signal, with_network); Ok(()) } @@ -342,7 +338,7 @@ pub mod pallet { /// Favor a signal. #[pallet::call_index(2)] #[pallet::weight((0, DispatchClass::Normal))] // TODO - pub fn favor(origin: OriginFor, signal: Signal, for_network: NetworkId) -> DispatchResult { + pub fn favor(origin: OriginFor, signal: Signal, with_network: NetworkId) -> DispatchResult { let validator = ensure_signed(origin)?; // Perform the relevant checks for this class of signal @@ -373,21 +369,17 @@ pub mod pallet { Signal::Halt { .. } => {} } - if Favors::::contains_key((signal, for_network), validator) { + if Favors::::contains_key((signal, with_network), validator) { Err::<(), _>(Error::::AlreadyInFavor)?; } // Set the validator as in favor - Favors::::set((signal, for_network), validator, Some(())); + Favors::::set((signal, with_network), validator, Some(())); - Core::::emit_event(Event::SignalFavored { - signal, - by: validator.into(), - with_network: for_network, - }); + Core::::emit_event(Event::SignalFavored { signal, by: validator.into(), with_network }); // Check if the network is in favor - let network_in_favor = Self::tally_for_network(signal, for_network); + let network_in_favor = Self::tally_for_network(signal, with_network); // If this network is in favor, check if enough networks are if network_in_favor && Self::tally_for_all_networks(signal) { @@ -416,7 +408,7 @@ pub mod pallet { pub fn revoke_favor( origin: OriginFor, signal: Signal, - for_network: NetworkId, + with_network: NetworkId, ) -> DispatchResult { match signal { Signal::Retire { .. } => { @@ -428,7 +420,7 @@ pub mod pallet { } let validator = ensure_signed(origin)?; - Self::revoke_favor_internal(validator, signal, for_network) + Self::revoke_favor_internal(validator, signal, with_network) } /// Emit an event standing against the signal. @@ -442,7 +434,7 @@ pub mod pallet { pub fn stand_against( origin: OriginFor, signal: Signal, - for_network: NetworkId, + with_network: NetworkId, ) -> DispatchResult { match signal { Signal::Retire { .. } => { @@ -455,8 +447,8 @@ pub mod pallet { let validator = ensure_signed(origin)?; // If currently in favor, revoke the favor - if Favors::::contains_key((signal, for_network), validator) { - Self::revoke_favor_internal(validator, signal, for_network)?; + if Favors::::contains_key((signal, with_network), validator) { + Self::revoke_favor_internal(validator, signal, with_network)?; } else { // Check this Signal exists (which would've been implied by `Favors` for it existing) match signal { @@ -472,7 +464,7 @@ pub mod pallet { Core::::emit_event(Event::AgainstSignal { signal, account: validator.into(), - with_network: for_network, + with_network, }); Ok(()) diff --git a/substrate/validator-sets/Cargo.toml b/substrate/validator-sets/Cargo.toml index c1d182da..ea4fa3ee 100644 --- a/substrate/validator-sets/Cargo.toml +++ b/substrate/validator-sets/Cargo.toml @@ -20,17 +20,17 @@ bitvec = { version = "1", default-features = false, features = ["alloc", "serde" scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "bit-vec"] } -sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +sp-core = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-application-crypto = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-io = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +sp-api = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +frame-system = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +frame-support = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } -pallet-session = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } -pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "16336c737dbe833e9d138a256af99698aba637c7", default-features = false } +pallet-session = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-babe = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } +pallet-grandpa = { git = "https://github.com/serai-dex/patch-polkadot-sdk", rev = "ef18bfc7029d4a3d7c27e1d0b84da5091628a7d9", default-features = false } serai-abi = { path = "../abi", default-features = false, features = ["substrate"] } diff --git a/substrate/validator-sets/src/lib.rs b/substrate/validator-sets/src/lib.rs index 614ce3ff..71ee672a 100644 --- a/substrate/validator-sets/src/lib.rs +++ b/substrate/validator-sets/src/lib.rs @@ -3,7 +3,7 @@ #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; -use alloc::vec::Vec; +use alloc::{vec, vec::Vec}; mod embedded_elliptic_curve_keys; use embedded_elliptic_curve_keys::*; @@ -65,11 +65,16 @@ mod pallet { } #[pallet::genesis_config] - #[derive(Clone, PartialEq, Eq, Debug)] + #[derive(Clone, Debug)] pub struct GenesisConfig { /// List of participants to place in the initial validator sets. pub participants: Vec<(T::AccountId, Vec)>, } + impl Default for GenesisConfig { + fn default() -> Self { + Self { participants: Default::default() } + } + } #[pallet::pallet] pub struct Pallet(PhantomData); diff --git a/substrate/validator-sets/src/mock.rs b/substrate/validator-sets/src/mock.rs deleted file mode 100644 index 25b97620..00000000 --- a/substrate/validator-sets/src/mock.rs +++ /dev/null @@ -1,217 +0,0 @@ -//! Test environment for ValidatorSets pallet. - -use super::*; - -use std::collections::HashMap; - -use frame_support::{ - construct_runtime, - traits::{ConstU16, ConstU32, ConstU64}, -}; - -use sp_core::{ - H256, Pair as PairTrait, - sr25519::{Public, Pair}, -}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, -}; - -use serai_abi::primitives::*; -use validator_sets::{primitives::MAX_KEY_SHARES_PER_SET_U32, MembershipProof}; - -pub use crate as validator_sets; -pub use serai_coins_pallet as coins; -pub use dex_pallet as dex; -pub use pallet_babe as babe; -pub use pallet_grandpa as grandpa; -pub use pallet_timestamp as timestamp; - -type Block = frame_system::mocking::MockBlock; -// Maximum number of authorities per session. -pub type MaxAuthorities = ConstU32<{ MAX_KEY_SHARES_PER_SET_U32 }>; - -pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); -pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = - sp_consensus_babe::BabeEpochConfiguration { - c: PRIMARY_PROBABILITY, - allowed_slots: sp_consensus_babe::AllowedSlots::PrimaryAndSecondaryPlainSlots, - }; - -pub const MEDIAN_PRICE_WINDOW_LENGTH: u16 = 10; - -construct_runtime!( - pub enum Test - { - System: frame_system, - Timestamp: timestamp, - Coins: coins, - LiquidityTokens: coins::::{Pallet, Call, Storage, Event}, - ValidatorSets: validator_sets, - Dex: dex, - Babe: babe, - Grandpa: grandpa, - } -); - -impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = Public; - type Lookup = IdentityLookup; - type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = ConstU32<16>; -} - -impl timestamp::Config for Test { - type Moment = u64; - type OnTimestampSet = Babe; - type MinimumPeriod = ConstU64<{ (TARGET_BLOCK_TIME * 1000) / 2 }>; - type WeightInfo = (); -} - -impl babe::Config for Test { - type EpochDuration = ConstU64<{ FAST_EPOCH_DURATION }>; - - type ExpectedBlockTime = ConstU64<{ TARGET_BLOCK_TIME * 1000 }>; - type EpochChangeTrigger = babe::ExternalTrigger; - type DisabledValidators = ValidatorSets; - - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - - type KeyOwnerProof = MembershipProof; - type EquivocationReportSystem = (); -} - -impl grandpa::Config for Test { - type RuntimeEvent = RuntimeEvent; - - type WeightInfo = (); - type MaxAuthorities = MaxAuthorities; - - type MaxSetIdSessionEntries = ConstU64<0>; - type KeyOwnerProof = MembershipProof; - type EquivocationReportSystem = (); -} - -impl coins::Config for Test { - type RuntimeEvent = RuntimeEvent; - type AllowMint = ValidatorSets; -} - -impl coins::Config for Test { - type RuntimeEvent = RuntimeEvent; - type AllowMint = (); -} - -impl dex::Config for Test { - type RuntimeEvent = RuntimeEvent; - - type LPFee = ConstU32<3>; // 0.3% - type MintMinLiquidity = ConstU64<10000>; - - type MaxSwapPathLength = ConstU32<3>; // coin1 -> SRI -> coin2 - - type MedianPriceWindowLength = ConstU16<{ MEDIAN_PRICE_WINDOW_LENGTH }>; - - type WeightInfo = dex::weights::SubstrateWeight; -} - -impl Config for Test { - type RuntimeEvent = RuntimeEvent; - type ShouldEndSession = Babe; -} - -// For a const we can't define -pub fn genesis_participants() -> Vec { - vec![ - insecure_pair_from_name("Alice"), - insecure_pair_from_name("Bob"), - insecure_pair_from_name("Charlie"), - insecure_pair_from_name("Dave"), - ] -} - -// Amounts for single key share per network -pub fn key_shares() -> HashMap { - HashMap::from([ - (NetworkId::Serai, Amount(50_000 * 10_u64.pow(8))), - (NetworkId::External(ExternalNetworkId::Bitcoin), Amount(1_000_000 * 10_u64.pow(8))), - (NetworkId::External(ExternalNetworkId::Ethereum), Amount(1_000_000 * 10_u64.pow(8))), - (NetworkId::External(ExternalNetworkId::Monero), Amount(100_000 * 10_u64.pow(8))), - ]) -} - -pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); - let networks: Vec<(NetworkId, Amount)> = key_shares().into_iter().collect::>(); - - coins::GenesisConfig:: { - accounts: genesis_participants() - .clone() - .into_iter() - .map(|a| (a.public(), Balance { coin: Coin::Serai, amount: Amount(1 << 60) })) - .collect(), - _ignore: Default::default(), - } - .assimilate_storage(&mut t) - .unwrap(); - - #[expect(unused_variables, unreachable_code, clippy::diverging_sub_expression)] - validator_sets::GenesisConfig:: { - networks, - participants: genesis_participants() - .into_iter() - .map(|p| { - let keys: crate::AllEmbeddedEllipticCurveKeysAtGenesis = todo!("TODO"); - (p.public(), keys) - }) - .collect(), - } - .assimilate_storage(&mut t) - .unwrap(); - - babe::GenesisConfig:: { - authorities: genesis_participants() - .into_iter() - .map(|validator| (validator.public().into(), 1)) - .collect(), - epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG), - _config: PhantomData, - } - .assimilate_storage(&mut t) - .unwrap(); - - grandpa::GenesisConfig:: { - authorities: genesis_participants() - .into_iter() - .map(|validator| (validator.public().into(), 1)) - .collect(), - _config: PhantomData, - } - .assimilate_storage(&mut t) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(0)); - ext -} diff --git a/substrate/validator-sets/src/tests.rs b/substrate/validator-sets/src/tests.rs deleted file mode 100644 index e627b2f5..00000000 --- a/substrate/validator-sets/src/tests.rs +++ /dev/null @@ -1,558 +0,0 @@ -use crate::{mock::*, primitives::*}; - -use std::collections::HashMap; - -use ciphersuite::{WrappedGroup, GroupIo}; -use dkg_musig::musig; -use schnorrkel::{frost::curve::Ristretto, Schnorrkel}; - -use zeroize::Zeroizing; -use rand_core::OsRng; - -use frame_support::{ - assert_noop, assert_ok, - pallet_prelude::{InvalidTransaction, TransactionSource}, - traits::{OnFinalize, OnInitialize}, -}; -use frame_system::RawOrigin; - -use sp_core::{ - sr25519::{Public, Pair, Signature}, - Pair as PairTrait, -}; -use sp_runtime::traits::ValidateUnsigned; - -use serai_abi::primitives::*; - -fn active_network_validators(network: NetworkId) -> Vec<(Public, u64)> { - if network == NetworkId::Serai { - Babe::authorities().into_iter().map(|(id, key_share)| (id.into_inner(), key_share)).collect() - } else { - ValidatorSets::participants_for_latest_decided_set(network).unwrap().into_inner() - } -} - -fn verify_session_and_active_validators(network: NetworkId, participants: &[Public], session: u32) { - let mut validators: Vec = active_network_validators(network) - .into_iter() - .map(|(p, ks)| { - assert_eq!(ks, 1); - p - }) - .collect(); - validators.sort(); - - assert_eq!(ValidatorSets::session(network).unwrap(), Session(session)); - assert_eq!(participants, validators); - - // TODO: how to make sure block finalizations work as usual here? -} - -fn get_session_at_which_changes_activate(network: NetworkId) -> u32 { - let current_session = ValidatorSets::session(network).unwrap().0; - // changes should be active in the next session - if network == NetworkId::Serai { - // it takes 1 extra session for serai net to make the changes active. - current_session + 2 - } else { - current_session + 1 - } -} - -fn set_keys_for_session(network: ExternalNetworkId) { - ValidatorSets::set_keys( - RawOrigin::None.into(), - network, - KeyPair(insecure_pair_from_name("Alice").public(), vec![].try_into().unwrap()), - vec![].try_into().unwrap(), - Signature([0u8; 64]), - ) - .unwrap(); -} - -fn set_keys_signature(set: &ExternalValidatorSet, key_pair: &KeyPair, pairs: &[Pair]) -> Signature { - let mut pub_keys = vec![]; - for pair in pairs { - let public_key = - ::read_G::<&[u8]>(&mut pair.public().0.as_ref()).unwrap(); - pub_keys.push(public_key); - } - - let mut threshold_keys = vec![]; - for i in 0 .. pairs.len() { - let secret_key = ::read_F::<&[u8]>( - &mut pairs[i].as_ref().secret.to_bytes()[.. 32].as_ref(), - ) - .unwrap(); - assert_eq!(Ristretto::generator() * secret_key, pub_keys[i]); - - threshold_keys.push( - musig::(musig_context((*set).into()), Zeroizing::new(secret_key), &pub_keys) - .unwrap(), - ); - } - - let mut musig_keys = HashMap::new(); - for threshold_keys in threshold_keys { - musig_keys.insert(threshold_keys.params().i(), threshold_keys); - } - - let sig = frost::tests::sign_without_caching( - &mut OsRng, - frost::tests::algorithm_machines(&mut OsRng, &Schnorrkel::new(b"substrate"), &musig_keys), - &set_keys_message(set, key_pair), - ); - - Signature(sig.to_bytes()) -} - -fn get_ordered_keys(network: NetworkId, participants: &[Pair]) -> Vec { - // retrieve the current session validators so that we know the order of the keys - // that is necessary for the correct musig signature. - let validators = ValidatorSets::participants_for_latest_decided_set(network).unwrap(); - - // collect the pairs of the validators - let mut pairs = vec![]; - for (v, _) in validators { - let p = participants.iter().find(|pair| pair.public() == v).unwrap().clone(); - pairs.push(p); - } - - pairs -} - -fn rotate_session_until(network: NetworkId, session: u32) { - let mut current = ValidatorSets::session(network).unwrap().0; - while current < session { - Babe::on_initialize(System::block_number() + 1); - ValidatorSets::rotate_session(); - if let NetworkId::External(n) = network { - set_keys_for_session(n); - } - ValidatorSets::retire_set(ValidatorSet { session: Session(current), network }); - current += 1; - } - assert_eq!(current, session); -} - -#[test] -fn rotate_session() { - new_test_ext().execute_with(|| { - let genesis_participants: Vec = - genesis_participants().into_iter().map(|p| p.public()).collect(); - let key_shares = key_shares(); - - let mut participants = HashMap::from([ - (NetworkId::Serai, genesis_participants.clone()), - (NetworkId::External(ExternalNetworkId::Bitcoin), genesis_participants.clone()), - (NetworkId::External(ExternalNetworkId::Ethereum), genesis_participants.clone()), - (NetworkId::External(ExternalNetworkId::Monero), genesis_participants), - ]); - - // rotate session - for network in NETWORKS { - let participants = participants.get_mut(&network).unwrap(); - - // verify for session 0 - participants.sort(); - if let NetworkId::External(n) = network { - set_keys_for_session(n); - } - verify_session_and_active_validators(network, participants, 0); - - // add 1 participant - let new_participant = insecure_pair_from_name("new-guy").public(); - Coins::mint(new_participant, Balance { coin: Coin::Serai, amount: key_shares[&network] }) - .unwrap(); - ValidatorSets::allocate( - RawOrigin::Signed(new_participant).into(), - network, - key_shares[&network], - ) - .unwrap(); - participants.push(new_participant); - - // move network to the activation session - let activation_session = get_session_at_which_changes_activate(network); - rotate_session_until(network, activation_session); - - // verify - participants.sort(); - verify_session_and_active_validators(network, participants, activation_session); - - // remove 1 participant - let participant_to_remove = participants[0]; - ValidatorSets::deallocate( - RawOrigin::Signed(participant_to_remove).into(), - network, - key_shares[&network], - ) - .unwrap(); - participants - .swap_remove(participants.iter().position(|k| *k == participant_to_remove).unwrap()); - - // check pending deallocations - let pending = ValidatorSets::pending_deallocations( - (network, participant_to_remove), - Session(if network == NetworkId::Serai { - activation_session + 3 - } else { - activation_session + 2 - }), - ); - assert_eq!(pending, Some(key_shares[&network])); - - // move network to the activation session - let activation_session = get_session_at_which_changes_activate(network); - rotate_session_until(network, activation_session); - - // verify - participants.sort(); - verify_session_and_active_validators(network, participants, activation_session); - } - }) -} - -#[test] -fn allocate() { - new_test_ext().execute_with(|| { - let genesis_participants: Vec = - genesis_participants().into_iter().map(|p| p.public()).collect(); - let key_shares = key_shares(); - let participant = insecure_pair_from_name("random1").public(); - let network = NetworkId::External(ExternalNetworkId::Ethereum); - - // check genesis TAS - set_keys_for_session(network.try_into().unwrap()); - assert_eq!( - ValidatorSets::total_allocated_stake(network).unwrap().0, - key_shares[&network].0 * u64::try_from(genesis_participants.len()).unwrap() - ); - - // we can't allocate less than a key share - let amount = Amount(key_shares[&network].0 * 3); - Coins::mint(participant, Balance { coin: Coin::Serai, amount }).unwrap(); - assert_noop!( - ValidatorSets::allocate( - RawOrigin::Signed(participant).into(), - network, - Amount(key_shares[&network].0 - 1) - ), - validator_sets::Error::::InsufficientAllocation - ); - - // we can't allocate too much that the net exhibits the ability to handle any single node - // becoming byzantine - assert_noop!( - ValidatorSets::allocate(RawOrigin::Signed(participant).into(), network, amount), - validator_sets::Error::::AllocationWouldRemoveFaultTolerance - ); - - // we should be allocate a proper amount - assert_ok!(ValidatorSets::allocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - assert_eq!(Coins::balance(participant, Coin::Serai).0, amount.0 - key_shares[&network].0); - - // check new amount is reflected on TAS on new session - rotate_session_until(network, 1); - assert_eq!( - ValidatorSets::total_allocated_stake(network).unwrap().0, - key_shares[&network].0 * (u64::try_from(genesis_participants.len()).unwrap() + 1) - ); - - // check that new participants match - let mut active_participants: Vec = - active_network_validators(network).into_iter().map(|(p, _)| p).collect(); - - let mut current_participants = genesis_participants.clone(); - current_participants.push(participant); - - current_participants.sort(); - active_participants.sort(); - assert_eq!(current_participants, active_participants); - }) -} - -#[test] -fn deallocate_pending() { - new_test_ext().execute_with(|| { - let genesis_participants: Vec = - genesis_participants().into_iter().map(|p| p.public()).collect(); - let key_shares = key_shares(); - let participant = insecure_pair_from_name("random1").public(); - let network = NetworkId::External(ExternalNetworkId::Bitcoin); - - // check genesis TAS - set_keys_for_session(network.try_into().unwrap()); - assert_eq!( - ValidatorSets::total_allocated_stake(network).unwrap().0, - key_shares[&network].0 * u64::try_from(genesis_participants.len()).unwrap() - ); - - // allocate some amount - Coins::mint(participant, Balance { coin: Coin::Serai, amount: key_shares[&network] }).unwrap(); - assert_ok!(ValidatorSets::allocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - assert_eq!(Coins::balance(participant, Coin::Serai).0, 0); - - // move to next session - let mut current_session = ValidatorSets::session(network).unwrap().0; - current_session += 1; - rotate_session_until(network, current_session); - assert_eq!( - ValidatorSets::total_allocated_stake(network).unwrap().0, - key_shares[&network].0 * (u64::try_from(genesis_participants.len()).unwrap() + 1) - ); - - // we can deallocate all of our allocation - assert_ok!(ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - - // check pending deallocations - let pending_session = - if network == NetworkId::Serai { current_session + 3 } else { current_session + 2 }; - assert_eq!( - ValidatorSets::pending_deallocations((network, participant), Session(pending_session)), - Some(key_shares[&network]) - ); - - // we can't claim it immediately - assert_noop!( - ValidatorSets::claim_deallocation( - RawOrigin::Signed(participant).into(), - network, - Session(pending_session), - ), - validator_sets::Error::::NonExistentDeallocation - ); - - // we should be able to claim it in the pending session - rotate_session_until(network, pending_session); - assert_ok!(ValidatorSets::claim_deallocation( - RawOrigin::Signed(participant).into(), - network, - Session(pending_session), - )); - }) -} - -#[test] -fn deallocate_immediately() { - new_test_ext().execute_with(|| { - let genesis_participants: Vec = - genesis_participants().into_iter().map(|p| p.public()).collect(); - let key_shares = key_shares(); - let participant = insecure_pair_from_name("random1").public(); - let network = NetworkId::External(ExternalNetworkId::Monero); - - // check genesis TAS - set_keys_for_session(network.try_into().unwrap()); - assert_eq!( - ValidatorSets::total_allocated_stake(network).unwrap().0, - key_shares[&network].0 * u64::try_from(genesis_participants.len()).unwrap() - ); - - // we can't deallocate when we don't have an allocation - assert_noop!( - ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - ), - validator_sets::Error::::NonExistentValidator - ); - - // allocate some amount - Coins::mint(participant, Balance { coin: Coin::Serai, amount: key_shares[&network] }).unwrap(); - assert_ok!(ValidatorSets::allocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - assert_eq!(Coins::balance(participant, Coin::Serai).0, 0); - - // we can't deallocate more than our allocation - assert_noop!( - ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - Amount(key_shares[&network].0 + 1) - ), - validator_sets::Error::::NotEnoughAllocated - ); - - // we can't deallocate an amount that would left us less than a key share as long as it isn't 0 - assert_noop!( - ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - Amount(key_shares[&network].0 / 2) - ), - validator_sets::Error::::DeallocationWouldRemoveParticipant - ); - - // we can deallocate all of our allocation - assert_ok!(ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - - // It should be immediately deallocated since we are not yet in an active set - assert_eq!(Coins::balance(participant, Coin::Serai), key_shares[&network]); - assert!(ValidatorSets::pending_deallocations((network, participant), Session(1)).is_none()); - - // allocate again - assert_ok!(ValidatorSets::allocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - )); - assert_eq!(Coins::balance(participant, Coin::Serai).0, 0); - - // make a pool so that we have security oracle value for the coin - let liq_acc = insecure_pair_from_name("liq-acc").public(); - let coin = ExternalCoin::Monero; - let balance = ExternalBalance { coin, amount: Amount(2 * key_shares[&network].0) }; - Coins::mint(liq_acc, balance.into()).unwrap(); - Coins::mint(liq_acc, Balance { coin: Coin::Serai, amount: balance.amount }).unwrap(); - Dex::add_liquidity( - RawOrigin::Signed(liq_acc).into(), - coin, - balance.amount.0 / 2, - balance.amount.0 / 2, - 1, - 1, - liq_acc, - ) - .unwrap(); - Dex::on_finalize(1); - assert!(Dex::security_oracle_value(coin).unwrap().0 > 0); - - // we can't deallocate if it would break economic security - // The reason we don't have economic security for the network now is that we just set - // the value for coin/SRI to 1:1 when making the pool and we minted 2 * key_share amount - // of coin but we only allocated 1 key_share of SRI for the network although we need more than - // 3 for the same amount of coin. - assert_noop!( - ValidatorSets::deallocate( - RawOrigin::Signed(participant).into(), - network, - key_shares[&network] - ), - validator_sets::Error::::DeallocationWouldRemoveEconomicSecurity - ); - }) -} - -#[test] -fn set_keys_keys_exist() { - new_test_ext().execute_with(|| { - let network = ExternalNetworkId::Monero; - - // set the keys first - ValidatorSets::set_keys( - RawOrigin::None.into(), - network, - KeyPair(insecure_pair_from_name("name").public(), Vec::new().try_into().unwrap()), - vec![].try_into().unwrap(), - Signature([0u8; 64]), - ) - .unwrap(); - - let call = validator_sets::Call::::set_keys { - network, - key_pair: KeyPair(insecure_pair_from_name("name").public(), Vec::new().try_into().unwrap()), - signature_participants: vec![].try_into().unwrap(), - signature: Signature([0u8; 64]), - }; - - assert_eq!( - ValidatorSets::validate_unsigned(TransactionSource::External, &call), - InvalidTransaction::Stale.into() - ); - }) -} - -#[test] -fn set_keys_invalid_signature() { - new_test_ext().execute_with(|| { - let network = ExternalNetworkId::Ethereum; - let mut participants = get_ordered_keys(network.into(), &genesis_participants()); - - // we can't have invalid set - let mut set = ExternalValidatorSet { network, session: Session(1) }; - let key_pair = - KeyPair(insecure_pair_from_name("name").public(), Vec::new().try_into().unwrap()); - let signature = set_keys_signature(&set, &key_pair, &participants); - - let call = validator_sets::Call::::set_keys { - network, - key_pair: key_pair.clone(), - signature_participants: vec![].try_into().unwrap(), - signature, - }; - assert_eq!( - ValidatorSets::validate_unsigned(TransactionSource::External, &call), - InvalidTransaction::BadProof.into() - ); - - // fix the set - set.session = Session(0); - - // participants should match - participants.push(insecure_pair_from_name("random1")); - let signature = set_keys_signature(&set, &key_pair, &participants); - - let call = validator_sets::Call::::set_keys { - network, - key_pair: key_pair.clone(), - signature_participants: vec![].try_into().unwrap(), - signature, - }; - assert_eq!( - ValidatorSets::validate_unsigned(TransactionSource::External, &call), - InvalidTransaction::BadProof.into() - ); - - // fix the participants - participants.pop(); - - // msg key pair and the key pair to set should match - let key_pair2 = - KeyPair(insecure_pair_from_name("name2").public(), Vec::new().try_into().unwrap()); - let signature = set_keys_signature(&set, &key_pair2, &participants); - - let call = validator_sets::Call::::set_keys { - network, - key_pair: key_pair.clone(), - signature_participants: vec![].try_into().unwrap(), - signature, - }; - assert_eq!( - ValidatorSets::validate_unsigned(TransactionSource::External, &call), - InvalidTransaction::BadProof.into() - ); - - // use the same key pair - let signature = set_keys_signature(&set, &key_pair, &participants); - let call = validator_sets::Call::::set_keys { - network, - key_pair, - signature_participants: vec![].try_into().unwrap(), - signature, - }; - ValidatorSets::validate_unsigned(TransactionSource::External, &call).unwrap(); - }) -} - -// TODO: add report_slashes tests when the feature is complete.