diff --git a/.rustfmt.toml b/.rustfmt.toml index 1798e3c8cd..24235c6929 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -21,4 +21,5 @@ match_arm_blocks = false match_block_trailing_comma = true trailing_comma = "Vertical" trailing_semicolon = false -use_field_init_shorthand = true \ No newline at end of file +use_field_init_shorthand = true +indent_style = "Block" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b01753d6c2..072752558d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes included in each Chainflip release will be documented in this file. +## [1.6.7] - 2024-09-25 + +### Fixes + +- Add missing broker fees migration. +- Close expired Solana channels. + ## [1.6.6] - 2024-09-24 ### Fixes diff --git a/Cargo.lock b/Cargo.lock index ca2caab4c4..539fab75d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,18 +23,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.28.1", + "gimli 0.31.1", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher 0.4.4", @@ -68,28 +68,28 @@ dependencies = [ "cipher 0.4.4", "ctr", "ghash", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -97,18 +97,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -136,47 +136,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -184,9 +185,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "approx" @@ -199,18 +200,24 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074b80d14d0240b6ce94d68f059a2d26a5d77280ae142662365a21ef6e2594ef" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -222,18 +229,6 @@ dependencies = [ "ark-std", ] -[[package]] -name = "ark-bls12-377-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c7021f180a0cbea0380eba97c2af3c57074cdaffe0eef7e840e1c9f2841e55" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-models-ext", - "ark-std", -] - [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -246,45 +241,6 @@ dependencies = [ "ark-std", ] -[[package]] -name = "ark-bls12-381-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1dc4b3d08f19e8ec06e949712f95b8361e43f1391d94f65e4234df03480631c" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-models-ext", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-bw6-761" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-bw6-761-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccee5fba47266f460067588ee1bf070a9c760bf2050c1c509982c5719aadb4f2" -dependencies = [ - "ark-bw6-761", - "ark-ec", - "ark-ff", - "ark-models-ext", - "ark-std", -] - [[package]] name = "ark-ec" version = "0.4.2" @@ -299,60 +255,9 @@ dependencies = [ "hashbrown 0.13.2", "itertools 0.10.5", "num-traits", - "rayon", "zeroize", ] -[[package]] -name = "ark-ed-on-bls12-377" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-ed-on-bls12-377-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524a4fb7540df2e1a8c2e67a83ba1d1e6c3947f4f9342cc2359fc2e789ad731d" -dependencies = [ - "ark-ec", - "ark-ed-on-bls12-377", - "ark-ff", - "ark-models-ext", - "ark-std", -] - -[[package]] -name = "ark-ed-on-bls12-381-bandersnatch" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-ed-on-bls12-381-bandersnatch-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15185f1acb49a07ff8cbe5f11a1adc5a93b19e211e325d826ae98e98e124346" -dependencies = [ - "ark-ec", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ff", - "ark-models-ext", - "ark-std", -] - [[package]] name = "ark-ff" version = "0.4.2" @@ -396,19 +301,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ark-models-ext" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9eab5d4b5ff2f228b763d38442adc9b084b0a465409b059fac5c2308835ec2" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", -] - [[package]] name = "ark-poly" version = "0.4.2" @@ -422,35 +314,6 @@ dependencies = [ "hashbrown 0.13.2", ] -[[package]] -name = "ark-scale" -version = "0.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "ark-secret-scalar" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", - "ark-transcript", - "digest 0.10.7", - "getrandom_or_panic", - "zeroize", -] - [[package]] name = "ark-serialize" version = "0.4.2" @@ -482,39 +345,19 @@ checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", "rand 0.8.5", - "rayon", ] -[[package]] -name = "ark-transcript" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "digest 0.10.7", - "rand_core 0.6.4", - "sha3", -] - -[[package]] -name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" - [[package]] name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -533,9 +376,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii-canvas" @@ -552,8 +395,24 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", + "asn1-rs-derive 0.4.0", + "asn1-rs-impl 0.1.0", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +dependencies = [ + "asn1-rs-derive 0.5.1", + "asn1-rs-impl 0.2.0", "displaydoc", "nom", "num-traits", @@ -571,7 +430,19 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "synstructure 0.13.1", ] [[package]] @@ -585,16 +456,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "assert_cmd" -version = "2.0.14" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" +checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" dependencies = [ "anstyle", "bstr", "doc-comment", - "predicates 3.1.0", + "libc", + "predicates 3.1.2", "predicates-core", "predicates-tree", "wait-timeout", @@ -608,7 +491,7 @@ checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" dependencies = [ "event-listener 2.5.3", "futures-core", - "parking_lot 0.12.1", + "parking_lot 0.12.3", ] [[package]] @@ -634,28 +517,26 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 4.0.3", "event-listener-strategy", "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.1.1", + "futures-lite 2.3.0", "slab", ] @@ -693,21 +574,21 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.1" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.4.0", - "rustix 0.38.31", + "polling 3.7.3", + "rustix 0.38.37", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -721,13 +602,13 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "event-listener-strategy", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -754,43 +635,43 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.31", + "rustix 0.38.37", "windows-sys 0.48.0", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.1", - "async-lock 2.8.0", + "async-io 2.3.4", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.31", + "rustix 0.38.37", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -814,7 +695,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -830,69 +711,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "atty" -version = "0.2.14" +name = "attohttpc" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "http 0.2.12", + "log", + "url", ] [[package]] name = "auto_impl" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.21.0", - "cc", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.36.5", "rustc-demangle", -] - -[[package]] -name = "bandersnatch_vrfs" -version = "0.0.4" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ff", - "ark-serialize", - "ark-std", - "dleq_vrf", - "fflonk", - "merlin 3.0.0", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "ring 0.1.0", - "sha2 0.10.8", - "sp-ark-bls12-381", - "sp-ark-ed-on-bls12-381-bandersnatch", - "zeroize", + "windows-targets 0.52.6", ] [[package]] @@ -995,22 +853,22 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.16", + "prettyplease 0.2.22", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "bip39" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" dependencies = [ - "bitcoin_hashes 0.11.0", + "bitcoin_hashes 0.13.0", "rand 0.8.5", "rand_core 0.6.4", "serde", @@ -1047,16 +905,16 @@ dependencies = [ ] [[package]] -name = "bitcoin-private" -version = "0.1.0" +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] -name = "bitcoin_hashes" -version = "0.11.0" +name = "bitcoin-private" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" [[package]] name = "bitcoin_hashes" @@ -1068,6 +926,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -1076,9 +944,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -1130,8 +998,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.0", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] @@ -1141,21 +1009,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.0", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] name = "blake3" -version = "1.5.0" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "cc", "cfg-if", - "constant_time_eq 0.3.0", + "constant_time_eq 0.3.1", ] [[package]] @@ -1199,42 +1067,39 @@ dependencies = [ [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.3.0", + "async-channel 2.3.1", "async-task", - "fastrand 2.0.1", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] name = "borsh" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" dependencies = [ "borsh-derive", - "cfg_aliases", - "hashbrown 0.14.3", + "cfg_aliases 0.2.1", + "hashbrown 0.14.5", ] [[package]] name = "borsh-derive" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", "syn_derive", ] @@ -1250,6 +1115,18 @@ dependencies = [ "serde", ] +[[package]] +name = "bounded-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "bs58" version = "0.4.0" @@ -1268,12 +1145,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.8", "serde", ] @@ -1288,9 +1165,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -1306,9 +1183,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.14.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea31d69bda4949c1c1562c1e6f042a1caefac98cdc8a298260a2ff41c1e2d42b" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -1318,9 +1195,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] @@ -1358,18 +1235,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -1382,7 +1259,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1396,7 +1273,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1404,14 +1281,21 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" dependencies = [ "jobserver", "libc", + "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -1430,8 +1314,8 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-core 21.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-std 14.0.0", "utilities", ] @@ -1448,7 +1332,7 @@ dependencies = [ "cf-primitives", "cf-runtime-utilities", "cf-test-utilities", - "curve25519-dalek 3.2.1", + "curve25519-dalek 4.1.3", "digest 0.10.7", "ed25519-dalek", "ethabi", @@ -1459,7 +1343,7 @@ dependencies = [ "heck 0.5.0", "hex", "hex-literal", - "itertools 0.11.0", + "itertools 0.13.0", "libsecp256k1", "log", "parity-scale-codec", @@ -1473,10 +1357,10 @@ dependencies = [ "sha2 0.10.8", "sha2-const", "sol-prim", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "ss58-registry", "strum 0.24.1", "thiserror", @@ -1543,12 +1427,12 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", "sp-offchain", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-session", - "sp-std 8.0.0", + "sp-std 14.0.0", "sp-timestamp", "sp-transaction-pool", "sp-version", @@ -1568,10 +1452,10 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "strum 0.24.1", "strum_macros 0.24.3", "utilities", @@ -1594,9 +1478,9 @@ dependencies = [ "hex-literal", "log", "parity-scale-codec", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-std 14.0.0", ] [[package]] @@ -1607,9 +1491,9 @@ dependencies = [ "frame-support", "log", "parity-scale-codec", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -1622,8 +1506,8 @@ dependencies = [ "pallet-session", "parity-scale-codec", "rand 0.8.5", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -1634,9 +1518,9 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", ] [[package]] @@ -1654,9 +1538,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -1670,14 +1554,14 @@ dependencies = [ "hex", "parity-scale-codec", "scale-info", - "sp-std 8.0.0", + "sp-std 14.0.0", ] [[package]] name = "cfg-expr" -version = "0.15.6" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -1694,6 +1578,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha" version = "0.3.0" @@ -1746,8 +1636,9 @@ dependencies = [ "futures", "hex", "hmac-sha512", + "jsonrpsee 0.23.2", "lazy_static", - "libp2p-identity 0.2.8", + "libp2p-identity", "libsecp256k1", "pallet-cf-account-roles", "pallet-cf-asset-balances", @@ -1765,7 +1656,7 @@ dependencies = [ "serde", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core 21.0.0", + "sp-core 34.0.0", "state-chain-runtime", "tiny-bip39", "tokio", @@ -1780,13 +1671,13 @@ version = "1.7.0" dependencies = [ "anyhow", "chainflip-api", - "clap 3.2.25", + "clap", "custom-rpc", "futures", "hex", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "serde", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", "substrate-build-script-utils", "tokio", @@ -1804,7 +1695,7 @@ dependencies = [ "cf-chains", "chainflip-api", "chainflip-engine", - "clap 3.2.25", + "clap", "config", "custom-rpc", "futures", @@ -1833,10 +1724,10 @@ dependencies = [ "cf-primitives", "chainflip-node", "chrono", - "clap 3.2.25", + "clap", "config", "csv", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "custom-rpc", "dyn-clone", "ed25519-dalek", @@ -1854,14 +1745,14 @@ dependencies = [ "hex", "http 1.1.0", "httparse", - "itertools 0.11.0", - "jsonrpsee 0.16.3", + "itertools 0.13.0", + "jsonrpsee 0.23.2", "lazy_format", "lazy_static", - "mockall", + "mockall 0.13.0", "multisig", "num-bigint", - "num-derive 0.4.2", + "num-derive", "num-traits", "pallet-cf-account-roles", "pallet-cf-broadcast", @@ -1896,9 +1787,9 @@ dependencies = [ "serde_path_to_error", "sha2 0.10.8", "sol-prim", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-version", "state-chain-runtime", "substrate-build-script-utils", @@ -1913,7 +1804,7 @@ dependencies = [ "utilities", "warp", "web3", - "x25519-dalek 2.0.1", + "x25519-dalek", "zeroize", "zmq", ] @@ -1928,14 +1819,14 @@ dependencies = [ "cf-chains", "cf-primitives", "chainflip-engine", - "clap 3.2.25", + "clap", "config", "frame-support", "futures", "hex", "insta", - "jsonrpsee 0.16.3", - "mockall", + "jsonrpsee 0.23.2", + "mockall 0.11.4", "pallet-cf-broadcast", "pallet-cf-environment", "pallet-cf-ingress-egress", @@ -1943,7 +1834,7 @@ dependencies = [ "redis", "serde", "serde_json", - "sp-core 21.0.0", + "sp-core 34.0.0", "state-chain-runtime", "substrate-build-script-utils", "tempfile", @@ -1960,16 +1851,17 @@ dependencies = [ "anyhow", "cf-primitives", "chainflip-api", - "clap 3.2.25", + "clap", "custom-rpc", "frame-system", "futures", "hex", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "pallet-cf-pools", + "sc-rpc", "serde", "serde_json", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", "substrate-build-script-utils", "tokio", @@ -1984,7 +1876,7 @@ version = "1.7.0" dependencies = [ "cf-chains", "cf-primitives", - "clap 4.4.18", + "clap", "custom-rpc", "frame-benchmarking", "frame-benchmarking-cli", @@ -1992,7 +1884,7 @@ dependencies = [ "futures", "hex", "hex-literal", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2021,44 +1913,57 @@ dependencies = [ "sp-consensus", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-io 23.0.0", + "sp-io 38.0.0", "sp-keyring", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-timestamp", "state-chain-runtime", "substrate-build-script-utils", "substrate-frame-rpc-system", - "try-runtime-cli", "utilities", ] [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "cid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" +dependencies = [ + "core2", + "multibase", + "multihash 0.17.0", + "serde", + "unsigned-varint 0.7.2", ] [[package]] name = "cid" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" dependencies = [ "core2", "multibase", - "multihash 0.17.0", + "multihash 0.18.1", "serde", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -2083,9 +1988,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -2094,89 +1999,50 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive 3.2.25", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "once_cell", - "strsim 0.10.0", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap" -version = "4.4.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", - "clap_derive 4.4.7", + "clap_derive", ] [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim 0.10.0", + "clap_lex", + "strsim 0.11.1", "terminal_size", ] [[package]] name = "clap_derive" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "clap_derive" -version = "4.4.7" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -2245,51 +2111,35 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "futures-core", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tokio-util", ] [[package]] name = "comfy-table" -version = "7.1.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" +checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ - "strum 0.25.0", - "strum_macros 0.25.3", + "strum 0.26.3", + "strum_macros 0.26.4", "unicode-width", ] -[[package]] -name = "common" -version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#b273d33f9981e2bb3375ab45faeb537f7ee35224" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "fflonk", - "getrandom_or_panic", - "merlin 3.0.0", - "rand_chacha 0.3.1", -] - [[package]] name = "common-path" version = "1.0.0" @@ -2298,9 +2148,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -2339,9 +2189,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" +checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" dependencies = [ "cfg-if", "cpufeatures", @@ -2358,9 +2208,9 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" dependencies = [ "const-random-macro", ] @@ -2371,7 +2221,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -2384,9 +2234,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "constcat" @@ -2412,9 +2262,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core2" @@ -2436,9 +2286,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -2467,7 +2317,7 @@ dependencies = [ "gimli 0.27.3", "hashbrown 0.13.2", "log", - "regalloc2", + "regalloc2 0.6.1", "smallvec", "target-lexicon", ] @@ -2541,11 +2391,26 @@ dependencies = [ "wasmtime-types", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -2580,9 +2445,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2598,7 +2463,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2630,7 +2495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -2640,7 +2505,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -2682,7 +2547,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2695,37 +2560,24 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.5.0", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.1" -source = "git+https://github.com/solana-labs/curve25519-dalek.git?rev=b500cdc2a920cd5bff9e2dd974d7b97349d61464#b500cdc2a920cd5bff9e2dd974d7b97349d61464" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", "serde", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2737,7 +2589,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -2753,7 +2605,7 @@ dependencies = [ "futures", "hex", "insta", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "pallet-cf-governance", "pallet-cf-pools", @@ -2761,14 +2613,15 @@ dependencies = [ "pallet-cf-witnesser", "parity-scale-codec", "sc-client-api", + "sc-rpc", "sc-rpc-api", "serde", "serde_json", "sp-api", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", "state-chain-runtime", "thiserror", "utilities", @@ -2776,9 +2629,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.115" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc" +checksum = "54ccead7d199d584d139148b04b4a368d1ec7556a1d9ea2548febb1b9d49f9a4" dependencies = [ "cc", "cxxbridge-flags", @@ -2788,9 +2641,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.115" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a71e1e631fa2f2f5f92e8b0d860a00c198c6771623a6cefcc863e3554f0d8d6" +checksum = "c77953e99f01508f89f55c494bfa867171ef3a6c8cea03d26975368f2121a5c1" dependencies = [ "cc", "codespan-reporting", @@ -2798,24 +2651,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "cxxbridge-flags" -version = "1.0.115" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c" +checksum = "65777e06cc48f0cb0152024c77d6cf9e4bdb4408e7b48bea993d42fa0f5b02b6" [[package]] name = "cxxbridge-macro" -version = "1.0.115" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e" +checksum = "98532a60dedaebc4848cb2cba5023337cc9ea3af16a5b062633fabfd9f18fb60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -2840,12 +2693,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.5" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.5", - "darling_macro 0.20.5", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -2878,16 +2731,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.5" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.61", + "strsim 0.11.1", + "syn 2.0.79", ] [[package]] @@ -2914,26 +2767,39 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.5", + "darling_core 0.20.10", "quote", - "syn 2.0.61", + "syn 2.0.79", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2941,9 +2807,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2951,9 +2817,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -2965,7 +2831,21 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs 0.6.2", "displaydoc", "nom", "num-bigint", @@ -2980,6 +2860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", + "serde", ] [[package]] @@ -2995,13 +2876,13 @@ dependencies = [ [[package]] name = "derive-syn-parse" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -3031,23 +2912,17 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.79", ] -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "difflib" version = "0.4.0" @@ -3081,7 +2956,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3147,29 +3022,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", -] - -[[package]] -name = "dleq_vrf" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-scale", - "ark-secret-scalar", - "ark-serialize", - "ark-std", - "ark-transcript", - "arrayvec 0.7.4", - "zeroize", + "syn 2.0.79", ] [[package]] @@ -3198,18 +3057,18 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "docify" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" +checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" +checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", "derive-syn-parse", @@ -3217,9 +3076,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.61", + "syn 2.0.79", "termcolor", - "toml 0.8.10", + "toml 0.8.19", "walkdir", ] @@ -3231,9 +3090,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dtoa" @@ -3243,9 +3102,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clonable" @@ -3270,9 +3129,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" @@ -3284,6 +3143,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -3304,12 +3164,12 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3333,9 +3193,9 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -3344,9 +3204,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -3363,15 +3223,16 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -3384,9 +3245,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -3404,7 +3265,7 @@ dependencies = [ "engine-upgrade-utils", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -3416,7 +3277,7 @@ dependencies = [ "cf-engine-dylib", "engine-proc-macros", "engine-upgrade-utils", - "predicates 3.1.0", + "predicates 3.1.2", "reqwest", "tempfile", ] @@ -3426,14 +3287,14 @@ name = "engine-upgrade-utils" version = "1.0.0" dependencies = [ "anyhow", - "toml 0.8.10", + "toml 0.8.19", ] [[package]] name = "enr" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" dependencies = [ "base64 0.21.7", "bytes", @@ -3471,11 +3332,23 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -3506,9 +3379,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", @@ -3531,9 +3404,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3635,9 +3508,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7cd562832e2ff584fa844cd2f6e5d4f35bbe11b28c7c9b8df957b2e1d0c701" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -3651,9 +3524,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35dc9a249c066d17e8947ff52a4116406163cf92c7f0763cb8c001760b26403f" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -3663,9 +3536,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43304317c7f776876e47f2f637859f6d0701c1ec7930a150f169d5fbe7d76f5a" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -3682,9 +3555,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f96502317bf34f6d71a3e3d270defaa9485d754d789e15a8e04a84161c95eb" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", "const-hex", @@ -3692,23 +3565,23 @@ dependencies = [ "ethers-core", "ethers-etherscan", "eyre", - "prettyplease 0.2.16", + "prettyplease 0.2.22", "proc-macro2", "quote", "regex", "reqwest", "serde", "serde_json", - "syn 2.0.61", - "toml 0.8.10", + "syn 2.0.79", + "toml 0.8.19", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452ff6b0a64507ce8d67ffd48b1da3b42f03680dcf5382244e9c93822cbbf5de" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ "Inflector", "const-hex", @@ -3717,16 +3590,16 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "ethers-core" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bytes", "cargo_metadata 0.18.1", "chrono", @@ -3742,8 +3615,8 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.25.0", - "syn 2.0.61", + "strum 0.26.3", + "syn 2.0.79", "tempfile", "thiserror", "tiny-keccak", @@ -3752,14 +3625,14 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -3768,9 +3641,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145211f34342487ef83a597c1e69f0d3e01512217a7c72cc8a25931854c7dca0" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", "auto_impl", @@ -3795,9 +3668,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", "auto_impl", @@ -3810,7 +3683,7 @@ dependencies = [ "futures-timer", "futures-util", "hashers", - "http 0.2.11", + "http 0.2.12", "instant", "jsonwebtoken", "once_cell", @@ -3820,7 +3693,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tracing", "tracing-futures", "url", @@ -3832,9 +3705,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b125a103b56aef008af5d5fb48191984aa326b50bfd2557d231dc499833de3" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", @@ -3851,9 +3724,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d21df08582e0a43005018a858cc9b465c5fff9cf4056651be64f844e57d1f55f" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ "cfg-if", "const-hex", @@ -3868,7 +3741,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "solang-parser", @@ -3895,28 +3768,28 @@ checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.3", - "pin-project-lite 0.2.13", + "event-listener 5.3.1", + "pin-project-lite", ] [[package]] @@ -3930,15 +3803,17 @@ dependencies = [ [[package]] name = "expander" -version = "2.0.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ "blake2 0.10.6", + "file-guard", "fs-err", + "prettyplease 0.2.22", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -3963,6 +3838,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.9.0" @@ -3974,9 +3855,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdlimit" @@ -3995,27 +3876,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] -name = "fflonk" -version = "0.1.0" -source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "merlin 3.0.0", -] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] -name = "fiat-crypto" -version = "0.2.6" +name = "file-guard" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "file-per-thread-logger" @@ -4029,14 +3907,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -4051,7 +3929,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "scale-info", ] @@ -4075,12 +3953,11 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "libz-sys", "miniz_oxide", ] @@ -4116,8 +3993,8 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "13.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", ] @@ -4131,6 +4008,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "forwarded-header-value" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" +dependencies = [ + "nonempty", + "thiserror", +] + [[package]] name = "fragile" version = "2.0.0" @@ -4139,8 +4026,8 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "frame-support-procedural", @@ -4152,32 +4039,31 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 23.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-runtime-interface 17.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", + "sp-application-crypto 38.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-runtime-interface 28.0.0", + "sp-storage 21.0.0", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "42.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "Inflector", - "array-bytes 6.2.2", + "array-bytes", "chrono", - "clap 4.4.18", + "clap", "comfy-table", "frame-benchmarking", "frame-support", "frame-system", "gethostname", "handlebars", - "itertools 0.10.5", + "itertools 0.11.0", "lazy_static", "linked-hash-map", "log", @@ -4185,6 +4071,7 @@ dependencies = [ "rand 0.8.5", "rand_pcg", "sc-block-builder", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-client-db", @@ -4195,37 +4082,38 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-database", - "sp-externalities 0.19.0", + "sp-externalities 0.29.0", + "sp-genesis-builder", "sp-inherents", - "sp-io 23.0.0", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", - "sp-storage 13.0.0", - "sp-trie 22.0.0", - "sp-wasm-interface 14.0.0", + "sp-io 38.0.0", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", + "sp-storage 21.0.0", + "sp-trie 37.0.0", + "sp-wasm-interface 21.0.0", "thiserror", "thousands", ] [[package]] name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "aquamarine", "frame-support", "frame-system", "frame-try-runtime", "log", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", - "sp-tracing 10.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-tracing 17.0.0", ] [[package]] @@ -4251,34 +4139,13 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-remote-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "futures", - "indicatif", - "jsonrpsee 0.16.3", - "log", - "parity-scale-codec", - "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", -] - [[package]] name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "aquamarine", - "array-bytes 6.2.2", + "array-bytes", "bitflags 1.3.2", "docify", "environmental", @@ -4295,69 +4162,69 @@ dependencies = [ "serde_json", "smallvec", "sp-api", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-core-hashing-proc-macro", - "sp-debug-derive 8.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive 14.0.0", "sp-genesis-builder", "sp-inherents", - "sp-io 23.0.0", + "sp-io 38.0.0", "sp-metadata-ir", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-staking", - "sp-state-machine 0.28.0", - "sp-std 8.0.0", - "sp-tracing 10.0.0", - "sp-weights 20.0.0", + "sp-state-machine 0.43.0", + "sp-std 14.0.0", + "sp-tracing 17.0.0", + "sp-weights 31.0.0", "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "30.0.2" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "expander", "frame-support-procedural-tools", - "itertools 0.10.5", + "itertools 0.11.0", "macro_magic", - "proc-macro-warning", + "proc-macro-warning 1.0.2", "proc-macro2", "quote", - "sp-core-hashing 9.0.0", - "syn 2.0.61", + "sp-crypto-hashing", + "syn 2.0.79", ] [[package]] name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "13.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "12.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.1.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "cfg-if", "docify", @@ -4366,48 +4233,47 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "sp-version", - "sp-weights 20.0.0", + "sp-weights 31.0.0", ] [[package]] name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "docify", "parity-scale-codec", "sp-api", ] [[package]] name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", ] [[package]] @@ -4443,9 +4309,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -4456,11 +4322,21 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-bounded" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +dependencies = [ + "futures-timer", + "futures-util", +] + [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -4468,15 +4344,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -4486,9 +4362,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -4501,21 +4377,21 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite", "waker-fn", ] [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -4530,43 +4406,42 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "futures-rustls" -version = "0.22.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.20.9", - "webpki", + "rustls 0.21.12", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -4574,9 +4449,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -4585,7 +4460,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "pin-utils", "slab", ] @@ -4642,9 +4517,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe739944a5406424e080edccb6add95685130b9f160d5407c639c7df0c5836b0" +checksum = "96512db27971c2c3eece70a1e106fbe6c87760234e31e8f7e5634912fe52794a" dependencies = [ "typenum", ] @@ -4672,9 +4547,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -4693,11 +4568,11 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "polyval", ] @@ -4707,7 +4582,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -4717,36 +4592,34 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] [[package]] -name = "glob" -version = "0.3.1" +name = "gimli" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] -name = "globset" -version = "0.4.14" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-net" -version = "0.2.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", + "http 0.2.12", "js-sys", "pin-project", "serde", @@ -4771,9 +4644,9 @@ dependencies = [ [[package]] name = "gloo-utils" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ "js-sys", "serde", @@ -4782,6 +4655,26 @@ dependencies = [ "web-sys", ] +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.3", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -4790,7 +4683,7 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -4804,8 +4697,27 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.2.2", + "http 0.2.12", + "indexmap 2.6.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -4814,9 +4726,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -4853,7 +4765,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -4862,20 +4774,26 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "allocator-api2", "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hashers" version = "1.0.1" @@ -4891,7 +4809,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -4903,7 +4821,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 0.2.11", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -4915,7 +4833,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.11", + "http 0.2.12", ] [[package]] @@ -4932,18 +4850,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -4954,6 +4869,12 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-literal" version = "0.4.1" @@ -5043,9 +4964,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -5070,21 +4991,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", - "pin-project-lite 0.2.13", + "http 0.2.12", + "pin-project-lite", ] [[package]] -name = "http-range-header" -version = "0.3.1" +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "pin-project-lite", +] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -5100,28 +5038,49 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", - "http 0.2.11", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.13", - "socket2 0.5.5", + "pin-project-lite", + "socket2 0.5.7", "tokio", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -5129,14 +5088,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", - "hyper", + "http 0.2.12", + "hyper 0.14.30", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", - "webpki-roots 0.25.4", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "log", + "rustls 0.23.13", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", ] [[package]] @@ -5147,7 +5123,7 @@ checksum = "6eea26c5d0b6ab9d72219f65000af310f042a740926f7b2fa3553e774036e2e7" dependencies = [ "derive_builder", "dns-lookup", - "hyper", + "hyper 0.14.30", "tokio", "tower-service", "tracing", @@ -5160,17 +5136,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", ] +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower-service", + "tracing", +] + [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -5242,7 +5237,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.1", + "async-io 2.3.4", "core-foundation", "fnv", "futures", @@ -5255,6 +5250,25 @@ dependencies = [ "windows", ] +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.12", + "hyper 0.14.30", + "log", + "rand 0.8.5", + "tokio", + "url", + "xmltree", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -5295,18 +5309,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -5331,12 +5345,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[package]] @@ -5345,19 +5359,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "indicatif" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - [[package]] name = "inout" version = "0.1.3" @@ -5369,9 +5370,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.38.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc" +checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" dependencies = [ "console", "lazy_static", @@ -5382,9 +5383,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -5404,7 +5405,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.5", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -5421,7 +5422,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.5", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -5429,21 +5430,27 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.5", - "rustix 0.38.31", + "hermit-abi 0.4.0", + "libc", "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -5462,6 +5469,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -5473,24 +5489,44 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -5523,73 +5559,74 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +checksum = "138572befc78a9793240645926f30161f8b4143d2be18d09e44ed9814bd7ee2c" dependencies = [ - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-http-client 0.16.3", - "jsonrpsee-proc-macros", - "jsonrpsee-server", - "jsonrpsee-types 0.16.3", - "jsonrpsee-wasm-client", - "jsonrpsee-ws-client", - "tracing", + "jsonrpsee-client-transport 0.20.4", + "jsonrpsee-core 0.20.4", + "jsonrpsee-http-client 0.20.4", + "jsonrpsee-types 0.20.4", ] [[package]] name = "jsonrpsee" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" dependencies = [ - "jsonrpsee-client-transport 0.20.3", - "jsonrpsee-core 0.20.3", - "jsonrpsee-http-client 0.20.3", - "jsonrpsee-types 0.20.3", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-http-client 0.23.2", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types 0.23.2", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", + "tokio", + "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "5c671353e4adf926799107bd7f5724a06b6bc0a333db442a0843c58640bdd0c1" dependencies = [ - "anyhow", - "futures-channel", - "futures-timer", "futures-util", - "gloo-net", - "http 0.2.11", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "http 0.2.12", + "jsonrpsee-core 0.20.4", "pin-project", - "rustls-native-certs", - "soketto", + "rustls-native-certs 0.6.3", + "soketto 0.7.1", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tracing", - "webpki-roots 0.25.4", + "url", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" dependencies = [ + "base64 0.22.1", + "futures-channel", "futures-util", - "http 0.2.11", - "jsonrpsee-core 0.20.3", + "gloo-net", + "http 1.1.0", + "jsonrpsee-core 0.23.2", "pin-project", - "rustls-native-certs", - "soketto", + "rustls 0.23.13", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto 0.8.0", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.0", "tokio-util", "tracing", "url", @@ -5597,85 +5634,91 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.16.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +checksum = "f24ea59b037b6b9b0e2ebe2c30a3e782b56bd7c76dcc5d6d70ba55d442af56e3" dependencies = [ "anyhow", - "arrayvec 0.7.4", "async-lock 2.8.0", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", - "globset", - "hyper", - "jsonrpsee-types 0.16.3", - "parking_lot 0.12.1", - "rand 0.8.5", + "hyper 0.14.30", + "jsonrpsee-types 0.20.4", "rustc-hash", "serde", "serde_json", - "soketto", "thiserror", "tokio", "tracing", - "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" dependencies = [ "anyhow", - "async-lock 2.8.0", "async-trait", "beef", + "bytes", "futures-timer", "futures-util", - "hyper", - "jsonrpsee-types 0.20.3", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "jsonrpsee-types 0.23.2", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", + "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-http-client" -version = "0.16.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +checksum = "57c7b9f95208927653e7965a98525e7fc641781cab89f0e27c43fa2974405683" dependencies = [ "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", - "rustc-hash", + "hyper 0.14.30", + "hyper-rustls 0.24.2", + "jsonrpsee-core 0.20.4", + "jsonrpsee-types 0.20.4", "serde", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-http-client" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" dependencies = [ "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core 0.20.3", - "jsonrpsee-types 0.20.3", + "base64 0.22.1", + "http-body 1.0.1", + "hyper 1.4.1", + "hyper-rustls 0.27.3", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "rustls 0.23.13", + "rustls-platform-verifier", "serde", "serde_json", "thiserror", @@ -5687,32 +5730,38 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 1.1.3", + "heck 0.5.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "jsonrpsee-server" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" dependencies = [ - "futures-channel", + "anyhow", "futures-util", - "http 0.2.11", - "hyper", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "pin-project", + "route-recognizer", "serde", "serde_json", - "soketto", + "soketto 0.8.0", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -5722,9 +5771,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +checksum = "3264e339143fe37ed081953842ee67bfafa99e3b91559bdded6e4abd8fc8535e" dependencies = [ "anyhow", "beef", @@ -5736,39 +5785,39 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ - "anyhow", "beef", + "http 1.1.0", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-wasm-client" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5df77c8f625d36e4cfb583c5a674eccebe32403fcfe42f7ceff7fac9324dd" +checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" dependencies = [ - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", ] [[package]] name = "jsonrpsee-ws-client" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" dependencies = [ - "http 0.2.11", - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "http 1.1.0", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "url", ] [[package]] @@ -5787,14 +5836,15 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", "signature", ] @@ -5830,7 +5880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.3", ] [[package]] @@ -5841,7 +5891,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "regex", "rocksdb", "smallvec", @@ -5849,31 +5899,33 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.5", + "regex-syntax 0.8.5", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.8", +] [[package]] name = "lazy_format" @@ -5883,9 +5935,9 @@ checksum = "e479e99b287d578ed5f6cd4c92cdf48db219088adb9c5b14f7c155b71dfba792" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -5895,18 +5947,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] @@ -5917,21 +5969,22 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.51.4" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" +checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" dependencies = [ "bytes", + "either", "futures", "futures-timer", - "getrandom 0.2.12", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", "libp2p-dns", "libp2p-identify", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", @@ -5941,94 +5994,100 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", + "libp2p-upnp", "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", - "multiaddr", + "multiaddr 0.18.2", "pin-project", + "rw-stream-sink", + "thiserror", ] [[package]] name = "libp2p-allow-block-list" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" +checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" dependencies = [ "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", "void", ] [[package]] name = "libp2p-connection-limits" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" dependencies = [ "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", "void", ] [[package]] name = "libp2p-core" -version = "0.39.2" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" dependencies = [ "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-identity 0.1.3", + "libp2p-identity", "log", - "multiaddr", - "multihash 0.17.0", + "multiaddr 0.18.2", + "multihash 0.19.1", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand 0.8.5", "rw-stream-sink", "smallvec", "thiserror", - "unsigned-varint", + "unsigned-varint 0.7.2", "void", ] [[package]] name = "libp2p-dns" -version = "0.39.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" +checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" dependencies = [ + "async-trait", "futures", "libp2p-core", + "libp2p-identity", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "smallvec", "trust-dns-resolver", ] [[package]] name = "libp2p-identify" -version = "0.42.2" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" +checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" dependencies = [ "asynchronous-codec", "either", "futures", + "futures-bounded", "futures-timer", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", "log", - "lru 0.10.1", + "lru", "quick-protobuf", "quick-protobuf-codec", "smallvec", @@ -6038,33 +6097,16 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" -dependencies = [ - "bs58 0.4.0", - "ed25519-dalek", - "log", - "multiaddr", - "multihash 0.17.0", - "quick-protobuf", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", - "zeroize", -] - -[[package]] -name = "libp2p-identity" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" +checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" dependencies = [ "bs58 0.5.1", "ed25519-dalek", "hkdf", "multihash 0.19.1", "quick-protobuf", + "rand 0.8.5", "sha2 0.10.8", "thiserror", "tracing", @@ -6073,11 +6115,11 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.43.3" +version = "0.44.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" +checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "asynchronous-codec", "bytes", "either", @@ -6086,35 +6128,36 @@ dependencies = [ "futures-timer", "instant", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", "log", "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "sha2 0.10.8", "smallvec", "thiserror", "uint", - "unsigned-varint", + "unsigned-varint 0.7.2", "void", ] [[package]] name = "libp2p-mdns" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" +checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" dependencies = [ "data-encoding", "futures", "if-watch", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", "smallvec", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "trust-dns-proto 0.22.0", "void", @@ -6122,30 +6165,35 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" +checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" dependencies = [ + "instant", "libp2p-core", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-ping", "libp2p-swarm", + "once_cell", "prometheus-client", ] [[package]] name = "libp2p-noise" -version = "0.42.2" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" +checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" dependencies = [ "bytes", - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.3", "futures", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "log", + "multiaddr 0.18.2", + "multihash 0.19.1", "once_cell", "quick-protobuf", "rand 0.8.5", @@ -6153,21 +6201,22 @@ dependencies = [ "snow", "static_assertions", "thiserror", - "x25519-dalek 1.1.1", + "x25519-dalek", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" +checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" dependencies = [ "either", "futures", "futures-timer", "instant", "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", @@ -6176,47 +6225,51 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha.3" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" +checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.1", - "quinn-proto", + "parking_lot 0.12.3", + "quinn 0.10.2", "rand 0.8.5", - "rustls 0.20.9", + "ring 0.16.20", + "rustls 0.21.12", + "socket2 0.5.7", "thiserror", "tokio", ] [[package]] name = "libp2p-request-response" -version = "0.24.1" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" +checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" dependencies = [ "async-trait", "futures", "instant", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm", + "log", "rand 0.8.5", "smallvec", + "void", ] [[package]] name = "libp2p-swarm" -version = "0.42.2" +version = "0.43.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" +checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" dependencies = [ "either", "fnv", @@ -6224,9 +6277,11 @@ dependencies = [ "futures-timer", "instant", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "libp2p-swarm-derive", "log", + "multistream-select", + "once_cell", "rand 0.8.5", "smallvec", "tokio", @@ -6235,88 +6290,109 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" +checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" dependencies = [ "heck 0.4.1", + "proc-macro-warning 0.4.2", + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "libp2p-tcp" -version = "0.39.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" +checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" dependencies = [ "futures", "futures-timer", "if-watch", "libc", "libp2p-core", + "libp2p-identity", "log", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", ] [[package]] name = "libp2p-tls" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" dependencies = [ "futures", "futures-rustls", "libp2p-core", - "libp2p-identity 0.1.3", + "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.20.9", + "rustls 0.21.12", + "rustls-webpki 0.101.7", "thiserror", - "webpki", - "x509-parser", + "x509-parser 0.15.1", "yasna", ] +[[package]] +name = "libp2p-upnp" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +dependencies = [ + "futures", + "futures-timer", + "igd-next", + "libp2p-core", + "libp2p-swarm", + "log", + "tokio", + "void", +] + [[package]] name = "libp2p-wasm-ext" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" +checksum = "1e5d8e3a9e07da0ef5b55a9f26c009c8fb3c725d492d8bb4b431715786eea79c" dependencies = [ "futures", "js-sys", "libp2p-core", - "parity-send-wrapper", + "send_wrapper 0.6.0", "wasm-bindgen", "wasm-bindgen-futures", ] [[package]] name = "libp2p-websocket" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" +checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", + "libp2p-identity", "log", - "parking_lot 0.12.1", - "quicksink", + "parking_lot 0.12.3", + "pin-project-lite", "rw-stream-sink", - "soketto", + "soketto 0.8.0", + "thiserror", "url", - "webpki-roots 0.22.6", + "webpki-roots 0.25.4", ] [[package]] name = "libp2p-yamux" -version = "0.43.1" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" +checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" dependencies = [ "futures", "libp2p-core", @@ -6327,13 +6403,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.7", ] [[package]] @@ -6379,7 +6455,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -6402,9 +6478,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.15" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -6458,9 +6534,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lioness" @@ -6474,11 +6550,66 @@ dependencies = [ "keystream", ] +[[package]] +name = "litep2p" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f46c51c205264b834ceed95c8b195026e700494bc3991aaba3b4ea9e20626d9" +dependencies = [ + "async-trait", + "bs58 0.4.0", + "bytes", + "cid 0.10.1", + "ed25519-dalek", + "futures", + "futures-timer", + "hex-literal", + "indexmap 2.6.0", + "libc", + "mockall 0.12.1", + "multiaddr 0.17.1", + "multihash 0.17.0", + "network-interface", + "nohash-hasher", + "parking_lot 0.12.3", + "pin-project", + "prost 0.12.6", + "prost-build 0.11.9", + "quinn 0.9.4", + "rand 0.8.5", + "rcgen", + "ring 0.16.20", + "rustls 0.20.9", + "serde", + "sha2 0.10.8", + "simple-dns", + "smallvec", + "snow", + "socket2 0.5.7", + "static_assertions", + "str0m", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite 0.20.1", + "tokio-util", + "tracing", + "trust-dns-resolver", + "uint", + "unsigned-varint 0.8.0", + "url", + "webpki", + "x25519-dalek", + "x509-parser 0.16.0", + "yasna", + "zeroize", +] + [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -6486,26 +6617,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "lru" -version = "0.10.1" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" -dependencies = [ - "hashbrown 0.13.2", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -6519,19 +6641,18 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" dependencies = [ - "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -6548,58 +6669,52 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.61", + "syn 2.0.79", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -6632,9 +6747,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" dependencies = [ "autocfg", "rawpointer", @@ -6652,9 +6767,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" @@ -6662,7 +6777,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.31", + "rustix 0.38.37", ] [[package]] @@ -6674,6 +6789,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -6735,9 +6859,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -6751,22 +6875,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6776,20 +6901,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "either", "hashlink", "lioness", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "rand_chacha 0.3.1", "rand_distr", - "subtle 2.5.0", + "subtle 2.6.1", "thiserror", "zeroize", ] @@ -6804,11 +6929,40 @@ dependencies = [ "downcast", "fragile", "lazy_static", - "mockall_derive", + "mockall_derive 0.11.4", "predicates 2.1.5", "predicates-tree", ] +[[package]] +name = "mockall" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive 0.12.1", + "predicates 3.1.2", + "predicates-tree", +] + +[[package]] +name = "mockall" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c28b3fb6d753d28c20e826cd46ee611fda1cf3cde03a443a974043247c065a" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "mockall_derive 0.13.0", + "predicates 3.1.2", + "predicates-tree", +] + [[package]] name = "mockall_derive" version = "0.11.4" @@ -6821,6 +6975,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "mockall_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "mockall_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "341014e7f530314e9a1fdbc7400b244efea7122662c96bfa248c31da5bfb2020" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "multer" version = "2.1.0" @@ -6830,7 +7008,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 0.2.11", + "http 0.2.12", "httparse", "log", "memchr", @@ -6854,7 +7032,26 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.7.2", + "url", +] + +[[package]] +name = "multiaddr" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "libp2p-identity", + "multibase", + "multihash 0.19.1", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.8.0", "url", ] @@ -6883,7 +7080,24 @@ dependencies = [ "multihash-derive", "sha2 0.10.8", "sha3", - "unsigned-varint", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.8", + "sha3", + "unsigned-varint 0.7.2", ] [[package]] @@ -6893,7 +7107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -6907,7 +7121,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -6916,6 +7130,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multisig" version = "0.1.0" @@ -6928,19 +7148,19 @@ dependencies = [ "blake2 0.10.6", "cf-chains", "cf-primitives", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519-dalek", "futures", "futures-core", "futures-util", - "generic-array 1.0.0", + "generic-array 1.1.0", "hex", - "itertools 0.11.0", + "itertools 0.13.0", "lazy_static", - "mockall", + "mockall 0.11.4", "multisig", "num-bigint", - "num-derive 0.3.3", + "num-derive", "num-traits", "public-ip", "rand 0.8.5", @@ -6949,8 +7169,8 @@ dependencies = [ "secp256k1 0.27.0", "serde", "sha2 0.9.9", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "state-chain-runtime", "strum 0.24.1", "strum_macros 0.24.3", @@ -6965,23 +7185,23 @@ dependencies = [ [[package]] name = "multistream-select" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" dependencies = [ "bytes", "futures", "log", "pin-project", "smallvec", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] name = "nalgebra" -version = "0.32.3" +version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" dependencies = [ "approx", "matrixmultiply", @@ -6995,13 +7215,13 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -7021,11 +7241,10 @@ checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -7092,22 +7311,34 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +dependencies = [ + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "network-interface" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" dependencies = [ - "bytes", - "futures", + "cc", "libc", - "log", - "tokio", + "thiserror", + "winapi", ] [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nibble_vec" @@ -7129,6 +7360,12 @@ dependencies = [ "libc", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "no-std-net" version = "0.6.0" @@ -7157,6 +7394,18 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -7175,20 +7424,19 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -7199,17 +7447,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -7218,7 +7455,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -7227,7 +7464,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "itoa", ] @@ -7242,11 +7479,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -7254,9 +7490,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -7268,37 +7504,31 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.5", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.30.4" @@ -7320,20 +7550,41 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", +] + +[[package]] +name = "oid-registry" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" +dependencies = [ + "asn1-rs 0.6.2", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "opaque-debug" @@ -7343,9 +7594,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open-fastrlp" @@ -7353,7 +7604,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "auto_impl", "bytes", "ethereum-types", @@ -7378,7 +7629,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -7395,7 +7646,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -7404,6 +7655,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.2+3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.103" @@ -7412,6 +7672,7 @@ checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -7432,12 +7693,6 @@ dependencies = [ "hashbrown 0.12.3", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "overload" version = "0.1.1" @@ -7446,8 +7701,8 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallet-aura" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "36.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "frame-system", @@ -7455,24 +7710,22 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto 23.0.0", + "sp-application-crypto 38.0.0", "sp-consensus-aura", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", ] [[package]] @@ -7489,10 +7742,10 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7512,10 +7765,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7537,10 +7790,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7557,7 +7810,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-std 8.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7575,10 +7828,10 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7595,12 +7848,13 @@ dependencies = [ "frame-system", "itertools 0.13.0", "log", + "nanorand", "parity-scale-codec", "rand 0.8.5", "scale-info", "serde", - "sp-core 21.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7621,11 +7875,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7645,10 +7899,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7666,10 +7920,10 @@ dependencies = [ "quickcheck", "quickcheck_macros", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7689,10 +7943,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7708,10 +7962,10 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7734,10 +7988,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "strum 0.24.1", "strum_macros 0.24.3", ] @@ -7758,10 +8012,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7778,16 +8032,16 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "itertools 0.11.0", + "itertools 0.13.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7807,11 +8061,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", "sp-staking", - "sp-std 8.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7828,17 +8082,17 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "itertools 0.11.0", + "itertools 0.13.0", "log", "pallet-cf-account-roles", "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7862,10 +8116,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7884,10 +8138,10 @@ dependencies = [ "pallet-cf-flip", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", ] [[package]] @@ -7911,11 +8165,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto 23.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-application-crypto 38.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7937,10 +8191,10 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] @@ -7959,17 +8213,17 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "utilities", ] [[package]] name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7979,20 +8233,19 @@ dependencies = [ "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto 23.0.0", + "sp-application-crypto 38.0.0", "sp-consensus-grandpa", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", "sp-session", "sp-staking", - "sp-std 8.0.0", ] [[package]] name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "frame-system", @@ -8001,20 +8254,19 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", "sp-session", "sp-staking", - "sp-state-machine 0.28.0", - "sp-std 8.0.0", - "sp-trie 22.0.0", + "sp-state-machine 0.43.0", + "sp-trie 37.0.0", ] [[package]] name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "36.0.1" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "docify", "frame-benchmarking", @@ -8024,55 +8276,66 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-storage 21.0.0", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "40.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", - "sp-weights 20.0.0", + "sp-runtime 39.0.0", + "sp-weights 31.0.0", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", - "sp-runtime 24.0.0", - "sp-weights 20.0.0", + "sp-runtime 39.0.0", + "sp-weights 31.0.0", +] + +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", ] [[package]] @@ -8088,8 +8351,8 @@ dependencies = [ "libc", "log", "lz4", - "memmap2", - "parking_lot 0.12.1", + "memmap2 0.5.10", + "parking_lot 0.12.3", "rand 0.8.5", "siphasher 0.3.11", "snap", @@ -8098,11 +8361,11 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "bytes", @@ -8113,22 +8376,16 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "parity-send-wrapper" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" - [[package]] name = "parity-wasm" version = "0.45.0" @@ -8137,9 +8394,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -8154,12 +8411,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -8178,15 +8435,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.7", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -8203,14 +8460,25 @@ checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle 2.6.1", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-slash" @@ -8241,7 +8509,7 @@ checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", "hmac 0.12.1", - "password-hash", + "password-hash 0.4.2", "sha2 0.10.8", ] @@ -8253,6 +8521,7 @@ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac 0.12.1", + "password-hash 0.5.0", ] [[package]] @@ -8278,9 +8547,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.7" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" dependencies = [ "memchr", "thiserror", @@ -8289,9 +8558,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.7" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" +checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" dependencies = [ "pest", "pest_generator", @@ -8299,22 +8568,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.7" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" +checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "pest_meta" -version = "2.7.7" +version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" +checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" dependencies = [ "once_cell", "pest", @@ -8323,12 +8592,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.2", + "indexmap 2.6.0", ] [[package]] @@ -8371,7 +8640,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -8394,35 +8663,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -8432,12 +8695,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.1.1", "futures-io", ] @@ -8453,53 +8716,93 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] -name = "platforms" -version = "3.3.0" +name = "polkavm" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +dependencies = [ + "log", +] [[package]] name = "polkavm-common" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +dependencies = [ + "log", +] [[package]] name = "polkavm-derive" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ "polkavm-derive-impl-macro", ] [[package]] name = "polkavm-derive-impl" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "polkavm-derive-impl-macro" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.61", + "syn 2.0.79", +] + +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common", + "regalloc2 0.9.3", + "rustc-demangle", ] +[[package]] +name = "polkavm-linux-raw" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" + [[package]] name = "polling" version = "2.8.0" @@ -8512,22 +8815,23 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "windows-sys 0.48.0", ] [[package]] name = "polling" -version = "3.4.0" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", - "pin-project-lite 0.2.13", - "rustix 0.38.31", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.37", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8537,27 +8841,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "universal-hash", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "universal-hash", ] [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "powerfmt" @@ -8567,9 +8871,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -8593,9 +8900,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" dependencies = [ "anstyle", "difflib", @@ -8607,15 +8914,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" dependencies = [ "predicates-core", "termtree", @@ -8633,12 +8940,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -8667,20 +8974,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -8707,6 +9005,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "proc-macro-warning" version = "1.0.2" @@ -8715,41 +9024,41 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "thiserror", ] [[package]] name = "prometheus-client" -version = "0.19.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -8761,22 +9070,22 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "unarray", ] @@ -8787,7 +9096,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive 0.12.6", ] [[package]] @@ -8801,28 +9120,62 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", "prettyplease 0.1.25", - "prost", - "prost-types", + "prost 0.11.9", + "prost-types 0.11.9", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools 0.12.1", + "log", + "multimap 0.10.0", + "once_cell", + "petgraph", + "prettyplease 0.2.22", + "prost 0.12.6", + "prost-types 0.12.6", "regex", + "syn 2.0.79", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", "syn 1.0.109", - "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] @@ -8831,14 +9184,23 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", ] [[package]] name = "psm" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" dependencies = [ "cc", ] @@ -8852,10 +9214,10 @@ dependencies = [ "dns-lookup", "futures-core", "futures-util", - "http 0.2.11", - "hyper", + "http 0.2.12", + "hyper 0.14.30", "hyper-system-resolver", - "pin-project-lite 0.2.13", + "pin-project-lite", "thiserror", "tokio", "tracing", @@ -8864,6 +9226,21 @@ dependencies = [ "trust-dns-proto 0.20.4", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -8881,15 +9258,15 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", "thiserror", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -8915,14 +9292,39 @@ dependencies = [ ] [[package]] -name = "quicksink" -version = "0.1.2" +name = "quinn" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", + "bytes", + "pin-project-lite", + "quinn-proto 0.9.6", + "quinn-udp 0.3.2", + "rustc-hash", + "rustls 0.20.9", + "thiserror", + "tokio", + "tracing", + "webpki", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", + "rustc-hash", + "rustls 0.21.12", + "thiserror", + "tokio", + "tracing", ] [[package]] @@ -8943,11 +9345,54 @@ dependencies = [ "webpki", ] +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.21.12", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +dependencies = [ + "libc", + "quinn-proto 0.9.6", + "socket2 0.4.10", + "tracing", + "windows-sys 0.42.0", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2 0.5.7", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -9027,7 +9472,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -9067,6 +9512,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "11.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -9075,9 +9529,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -9107,20 +9561,22 @@ dependencies = [ [[package]] name = "redis" -version = "0.24.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd" +checksum = "a7e86f5670bd8b028edfb240f0616cad620705b31ec389d55e4f3da2c38dcd48" dependencies = [ + "arc-swap", "async-trait", "bytes", "combine", "futures-util", "itoa", + "num-bigint", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "ryu", "sha1_smol", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tokio-util", "url", @@ -9137,42 +9593,42 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -9187,16 +9643,29 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" -version = "1.10.3" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -9210,13 +9679,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] @@ -9227,32 +9696,26 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http 0.2.11", - "http-body", - "hyper", - "hyper-rustls", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls 0.24.2", "hyper-tls", "ipnet", "js-sys", @@ -9261,9 +9724,9 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -9271,7 +9734,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -9298,23 +9761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.5.0", -] - -[[package]] -name = "ring" -version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#b273d33f9981e2bb3375ab45faeb537f7ee35224" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "blake2 0.10.6", - "common", - "fflonk", - "merlin 3.0.0", + "subtle 2.6.1", ] [[package]] @@ -9334,16 +9781,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.12", + "cfg-if", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -9398,6 +9846,12 @@ dependencies = [ "serde", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.3.1" @@ -9446,9 +9900,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -9464,11 +9918,11 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.21", + "semver 1.0.23", ] [[package]] @@ -9510,14 +9964,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -9527,7 +9981,6 @@ version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "log", "ring 0.16.20", "sct", "webpki", @@ -9540,11 +9993,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.7", - "rustls-webpki", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "log", + "once_cell", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle 2.6.1", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -9552,7 +10020,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", "schannel", "security-framework", ] @@ -9566,21 +10047,74 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" + +[[package]] +name = "rustls-platform-verifier" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.13", + "rustls-native-certs 0.7.3", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.8", + "security-framework", + "security-framework-sys", + "webpki-roots 0.26.6", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ruzstd" @@ -9595,9 +10129,9 @@ dependencies = [ [[package]] name = "rw-stream-sink" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" dependencies = [ "futures", "pin-project", @@ -9606,15 +10140,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" dependencies = [ "bytemuck", ] @@ -9639,19 +10173,19 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "4.1.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "29.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "log", - "sp-core 21.0.0", - "sp-wasm-interface 14.0.0", + "sp-core 34.0.0", + "sp-wasm-interface 21.0.0", "thiserror", ] [[package]] name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "futures", "futures-timer", @@ -9664,36 +10198,36 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.42.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-runtime 24.0.0", - "sp-trie 22.0.0", + "sp-runtime 39.0.0", + "sp-trie 37.0.0", ] [[package]] name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "docify", "log", - "memmap2", + "memmap2 0.9.5", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -9703,39 +10237,41 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing", "sp-genesis-builder", - "sp-io 23.0.0", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-io 38.0.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", + "sp-tracing 17.0.0", ] [[package]] name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "12.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.46.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", "chrono", - "clap 4.4.18", + "clap", "fdlimit", "futures", - "itertools 0.10.5", - "libp2p-identity 0.1.3", + "itertools 0.11.0", + "libp2p-identity", "log", "names", + "parity-bip39", "parity-scale-codec", "rand 0.8.5", "regex", @@ -9752,11 +10288,11 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-keyring", - "sp-keystore 0.27.0", - "sp-panic-handler 8.0.0", - "sp-runtime 24.0.0", + "sp-keystore 0.40.0", + "sp-panic-handler 13.0.0", + "sp-runtime 39.0.0", "sp-version", "thiserror", "tokio", @@ -9764,35 +10300,35 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "fnv", "futures", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-executor", "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-database", - "sp-externalities 0.19.0", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-externalities 0.29.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", "sp-statement-store", - "sp-storage 13.0.0", - "sp-trie 22.0.0", + "sp-storage 21.0.0", + "sp-trie 37.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -9802,48 +10338,47 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic 16.0.0", + "sp-arithmetic 26.0.0", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-database", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", - "sp-trie 22.0.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", + "sp-trie 37.0.0", ] [[package]] name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", - "futures-timer", - "libp2p-identity 0.1.3", "log", - "mockall", - "parking_lot 0.12.1", + "mockall 0.11.4", + "parking_lot 0.12.3", "sc-client-api", + "sc-network-types", "sc-utils", "serde", "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", @@ -9855,27 +10390,27 @@ dependencies = [ "sc-consensus-slots", "sc-telemetry", "sp-api", - "sp-application-crypto 23.0.0", + "sp-application-crypto 38.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.29.1" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "ahash 0.8.7", - "array-bytes 6.2.2", + "ahash 0.8.11", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", @@ -9884,7 +10419,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "sc-block-builder", "sc-chain-spec", @@ -9894,31 +10429,33 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-network-sync", + "sc-network-types", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", "serde_json", "sp-api", - "sp-application-crypto 23.0.0", - "sp-arithmetic 16.0.0", + "sp-application-crypto 38.0.0", + "sp-arithmetic 26.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core 21.0.0", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.29.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "finality-grandpa", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "parity-scale-codec", "sc-client-api", @@ -9926,15 +10463,15 @@ dependencies = [ "sc-rpc", "serde", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "thiserror", ] [[package]] name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", @@ -9944,72 +10481,85 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic 16.0.0", + "sp-arithmetic 26.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", ] [[package]] name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.40.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-executor-common", + "sc-executor-polkavm", "sc-executor-wasmtime", "schnellru", "sp-api", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-io 23.0.0", - "sp-panic-handler 8.0.0", - "sp-runtime-interface 17.0.0", - "sp-trie 22.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-io 38.0.0", + "sp-panic-handler 13.0.0", + "sp-runtime-interface 28.0.0", + "sp-trie 37.0.0", "sp-version", - "sp-wasm-interface 14.0.0", + "sp-wasm-interface 21.0.0", "tracing", ] [[package]] name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.35.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "polkavm", "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface 14.0.0", + "sp-wasm-interface 21.0.0", "thiserror", "wasm-instrument", ] +[[package]] +name = "sc-executor-polkavm" +version = "0.32.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" +dependencies = [ + "log", + "polkavm", + "sc-executor-common", + "sp-wasm-interface 21.0.0", +] + [[package]] name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.35.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 17.0.0", - "sp-wasm-interface 14.0.0", + "sp-runtime-interface 28.0.0", + "sp-wasm-interface 21.0.0", "wasmtime", ] [[package]] name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "ansi_term", "futures", @@ -10020,62 +10570,63 @@ dependencies = [ "sc-network-common", "sc-network-sync", "sp-blockchain", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "33.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", - "parking_lot 0.12.1", + "array-bytes", + "parking_lot 0.12.3", "serde_json", - "sp-application-crypto 23.0.0", - "sp-core 21.0.0", - "sp-keystore 0.27.0", + "sp-application-crypto 38.0.0", + "sp-core 34.0.0", + "sp-keystore 0.40.0", "thiserror", ] [[package]] name = "sc-mixnet" -version = "0.1.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.14.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 4.2.0", - "arrayvec 0.7.4", + "array-bytes", + "arrayvec 0.7.6", "blake2 0.10.6", "bytes", "futures", "futures-timer", - "libp2p-identity 0.1.3", "log", "mixnet", - "multiaddr", + "multiaddr 0.18.2", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-client-api", "sc-network", + "sc-network-types", "sc-transaction-pool-api", "sp-api", "sp-consensus", - "sp-core 21.0.0", - "sp-keystore 0.27.0", + "sp-core 34.0.0", + "sp-keystore 0.40.0", "sp-mixnet", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "thiserror", ] [[package]] name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "asynchronous-codec", "bytes", + "cid 0.9.0", "either", "fnv", "futures", @@ -10083,115 +10634,103 @@ dependencies = [ "ip_network", "libp2p", "linked_hash_set", + "litep2p", "log", - "mockall", + "mockall 0.11.4", + "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "partial_sort", "pin-project", + "prost 0.12.6", + "prost-build 0.12.6", "rand 0.8.5", "sc-client-api", "sc-network-common", + "sc-network-types", "sc-utils", + "schnellru", "serde", "serde_json", "smallvec", - "sp-arithmetic 16.0.0", + "sp-arithmetic 26.0.0", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", "thiserror", "tokio", "tokio-stream", - "unsigned-varint", + "unsigned-varint 0.7.2", + "void", "wasm-timer", "zeroize", ] -[[package]] -name = "sc-network-bitswap" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "async-channel 1.9.0", - "cid", - "futures", - "libp2p-identity 0.1.3", - "log", - "prost", - "prost-build", - "sc-client-api", - "sc-network", - "sp-blockchain", - "sp-runtime 24.0.0", - "thiserror", - "unsigned-varint", -] - [[package]] name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "bitflags 1.3.2", "futures", - "libp2p-identity 0.1.3", + "libp2p-identity", "parity-scale-codec", - "prost-build", + "prost-build 0.12.6", "sc-consensus", + "sc-network-types", "sp-consensus", "sp-consensus-grandpa", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "futures", "futures-timer", - "libp2p", "log", "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "schnellru", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "sc-network-light" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "futures", - "libp2p-identity 0.1.3", "log", "parity-scale-codec", - "prost", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-network", + "sc-network-types", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "thiserror", ] [[package]] name = "sc-network-sync" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "fork-tree", @@ -10199,23 +10738,24 @@ dependencies = [ "futures-timer", "libp2p", "log", - "mockall", + "mockall 0.11.4", "parity-scale-codec", - "prost", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-consensus", "sc-network", "sc-network-common", + "sc-network-types", "sc-utils", "schnellru", "smallvec", - "sp-arithmetic 16.0.0", + "sp-arithmetic 26.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", "thiserror", "tokio", @@ -10224,61 +10764,78 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures", - "libp2p", "log", "parity-scale-codec", "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "sc-utils", "sp-consensus", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "substrate-prometheus-endpoint", ] +[[package]] +name = "sc-network-types" +version = "0.12.1" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" +dependencies = [ + "bs58 0.5.1", + "ed25519-dalek", + "libp2p-identity", + "litep2p", + "log", + "multiaddr 0.18.2", + "multihash 0.19.1", + "rand 0.8.5", + "thiserror", + "zeroize", +] + [[package]] name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "39.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bytes", "fnv", "futures", "futures-timer", - "hyper", - "hyper-rustls", - "libp2p", + "hyper 0.14.30", + "hyper-rustls 0.24.2", "log", "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "sc-client-api", "sc-network", "sc-network-common", + "sc-network-types", "sc-transaction-pool-api", "sc-utils", "sp-api", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-keystore 0.27.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", "sp-offchain", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "threadpool", "tracing", ] [[package]] name = "sc-proposer-metrics" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.18.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10286,14 +10843,14 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "39.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -10305,11 +10862,11 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core 21.0.0", - "sp-keystore 0.27.0", + "sp-core 34.0.0", + "sp-keystore 0.40.0", "sp-offchain", "sp-rpc", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-session", "sp-statement-store", "sp-version", @@ -10318,10 +10875,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -10329,21 +10886,28 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-version", "thiserror", ] [[package]] name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "16.0.2" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "http 0.2.11", - "jsonrpsee 0.16.3", + "forwarded-header-value", + "futures", + "governor", + "http 1.1.0", + "http-body-util", + "hyper 1.4.1", + "ip_network", + "jsonrpsee 0.23.2", "log", + "serde", "serde_json", "substrate-prometheus-endpoint", "tokio", @@ -10353,27 +10917,30 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.44.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures", "futures-util", "hex", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", + "sc-rpc", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "sp-api", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-version", "thiserror", "tokio", @@ -10382,18 +10949,18 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.45.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "directories", "exit-future", "futures", "futures-timer", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "sc-chain-spec", @@ -10404,11 +10971,11 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", - "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", "sc-network-transactions", + "sc-network-types", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", @@ -10418,21 +10985,22 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "serde_json", "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", "sp-session", - "sp-state-machine 0.28.0", - "sp-storage 13.0.0", + "sp-state-machine 0.43.0", + "sp-storage 21.0.0", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie 22.0.0", + "sp-trie 37.0.0", "sp-version", "static_init", "substrate-prometheus-endpoint", @@ -10445,19 +11013,19 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.36.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.1", - "sp-core 21.0.0", + "parking_lot 0.12.3", + "sp-core 34.0.0", ] [[package]] name = "sc-sysinfo" -version = "6.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "derive_more", "futures", @@ -10469,23 +11037,25 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-io 38.0.0", + "sp-std 14.0.0", ] [[package]] name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "24.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "chrono", "futures", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", + "sc-network", "sc-utils", "serde", "serde_json", @@ -10495,8 +11065,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "ansi_term", "chrono", @@ -10505,7 +11075,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "regex", "rustc-hash", "sc-client-api", @@ -10513,31 +11083,31 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", - "sp-runtime 24.0.0", - "sp-tracing 10.0.0", + "sp-runtime 39.0.0", + "sp-tracing 17.0.0", "thiserror", "tracing", - "tracing-log 0.1.4", - "tracing-subscriber 0.2.25", + "tracing-log 0.2.0", + "tracing-subscriber 0.3.18", ] [[package]] name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "11.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", @@ -10545,16 +11115,17 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "sc-client-api", "sc-transaction-pool-api", "sc-utils", "serde", "sp-api", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-tracing 10.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-runtime 39.0.0", + "sp-tracing 17.0.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -10562,8 +11133,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", @@ -10571,24 +11142,24 @@ dependencies = [ "parity-scale-codec", "serde", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", "thiserror", ] [[package]] name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "17.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-channel 1.9.0", "futures", "futures-timer", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "prometheus", - "sp-arithmetic 16.0.0", + "sp-arithmetic 26.0.0", ] [[package]] @@ -10629,15 +11200,15 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12ebca36cec2a3f983c46295b282b35e5f8496346fb859a8776dad5389e5389" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ "derive_more", "parity-scale-codec", "primitive-types", "scale-bits 0.6.0", - "scale-decode-derive 0.13.0", + "scale-decode-derive 0.13.1", "scale-type-resolver", "smallvec", ] @@ -10657,9 +11228,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a387a62a2be6ec532eb4f9e1fc800f26d462c06b335d9c3ee54559a355b9fb" +checksum = "9bb22f574168103cdd3133b19281639ca65ad985e24612728f727339dcaf4021" dependencies = [ "darling 0.14.4", "proc-macro2", @@ -10697,9 +11268,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", @@ -10711,11 +11282,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -10728,7 +11299,7 @@ dependencies = [ "hex", "insta", "parity-scale-codec", - "scale-decode 0.13.0", + "scale-decode 0.13.1", "scale-info", "scale-type-resolver", "serde", @@ -10740,7 +11311,7 @@ name = "scale-json-event-logger" version = "0.1.0" dependencies = [ "anyhow", - "env_logger 0.11.3", + "env_logger 0.11.5", "hex", "hex-literal", "log", @@ -10782,20 +11353,20 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "cfg-if", "hashbrown 0.13.2", ] @@ -10814,7 +11385,7 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -10826,14 +11397,14 @@ checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ "aead", "arrayref", - "arrayvec 0.7.4", - "curve25519-dalek 4.1.1", + "arrayvec 0.7.6", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin 3.0.0", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -10873,10 +11444,25 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] +[[package]] +name = "sctp-proto" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6220f78bb44c15f326b0596113305f6101097a18755d53727a575c97e09fb24" +dependencies = [ + "bytes", + "crc", + "fxhash", + "log", + "rand 0.8.5", + "slab", + "thiserror", +] + [[package]] name = "sec1" version = "0.7.3" @@ -10887,7 +11473,8 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -10959,22 +11546,23 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -10991,9 +11579,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -11018,49 +11606,50 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -11068,9 +11657,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -11093,8 +11682,14 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "indexmap 1.9.3", "serde", + "serde_json", "serde_with_macros", + "time", ] [[package]] @@ -11103,10 +11698,20 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.5", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", ] [[package]] @@ -11119,7 +11724,19 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", + "sha1-asm", ] [[package]] @@ -11133,11 +11750,20 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1-asm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" +dependencies = [ + "cc", +] + [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -11161,7 +11787,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] @@ -11208,9 +11834,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -11240,14 +11866,24 @@ dependencies = [ [[package]] name = "similar" -version = "2.4.0" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" + +[[package]] +name = "simple-dns" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" +checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" +dependencies = [ + "bitflags 2.6.0", +] [[package]] name = "simple-mermaid" -version = "0.1.0" -source = "git+https://github.com/kianenigma/simple-mermaid.git?rev=e48b187bcfd5cc75111acd9d241f1bd36604344b#e48b187bcfd5cc75111acd9d241f1bd36604344b" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" [[package]] name = "simple_asn1" @@ -11290,9 +11926,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smol" @@ -11317,8 +11953,8 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eca99148e026936bbc444c3708748207033968e4ef1c33bfc885660ae4d44d21" dependencies = [ - "arrayvec 0.7.4", - "async-lock 3.3.0", + "arrayvec 0.7.6", + "async-lock 3.4.0", "atomic-take", "base64 0.21.7", "bip39", @@ -11331,9 +11967,9 @@ dependencies = [ "either", "event-listener 3.1.0", "fnv", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -11359,10 +11995,10 @@ dependencies = [ "siphasher 1.0.1", "slab", "smallvec", - "soketto", + "soketto 0.7.1", "twox-hash", "wasmi", - "x25519-dalek 2.0.1", + "x25519-dalek", "zeroize", ] @@ -11372,8 +12008,8 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e6f1898682b618b81570047b9d870b3faaff6ae1891b468eddd94d7f903c2fe" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.3.0", + "async-channel 2.3.1", + "async-lock 3.4.0", "base64 0.21.7", "blake2-rfc", "derive_more", @@ -11381,15 +12017,15 @@ dependencies = [ "event-listener 3.1.0", "fnv", "futures-channel", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", - "lru 0.12.3", + "lru", "no-std-net", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11417,12 +12053,12 @@ dependencies = [ "aes-gcm", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", - "ring 0.17.7", + "ring 0.17.8", "rustc_version", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -11437,12 +12073,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -11453,13 +12089,27 @@ checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", "bytes", - "flate2", "futures", - "http 0.2.11", "httparse", "log", "rand 0.8.5", - "sha-1", + "sha-1 0.9.8", +] + +[[package]] +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", ] [[package]] @@ -11494,50 +12144,38 @@ dependencies = [ [[package]] name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "docify", "hash-db 0.16.0", "log", "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core 21.0.0", - "sp-externalities 0.19.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", "sp-metadata-ir", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", - "sp-std 8.0.0", - "sp-trie 22.0.0", + "sp-runtime 39.0.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.43.0", + "sp-trie 37.0.0", "sp-version", "thiserror", ] [[package]] name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "20.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", -] - -[[package]] -name = "sp-application-crypto" -version = "23.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", + "syn 2.0.79", ] [[package]] @@ -11555,17 +12193,15 @@ dependencies = [ ] [[package]] -name = "sp-arithmetic" -version = "16.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +name = "sp-application-crypto" +version = "38.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "integer-sqrt", - "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 8.0.0", - "static_assertions", + "sp-core 34.0.0", + "sp-io 38.0.0", ] [[package]] @@ -11584,107 +12220,83 @@ dependencies = [ ] [[package]] -name = "sp-ark-bls12-381" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" -dependencies = [ - "ark-bls12-381-ext", - "sp-crypto-ec-utils", -] - -[[package]] -name = "sp-ark-ed-on-bls12-381-bandersnatch" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +name = "sp-arithmetic" +version = "26.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "ark-ed-on-bls12-381-bandersnatch-ext", - "sp-crypto-ec-utils", + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", ] [[package]] name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "sp-api", "sp-inherents", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.1" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "futures", - "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "schnellru", "sp-api", "sp-consensus", + "sp-core 34.0.0", "sp-database", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", "thiserror", + "tracing", ] [[package]] name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.40.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "futures", "log", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", + "sp-runtime 39.0.0", + "sp-state-machine 0.43.0", "thiserror", ] [[package]] name = "sp-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto 23.0.0", - "sp-consensus-slots", - "sp-inherents", - "sp-runtime 24.0.0", - "sp-std 8.0.0", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.40.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "serde", "sp-api", - "sp-application-crypto 23.0.0", + "sp-application-crypto 38.0.0", "sp-consensus-slots", - "sp-core 21.0.0", "sp-inherents", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "21.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "finality-grandpa", "log", @@ -11692,36 +12304,34 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 23.0.0", - "sp-core 21.0.0", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-application-crypto 38.0.0", + "sp-core 34.0.0", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.40.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 8.0.0", "sp-timestamp", ] [[package]] name = "sp-core" -version = "21.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0db34a19be2efa0398a9506a365392d93a85220856d55e0eb78165ad2e1bedc" dependencies = [ - "array-bytes 6.2.2", - "bandersnatch_vrfs", + "array-bytes", "bip39", "bitflags 1.3.2", "blake2 0.10.6", - "bounded-collections", + "bounded-collections 0.1.9", "bs58 0.5.1", "dyn-clonable", "ed25519-zebra 3.1.0", @@ -11730,27 +12340,29 @@ dependencies = [ "hash256-std-hasher", "impl-serde", "itertools 0.10.5", + "lazy_static", "libsecp256k1", "log", - "merlin 3.0.0", + "merlin 2.0.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "paste", "primitive-types", "rand 0.8.5", + "regex", "scale-info", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", + "schnorrkel 0.9.1", + "secp256k1 0.24.3", "secrecy", "serde", - "sp-core-hashing 9.0.0", - "sp-debug-derive 8.0.0", - "sp-externalities 0.19.0", - "sp-runtime-interface 17.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", + "sp-core-hashing", + "sp-debug-derive 12.0.0", + "sp-externalities 0.23.0", + "sp-runtime-interface 22.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.4.6", "thiserror", "tracing", "w3f-bls", @@ -11759,46 +12371,44 @@ dependencies = [ [[package]] name = "sp-core" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0db34a19be2efa0398a9506a365392d93a85220856d55e0eb78165ad2e1bedc" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", - "bounded-collections", + "bounded-collections 0.2.0", "bs58 0.5.1", "dyn-clonable", - "ed25519-zebra 3.1.0", + "ed25519-zebra 4.0.3", "futures", "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", - "itertools 0.10.5", - "lazy_static", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", - "merlin 2.0.1", + "merlin 3.0.0", + "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "paste", "primitive-types", "rand 0.8.5", - "regex", "scale-info", - "schnorrkel 0.9.1", - "secp256k1 0.24.3", + "schnorrkel 0.11.4", + "secp256k1 0.28.2", "secrecy", "serde", - "sp-core-hashing 13.0.0", - "sp-debug-derive 12.0.0", - "sp-externalities 0.23.0", - "sp-runtime-interface 22.0.0", - "sp-std 12.0.0", - "sp-storage 17.0.0", + "sp-crypto-hashing", + "sp-debug-derive 14.0.0", + "sp-externalities 0.29.0", + "sp-runtime-interface 28.0.0", + "sp-std 14.0.0", + "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror", "tracing", "w3f-bls", @@ -11807,8 +12417,9 @@ dependencies = [ [[package]] name = "sp-core-hashing" -version = "9.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" dependencies = [ "blake2b_simd", "byteorder", @@ -11819,10 +12430,9 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" +name = "sp-crypto-hashing" +version = "0.1.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "blake2b_simd", "byteorder", @@ -11833,53 +12443,22 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing-proc-macro" -version = "9.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "quote", - "sp-core-hashing 9.0.0", - "syn 2.0.61", -] - -[[package]] -name = "sp-crypto-ec-utils" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" -dependencies = [ - "ark-bls12-377", - "ark-bls12-377-ext", - "ark-bls12-381", - "ark-bls12-381-ext", - "ark-bw6-761", - "ark-bw6-761-ext", - "ark-ec", - "ark-ed-on-bls12-377", - "ark-ed-on-bls12-377-ext", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ed-on-bls12-381-bandersnatch-ext", - "ark-scale", - "sp-runtime-interface 24.0.0", - "sp-std 14.0.0", + "sp-crypto-hashing", + "syn 2.0.79", ] [[package]] name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "10.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "kvdb", - "parking_lot 0.12.1", -] - -[[package]] -name = "sp-debug-derive" -version = "8.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", + "parking_lot 0.12.3", ] [[package]] @@ -11890,28 +12469,17 @@ checksum = "50535e1a5708d3ba5c1195b59ebefac61cc8679c2c24716b87a86e8b7ed2e4a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", -] - -[[package]] -name = "sp-externalities" -version = "0.19.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 8.0.0", - "sp-storage 13.0.0", + "syn 2.0.79", ] [[package]] @@ -11928,64 +12496,39 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "0.29.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 14.0.0", - "sp-storage 19.0.0", + "sp-storage 21.0.0", ] [[package]] name = "sp-genesis-builder" -version = "0.1.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.15.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", "thiserror", ] -[[package]] -name = "sp-io" -version = "23.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "bytes", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1 0.28.2", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-keystore 0.27.0", - "sp-runtime-interface 17.0.0", - "sp-state-machine 0.28.0", - "sp-std 8.0.0", - "sp-tracing 10.0.0", - "sp-trie 22.0.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "28.0.0" @@ -12011,45 +12554,70 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "sp-io" +version = "38.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive", + "rustversion", + "secp256k1 0.28.2", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.43.0", + "sp-tracing 17.0.0", + "sp-trie 37.0.0", + "tracing", + "tracing-core", +] + [[package]] name = "sp-keyring" -version = "24.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "39.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "strum 0.24.1", + "sp-core 34.0.0", + "sp-runtime 39.0.0", + "strum 0.26.3", ] [[package]] name = "sp-keystore" -version = "0.27.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db18ab01b2684856904c973d2be7dbf9ab3607cf706a7bd6648812662e5e7c5" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", - "sp-core 21.0.0", - "sp-externalities 0.19.0", + "parking_lot 0.12.3", + "sp-core 26.0.0", + "sp-externalities 0.23.0", "thiserror", ] [[package]] name = "sp-keystore" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db18ab01b2684856904c973d2be7dbf9ab3607cf706a7bd6648812662e5e7c5" +version = "0.40.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", - "sp-core 26.0.0", - "sp-externalities 0.23.0", - "thiserror", + "parking_lot 0.12.3", + "sp-core 34.0.0", + "sp-externalities 0.29.0", ] [[package]] name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "11.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "thiserror", "zstd 0.12.4", @@ -12057,41 +12625,40 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.1.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.7.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-std 8.0.0", ] [[package]] name = "sp-mixnet" -version = "0.1.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.12.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-application-crypto 23.0.0", - "sp-std 8.0.0", + "sp-application-crypto 38.0.0", ] [[package]] name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "sp-api", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-panic-handler" -version = "8.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" dependencies = [ "backtrace", "lazy_static", @@ -12100,9 +12667,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" +version = "13.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "backtrace", "lazy_static", @@ -12111,36 +12677,12 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "32.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "rustc-hash", "serde", - "sp-core 21.0.0", -] - -[[package]] -name = "sp-runtime" -version = "24.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto 23.0.0", - "sp-arithmetic 16.0.0", - "sp-core 21.0.0", - "sp-io 23.0.0", - "sp-std 8.0.0", - "sp-weights 20.0.0", + "sp-core 34.0.0", ] [[package]] @@ -12167,21 +12709,29 @@ dependencies = [ ] [[package]] -name = "sp-runtime-interface" -version = "17.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +name = "sp-runtime" +version = "39.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "bytes", + "docify", + "either", + "hash256-std-hasher", "impl-trait-for-tuples", + "log", + "num-traits", "parity-scale-codec", - "primitive-types", - "sp-externalities 0.19.0", - "sp-runtime-interface-proc-macro 11.0.0", - "sp-std 8.0.0", - "sp-storage 13.0.0", - "sp-tracing 10.0.0", - "sp-wasm-interface 14.0.0", - "static_assertions", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 38.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 38.0.0", + "sp-std 14.0.0", + "sp-weights 31.0.0", + "tracing", ] [[package]] @@ -12205,36 +12755,23 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "28.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", "primitive-types", - "sp-externalities 0.25.0", - "sp-runtime-interface-proc-macro 17.0.0", + "sp-externalities 0.29.0", + "sp-runtime-interface-proc-macro 18.0.0", "sp-std 14.0.0", - "sp-storage 19.0.0", - "sp-tracing 16.0.0", - "sp-wasm-interface 20.0.0", + "sp-storage 21.0.0", + "sp-tracing 17.0.0", + "sp-wasm-interface 21.0.0", "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "11.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.61", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "15.0.0" @@ -12245,101 +12782,98 @@ dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "18.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "35.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core 21.0.0", - "sp-keystore 0.27.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-keystore 0.40.0", + "sp-runtime 39.0.0", "sp-staking", - "sp-std 8.0.0", ] [[package]] name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core 21.0.0", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-state-machine" -version = "0.28.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df7c6680d9342c22c10d8272ebf9f0339b0e439b3e67b68f5627f9dfc6926a07" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-panic-handler 8.0.0", - "sp-std 8.0.0", - "sp-trie 22.0.0", + "sp-core 26.0.0", + "sp-externalities 0.23.0", + "sp-panic-handler 12.0.0", + "sp-std 12.0.0", + "sp-trie 27.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", ] [[package]] name = "sp-state-machine" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7c6680d9342c22c10d8272ebf9f0339b0e439b3e67b68f5627f9dfc6926a07" +version = "0.43.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 26.0.0", - "sp-externalities 0.23.0", - "sp-panic-handler 12.0.0", - "sp-std 12.0.0", - "sp-trie 27.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-panic-handler 13.0.0", + "sp-trie 37.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.29.1", ] [[package]] name = "sp-statement-store" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "18.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "aes-gcm", - "curve25519-dalek 4.1.1", + "curve25519-dalek 4.1.3", "ed25519-dalek", "hkdf", "parity-scale-codec", @@ -12347,21 +12881,16 @@ dependencies = [ "scale-info", "sha2 0.10.8", "sp-api", - "sp-application-crypto 23.0.0", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-runtime 24.0.0", - "sp-runtime-interface 17.0.0", - "sp-std 8.0.0", + "sp-application-crypto 38.0.0", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-externalities 0.29.0", + "sp-runtime 39.0.0", + "sp-runtime-interface 28.0.0", "thiserror", - "x25519-dalek 2.0.1", + "x25519-dalek", ] -[[package]] -name = "sp-std" -version = "8.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" - [[package]] name = "sp-std" version = "12.0.0" @@ -12371,20 +12900,7 @@ checksum = "54c78c5a66682568cc7b153603c5d01a2cc8f5c221c7b1e921517a0eef18ae05" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" - -[[package]] -name = "sp-storage" -version = "13.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 8.0.0", - "sp-std 8.0.0", -] +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" [[package]] name = "sp-storage" @@ -12402,42 +12918,28 @@ dependencies = [ [[package]] name = "sp-storage" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "21.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive 14.0.0", - "sp-std 14.0.0", ] [[package]] name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-runtime 39.0.0", "thiserror", ] -[[package]] -name = "sp-tracing" -version = "10.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "parity-scale-codec", - "sp-std 8.0.0", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", -] - [[package]] name = "sp-tracing" version = "14.0.0" @@ -12453,128 +12955,112 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "17.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", - "sp-std 14.0.0", "tracing", "tracing-core", - "tracing-subscriber 0.2.25", + "tracing-subscriber 0.3.18", ] [[package]] name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "sp-api", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "34.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-inherents", - "sp-runtime 24.0.0", - "sp-std 8.0.0", - "sp-trie 22.0.0", + "sp-runtime 39.0.0", + "sp-trie 37.0.0", ] [[package]] name = "sp-trie" -version = "22.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c4bf89a5bd74f696cd1f23d83bb6abe6bd0abad1f3c70d4b0d7ebec4098cfe" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "hash-db 0.16.0", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 21.0.0", - "sp-externalities 0.19.0", - "sp-std 8.0.0", + "sp-core 26.0.0", + "sp-std 12.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", "trie-root", ] [[package]] name = "sp-trie" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c4bf89a5bd74f696cd1f23d83bb6abe6bd0abad1f3c70d4b0d7ebec4098cfe" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.11", "hash-db 0.16.0", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 26.0.0", - "sp-std 12.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.29.1", "trie-root", ] [[package]] name = "sp-version" -version = "22.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "37.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-core-hashing-proc-macro", - "sp-runtime 24.0.0", - "sp-std 8.0.0", + "sp-crypto-hashing-proc-macro", + "sp-runtime 39.0.0", + "sp-std 14.0.0", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "8.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "14.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.61", -] - -[[package]] -name = "sp-wasm-interface" -version = "14.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 8.0.0", - "wasmtime", + "syn 2.0.79", ] [[package]] @@ -12593,46 +13079,44 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#2556e33fb4c52ea8192de68df33c151768edc2a9" +version = "21.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 14.0.0", "wasmtime", ] [[package]] name = "sp-weights" -version = "20.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1689f9594c2c4d09ede3d8a991a9eb900654e424fb00b62f2b370170af347acd" dependencies = [ - "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 16.0.0", - "sp-debug-derive 8.0.0", - "sp-std 8.0.0", + "sp-arithmetic 21.0.0", + "sp-core 26.0.0", + "sp-debug-derive 12.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-weights" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1689f9594c2c4d09ede3d8a991a9eb900654e424fb00b62f2b370170af347acd" +version = "31.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "bounded-collections 0.2.0", "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic 21.0.0", - "sp-core 26.0.0", - "sp-debug-derive 12.0.0", - "sp-std 12.0.0", + "sp-arithmetic 26.0.0", + "sp-debug-derive 14.0.0", ] [[package]] @@ -12648,14 +13132,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spinners" -version = "4.1.1" +name = "spinning_top" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" dependencies = [ - "lazy_static", - "maplit", - "strum 0.24.1", + "lock_api", ] [[package]] @@ -12670,9 +13152,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.46.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1114ee5900b8569bbc8b1a014a942f937b752af4b44f4607430b5f86cedaac0" +checksum = "43fce22ed1df64d04b262351c8f9d5c6da4f76f79f25ad15529792f893fad25d" dependencies = [ "Inflector", "num-format", @@ -12749,14 +13231,14 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-genesis-builder", "sp-inherents", - "sp-io 23.0.0", + "sp-io 38.0.0", "sp-offchain", - "sp-runtime 24.0.0", + "sp-runtime 39.0.0", "sp-session", - "sp-std 8.0.0", + "sp-std 14.0.0", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -12776,7 +13258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ "bitflags 1.3.2", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", "parking_lot 0.11.2", "parking_lot_core 0.8.6", @@ -12790,13 +13272,33 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.1.1", "memchr", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "str0m" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6706347e49b13373f7ddfafad47df7583ed52083d6fc8a594eb2c80497ef959d" +dependencies = [ + "combine", + "crc", + "fastrand 2.1.1", + "hmac 0.12.1", + "once_cell", + "openssl", + "openssl-sys", + "sctp-proto", + "serde", + "sha-1 0.10.1", + "thiserror", + "tracing", +] + [[package]] name = "string_cache" version = "0.8.7" @@ -12805,7 +13307,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "phf_shared 0.10.0", "precomputed-hash", ] @@ -12822,22 +13324,25 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] [[package]] name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros 0.26.4", ] [[package]] @@ -12855,43 +13360,56 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "substrate-bip39" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", - "schnorrkel 0.9.1", + "schnorrkel 0.11.4", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel 0.11.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "substrate-build-script-utils" -version = "3.0.0" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "11.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" [[package]] name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "38.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ + "docify", "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "parity-scale-codec", "sc-rpc-api", @@ -12899,49 +13417,39 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 21.0.0", - "sp-runtime 24.0.0", + "sp-core 34.0.0", + "sp-runtime 39.0.0", ] [[package]] name = "substrate-prometheus-endpoint" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "0.17.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "hyper", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "log", "prometheus", "thiserror", "tokio", ] -[[package]] -name = "substrate-rpc-client" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "async-trait", - "jsonrpsee 0.16.3", - "log", - "sc-rpc-api", - "serde", - "sp-runtime 24.0.0", -] - [[package]] name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" +version = "24.0.0" +source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.15.2+2#d4792faaa7ab3fbb9798dcc629564d182853690e" dependencies = [ - "ansi_term", "build-helper", "cargo_metadata 0.15.4", + "console", "filetime", "parity-wasm", + "polkavm-linker", "sp-maybe-compressed-blob", - "strum 0.24.1", + "strum 0.26.3", "tempfile", - "toml 0.8.10", + "toml 0.8.19", "walkdir", "wasm-opt", ] @@ -12954,9 +13462,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" @@ -12973,7 +13481,7 @@ dependencies = [ "futures", "hex", "impl-serde", - "jsonrpsee 0.20.3", + "jsonrpsee 0.20.4", "parity-scale-codec", "primitive-types", "scale-bits 0.4.0", @@ -12984,7 +13492,7 @@ dependencies = [ "serde", "serde_json", "sp-core 26.0.0", - "sp-core-hashing 13.0.0", + "sp-core-hashing", "sp-runtime 29.0.0", "subxt-lightclient", "subxt-macro", @@ -13002,13 +13510,13 @@ dependencies = [ "frame-metadata 16.0.0", "heck 0.4.1", "hex", - "jsonrpsee 0.20.3", + "jsonrpsee 0.20.4", "parity-scale-codec", "proc-macro2", "quote", "scale-info", "subxt-metadata", - "syn 2.0.61", + "syn 2.0.79", "thiserror", "tokio", ] @@ -13036,11 +13544,11 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5086ce2a90e723083ff19b77f06805d00e732eac3e19c86f6cd643d4255d334" dependencies = [ - "darling 0.20.5", + "darling 0.20.10", "parity-scale-codec", "proc-macro-error", "subxt-codegen", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -13052,7 +13560,7 @@ dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-core-hashing 13.0.0", + "sp-core-hashing", "thiserror", ] @@ -13067,7 +13575,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.21", + "semver 1.0.23", "serde", "serde_json", "sha2 0.10.8", @@ -13089,9 +13597,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.61" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -13107,7 +13615,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -13128,6 +13636,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -13157,20 +13676,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "rustix 0.38.31", - "windows-sys 0.52.0", + "fastrand 2.1.1", + "once_cell", + "rustix 0.38.37", + "windows-sys 0.59.0", ] [[package]] @@ -13195,12 +13715,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" dependencies = [ - "rustix 0.38.31", - "windows-sys 0.48.0", + "rustix 0.38.37", + "windows-sys 0.59.0", ] [[package]] @@ -13209,30 +13729,24 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -13243,9 +13757,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -13272,9 +13786,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -13293,9 +13807,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -13303,14 +13817,13 @@ dependencies = [ [[package]] name = "tiny-bip39" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +checksum = "4a6e875ccbd782b2d91350816d4ab27da3c9424c381f9ba07ed3e2e1ae680d90" dependencies = [ "anyhow", - "hmac 0.12.1", "once_cell", - "pbkdf2 0.11.0", + "pbkdf2 0.12.2", "rand 0.8.5", "rustc-hash", "sha2 0.10.8", @@ -13331,9 +13844,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -13346,32 +13859,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", - "parking_lot 0.12.1", - "pin-project-lite 0.2.13", + "parking_lot 0.12.3", + "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.7", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -13385,34 +13897,34 @@ dependencies = [ ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "pin-project", - "rand 0.8.5", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.21.12", + "rustls 0.23.13", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tokio-util", ] @@ -13426,25 +13938,37 @@ dependencies = [ "futures-util", "log", "rustls 0.21.12", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", - "tungstenite", + "tokio-rustls 0.24.1", + "tungstenite 0.20.1", "webpki-roots 0.25.4", ] +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.21.0", +] + [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -13464,54 +13988,32 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.2", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.2", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.22.4" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -13527,7 +14029,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.13", + "pin-project-lite", "tower-layer", "tower-service", "tracing", @@ -13535,33 +14037,31 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "bytes", - "futures-core", - "futures-util", - "http 0.2.11", - "http-body", - "http-range-header", - "pin-project-lite 0.2.13", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "pin-project-lite", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -13570,7 +14070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -13583,7 +14083,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -13650,7 +14150,6 @@ dependencies = [ "chrono", "lazy_static", "matchers 0.0.1", - "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -13672,6 +14171,7 @@ dependencies = [ "matchers 0.1.0", "nu-ansi-term", "once_cell", + "parking_lot 0.12.3", "regex", "serde", "serde_json", @@ -13697,6 +14197,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-db" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +dependencies = [ + "hash-db 0.16.0", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-root" version = "0.18.0" @@ -13787,24 +14299,50 @@ dependencies = [ "url", ] +[[package]] +name = "trust-dns-proto" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand 0.8.5", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "trust-dns-resolver" -version = "0.22.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" dependencies = [ "cfg-if", "futures-util", "ipconfig", - "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", "resolv-conf", "smallvec", "thiserror", "tokio", "tracing", - "trust-dns-proto 0.22.0", + "trust-dns-proto 0.23.2", ] [[package]] @@ -13813,42 +14351,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "try-runtime-cli" -version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/polkadot-sdk.git?tag=chainflip-substrate-1.6+1#ffae0468e92414b4f7a8af2db53c87e9916f1d80" -dependencies = [ - "async-trait", - "clap 4.4.18", - "frame-remote-externalities", - "frame-try-runtime", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core 21.0.0", - "sp-debug-derive 8.0.0", - "sp-externalities 0.19.0", - "sp-inherents", - "sp-io 23.0.0", - "sp-keystore 0.27.0", - "sp-rpc", - "sp-runtime 24.0.0", - "sp-state-machine 0.28.0", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights 20.0.0", - "substrate-rpc-client", - "zstd 0.12.4", -] - [[package]] name = "tt-call" version = "1.0.9" @@ -13864,7 +14366,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.11", + "http 0.2.12", "httparse", "log", "rand 0.8.5", @@ -13875,6 +14377,25 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -13895,9 +14416,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -13928,15 +14449,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -13949,15 +14470,15 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "universal-hash" @@ -13966,7 +14487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -13981,6 +14502,16 @@ dependencies = [ "futures-util", ] +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +dependencies = [ + "bytes", + "tokio-util", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -13995,9 +14526,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -14012,9 +14543,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utilities" @@ -14024,19 +14555,19 @@ dependencies = [ "async-broadcast 0.5.1", "async-channel 1.9.0", "bs58 0.5.1", - "clap 3.2.25", + "clap", "futures", "futures-util", "hex", - "itertools 0.11.0", - "jsonrpsee 0.16.3", + "itertools 0.13.0", + "jsonrpsee 0.23.2", "lazy_format", "lazy_static", "log", - "mockall", + "mockall 0.11.4", "num-traits", "pin-project", - "predicates 3.1.0", + "predicates 3.1.2", "prometheus", "regex", "reqwest", @@ -14045,7 +14576,7 @@ dependencies = [ "scopeguard", "serde", "serde_json", - "sp-core 21.0.0", + "sp-core 34.0.0", "sp-rpc", "tempfile", "thiserror", @@ -14062,7 +14593,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "serde", ] @@ -14080,9 +14611,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -14092,9 +14623,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -14125,15 +14656,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -14150,30 +14681,28 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" dependencies = [ "bytes", "futures-channel", "futures-util", "headers", - "http 0.2.11", - "hyper", + "http 0.2.12", + "hyper 0.14.30", "log", "mime", "mime_guess", "multer", "percent-encoding", "pin-project", - "rustls-pemfile", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-stream", - "tokio-tungstenite", + "tokio-tungstenite 0.21.0", "tokio-util", "tower-service", "tracing", @@ -14193,34 +14722,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -14230,9 +14760,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -14240,37 +14770,37 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-instrument" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" dependencies = [ "parity-wasm", ] [[package]] name = "wasm-opt" -version = "0.116.0" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" dependencies = [ "anyhow", "libc", @@ -14364,9 +14894,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -14568,9 +15098,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -14582,7 +15112,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "derive_more", "ethabi", "ethereum-types", @@ -14593,12 +15123,12 @@ dependencies = [ "idna 0.4.0", "jsonrpc-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project", "rlp", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "tiny-keccak", "tokio", "tokio-util", @@ -14624,24 +15154,24 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "which" @@ -14652,14 +15182,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.31", + "rustix 0.38.37", ] [[package]] name = "wide" -version = "0.7.15" +version = "0.7.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" +checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" dependencies = [ "bytemuck", "safe_arch", @@ -14667,9 +15197,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -14689,11 +15219,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -14727,7 +15257,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -14754,7 +15299,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -14789,17 +15343,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -14816,9 +15371,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -14834,9 +15389,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -14852,9 +15407,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -14870,9 +15431,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -14888,9 +15449,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -14906,9 +15467,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -14924,15 +15485,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -14977,45 +15538,65 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "1.1.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 3.2.0", - "rand_core 0.5.1", + "curve25519-dalek 4.1.3", + "rand_core 0.6.4", + "serde", "zeroize", ] [[package]] -name = "x25519-dalek" -version = "2.0.1" +name = "x509-parser" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" dependencies = [ - "curve25519-dalek 4.1.1", - "rand_core 0.6.4", - "serde", - "zeroize", + "asn1-rs 0.5.2", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time", ] [[package]] name = "x509-parser" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs", - "base64 0.13.1", + "asn1-rs 0.6.2", "data-encoding", - "der-parser", + "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry", + "oid-registry 0.7.1", "rusticata-macros", "thiserror", "time", ] +[[package]] +name = "xml-rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + [[package]] name = "yaml-rust" version = "0.4.5" @@ -15027,14 +15608,15 @@ dependencies = [ [[package]] name = "yamux" -version = "0.10.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.3", + "pin-project", "rand 0.8.5", "static_assertions", ] @@ -15062,29 +15644,30 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -15097,7 +15680,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.79", ] [[package]] @@ -15190,9 +15773,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 5fb450e001..d9a5a4234f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ members = [ [workspace.lints.clippy] blocks_in_conditions = "allow" -thread-local-initializer-can-be-made-const = "allow" +missing_const_for_thread_local = "allow" # The list of dependencies below (which can be both direct and indirect dependencies) are crates # that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of diff --git a/README.md b/README.md index 2601ebc724..945088eeac 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,9 @@ cargo cf-test-ci > **_NOTE:_** cf-test-ci is an alias for cargo test with additional flags. These aliases are defined in [.cargo/config.toml](.cargo/config.toml). ## Contributing + ### Setup + Make sure you have the following packages and tools installed. The following is for debian-like systems (e.g. Ubuntu). You may need to adjust for your system. ```bash @@ -114,9 +116,11 @@ commit. ### Prerequisites #### Hardware + We recommend at least 16GB of RAM and 4 CPU cores to handle all the containers and binaries running locally. #### Software and Tools + You will need to download [Docker](https://docs.docker.com/get-docker/). Make sure you use a recent version that has `docker-compose` plugin included. Otherwise, you might need to modify the `./localnet/manage.sh` script to use `docker-compose` instead of `docker compose`. ### Creating a Localnet @@ -129,6 +133,7 @@ From the repo root, run the following: cargo build ./localnet/manage.sh ``` + You'll be prompted with the following: ```shell @@ -155,7 +160,7 @@ You'll be prompted with the following: These commands can be used to control which logs the engine outputs at runtime. - `curl -X GET 127.0.0.1:36079/tracing` (Returns the current filtering directives) -- `curl --json '"debug,warp=off,hyper=off,jsonrpc=off,web3=off,reqwest=off"` (Sets the filter directives so the default is DEBUG, and the logging in modules warp, hyper, jsonrpc, web3, and reqwest is turned off) +- `curl --json '"debug,warp=off,hyper=off,jsonrpc=off,web3=off,reqwest=off"' 127.0.0.1:36079/tracing` (Sets the filter directives so the default is DEBUG, and the logging in modules warp, hyper, jsonrpc, web3, and reqwest is turned off) - `curl -X POST -H 'Content-Type: application/json' -d '"debug,warp=off,hyper=off,jsonrpc=off,web3=off,reqwest=off"' 127.0.0.1:36079/tracing` (Equivalent to the above, but without using the --json short-hand) The `RUST_LOG` environment variable controls the initial filtering directives if specified at engine startup. diff --git a/api/bin/chainflip-broker-api/Cargo.toml b/api/bin/chainflip-broker-api/Cargo.toml index 9c5bf21dee..153d1ec7ac 100644 --- a/api/bin/chainflip-broker-api/Cargo.toml +++ b/api/bin/chainflip-broker-api/Cargo.toml @@ -26,17 +26,17 @@ chainflip-api = { path = "../../lib" } cf-utilities = { package = "utilities", path = "../../../utilities" } custom-rpc = { path = "../../../state-chain/custom-rpc" } -anyhow = "1.0.66" -clap = { version = "3.2.23", features = ["derive"] } -futures = "0.3" +anyhow = "1.0" +clap = { version = "4.5.3", features = ["derive"] } +futures = "0.3.30" hex = "0.4.3" -jsonrpsee = { version = "0.16.2", features = ["full"] } -serde = { version = '1.0', features = ['derive'] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +jsonrpsee = { version = "0.23.2", features = ["full"] } +serde = { version = '1.0.197', features = ['derive'] } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } tokio = "1.20.1" tracing = "0.1.34" tracing-subscriber = { version = "0.3.3", features = ["env-filter"] } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } diff --git a/api/bin/chainflip-broker-api/README.md b/api/bin/chainflip-broker-api/README.md index 2e9542567c..7443f93980 100644 --- a/api/bin/chainflip-broker-api/README.md +++ b/api/bin/chainflip-broker-api/README.md @@ -17,26 +17,17 @@ Exposes Broker functionality via a json api interface. ```sh chainflip-broker-api -USAGE: - chainflip-broker-api [OPTIONS] - -OPTIONS: - -h, --help - Print help information - - --port - The port number on which the broker will listen for connections. Use 0 to assign a - random port. [default: 80] - - --state_chain.signing_key_file - A path to a file that contains the broker's secret key for signing extrinsics. - [default: /etc/chainflip/keys/signing_key_file] - - --state_chain.ws_endpoint - The state chain node's rpc endpoint. [default: ws://localhost:9944] - - -v, --version - Print the version of the API +Usage: chainflip-broker-api [OPTIONS] + +Options: + --port The port number on which the broker will listen for connections. Use 0 to assign a random port. [default: 80] + --max_connections The maximum number of concurrent websocket connections to accept. [default: 100] + --state_chain.ws_endpoint The state chain node's RPC endpoint. [default: ws://localhost:9944] + --state_chain.signing_key_file A path to a file that contains the broker's secret key for signing extrinsics. [default: /etc/chainflip/keys/signing_key_file] + --health_check.hostname Hostname for this server's healthcheck. Requires the parameter to be given as well. + --health_check.port Port for this server's healthcheck. Requires the parameter to be given as well. + -h, --help Print help + -V, --version Print version ``` ## Example @@ -51,6 +42,7 @@ OPTIONS: --state_chain.signing_key_file /path/to/my/signing_key \ --port 62378 # or whatever port you want to use ``` + It will print `🎙 Server is listening on 0.0.0.0:62378.` and continue to run. 2. Then in another terminal: diff --git a/api/bin/chainflip-broker-api/src/main.rs b/api/bin/chainflip-broker-api/src/main.rs index d3be85b815..f39bb9f91d 100644 --- a/api/bin/chainflip-broker-api/src/main.rs +++ b/api/bin/chainflip-broker-api/src/main.rs @@ -10,6 +10,7 @@ use chainflip_api::{ SwapDepositAddress, WithdrawFeesDetail, }; use clap::Parser; +use custom_rpc::to_rpc_error; use futures::FutureExt; use jsonrpsee::{ core::{async_trait, RpcResult}, @@ -73,7 +74,8 @@ impl RpcServer for RpcServerImpl { .operator_api() .register_account_role(AccountRole::Broker) .await - .map(|tx_hash| format!("{tx_hash:#x}"))?) + .map(|tx_hash| format!("{tx_hash:#x}")) + .map_err(to_rpc_error)?) } async fn request_swap_deposit_address( @@ -102,7 +104,8 @@ impl RpcServer for RpcServerImpl { refund_parameters, dca_parameters, ) - .await?) + .await + .map_err(to_rpc_error)?) } async fn withdraw_fees( @@ -110,12 +113,17 @@ impl RpcServer for RpcServerImpl { asset: Asset, destination_address: AddressString, ) -> RpcResult { - Ok(self.api.broker_api().withdraw_fees(asset, destination_address).await?) + Ok(self + .api + .broker_api() + .withdraw_fees(asset, destination_address) + .await + .map_err(to_rpc_error)?) } } #[derive(Parser, Debug, Clone, Default)] -#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), version_short = 'v')] +#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"))] pub struct BrokerOptions { #[clap( long = "port", @@ -168,9 +176,11 @@ async fn main() -> anyhow::Result<()> { let server = ServerBuilder::default() .max_connections(opts.max_connections) .build(format!("0.0.0.0:{}", opts.port)) - .await?; + .await + .map_err(to_rpc_error)?; let server_addr = server.local_addr()?; - let server = server.start(RpcServerImpl::new(scope, opts).await?.into_rpc())?; + let server = server + .start(RpcServerImpl::new(scope, opts).await.map_err(to_rpc_error)?.into_rpc()); log::info!("🎙 Server is listening on {server_addr}."); diff --git a/api/bin/chainflip-cli/Cargo.toml b/api/bin/chainflip-cli/Cargo.toml index 2feddbcb1f..bb93b70b21 100644 --- a/api/bin/chainflip-cli/Cargo.toml +++ b/api/bin/chainflip-cli/Cargo.toml @@ -11,11 +11,11 @@ workspace = true [dependencies] anyhow = "1.0" bigdecimal = "0.4.5" -clap = { version = "3.2.16", features = ["derive", "env"] } +clap = { version = "4.5.3", features = ["derive", "env"] } config = "0.13.1" -futures = "0.3.14" +futures = "0.3.30" hex = { version = "0.4.3", features = ["serde"] } -serde = { version = "1.0", features = ["derive", "rc"] } +serde = { version = "1.0.197", features = ["derive", "rc"] } tokio = { version = "1.13.1", features = ["full"] } serde_json = "1.0" @@ -27,4 +27,4 @@ utilities = { path = "../../../utilities" } custom-rpc = { path = "../../../state-chain/custom-rpc" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } diff --git a/api/bin/chainflip-cli/src/main.rs b/api/bin/chainflip-cli/src/main.rs index e143be6451..d7293453f2 100644 --- a/api/bin/chainflip-cli/src/main.rs +++ b/api/bin/chainflip-cli/src/main.rs @@ -1,4 +1,3 @@ -#![feature(absolute_path)] use crate::settings::{ BrokerSubcommands, CLICommandLineOptions, CLISettings, CliCommand::*, LiquidityProviderSubcommands, ValidatorSubcommands, diff --git a/api/bin/chainflip-ingress-egress-tracker/Cargo.toml b/api/bin/chainflip-ingress-egress-tracker/Cargo.toml index 736a01750c..dda5a69f2f 100644 --- a/api/bin/chainflip-ingress-egress-tracker/Cargo.toml +++ b/api/bin/chainflip-ingress-egress-tracker/Cargo.toml @@ -9,23 +9,23 @@ edition = "2021" workspace = true [dependencies] -anyhow = "1.0.72" +anyhow = "1.0" async-trait = "0.1.73" bitcoin = { version = "0.30.0", features = ["serde"] } -futures = "0.3.28" +futures = "0.3.30" hex = "0.4.3" -serde = "1.0.195" +serde = "1.0.197" serde_json = "1.0" tokio = "1.29.1" tracing = "0.1.34" tracing-subscriber = { version = "0.3.3", features = ["env-filter"] } tempfile = "3.8" -clap = { version = "3.2.23", features = ["derive", "env"] } +clap = { version = "4.5.3", features = ["derive", "env"] } config = "0.13.1" -redis = { version = "0.24.0", features = ["tokio-comp"] } +redis = { version = "0.27.2", features = ["tokio-comp"] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -codec = { package = "parity-scale-codec", version = "3.6.1", features = [ +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +codec = { package = "parity-scale-codec", version = "3.6.12", features = [ "derive", "full", ] } @@ -41,10 +41,10 @@ state-chain-runtime = { path = "../../../state-chain/runtime" } cf-chains = { path = "../../../state-chain/chains" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } [dev-dependencies] -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } insta = { version = "1.36.1", features = ["json"] } -jsonrpsee = { version = "0.16.2", features = ["full"] } +jsonrpsee = { version = "0.23.2", features = ["full"] } mockall = "0.11.0" diff --git a/api/bin/chainflip-ingress-egress-tracker/src/settings.rs b/api/bin/chainflip-ingress-egress-tracker/src/settings.rs index 55381e6281..a420446c70 100644 --- a/api/bin/chainflip-ingress-egress-tracker/src/settings.rs +++ b/api/bin/chainflip-ingress-egress-tracker/src/settings.rs @@ -7,7 +7,7 @@ use serde::Deserialize; use std::{collections::HashMap, env}; #[derive(Parser, Debug, Clone, Default)] -#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), version_short = 'v')] +#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"))] pub struct TrackerOptions { #[clap(long = "eth.rpc.ws_endpoint")] eth_ws_endpoint: Option, diff --git a/api/bin/chainflip-ingress-egress-tracker/src/store.rs b/api/bin/chainflip-ingress-egress-tracker/src/store.rs index 9cd0a95bd2..594984e35a 100644 --- a/api/bin/chainflip-ingress-egress-tracker/src/store.rs +++ b/api/bin/chainflip-ingress-egress-tracker/src/store.rs @@ -28,15 +28,19 @@ impl Store for RedisStore { async fn save_to_array(&mut self, storable: &S) -> anyhow::Result<()> { let key = storable.get_key(); - self.con.rpush(&key, serde_json::to_string(storable)?).await?; - self.con.expire(key, storable.get_expiry_duration().as_secs() as i64).await?; + self.con + .rpush::(key.clone(), serde_json::to_string(storable)?) + .await?; + self.con + .expire::(key, storable.get_expiry_duration().as_secs() as i64) + .await?; Ok(()) } async fn save_singleton(&mut self, storable: &S) -> anyhow::Result<()> { self.con - .set_ex( + .set_ex::( storable.get_key(), serde_json::to_string(storable)?, storable.get_expiry_duration().as_secs(), diff --git a/api/bin/chainflip-lp-api/Cargo.toml b/api/bin/chainflip-lp-api/Cargo.toml index a12f322a71..0a70e54895 100644 --- a/api/bin/chainflip-lp-api/Cargo.toml +++ b/api/bin/chainflip-lp-api/Cargo.toml @@ -23,25 +23,26 @@ workspace = true [dependencies] anyhow = "1.0" -clap = { version = "3.2.23", features = ["derive", "env"] } -futures = "0.3" +clap = { version = "4.5.3", features = ["derive", "env"] } +futures = "0.3.30" hex = "0.4.3" -jsonrpsee = { version = "0.16.2", features = ["full"] } -serde = { version = '1.0', features = ['derive'] } +jsonrpsee = { version = "0.23.2", features = ["full"] } +serde = { version = "1.0.197", features = ['derive'] } serde_json = "1.0" -sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } tokio = "1.20.1" tracing = "0.1" tracing-subscriber = { version = "0.3.3", features = ["env-filter"] } pallet-cf-pools = { path = '../../../state-chain/pallets/cf-pools' } cf-primitives = { path = "../../../state-chain/primitives" } custom-rpc = { path = "../../../state-chain/custom-rpc" } -frame-system = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1' } +frame-system = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } +sc-rpc = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } # Local chainflip-api = { path = "../../lib" } cf-utilities = { package = "utilities", path = "../../../utilities" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } diff --git a/api/bin/chainflip-lp-api/README.md b/api/bin/chainflip-lp-api/README.md index 0ab3c691c2..70ce41e9bd 100644 --- a/api/bin/chainflip-lp-api/README.md +++ b/api/bin/chainflip-lp-api/README.md @@ -16,26 +16,16 @@ The `signing_key_file` should be the broker's private key for their on-chain acc ```sh chainflip-lp-api -USAGE: - chainflip-lp-api [OPTIONS] - -OPTIONS: - -h, --help - Print help information - - --port - The port number on which the LP server will listen for connections. Use 0 to assign a - random port. [default: 80] - - --state_chain.signing_key_file - A path to a file that contains the LPs secret key for signing extrinsics. - [default: /etc/chainflip/keys/signing_key_file] - - --state_chain.ws_endpoint - The state chain nodes RPC endpoint. [default: ws://localhost:9944] - - -v, --version - Print the version of the API +Usage: chainflip-lp-api [OPTIONS] + +Options: + --port The port number on which the LP server will listen for connections. Use 0 to assign a random port. [default: 80] + --state_chain.ws_endpoint The state chain node's RPC endpoint. [default: ws://localhost:9944] + --state_chain.signing_key_file A path to a file that contains the LP's secret key for signing extrinsics. [default: /etc/chainflip/keys/signing_key_file] + --health_check.hostname Hostname for this server's healthcheck. Requires the parameter to be given as well. + --health_check.port Port for this server's healthcheck. Requires the parameter to be given as well. + -h, --help Print help + -V, --version Print version ``` ## Working Example diff --git a/api/bin/chainflip-lp-api/src/main.rs b/api/bin/chainflip-lp-api/src/main.rs index b055995d7c..bc0649f1fa 100644 --- a/api/bin/chainflip-lp-api/src/main.rs +++ b/api/bin/chainflip-lp-api/src/main.rs @@ -24,15 +24,14 @@ use chainflip_api::{ use clap::Parser; use custom_rpc::{ order_fills::{order_fills_from_block_updates, OrderFills}, - CustomApiClient, + to_rpc_error, CustomApiClient, }; use futures::{try_join, FutureExt, StreamExt}; use jsonrpsee::{ core::{async_trait, RpcResult}, proc_macros::rpc, server::ServerBuilder, - types::SubscriptionResult, - SubscriptionSink, + PendingSubscriptionSink, }; use pallet_cf_pools::{CloseOrder, IncreaseOrDecrease, OrderId, RangeOrderSize, MAX_ORDERS_DELETE}; use rpc_types::{OpenSwapChannels, OrderIdJson, RangeOrderSizeJson}; @@ -229,7 +228,8 @@ impl RpcServerImpl { ) -> Result { Ok(Self { api: StateChainApi::connect(scope, StateChain { ws_endpoint, signing_key_file }) - .await?, + .await + .map_err(to_rpc_error)?, }) } } @@ -248,7 +248,8 @@ impl RpcServer for RpcServerImpl { .lp_api() .request_liquidity_deposit_address(asset, wait_for.unwrap_or_default(), boost_fee) .await - .map(|result| result.map_details(|address| address.to_string()))?) + .map(|result| result.map_details(|address| address.to_string())) + .map_err(to_rpc_error)?) } async fn register_liquidity_refund_address( @@ -256,7 +257,12 @@ impl RpcServer for RpcServerImpl { chain: ForeignChain, address: AddressString, ) -> RpcResult { - Ok(self.api.lp_api().register_liquidity_refund_address(chain, address).await?) + Ok(self + .api + .lp_api() + .register_liquidity_refund_address(chain, address) + .await + .map_err(to_rpc_error)?) } /// Returns an egress id @@ -271,12 +277,13 @@ impl RpcServer for RpcServerImpl { .api .lp_api() .withdraw_asset( - try_parse_number_or_hex(amount)?, + try_parse_number_or_hex(amount).map_err(to_rpc_error)?, asset, destination_address, wait_for.unwrap_or_default(), ) - .await?) + .await + .map_err(to_rpc_error)?) } /// Returns an egress id @@ -290,11 +297,15 @@ impl RpcServer for RpcServerImpl { .api .lp_api() .transfer_asset( - amount.try_into().map_err(|_| anyhow!("Failed to convert amount to u128"))?, + amount + .try_into() + .map_err(|_| anyhow!("Failed to convert amount to u128")) + .map_err(to_rpc_error)?, asset, destination_account, ) - .await?) + .await + .map_err(to_rpc_error)?) } /// Returns a list of all assets and their free balance in json format @@ -308,6 +319,7 @@ impl RpcServer for RpcServerImpl { Some(self.api.state_chain_client.latest_finalized_block().hash), ) .await + .map_err(to_rpc_error) } async fn update_range_order( @@ -325,12 +337,13 @@ impl RpcServer for RpcServerImpl { .update_range_order( base_asset, quote_asset, - id.try_into()?, + id.try_into().map_err(to_rpc_error)?, tick_range, - size_change.try_map(|size| size.try_into())?, + size_change.try_map(|size| size.try_into()).map_err(to_rpc_error)?, wait_for.unwrap_or_default(), ) - .await?) + .await + .map_err(to_rpc_error)?) } async fn set_range_order( @@ -348,12 +361,13 @@ impl RpcServer for RpcServerImpl { .set_range_order( base_asset, quote_asset, - id.try_into()?, + id.try_into().map_err(to_rpc_error)?, tick_range, - size.try_into()?, + size.try_into().map_err(to_rpc_error)?, wait_for.unwrap_or_default(), ) - .await?) + .await + .map_err(to_rpc_error)?) } async fn update_limit_order( @@ -374,13 +388,14 @@ impl RpcServer for RpcServerImpl { base_asset, quote_asset, side, - id.try_into()?, + id.try_into().map_err(to_rpc_error)?, tick, - amount_change.try_map(try_parse_number_or_hex)?, + amount_change.try_map(try_parse_number_or_hex).map_err(to_rpc_error)?, dispatch_at, wait_for.unwrap_or_default(), ) - .await?) + .await + .map_err(to_rpc_error)?) } async fn set_limit_order( @@ -401,13 +416,14 @@ impl RpcServer for RpcServerImpl { base_asset, quote_asset, side, - id.try_into()?, + id.try_into().map_err(to_rpc_error)?, tick, - try_parse_number_or_hex(sell_amount)?, + try_parse_number_or_hex(sell_amount).map_err(to_rpc_error)?, dispatch_at, wait_for.unwrap_or_default(), ) - .await?) + .await + .map_err(to_rpc_error)?) } /// Returns the tx hash that the account role was set @@ -416,7 +432,8 @@ impl RpcServer for RpcServerImpl { .api .operator_api() .register_account_role(AccountRole::LiquidityProvider) - .await?) + .await + .map_err(to_rpc_error)?) } async fn get_open_swap_channels(&self) -> RpcResult { @@ -437,7 +454,7 @@ impl RpcServer for RpcServerImpl { executor_address: Option, ) -> RpcResult { let redeem_amount = if let Some(number_or_hex) = exact_amount { - RedemptionAmount::Exact(try_parse_number_or_hex(number_or_hex)?) + RedemptionAmount::Exact(try_parse_number_or_hex(number_or_hex).map_err(to_rpc_error)?) } else { RedemptionAmount::Max }; @@ -446,44 +463,43 @@ impl RpcServer for RpcServerImpl { .api .operator_api() .request_redemption(redeem_amount, redeem_address, executor_address) - .await?) + .await + .map_err(to_rpc_error)?) } - fn subscribe_order_fills(&self, mut sink: SubscriptionSink) -> SubscriptionResult { - sink.accept()?; + fn subscribe_order_fills(&self, pending_sink: PendingSubscriptionSink) { let state_chain_client = self.api.state_chain_client.clone(); tokio::spawn(async move { - let mut finalized_block_stream = state_chain_client.finalized_block_stream().await; - while let Some(block) = finalized_block_stream.next().await { - if let Err(option_error) = order_fills(state_chain_client.clone(), block) - .await - .map_err(Some) - .and_then(|order_fills| match sink.send(&order_fills) { - Ok(true) => Ok(()), - Ok(false) => Err(None), - Err(error) => Err(Some(jsonrpsee::core::Error::ParseError(error))), - }) { - if let Some(error) = option_error { - sink.close(error); + if let Ok(sink) = pending_sink.accept().await { + let mut finalized_block_stream = state_chain_client.finalized_block_stream().await; + while let Some(block) = finalized_block_stream.next().await { + match order_fills(state_chain_client.clone(), block).await { + Ok(order_fills) => { + if sink + .send(sc_rpc::utils::to_sub_message(&sink, &order_fills)) + .await + .is_err() + { + break; + } + }, + Err(_) => break, } - break } } }); - - Ok(()) } async fn order_fills(&self, at: Option) -> RpcResult> { let state_chain_client = &self.api.state_chain_client; let block = if let Some(at) = at { - state_chain_client.block(at).await? + state_chain_client.block(at).await.map_err(to_rpc_error)? } else { state_chain_client.latest_finalized_block() }; - Ok(order_fills(state_chain_client.clone(), block).await?) + Ok(order_fills(state_chain_client.clone(), block).await.map_err(to_rpc_error)?) } async fn cancel_all_orders( @@ -497,7 +513,8 @@ impl RpcServer for RpcServerImpl { .base_rpc_client .raw_rpc_client .cf_available_pools(None) - .await?; + .await + .map_err(to_rpc_error)?; for pool in pool_pairs { let orders = self .api @@ -511,7 +528,8 @@ impl RpcServer for RpcServerImpl { None, None, ) - .await?; + .await + .map_err(to_rpc_error)?; for order in orders.range_orders { orders_to_delete.push(CloseOrder::Range { base_asset: pool.base, @@ -551,7 +569,8 @@ impl RpcServer for RpcServerImpl { .expect("Guaranteed by `chunk` method."), wait_for.unwrap_or_default(), ) - .await?, + .await + .map_err(to_rpc_error)?, ); } @@ -567,14 +586,15 @@ impl RpcServer for RpcServerImpl { .api .lp_api() .cancel_orders_batch(orders, wait_for.unwrap_or_default()) - .await?) + .await + .map_err(to_rpc_error)?) } } async fn order_fills( state_chain_client: Arc, block: BlockInfo, -) -> Result, jsonrpsee::core::Error> +) -> RpcResult> where StateChainClient: StorageApi, { @@ -605,7 +625,7 @@ where } #[derive(Parser, Debug, Clone, Default)] -#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), version_short = 'v')] +#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), short_flag = 'v')] pub struct LPOptions { #[clap( long = "port", @@ -653,11 +673,16 @@ async fn main() -> anyhow::Result<()> { &opts.health_check, has_completed_initialising.clone(), ) - .await?; + .await + .map_err(to_rpc_error)?; - let server = ServerBuilder::default().build(format!("0.0.0.0:{}", opts.port)).await?; + let server = ServerBuilder::default() + .build(format!("0.0.0.0:{}", opts.port)) + .await + .map_err(to_rpc_error)?; let server_addr = server.local_addr()?; - let server = server.start(RpcServerImpl::new(scope, opts).await?.into_rpc())?; + let server = server + .start(RpcServerImpl::new(scope, opts).await.map_err(to_rpc_error)?.into_rpc()); log::info!("🎙 Server is listening on {server_addr}."); diff --git a/api/lib/Cargo.toml b/api/lib/Cargo.toml index 4044ac8d7e..25573c5dd1 100644 --- a/api/lib/Cargo.toml +++ b/api/lib/Cargo.toml @@ -11,18 +11,19 @@ anyhow = "1.0" async-trait = "0.1.49" bs58 = "0.5.1" ed25519-dalek = "2.1.1" -futures = "0.3.14" +futures = "0.3.30" hex = "0.4.3" hmac-sha512 = "1.1.4" libsecp256k1 = { version = '0.7' } rand = "0.8.5" -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0.197", features = ["derive"] } tiny-bip39 = "1.0.0" tokio = "1.28" tracing = "0.1" zeroize = "1.5.4" libp2p-identity = { version = "0.2", features = ["ed25519", "peerid"] } lazy_static = "1.4" +jsonrpsee = { version = "0.23.2", features = ["full"] } # Local chainflip-engine = { path = "../../engine/" } @@ -49,8 +50,8 @@ state-chain-runtime = { path = "../../state-chain/runtime" } # Substrate -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-consensus-aura = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1' } -sp-core = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1' } -sp-consensus-grandpa = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1' } -codec = { package = "parity-scale-codec", version = "3.6.1" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-consensus-aura = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } +sp-core = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } +sp-consensus-grandpa = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } +codec = { package = "parity-scale-codec", version = "3.6.12" } diff --git a/api/lib/src/lib.rs b/api/lib/src/lib.rs index df698fc527..47e72bcd68 100644 --- a/api/lib/src/lib.rs +++ b/api/lib/src/lib.rs @@ -11,7 +11,6 @@ use cf_chains::{ }; pub use cf_primitives::{AccountRole, Affiliates, Asset, BasisPoints, ChannelId, SemVer}; use cf_primitives::{BlockNumber, DcaParameters, NetworkEnvironment, Price}; -use futures::FutureExt; use pallet_cf_account_roles::MAX_LENGTH_FOR_VANITY_NAME; use pallet_cf_governance::ExecutionMode; use serde::{Deserialize, Serialize}; @@ -333,14 +332,14 @@ impl fmt::Display for AddressString { } } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct RefundParameters { pub retry_duration: BlockNumber, pub refund_address: AddressString, pub min_price: Price, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct SwapDepositAddress { pub address: AddressString, pub issued_block: state_chain_runtime::BlockNumber, @@ -350,7 +349,7 @@ pub struct SwapDepositAddress { pub refund_parameters: Option>, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct WithdrawFeesDetail { pub tx_hash: H256, pub egress_id: (ForeignChain, u64), diff --git a/api/lib/src/queries.rs b/api/lib/src/queries.rs index 5ae298f0fc..ac866199df 100644 --- a/api/lib/src/queries.rs +++ b/api/lib/src/queries.rs @@ -7,6 +7,7 @@ use chainflip_engine::state_chain_observer::client::{ use codec::Decode; use custom_rpc::CustomApiClient; use frame_support::sp_runtime::DigestItem; +use jsonrpsee::core::RpcResult; use pallet_cf_ingress_egress::DepositChannelDetails; use pallet_cf_validator::RotationPhase; use serde::Deserialize; @@ -15,6 +16,7 @@ use state_chain_runtime::runtime_apis::FailingWitnessValidators; use std::{collections::BTreeMap, ops::Deref, sync::Arc}; use tracing::log; use utilities::task_scope; + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SwapChannelInfo { deposit_address: ::Humanreadable, @@ -56,7 +58,7 @@ impl QueryApi { pub async fn get_open_swap_channels( &self, block_hash: Option, - ) -> Result>, anyhow::Error> + ) -> RpcResult>> where state_chain_runtime::Runtime: pallet_cf_ingress_egress::Config, TargetChain = C>, @@ -64,23 +66,20 @@ impl QueryApi { let block_hash = block_hash.unwrap_or_else(|| self.state_chain_client.latest_finalized_block().hash); - let (channel_details, network_environment) = tokio::try_join!( - self.state_chain_client - .storage_map::, - >, Vec<_>>(block_hash) - .map(|result| { - result.map(|channels| channels.into_iter().collect::>()) - }), - self.state_chain_client - .storage_value::>( - block_hash - ), - )?; - - Ok(channel_details - .iter() + let (channels, network_environment) = tokio::try_join!( + self.state_chain_client + .storage_map::, + >, Vec<_>>(block_hash), + self.state_chain_client + .storage_value::>(block_hash), + )?; + + Ok(channels + .into_iter() .filter_map(|(_, DepositChannelDetails { action, deposit_channel, .. })| match action { pallet_cf_ingress_egress::ChannelAction::Swap { destination_asset, .. } | pallet_cf_ingress_egress::ChannelAction::CcmTransfer { @@ -88,7 +87,7 @@ impl QueryApi { } => Some(SwapChannelInfo { deposit_address: deposit_channel.address.to_humanreadable(network_environment), source_asset: deposit_channel.asset.into(), - destination_asset: *destination_asset, + destination_asset, }), _ => None, }) diff --git a/bouncer/commands/run_test.ts b/bouncer/commands/run_test.ts index df8c8accbf..d969b47db9 100755 --- a/bouncer/commands/run_test.ts +++ b/bouncer/commands/run_test.ts @@ -39,6 +39,7 @@ import { testBoostingSwap } from '../tests/boost'; import { ConsoleColors, ConsoleLogColors } from '../shared/utils'; import { testDeltaBasedIngress } from '../tests/delta_based_ingress'; import { testCancelOrdersBatch } from '../tests/create_and_delete_multiple_orders'; +import { depositChannelCreation } from '../tests/request_swap_deposit_address_with_affiliates'; async function main() { const testName = process.argv[2]; @@ -65,6 +66,7 @@ async function main() { testSwapAfterDisconnection, testDeltaBasedIngress, testCancelOrdersBatch, + depositChannelCreation, ]; // Help message diff --git a/bouncer/commands/setup_vaults.ts b/bouncer/commands/setup_vaults.ts index a0f2d61829..02cb1f51ee 100755 --- a/bouncer/commands/setup_vaults.ts +++ b/bouncer/commands/setup_vaults.ts @@ -67,7 +67,7 @@ async function main(): Promise { .createPure(polkadot.createType('ProxyType', 'Any'), 0, 0) .signAndSend(alice, { nonce: -1 }, (result) => { if (result.isError) { - handleSubstrateError(result); + handleSubstrateError(polkadot)(result); } if (result.isInBlock) { console.log('Polkadot Vault created'); @@ -117,7 +117,7 @@ async function main(): Promise { ]) .signAndSend(alice, { nonce: -1 }, (result) => { if (result.isError) { - handleSubstrateError(result); + handleSubstrateError(polkadot)(result); } if (result.isInBlock) { unsubscribe(); diff --git a/bouncer/package.json b/bouncer/package.json index e474f615c1..5b107e2d97 100644 --- a/bouncer/package.json +++ b/bouncer/package.json @@ -6,11 +6,13 @@ "prettier:write": "prettier --write ." }, "dependencies": { - "@chainflip/cli": "1.6.2", + "@chainflip/cli": "1.6.3", + "@chainflip/utils": "^0.4.0", "@coral-xyz/anchor": "^0.30.1", "@iarna/toml": "^2.2.5", "@polkadot/api": "^11.3.1", "@polkadot/keyring": "12.6.2", + "@polkadot/types": "^11.3.1", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", "@solana/spl-token": "^0.4.6", diff --git a/bouncer/pnpm-lock.yaml b/bouncer/pnpm-lock.yaml index 0b28eb33f2..92661a523b 100644 --- a/bouncer/pnpm-lock.yaml +++ b/bouncer/pnpm-lock.yaml @@ -9,8 +9,11 @@ importers: .: dependencies: '@chainflip/cli': - specifier: 1.6.2 - version: 1.6.2(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + specifier: 1.6.3 + version: 1.6.3(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10) + '@chainflip/utils': + specifier: ^0.4.0 + version: 0.4.0 '@coral-xyz/anchor': specifier: ^0.30.1 version: 0.30.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -23,6 +26,9 @@ importers: '@polkadot/keyring': specifier: 12.6.2 version: 12.6.2(@polkadot/util-crypto@12.6.2(@polkadot/util@12.6.2))(@polkadot/util@12.6.2) + '@polkadot/types': + specifier: ^11.3.1 + version: 11.3.1 '@polkadot/util': specifier: 12.6.2 version: 12.6.2 @@ -133,16 +139,19 @@ packages: resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} engines: {node: '>=6.9.0'} - '@chainflip/bitcoin@1.0.2': - resolution: {integrity: sha512-OrkjJT5mH9+wvm7lSl09D2VlY/kEvqfFGgiLDvItxTUCrm/McADDiGontjXOwe3u4r8KdocPEF47jLHQLAg33A==} + '@chainflip/bitcoin@1.1.1': + resolution: {integrity: sha512-Jr6X/0QTSFYpTp23ZPhyioL6wL9x3Xpj6OGjadQKZyhobRN4BZkhLogv20HDYTJcRzVphzrTJArbEaNie04XVA==} - '@chainflip/cli@1.6.2': - resolution: {integrity: sha512-wV4bLsn1fqtUxVjEFcfaOnL5AjrgqZ9JxBRmRHTchOWt3+B5QHx0Ehn3pR1dN/9Jnqe0xMSAwBLuH6tJ7hAqQA==} + '@chainflip/cli@1.6.3': + resolution: {integrity: sha512-isbPdFbO0tmQ7+7OjWSyzKtuog7FOgvkeb7fIini88LHsTjTXf8UvoKGYncOgwvLVQIY+J7NDnSQQmKdBg7PUw==} hasBin: true peerDependencies: axios: ^1.x ethers: ^6.13.2 + '@chainflip/extrinsics@1.6.1': + resolution: {integrity: sha512-sm3v2QguNW4/RiIZYHd+VRSxup2q4cVBY0VjbQJw6xYqhNCzZlt+Hl38Kni+TCHQu3hP/WgIF72yvvSs7/PBdg==} + '@chainflip/rpc@1.6.7': resolution: {integrity: sha512-OIE2cqzDy9Oq9sHuxJKOtbjP438QwMFdc6tuWdAmjjPcHGATI0Ft/lIKeCutD/8uH/CumOzaOoBaT2pI6G78Gg==} @@ -973,6 +982,9 @@ packages: base-x@4.0.0: resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} + base-x@5.0.0: + resolution: {integrity: sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -996,6 +1008,10 @@ packages: resolution: {integrity: sha512-mdFV5+/v0XyNYXjBS6CQPLo9ekCx4gtKZFnJm5PMto7Fs9hTTDpkkzOB7/FtluRI6JbUUAu+snTYfJRgHLZbZQ==} engines: {node: '>=8.0.0'} + bip174@3.0.0-rc.1: + resolution: {integrity: sha512-+8P3BpSairVNF2Nee6Ksdc1etIjWjBOi/MH0MwKtq9YaYp+S2Hk2uvup0e8hCT4IKlS58nXJyyQVmW92zPoD4Q==} + engines: {node: '>=18.0.0'} + bitcoin-core@4.2.0: resolution: {integrity: sha512-QFmer//rZhyuYm0mBOVAmMhIG/EFmXDahC3a1LvNTwM8/KszxUGEAjvAT4tzm1FaDj4c7pQWMG/vOWtoKjeR3Q==} engines: {node: '>=7'} @@ -1004,6 +1020,10 @@ packages: resolution: {integrity: sha512-Fk8+Vc+e2rMoDU5gXkW9tD+313rhkm5h6N9HfZxXvYU9LedttVvmXKTgd9k5rsQJjkSfsv6XRM8uhJv94SrvcA==} engines: {node: '>=8.0.0'} + bitcoinjs-lib@7.0.0-rc.0: + resolution: {integrity: sha512-7CQgOIbREemKR/NT2uc3uO/fkEy+6CM0sLxboVVY6bv6DbZmPt3gg5Y/hhWgQFeZu5lfTbtVAv32MIxf7lMh4g==} + engines: {node: '>=18.0.0'} + blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} @@ -1048,12 +1068,18 @@ packages: bs58@5.0.0: resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} + bs58@6.0.0: + resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==} + bs58check@2.1.2: resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} bs58check@3.0.1: resolution: {integrity: sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==} + bs58check@4.0.0: + resolution: {integrity: sha512-FsGDOnFg9aVI9erdriULkd/JjEWONV/lQE5aYziB5PoBsXRind56lh8doIZIc9X4HoxT5x4bLjMWN1/NB8Zp5g==} + buffer-layout@1.2.2: resolution: {integrity: sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==} engines: {node: '>=4.5'} @@ -2769,6 +2795,9 @@ packages: tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tsx@4.16.2: resolution: {integrity: sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==} engines: {node: '>=18.0.0'} @@ -2826,6 +2855,14 @@ packages: resolution: {integrity: sha512-vrrNZJiusLWoFWBqz5Y5KMCgP9W9hnjZHzZiZRT8oNAkq3d5Z5Oe76jAvVVSRh4U8GGR90N2X1dWtrhvx6L8UQ==} engines: {node: '>=14.0.0'} + uint8array-tools@0.0.8: + resolution: {integrity: sha512-xS6+s8e0Xbx++5/0L+yyexukU7pz//Yg6IHg3BKhXotg1JcYtgxVcUctQ0HxLByiJzpAkNFawz1Nz5Xadzo82g==} + engines: {node: '>=14.0.0'} + + uint8array-tools@0.0.9: + resolution: {integrity: sha512-9vqDWmoSXOoi+K14zNaf6LBV51Q8MayF0/IiQs3GlygIKUYtog603e6virExkjjFosfJUBI4LhbQK1iq8IG11A==} + engines: {node: '>=14.0.0'} + ultron@1.1.1: resolution: {integrity: sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==} @@ -2879,12 +2916,23 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + valibot@0.38.0: + resolution: {integrity: sha512-RCJa0fetnzp+h+KN9BdgYOgtsMAG9bfoJ9JSjIhFHobKWVWyzM3jjaeNTdpFK9tQtf3q1sguXeERJ/LcmdFE7w==} + peerDependencies: + typescript: '>=5' + peerDependenciesMeta: + typescript: + optional: true + varint@5.0.2: resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} varuint-bitcoin@1.1.2: resolution: {integrity: sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==} + varuint-bitcoin@2.0.0: + resolution: {integrity: sha512-6QZbU/rHO2ZQYpWFDALCDSRsXbAs1VOEmXAxtbtjLtKuMJ/FQ8YbhfxlaiKv5nklci0M6lZtlZyxo9Q+qNnyog==} + vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -3111,14 +3159,17 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 - '@chainflip/bitcoin@1.0.2': + '@chainflip/bitcoin@1.1.1(typescript@5.5.3)': dependencies: '@chainflip/utils': 0.4.0 - '@noble/hashes': 1.4.0 + bitcoinjs-lib: 7.0.0-rc.0(typescript@5.5.3) + transitivePeerDependencies: + - typescript - '@chainflip/cli@1.6.2(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)': + '@chainflip/cli@1.6.3(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10)': dependencies: - '@chainflip/bitcoin': 1.0.2 + '@chainflip/bitcoin': 1.1.1(typescript@5.5.3) + '@chainflip/extrinsics': 1.6.1 '@chainflip/rpc': 1.6.7 '@chainflip/solana': 1.0.2 '@chainflip/utils': 0.4.0 @@ -3130,8 +3181,11 @@ snapshots: transitivePeerDependencies: - bufferutil - supports-color + - typescript - utf-8-validate + '@chainflip/extrinsics@1.6.1': {} + '@chainflip/rpc@1.6.7': dependencies: '@chainflip/utils': 0.3.0 @@ -3613,19 +3667,19 @@ snapshots: '@polkadot/types': 11.3.1 '@polkadot/types-codec': 11.3.1 '@polkadot/util': 12.6.2 - tslib: 2.6.3 + tslib: 2.7.0 '@polkadot/types-codec@11.3.1': dependencies: '@polkadot/util': 12.6.2 '@polkadot/x-bigint': 12.6.2 - tslib: 2.6.3 + tslib: 2.7.0 '@polkadot/types-create@11.3.1': dependencies: '@polkadot/types-codec': 11.3.1 '@polkadot/util': 12.6.2 - tslib: 2.6.3 + tslib: 2.7.0 '@polkadot/types-known@11.3.1': dependencies: @@ -3650,7 +3704,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) rxjs: 7.8.1 - tslib: 2.6.3 + tslib: 2.7.0 '@polkadot/util-crypto@12.6.2(@polkadot/util@12.6.2)': dependencies: @@ -4265,6 +4319,8 @@ snapshots: base-x@4.0.0: {} + base-x@5.0.0: {} + base64-js@1.5.1: {} bcrypt-pbkdf@1.0.2: @@ -4285,6 +4341,11 @@ snapshots: bip174@2.1.1: {} + bip174@3.0.0-rc.1: + dependencies: + uint8array-tools: 0.0.9 + varuint-bitcoin: 2.0.0 + bitcoin-core@4.2.0: dependencies: '@uphold/request-logger': 2.0.0(request@2.88.2) @@ -4306,6 +4367,18 @@ snapshots: typeforce: 1.18.0 varuint-bitcoin: 1.1.2 + bitcoinjs-lib@7.0.0-rc.0(typescript@5.5.3): + dependencies: + '@noble/hashes': 1.4.0 + bech32: 2.0.0 + bip174: 3.0.0-rc.1 + bs58check: 4.0.0 + uint8array-tools: 0.0.9 + valibot: 0.38.0(typescript@5.5.3) + varuint-bitcoin: 2.0.0 + transitivePeerDependencies: + - typescript + blakejs@1.2.1: {} bluebird@3.7.2: {} @@ -4371,6 +4444,10 @@ snapshots: dependencies: base-x: 4.0.0 + bs58@6.0.0: + dependencies: + base-x: 5.0.0 + bs58check@2.1.2: dependencies: bs58: 4.0.1 @@ -4382,6 +4459,11 @@ snapshots: '@noble/hashes': 1.4.0 bs58: 5.0.0 + bs58check@4.0.0: + dependencies: + '@noble/hashes': 1.4.0 + bs58: 6.0.0 + buffer-layout@1.2.2: {} buffer-to-arraybuffer@0.0.5: {} @@ -6409,6 +6491,8 @@ snapshots: tslib@2.6.3: {} + tslib@2.7.0: {} + tsx@4.16.2: dependencies: esbuild: 0.21.5 @@ -6477,6 +6561,10 @@ snapshots: uint8array-tools@0.0.7: {} + uint8array-tools@0.0.8: {} + + uint8array-tools@0.0.9: {} + ultron@1.1.1: {} unbox-primitive@1.0.2: @@ -6522,12 +6610,20 @@ snapshots: uuid@9.0.1: {} + valibot@0.38.0(typescript@5.5.3): + optionalDependencies: + typescript: 5.5.3 + varint@5.0.2: {} varuint-bitcoin@1.1.2: dependencies: safe-buffer: 5.2.1 + varuint-bitcoin@2.0.0: + dependencies: + uint8array-tools: 0.0.8 + vary@1.1.2: {} verror@1.10.0: diff --git a/bouncer/shared/polkadot_utils.ts b/bouncer/shared/polkadot_utils.ts index d7e3f48123..8af8bc0fce 100644 --- a/bouncer/shared/polkadot_utils.ts +++ b/bouncer/shared/polkadot_utils.ts @@ -1,10 +1,10 @@ import { BN } from '@polkadot/util'; +import { AugmentedEvent, SubmittableExtrinsicFunction } from '@polkadot/api/types'; import { aliceKeyringPair } from '../shared/polkadot_keyring'; import { Event, polkadotSigningMutex, sleep } from '../shared/utils'; import { getPolkadotApi } from './utils/substrate'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export async function handleDispatchError(result: any) { +export async function handleDispatchError(result: { dispatchError?: string }) { await using polkadot = await getPolkadotApi(); if (result.dispatchError) { const dispatchError = JSON.parse(result.dispatchError); @@ -21,8 +21,10 @@ export async function handleDispatchError(result: any) { } } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export async function submitAndGetEvent(call: any, eventMatch: any): Promise { +export async function submitAndGetEvent( + call: ReturnType>, + eventMatch: AugmentedEvent<'promise'>, +): Promise { const alice = await aliceKeyringPair(); let done = false; let event: Event = { name: '', data: [], block: 0, event_index: 0 }; diff --git a/bouncer/shared/utils.ts b/bouncer/shared/utils.ts index f3d0e2c3c8..8ce6075902 100644 --- a/bouncer/shared/utils.ts +++ b/bouncer/shared/utils.ts @@ -18,6 +18,7 @@ import { Connection, Keypair, PublicKey } from '@solana/web3.js'; import { hexToU8a, u8aToHex, BN } from '@polkadot/util'; import BigNumber from 'bignumber.js'; import { EventParser, BorshCoder } from '@coral-xyz/anchor'; +import { ISubmittableResult } from '@polkadot/types/types'; import { base58Decode, base58Encode } from '../polkadot/util-crypto'; import { newDotAddress } from './new_dot_address'; import { BtcAddressType, newBtcAddress } from './new_btc_address'; @@ -112,7 +113,7 @@ export function getContractAddress(chain: Chain, contract: string): string { } } -export function shortChainFromAsset(asset: Asset): string { +export function shortChainFromAsset(asset: Asset) { switch (asset) { case 'Dot': return 'Dot'; @@ -897,10 +898,8 @@ export function getEncodedSolAddress(address: string): string { return /^0x[a-fA-F0-9]+$/.test(address) ? encodeSolAddress(address) : address; } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function handleSubstrateError(api: any) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return (arg: any) => { +export function handleSubstrateError(api: ApiPromise, exit = true) { + return (arg: ISubmittableResult) => { const { dispatchError } = arg; if (dispatchError) { let error; @@ -910,8 +909,12 @@ export function handleSubstrateError(api: any) { } else { error = dispatchError.toString(); } - console.log('Dispatch error:' + error); - process.exit(-1); + if (exit) { + console.log('Dispatch error:' + error); + process.exit(-1); + } else { + throw new Error('Dispatch error: ' + error); + } } }; } diff --git a/bouncer/shared/utils/substrate.ts b/bouncer/shared/utils/substrate.ts index ab58ab7809..093afbb574 100644 --- a/bouncer/shared/utils/substrate.ts +++ b/bouncer/shared/utils/substrate.ts @@ -32,6 +32,7 @@ const getCachedDisposable = { + connections -= 1; setTimeout(() => { if (connections === 0) { const dispose = Reflect.get( diff --git a/bouncer/tests/DCA_test.ts b/bouncer/tests/DCA_test.ts index bd03eee875..43e14aad59 100644 --- a/bouncer/tests/DCA_test.ts +++ b/bouncer/tests/DCA_test.ts @@ -42,7 +42,11 @@ async function testDCASwap(inputAsset: Asset, amount: number, numberOfChunks: nu 0, // brokerCommissionBps false, // log 0, // boostFeeBps - undefined, // FoK parameters + { + refundAddress: '0xa56A6be23b6Cf39D9448FF6e897C29c41c8fbDFF', + minPriceX128: '1', + retryDurationBlocks: 100, + }, // FoK parameters dcaParameters, ); diff --git a/bouncer/tests/all_concurrent_tests.ts b/bouncer/tests/all_concurrent_tests.ts index a0fde59b3a..fd7bb601ea 100755 --- a/bouncer/tests/all_concurrent_tests.ts +++ b/bouncer/tests/all_concurrent_tests.ts @@ -13,6 +13,7 @@ import { testFillOrKill } from './fill_or_kill'; import { testDCASwaps } from './DCA_test'; import { testCancelOrdersBatch } from './create_and_delete_multiple_orders'; import { testAllSwaps } from './all_swaps'; +import { depositChannelCreation } from './request_swap_deposit_address_with_affiliates'; async function runAllConcurrentTests() { // Specify the number of nodes via providing an argument to this script. @@ -41,6 +42,7 @@ async function runAllConcurrentTests() { testFillOrKill.run(), testDCASwaps.run(), testCancelOrdersBatch.run(), + depositChannelCreation.run(), ]; // Tests that only work if there is more than one node diff --git a/bouncer/tests/request_swap_deposit_address_with_affiliates.ts b/bouncer/tests/request_swap_deposit_address_with_affiliates.ts new file mode 100644 index 0000000000..794468dacc --- /dev/null +++ b/bouncer/tests/request_swap_deposit_address_with_affiliates.ts @@ -0,0 +1,255 @@ +import * as ss58 from '@chainflip/utils/ss58'; +import * as base58 from '@chainflip/utils/base58'; +import { isHex } from '@chainflip/utils/string'; +import { hexToBytes } from '@chainflip/utils/bytes'; +import { ApiPromise, Keyring } from '@polkadot/api'; +import { broker, chainConstants, getInternalAsset } from '@chainflip/cli'; +import assert from 'assert'; +import { z } from 'zod'; +import { getChainflipApi } from '../shared/utils/substrate'; +import { deferredPromise, handleSubstrateError, shortChainFromAsset } from '../shared/utils'; +import { ExecutableTest } from '../shared/executable_test'; + +const keyring = new Keyring({ type: 'sr25519' }); +keyring.setSS58Format(2112); + +const account = keyring.addFromUri('//BROKER_2'); +const account2 = keyring.addFromUri('//BROKER_1'); +type NewSwapRequest = Parameters<(typeof broker)['buildExtrinsicPayload']>[0]; + +const numberSchema = z.string().transform((n) => Number(n.replace(/,/g, ''))); +const bigintSchema = z.string().transform((n) => BigInt(n.replace(/,/g, ''))); + +const shortChainSchema = z.enum(['Btc', 'Eth', 'Arb', 'Dot', 'Sol']); + +const addressTransforms = { + Btc: (address: string) => address, + Eth: (address: string) => address.toLowerCase(), + Arb: (address: string) => address.toLowerCase(), + Dot: (address: string) => + isHex(address) ? ss58.encode({ data: address, ss58Format: 0 }) : address, + Sol: (address: string) => (isHex(address) ? base58.encode(hexToBytes(address)) : address), +} as const; + +const eventSchema = z + .object({ + event: z.object({ + data: z.object({ + destinationAddress: z.record(shortChainSchema, z.string()), + sourceAsset: z.string(), + destinationAsset: z.string(), + brokerCommissionRate: numberSchema, + channelMetadata: z + .object({ message: z.string(), gasBudget: bigintSchema, cfParameters: z.string() }) + .nullable(), + boostFee: numberSchema, + affiliateFees: z.array(z.object({ account: z.string(), bps: numberSchema })), + refundParameters: z + .object({ + retryDuration: numberSchema, + refundAddress: z.record(shortChainSchema, z.string()), + minPrice: bigintSchema, + }) + .nullable(), + dcaParameters: z + .object({ numberOfChunks: numberSchema, chunkInterval: numberSchema }) + .nullable(), + }), + }), + }) + .transform((event) => event.event.data); + +const requestSwapDepositAddress = async ( + chainflip: ApiPromise, + params: NewSwapRequest, + getNonce: () => number, +) => { + const deferred = deferredPromise>(); + const { promise, resolve, reject } = deferred; + + const eventMatcher = chainflip.events.swapping.SwapDepositAddressReady; + + const unsubscribe = await chainflip.tx.swapping + .requestSwapDepositAddressWithAffiliates(...broker.buildExtrinsicPayload(params, 'backspin')) + .signAndSend(account, { nonce: getNonce() }, (result) => { + if (!result.isInBlock) return; + + if (result.dispatchError) { + try { + handleSubstrateError(chainflip, false)(result); + } catch (e) { + reject(e as Error); + return; + } + } + + const event = result.events.find((record) => eventMatcher.is(record.event)); + assert(event, 'SwapDepositAddressReady event not found'); + resolve(eventSchema.parse(event.toHuman())); + }); + + const event = await promise.finally(unsubscribe); + + const sourceAsset = getInternalAsset({ chain: params.srcChain, asset: params.srcAsset }); + const destinationAsset = getInternalAsset({ chain: params.destChain, asset: params.destAsset }); + + assert.strictEqual(event.sourceAsset, sourceAsset, 'source asset is wrong'); + assert.strictEqual(event.destinationAsset, destinationAsset, 'destination asset is wrong'); + + const destChain = shortChainFromAsset(destinationAsset); + const transformDestAddress = addressTransforms[destChain]; + + assert.strictEqual( + transformDestAddress(event.destinationAddress[destChain]!), + transformDestAddress(params.destAddress), + 'destination address is wrong', + ); + assert.strictEqual(event.brokerCommissionRate, params.commissionBps ?? 0); + assert.strictEqual(event.boostFee, params.maxBoostFeeBps ?? 0); + + if (params.fillOrKillParams) { + assert.strictEqual( + event.refundParameters?.minPrice, + BigInt(params.fillOrKillParams.minPriceX128), + ); + assert.strictEqual( + event.refundParameters?.retryDuration, + params.fillOrKillParams.retryDurationBlocks, + ); + const sourceChain = shortChainFromAsset(sourceAsset); + const transformRefundAddress = addressTransforms[sourceChain]; + assert.strictEqual( + transformRefundAddress(event.refundParameters!.refundAddress[sourceChain]!), + transformRefundAddress(params.fillOrKillParams.refundAddress), + ); + } + + if (params.affiliates) { + assert.deepStrictEqual( + params.affiliates + .toSorted((a, b) => a.account.localeCompare(b.account)) + .map((aff) => ({ account: aff.account, bps: aff.commissionBps })), + event.affiliateFees.toSorted((a, b) => a.account.localeCompare(b.account)), + ); + } + + if (params.dcaParams) { + assert.strictEqual(event.dcaParameters?.numberOfChunks, params.dcaParams.numberOfChunks); + assert.strictEqual(event.dcaParameters.chunkInterval, params.dcaParams.chunkIntervalBlocks); + } + + if (params.ccmParams) { + assert.strictEqual(event.channelMetadata?.message, params.ccmParams.message); + assert.strictEqual(event.channelMetadata.gasBudget, BigInt(params.ccmParams.gasBudget)); + assert.strictEqual(event.channelMetadata.cfParameters, params.ccmParams.cfParameters); + } +}; + +const addresses = { + Bitcoin: [ + 'n37AcBDN48pKxBR5DK1fSDFnzFuMhGq9wy', // P2PKH + '2MuBZJLi7VdTJgdTkeBfWFMMVvGUJYW9aAt', // P2SH + 'bcrt1qzhzr5p67ukjyzfmxsh53a8rv3p06nqq0m3md3q', // P2WPKH + 'bcrt1qqazrtdsvdnl8pv6ypz4jv9h7ud0fs5u4tullapvan2amku7eyujsum5wt8', // P2WSH + 'bcrt1plrgeugjy6vsehsythzxy4jg5ga2zdvuf4zwjchynd78ldklacs4q52p6g5', // Taproot + ], + Ethereum: ['0xa56A6be23b6Cf39D9448FF6e897C29c41c8fbDFF'], + Arbitrum: ['0xa56A6be23b6Cf39D9448FF6e897C29c41c8fbDFF'], + Polkadot: ['1yMmfLti1k3huRQM2c47WugwonQMqTvQ2GUFxnU7Pcs7xPo'], + Solana: ['3yKDHJgzS2GbZB9qruoadRYtq8597HZifnRju7fHpdRC'], +} as const; + +const entries = Object.entries as (o: T) => [keyof T, T[keyof T]][]; + +const baseCases = entries(addresses).flatMap(([destChain, addrs]) => + addrs.map( + (destAddress) => + ({ + srcAsset: 'FLIP', + srcChain: 'Ethereum', + destChain, + destAsset: chainConstants[destChain].assets[0], + destAddress, + }) as NewSwapRequest, + ), +); + +const refundCases = entries(addresses).flatMap(([srcChain, addrs]) => + addrs.map( + (refundAddress) => + ({ + destAsset: 'FLIP', + destChain: 'Ethereum', + destAddress: addresses.Ethereum[0], + srcChain, + srcAsset: chainConstants[srcChain].assets[0], + fillOrKillParams: { + refundAddress, + minPriceX128: '1', + retryDurationBlocks: 100, + }, + }) as NewSwapRequest, + ), +); + +const withDca: NewSwapRequest = { + ...refundCases[0], + dcaParams: { + numberOfChunks: 7200, + chunkIntervalBlocks: 2, + }, +}; + +const withCommission: NewSwapRequest = { + ...baseCases[0], + commissionBps: 100, +}; + +const withAffiliates: NewSwapRequest = { + ...baseCases[0], + affiliates: [{ account: account2.address, commissionBps: 100 }], +}; + +const withCcm: NewSwapRequest = { + ...baseCases.find((c) => c.destChain === 'Arbitrum')!, + ccmParams: { + message: '0xcafebabe', + gasBudget: '1000000', + cfParameters: '0xdeadbeef', + }, +}; + +const main = async () => { + await using api = await getChainflipApi(); + let nonce = (await api.rpc.system.accountNextIndex(account.address)).toJSON() as number; + + const allCases = [...baseCases, ...refundCases, withDca, withCommission, withAffiliates, withCcm]; + const results = await Promise.allSettled( + allCases.map((params) => requestSwapDepositAddress(api, params, () => nonce++)), + ); + + // optimism 🚀 + let success = true; + + results.forEach((result, i) => { + if (result.status === 'fulfilled') { + console.log('✅', `swap channel ${i} opened successfully`); + } else { + // realism 😔 + success = false; + console.error( + '❌', + `swap channel ${i} couldn't be opened`, + (result.reason as Error).message, + allCases[i], + ); + } + }); + + if (!success) { + console.error('Some tests failed'); + process.exit(1); + } +}; + +export const depositChannelCreation = new ExecutableTest('Deposit-Channel-Creation', main, 360); diff --git a/bouncer/tsconfig.json b/bouncer/tsconfig.json index 6ca9844538..4b854b2f72 100644 --- a/bouncer/tsconfig.json +++ b/bouncer/tsconfig.json @@ -9,8 +9,9 @@ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, "lib": [ + "ESNext", "ESNext.Disposable", "DOM" ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, diff --git a/engine-runner-bin/tests/command_args.rs b/engine-runner-bin/tests/command_args.rs index ac8ba81a53..0cac33820f 100644 --- a/engine-runner-bin/tests/command_args.rs +++ b/engine-runner-bin/tests/command_args.rs @@ -13,7 +13,7 @@ fn assert_command_arg_for_latest_version(arg: &str) { #[test] fn version_should_return_for_latest_version() { assert_command_arg_for_latest_version("--version"); - assert_command_arg_for_latest_version("-v"); + assert_command_arg_for_latest_version("-V"); } #[test] diff --git a/engine/Cargo.toml b/engine/Cargo.toml index 2a5cc0886b..14187d00fc 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -20,20 +20,20 @@ async-channel = "1.7.1" async-trait = "0.1.49" bincode = "1.3.3" bitcoin = { version = "0.30.0", features = ["serde"] } -chrono = { version = "0.4.21", default_features = false, features = ["clock"] } -clap = { version = "3.2.16", features = ["derive", "env"] } +chrono = { version = "0.4.31", default-features = false, features = ["clock"] } +clap = { version = "4.5.3", features = ["derive", "env"] } config = "0.13.1" fs_extra = "1.2.0" -futures = "0.3.14" +futures = "0.3.30" futures-core = "0.3.14" futures-util = "0.3.14" hex = "0.4.3" httparse = "1.4.1" http = "1.1.0" -itertools = "0.11" +itertools = "0.13" # Same version of jsonrpsee as the substrate version our StateChain is on. -jsonrpsee = { version = "0.16.2", features = ["full"] } +jsonrpsee = { version = "0.23.2", features = ["full"] } dyn-clone = "1.0.4" ethbloom = "0.13" @@ -43,7 +43,7 @@ num-bigint = "0.4" num-derive = "0.4" num-traits = "0.2" secp256k1 = "0.27" -serde = { version = "1.0", features = ["derive", "rc"] } +serde = { version = "1.0.197", features = ["derive", "rc"] } serde_json = "1.0" sha2 = "0.10" subxt = { version = "0.33.0", features = ["substrate-compat"] } @@ -52,10 +52,10 @@ tokio = { version = "1.22", features = ["full", "test-util"] } tokio-stream = { version = "0.1.5", features = ["sync"] } url = "2.4" web3 = { version = "0.19", default-features = false, features = [ - "ws-tls-tokio", + "ws-tls-tokio", ] } zeroize = "1.5.4" -curve25519-dalek = { version = "4.1", features = ["serde"] } +curve25519-dalek = { version = "4.1.3", features = ["serde"] } ed25519-dalek = "2.1.1" pin-project = "1.0.12" rand = "0.8.4" @@ -63,7 +63,7 @@ reqwest = { version = "0.11.4", features = ["rustls-tls"] } tracing = "0.1" x25519-dalek = { version = "2.0", features = ["serde"] } zmq = { git = "https://github.com/chainflip-io/rust-zmq.git", tag = "chainflip-v0.9.2+1", features = [ - "vendored", + "vendored", ] } warp = { version = "0.3.6" } regex = { version = "1" } @@ -95,31 +95,31 @@ pallet-cf-cfe-interface = { path = "../state-chain/pallets/cf-cfe-interface" } state-chain-runtime = { path = "../state-chain/runtime" } utilities = { path = "../utilities" } sol-prim = { path = "../foreign-chains/solana/sol-prim", features = [ - "pda", - "str", - "serde", - "scale", + "pda", + "str", + "serde", + "scale", ] } # substrate deps cf-amm = { path = "../state-chain/amm" } -codec = { package = "parity-scale-codec", version = "3.6.1", features = [ - "derive", - "full", +codec = { package = "parity-scale-codec", version = "3.6.12", features = [ + "derive", + "full", ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sc-transaction-pool-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -scale-info = { version = "2.10.0", features = ["derive"] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sc-transaction-pool-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +scale-info = { version = "2.11.1", features = ["derive"] } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } frame-metadata = { version = "16.0.0", default-features = false, features = [ - "current", + "current", ] } serde_bytes = "0.11.14" bs58 = "0.5.1" @@ -136,18 +136,19 @@ features = ["lz4"] [dev-dependencies] csv = "1.1.6" ethereum = "0.14" -mockall = "0.11.0" +mockall = { version = "0.13.0", features = ["nightly"] } multisig = { path = "multisig", features = ["test"] } rlp = "0.5" tempfile = "3.7.0" utilities = { package = "utilities", path = "../utilities", features = [ - "test-utils", + "test-utils", ] } serde_path_to_error = "*" [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } engine-upgrade-utils = { path = "../engine-upgrade-utils" } [features] integration-test = [] +std = [] diff --git a/engine/generate-genesis-keys/Cargo.toml b/engine/generate-genesis-keys/Cargo.toml index 67ad5e3bbe..bb64b32d0d 100644 --- a/engine/generate-genesis-keys/Cargo.toml +++ b/engine/generate-genesis-keys/Cargo.toml @@ -13,7 +13,7 @@ hex = "0.4.3" bincode = "1.3.3" csv = "1.1.6" serde_json = "1.0" -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0.197", features = ["derive"] } # have to use the older version until secp256k1 updates its dependency (https://github.com/rust-bitcoin/rust-secp256k1/issues/328) rand = "0.8.5" diff --git a/engine/multisig/Cargo.toml b/engine/multisig/Cargo.toml index 0982c8165b..9ea8ccf775 100644 --- a/engine/multisig/Cargo.toml +++ b/engine/multisig/Cargo.toml @@ -18,29 +18,29 @@ async-trait = "0.1.49" async-channel = "1.7.1" async-broadcast = "0.4.1" bincode = "1.3.3" -futures = "0.3.14" +futures = "0.3.30" futures-core = "0.3.14" futures-util = "0.3.14" hex = "0.4.3" -itertools = "0.11" +itertools = "0.13" lazy_static = "1.4" secp256k1 = { version = "0.27", features = [ - "serde", - "rand-std", - "global-context", + "serde", + "rand-std", + "global-context", ] } -serde = { version = "1.0", features = ["derive", "rc"] } +serde = { version = "1.0.197", features = ["derive", "rc"] } sha2 = "0.9.5" thiserror = "1.0.26" tokio = { version = "1.22", features = ["full", "test-util"] } tokio-stream = { version = "0.1.5", features = ["sync"] } num-bigint = "0.4" num-traits = "0.2" -num-derive = "0.3" +num-derive = "0.4.2" zeroize = "1.5.4" generic-array = "1.0" public-ip = "0.2.2" -curve25519-dalek = { version = "4.1", features = ["serde"] } +curve25519-dalek = { version = "4.1.3", features = ["serde"] } typenum = "1.15" schnorrkel = "0.11.4" rayon = "1.7.0" @@ -57,8 +57,8 @@ state-chain-runtime = { path = "../../state-chain/runtime" } utilities = { package = "utilities", path = "../../utilities" } # substrate deps -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } ed25519-dalek = "2.1.1" [dev-dependencies] @@ -66,8 +66,9 @@ mockall = "0.11.0" # Turn on the "test" feature flag for tests multisig = { path = ".", features = ["test"] } utilities = { package = "utilities", path = "../../utilities", features = [ - "test-utils", + "test-utils", ] } [features] test = ['mockall'] +std = [] diff --git a/engine/multisig/src/client/ceremony_manager.rs b/engine/multisig/src/client/ceremony_manager.rs index 3a6c5108f2..2f6d9b1149 100644 --- a/engine/multisig/src/client/ceremony_manager.rs +++ b/engine/multisig/src/client/ceremony_manager.rs @@ -711,7 +711,7 @@ impl CeremonyStates { } /// Process ceremony data arriving from a peer, - fn process_data( + fn process_data( &mut self, sender_id: AccountId, ceremony_id: CeremonyId, @@ -763,7 +763,7 @@ impl CeremonyStates { /// Returns the state for the given ceremony id if it exists, /// otherwise creates a new unauthorized one - fn get_state_or_create_unauthorized( + fn get_state_or_create_unauthorized( &mut self, ceremony_id: CeremonyId, scope: &Scope<'_, anyhow::Error>, @@ -844,7 +844,7 @@ enum CeremonyRequestState { } impl CeremonyHandle { - fn spawn( + fn spawn( ceremony_id: CeremonyId, outcome_sender: UnboundedSender<(CeremonyId, CeremonyOutcome)>, scope: &Scope<'_, anyhow::Error>, diff --git a/engine/multisig/src/client/utils.rs b/engine/multisig/src/client/utils.rs index 8c36276490..ea517046a5 100644 --- a/engine/multisig/src/client/utils.rs +++ b/engine/multisig/src/client/utils.rs @@ -13,7 +13,7 @@ where Iter: Iterator, { iter.sorted_unstable() - .group_by(|x| x.clone()) + .chunk_by(|x| x.clone()) .into_iter() .map(|(_, mut group)| { let first = group.next().expect("must have at least one element"); diff --git a/engine/src/db/persistent/tests.rs b/engine/src/db/persistent/tests.rs index 164b5230e2..9fb79b07f8 100644 --- a/engine/src/db/persistent/tests.rs +++ b/engine/src/db/persistent/tests.rs @@ -92,7 +92,7 @@ fn can_update_key() { let keys_before = p_db.load_keys::(); // there should be no key [0; 33] yet - assert!(keys_before.get(&key_id).is_none()); + assert!(!keys_before.contains_key(&key_id)); p_db.update_key::( &key_id, @@ -100,7 +100,7 @@ fn can_update_key() { ); let keys_before = p_db.load_keys::(); - assert!(keys_before.get(&key_id).is_some()); + assert!(keys_before.contains_key(&key_id)); } fn find_backups(temp_dir: &TempDir, db_path: PathBuf) -> Result, std::io::Error> { @@ -151,7 +151,7 @@ fn can_load_key_from_backup() { let p_db = PersistentKeyDB::open_and_migrate_to_latest(backups.first().unwrap(), None).unwrap(); - assert!(p_db.load_keys::().get(&key_id).is_some()); + assert!(p_db.load_keys::().contains_key(&key_id)); } } diff --git a/engine/src/dot/http_rpc.rs b/engine/src/dot/http_rpc.rs index bbf0adc08a..54985cf1b1 100644 --- a/engine/src/dot/http_rpc.rs +++ b/engine/src/dot/http_rpc.rs @@ -3,7 +3,7 @@ use cf_primitives::PolkadotBlockNumber; use futures_core::Future; use http::uri::Uri; use jsonrpsee::{ - core::{client::ClientT, traits::ToRpcParams, Error as JsonRpseeError}, + core::{client::ClientT, traits::ToRpcParams}, http_client::{HttpClient, HttpClientBuilder}, }; use serde_json::value::RawValue; @@ -41,7 +41,7 @@ impl PolkadotHttpClient { struct Params(Option>); impl ToRpcParams for Params { - fn to_rpc_params(self) -> Result>, JsonRpseeError> { + fn to_rpc_params(self) -> Result>, serde_json::Error> { Ok(self.0) } } diff --git a/engine/src/elections/voter_api.rs b/engine/src/elections/voter_api.rs index f17edbb328..c38a15ada5 100644 --- a/engine/src/elections/voter_api.rs +++ b/engine/src/elections/voter_api.rs @@ -66,4 +66,4 @@ macro_rules! generate_voter_api_tuple_impls { } } -generate_voter_api_tuple_impls!(tuple_5_impls: ((A, A0), (B, B0), (C, C0), (D, D0), (EE, E0))); +generate_voter_api_tuple_impls!(tuple_6_impls: ((A, A0), (B, B0), (C, C0), (D, D0), (EE, E0), (FF, F0))); diff --git a/engine/src/p2p/core/tests.rs b/engine/src/p2p/core/tests.rs index cd8df5ca23..516b581d17 100644 --- a/engine/src/p2p/core/tests.rs +++ b/engine/src/p2p/core/tests.rs @@ -15,7 +15,7 @@ use utilities::{ fn create_node_info(id: AccountId, node_key: &ed25519_dalek::SigningKey, port: Port) -> PeerInfo { use std::net::Ipv4Addr; let ip = "0.0.0.0".parse::().unwrap().to_ipv6_mapped(); - let pubkey = Public(node_key.verifying_key().to_bytes()); + let pubkey = Public::from(node_key.verifying_key().to_bytes()); PeerInfo::new(id, pubkey, ip, port) } diff --git a/engine/src/p2p/peer_info_submitter.rs b/engine/src/p2p/peer_info_submitter.rs index 1e0b3863ac..0524f54f0e 100644 --- a/engine/src/p2p/peer_info_submitter.rs +++ b/engine/src/p2p/peer_info_submitter.rs @@ -30,7 +30,7 @@ async fn update_registered_peer_id( where StateChainClient: SignedExtrinsicApi, { - let peer_id = sp_core::ed25519::Public(p2p_key.signing_key.verifying_key().to_bytes()); + let peer_id = sp_core::ed25519::Public::from(p2p_key.signing_key.verifying_key().to_bytes()); let signature = { use ed25519_dalek::Signer; @@ -44,7 +44,7 @@ where port: cfe_port, ip_address: ip_address.into(), // We sign over our account id - signature: sp_core::ed25519::Signature(signature.to_bytes()), + signature: sp_core::ed25519::Signature::from(signature.to_bytes()), }) .await .until_finalized() diff --git a/engine/src/retrier.rs b/engine/src/retrier.rs index d9287fc5d4..e11dcb20fe 100644 --- a/engine/src/retrier.rs +++ b/engine/src/retrier.rs @@ -959,7 +959,7 @@ mod tests { task_scope(|scope| { async move { - const INITIAL_TIMEOUT: Duration = Duration::from_millis(100); + const INITIAL_TIMEOUT: Duration = Duration::from_millis(300); let retrier_client = RetrierClient::new( scope, diff --git a/engine/src/settings.rs b/engine/src/settings.rs index 5a927a1c58..e547aa8f48 100644 --- a/engine/src/settings.rs +++ b/engine/src/settings.rs @@ -270,7 +270,7 @@ pub struct SolOptions { #[derive(Parser, Debug, Clone, Default)] pub struct P2POptions { - #[clap(long = "p2p.node_key_file", parse(from_os_str))] + #[clap(long = "p2p.node_key_file")] node_key_file: Option, #[clap(long = "p2p.ip_address")] ip_address: Option, @@ -281,7 +281,7 @@ pub struct P2POptions { } #[derive(Parser, Debug, Clone)] -#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), version_short = 'v')] +#[clap(version = env!("SUBSTRATE_CLI_IMPL_VERSION"), before_help = format!("chainflip-engine {}", env!("SUBSTRATE_CLI_IMPL_VERSION")))] pub struct CommandLineOptions { // Misc Options #[clap(short = 'c', long = "config-root", env = CONFIG_ROOT, default_value = DEFAULT_CONFIG_ROOT)] @@ -321,7 +321,7 @@ pub struct CommandLineOptions { pub prometheus_port: Option, // Signing Settings - #[clap(long = "signing.db_file", parse(from_os_str))] + #[clap(long = "signing.db_file")] pub signing_db_file: Option, // Logging settings diff --git a/engine/src/sol/commitment_config.rs b/engine/src/sol/commitment_config.rs index b05e91bccb..29d4cce131 100644 --- a/engine/src/sol/commitment_config.rs +++ b/engine/src/sol/commitment_config.rs @@ -127,8 +127,8 @@ pub enum CommitmentLevel { /// This differs from `single` in that: /// 1) It incorporates votes from gossip and replay. /// 2) It does not count votes on descendants of a block, only direct votes on that block. - /// 3) This confirmation level also upholds "optimistic confirmation" guarantees in - /// release 1.3 and onwards. + /// 3) This confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 + /// and onwards. #[deprecated(since = "1.5.5", note = "Please use CommitmentLevel::Confirmed instead")] SingleGossip, diff --git a/engine/src/state_chain_observer/client/base_rpc_api.rs b/engine/src/state_chain_observer/client/base_rpc_api.rs index ebd63785be..8cd1f686f3 100644 --- a/engine/src/state_chain_observer/client/base_rpc_api.rs +++ b/engine/src/state_chain_observer/client/base_rpc_api.rs @@ -13,7 +13,7 @@ use sp_version::RuntimeVersion; use state_chain_runtime::SignedBlock; use codec::Encode; -use custom_rpc::CustomApiClient; +use custom_rpc::{to_rpc_error, CustomApiClient}; use sc_rpc_api::{ author::AuthorApiClient, chain::ChainApiClient, @@ -183,28 +183,34 @@ fn unwrap_value(list_or_value: sp_rpc::list::ListOrValue) -> T { #[async_trait] impl BaseRpcApi for BaseRpcClient { async fn health(&self) -> RpcResult { - self.raw_rpc_client.system_health().await + self.raw_rpc_client.system_health().await.map_err(to_rpc_error) } async fn next_account_nonce( &self, account_id: state_chain_runtime::AccountId, ) -> RpcResult { - self.raw_rpc_client.nonce(account_id).await + self.raw_rpc_client.nonce(account_id).await.map_err(to_rpc_error) } async fn submit_extrinsic( &self, extrinsic: state_chain_runtime::UncheckedExtrinsic, ) -> RpcResult { - self.raw_rpc_client.submit_extrinsic(Bytes::from(extrinsic.encode())).await + self.raw_rpc_client + .submit_extrinsic(Bytes::from(extrinsic.encode())) + .await + .map_err(to_rpc_error) } async fn submit_and_watch_extrinsic( &self, extrinsic: state_chain_runtime::UncheckedExtrinsic, ) -> RpcResult>> { - self.raw_rpc_client.watch_extrinsic(Bytes::from(extrinsic.encode())).await + self.raw_rpc_client + .watch_extrinsic(Bytes::from(extrinsic.encode())) + .await + .map_err(to_rpc_error) } async fn storage( @@ -212,7 +218,10 @@ impl BaseRpcApi for BaseRpcClient RpcResult> { - self.raw_rpc_client.storage(storage_key, Some(block_hash)).await + self.raw_rpc_client + .storage(storage_key, Some(block_hash)) + .await + .map_err(to_rpc_error) } async fn storage_pairs( @@ -220,11 +229,14 @@ impl BaseRpcApi for BaseRpcClient RpcResult> { - self.raw_rpc_client.storage_pairs(storage_key, Some(block_hash)).await + self.raw_rpc_client + .storage_pairs(storage_key, Some(block_hash)) + .await + .map_err(to_rpc_error) } async fn block(&self, block_hash: state_chain_runtime::Hash) -> RpcResult> { - self.raw_rpc_client.block(Some(block_hash)).await + self.raw_rpc_client.block(Some(block_hash)).await.map_err(to_rpc_error) } async fn block_hash( @@ -234,7 +246,8 @@ impl BaseRpcApi for BaseRpcClient BaseRpcApi for BaseRpcClient RpcResult { - Ok(self.raw_rpc_client.header(Some(block_hash)).await?.expect(SUBSTRATE_BEHAVIOUR)) + Ok(self + .raw_rpc_client + .header(Some(block_hash)) + .await + .map_err(to_rpc_error)? + .expect(SUBSTRATE_BEHAVIOUR)) } async fn latest_unfinalized_block_hash(&self) -> RpcResult { - Ok(unwrap_value(self.raw_rpc_client.block_hash(None).await?).expect(SUBSTRATE_BEHAVIOUR)) + Ok(unwrap_value(self.raw_rpc_client.block_hash(None).await.map_err(to_rpc_error)?) + .expect(SUBSTRATE_BEHAVIOUR)) } async fn latest_finalized_block_hash(&self) -> RpcResult { - self.raw_rpc_client.finalized_head().await + self.raw_rpc_client.finalized_head().await.map_err(to_rpc_error) } async fn subscribe_finalized_block_headers( &self, ) -> RpcResult> { - self.raw_rpc_client.subscribe_finalized_heads().await + self.raw_rpc_client.subscribe_finalized_heads().await.map_err(to_rpc_error) } async fn subscribe_unfinalized_block_headers( &self, ) -> RpcResult> { - self.raw_rpc_client.subscribe_new_heads().await + self.raw_rpc_client.subscribe_new_heads().await.map_err(to_rpc_error) } async fn runtime_version( &self, at: Option, ) -> RpcResult { - self.raw_rpc_client.runtime_version(at).await + self.raw_rpc_client.runtime_version(at).await.map_err(to_rpc_error) } async fn dry_run( @@ -277,7 +296,10 @@ impl BaseRpcApi for BaseRpcClient RpcResult { - self.raw_rpc_client.dry_run(extrinsic, Some(block_hash)).await + self.raw_rpc_client + .dry_run(extrinsic, Some(block_hash)) + .await + .map_err(to_rpc_error) } async fn request_raw( @@ -285,7 +307,7 @@ impl BaseRpcApi for BaseRpcClient>, ) -> RpcResult> { - self.raw_rpc_client.request(method, Params(params)).await + self.raw_rpc_client.request(method, Params(params)).await.map_err(to_rpc_error) } async fn subscribe_raw( @@ -294,14 +316,17 @@ impl BaseRpcApi for BaseRpcClient>, unsub: &str, ) -> RpcResult>> { - self.raw_rpc_client.subscribe(sub, Params(params), unsub).await + self.raw_rpc_client + .subscribe(sub, Params(params), unsub) + .await + .map_err(to_rpc_error) } } struct Params(Option>); impl jsonrpsee::core::traits::ToRpcParams for Params { - fn to_rpc_params(self) -> RpcResult>> { + fn to_rpc_params(self) -> Result>, serde_json::Error> { Ok(self.0) } } diff --git a/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher.rs b/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher.rs index 91621a09ed..83c08206ca 100644 --- a/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher.rs +++ b/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher.rs @@ -31,6 +31,7 @@ use crate::state_chain_observer::client::{ storage_api::{CheckBlockCompatibility, StorageApi}, SUBSTRATE_BEHAVIOUR, }; +use jsonrpsee::types::ErrorObjectOwned; use super::signer; @@ -50,7 +51,7 @@ pub enum ExtrinsicError { #[derive(Error, Debug)] pub enum DryRunError { #[error(transparent)] - RpcCallError(#[from] jsonrpsee::core::Error), + RpcCallError(#[from] ErrorObjectOwned), #[error("Unable to decode dry_run RPC result: {0}")] CannotDecodeReply(#[from] codec::Error), #[error("The transaction is invalid: {0}")] @@ -239,23 +240,17 @@ impl<'a, 'env, BaseRpcClient: base_rpc_api::BaseRpcApi + Send + Sync + 'static> // This occurs when a transaction with the same nonce is in the // transaction pool (and the priority is <= priority of that // existing tx) - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj.code() == 1014 => { + obj if obj.code() == 1014 => { debug!(target: "state_chain_client", request_id = request.id, "Submission failed as transaction with same nonce found in transaction pool: {obj:?}"); break Ok(Err(SubmissionLogicError::NonceTooLow)) }, // This occurs when the nonce has already been *consumed* i.e a // transaction with that nonce is in a block - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj == &invalid_err_obj(InvalidTransaction::Stale) => { + obj if obj == invalid_err_obj(InvalidTransaction::Stale) => { debug!(target: "state_chain_client", request_id = request.id, "Submission failed as the transaction is stale: {obj:?}"); break Ok(Err(SubmissionLogicError::NonceTooLow)) }, - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj == &invalid_err_obj(InvalidTransaction::BadProof) => { + obj if obj == invalid_err_obj(InvalidTransaction::BadProof) => { warn!(target: "state_chain_client", request_id = request.id, "Submission failed due to a bad proof: {obj:?}. Refetching the runtime version."); // TODO: Check if hash and block number should also be updated @@ -271,7 +266,7 @@ impl<'a, 'env, BaseRpcClient: base_rpc_api::BaseRpcApi + Send + Sync + 'static> self.runtime_version = new_runtime_version; }, - err => break Err(err.into()), + obj => break Err(obj.into()), } }, } @@ -522,7 +517,7 @@ impl<'a, 'env, BaseRpcClient: base_rpc_api::BaseRpcApi + Send + Sync + 'static> _ => None, }) .sorted_by_key(|(extrinsic_index, _)| *extrinsic_index) - .group_by(|(extrinsic_index, _)| *extrinsic_index) + .chunk_by(|(extrinsic_index, _)| *extrinsic_index) .into_iter() .map(|(extrinsic_index, extrinsic_events)| { (extrinsic_index, extrinsic_events.map(|(_extrinsics_index, event)| event)) diff --git a/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher/tests.rs b/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher/tests.rs index f21454c3ca..1e4b11d291 100644 --- a/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher/tests.rs +++ b/engine/src/state_chain_observer/client/extrinsic_api/signed/submission_watcher/tests.rs @@ -1,120 +1,127 @@ -use cf_chains::{dot, ChainState}; -use futures_util::FutureExt; -use jsonrpsee::core::client::{Subscription, SubscriptionKind}; -use utilities::task_scope::task_scope; - -use crate::{ - constants::SIGNED_EXTRINSIC_LIFETIME, - state_chain_observer::client::base_rpc_api::MockBaseRpcApi, -}; - -use super::*; - -const INITIAL_NONCE: state_chain_runtime::Nonce = 10; - -/// If the tx fails due to a bad proof, it should fetch the runtime version and retry. -#[tokio::test] -async fn should_update_version_on_bad_proof() { - task_scope(|scope| { - async { - let mut mock_rpc_api = MockBaseRpcApi::new(); - - mock_rpc_api.expect_next_account_nonce().return_once(move |_| Ok(1)); - mock_rpc_api.expect_submit_and_watch_extrinsic().times(1).returning(move |_| { - Err(jsonrpsee::core::Error::Call(jsonrpsee::types::error::CallError::Custom( - jsonrpsee::types::ErrorObject::owned( - 1010, - "Invalid Transaction", - Some("Transaction has a bad signature"), - ), - ))) - }); - - mock_rpc_api.expect_runtime_version().times(1).returning(move |_| { - let new_runtime_version = sp_version::RuntimeVersion { - spec_name: "test".into(), - impl_name: "test".into(), - authoring_version: 0, - spec_version: 0, - impl_version: 0, - apis: vec![].into(), - transaction_version: 0, - state_version: 0, - }; - assert_ne!( - new_runtime_version, - Default::default(), - "The new runtime version must be different from the version that the watcher started with" - ); - - Ok(new_runtime_version) - }); - - // On the retry, return a success. - mock_rpc_api.expect_next_account_nonce().return_once(move |_| Ok(1)); - mock_rpc_api.expect_submit_and_watch_extrinsic().return_once(move |_| { - Ok(Subscription::new( - futures::channel::mpsc::channel(1).0, - futures::channel::mpsc::channel(1).1, - SubscriptionKind::Subscription(jsonrpsee::types::SubscriptionId::Num(0)), - )) - }); - - let _watcher = new_watcher_and_submit_test_extrinsic(scope, mock_rpc_api).await; - - Ok(()) - } - .boxed() - }) - .await - .unwrap(); -} - -/// Create a new watcher and submit a dummy extrinsic. -async fn new_watcher_and_submit_test_extrinsic<'a, 'env>( - scope: &'a Scope<'env, anyhow::Error>, - mock_rpc_api: MockBaseRpcApi, -) -> SubmissionWatcher<'a, 'env, MockBaseRpcApi> { - let (mut watcher, _requests) = SubmissionWatcher::new( - scope, - signer::PairSigner::new(sp_core::Pair::generate().0), - INITIAL_NONCE, - H256::default(), - 0, - Default::default(), - H256::default(), - SIGNED_EXTRINSIC_LIFETIME, - Arc::new(mock_rpc_api), - ); - - // Just some dummy call to test with - let call = - state_chain_runtime::RuntimeCall::Witnesser(pallet_cf_witnesser::Call::witness_at_epoch { - call: Box::new(state_chain_runtime::RuntimeCall::PolkadotChainTracking( - pallet_cf_chain_tracking::Call::update_chain_state { - new_chain_state: ChainState { - block_height: 0, - tracked_data: dot::PolkadotTrackedData { - median_tip: 0, - runtime_version: Default::default(), - }, - }, - }, - )), - epoch_index: 0, - }); - let mut request = Request { - id: 0, - next_submission_id: 0, - pending_submissions: Default::default(), - strictly_one_submission: false, - resubmit_window: ..=1, - call, - until_in_block_sender: Some(oneshot::channel().0), - until_finalized_sender: oneshot::channel().0, - }; - - let _result = watcher.submit_extrinsic(&mut request).await; - - watcher -} +// TODO: In the latest jsonrpsee, Subscription::new is now private. This makes mocking +// harder to do. Also this is possibly the reason Mockall fails to create mocks +// because some internal types no longer support "Default" impl. +// We need to either re-think about this test, or use a different Mock mechanism to test this. + +// use base_rpc_api::BaseRpcClient; +// use cf_chains::{dot, ChainState}; +// use futures_util::FutureExt; +// use jsonrpsee::{ +// core::client::{Subscription, SubscriptionKind}, +// types::ErrorObject, +// }; +// use utilities::task_scope::task_scope; + +// use crate::{ +// constants::SIGNED_EXTRINSIC_LIFETIME, +// state_chain_observer::client::base_rpc_api::MockBaseRpcApi, +// }; + +// use super::*; + +// const INITIAL_NONCE: state_chain_runtime::Nonce = 10; + +// /// If the tx fails due to a bad proof, it should fetch the runtime version and retry. +// #[tokio::test] +// async fn should_update_version_on_bad_proof() { +// task_scope(|scope| { +// async { +// let mut mock_rpc_api = MockBaseRpcApi::new(); + +// mock_rpc_api.expect_next_account_nonce().return_once(move |_| Ok(1)); +// mock_rpc_api.expect_submit_and_watch_extrinsic().times(1).returning(move |_| { +// Err(ErrorObject::owned( +// 1010, +// "Invalid Transaction", +// Some("Transaction has a bad signature"), +// )) +// }); + +// mock_rpc_api.expect_runtime_version().times(1).returning(move |_| { +// let new_runtime_version = sp_version::RuntimeVersion { +// spec_name: "test".into(), +// impl_name: "test".into(), +// authoring_version: 0, +// spec_version: 0, +// impl_version: 0, +// apis: vec![].into(), +// transaction_version: 0, +// state_version: 0, +// }; +// assert_ne!( +// new_runtime_version, +// Default::default(), +// "The new runtime version must be different from the version that the watcher started with" +// ); + +// Ok(new_runtime_version) +// }); + +// // On the retry, return a success. +// mock_rpc_api.expect_next_account_nonce().return_once(move |_| Ok(1)); + +// expect_submit_and_watch_extrinsic().return_once(move |_| { Ok(Subscription::new( +// futures::channel::mpsc::channel(1).0, +// futures::channel::mpsc::channel(1).1, +// SubscriptionKind::Subscription(jsonrpsee::types::SubscriptionId::Num(0)), +// )) +// }); + +// let _watcher = new_watcher_and_submit_test_extrinsic(scope, mock_rpc_api).await; + +// Ok(()) +// } +// .boxed() +// }) +// .await +// .unwrap(); +// } + +// /// Create a new watcher and submit a dummy extrinsic. +// async fn new_watcher_and_submit_test_extrinsic<'a, 'env>( +// scope: &'a Scope<'env, anyhow::Error>, +// mock_rpc_api: MockBaseRpcApi, +// ) -> SubmissionWatcher<'a, 'env, MockBaseRpcApi> { +// let (mut watcher, _requests) = SubmissionWatcher::new( +// scope, +// signer::PairSigner::new(sp_core::Pair::generate().0), +// INITIAL_NONCE, +// H256::default(), +// 0, +// Default::default(), +// H256::default(), +// SIGNED_EXTRINSIC_LIFETIME, +// Arc::new(mock_rpc_api), +// ); + +// // Just some dummy call to test with +// let call = +// state_chain_runtime::RuntimeCall::Witnesser(pallet_cf_witnesser::Call::witness_at_epoch { +// call: Box::new(state_chain_runtime::RuntimeCall::PolkadotChainTracking( +// pallet_cf_chain_tracking::Call::update_chain_state { +// new_chain_state: ChainState { +// block_height: 0, +// tracked_data: dot::PolkadotTrackedData { +// median_tip: 0, +// runtime_version: Default::default(), +// }, +// }, +// }, +// )), +// epoch_index: 0, +// }); +// let mut request = Request { +// id: 0, +// next_submission_id: 0, +// pending_submissions: Default::default(), +// strictly_one_submission: false, +// resubmit_window: ..=1, +// call, +// until_in_block_sender: Some(oneshot::channel().0), +// until_finalized_sender: oneshot::channel().0, +// }; + +// let _result = watcher.submit_extrinsic(&mut request).await; + +// watcher +// } diff --git a/engine/src/state_chain_observer/client/extrinsic_api/unsigned.rs b/engine/src/state_chain_observer/client/extrinsic_api/unsigned.rs index 933a1b11e9..1171bce173 100644 --- a/engine/src/state_chain_observer/client/extrinsic_api/unsigned.rs +++ b/engine/src/state_chain_observer/client/extrinsic_api/unsigned.rs @@ -69,9 +69,7 @@ impl UnsignedExtrinsicClient { // that this particular extrinsic has already been // submitted. And so we can ignore the error and return // the transaction hash - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj.code() == 1013 => { + obj if obj.code() == 1013 => { tracing::debug!( "Already in pool with tx_hash: {expected_hash:#x}." ); @@ -81,21 +79,17 @@ impl UnsignedExtrinsicClient { // believe it has a similiar meaning to POOL_ALREADY_IMPORTED, // but we don't know. We believe there maybe cases where we need // to resubmit if this error occurs. - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj.code() == 1012 => { + obj if obj.code() == 1012 => { tracing::debug!( "Transaction is temporarily banned with tx_hash: {expected_hash:#x}." ); Ok(expected_hash) }, - jsonrpsee::core::Error::Call( - jsonrpsee::types::error::CallError::Custom(ref obj), - ) if obj == &invalid_err_obj(InvalidTransaction::Stale) => { + obj if obj == invalid_err_obj(InvalidTransaction::Stale) => { tracing::debug!("Submission failed as the transaction is stale: {obj:?}"); Err(ExtrinsicError::Stale) }, - _ => return Err(rpc_err.into()), + obj => return Err(obj.into()), } }, } diff --git a/engine/src/witness/btc.rs b/engine/src/witness/btc.rs index 9df5799190..b78a3cfca6 100644 --- a/engine/src/witness/btc.rs +++ b/engine/src/witness/btc.rs @@ -1,5 +1,6 @@ mod chain_tracking; mod deposits; +mod smart_contract; pub mod source; use crate::{ diff --git a/engine/src/witness/btc/deposits.rs b/engine/src/witness/btc/deposits.rs index 5e05148082..02d42d2f0b 100644 --- a/engine/src/witness/btc/deposits.rs +++ b/engine/src/witness/btc/deposits.rs @@ -100,7 +100,7 @@ fn deposit_witnesses( }) }) .sorted_by_key(|deposit_witness| deposit_witness.deposit_address.clone()) - .group_by(|deposit_witness| deposit_witness.deposit_address.clone()) + .chunk_by(|deposit_witness| deposit_witness.deposit_address.clone()) .into_iter() .map(|(_deposit_address, deposit_witnesses)| { // We only take the largest output of a tx as a deposit witness. This is to diff --git a/engine/src/witness/btc/smart_contract.rs b/engine/src/witness/btc/smart_contract.rs new file mode 100644 index 0000000000..76f2ddf387 --- /dev/null +++ b/engine/src/witness/btc/smart_contract.rs @@ -0,0 +1,300 @@ +use bitcoin::{opcodes::all::OP_RETURN, ScriptBuf}; +use cf_amm::common::{bounded_sqrt_price, sqrt_price_to_price}; +use cf_chains::{ + address::EncodedAddress, + btc::{smart_contract_encoding::UtxoEncodedData, ScriptPubkey}, +}; +use cf_primitives::{Asset, AssetAmount, Price}; +use codec::Decode; +use itertools::Itertools; +use utilities::SliceToArray; + +use crate::btc::rpc::VerboseTransaction; + +const OP_PUSHBYTES_75: u8 = 0x4b; +const OP_PUSHDATA1: u8 = 0x4c; + +#[derive(PartialEq, Debug)] +pub struct BtcContractCall { + output_asset: Asset, + deposit_amount: AssetAmount, + output_address: EncodedAddress, + // --- FoK --- + retry_duration: u16, + refund_address: ScriptPubkey, + min_price: Price, + // --- DCA --- + number_of_chunks: u16, + chunk_interval: u16, + // --- Boost --- + boost_fee: u8, +} + +fn try_extract_utxo_encoded_data(script: &bitcoin::ScriptBuf) -> Option<&[u8]> { + let bytes = script.as_script().as_bytes(); + + if bytes.len() < 2 { + return None; + } + + // First opcode must be OP_RETURN + if bytes[0] != OP_RETURN.to_u8() { + return None; + } + + // Second opcode must be either OP_PUSHBYTES_X (1..=75) or OP_PUSHDATA1 (76): + let (data_len, data_bytes) = match bytes[1] { + // Opcode encodes the length directly + data_len @ 1..=OP_PUSHBYTES_75 => (data_len, &bytes[2..]), + // The length is encoded in the following byte: + OP_PUSHDATA1 => (bytes[2], &bytes[3..]), + _ => { + return None; + }, + }; + + // Sanity check: + if data_bytes.len() != data_len as usize { + return None; + } + + Some(data_bytes) +} + +fn script_buf_to_script_pubkey(script: &ScriptBuf) -> Option { + fn data_from_script(script: &ScriptBuf, bytes_to_skip: usize) -> [u8; LEN] { + script.bytes().skip(bytes_to_skip).take(LEN).collect_vec().as_array() + } + + let pubkey = if script.is_p2pkh() { + ScriptPubkey::P2PKH(data_from_script(script, 3)) + } else if script.is_p2sh() { + ScriptPubkey::P2SH(data_from_script(script, 2)) + } else if script.is_v1_p2tr() { + ScriptPubkey::Taproot(data_from_script(script, 2)) + } else if script.is_v0_p2wsh() { + ScriptPubkey::P2WSH(data_from_script(script, 2)) + } else if script.is_v0_p2wpkh() { + ScriptPubkey::P2WPKH(data_from_script(script, 2)) + } else { + ScriptPubkey::OtherSegwit { + version: script.witness_version()?.to_num(), + program: script.bytes().skip(2).collect_vec().try_into().ok()?, + } + }; + + Some(pubkey) +} + +// Currently unused, but will be used by the deposit wintesser: +#[allow(dead_code)] +pub fn try_extract_contract_call( + tx: &VerboseTransaction, + vault_address: ScriptPubkey, +) -> Option { + // A correctly constructed transaction carrying CF swap parameters must have at least 3 outputs: + let [utxo_to_vault, nulldata_utxo, change_utxo, ..] = &tx.vout[..] else { + return None; + }; + + // First output must be a deposit into our vault: + if utxo_to_vault.script_pubkey.as_bytes() != vault_address.bytes() { + return None; + } + + // Second output must be a nulldata UTXO (with 0 amount): + if nulldata_utxo.value.to_sat() != 0 { + tracing::warn!( + "Observed a tx into our vault's change address, but the value of the second UTXO is non-zero (tx_hash: {})", + tx.hash + ); + return None; + } + + let mut data = try_extract_utxo_encoded_data(&nulldata_utxo.script_pubkey)?; + + let Ok(data) = UtxoEncodedData::decode(&mut data) else { + tracing::warn!( + "Failed to decode UTXO encoded data targeting our vault (tx_hash: {})", + tx.hash + ); + return None; + }; + + // Third output must be a "change utxo" whose address we assume to also be the refund address: + let Some(refund_address) = script_buf_to_script_pubkey(&change_utxo.script_pubkey) else { + tracing::error!("Failed to extract refund address (tx_hash: {})", tx.hash); + return None; + }; + + let deposit_amount = utxo_to_vault.value.to_sat(); + + // Derive min price (encoded as min output amount to save space): + let min_price = sqrt_price_to_price(bounded_sqrt_price( + data.parameters.min_output_amount.into(), + deposit_amount.into(), + )); + + Some(BtcContractCall { + output_asset: data.output_asset, + deposit_amount: deposit_amount as AssetAmount, + output_address: data.output_address, + retry_duration: data.parameters.retry_duration, + refund_address, + min_price, + number_of_chunks: data.parameters.number_of_chunks, + chunk_interval: data.parameters.chunk_interval, + boost_fee: data.parameters.boost_fee, + }) +} + +#[cfg(test)] +mod tests { + + use bitcoin::{ + address::WitnessProgram, key::TweakedPublicKey, PubkeyHash, ScriptHash, WPubkeyHash, + WScriptHash, + }; + use cf_chains::address::EncodedAddress; + use secp256k1::{hashes::Hash, XOnlyPublicKey}; + use sp_core::bounded_vec; + + use crate::{btc::rpc::VerboseTxOut, witness::btc::deposits::tests::fake_transaction}; + + use super::*; + + use cf_chains::btc::smart_contract_encoding::*; + + const MOCK_DOT_ADDRESS: [u8; 32] = [9u8; 32]; + + const MOCK_SWAP_PARAMS: UtxoEncodedData = UtxoEncodedData { + output_asset: Asset::Dot, + output_address: EncodedAddress::Dot(MOCK_DOT_ADDRESS), + parameters: SharedCfParameters { + retry_duration: 5, + min_output_amount: u128::MAX, + number_of_chunks: 0x0ffff, + chunk_interval: 2, + boost_fee: 5, + }, + }; + + #[test] + fn script_buf_to_script_pubkey_conversion() { + // Check that we can convert from all types of bitcoin addresses: + for (script_buf, script_pubkey) in [ + ( + ScriptBuf::new_p2pkh(&PubkeyHash::from_byte_array([7; 20])), + ScriptPubkey::P2PKH([7; 20]), + ), + ( + ScriptBuf::new_p2sh(&ScriptHash::from_byte_array([7; 20])), + ScriptPubkey::P2SH([7; 20]), + ), + ( + ScriptBuf::new_v1_p2tr_tweaked(TweakedPublicKey::dangerous_assume_tweaked( + XOnlyPublicKey::from_slice(&[7; 32]).unwrap(), + )), + ScriptPubkey::Taproot([7; 32]), + ), + ( + ScriptBuf::new_v0_p2wsh(&WScriptHash::from_byte_array([7; 32])), + ScriptPubkey::P2WSH([7; 32]), + ), + ( + ScriptBuf::new_v0_p2wpkh(&WPubkeyHash::from_byte_array([7; 20])), + ScriptPubkey::P2WPKH([7; 20]), + ), + ( + ScriptBuf::new_witness_program( + &WitnessProgram::new(bitcoin::address::WitnessVersion::V2, [7; 40]).unwrap(), + ), + ScriptPubkey::OtherSegwit { version: 2, program: bounded_vec![7; 40] }, + ), + ] { + assert_eq!(script_buf_to_script_pubkey(&script_buf), Some(script_pubkey)); + } + } + + #[test] + fn test_extract_contract_call_from_tx() { + use bitcoin::Amount; + + const VAULT_PK_HASH: [u8; 20] = [7; 20]; + const REFUND_PK_HASH: [u8; 20] = [8; 20]; + + // Addresses represented in both `ScriptPubkey` and `ScriptBuf` to satisfy interfaces: + let vault_pubkey = ScriptPubkey::P2PKH(VAULT_PK_HASH); + let vault_script = ScriptBuf::new_p2pkh(&PubkeyHash::from_byte_array(VAULT_PK_HASH)); + assert_eq!(vault_pubkey.bytes(), vault_script.to_bytes()); + + let refund_pubkey = ScriptPubkey::P2PKH(REFUND_PK_HASH); + let refund_script = ScriptBuf::new_p2pkh(&PubkeyHash::from_byte_array(REFUND_PK_HASH)); + assert_eq!(refund_pubkey.bytes(), refund_script.to_bytes()); + + let tx = fake_transaction( + vec![ + // A UTXO spending into our vault; + VerboseTxOut { + value: Amount::from_sat(1000), + n: 0, + script_pubkey: vault_script.clone(), + }, + // A nulddata UTXO encoding some swap parameters: + VerboseTxOut { + value: Amount::from_sat(0), + n: 1, + script_pubkey: ScriptBuf::from_bytes( + encode_swap_params_in_nulldata_utxo(MOCK_SWAP_PARAMS.clone()).raw(), + ), + }, + // A UTXO containing refund address: + VerboseTxOut { + value: Amount::from_sat(0), + n: 2, + script_pubkey: refund_script.clone(), + }, + ], + None, + ); + + assert_eq!( + try_extract_contract_call(&tx, vault_pubkey).unwrap(), + BtcContractCall { + output_asset: MOCK_SWAP_PARAMS.output_asset, + deposit_amount: 1000, + output_address: MOCK_SWAP_PARAMS.output_address.clone(), + retry_duration: MOCK_SWAP_PARAMS.parameters.retry_duration, + refund_address: refund_pubkey, + min_price: sqrt_price_to_price(bounded_sqrt_price( + MOCK_SWAP_PARAMS.parameters.min_output_amount.into(), + 1000.into(), + )), + number_of_chunks: MOCK_SWAP_PARAMS.parameters.number_of_chunks, + chunk_interval: MOCK_SWAP_PARAMS.parameters.chunk_interval, + boost_fee: MOCK_SWAP_PARAMS.parameters.boost_fee, + } + ); + } + + #[test] + fn extract_nulldata_utxo() { + for data in [vec![0x3u8; 1_usize], vec![0x3u8; 75_usize], vec![0x3u8; 80_usize]] { + let script_buf = + ScriptBuf::from_bytes(encode_data_in_nulldata_utxo(&data).unwrap().raw()); + + assert_eq!(try_extract_utxo_encoded_data(&script_buf), Some(&data[..])); + } + + // Some degenerate cases: + for data in [ + vec![], // too few bytes + vec![OP_RETURN.to_u8()], // too few bytes + vec![OP_RETURN.to_u8(), OP_PUSHBYTES_75], // no bytes follow "pushbytes" + ] { + let script_buf = ScriptBuf::from_bytes(data); + + assert_eq!(try_extract_utxo_encoded_data(&script_buf), None); + } + } +} diff --git a/engine/src/witness/common/chunked_chain_source/chunked_by_vault/continuous.rs b/engine/src/witness/common/chunked_chain_source/chunked_by_vault/continuous.rs index 4c3528cf47..55749ed26a 100644 --- a/engine/src/witness/common/chunked_chain_source/chunked_by_vault/continuous.rs +++ b/engine/src/witness/common/chunked_chain_source/chunked_by_vault/continuous.rs @@ -108,19 +108,18 @@ where // Note if the processed indices loaded from the database are not aligned to the `witness_period`, we will skip blocks. // For example: If the `witness_period` is 5, and the database states 0..3 are witnessed. Then blocks 3..5 will not be // witnessed as we cannot partially witness a `witness_period`, but we will witness 5..10 etc. - - for unprocessed_root in itertools::unfold( - if processed_indices.is_empty() { - Some(epoch.info.1) - } else if let Some(next_unprocessed) = ::checked_block_witness_next(processed_indices.iter(true).last().unwrap()) { - Some(std::cmp::max(next_unprocessed, epoch.info.1)) - } else { - None - }, - |optional_next_unprocessed_root| { + let mut optional_next_unprocessed_root = if processed_indices.is_empty() { + Some(epoch.info.1) + } else if let Some(next_unprocessed) = ::checked_block_witness_next(processed_indices.iter(true).last().unwrap()) { + Some(std::cmp::max(next_unprocessed, epoch.info.1)) + } else { + None + }; + for unprocessed_root in std::iter::from_fn( + move || { if let Some(next_unprocessed_root) = optional_next_unprocessed_root.as_mut().filter(|next_unprocessed_root| **next_unprocessed_root < header.index) { let next_unprocessed_root = *next_unprocessed_root; - *optional_next_unprocessed_root = ::checked_block_witness_next(next_unprocessed_root); + optional_next_unprocessed_root = ::checked_block_witness_next(next_unprocessed_root); Some(next_unprocessed_root) } else { None diff --git a/engine/src/witness/common/chunked_chain_source/chunked_by_vault/monitored_items.rs b/engine/src/witness/common/chunked_chain_source/chunked_by_vault/monitored_items.rs index 4980d15ead..658a34e81b 100644 --- a/engine/src/witness/common/chunked_chain_source/chunked_by_vault/monitored_items.rs +++ b/engine/src/witness/common/chunked_chain_source/chunked_by_vault/monitored_items.rs @@ -43,6 +43,7 @@ fn is_header_ready( /// the same SC block 50. /// - The SC progresses to block 51, revealing that an address is to be witnessed. /// - There is a deposit at block 10 of X, which CFE B witnesses, but CFE A does not. +/// /// If CFE A does not wait until the block is ready to process it can miss witnesses and be out /// of sync with the other CFEs. #[derive(Clone)] diff --git a/engine/src/witness/evm/evm_deposits.rs b/engine/src/witness/evm/evm_deposits.rs index 3a8c62a15f..bd23a763bd 100644 --- a/engine/src/witness/evm/evm_deposits.rs +++ b/engine/src/witness/evm/evm_deposits.rs @@ -37,6 +37,7 @@ impl ChunkedByVaultBuilder { /// - A standard ETH transfer /// - A transfer made via a contract, which would not be detected by checking the `to` field in /// standard transfers since the `to` field would not be set + /// /// We do *not* officially support ETH deposited using Ethereum/Solidity's self-destruct. /// See [below](`eth_ingresses_at_block`) for more details. pub async fn ethereum_deposits( @@ -222,7 +223,7 @@ fn eth_ingresses_at_block for SolanaEgressWitnessingVoter { } } +#[derive(Clone)] +struct SolanaLivenessVoter { + client: SolRetryRpcClient, +} + +#[async_trait::async_trait] +impl VoterApi for SolanaLivenessVoter { + async fn vote( + &self, + _settings: ::ElectoralSettings, + slot: ::ElectionProperties, + ) -> Result<<::Vote as VoteStorage>::Vote, anyhow::Error> { + Ok(SolHash::from_str( + &self.client.get_block(slot, RpcBlockConfig::default()).await.blockhash, + ) + .map_err(|e| anyhow::anyhow!("Failed to convert blockhash String to SolHash: {e}"))?) + } +} + pub async fn start( scope: &Scope<'_, anyhow::Error>, client: SolRetryRpcClient, @@ -165,7 +187,8 @@ where SolanaFeeTrackingVoter { client: client.clone() }, SolanaIngressTrackingVoter { client: client.clone() }, SolanaNonceTrackingVoter { client: client.clone() }, - SolanaEgressWitnessingVoter { client }, + SolanaEgressWitnessingVoter { client: client.clone() }, + SolanaLivenessVoter { client }, )), ) .continuously_vote() diff --git a/engine/src/witness/sol/sol_deposits.rs b/engine/src/witness/sol/sol_deposits.rs index 3b43de276d..84100696d7 100644 --- a/engine/src/witness/sol/sol_deposits.rs +++ b/engine/src/witness/sol/sol_deposits.rs @@ -84,11 +84,15 @@ where .into_iter() .filter_map(move |(deposit_channel, amount)| { let amount: SolAmount = amount.saturated_into(); // TODO: Change the DeltaBasedIngress to not use the Chains Amount type but - // instead use u256 or u128 or some generic. - let (_, current_total_ingressed) = + // instead use u256 or u128 or some generic. + let (deposit_details, current_total_ingressed) = deposit_channels.get(deposit_channel.address()).unwrap(); if amount != current_total_ingressed.amount || - slot < current_total_ingressed.block_number + slot < current_total_ingressed.block_number || + // We avoid submitting an extrinsic if the amount is unchanged. However, the delta_based_ingress election won't close a + // channel until at least one ingress submission reaches consensus. To ensure this happens, we submit the amount on the + // first witnessed slot after the deposit channel's close block. + slot >= deposit_details.close_block { Some(( *deposit_channel.address(), diff --git a/foreign-chains/solana/sol-prim/Cargo.toml b/foreign-chains/solana/sol-prim/Cargo.toml index 1e8d10ed19..e0a1675664 100644 --- a/foreign-chains/solana/sol-prim/Cargo.toml +++ b/foreign-chains/solana/sol-prim/Cargo.toml @@ -5,35 +5,46 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[features] -default = ["str", "serde", "pda"] -pda = ["dep:digest", "dep:sha2", "dep:curve25519-dalek"] -serde = ["dep:serde", "str"] -str = ["dep:bs58"] -scale = ["dep:codec", "dep:scale-info"] -std-error = ["dep:thiserror", "bs58/std"] -runtime-benchmarks = [] - - [dependencies] cf-utilities = { package = "utilities", path = "../../../utilities", default-features = false } bs58 = { version = "0.5.1", optional = true, default-features = false } curve25519-dalek = { version = "^2.1", optional = true, default-features = false, features = [ - "u64_backend", + "u64_backend", ] } digest = { version = "^0.10", optional = true, default-features = false } -serde = { version = "^1", optional = true, features = [ - "derive", +serde = { version = "1.0.197", optional = true, features = [ + "derive", ], default-features = false } sha2 = { version = "^0.10", optional = true, default-features = false } thiserror = { version = "^1", optional = true, default-features = false } -codec = { package = 'parity-scale-codec', version = '3.6.1', optional = true, default-features = false, features = [ - 'derive', +codec = { package = "parity-scale-codec", version = "3.6.12", optional = true, default-features = false, features = [ + 'derive', ] } -scale-info = { version = '2.5.0', optional = true, default-features = false, features = [ - 'derive', +scale-info = { version = '2.11.1', optional = true, default-features = false, features = [ + 'derive', ] } [dev-dependencies] serde_json = { version = "^1" } + +[features] +default = ["str", "serde", "pda", "scale", "std"] +pda = ["dep:digest", "dep:sha2", "dep:curve25519-dalek"] +serde = ["dep:serde", "str"] +str = ["dep:bs58"] +scale = ["dep:codec", "dep:scale-info"] +std = [ + "bs58?/std", + "curve25519-dalek?/std", + "digest?/std", + "codec?/std", + "codec?/derive", + "scale-info?/std", + "scale-info?/derive", + "serde?/std", + "serde?/derive", + "sha2?/std", + "cf-utilities/std", + "dep:thiserror", +] diff --git a/foreign-chains/solana/sol-prim/src/consts.rs b/foreign-chains/solana/sol-prim/src/consts.rs index 17239b94a9..9db587414e 100644 --- a/foreign-chains/solana/sol-prim/src/consts.rs +++ b/foreign-chains/solana/sol-prim/src/consts.rs @@ -38,6 +38,7 @@ pub const MAX_TRANSACTION_LENGTH: usize = 1_232usize; pub const MAX_COMPUTE_UNITS_PER_TRANSACTION: u32 = 1_400_000u32; pub const MICROLAMPORTS_PER_LAMPORT: u32 = 1_000_000u32; pub const LAMPORTS_PER_SIGNATURE: u64 = 5000u64; +pub const TOKEN_ACCOUNT_RENT: u64 = 2039280u64; pub const NONCE_ACCOUNT_LENGTH: u64 = 80u64; diff --git a/foreign-chains/solana/sol-prim/src/lib.rs b/foreign-chains/solana/sol-prim/src/lib.rs index dea2b7f7bd..0af3877a27 100644 --- a/foreign-chains/solana/sol-prim/src/lib.rs +++ b/foreign-chains/solana/sol-prim/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std-error"), no_std)] +#![cfg_attr(not(feature = "std"), no_std)] pub use crate::{address::Address, digest::Digest, signature::Signature}; use codec::{Decode, Encode}; diff --git a/foreign-chains/solana/sol-prim/src/pda.rs b/foreign-chains/solana/sol-prim/src/pda.rs index 8ea4383e83..2d951e4898 100644 --- a/foreign-chains/solana/sol-prim/src/pda.rs +++ b/foreign-chains/solana/sol-prim/src/pda.rs @@ -7,16 +7,16 @@ use crate::{address::Address, consts, AccountBump, PdaAndBump}; #[derive(Copy, Clone, Debug, PartialEq, Eq, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "std-error", derive(thiserror::Error))] +#[cfg_attr(feature = "std", derive(thiserror::Error))] pub enum PdaError { - #[cfg_attr(feature = "std-error", error("not a valid point"))] + #[cfg_attr(feature = "std", error("not a valid point"))] NotAValidPoint, - #[cfg_attr(feature = "std-error", error("too many seeds"))] + #[cfg_attr(feature = "std", error("too many seeds"))] TooManySeeds, - #[cfg_attr(feature = "std-error", error("seed too large"))] + #[cfg_attr(feature = "std", error("seed too large"))] SeedTooLarge, // TODO: choose a better name - #[cfg_attr(feature = "std-error", error("bad luck bumping seed"))] + #[cfg_attr(feature = "std", error("bad luck bumping seed"))] BumpSeedBadLuck, } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 063c05d800..c1b43f7a30 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-02-04" +channel = "nightly-2024-07-31" components = [ "cargo", "clippy", diff --git a/state-chain/TROUBLESHOOTING.md b/state-chain/TROUBLESHOOTING.md index 3ebc5b6a92..55a7acdca9 100644 --- a/state-chain/TROUBLESHOOTING.md +++ b/state-chain/TROUBLESHOOTING.md @@ -136,7 +136,7 @@ To start debugging build the node with benchmark features enabled as well as deb Benchmarking in general has a very slow cycle time, you can speed it up by running the benchmarks in a test environment though. Add the following line to the end of your benchmark to execute your benchmark with the test suite and **against the mock** of your pallet: -```rust +```rust,ignore impl_benchmark_test_suite!( Pallet, crate::mock::new_test_ext(Default::default(), Default::default()), diff --git a/state-chain/amm/Cargo.toml b/state-chain/amm/Cargo.toml index 769f75da27..cc09cb8f72 100644 --- a/state-chain/amm/Cargo.toml +++ b/state-chain/amm/Cargo.toml @@ -11,21 +11,21 @@ workspace = true [dependencies] cf-primitives = { path = '../primitives', default-features = false } cf-utilities = { package = 'utilities', path = '../../utilities', default-features = false } -serde = { version = '1.0', default-features = false, features = [ +serde = { version = "1.0.197", default-features = false, features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] rand = "0.8" diff --git a/state-chain/amm/src/common.rs b/state-chain/amm/src/common.rs index 960532e6a8..48ef310b01 100644 --- a/state-chain/amm/src/common.rs +++ b/state-chain/amm/src/common.rs @@ -10,13 +10,18 @@ pub const MAX_LP_FEE: u32 = ONE_IN_HUNDREDTH_PIPS / 2; /// Represents an amount of an asset, in its smallest unit i.e. Ethereum has 10^-18 precision, and /// therefore an `Amount` with the literal value of `1` would represent 10^-18 Ethereum. pub type Amount = U256; + /// The `log1.0001(price)` rounded to the nearest integer. Note [Price] is always /// in units of asset One. pub type Tick = i32; -/// The square root of the price, represented as a fixed point integer with 96 fractional bits and + +/// The square root of the price. +/// +/// Represented as a fixed point integer with 96 fractional bits and /// 64 integer bits (The higher bits past 96+64 th aren't used). [SqrtPriceQ64F96] is always in sqrt /// units of asset one. pub type SqrtPriceQ64F96 = U256; + /// The number of fractional bits used by `SqrtPriceQ64F96`. pub const SQRT_PRICE_FRACTIONAL_BITS: u32 = 96; @@ -263,10 +268,6 @@ pub(super) trait SwapDirection { /// Increases a valid sqrt_price by a specified number of ticks fn increase_sqrt_price(sqrt_price: SqrtPriceQ64F96, delta: Tick) -> SqrtPriceQ64F96; - - /// Returns the equivalent saturated amount in the output asset to a given amount of the input - /// asset at a specific tick, will return None iff the tick is invalid - fn input_to_output_amount_floor(amount: Amount, tick: Tick) -> Option; } impl SwapDirection for BaseToQuote { const INPUT_SIDE: Pairs = Pairs::Base; @@ -283,19 +284,6 @@ impl SwapDirection for BaseToQuote { fn increase_sqrt_price(sqrt_price: SqrtPriceQ64F96, delta: Tick) -> SqrtPriceQ64F96 { sqrt_price_at_tick(tick_at_sqrt_price(sqrt_price).saturating_sub(delta).max(MIN_TICK)) } - - fn input_to_output_amount_floor(amount: Amount, tick: Tick) -> Option { - if is_tick_valid(tick) { - Some( - (U256::full_mul(amount, sqrt_price_to_price(sqrt_price_at_tick(tick))) / - (U256::one() << PRICE_FRACTIONAL_BITS)) - .try_into() - .unwrap_or(U256::MAX), - ) - } else { - None - } - } } impl SwapDirection for QuoteToBase { const INPUT_SIDE: Pairs = Pairs::Quote; @@ -317,19 +305,6 @@ impl SwapDirection for QuoteToBase { .min(MAX_TICK), ) } - - fn input_to_output_amount_floor(amount: Amount, tick: Tick) -> Option { - if is_tick_valid(tick) { - Some( - (U256::full_mul(amount, U256::one() << PRICE_FRACTIONAL_BITS) / - sqrt_price_to_price(sqrt_price_at_tick(tick))) - .try_into() - .unwrap_or(U256::MAX), - ) - } else { - None - } - } } pub const PRICE_FRACTIONAL_BITS: u32 = 128; diff --git a/state-chain/amm/src/limit_orders.rs b/state-chain/amm/src/limit_orders.rs index 08cb18072f..f63b25acb2 100644 --- a/state-chain/amm/src/limit_orders.rs +++ b/state-chain/amm/src/limit_orders.rs @@ -1,4 +1,6 @@ -//! This code implements a single liquidity pool pair, that allows LPs to specify particular prices +//! This code implements a single liquidity pool pair. +//! +//! This liquidity pool pair allows LPs to specify particular prices //! at with they want to sell one of the two assets in the pair. The price an LP wants to sell at //! is specified using `Tick`s. //! @@ -123,7 +125,7 @@ impl FloatBetweenZeroAndOne { // 256 bits, so we maintain at least 256 accurate bits in the result. let (d, div_remainder) = U512::div_mod(mul_normalised_mantissa, U512::from(denominator)); // Note that d can never be zero as mul_normalised_mantissa always has at least one bit - // set above the 256th bit. + // set above the 256th bit. let d = if div_remainder.is_zero() { d } else { d + U512::one() }; let normalise_shift = d.leading_zeros(); // We right shift and use the lower 256 bits for the mantissa diff --git a/state-chain/amm/src/range_orders.rs b/state-chain/amm/src/range_orders.rs index 5ff86989c5..590b1efc78 100644 --- a/state-chain/amm/src/range_orders.rs +++ b/state-chain/amm/src/range_orders.rs @@ -41,7 +41,9 @@ use crate::common::{ pub type Liquidity = u128; type FeeGrowthQ128F128 = U256; -/// This is the maximum Liquidity that can be associated with a given tick. Note this doesn't mean +/// This is the maximum Liquidity that can be associated with a given tick. +/// +/// Note this doesn't mean /// the maximum amount of Liquidity a tick can have, but is the maximum allowed value of the sum of /// the liquidity associated with all range orders that start or end at this tick. /// This does indirectly limit the maximum liquidity at any price/tick, due to the fact there is diff --git a/state-chain/amm/src/range_orders/tests.rs b/state-chain/amm/src/range_orders/tests.rs index 80c8ad47b0..b189e10bd7 100644 --- a/state-chain/amm/src/range_orders/tests.rs +++ b/state-chain/amm/src/range_orders/tests.rs @@ -1,5 +1,3 @@ -#![cfg(test)] - use rand::{prelude::Distribution, Rng, SeedableRng}; #[cfg(feature = "slow-tests")] @@ -52,7 +50,8 @@ fn r_non_zero() { 0x5d6af8dedb81196699c329225ee604u128.ilog2() + 0x2216e584f5fa1ea926041bedfe98u128.ilog2() + 0x48a170391f7dc42444e8fa2u128.ilog2()) as i32 - - (128 * 19)) > 0 + (128 * 19)) > + 0 ); } diff --git a/state-chain/cf-integration-tests/Cargo.toml b/state-chain/cf-integration-tests/Cargo.toml index 5c873c1fc9..69885ecd45 100644 --- a/state-chain/cf-integration-tests/Cargo.toml +++ b/state-chain/cf-integration-tests/Cargo.toml @@ -35,7 +35,7 @@ cf-utilities = { package = 'utilities', path = '../../utilities' } cf-traits = { path = '../traits' } cfe-events = { path = '../cfe-events' } chainflip-node = { path = '../node' } -pallet-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +pallet-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } pallet-cf-account-roles = { path = '../pallets/cf-account-roles' } pallet-cf-broadcast = { path = '../pallets/cf-broadcast' } pallet-cf-chain-tracking = { path = '../pallets/cf-chain-tracking' } @@ -55,39 +55,36 @@ pallet-cf-threshold-signature = { path = '../pallets/cf-threshold-signature' } pallet-cf-validator = { path = '../pallets/cf-validator' } pallet-cf-vaults = { path = '../pallets/cf-vaults' } pallet-cf-witnesser = { path = '../pallets/cf-witnesser' } -pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", features = [ - 'historical', +pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", features = [ + 'historical', ] } # Substrate dependencies -codec = { package = "parity-scale-codec", version = "3.6.1", features = [ - "derive", +codec = { package = "parity-scale-codec", version = "3.6.12", features = [ + "derive", ] } -scale-info = { version = "2.10.0", features = ["derive"] } +scale-info = { version = "2.11.1", features = ["derive"] } -frame-executive = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-system-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +frame-executive = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-system-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } -pallet-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -pallet-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +pallet-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +pallet-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } -sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } - -[features] -try-runtime = ['frame-support/try-runtime', 'frame-system/try-runtime'] +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } diff --git a/state-chain/cf-integration-tests/src/account.rs b/state-chain/cf-integration-tests/src/account.rs index 87c1770bf5..a869454e2e 100644 --- a/state-chain/cf-integration-tests/src/account.rs +++ b/state-chain/cf-integration-tests/src/account.rs @@ -84,7 +84,7 @@ fn account_deletion_removes_relevant_storage_items() { assert!(AccountPeerMapping::::get(&backup_node).is_none()); assert!(!MappedPeers::::contains_key(peer_id)); let vanity_names = VanityNames::::get(); - assert!(vanity_names.get(&backup_node).is_none()); + assert!(!vanity_names.contains_key(&backup_node)); assert_eq!(pallet_cf_account_roles::AccountRoles::::get(&backup_node), None); assert_eq!(Reputations::::get(backup_node).online_blocks, 0); }); diff --git a/state-chain/cf-integration-tests/src/lib.rs b/state-chain/cf-integration-tests/src/lib.rs index 623c671e5f..0f5c09ffa1 100644 --- a/state-chain/cf-integration-tests/src/lib.rs +++ b/state-chain/cf-integration-tests/src/lib.rs @@ -1,5 +1,4 @@ #![cfg(test)] -#![feature(exclusive_range_pattern)] mod network; mod broadcasting; diff --git a/state-chain/cf-integration-tests/src/migrations/serialize_solana_broadcast.rs b/state-chain/cf-integration-tests/src/migrations/serialize_solana_broadcast.rs index 1a27e5f7c5..be7b0d89b6 100644 --- a/state-chain/cf-integration-tests/src/migrations/serialize_solana_broadcast.rs +++ b/state-chain/cf-integration-tests/src/migrations/serialize_solana_broadcast.rs @@ -10,7 +10,7 @@ use sp_runtime::AccountId32; use frame_support::traits::OnRuntimeUpgrade; use pallet_cf_broadcast::BroadcastData; use state_chain_runtime::{ - migrations::serialize_solana_broadcast::{old, SerializeSolanaBroadcastMigration}, + migrations::serialize_solana_broadcast::{self, old, SerializeSolanaBroadcastMigration}, SolanaInstance, }; @@ -126,11 +126,9 @@ fn test_migration() { }, ); - #[cfg(feature = "try-runtime")] - let state = SerializeSolanaBroadcastMigration::pre_upgrade().unwrap(); + let state = serialize_solana_broadcast::pre_upgrade_check().unwrap(); SerializeSolanaBroadcastMigration::on_runtime_upgrade(); - #[cfg(feature = "try-runtime")] - SerializeSolanaBroadcastMigration::post_upgrade(state).unwrap(); + serialize_solana_broadcast::post_upgrade_check(state).unwrap(); let expected_serialized_tx = hex_literal::hex!("01d1144b223b6b600de4b2d96bdceb03573a3e9781953e4c668c57e505f017859d96543243b4d904dc2f02f2f5ab5db7ba4551c7e015e64078add4674ac2e7460c0100080f2e8944a76efbece296221e736627f4528a947578263a1172a9786410702d2ef222020a74fd97df45db96d2bbf4e485ccbec56945155ff8f668856be26c9de4a979c03bceb9ddea819e956b2b332e87fbbf49fc8968df78488e88cfaa366f30368cd28baa84f2067bbdf24513c2d44e44bf408f2e6da6e60762e3faa4a62a0adb8d9871ed5fb2ee05765af23b7cabcc0d6b08ed370bb9f616a0d4dea40a25f870b5b9d633289c8fd72fb05f33349bf4cc44e82add5d865311ae346d7c9a67b7ddf53a2f4350451db5595a75e231519bc2758798f72550e57487722e7cbe954dbc00000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a4000000006a7d517192c568ee08a845f73d29788cf035c3145b21ab344d8062ea940000006ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a90fb9ba52b1f09445f1e3a7508d59f0797923acf744fbe2da303fb06da859ee8772b5d2051d300b10b74314b7e25ace9998ca66eb2c7fbc10ef130dd67028293ca140fd3d05766f0087d57bf99df05731e894392ffcc8e8d7e960ba73c09824aaa1e031c8bc9bec3b610cf7b36eb3bf3aa40237c9e5be2c7893878578439eb00bf7f02ac4729abaa97c01aa6526ba909c3bcb16c7f47c7e13dfdc5a1b15f647b40507030309000404000000080009030a0000000000000008000502336201000c050e00040507158e24658f6c59298c080000000100000000000000ff0c090e000d01020b0a060716494710642cb0c646080000000200000000000000ff06").to_vec(); diff --git a/state-chain/cf-integration-tests/src/mock_runtime.rs b/state-chain/cf-integration-tests/src/mock_runtime.rs index 8be7c3a0d7..56251afa19 100644 --- a/state-chain/cf-integration-tests/src/mock_runtime.rs +++ b/state-chain/cf-integration-tests/src/mock_runtime.rs @@ -39,6 +39,8 @@ pub const ACCRUAL_RATIO: (i32, u32) = (1, 1); const COMPUTE_PRICE: u64 = 1_000u64; +const BLOCKS_BETWEEN_LIVENESS_CHECKS: u32 = 10; + /// The offences committable within the protocol and their respective reputation penalty and /// suspension durations. pub const PENALTIES: &[(Offence, (i32, BlockNumber))] = &[ @@ -50,6 +52,7 @@ pub const PENALTIES: &[(Offence, (i32, BlockNumber))] = &[ // so there is no need to suspend them further. (Offence::FailedToBroadcastTransaction, (10, 0)), (Offence::GrandpaEquivocation, (50, HEARTBEAT_BLOCK_INTERVAL * 5)), + (Offence::FailedLivenessCheck(cf_chains::ForeignChain::Solana), (4, 0)), ]; use crate::{ @@ -303,6 +306,7 @@ impl ExtBuilder { (), (), (), + (), ), unsynchronised_settings: ( (), @@ -312,6 +316,7 @@ impl ExtBuilder { (), (), (), + (), ), settings: ( (), @@ -322,6 +327,7 @@ impl ExtBuilder { }, (), (), + BLOCKS_BETWEEN_LIVENESS_CHECKS, ), }), }, diff --git a/state-chain/cf-integration-tests/src/network.rs b/state-chain/cf-integration-tests/src/network.rs index 2c79c5347a..8b03627874 100644 --- a/state-chain/cf-integration-tests/src/network.rs +++ b/state-chain/cf-integration-tests/src/network.rs @@ -36,9 +36,10 @@ type CfeEvent = cfe_events::CfeEvent<::ValidatorId>; // TODO: Can we use the actual events here? // Events from ethereum contract + #[derive(Debug, Clone)] pub enum ContractEvent { - Funded { node_id: NodeId, amount: FlipBalance, total: FlipBalance, epoch: EpochIndex }, + Funded { node_id: NodeId, amount: FlipBalance, epoch: EpochIndex }, Redeemed { node_id: NodeId, amount: FlipBalance, epoch: EpochIndex }, } @@ -85,10 +86,9 @@ impl ScGatewayContract { pub fn fund_account(&mut self, node_id: NodeId, amount: FlipBalance, epoch: EpochIndex) { assert!(amount >= MinimumFunding::::get()); let current_amount = self.balances.get(&node_id).unwrap_or(&0); - let total = current_amount + amount; - self.balances.insert(node_id.clone(), total); + self.balances.insert(node_id.clone(), current_amount + amount); - self.events.push(ContractEvent::Funded { node_id, amount, total, epoch }); + self.events.push(ContractEvent::Funded { node_id, amount, epoch }); } // We don't really care about the process of "registering" and then "executing" redemption here. diff --git a/state-chain/cf-integration-tests/src/swapping.rs b/state-chain/cf-integration-tests/src/swapping.rs index eeb4d30d5a..8ec0ed2eaa 100644 --- a/state-chain/cf-integration-tests/src/swapping.rs +++ b/state-chain/cf-integration-tests/src/swapping.rs @@ -30,7 +30,7 @@ use cf_traits::{AdjustedFeeEstimationApi, AssetConverter, BalanceApi, EpochInfo, use frame_support::{ assert_ok, instances::Instance1, - traits::{OnFinalize, OnIdle}, + traits::{OnFinalize, OnIdle, Time}, }; use pallet_cf_broadcast::{ AwaitingBroadcast, BroadcastIdCounter, PendingApiCalls, RequestFailureCallbacks, diff --git a/state-chain/cf-session-benchmarking/Cargo.toml b/state-chain/cf-session-benchmarking/Cargo.toml index cee58e17c6..934f2f3345 100644 --- a/state-chain/cf-session-benchmarking/Cargo.toml +++ b/state-chain/cf-session-benchmarking/Cargo.toml @@ -18,20 +18,20 @@ workspace = true [dependencies] rand = { version = '0.8.4', default-features = false, features = ['std_rng'] } -pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'historical', ] } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [features] default = ['std'] diff --git a/state-chain/cf-session-benchmarking/src/lib.rs b/state-chain/cf-session-benchmarking/src/lib.rs index 04a8f358d6..c4f4eb3c84 100644 --- a/state-chain/cf-session-benchmarking/src/lib.rs +++ b/state-chain/cf-session-benchmarking/src/lib.rs @@ -9,6 +9,7 @@ use pallet_session::*; use rand::{RngCore, SeedableRng}; use sp_std::{prelude::*, vec}; +#[allow(dead_code)] pub struct Pallet(pallet_session::Pallet); pub trait Config: pallet_session::Config + pallet_session::historical::Config {} diff --git a/state-chain/cfe-events/Cargo.toml b/state-chain/cfe-events/Cargo.toml index 296128d0d7..6e8ae7ac60 100644 --- a/state-chain/cfe-events/Cargo.toml +++ b/state-chain/cfe-events/Cargo.toml @@ -15,18 +15,18 @@ cf-primitives = { path = '../primitives', default-features = false } cf-chains = { path = "../chains", default-features = false } # Parity dependencies -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -hex = "0.4" +hex = "0.4.3" [features] diff --git a/state-chain/chains/Cargo.toml b/state-chain/chains/Cargo.toml index d868f43d00..da4e33f49a 100644 --- a/state-chain/chains/Cargo.toml +++ b/state-chain/chains/Cargo.toml @@ -21,7 +21,7 @@ libsecp256k1 = { default-features = false, version = '0.7', features = [ sha2 = { version = "0.10", default-features = false } # Solana -sol-prim = { path = "../../foreign-chains/solana/sol-prim", features = [ +sol-prim = { path = "../../foreign-chains/solana/sol-prim", default-features = false, features = [ "pda", "str", "serde", @@ -38,7 +38,7 @@ rlp = { default-features = false, version = '0.5' } bech32 = { default-features = false, version = '0.9.1' } # Solana -borsh = { version = "1.2.1", default_features = false, features = [ +borsh = { version = "1.2.1", default-features = false, features = [ "derive", "unstable__schema", "hashbrown", @@ -55,39 +55,39 @@ bincode = { version = "2.0.0-rc.3", default-features = false, features = [ "alloc", "serde", ] } -curve25519-dalek = { git = "https://github.com/solana-labs/curve25519-dalek.git", rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464", optional = true } +curve25519-dalek = { version = "4.1.3", optional = true } sha2-const = { version = "0.1.2", default-features = false } ed25519-dalek = { version = "2.1.1", optional = true } # Other -anyhow = { version = '1.0', default-features = false, optional = true } -hex = { default-features = false, version = '0.4', features = ['serde'] } -hex-literal = { version = '0.4.1', default-features = false } -serde = { version = '1.0.195', default-features = false, features = [ - 'alloc', - 'derive', +anyhow = { version = "1.0", default-features = false, optional = true } +hex = { default-features = false, version = "0.4", features = ["serde"] } +hex-literal = { version = "0.4.1", default-features = false } +serde = { version = "1.0.197", default-features = false, features = [ + "alloc", + "derive", ] } serde_bytes = { version = "0.11.14", default-features = false } -log = { version = '0.4.16', default-features = false } -itertools = { version = '0.11.0', default-features = false } -arrayref = '0.3.6' -strum = { default-features = false, version = '0.24' } +log = { version = "0.4.16", default-features = false } +itertools = { version = "0.13", default-features = false } +arrayref = "0.3.6" +strum = { default-features = false, version = "0.24" } thiserror = { version = "1.0.50", optional = true } rand = { version = "0.8.4", optional = true } # Substrate packages -ss58-registry = { version = '1.41', optional = true } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ - 'derive', +ss58-registry = { version = "1.41", optional = true } +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ + "derive", ] } -scale-info = { version = '2.10.0', default-features = false, features = [ - 'derive', +scale-info = { version = "2.11.1", default-features = false, features = [ + "derive", ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../test-utilities' } @@ -99,35 +99,47 @@ ed25519-dalek = { version = "2.1.1", features = ["rand_core"] } [features] default = ['std'] std = [ - 'bech32/std', - 'cf-primitives/std', - 'cf-utilities/std', - 'scale-info/std', - 'codec/std', - 'ethabi/full-serde', - 'ethereum/std', - 'ethereum-types/std', - 'frame-support/std', - 'hex/std', - 'hex/serde', - 'libsecp256k1/std', - 'log/std', - 'rlp/std', - 'serde/std', - 'sp-std/std', - 'sp-core/std', - 'sp-core/full_crypto', - 'sp-io/std', - 'dep:ss58-registry', - 'dep:thiserror', - 'dep:anyhow', - 'strum/std', - 'curve25519-dalek/std', - 'sp-runtime/std', + "bech32/std", + "cf-primitives/std", + "cf-utilities/std", + "scale-info/std", + "codec/std", + "ethabi/full-serde", + "ethereum/std", + "ethereum-types/std", + "frame-support/std", + "hex/std", + "hex/serde", + "libsecp256k1/std", + "log/std", + "rlp/std", + "serde/std", + "sp-std/std", + "sp-core/std", + "sp-core/full_crypto", + "sp-io/std", + "dep:ss58-registry", + "dep:thiserror", + "dep:anyhow", + "strum/std", + "sp-runtime/std", + "anyhow?/std", + "bincode/std", + "bs58/std", + "cf-runtime-utilities/std", + "digest/std", + "ethabi/std", + "serde_bytes/std", + "serde_with/std", + "sha2/std", + "sol-prim/std", + "itertools/use_std", + # "borsh/std" not needed, it conflicts with borsh/hashbrown. ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'frame-support/runtime-benchmarks', + 'sp-runtime/runtime-benchmarks', ] +try-runtime = ["frame-support/try-runtime", "sp-runtime/try-runtime"] runtime-integration-tests = ['std', 'dep:rand', 'ed25519-dalek/rand_core'] diff --git a/state-chain/chains/src/address.rs b/state-chain/chains/src/address.rs index 77a1cd2d4a..2cddfa239e 100644 --- a/state-chain/chains/src/address.rs +++ b/state-chain/chains/src/address.rs @@ -338,8 +338,9 @@ impl ToHumanreadableAddress for PolkadotAccountId { #[cfg(feature = "std")] #[derive(Debug, Clone, Serialize)] #[serde(untagged)] -/// A type that serializes the address in a human-readable way. This can only be -/// serialized and not deserialized. +/// A type that serializes the address in a human-readable way. +/// +/// This can only be serialized and not deserialized. /// `deserialize` is not implemented for ForeignChainAddressHumanreadable /// because it is not possible to deserialize a human-readable address without /// further context around the asset and chain. diff --git a/state-chain/chains/src/arb.rs b/state-chain/chains/src/arb.rs index 69cbb1ad68..eb690e5c4f 100644 --- a/state-chain/chains/src/arb.rs +++ b/state-chain/chains/src/arb.rs @@ -72,7 +72,12 @@ pub struct ArbitrumTrackedData { impl Default for ArbitrumTrackedData { #[track_caller] fn default() -> Self { - panic!("You should not use the default chain tracking, as it's meaningless.") + frame_support::print("You should not use the default chain tracking, as it's meaningless."); + + ArbitrumTrackedData { + base_fee: Default::default(), + gas_limit_multiplier: Default::default(), + } } } diff --git a/state-chain/chains/src/btc.rs b/state-chain/chains/src/btc.rs index 3251477b85..7999af390e 100644 --- a/state-chain/chains/src/btc.rs +++ b/state-chain/chains/src/btc.rs @@ -1,6 +1,7 @@ pub mod api; pub mod benchmarking; pub mod deposit_address; +pub mod smart_contract_encoding; pub mod utxo_selection; extern crate alloc; @@ -39,7 +40,10 @@ pub const CHANGE_ADDRESS_SALT: u32 = 0; // The bitcoin script generated from the bitcoin address should not exceed this value according to // our construction -pub const MAX_BITCOIN_SCRIPT_LENGTH: u32 = 128; +pub const MAX_BITCOIN_SCRIPT_LENGTH: usize = 128; + +// Bitcion does not support push operations of data larger than this size: +const MAX_PUSHABLE_BYTES: u32 = 520; // We must send strictly greater than this amount to avoid hitting the Bitcoin dust // limit @@ -116,7 +120,11 @@ pub struct BitcoinTrackedData { impl Default for BitcoinTrackedData { #[track_caller] fn default() -> Self { - panic!("You should not use the default chain tracking, as it's meaningless."); + frame_support::print("You should not use the default chain tracking, as it's meaningless."); + + BitcoinTrackedData { + btc_fee_info: BitcoinFeeInfo { sats_per_kilobyte: Default::default() }, + } } } @@ -579,7 +587,12 @@ impl ScriptPubkey { ]), ScriptPubkey::OtherSegwit { version, program } => BitcoinScript::new(&[ BitcoinOp::PushVersion { version: *version }, - BitcoinOp::PushBytes { bytes: program.clone() }, + BitcoinOp::PushBytes { + bytes: program + .to_vec() + .try_into() + .expect("MAX_SEGWIT_PROGRAM_BYTES < MAX_PUSHABLE_BYTES"), + }, ]), } } @@ -921,7 +934,7 @@ impl BitcoinTransaction { } } -trait SerializeBtc { +pub trait SerializeBtc { /// Encodes this item to a byte buffer. fn btc_encode_to(&self, buf: &mut Vec); /// The exact size this object will have once serialized. @@ -954,22 +967,32 @@ impl SerializeBtc for &[T] { #[derive(Encode, Decode, TypeInfo, MaxEncodedLen, Clone, RuntimeDebug, PartialEq, Eq)] pub enum BitcoinOp { PushUint { value: u32 }, - PushBytes { bytes: BoundedVec> }, + PushBytes { bytes: BoundedVec> }, Drop, CheckSig, Dup, Hash160, EqualVerify, Equal, - // Not part of the bitcoin spec, implemented for convenience + Return, + // The following are not part of the bitcoin spec, implemented for convenience: PushArray20 { bytes: [u8; 20] }, PushArray32 { bytes: [u8; 32] }, PushVersion { version: u8 }, } -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, RuntimeDebug, PartialEq, Eq)] +#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug, PartialEq, Eq)] pub struct BitcoinScript { - bytes: BoundedVec>, + bytes: Vec, +} + +// We only store (spendable) BitcoinScripts that we authored ourselves. +// For these, the max encoded length is MAX_BITCOIN_SCRIPT_LENGTH. +// For anything else, we don't need MaxEncodedLen. +impl MaxEncodedLen for BitcoinScript { + fn max_encoded_len() -> usize { + MAX_BITCOIN_SCRIPT_LENGTH + } } impl BitcoinScript { @@ -978,11 +1001,11 @@ impl BitcoinScript { for op in ops.iter() { op.btc_encode_to(&mut bytes); } - Self { bytes: bytes.try_into().unwrap() } + Self { bytes } } pub fn raw(self) -> Vec { - self.bytes.into_inner() + self.bytes } } @@ -1057,6 +1080,7 @@ impl SerializeBtc for BitcoinOp { } else { buf.push(0x50 + *version); }, + BitcoinOp::Return => buf.push(0x6a), } } @@ -1085,6 +1109,7 @@ impl SerializeBtc for BitcoinOp { BitcoinOp::Dup | BitcoinOp::Hash160 | BitcoinOp::EqualVerify | + BitcoinOp::Return | BitcoinOp::Equal => 1, BitcoinOp::PushArray20 { .. } => 21, BitcoinOp::PushArray32 { .. } => 33, diff --git a/state-chain/chains/src/btc/api.rs b/state-chain/chains/src/btc/api.rs index fb9916488d..c60401de79 100644 --- a/state-chain/chains/src/btc/api.rs +++ b/state-chain/chains/src/btc/api.rs @@ -171,7 +171,6 @@ impl ApiCall for BitcoinApi { ) -> Self { match self { BitcoinApi::BatchTransfer(call) => call.signed(threshold_signature, signer).into(), - BitcoinApi::_Phantom(..) => unreachable!(), } } diff --git a/state-chain/chains/src/btc/smart_contract_encoding.rs b/state-chain/chains/src/btc/smart_contract_encoding.rs new file mode 100644 index 0000000000..82add655a3 --- /dev/null +++ b/state-chain/chains/src/btc/smart_contract_encoding.rs @@ -0,0 +1,129 @@ +use crate::address::EncodedAddress; +use cf_primitives::{Asset, AssetAmount, ForeignChain}; +use codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_std::vec::Vec; + +use super::{BitcoinOp, BitcoinScript}; + +// The maximum length of data that can be encoded in a nulldata utxo +const MAX_NULLDATA_LENGTH: usize = 80; + +#[derive(Clone, PartialEq, Debug, TypeInfo)] +pub struct UtxoEncodedData { + pub output_asset: Asset, + pub output_address: EncodedAddress, + pub parameters: SharedCfParameters, +} + +impl Encode for UtxoEncodedData { + fn encode(&self) -> Vec { + let mut r = Vec::with_capacity(MAX_NULLDATA_LENGTH); + + self.output_asset.encode_to(&mut r); + + // Note that we don't encode the variant since we know the + // asset from reading the previous field: + match &self.output_address { + EncodedAddress::Eth(inner) => inner.encode_to(&mut r), + EncodedAddress::Dot(inner) => inner.encode_to(&mut r), + EncodedAddress::Btc(inner) => inner.encode_to(&mut r), + EncodedAddress::Arb(inner) => inner.encode_to(&mut r), + EncodedAddress::Sol(inner) => inner.encode_to(&mut r), + } + + self.parameters.encode_to(&mut r); + + r + } +} + +impl Decode for UtxoEncodedData { + fn decode(input: &mut I) -> Result { + let output_asset = Asset::decode(input)?; + + let output_address = match ForeignChain::from(output_asset) { + ForeignChain::Ethereum => EncodedAddress::Eth(Decode::decode(input)?), + ForeignChain::Polkadot => EncodedAddress::Dot(Decode::decode(input)?), + ForeignChain::Bitcoin => EncodedAddress::Btc(Decode::decode(input)?), + ForeignChain::Arbitrum => EncodedAddress::Arb(Decode::decode(input)?), + ForeignChain::Solana => EncodedAddress::Sol(Decode::decode(input)?), + }; + + let parameters = SharedCfParameters::decode(input)?; + + Ok(UtxoEncodedData { output_asset, output_address, parameters }) + } +} + +// The encoding of these parameters is the same across chains +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Debug)] +pub struct SharedCfParameters { + // FoK fields (refund address is stored externally): + pub retry_duration: u16, + pub min_output_amount: AssetAmount, + // DCA fields: + pub number_of_chunks: u16, + pub chunk_interval: u16, + // Boost fields: + pub boost_fee: u8, +} + +#[allow(dead_code)] +pub fn encode_data_in_nulldata_utxo(data: &[u8]) -> Option { + if data.len() > MAX_NULLDATA_LENGTH { + return None; + } + + Some(BitcoinScript::new(&[ + BitcoinOp::Return, + BitcoinOp::PushBytes { bytes: data.to_vec().try_into().expect("size checked just above") }, + ])) +} + +pub fn encode_swap_params_in_nulldata_utxo(params: UtxoEncodedData) -> BitcoinScript { + encode_data_in_nulldata_utxo(¶ms.encode()).expect("params must always fit in utxo") +} + +#[cfg(test)] +mod tests { + use super::*; + + const MOCK_DOT_ADDRESS: [u8; 32] = [9u8; 32]; + + const MOCK_SWAP_PARAMS: UtxoEncodedData = UtxoEncodedData { + output_asset: Asset::Dot, + output_address: EncodedAddress::Dot(MOCK_DOT_ADDRESS), + parameters: SharedCfParameters { + retry_duration: 5, + min_output_amount: u128::MAX, + number_of_chunks: 0x0ffff, + chunk_interval: 2, + boost_fee: 5, + }, + }; + + #[test] + fn check_utxo_encoding() { + // The following encoding is expected for MOCK_SWAP_PARAMS: + // (not using "insta" because we want to be precise about how the data + // is encoded exactly, rather than simply that the encoding doesn't change) + let expected_encoding: Vec = [0x04] // Asset + .into_iter() + .chain(MOCK_DOT_ADDRESS) // Polkadot address + .chain([0x05, 0x00]) // Retry duration + .chain([ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, + ]) // min output amount + .chain([0xff, 0xff]) // Number of chunks + .chain([0x02, 0x00]) // Chunk interval + .chain([0x5]) // Boost fee + .collect(); + + assert_eq!(MOCK_SWAP_PARAMS.encode(), expected_encoding); + assert_eq!(expected_encoding.len(), 56); + + assert_eq!(UtxoEncodedData::decode(&mut expected_encoding.as_ref()), Ok(MOCK_SWAP_PARAMS)); + } +} diff --git a/state-chain/chains/src/dot.rs b/state-chain/chains/src/dot.rs index 643945da54..ce76109be5 100644 --- a/state-chain/chains/src/dot.rs +++ b/state-chain/chains/src/dot.rs @@ -31,11 +31,11 @@ use sp_core::{sr25519, ConstBool, H256}; pub struct PolkadotSignature(sr25519::Signature); impl PolkadotSignature { fn verify(&self, payload: &EncodedPolkadotPayload, signer: &PolkadotPublicKey) -> bool { - self.0.verify(&payload.0[..], &sr25519::Public(*signer.aliased_ref())) + self.0.verify(&payload.0[..], &sr25519::Public::from(*signer.aliased_ref())) } - pub const fn from_aliased(signature: [u8; 64]) -> Self { - Self(sr25519::Signature(signature)) + pub fn from_aliased(signature: [u8; 64]) -> Self { + Self(sr25519::Signature::from(signature)) } pub fn aliased_ref(&self) -> &[u8; 64] { @@ -186,7 +186,7 @@ impl PolkadotUncheckedExtrinsic { pub fn signature(&self) -> Option { self.0.signature.as_ref().and_then(|signature| { if let MultiSignature::Sr25519(signature) = &signature.1 { - Some(PolkadotSignature(signature.clone())) + Some(PolkadotSignature(*signature)) } else { None } @@ -243,7 +243,9 @@ pub struct PolkadotTrackedData { impl Default for PolkadotTrackedData { #[track_caller] fn default() -> Self { - panic!("You should not use the default chain tracking, as it's meaningless.") + frame_support::print("You should not use the default chain tracking, as it's meaningless."); + + PolkadotTrackedData { median_tip: Default::default(), runtime_version: Default::default() } } } @@ -681,8 +683,8 @@ pub enum ProxyCall { /// Parameters: /// - `proxy`: The account that the `caller` would like to make a proxy. /// - `proxy_type`: The permissions allowed for this proxy account. - /// - `delay`: The announcement period required of the initial proxy. Will generally be - /// zero. + /// - `delay`: The announcement period required of the initial proxy. This will generally be + /// set to zero. /// /// # /// Weight is a function of the number of proxies the user has (P). @@ -733,17 +735,16 @@ pub enum ProxyCall { /// /// Requires a `Signed` origin. /// - /// - `proxy_type`: The type of the proxy that the sender will be registered as over the - /// new account. This will almost always be the most permissive `ProxyType` possible to - /// allow for maximum flexibility. + /// - `proxy_type`: The type of the proxy that the sender will be registered as over the new + /// account. This will almost always be the most permissive `ProxyType` possible to allow for + /// maximum flexibility. /// - `index`: A disambiguation index, in case this is called multiple times in the same - /// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just - /// want to use `0`. - /// - `delay`: The announcement period required of the initial proxy. Will generally be - /// zero. + /// transaction (e.g. with `utility::batch`). Unless you're using `batch` you probably just + /// want to use `0`. + /// - `delay`: The announcement period required of the initial proxy. Will generally be zero. /// - /// Fails with `Duplicate` if this has already been called in this transaction, from the - /// same sender, with the same parameters. + /// Fails with `Duplicate` if this has already been called in this transaction, from the same + /// sender, with the same parameters. /// /// Fails if there are insufficient funds to pay for deposit. /// diff --git a/state-chain/chains/src/dot/benchmarking.rs b/state-chain/chains/src/dot/benchmarking.rs index 8c1a4c47a0..742108b5e9 100644 --- a/state-chain/chains/src/dot/benchmarking.rs +++ b/state-chain/chains/src/dot/benchmarking.rs @@ -16,21 +16,28 @@ use super::{ EncodedPolkadotPayload, PolkadotAccountId, PolkadotReplayProtection, PolkadotTrackedData, TxId, }; -const SIGNATURE: PolkadotSignature = PolkadotSignature::from_aliased([1u8; 64]); -const ACCOUNT_ID_1: PolkadotAccountId = PolkadotAccountId::from_aliased([2u8; 32]); -const ACCOUNT_ID_2: PolkadotAccountId = PolkadotAccountId::from_aliased([3u8; 32]); +const SIGNATURE: [u8; 64] = [1u8; 64]; +const ACCOUNT_ID_1: [u8; 32] = [2u8; 32]; +const ACCOUNT_ID_2: [u8; 32] = [3u8; 32]; const NONCE: u32 = 5; const ENCODED_EXTRINSIC: [u8; 100] = [3u8; 100]; +fn account(inner: [u8; 32]) -> PolkadotAccountId { + PolkadotAccountId::from_aliased(inner) +} +fn signature(inner: [u8; 64]) -> PolkadotSignature { + PolkadotSignature::from_aliased(inner) +} + impl BenchmarkValue for PolkadotUncheckedExtrinsic { fn benchmark_value() -> Self { PolkadotUncheckedExtrinsic::new_signed( PolkadotRuntimeCall::Balances(BalancesCall::transfer_all { - dest: PolkadotAccountIdLookup::from(ACCOUNT_ID_1), + dest: PolkadotAccountIdLookup::from(account(ACCOUNT_ID_1)), keep_alive: true, }), - ACCOUNT_ID_2, - SIGNATURE, + account(ACCOUNT_ID_2), + signature(SIGNATURE), PolkadotSignedExtra(( (), (), @@ -49,7 +56,7 @@ impl BenchmarkValue for PolkadotUncheckedExtrinsic { impl BenchmarkValue for PolkadotSignature { fn benchmark_value() -> Self { - SIGNATURE + signature(SIGNATURE) } } diff --git a/state-chain/chains/src/eth.rs b/state-chain/chains/src/eth.rs index 391b5b6155..5ff85fbfd6 100644 --- a/state-chain/chains/src/eth.rs +++ b/state-chain/chains/src/eth.rs @@ -131,7 +131,9 @@ impl FeeEstimationApi for EthereumTrackedData { impl Default for EthereumTrackedData { #[track_caller] fn default() -> Self { - panic!("You should not use the default chain tracking, as it's meaningless.") + frame_support::print("You should not use the default chain tracking, as it's meaningless."); + + EthereumTrackedData { base_fee: Default::default(), priority_fee: Default::default() } } } diff --git a/state-chain/chains/src/eth/deposit_address.rs b/state-chain/chains/src/eth/deposit_address.rs index dd21f4cf19..bfa54499de 100644 --- a/state-chain/chains/src/eth/deposit_address.rs +++ b/state-chain/chains/src/eth/deposit_address.rs @@ -51,6 +51,7 @@ const PREFIX_BYTE: u8 = 0xff; pub const ETHEREUM_ETH_ADDRESS: EthereumAddress = H160([0xEE; 20]); /// Derives the CREATE2 Ethereum address for a given asset, vault, and channel id. +/// /// @param vault_address The address of the Ethereum Vault /// @param token_address The token address if this is a token deposit /// @param channel_id The numerical channel id diff --git a/state-chain/chains/src/evm.rs b/state-chain/chains/src/evm.rs index add93328cd..35ce8299d9 100644 --- a/state-chain/chains/src/evm.rs +++ b/state-chain/chains/src/evm.rs @@ -104,8 +104,10 @@ impl Display for AggKeyVerificationError { } } +/// Implementation of a Parity Bit. +/// /// A parity bit can be either odd or even, but can have different representations depending on its -/// use. EVM generaly assumes `0` or `1` but the standard serialization format used in most +/// use. EVM generally assumes `0` or `1` but the standard serialization format used in most /// libraries assumes `2` or `3`. #[derive( Encode, diff --git a/state-chain/chains/src/sol.rs b/state-chain/chains/src/sol.rs index 04877d7de6..b8a344ad0d 100644 --- a/state-chain/chains/src/sol.rs +++ b/state-chain/chains/src/sol.rs @@ -22,7 +22,10 @@ pub mod transaction_builder; pub use crate::assets::sol::Asset as SolAsset; use crate::benchmarking_value::BenchmarkValue; pub use sol_prim::{ - consts::{LAMPORTS_PER_SIGNATURE, MAX_TRANSACTION_LENGTH, MICROLAMPORTS_PER_LAMPORT}, + consts::{ + LAMPORTS_PER_SIGNATURE, MAX_TRANSACTION_LENGTH, MICROLAMPORTS_PER_LAMPORT, + TOKEN_ACCOUNT_RENT, + }, pda::{Pda as DerivedAddressBuilder, PdaError as AddressDerivationError}, Address as SolAddress, Amount as SolAmount, ComputeLimit as SolComputeLimit, Digest as SolHash, Signature as SolSignature, SlotNumber as SolBlockNumber, @@ -147,6 +150,7 @@ pub mod compute_units_costs { pub const COMPUTE_UNITS_PER_SET_GOV_KEY: SolComputeLimit = 15_000u32; pub const COMPUTE_UNITS_PER_BUMP_DERIVATION: SolComputeLimit = 2_000u32; + /// This is equivalent to a priority fee pub const MIN_COMPUTE_PRICE: SolAmount = 10u64; // Max compute units per CCM transfers. Capping it to maximize chances of inclusion. @@ -173,6 +177,29 @@ pub struct SolTrackedData { pub priority_fee: ::ChainAmount, } +impl SolTrackedData { + // Calculate the estimated fee for broadcasting a transaction given its compute units + // and the current priority fee. + pub fn calculate_transaction_fee( + &self, + compute_units: SolComputeLimit, + ) -> ::ChainAmount { + use compute_units_costs::*; + + // Match the minimum compute price that will be set on broadcast. + let priority_fee = sp_std::cmp::max(self.priority_fee, MIN_COMPUTE_PRICE); + + LAMPORTS_PER_SIGNATURE.saturating_add( + // It should never approach overflow but just in case + sp_std::cmp::min( + SolAmount::MAX as u128, + (priority_fee as u128 * compute_units as u128) + .div_ceil(MICROLAMPORTS_PER_LAMPORT.into()), + ) as SolAmount, + ) + } +} + impl FeeEstimationApi for SolTrackedData { fn estimate_egress_fee( &self, @@ -188,14 +215,12 @@ impl FeeEstimationApi for SolTrackedData { }, ); - LAMPORTS_PER_SIGNATURE.saturating_add( - // It should never approach overflow but just in case - sp_std::cmp::min( - SolAmount::MAX as u128, - (self.priority_fee as u128 * compute_units_per_transfer as u128) - .div_ceil(MICROLAMPORTS_PER_LAMPORT.into()), - ) as SolAmount, - ) + let gas_fee = self.calculate_transaction_fee(compute_units_per_transfer); + + match asset { + assets::sol::Asset::Sol => gas_fee, + assets::sol::Asset::SolUsdc => gas_fee.saturating_add(TOKEN_ACCOUNT_RENT), + } } fn estimate_ingress_fee( &self, @@ -211,14 +236,7 @@ impl FeeEstimationApi for SolTrackedData { }, ); - LAMPORTS_PER_SIGNATURE.saturating_add( - // It should never approach overflow but just in case - sp_std::cmp::min( - SolAmount::MAX as u128, - (self.priority_fee as u128 * compute_units_per_fetch as u128) - .div_ceil(MICROLAMPORTS_PER_LAMPORT.into()), - ) as SolAmount, - ) + self.calculate_transaction_fee(compute_units_per_fetch) } } diff --git a/state-chain/chains/src/sol/api.rs b/state-chain/chains/src/sol/api.rs index 4072c268d1..ff1b9442bf 100644 --- a/state-chain/chains/src/sol/api.rs +++ b/state-chain/chains/src/sol/api.rs @@ -73,6 +73,7 @@ pub trait SolanaEnvironment: } /// IMPORTANT: This should only be used if the nonce has not been used to sign a transaction. +/// /// Once a nonce is actually used, it should ONLY be recovered via Witnessing. /// Only use this if you know what you are doing. pub trait RecoverDurableNonce { @@ -230,7 +231,7 @@ impl SolanaApi { durable_nonce, compute_price, ) - .map_err(|e| { + .inspect_err(|e| { // Vault Rotation call building NOT transactional - meaning when this fails, // storage is not rolled back. We must recover the durable nonce here, // since it has been taken from storage but not actually used. @@ -243,7 +244,6 @@ impl SolanaApi { durable_nonce ); Environment::recover_durable_nonce(durable_nonce.0); - e })?; Ok(Self { @@ -347,7 +347,7 @@ impl SolanaApi { ) }, } - .map_err(|e| { + .inspect_err(|e| { // CCM call building is NOT transactional - meaning when this fails, // storage is not rolled back. We must recover the durable nonce here, // since it has been taken from storage but not actually used. @@ -360,7 +360,6 @@ impl SolanaApi { durable_nonce ); Environment::recover_durable_nonce(durable_nonce.0); - e })?; Ok(Self { diff --git a/state-chain/chains/src/sol/sol_tx_core/bpf_loader_instructions.rs b/state-chain/chains/src/sol/sol_tx_core/bpf_loader_instructions.rs index c2addd263e..e69e4280ab 100644 --- a/state-chain/chains/src/sol/sol_tx_core/bpf_loader_instructions.rs +++ b/state-chain/chains/src/sol/sol_tx_core/bpf_loader_instructions.rs @@ -25,6 +25,7 @@ pub enum UpgradeableLoaderInstruction { /// # Account references /// 0. `[writable]` Buffer account to write program data to. /// 1. `[signer]` Buffer authority + /// /// Simplified since we don't use it anyway Write, diff --git a/state-chain/chains/src/sol/sol_tx_core/short_vec.rs b/state-chain/chains/src/sol/sol_tx_core/short_vec.rs index ca982ceb7e..f021e0a150 100644 --- a/state-chain/chains/src/sol/sol_tx_core/short_vec.rs +++ b/state-chain/chains/src/sol/sol_tx_core/short_vec.rs @@ -8,6 +8,8 @@ use serde::{ }; use sp_std::{convert::TryFrom, fmt, marker::PhantomData, vec::Vec}; +/// Represents a ShortU16. +/// /// Same as u16, but serialized with 1 to 3 bytes. If the value is above /// 0x7f, the top bit is set and the remaining value is stored in the next /// bytes. Each byte follows the same pattern until the 3rd byte. The 3rd diff --git a/state-chain/custom-rpc/Cargo.toml b/state-chain/custom-rpc/Cargo.toml index 01ccab8f5a..c473a89a75 100644 --- a/state-chain/custom-rpc/Cargo.toml +++ b/state-chain/custom-rpc/Cargo.toml @@ -8,16 +8,16 @@ edition = '2021' workspace = true [dependencies] -codec = { package = 'parity-scale-codec', version = '3.6.1' } +codec = { package = "parity-scale-codec", version = "3.6.12" } # Chainflip Runtime state-chain-runtime = { path = '../runtime' } anyhow = "1.0" -futures = "0.3.14" -jsonrpsee = { version = "0.16.2", features = ["full"] } +futures = "0.3.30" +jsonrpsee = { version = "0.23.2", features = ["full"] } hex = '0.4.3' -serde = { version = '1.0', features = ['derive'] } +serde = { version = "1.0.197", features = ['derive'] } thiserror = "1.0" log = { version = '0.4' } @@ -30,15 +30,16 @@ pallet-cf-pools = { path = "../pallets/cf-pools" } pallet-cf-witnesser = { path = "../pallets/cf-witnesser" } pallet-cf-swapping = { path = "../pallets/cf-swapping" } -sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-state-machine = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sc-client-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sc-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-state-machine = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sc-client-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [dev-dependencies] insta = { version = "1.34.0", features = ["json"] } diff --git a/state-chain/custom-rpc/src/lib.rs b/state-chain/custom-rpc/src/lib.rs index d11e31cd50..2cac8ca9b6 100644 --- a/state-chain/custom-rpc/src/lib.rs +++ b/state-chain/custom-rpc/src/lib.rs @@ -19,10 +19,10 @@ use cf_primitives::{ use cf_utilities::rpc::NumberOrHex; use core::ops::Range; use jsonrpsee::{ - core::{error::SubscriptionClosed, RpcResult}, + core::RpcResult, proc_macros::rpc, - types::error::{CallError, SubscriptionEmptyError}, - SubscriptionSink, + types::error::{ErrorObject, ErrorObjectOwned}, + PendingSubscriptionSink, }; use order_fills::OrderFills; use pallet_cf_governance::GovCallHash; @@ -62,7 +62,7 @@ use std::{ pub mod monitoring; pub mod order_fills; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcEpochState { pub blocks_per_epoch: u32, pub current_epoch_started_at: u32, @@ -81,7 +81,7 @@ impl From for RpcEpochState { } } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcRedemptionsInfo { pub total_balance: NumberOrHex, pub count: u32, @@ -94,7 +94,7 @@ impl From for RpcRedemptionsInfo { pub type RpcFeeImbalance = FeeImbalance; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcFlipSupply { pub total_supply: NumberOrHex, pub offchain_supply: NumberOrHex, @@ -108,7 +108,7 @@ impl From for RpcFlipSupply { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcMonitoringData { pub external_chains_height: ExternalChainsBlockHeight, pub btc_utxos: BtcUtxos, @@ -203,7 +203,7 @@ impl ScheduledSwap { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcLiquidityProviderBoostPoolInfo { pub fee_tier: u16, pub total_balance: U256, @@ -234,7 +234,7 @@ impl From<&LiquidityProviderBoostPoolInfo> for RpcLiquidityProviderBoostPoolInfo } #[allow(clippy::large_enum_variant)] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] #[serde(tag = "role", rename_all = "snake_case")] pub enum RpcAccountInfo { Unregistered { @@ -332,7 +332,7 @@ impl RpcAccountInfo { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcAccountInfoV2 { pub balance: NumberOrHex, pub bond: NumberOrHex, @@ -349,7 +349,7 @@ pub struct RpcAccountInfoV2 { pub restricted_balances: BTreeMap, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcPenalty { reputation_points: i32, suspension_duration_blocks: u32, @@ -357,7 +357,7 @@ pub struct RpcPenalty { type RpcSuspensions = Vec<(Offence, Vec<(u32, state_chain_runtime::AccountId)>)>; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcAuctionState { blocks_per_epoch: u32, current_epoch_started_at: u32, @@ -367,7 +367,7 @@ pub struct RpcAuctionState { min_active_bid: Option, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcSwapOutputV1 { // Intermediary amount, if there's any pub intermediary: Option, @@ -384,14 +384,14 @@ impl From for RpcSwapOutputV1 { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcFee { #[serde(flatten)] pub asset: Asset, pub amount: Amount, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcSwapOutputV2 { // Intermediary amount, if there's any pub intermediary: Option, @@ -420,12 +420,12 @@ impl From for RpcPoolInfo { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct PoolsEnvironment { pub fees: any::AssetMap>, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct IngressEgressEnvironment { pub minimum_deposit_amounts: any::AssetMap, pub ingress_fees: any::AssetMap>, @@ -435,22 +435,23 @@ pub struct IngressEgressEnvironment { pub channel_opening_fees: HashMap, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct FundingEnvironment { pub redemption_tax: NumberOrHex, pub minimum_funding_amount: NumberOrHex, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct SwappingEnvironment { maximum_swap_amounts: any::AssetMap>, network_fee_hundredth_pips: Permill, swap_retry_delay_blocks: u32, max_swap_retry_duration_blocks: u32, max_swap_request_duration_blocks: u32, + minimum_chunk_size: any::AssetMap, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct RpcEnvironment { ingress_egress: IngressEgressEnvironment, swapping: SwappingEnvironment, @@ -488,25 +489,25 @@ mod boost_pool_rpc { use super::*; - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] struct AccountAndAmount { account_id: AccountId32, amount: U256, } - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] struct PendingBoost { deposit_id: PrewitnessedDepositId, owed_amounts: Vec, } - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] struct PendingWithdrawal { account_id: AccountId32, pending_deposits: BTreeSet, } - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] pub struct BoostPoolDetailsRpc { fee_tier: u16, #[serde(flatten)] @@ -555,13 +556,13 @@ mod boost_pool_rpc { } } - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] struct PendingFees { deposit_id: PrewitnessedDepositId, fees: Vec, } - #[derive(Serialize, Deserialize)] + #[derive(Serialize, Deserialize, Clone)] pub struct BoostPoolFeesRpc { fee_tier: u16, #[serde(flatten)] @@ -996,20 +997,26 @@ where } } -fn to_rpc_error(e: E) -> jsonrpsee::core::Error { - CallError::from_std_error(e).into() +pub fn str_to_rpc_error(e: &str) -> ErrorObjectOwned { + ErrorObject::owned(jsonrpsee::types::error::CALL_EXECUTION_FAILED_CODE, e, Option::<()>::None) } -fn map_dispatch_error(e: DispatchErrorWithMessage) -> jsonrpsee::core::Error { - jsonrpsee::core::Error::from(match e { - DispatchErrorWithMessage::Module(message) => match std::str::from_utf8(&message) { - Ok(message) => anyhow::anyhow!("DispatchError: {message}"), - Err(error) => - anyhow::anyhow!("DispatchError: Unable to deserialize error message: '{error}'"), - }, - DispatchErrorWithMessage::Other(e) => - anyhow::anyhow!("DispatchError: {}", <&'static str>::from(e)), - }) +pub fn to_rpc_error(e: E) -> ErrorObjectOwned { + str_to_rpc_error(&format!("{}", e)[..]) +} + +fn map_dispatch_error(e: DispatchErrorWithMessage) -> ErrorObjectOwned { + str_to_rpc_error( + &(match e { + DispatchErrorWithMessage::Module(message) => match std::str::from_utf8(&message) { + Ok(message) => format!("DispatchError: {message}"), + Err(error) => + format!("DispatchError: Unable to deserialize error message: '{error}'"), + }, + DispatchErrorWithMessage::Other(e) => + format!("DispatchError: {}", <&'static str>::from(e)), + })[..], + ) } impl CustomApiServer for CustomRpc @@ -1365,7 +1372,7 @@ where Ok(amount) } }) - .map_err(|str| anyhow::anyhow!(str))?, + .map_err(str_to_rpc_error)?, additional_orders.map(|additional_orders| { additional_orders .into_iter() @@ -1605,6 +1612,12 @@ where .map_err(to_rpc_error)?, max_swap_retry_duration_blocks: swap_limits.max_swap_retry_duration_blocks, max_swap_request_duration_blocks: swap_limits.max_swap_request_duration_blocks, + minimum_chunk_size: any::AssetMap::try_from_fn(|asset| { + runtime_api + .cf_minimum_chunk_size(hash, asset) + .map_err(to_rpc_error) + .map(Into::into) + })?, }) } @@ -1670,28 +1683,28 @@ where fn cf_subscribe_pool_price( &self, - sink: SubscriptionSink, + pending_sink: PendingSubscriptionSink, from_asset: Asset, to_asset: Asset, - ) -> Result<(), SubscriptionEmptyError> { + ) { self.new_subscription( true, /* only_on_changes */ false, /* end_on_error */ - sink, + pending_sink, move |client, hash| client.runtime_api().cf_pool_price(hash, from_asset, to_asset), ) } fn cf_subscribe_pool_price_v2( &self, - sink: SubscriptionSink, + pending_sink: PendingSubscriptionSink, base_asset: Asset, quote_asset: Asset, - ) -> Result<(), SubscriptionEmptyError> { + ) { self.new_subscription( false, /* only_on_changes */ true, /* end_on_error */ - sink, + pending_sink, move |client, hash| { client .runtime_api() @@ -1705,23 +1718,23 @@ where fn cf_subscribe_scheduled_swaps( &self, - sink: SubscriptionSink, + pending_sink: PendingSubscriptionSink, base_asset: Asset, quote_asset: Asset, - ) -> Result<(), SubscriptionEmptyError> { + ) { // Check that the requested pool exists: let Ok(Ok(_)) = self.client.runtime_api().cf_pool_info( self.client.info().best_hash, base_asset, quote_asset, ) else { - return Err(SubscriptionEmptyError); + return; }; self.new_subscription( false, /* only_on_changes */ true, /* end_on_error */ - sink, + pending_sink, move |client, hash| { Ok::<_, ApiError>(SwapResponse { swaps: client @@ -1732,7 +1745,7 @@ where .collect(), }) }, - ) + ); } fn cf_scheduled_swaps( @@ -1760,17 +1773,17 @@ where fn cf_subscribe_prewitness_swaps( &self, - sink: SubscriptionSink, + pending_sink: PendingSubscriptionSink, base_asset: Asset, quote_asset: Asset, side: Side, - ) -> Result<(), SubscriptionEmptyError> { + ) { self.new_subscription( false, /* only_on_changes */ true, /* end_on_error */ - sink, + pending_sink, move |client, hash| { - Ok::<_, jsonrpsee::core::Error>(RpcPrewitnessedSwap { + Ok::<_, ErrorObjectOwned>(RpcPrewitnessedSwap { base_asset, quote_asset, side, @@ -1808,10 +1821,7 @@ where }) } - fn cf_subscribe_lp_order_fills( - &self, - sink: SubscriptionSink, - ) -> Result<(), SubscriptionEmptyError> { + fn cf_subscribe_lp_order_fills(&self, sink: PendingSubscriptionSink) { self.new_subscription_with_state( false, /* only_on_changes */ true, /* end_on_error */ @@ -1825,18 +1835,16 @@ where let pools_events = client.runtime_api().cf_lp_events(hash).map_err(to_rpc_error)?; - Ok::<_, jsonrpsee::core::Error>( - order_fills::order_fills_from_block_updates( - prev_pools, - &pools, - pools_events, - ), - ) + RpcResult::Ok(order_fills::order_fills_from_block_updates( + prev_pools, + &pools, + pools_events, + )) }) .transpose()? .unwrap_or_default(); - Ok::<_, jsonrpsee::core::Error>((fills, pools)) + RpcResult::Ok((fills, pools)) }, ) } @@ -1986,9 +1994,9 @@ where &self, only_on_changes: bool, end_on_error: bool, - sink: SubscriptionSink, + sink: PendingSubscriptionSink, f: F, - ) -> Result<(), SubscriptionEmptyError> { + ) { self.new_subscription_with_state( only_on_changes, end_on_error, @@ -2011,20 +2019,24 @@ where &self, only_on_changes: bool, end_on_error: bool, - mut sink: SubscriptionSink, + pending_sink: PendingSubscriptionSink, f: F, - ) -> Result<(), SubscriptionEmptyError> { - use futures::{future::FutureExt, stream::StreamExt}; + ) { + use futures::{stream::StreamExt, FutureExt}; let info = self.client.info(); let (initial_item, initial_state) = match f(&self.client, info.best_hash, None) { Ok(initial) => initial, Err(e) => { - let _ = sink.reject(jsonrpsee::core::Error::from( - sc_rpc_api::state::error::Error::Client(Box::new(e)), - )); - return Ok(()) + self.executor.spawn( + "cf-rpc-update-subscription", + Some("rpc"), + pending_sink + .reject(sc_rpc_api::state::error::Error::Client(Box::new(to_rpc_error(e)))) + .boxed(), + ); + return; }, }; @@ -2056,7 +2068,7 @@ where data: new_item, })) }, - Err(error) if end_on_error => Some(Err(error)), + Err(error) if end_on_error => Some(Err(to_rpc_error(error))), _ => None, }) } @@ -2066,16 +2078,8 @@ where self.executor.spawn( "cf-rpc-update-subscription", Some("rpc"), - async move { - if let SubscriptionClosed::Failed(err) = sink.pipe_from_try_stream(stream).await { - log::error!("Subscription closed due to error: {err:?}"); - sink.close(err); - } - } - .boxed(), + sc_rpc::utils::pipe_from_stream(pending_sink, stream).boxed(), ); - - Ok(()) } } @@ -2255,6 +2259,18 @@ mod test { swap_retry_delay_blocks: 5, max_swap_retry_duration_blocks: 600, max_swap_request_duration_blocks: 14400, + minimum_chunk_size: any::AssetMap { + eth: eth::AssetMap { + eth: 123_u32.into(), + flip: 0u32.into(), + usdc: 456_u32.into(), + usdt: 0u32.into(), + }, + btc: btc::AssetMap { btc: 789_u32.into() }, + dot: dot::AssetMap { dot: 0u32.into() }, + arb: arb::AssetMap { eth: 0u32.into(), usdc: 101112_u32.into() }, + sol: sol::AssetMap { sol: 0u32.into(), usdc: 0u32.into() }, + }, }, ingress_egress: IngressEgressEnvironment { minimum_deposit_amounts: any::AssetMap { diff --git a/state-chain/custom-rpc/src/snapshots/custom_rpc__test__environment_serialization.snap b/state-chain/custom-rpc/src/snapshots/custom_rpc__test__environment_serialization.snap index fd5e8f168f..4bc7fb4da1 100644 --- a/state-chain/custom-rpc/src/snapshots/custom_rpc__test__environment_serialization.snap +++ b/state-chain/custom-rpc/src/snapshots/custom_rpc__test__environment_serialization.snap @@ -2,4 +2,4 @@ source: state-chain/custom-rpc/src/lib.rs expression: "serde_json::to_value(env).unwrap()" --- -{"funding":{"minimum_funding_amount":0,"redemption_tax":0},"ingress_egress":{"channel_opening_fees":{"Arbitrum":1000,"Bitcoin":0,"Ethereum":1000,"Polkadot":1000,"Solana":1000},"egress_dust_limits":{"Arbitrum":{"ETH":0,"USDC":"0xffffffffffffffff"},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":"0x7ffffffffffffffe","USDT":0},"Polkadot":{"DOT":0},"Solana":{"SOL":0,"USDC":0}},"egress_fees":{"Arbitrum":{"ETH":0,"USDC":null},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":null,"USDT":null},"Polkadot":{"DOT":"0x7ffffffffffffffe"},"Solana":{"SOL":1,"USDC":null}},"ingress_fees":{"Arbitrum":{"ETH":0,"USDC":null},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":null,"USDT":null},"Polkadot":{"DOT":"0x7ffffffffffffffe"},"Solana":{"SOL":0,"USDC":null}},"minimum_deposit_amounts":{"Arbitrum":{"ETH":0,"USDC":"0xffffffffffffffff"},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffff","USDC":"0x7ffffffffffffffe","USDT":0},"Polkadot":{"DOT":0},"Solana":{"SOL":0,"USDC":0}},"witness_safety_margins":{"Arbitrum":null,"Bitcoin":3,"Ethereum":3,"Polkadot":null,"Solana":null}},"pools":{"fees":{"Arbitrum":{"ETH":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Bitcoin":{"BTC":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Ethereum":{"ETH":null,"FLIP":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":null,"USDT":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Polkadot":{"DOT":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Solana":{"SOL":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":null}}},"swapping":{"max_swap_request_duration_blocks":14400,"max_swap_retry_duration_blocks":600,"maximum_swap_amounts":{"Arbitrum":{"ETH":null,"USDC":0},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":null,"USDC":"0x7ffffffffffffffe","USDT":null},"Polkadot":{"DOT":null},"Solana":{"SOL":null,"USDC":null}},"network_fee_hundredth_pips":1000000,"swap_retry_delay_blocks":5}} +{"funding":{"minimum_funding_amount":0,"redemption_tax":0},"ingress_egress":{"channel_opening_fees":{"Arbitrum":1000,"Bitcoin":0,"Ethereum":1000,"Polkadot":1000,"Solana":1000},"egress_dust_limits":{"Arbitrum":{"ETH":0,"USDC":"0xffffffffffffffff"},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":"0x7ffffffffffffffe","USDT":0},"Polkadot":{"DOT":0},"Solana":{"SOL":0,"USDC":0}},"egress_fees":{"Arbitrum":{"ETH":0,"USDC":null},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":null,"USDT":null},"Polkadot":{"DOT":"0x7ffffffffffffffe"},"Solana":{"SOL":1,"USDC":null}},"ingress_fees":{"Arbitrum":{"ETH":0,"USDC":null},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffffffffffffffffffff","USDC":null,"USDT":null},"Polkadot":{"DOT":"0x7ffffffffffffffe"},"Solana":{"SOL":0,"USDC":null}},"minimum_deposit_amounts":{"Arbitrum":{"ETH":0,"USDC":"0xffffffffffffffff"},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":"0xffffffffffffffff","USDC":"0x7ffffffffffffffe","USDT":0},"Polkadot":{"DOT":0},"Solana":{"SOL":0,"USDC":0}},"witness_safety_margins":{"Arbitrum":null,"Bitcoin":3,"Ethereum":3,"Polkadot":null,"Solana":null}},"pools":{"fees":{"Arbitrum":{"ETH":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Bitcoin":{"BTC":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Ethereum":{"ETH":null,"FLIP":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":null,"USDT":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Polkadot":{"DOT":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}}},"Solana":{"SOL":{"limit_order_fee_hundredth_pips":0,"limit_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"limit_total_swap_inputs":{"base":"0x0","quote":"0x0"},"quote_asset":{"asset":"USDC","chain":"Ethereum"},"range_order_fee_hundredth_pips":100,"range_order_total_fees_earned":{"base":"0x0","quote":"0x0"},"range_total_swap_inputs":{"base":"0x0","quote":"0x0"}},"USDC":null}}},"swapping":{"max_swap_request_duration_blocks":14400,"max_swap_retry_duration_blocks":600,"maximum_swap_amounts":{"Arbitrum":{"ETH":null,"USDC":0},"Bitcoin":{"BTC":0},"Ethereum":{"ETH":0,"FLIP":null,"USDC":"0x7ffffffffffffffe","USDT":null},"Polkadot":{"DOT":null},"Solana":{"SOL":null,"USDC":null}},"minimum_chunk_size":{"Arbitrum":{"ETH":0,"USDC":101112},"Bitcoin":{"BTC":789},"Ethereum":{"ETH":123,"FLIP":0,"USDC":456,"USDT":0},"Polkadot":{"DOT":0},"Solana":{"SOL":0,"USDC":0}},"network_fee_hundredth_pips":1000000,"swap_retry_delay_blocks":5}} diff --git a/state-chain/node/Cargo.toml b/state-chain/node/Cargo.toml index 921f8f4112..7e0b717a15 100644 --- a/state-chain/node/Cargo.toml +++ b/state-chain/node/Cargo.toml @@ -32,61 +32,58 @@ utilities = { package = "utilities", path = "../../utilities" } sol-prim = { path = "../../foreign-chains/solana/sol-prim" } # Added by Chainflip -hex = "0.4" +hex = "0.4.3" hex-literal = "0.4.1" log = "0.4.16" # Substrate-node-template dependencies -clap = { version = "4.4.14", features = ["derive"] } -futures = { version = "0.3.21", features = ["thread-pool"] } +clap = { version = "4.5.3", features = ["derive"] } +futures = { version = "0.3.30", features = ["thread-pool"] } serde_json = { version = "1.0.111", features = ["arbitrary_precision"] } -sc-cli = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-executor = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-network = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-service = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-telemetry = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-keystore = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-transaction-pool-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-consensus = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-consensus = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-consensus-grandpa-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-client-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-keyring = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -pallet-transaction-payment = { default-features = false, git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +sc-cli = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-executor = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-network = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-service = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-telemetry = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-keystore = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-transaction-pool-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-consensus = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-consensus = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-consensus-grandpa-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-client-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-keyring = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +pallet-transaction-payment = { default-features = false, git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } # These dependencies are used for the node template's RPCs -jsonrpsee = { version = "0.16.2", features = ["full"] } -sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-blockchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-basic-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -pallet-transaction-payment-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -sc-rpc-spec-v2 = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +jsonrpsee = { version = "0.23.2", features = ["full"] } +sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-rpc-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-blockchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-basic-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +pallet-transaction-payment-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +sc-rpc-spec-v2 = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } # These dependencies are used for runtime benchmarking -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } -frame-benchmarking-cli = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } - -# CLI-specific dependencies -try-runtime-cli = { optional = true, git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } +frame-benchmarking-cli = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.6+1' } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = 'chainflip-substrate-1.15.2+2' } [features] default = [] @@ -95,19 +92,15 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", "cf-chains/runtime-benchmarks", - "cf-primitives/runtime-benchmarks", "frame-system/runtime-benchmarks", - "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "sol-prim/runtime-benchmarks", ] try-runtime = [ "state-chain-runtime/try-runtime", - "try-runtime-cli/try-runtime", "frame-system/try-runtime", "pallet-transaction-payment/try-runtime", "sp-runtime/try-runtime", - + "cf-chains/try-runtime", ] [package.metadata.deb] diff --git a/state-chain/node/src/chain_spec.rs b/state-chain/node/src/chain_spec.rs index 29f971fcb2..a42c910794 100644 --- a/state-chain/node/src/chain_spec.rs +++ b/state-chain/node/src/chain_spec.rs @@ -27,8 +27,8 @@ use state_chain_runtime::{ BLOCKS_PER_MINUTE_SOLANA, }, opaque::SessionKeys, - AccountId, BlockNumber, FlipBalance, RuntimeGenesisConfig, SetSizeParameters, Signature, - SolanaElectionsConfig, WASM_BINARY, + AccountId, BlockNumber, FlipBalance, SetSizeParameters, Signature, SolanaElectionsConfig, + WASM_BINARY, }; use std::{ @@ -73,7 +73,7 @@ where } /// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; /// generate session keys from Aura and Grandpa keys pub fn session_keys(aura: AuraId, grandpa: GrandpaId) -> SessionKeys { @@ -284,7 +284,7 @@ pub fn inner_cf_development_config( sol_usdc_token_vault_ata, sol_durable_nonces_and_accounts, } = get_environment_or_defaults(testnet::ENV); - Ok(ChainSpec::builder(wasm_binary, None) + Ok(ChainSpec::builder(wasm_binary, Default::default()) .with_name("CF Develop") .with_id("cf-dev") .with_protocol_id("flip-dev") @@ -421,7 +421,7 @@ macro_rules! network_spec { .to_be_bytes()[4..], ) ); - Ok(ChainSpec::builder(wasm_binary, None) + Ok(ChainSpec::builder(wasm_binary, Default::default()) .with_name(NETWORK_NAME) .with_id(NETWORK_NAME) .with_protocol_id(&protocol_id) @@ -666,9 +666,8 @@ fn testnet_genesis( .iter() .filter_map(|(id, _, funds)| authority_ids.contains(id).then_some(*funds)) .min() - .map(|bond| { + .inspect(|bond| { log::info!("Bond will be set to {:?} Flip", bond / FLIPPERINOS_PER_FLIP); - bond }) .expect("At least one authority is required"), authority_set_min_size: min_authorities, diff --git a/state-chain/node/src/chain_spec/common.rs b/state-chain/node/src/chain_spec/common.rs index d5841edc3f..6578dae90a 100644 --- a/state-chain/node/src/chain_spec/common.rs +++ b/state-chain/node/src/chain_spec/common.rs @@ -52,6 +52,10 @@ const REPUTATION_PENALTY_SMALL: i32 = REPUTATION_PER_HEARTBEAT; // 15 minutes to const REPUTATION_PENALTY_MEDIUM: i32 = REPUTATION_PER_HEARTBEAT * 4; // One hour to recover reputation const REPUTATION_PENALTY_LARGE: i32 = REPUTATION_PER_HEARTBEAT * 8; // Two hours to recover reputation +// A penalty of 1 is missing an Ethereum witnessing every 15 seconds. We do liveness every minute. +// which is equivalent to ~4 missed Ethereum witnessings. +const LIVENESS_REPUTATION_PENALTY: i32 = REPUTATION_PER_HEARTBEAT / 5; + /// The offences committable within the protocol and their respective reputation penalty and /// suspension durations. pub const PENALTIES: &[(Offence, (i32, BlockNumber))] = &[ @@ -61,6 +65,10 @@ pub const PENALTIES: &[(Offence, (i32, BlockNumber))] = &[ (Offence::MissedAuthorshipSlot, (REPUTATION_PENALTY_LARGE, HEARTBEAT_BLOCK_INTERVAL)), (Offence::FailedToBroadcastTransaction, (REPUTATION_PENALTY_MEDIUM, HEARTBEAT_BLOCK_INTERVAL)), (Offence::GrandpaEquivocation, (REPUTATION_PENALTY_LARGE, HEARTBEAT_BLOCK_INTERVAL * 5)), + ( + Offence::FailedLivenessCheck(cf_chains::ForeignChain::Solana), + (LIVENESS_REPUTATION_PENALTY, 0), + ), ]; /// Daily slashing rate 0.1% (of the bond) for offline authority diff --git a/state-chain/node/src/cli.rs b/state-chain/node/src/cli.rs index 98037eb886..b2c53aa709 100644 --- a/state-chain/node/src/cli.rs +++ b/state-chain/node/src/cli.rs @@ -41,11 +41,6 @@ pub enum Subcommand { #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Try-runtime has migrated to a standalone CLI - /// (). The subcommand exists as a stub and - /// deprecation notice. It will be removed entirely some time after Janurary 2024. - TryRuntime, - /// Db meta columns information. ChainInfo(sc_cli::ChainInfoCmd), } diff --git a/state-chain/node/src/command.rs b/state-chain/node/src/command.rs index 60162346ef..846a0016ed 100644 --- a/state-chain/node/src/command.rs +++ b/state-chain/node/src/command.rs @@ -116,17 +116,16 @@ pub fn run() -> sc_cli::Result<()> { // This switch needs to be in the client, since the client decides // which sub-commands it wants to support. match cmd { - BenchmarkCmd::Pallet(cmd) => { + BenchmarkCmd::Pallet(cmd) => if !cfg!(feature = "runtime-benchmarks") { - return Err( - "Runtime benchmarking wasn't enabled when building the node. \ + Err("Runtime benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." - .into(), - ) - } - - cmd.run::(config) - }, + .into()) + } else { + cmd.run_with_spec::, ()>(Some( + config.chain_spec, + )) + }, BenchmarkCmd::Block(cmd) => { let PartialComponents { client, .. } = service::new_partial(&config)?; cmd.run(client) @@ -172,12 +171,6 @@ pub fn run() -> sc_cli::Result<()> { } }) }, - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()), - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ - You can enable it with `--features try-runtime`." - .into()), Some(Subcommand::ChainInfo(cmd)) => { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run::(&config)) @@ -185,7 +178,18 @@ pub fn run() -> sc_cli::Result<()> { None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - service::new_full(config).map_err(sc_cli::Error::Service) + match config.network.network_backend { + sc_network::config::NetworkBackendType::Libp2p => service::new_full::< + sc_network::NetworkWorker< + state_chain_runtime::opaque::Block, + ::Hash, + >, + >(config) + .map_err(sc_cli::Error::Service), + sc_network::config::NetworkBackendType::Litep2p => + service::new_full::(config) + .map_err(sc_cli::Error::Service), + } }) }, } diff --git a/state-chain/node/src/service.rs b/state-chain/node/src/service.rs index af56f04256..f8d26d27f5 100644 --- a/state-chain/node/src/service.rs +++ b/state-chain/node/src/service.rs @@ -86,23 +86,30 @@ pub fn new_partial(config: &Configuration) -> Result { telemetry.as_ref().map(|x| x.handle()), )?; - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; + let cidp_client = client.clone(); let import_queue = sc_consensus_aura::import_queue::(ImportQueueParams { block_import: grandpa_block_import.clone(), justification_import: Some(Box::new(grandpa_block_import.clone())), client: client.clone(), - create_inherent_data_providers: move |_, ()| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + create_inherent_data_providers: move |parent_hash, _| { + let cidp_client = cidp_client.clone(); + async move { + let slot_duration = sc_consensus_aura::standalone::slot_duration_at( + &*cidp_client, + parent_hash, + )?; + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); - Ok((slot, timestamp)) + Ok((slot, timestamp)) + } }, spawner: &task_manager.spawn_essential_handle(), registry: config.prometheus_registry(), @@ -124,7 +131,11 @@ pub fn new_partial(config: &Configuration) -> Result { } /// Builds a new service for a full client. -pub fn new_full(config: Configuration) -> Result { +pub fn new_full< + N: sc_network::NetworkBackend::Hash>, +>( + config: Configuration, +) -> Result { use sc_consensus_grandpa_rpc::{Grandpa, GrandpaApiServer}; let sc_service::PartialComponents { @@ -138,33 +149,24 @@ pub fn new_full(config: Configuration) -> Result { other: (block_import, grandpa_link, mut telemetry), } = new_partial(&config)?; - let (shared_voter_state, shared_authority_set, justification_stream, finality_provider) = { - let (_grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( - client.clone(), - GRANDPA_JUSTIFICATION_PERIOD, - &(client.clone() as Arc<_>), - select_chain.clone(), - telemetry.as_ref().map(|x| x.handle()), - )?; - - ( - sc_consensus_grandpa::SharedVoterState::empty(), - grandpa_link.shared_authority_set().clone(), - grandpa_link.justification_stream(), - sc_consensus_grandpa::FinalityProofProvider::new_for_service( - backend.clone(), - Some(grandpa_link.shared_authority_set().clone()), - ), - ) - }; - - let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); - - let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); - let grandpa_protocol_name = - sc_consensus_grandpa::protocol_standard_name(&genesis_hash, &config.chain_spec); + let mut net_config = sc_network::config::FullNetworkConfiguration::< + Block, + ::Hash, + N, + >::new(&config.network); + let metrics = N::register_notification_metrics(config.prometheus_registry()); + + let peer_store_handle = net_config.peer_store_handle(); + let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( + &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), + &config.chain_spec, + ); let (grandpa_protocol_config, grandpa_notification_service) = - sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()); + sc_consensus_grandpa::grandpa_peers_set_config::<_, N>( + grandpa_protocol_name.clone(), + metrics.clone(), + peer_store_handle, + ); net_config.add_notification_protocol(grandpa_protocol_config); let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( @@ -184,6 +186,7 @@ pub fn new_full(config: Configuration) -> Result { block_announce_validator_builder: None, warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), block_relay: None, + metrics, })?; if config.offchain_worker.enabled { @@ -198,7 +201,7 @@ pub fn new_full(config: Configuration) -> Result { transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool.clone(), )), - network_provider: network.clone(), + network_provider: Arc::new(network.clone()), enable_http_requests: true, custom_extensions: |_| vec![], }) @@ -207,6 +210,30 @@ pub fn new_full(config: Configuration) -> Result { ); } + // [CF] Required for Grandpa RPC. + let (shared_voter_state, shared_authority_set, justification_stream, finality_provider) = { + let (_grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( + client.clone(), + GRANDPA_JUSTIFICATION_PERIOD, + &(client.clone() as Arc<_>), + select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), + )?; + + ( + sc_consensus_grandpa::SharedVoterState::empty(), + grandpa_link.shared_authority_set().clone(), + grandpa_link.justification_stream(), + sc_consensus_grandpa::FinalityProofProvider::new_for_service( + backend.clone(), + Some(grandpa_link.shared_authority_set().clone()), + ), + ) + }; + + // [CF] Required for Chainspec RPC. + let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); + let role = config.role.clone(); let force_authoring = config.force_authoring; let backoff_authoring_blocks: Option<()> = None; diff --git a/state-chain/pallets/cf-account-roles/Cargo.toml b/state-chain/pallets/cf-account-roles/Cargo.toml index 423aef3d7a..49595544f4 100644 --- a/state-chain/pallets/cf-account-roles/Cargo.toml +++ b/state-chain/pallets/cf-account-roles/Cargo.toml @@ -24,23 +24,23 @@ cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', defau log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, optional = true } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, optional = true } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -59,7 +59,6 @@ std = [ 'sp-std/std', ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-account-roles/src/mock.rs b/state-chain/pallets/cf-account-roles/src/mock.rs index 0c3f74788c..b633ad2100 100644 --- a/state-chain/pallets/cf-account-roles/src/mock.rs +++ b/state-chain/pallets/cf-account-roles/src/mock.rs @@ -1,15 +1,8 @@ #![cfg(test)] use crate::{self as pallet_cf_account_roles, Config}; +use frame_support::derive_impl; -use frame_support::{ - derive_impl, - traits::{ConstU16, ConstU64}, -}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; - -type AccountId = u64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -22,29 +15,10 @@ frame_support::construct_runtime!( #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); type OnNewAccount = MockAccountRoles; type OnKilledAccount = MockAccountRoles; - type SystemWeightInfo = (); - type SS58Prefix = ConstU16<42>; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl Config for Test { diff --git a/state-chain/pallets/cf-asset-balances/Cargo.toml b/state-chain/pallets/cf-asset-balances/Cargo.toml index fef5cec5bb..6152b554da 100644 --- a/state-chain/pallets/cf-asset-balances/Cargo.toml +++ b/state-chain/pallets/cf-asset-balances/Cargo.toml @@ -26,29 +26,29 @@ cf-utilities = { package = "utilities", path = '../../../utilities', default-fea log = { version = '0.4.16', default-features = false } -serde = { version = '1.0.126', default_features = false, features = [ +serde = { version = '1.0.197', default-features = false, features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -70,7 +70,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-asset-balances/src/benchmarking.rs b/state-chain/pallets/cf-asset-balances/src/benchmarking.rs index 8a4fcfaf0c..738da4a8ef 100644 --- a/state-chain/pallets/cf-asset-balances/src/benchmarking.rs +++ b/state-chain/pallets/cf-asset-balances/src/benchmarking.rs @@ -1,5 +1,3 @@ -#![cfg(feature = "runtime-benchmarks")] - use crate::{Config, Pallet}; use frame_benchmarking::v2::*; diff --git a/state-chain/pallets/cf-asset-balances/src/mock.rs b/state-chain/pallets/cf-asset-balances/src/mock.rs index 211634d591..b976ea27c7 100644 --- a/state-chain/pallets/cf-asset-balances/src/mock.rs +++ b/state-chain/pallets/cf-asset-balances/src/mock.rs @@ -11,10 +11,9 @@ use cf_traits::{ impl_mock_chainflip, impl_mock_runtime_safe_mode, mocks::{egress_handler::MockEgressHandler, key_provider::MockKeyProvider}, }; -use frame_support::{derive_impl, parameter_types, sp_runtime::app_crypto::sp_core::H160}; +use frame_support::{derive_impl, sp_runtime::app_crypto::sp_core::H160}; use frame_system as system; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use sp_runtime::traits::IdentityLookup; use cf_chains::ForeignChainAddress; @@ -28,36 +27,11 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-broadcast/Cargo.toml b/state-chain/pallets/cf-broadcast/Cargo.toml index a2da8c9b07..f0f63a60e5 100644 --- a/state-chain/pallets/cf-broadcast/Cargo.toml +++ b/state-chain/pallets/cf-broadcast/Cargo.toml @@ -25,27 +25,27 @@ cfe-events = { path = '../../cfe-events', default-features = false } cf-runtime-utilities = { path = '../../runtime-utilities', default-features = false } log = { version = '0.4.16', default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -65,10 +65,23 @@ std = [ 'scale-info/std', 'sp-std/std', 'serde/std', + 'cf-chains/std', + 'cfe-events/std', + 'cf-primitives/std', + 'cf-runtime-upgrade-utilities/std', + 'cf-runtime-utilities/std', + 'cf-traits/std', + 'codec/std', + 'frame-benchmarking?/std', + 'frame-support/std', + 'frame-system/std', + 'log/std', + 'scale-info/std', + 'sp-std/std', + 'serde/std', ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-broadcast/src/lib.rs b/state-chain/pallets/cf-broadcast/src/lib.rs index f8eb5498ac..b3cb2c8641 100644 --- a/state-chain/pallets/cf-broadcast/src/lib.rs +++ b/state-chain/pallets/cf-broadcast/src/lib.rs @@ -2,7 +2,6 @@ #![doc = include_str!("../README.md")] #![doc = include_str!("../../cf-doc-head.md")] #![feature(extract_if)] -#![feature(is_sorted)] mod benchmarking; mod mock; @@ -437,10 +436,8 @@ pub mod pallet { // Retry broadcast (allowed by broadcast barrier) let next_block = block_number.saturating_add(One::one()); - let id_limit = BroadcastBarriers::::get() - .first() - .copied() - .unwrap_or(BroadcastId::max_value()); + let id_limit = + BroadcastBarriers::::get().first().copied().unwrap_or(BroadcastId::MAX); delayed_retries.retain(|broadcast_id| { if *broadcast_id <= id_limit { // If retry is allowed by the barrier - start the retry. @@ -688,6 +685,9 @@ impl, I: 'static> Pallet { .ok_or(Error::::InvalidPayload)?; Self::remove_pending_broadcast(&broadcast_id); + AbortedBroadcasts::::mutate(|aborted| { + aborted.remove(&broadcast_id); + }); if IncomingKeyAndBroadcastId::::exists() { let (incoming_key, rotation_broadcast_id) = @@ -773,9 +773,8 @@ impl, I: 'static> Pallet { pub fn clean_up_broadcast_storage(broadcast_id: BroadcastId) -> Option> { AwaitingBroadcast::::remove(broadcast_id); TransactionMetadata::::remove(broadcast_id); - PendingApiCalls::::take(broadcast_id).map(|api_call| { + PendingApiCalls::::take(broadcast_id).inspect(|api_call| { TransactionOutIdToBroadcastId::::remove(api_call.transaction_out_id()); - api_call }) } @@ -1089,7 +1088,7 @@ impl, I: 'static> Broadcaster for Pallet { } fn expire_broadcast(broadcast_id: BroadcastId) { - // These would otherwise be cleaned up when the broadacst succeeds or aborts. + // These would otherwise be cleaned up when the broadcast succeeds or aborts. RequestSuccessCallbacks::::remove(broadcast_id); RequestFailureCallbacks::::remove(broadcast_id); Self::clean_up_broadcast_storage(broadcast_id); diff --git a/state-chain/pallets/cf-broadcast/src/migrations.rs b/state-chain/pallets/cf-broadcast/src/migrations.rs index 3cb192c8a8..1d9cadbd3e 100644 --- a/state-chain/pallets/cf-broadcast/src/migrations.rs +++ b/state-chain/pallets/cf-broadcast/src/migrations.rs @@ -3,9 +3,11 @@ use cf_runtime_upgrade_utilities::{PlaceholderMigration, VersionedMigration}; mod initialize_broadcast_timeout_storage; mod migrate_timeouts; +pub mod remove_aborted_broadcasts; pub type PalletMigration = ( VersionedMigration, initialize_broadcast_timeout_storage::Migration, 6, 7>, VersionedMigration, migrate_timeouts::Migration, 7, 8>, PlaceholderMigration, 8>, + // Migration 8->9 is SerializeSolanaBroadcastMigration in runtime lib. ); diff --git a/state-chain/pallets/cf-broadcast/src/migrations/remove_aborted_broadcasts.rs b/state-chain/pallets/cf-broadcast/src/migrations/remove_aborted_broadcasts.rs new file mode 100644 index 0000000000..3161b13277 --- /dev/null +++ b/state-chain/pallets/cf-broadcast/src/migrations/remove_aborted_broadcasts.rs @@ -0,0 +1,24 @@ +use crate::*; + +// Highest stale aborted broadcasts as of 3/10/2024: +// Mainnet +pub const ETHEREUM_MAX_ABORTED_BROADCAST_BERGHAIN: BroadcastId = 11592; +pub const ARBITRUM_MAX_ABORTED_BROADCAST_BERGHAIN: BroadcastId = 426; +// Perseverance testnet +pub const ETHEREUM_MAX_ABORTED_BROADCAST_PERSEVERANCE: BroadcastId = 1609; +pub const ARBITRUM_MAX_ABORTED_BROADCAST_PERSEVERANCE: BroadcastId = 665; +pub const POLKADOT_MAX_ABORTED_BROADCAST_PERSEVERANCE: BroadcastId = 634; + +pub fn remove_stale_and_all_older, I: 'static>(latest_stale_broadcast: BroadcastId) { + AbortedBroadcasts::::mutate(|aborted| { + aborted.retain(|id| id > &latest_stale_broadcast); + }); +} + +#[cfg(feature = "try-runtime")] +pub fn assert_removed, I: 'static>(latest_stale_broadcast: BroadcastId) { + let aborted_broadcasts = AbortedBroadcasts::::get(); + if let Some(first) = aborted_broadcasts.first() { + assert!(*first > latest_stale_broadcast, "Aborted broadcast {first} was not removed"); + } +} diff --git a/state-chain/pallets/cf-broadcast/src/mock.rs b/state-chain/pallets/cf-broadcast/src/mock.rs index c67d6bb255..ab76aa1130 100644 --- a/state-chain/pallets/cf-broadcast/src/mock.rs +++ b/state-chain/pallets/cf-broadcast/src/mock.rs @@ -24,8 +24,7 @@ use codec::{Decode, Encode}; use frame_support::{derive_impl, parameter_types, traits::UnfilteredDispatchable}; use frame_system::pallet_prelude::BlockNumberFor; use scale_info::TypeInfo; -use sp_core::{ConstU64, H256}; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use sp_core::ConstU64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -36,40 +35,13 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - thread_local! { pub static VALIDKEY: std::cell::RefCell = RefCell::new(true); } #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } pub const BROADCAST_EXPIRY_BLOCKS: BlockNumberFor = 4; diff --git a/state-chain/pallets/cf-broadcast/src/tests.rs b/state-chain/pallets/cf-broadcast/src/tests.rs index a14dee7f4a..d217a3003a 100644 --- a/state-chain/pallets/cf-broadcast/src/tests.rs +++ b/state-chain/pallets/cf-broadcast/src/tests.rs @@ -1562,3 +1562,27 @@ fn changing_broadcast_timeout() { ); }); } + +#[test] +fn aborted_broadcast_is_cleaned_up_on_success() { + new_test_ext().execute_with(|| { + // Abort a broadcast + let (broadcast_id, tx_id) = start_mock_broadcast(); + let nominee = ready_to_abort_broadcast(broadcast_id); + assert_ok!(Broadcaster::transaction_failed(RuntimeOrigin::signed(nominee), broadcast_id)); + assert!(AbortedBroadcasts::::get().contains(&broadcast_id)); + + // Witness a successful broadcast as if it was manually broadcast + assert_ok!(Broadcaster::transaction_succeeded( + RuntimeOrigin::root(), + tx_id, + Default::default(), + ETH_TX_FEE, + MOCK_TX_METADATA, + Default::default(), + )); + + // Storage should be cleaned, event emitted. + assert!(AbortedBroadcasts::::get().is_empty()); + }); +} diff --git a/state-chain/pallets/cf-cfe-interface/Cargo.toml b/state-chain/pallets/cf-cfe-interface/Cargo.toml index 141ecfa854..84bcb4c479 100644 --- a/state-chain/pallets/cf-cfe-interface/Cargo.toml +++ b/state-chain/pallets/cf-cfe-interface/Cargo.toml @@ -24,16 +24,16 @@ cfe-events = { path = "../../cfe-events", default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [features] default = ['std'] @@ -50,7 +50,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-chain-tracking/Cargo.toml b/state-chain/pallets/cf-chain-tracking/Cargo.toml index b34a72390e..def1522f53 100644 --- a/state-chain/pallets/cf-chain-tracking/Cargo.toml +++ b/state-chain/pallets/cf-chain-tracking/Cargo.toml @@ -25,22 +25,22 @@ cf-traits = { path = '../../traits', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1', default-features = false, optional = true } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2', default-features = false, optional = true } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1' } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2' } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -57,10 +57,10 @@ std = [ 'log/std', 'scale-info/std', 'sp-std/std', + "sp-runtime/std", ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-chain-tracking/src/mock.rs b/state-chain/pallets/cf-chain-tracking/src/mock.rs index 2328dfcd19..d78458dee5 100644 --- a/state-chain/pallets/cf-chain-tracking/src/mock.rs +++ b/state-chain/pallets/cf-chain-tracking/src/mock.rs @@ -5,9 +5,7 @@ use std::cell::RefCell; use crate::{self as pallet_cf_chain_tracking, Config}; use cf_chains::mocks::MockEthereum; use cf_traits::{self, impl_mock_chainflip}; -use frame_support::{derive_impl, parameter_types}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; +use frame_support::derive_impl; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -18,11 +16,6 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - thread_local! { pub static NOMINATION: std::cell::RefCell> = RefCell::new(Some(0xc001d00d_u64)); pub static VALIDKEY: std::cell::RefCell = RefCell::new(true); @@ -30,29 +23,7 @@ thread_local! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-elections/Cargo.toml b/state-chain/pallets/cf-elections/Cargo.toml index c8be23bd42..31f9edf330 100644 --- a/state-chain/pallets/cf-elections/Cargo.toml +++ b/state-chain/pallets/cf-elections/Cargo.toml @@ -27,27 +27,30 @@ cf-utilities = { package = 'utilities', path = '../../../utilities', default-fea # Non-substrate external deps bitvec = { default-features = false, version = '1.0', features = ['alloc'] } -itertools = { version = "0.13", default_features = false } +itertools = { version = "0.13", default-features = false } log = { version = '0.4.16', default-features = false } -serde = { default_features = false, version = '1.0.195', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } +nanorand = { version = '0.7.0', default-features = false, features = [ + 'wyrand', +] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', 'bit-vec', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -scale-info = { version = '2.10.0', default-features = false, features = [ +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', 'bit-vec', ] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } @@ -69,6 +72,8 @@ std = [ 'sp-core/std', 'log/std', 'serde/std', + "frame-benchmarking?/std", + "itertools/use_std", ] try-runtime = [ 'frame-support/try-runtime', @@ -77,7 +82,6 @@ try-runtime = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-elections/src/benchmarking.rs b/state-chain/pallets/cf-elections/src/benchmarking.rs index 91ff037571..207b2f6aa6 100644 --- a/state-chain/pallets/cf-elections/src/benchmarking.rs +++ b/state-chain/pallets/cf-elections/src/benchmarking.rs @@ -1,5 +1,3 @@ -#![cfg(feature = "runtime-benchmarks")] - use crate::{ bitmap_components::ElectionBitmapComponents, electoral_system::{ @@ -24,6 +22,7 @@ use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec}; use crate::Call; +#[allow(clippy::multiple_bound_locations)] #[instance_benchmarks( where <<>::ElectoralSystem as ElectoralSystem>::Vote as VoteStorage>::Vote: BenchmarkValue, diff --git a/state-chain/pallets/cf-elections/src/electoral_systems.rs b/state-chain/pallets/cf-elections/src/electoral_systems.rs index 306cb2a605..686b8e25fd 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems.rs @@ -2,6 +2,7 @@ pub mod blockchain; pub mod change; pub mod composite; pub mod egress_success; +pub mod liveness; #[cfg(test)] pub mod mock; pub mod monotonic_median; diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/blockchain/delta_based_ingress.rs b/state-chain/pallets/cf-elections/src/electoral_systems/blockchain/delta_based_ingress.rs index 06be5c38bf..d92516010c 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/blockchain/delta_based_ingress.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/blockchain/delta_based_ingress.rs @@ -198,9 +198,9 @@ where None => (None, Some(*consensus_ingress_total)), Some(pending_ingress_total) => { if pending_ingress_total.block_number < - consensus_ingress_total.block_number && pending_ingress_total - .amount < - consensus_ingress_total.amount + consensus_ingress_total.block_number && + pending_ingress_total.amount < + consensus_ingress_total.amount { if pending_ingress_total.block_number <= *chain_tracking { ( diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/composite.rs b/state-chain/pallets/cf-elections/src/electoral_systems/composite.rs index 602b9fa791..c2da030d6c 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/composite.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/composite.rs @@ -31,6 +31,7 @@ mod tags { pub struct C; pub struct D; pub struct EE; + pub struct FF; } macro_rules! generate_electoral_system_tuple_impls { @@ -39,7 +40,7 @@ macro_rules! generate_electoral_system_tuple_impls { // We use the type names as variable names. #[allow(non_snake_case)] // In the 1/identity case, no invalid combinations are possible, so error cases are unreachable. - #[allow(unreachable_patterns)] + // Macro expands tuples, but only uses 1 element in some cases. #[allow(unused_variables)] pub mod $module { @@ -595,4 +596,4 @@ macro_rules! generate_electoral_system_tuple_impls { }; } -generate_electoral_system_tuple_impls!(tuple_5_impls: ((A, A0), (B, B0), (C, C0), (D, D0), (EE, E0))); +generate_electoral_system_tuple_impls!(tuple_6_impls: ((A, A0), (B, B0), (C, C0), (D, D0), (EE, E0), (FF, F0))); diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/liveness.rs b/state-chain/pallets/cf-elections/src/electoral_systems/liveness.rs new file mode 100644 index 0000000000..120c0ec808 --- /dev/null +++ b/state-chain/pallets/cf-elections/src/electoral_systems/liveness.rs @@ -0,0 +1,176 @@ +use sp_std::collections::btree_set::BTreeSet; + +use crate::{ + electoral_system::{ + AuthorityVoteOf, ConsensusVote, ConsensusVotes, ElectionIdentifierOf, ElectionReadAccess, + ElectionWriteAccess, ElectoralSystem, ElectoralWriteAccess, VotePropertiesOf, + }, + vote_storage::{self, VoteStorage}, + CorruptStorageError, +}; +use cf_primitives::AuthorityCount; +use cf_utilities::success_threshold_from_share_count; +use frame_support::{ + pallet_prelude::{MaybeSerializeDeserialize, Member}, + Parameter, +}; + +use itertools::Itertools; +use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; + +pub struct Liveness { + _phantom: core::marker::PhantomData<( + ChainBlockNumber, + ChainBlockHash, + BlockNumber, + Hook, + ValidatorId, + )>, +} + +pub trait OnCheckComplete { + fn on_check_complete(validator_ids: BTreeSet); +} + +impl< + ChainBlockNumber: Member + Parameter + Eq + From + Into + Copy, + ChainBlockHash: Member + Parameter + Eq + Ord, + BlockNumber: Member + + Parameter + + Eq + + MaybeSerializeDeserialize + + frame_support::sp_runtime::Saturating + + Ord + + Copy, + Hook: OnCheckComplete + 'static, + ValidatorId: Member + Parameter + Ord + MaybeSerializeDeserialize, + > ElectoralSystem for Liveness +{ + type ValidatorId = ValidatorId; + type ElectoralUnsynchronisedState = (); + type ElectoralUnsynchronisedStateMapKey = (); + type ElectoralUnsynchronisedStateMapValue = (); + + type ElectoralUnsynchronisedSettings = (); + // How many SC blocks to wait before we consider the election complete. + type ElectoralSettings = BlockNumber; + type ElectionIdentifierExtra = (); + + // The external chain block number that the engines will get the hash for. + type ElectionProperties = ChainBlockNumber; + + // The SC block number that we started the election at. + type ElectionState = BlockNumber; + type Vote = vote_storage::bitmap::Bitmap; + type Consensus = BTreeSet; + // The current SC block number, and the current chain tracking height. + type OnFinalizeContext = (BlockNumber, ChainBlockNumber); + type OnFinalizeReturn = (); + + fn generate_vote_properties( + _election_identifier: ElectionIdentifierOf, + _previous_vote: Option<(VotePropertiesOf, AuthorityVoteOf)>, + _vote: &::PartialVote, + ) -> Result, CorruptStorageError> { + Ok(()) + } + + fn is_vote_desired>( + _election_identifier: ElectionIdentifierOf, + _election_access: &ElectionAccess, + _current_vote: Option<(VotePropertiesOf, AuthorityVoteOf)>, + ) -> Result { + Ok(true) + } + + fn on_finalize>( + electoral_access: &mut ElectoralAccess, + election_identifiers: Vec>, + (current_sc_block, current_chain_tracking_number): &Self::OnFinalizeContext, + ) -> Result { + fn block_number_to_check + From>( + current_chain_tracking_number: ChainBlockNumber, + ) -> ChainBlockNumber { + use nanorand::{Rng, WyRand}; + let height: u64 = current_chain_tracking_number.into(); + + // 100 seems a reasonable number for all chains, fast or slow, most running nodes will + // have at least 100 blocks worth of state for any particular chain, while still + // providing enough variation. + const RANGE: u64 = 100; + WyRand::new_seed(height) + .generate_range((height.saturating_sub(RANGE))..height) + .into() + } + + if let Some(election_identifier) = election_identifiers + .into_iter() + .at_most_one() + .map_err(|_| CorruptStorageError::new())? + { + let mut election_access = electoral_access.election_mut(election_identifier)?; + + // Is the block the election started at + the duration we want the check to stay open + // for less than or equal to the current SC block? + if election_access.state()?.saturating_add(election_access.settings()?) <= + *current_sc_block + { + if let Some(bad_validators) = election_access.check_consensus()?.has_consensus() { + if !bad_validators.is_empty() { + Hook::on_check_complete(bad_validators); + } + } + election_access.delete(); + electoral_access.new_election( + (), + block_number_to_check(*current_chain_tracking_number), + *current_sc_block, + )?; + } + } else { + electoral_access.new_election( + (), + block_number_to_check(*current_chain_tracking_number), + *current_sc_block, + )?; + } + + Ok(()) + } + + fn check_consensus>( + _election_identifier: ElectionIdentifierOf, + _election_access: &ElectionAccess, + _previous_consensus: Option<&Self::Consensus>, + consensus_votes: ConsensusVotes, + ) -> Result, CorruptStorageError> { + let num_authorities = consensus_votes.num_authorities(); + let success_threshold = success_threshold_from_share_count(num_authorities); + + let mut grouped_votes = BTreeMap::new(); + for ConsensusVote { vote, validator_id } in consensus_votes.votes { + grouped_votes + .entry(vote.map(|v| v.1)) + .or_insert_with(Vec::new) + .push(validator_id); + } + + let (consensus_validators, non_consensus_validators): (Vec<_>, Vec<_>) = + grouped_votes.into_iter().partition(|(_, validator_ids)| { + validator_ids.len() as AuthorityCount >= success_threshold + }); + + Ok(if let Some((Some(_block_hash), _)) = consensus_validators.first() { + // If we have consensus on a value then we punish all validators that didn't vote for + // that value. + Some( + non_consensus_validators + .into_iter() + .flat_map(|(_, validator_ids)| validator_ids) + .collect(), + ) + } else { + None + }) + } +} diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs b/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs index 0b4afb119a..c89afb2c77 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs @@ -76,7 +76,8 @@ where Self { initial_election_state: Some((extra, properties, state)), ..self } } - pub fn build(self) -> TestContext { + // Useful for testing check_consensus since we already have an election. + pub fn build_with_initial_election(self) -> TestContext { let setup = self.clone(); let mut electoral_access = MockAccess::::new( self.unsynchronised_state, @@ -96,6 +97,19 @@ where TestContext { setup, electoral_access } } + + // We may want to test initialisation of elections within on finalise, so *don't* want to + // initialise an election in the utilities. + pub fn build(self) -> TestContext { + TestContext { + setup: self.clone(), + electoral_access: MockAccess::::new( + self.unsynchronised_state, + self.unsynchronised_settings, + self.electoral_settings, + ), + } + } } impl TestContext { @@ -122,7 +136,8 @@ impl TestContext { .check_consensus(None, consensus_votes) .unwrap(); - assert_eq!(new_consensus, expected_consensus); + // Should assert on some condition about the consensus. + assert_eq!(new_consensus.clone(), expected_consensus); self.inner_force_consensus_update( current_election_id, diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests.rs index cb0b0e12f2..d79a0c72d7 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/tests.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests.rs @@ -4,6 +4,7 @@ pub(crate) use crate::register_checks; pub mod change; pub mod egress_success; +pub mod liveness; pub mod monotonic_median; pub mod unsafe_median; pub mod utils; diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests/change.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests/change.rs index 19f2685a3d..6af37c8a1b 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/tests/change.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests/change.rs @@ -46,7 +46,7 @@ const SUCCESS_THRESHOLD: AuthorityCount = cf_utilities::success_threshold_from_share_count(AUTHORITY_COUNT); fn with_default_state() -> TestContext { - TestSetup::::default().build() + TestSetup::::default().build_with_initial_election() } fn generate_votes( diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests/egress_success.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests/egress_success.rs index 30dd5a459e..857c35428c 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/tests/egress_success.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests/egress_success.rs @@ -46,7 +46,7 @@ const SUCCESS_THRESHOLD: AuthorityCount = cf_utilities::success_threshold_from_share_count(AUTHORITY_COUNT); fn with_default_state() -> TestContext { - TestSetup::::default().build() + TestSetup::::default().build_with_initial_election() } fn generate_votes( diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests/liveness.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests/liveness.rs new file mode 100644 index 0000000000..e602553afd --- /dev/null +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests/liveness.rs @@ -0,0 +1,196 @@ +use sp_std::collections::btree_set::BTreeSet; + +use super::{mocks::*, register_checks}; +use crate::{ + electoral_system::{ConsensusVote, ConsensusVotes}, + electoral_systems::liveness::*, +}; + +pub type ChainBlockHash = u64; +pub type ChainBlockNumber = u64; +pub type BlockNumber = u32; +pub type ValidatorId = u16; + +thread_local! { + pub static HOOK_CALLED_COUNT: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +struct MockHook; + +impl OnCheckComplete for MockHook { + fn on_check_complete(_validator_ids: BTreeSet) { + HOOK_CALLED_COUNT.with(|hook_called| hook_called.set(hook_called.get() + 1)); + } +} + +impl MockHook { + pub fn called() -> u8 { + HOOK_CALLED_COUNT.with(|hook_called| hook_called.get()) + } +} + +type SimpleLiveness = + Liveness; + +register_checks! { + SimpleLiveness { + only_one_election(_pre, post) { + let election_ids = post.election_identifiers(); + assert_eq!(election_ids.len(), 1, "Only one election should exist."); + }, + hook_called_once(_pre, _post) { + assert_eq!(HOOK_CALLED_COUNT.with(|hook_called| hook_called.get()), 1, "Hook should have been called once so far!"); + }, + hook_called_twice(_pre, _post) { + assert_eq!(HOOK_CALLED_COUNT.with(|hook_called| hook_called.get()), 2, "Hook should have been called twice so far!"); + }, + hook_not_called(_pre, _post) { + assert_eq!( + HOOK_CALLED_COUNT.with(|hook_called| hook_called.get()), + 0, + "Hook should not have been called!" + ); + }, + } +} + +const CORRECT_VOTE: ChainBlockHash = 69420; +const INCORRECT_VOTE: ChainBlockHash = 666; + +fn generate_votes( + correct_voters: BTreeSet, + incorrect_voters: BTreeSet, + did_not_vote: BTreeSet, +) -> ConsensusVotes { + ConsensusVotes { + votes: correct_voters + .into_iter() + .map(|v| ConsensusVote { vote: Some(((), CORRECT_VOTE)), validator_id: v }) + .chain( + incorrect_voters + .into_iter() + .map(|v| ConsensusVote { vote: Some(((), INCORRECT_VOTE)), validator_id: v }), + ) + .chain(did_not_vote.into_iter().map(|v| ConsensusVote { vote: None, validator_id: v })) + .collect(), + } +} + +fn with_default_state() -> TestContext { + TestSetup::::default().build_with_initial_election() +} + +#[test] +fn all_vote_for_same_value_means_no_bad_validators() { + with_default_state().expect_consensus( + generate_votes((0..50).collect(), BTreeSet::default(), BTreeSet::default()), + Some(BTreeSet::default()), + ); +} + +#[test] +fn no_votes_no_one_bad_validators() { + with_default_state().expect_consensus( + generate_votes(BTreeSet::default(), BTreeSet::default(), (0..50).collect()), + None, + ); +} + +#[test] +fn consensus_with_bad_voters() { + let correct_voters: BTreeSet<_> = (0..50).collect(); + let incorrect_voters: BTreeSet<_> = (50..60).collect(); + let non_voters: BTreeSet<_> = (60..70).collect(); + + with_default_state().expect_consensus( + generate_votes(correct_voters.clone(), incorrect_voters.clone(), BTreeSet::default()), + Some(incorrect_voters.clone()), + ); + + with_default_state().expect_consensus( + generate_votes(correct_voters.clone(), BTreeSet::default(), non_voters.clone()), + Some(non_voters.clone()), + ); + + with_default_state().expect_consensus( + generate_votes(correct_voters, incorrect_voters.clone(), non_voters.clone()), + Some(incorrect_voters.into_iter().chain(non_voters).collect()), + ); +} + +#[test] +fn on_finalize() { + const INIT_BLOCK: BlockNumber = 100; + const BLOCKS_BETWEEN_CHECKS: BlockNumber = 10; + const INIT_CHAIN_TRACKING_BLOCK: ChainBlockNumber = 1000; + + let correct_voters: BTreeSet<_> = (0..50).collect(); + let non_voters: BTreeSet<_> = (60..70).collect(); + + TestSetup::default() + .with_electoral_settings(BLOCKS_BETWEEN_CHECKS) + .build() + .test_on_finalize( + &(INIT_BLOCK, INIT_CHAIN_TRACKING_BLOCK), + |_| assert_eq!(MockHook::called(), 0, "Hook should not have been called!"), + vec![ + Check::::only_one_election(), + Check::::hook_not_called(), + ], + ) + .expect_consensus( + generate_votes(correct_voters.clone(), BTreeSet::default(), non_voters.clone()), + Some(non_voters.clone()), + ) + .test_on_finalize( + // check duration has not yet elapsed, so no change + &(INIT_BLOCK + BLOCKS_BETWEEN_CHECKS - 1, INIT_CHAIN_TRACKING_BLOCK), + |_| {}, + vec![ + Check::::only_one_election(), + Check::::hook_not_called(), + ], + ) + .test_on_finalize( + &(INIT_BLOCK + BLOCKS_BETWEEN_CHECKS, INIT_CHAIN_TRACKING_BLOCK), + |_| {}, + vec![ + Check::::only_one_election(), + Check::::hook_called_once(), + ], + ) + .test_on_finalize( + // we should have reset to the hook not being called, and there's still just one + // election + &(INIT_BLOCK + BLOCKS_BETWEEN_CHECKS + 1, INIT_CHAIN_TRACKING_BLOCK), + |_| {}, + vec![ + Check::::only_one_election(), + Check::::hook_called_once(), + ], + ) + // there have been no votes, so still only called once + .test_on_finalize( + // we should have reset to the hook not being called, and there's still just one + // election + &(INIT_BLOCK + BLOCKS_BETWEEN_CHECKS * 2, INIT_CHAIN_TRACKING_BLOCK), + |_| {}, + vec![ + Check::::only_one_election(), + Check::::hook_called_once(), + ], + ) + .expect_consensus( + generate_votes(correct_voters.clone(), BTreeSet::default(), non_voters.clone()), + Some(non_voters), + ) + // we have votes now and expect nodes to be punished by having the hook called again. + .test_on_finalize( + &(INIT_BLOCK + BLOCKS_BETWEEN_CHECKS * 3, INIT_CHAIN_TRACKING_BLOCK), + |_| {}, + vec![ + Check::::only_one_election(), + Check::::hook_called_twice(), + ], + ); +} diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests/monotonic_median.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests/monotonic_median.rs index a3b55a3ad8..3628ab180b 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/tests/monotonic_median.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests/monotonic_median.rs @@ -15,7 +15,7 @@ fn with_default_setup() -> TestSetup { } fn with_default_context() -> TestContext { - with_default_setup().build() + with_default_setup().build_with_initial_election() } pub struct MockHook; @@ -131,7 +131,7 @@ fn finalize_election_state_can_not_decrease() { MockHook::reset(); with_default_setup() .with_unsynchronised_state(INTITIAL_STATE) - .build() + .build_with_initial_election() // It's possible for authorities to come to consensus on a lower state, // but this should not change the unsynchronised state. .force_consensus_update(ConsensusStatus::Gained { most_recent: None, new: new_state }) diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/tests/unsafe_median.rs b/state-chain/pallets/cf-elections/src/electoral_systems/tests/unsafe_median.rs index 36bcfcfd19..28f07e626c 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/tests/unsafe_median.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/tests/unsafe_median.rs @@ -16,7 +16,7 @@ fn with_default_setup() -> TestSetup { } fn with_default_context() -> TestContext { - with_default_setup().build() + with_default_setup().build_with_initial_election() } register_checks! { diff --git a/state-chain/pallets/cf-elections/src/lib.rs b/state-chain/pallets/cf-elections/src/lib.rs index e1932cbc6c..90c6678696 100644 --- a/state-chain/pallets/cf-elections/src/lib.rs +++ b/state-chain/pallets/cf-elections/src/lib.rs @@ -102,7 +102,6 @@ //! or reconstructed from the others is also configured via that trait. #![feature(try_find)] -#![feature(option_take_if)] #![cfg_attr(test, feature(closure_track_caller))] #![cfg_attr(not(feature = "std"), no_std)] #![doc = include_str!("../README.md")] @@ -124,7 +123,7 @@ use frame_system::pallet_prelude::*; pub use pallet::*; -pub const PALLET_VERSION: StorageVersion = StorageVersion::new(0); +pub const PALLET_VERSION: StorageVersion = StorageVersion::new(1); pub use pallet::UniqueMonotonicIdentifier; @@ -504,7 +503,7 @@ pub mod pallet { /// Stores governance-controlled settings regarding the elections. These settings can be changed /// at anytime, but that change will only affect newly created elections. #[pallet::storage] - pub(crate) type ElectoralSettings, I: 'static = ()> = StorageMap< + pub type ElectoralSettings, I: 'static = ()> = StorageMap< _, Twox64Concat, UniqueMonotonicIdentifier, diff --git a/state-chain/pallets/cf-elections/src/mock.rs b/state-chain/pallets/cf-elections/src/mock.rs index 28384de4db..3d3ea08aad 100644 --- a/state-chain/pallets/cf-elections/src/mock.rs +++ b/state-chain/pallets/cf-elections/src/mock.rs @@ -82,6 +82,7 @@ impl TestSetup { #[derive(Clone, Debug)] pub struct TestContext { + #[allow(dead_code)] pub setup: TestSetup, pub umis: Vec, } diff --git a/state-chain/pallets/cf-elections/src/vote_storage/composite.rs b/state-chain/pallets/cf-elections/src/vote_storage/composite.rs index 5ba58c7c44..88e1099710 100644 --- a/state-chain/pallets/cf-elections/src/vote_storage/composite.rs +++ b/state-chain/pallets/cf-elections/src/vote_storage/composite.rs @@ -44,7 +44,7 @@ macro_rules! generate_vote_storage_tuple_impls { } // In the 1/identity case, no invalid combinations are possible, so error cases are unreachable. - #[allow(unreachable_patterns)] + #[allow(non_snake_case)] #[allow(unused_variables)] impl<$($t: VoteStorage),*> VoteStorage for ($($t,)*) { @@ -109,7 +109,7 @@ macro_rules! generate_vote_storage_tuple_impls { match get_shared_data(shared_data_hash)? { Some(CompositeSharedData::$t(shared_data)) => Ok(Some(shared_data)), None => Ok(None), - _ => Err(CorruptStorageError::new()), + _ => Err(CorruptStorageError::new()) } }, )?.map(|(properties, authority_vote)| { @@ -274,8 +274,4 @@ macro_rules! generate_vote_storage_tuple_impls { } } -generate_vote_storage_tuple_impls!(tuple_1_impls: (A)); -generate_vote_storage_tuple_impls!(tuple_2_impls: (A, B)); -generate_vote_storage_tuple_impls!(tuple_3_impls: (A, B, C)); -generate_vote_storage_tuple_impls!(tuple_4_impls: (A, B, C, D)); -generate_vote_storage_tuple_impls!(tuple_5_impls: (A, B, C, D, EE)); +generate_vote_storage_tuple_impls!(tuple_6_impls: (A, B, C, D, EE, FF)); diff --git a/state-chain/pallets/cf-elections/src/vote_storage/individual/composite.rs b/state-chain/pallets/cf-elections/src/vote_storage/individual/composite.rs index e85eb5de33..6258427b69 100644 --- a/state-chain/pallets/cf-elections/src/vote_storage/individual/composite.rs +++ b/state-chain/pallets/cf-elections/src/vote_storage/individual/composite.rs @@ -74,10 +74,6 @@ macro_rules! generate_individual_vote_storage_tuple_impls { } } } - -generate_individual_vote_storage_tuple_impls!(tuple_0_impls: ()); -generate_individual_vote_storage_tuple_impls!(tuple_1_impls: (A)); +#[cfg(test)] generate_individual_vote_storage_tuple_impls!(tuple_2_impls: (A, B)); -generate_individual_vote_storage_tuple_impls!(tuple_3_impls: (A, B, C)); -generate_individual_vote_storage_tuple_impls!(tuple_4_impls: (A, B, C, D)); -generate_individual_vote_storage_tuple_impls!(tuple_5_impls: (A, B, C, D, EE)); +generate_individual_vote_storage_tuple_impls!(tuple_6_impls: (A, B, C, D, EE, FF)); diff --git a/state-chain/pallets/cf-emissions/Cargo.toml b/state-chain/pallets/cf-emissions/Cargo.toml index 6d57c11311..18f1523f8e 100644 --- a/state-chain/pallets/cf-emissions/Cargo.toml +++ b/state-chain/pallets/cf-emissions/Cargo.toml @@ -25,20 +25,20 @@ cf-traits = { path = '../../traits', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -46,9 +46,9 @@ serde = { default_features = false, version = '1.0.126', features = [ [dev-dependencies] pallet-cf-flip = { path = '../cf-flip' } cf-test-utilities = { path = '../../test-utilities' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -69,7 +69,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-emissions/src/lib.rs b/state-chain/pallets/cf-emissions/src/lib.rs index ffd6be433b..521ff7013a 100644 --- a/state-chain/pallets/cf-emissions/src/lib.rs +++ b/state-chain/pallets/cf-emissions/src/lib.rs @@ -321,13 +321,15 @@ impl Pallet { None, ) .map_err(Into::into) - .and_then(|result @ ScheduledEgressDetails { egress_amount, fee_withheld, .. }| { - if egress_amount < BURN_FEE_MULTIPLE * fee_withheld { - Err(Error::::FlipBalanceBelowBurnThreshold.into()) - } else { - Ok(result) - } - }) + .and_then( + |result @ ScheduledEgressDetails { egress_amount, fee_withheld, .. }| { + if egress_amount < BURN_FEE_MULTIPLE * fee_withheld { + Err(Error::::FlipBalanceBelowBurnThreshold.into()) + } else { + Ok(result) + } + }, + ) }) { Ok(ScheduledEgressDetails { egress_id, egress_amount, .. }) => { T::Issuance::burn_offchain(egress_amount.into()); diff --git a/state-chain/pallets/cf-emissions/src/mock.rs b/state-chain/pallets/cf-emissions/src/mock.rs index 36d8fc7763..944f24bd6e 100644 --- a/state-chain/pallets/cf-emissions/src/mock.rs +++ b/state-chain/pallets/cf-emissions/src/mock.rs @@ -20,8 +20,6 @@ use frame_support::{derive_impl, parameter_types, traits::Imbalance}; use frame_system as system; use scale_info::TypeInfo; use sp_arithmetic::Permill; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; pub type AccountId = u64; @@ -42,36 +40,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-environment/Cargo.toml b/state-chain/pallets/cf-environment/Cargo.toml index 2f4b1bbf37..0d83c0d9f7 100644 --- a/state-chain/pallets/cf-environment/Cargo.toml +++ b/state-chain/pallets/cf-environment/Cargo.toml @@ -19,7 +19,7 @@ workspace = true cf-chains = { path = '../../chains', default-features = false } cf-primitives = { path = '../../primitives', default-features = false } cf-traits = { path = '../../traits', default-features = false } -serde = { default_features = false, version = '1.0.195', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -28,22 +28,22 @@ log = { version = '0.4.16', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -64,7 +64,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-environment/src/mock.rs b/state-chain/pallets/cf-environment/src/mock.rs index c49275c00e..8cf6c3514f 100644 --- a/state-chain/pallets/cf-environment/src/mock.rs +++ b/state-chain/pallets/cf-environment/src/mock.rs @@ -13,9 +13,7 @@ use cf_traits::{ }; use frame_support::{derive_impl, parameter_types}; use sp_core::{H160, H256}; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; -type AccountId = u64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -26,36 +24,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-flip/Cargo.toml b/state-chain/pallets/cf-flip/Cargo.toml index 43c2cd9715..4b53cf531e 100644 --- a/state-chain/pallets/cf-flip/Cargo.toml +++ b/state-chain/pallets/cf-flip/Cargo.toml @@ -22,25 +22,25 @@ cf-primitives = { path = '../../primitives', default-features = false } cf-traits = { path = '../../traits', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] quickcheck = '1' quickcheck_macros = '1' -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -61,7 +61,6 @@ runtime-benchmarks = [ 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'sp-runtime/runtime-benchmarks', ] diff --git a/state-chain/pallets/cf-flip/src/imbalances.rs b/state-chain/pallets/cf-flip/src/imbalances.rs index 1eca7b1b7f..9ed8a70ac4 100644 --- a/state-chain/pallets/cf-flip/src/imbalances.rs +++ b/state-chain/pallets/cf-flip/src/imbalances.rs @@ -51,6 +51,8 @@ impl ImbalanceSource { } } +/// Denotes a "Surplus of funds". +/// /// Opaque, move-only struct with private fields that serves as a token denoting that funds have /// been added from *somewhere*, and that we need to account for this by cancelling it against a /// corresponding [Deficit]. @@ -172,6 +174,8 @@ impl Surplus { } } +/// Denotes a "Deficit of funds". +/// /// Opaque, move-only struct with private fields that serves as a token denoting that funds have /// been removed to *somewhere*, and that we need to account for this by cancelling it against a /// corresponding [Surplus]. diff --git a/state-chain/pallets/cf-flip/src/mock.rs b/state-chain/pallets/cf-flip/src/mock.rs index eaf926681f..1bdf106604 100644 --- a/state-chain/pallets/cf-flip/src/mock.rs +++ b/state-chain/pallets/cf-flip/src/mock.rs @@ -9,11 +9,7 @@ use frame_support::{ weights::{ConstantMultiplier, IdentityFee}, }; use frame_system::pallet_prelude::BlockNumberFor; -use sp_core::H256; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - Permill, -}; +use sp_runtime::Permill; pub type AccountId = u64; @@ -36,29 +32,8 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); type OnKilledAccount = BurnFlipAccount; - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-funding/Cargo.toml b/state-chain/pallets/cf-funding/Cargo.toml index 90e423f504..96497cc972 100644 --- a/state-chain/pallets/cf-funding/Cargo.toml +++ b/state-chain/pallets/cf-funding/Cargo.toml @@ -26,18 +26,18 @@ cf-traits = { path = '../../traits', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -45,9 +45,9 @@ serde = { default_features = false, version = '1.0.126', features = [ [dev-dependencies] pallet-cf-flip = { path = '../cf-flip' } cf-test-utilities = { path = '../../test-utilities' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -67,7 +67,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-funding/src/lib.rs b/state-chain/pallets/cf-funding/src/lib.rs index b923abe769..db1c8e3531 100644 --- a/state-chain/pallets/cf-funding/src/lib.rs +++ b/state-chain/pallets/cf-funding/src/lib.rs @@ -1,7 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![doc = include_str!("../README.md")] #![doc = include_str!("../../cf-doc-head.md")] -#![feature(is_sorted)] #[cfg(test)] mod mock; @@ -25,7 +24,7 @@ use frame_support::{ dispatch::DispatchResult, ensure, sp_runtime::{ - traits::{CheckedSub, UniqueSaturatedInto, Zero}, + traits::{CheckedSub, One, UniqueSaturatedInto, Zero}, Saturating, }, traits::{EnsureOrigin, HandleLifetime, IsType, OnKilledAccount, StorageVersion, UnixTime}, @@ -271,7 +270,7 @@ pub mod pallet { /// The account is already bound to an executor address. ExecutorAddressAlreadyBound, - /// The account cannot be reaped before it is unregstered. + /// The account cannot be reaped before it is unregistered. AccountMustBeUnregistered, } @@ -705,7 +704,7 @@ pub mod pallet { Self { genesis_accounts: Default::default(), redemption_tax: Default::default(), - minimum_funding: Default::default(), + minimum_funding: One::one(), redemption_ttl: Default::default(), } } @@ -716,7 +715,8 @@ pub mod pallet { fn build(&self) { assert!( self.redemption_tax < self.minimum_funding, - "Redemption tax must be less than minimum funding" + "Redemption tax must be less than minimum funding. Redemption tax: {:?}, Minimum_funding: {:?}", + self.redemption_tax, self.minimum_funding, ); MinimumFunding::::set(self.minimum_funding); RedemptionTax::::set(self.redemption_tax); diff --git a/state-chain/pallets/cf-funding/src/mock.rs b/state-chain/pallets/cf-funding/src/mock.rs index 4d346ba383..9b2f8a9942 100644 --- a/state-chain/pallets/cf-funding/src/mock.rs +++ b/state-chain/pallets/cf-funding/src/mock.rs @@ -10,10 +10,7 @@ use cf_traits::{ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{derive_impl, parameter_types}; use scale_info::TypeInfo; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - AccountId32, DispatchError, DispatchResult, Permill, -}; +use sp_runtime::{traits::IdentityLookup, AccountId32, DispatchError, DispatchResult, Permill}; use std::time::Duration; // Use a realistic account id for compatibility with `RegisterRedemption`. @@ -29,36 +26,11 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; + type Block = Block; type AccountId = AccountId; type Lookup = IdentityLookup; - type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-funding/src/tests.rs b/state-chain/pallets/cf-funding/src/tests.rs index 020236ab0a..8f0db0a4e2 100644 --- a/state-chain/pallets/cf-funding/src/tests.rs +++ b/state-chain/pallets/cf-funding/src/tests.rs @@ -1554,7 +1554,7 @@ fn check_restricted_balances_are_getting_removed() { vec![], vec![RESTRICTED_ADDRESS], )); - assert!(RestrictedBalances::::get(ALICE).get(&RESTRICTED_ADDRESS).is_none()); + assert!(!RestrictedBalances::::get(ALICE).contains_key(&RESTRICTED_ADDRESS)); }); } diff --git a/state-chain/pallets/cf-governance/Cargo.toml b/state-chain/pallets/cf-governance/Cargo.toml index ac7b6555ad..dcc81bf4a1 100644 --- a/state-chain/pallets/cf-governance/Cargo.toml +++ b/state-chain/pallets/cf-governance/Cargo.toml @@ -20,25 +20,25 @@ cf-primitives = { path = '../../primitives', default-features = false } cf-traits = { path = '../../traits', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -54,7 +54,6 @@ std = [ 'sp-std/std', ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-governance/README.md b/state-chain/pallets/cf-governance/README.md index c5ba092dc6..650bbf2bd7 100644 --- a/state-chain/pallets/cf-governance/README.md +++ b/state-chain/pallets/cf-governance/README.md @@ -26,18 +26,18 @@ Every Proposal has an expiry date. If a Proposal is not able to raise enough App To secure an extrinsic via Governance, add the following to your pallet's Config. -```rust(ignore) +```rust,ignore type EnsureGovernance: EnsureOrigin<::Origin>; ``` You must also configure the EnsureGovernance struct for your pallet in the runtime configuration: -```rust(ignore) +```rust,ignore type EnsureGovernance = pallet_cf_governance::EnsureGovernance; ``` To ensure extrinsics you need to make use of the EnsureGovernance struct. Pass the calling origin like in this example to ensure an extrinsic is only executable via the Governance origin: -```rust(ignore) +```rust,ignore T::EnsureGovernance::ensure_origin(origin)?; ``` diff --git a/state-chain/pallets/cf-governance/src/mock.rs b/state-chain/pallets/cf-governance/src/mock.rs index 564293c1e4..7139deab4a 100644 --- a/state-chain/pallets/cf-governance/src/mock.rs +++ b/state-chain/pallets/cf-governance/src/mock.rs @@ -11,14 +11,9 @@ use cf_traits::{ }; use frame_support::{derive_impl, dispatch::DispatchResultWithPostInfo, ensure, parameter_types}; use frame_system as system; -use sp_core::H256; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - Percent, -}; +use sp_runtime::Percent; use sp_std::collections::btree_set::BTreeSet; -type AccountId = u64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -29,11 +24,6 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - thread_local! { pub static UPGRADE_CONDITIONS_SATISFIED: std::cell::RefCell = RefCell::new(true); pub static UPGRADE_SUCCEEDED: std::cell::RefCell = RefCell::new(true); @@ -41,29 +31,7 @@ thread_local! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } cf_traits::impl_mock_epoch_info!( diff --git a/state-chain/pallets/cf-ingress-egress/Cargo.toml b/state-chain/pallets/cf-ingress-egress/Cargo.toml index 56a80cc484..9e966a2f43 100644 --- a/state-chain/pallets/cf-ingress-egress/Cargo.toml +++ b/state-chain/pallets/cf-ingress-egress/Cargo.toml @@ -28,29 +28,29 @@ strum_macros = { default-features = false, version = '0.24' } nanorand = { version = '0.7.0', default-features = false, features = [ 'wyrand', ] } -serde = { default_features = false, version = '1.0.126', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } # ==== Parity deps ==== -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] hex-literal = { version = '0.4.1' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } pallet-cf-governance = { path = '../cf-governance' } cf-test-utilities = { path = '../../test-utilities' } @@ -75,7 +75,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-ingress-egress/src/lib.rs b/state-chain/pallets/cf-ingress-egress/src/lib.rs index 5eaadaee53..072013cf10 100644 --- a/state-chain/pallets/cf-ingress-egress/src/lib.rs +++ b/state-chain/pallets/cf-ingress-egress/src/lib.rs @@ -1601,7 +1601,8 @@ impl, I: 'static> Pallet { // Only boost on non-zero fee and if the channel isn't already boosted: if T::SafeMode::get().boost_deposits_enabled && - boost_fee > 0 && !matches!(boost_status, BoostStatus::Boosted { .. }) + boost_fee > 0 && + !matches!(boost_status, BoostStatus::Boosted { .. }) { match Self::try_boosting(asset, amount, boost_fee, prewitnessed_deposit_id) { Ok(BoostOutput { used_pools, total_fee: boost_fee_amount }) => { diff --git a/state-chain/pallets/cf-ingress-egress/src/mock_btc.rs b/state-chain/pallets/cf-ingress-egress/src/mock_btc.rs index 5609762a6f..f08150dbd8 100644 --- a/state-chain/pallets/cf-ingress-egress/src/mock_btc.rs +++ b/state-chain/pallets/cf-ingress-egress/src/mock_btc.rs @@ -26,10 +26,7 @@ use cf_traits::{ DummyIngressSource, NetworkEnvironmentProvider, OnDeposit, }; use frame_support::derive_impl; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; -type AccountId = u64; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( @@ -41,29 +38,7 @@ frame_support::construct_runtime!( #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = frame_support::traits::ConstU64<250>; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = frame_support::traits::ConstU16<2112>; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-lp/Cargo.toml b/state-chain/pallets/cf-lp/Cargo.toml index f4f8599489..1a5ce9379b 100644 --- a/state-chain/pallets/cf-lp/Cargo.toml +++ b/state-chain/pallets/cf-lp/Cargo.toml @@ -22,30 +22,30 @@ cf-primitives = { path = '../../primitives', default-features = false } cf-traits = { path = '../../traits', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -serde = { version = '1.0.195', default_features = false, features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] pallet-cf-account-roles = { path = '../cf-account-roles' } cf-test-utilities = { path = '../../test-utilities' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -64,7 +64,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-lp/src/benchmarking.rs b/state-chain/pallets/cf-lp/src/benchmarking.rs index 490f28c65e..c5c3de9211 100644 --- a/state-chain/pallets/cf-lp/src/benchmarking.rs +++ b/state-chain/pallets/cf-lp/src/benchmarking.rs @@ -8,6 +8,7 @@ use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::OnNewAccount}; use frame_system::RawOrigin; +#[allow(clippy::multiple_bound_locations)] #[benchmarks( where ::Amount: From )] diff --git a/state-chain/pallets/cf-lp/src/mock.rs b/state-chain/pallets/cf-lp/src/mock.rs index 13aea233c8..4c4faa0747 100644 --- a/state-chain/pallets/cf-lp/src/mock.rs +++ b/state-chain/pallets/cf-lp/src/mock.rs @@ -20,11 +20,7 @@ use frame_support::{ assert_ok, derive_impl, parameter_types, sp_runtime::app_crypto::sp_core::H160, }; use frame_system as system; -use sp_core::H256; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - Permill, -}; +use sp_runtime::{traits::IdentityLookup, Permill}; use std::{cell::RefCell, collections::BTreeMap}; use sp_std::str::FromStr; @@ -59,11 +55,6 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - thread_local! { pub static BALANCE_MAP: RefCell> = RefCell::new(BTreeMap::new()); } @@ -141,29 +132,9 @@ impl MockBalanceApi { #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-pools/Cargo.toml b/state-chain/pallets/cf-pools/Cargo.toml index 0d14dbeb20..ff16a69a76 100644 --- a/state-chain/pallets/cf-pools/Cargo.toml +++ b/state-chain/pallets/cf-pools/Cargo.toml @@ -25,31 +25,31 @@ cf-runtime-utilities = { path = '../../runtime-utilities', default-features = fa cf-traits = { path = '../../traits', default-features = false } cf-utilities = { package = 'utilities', path = '../../../utilities', default-features = false } -itertools = { version = "0.11", default-features = false } +itertools = { version = "0.13", default-features = false } log = { version = '0.4.16', default-features = false } -serde = { default_features = false, version = '1.0.195', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = "2.10.0", default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ "derive", ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } cf-test-utilities = { path = '../../test-utilities' } [features] @@ -72,10 +72,10 @@ std = [ 'sp-std/std', 'sp-core/std', 'serde/std', + "itertools/use_std", ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-pools/src/lib.rs b/state-chain/pallets/cf-pools/src/lib.rs index e406886d49..b804a77d7f 100644 --- a/state-chain/pallets/cf-pools/src/lib.rs +++ b/state-chain/pallets/cf-pools/src/lib.rs @@ -1740,7 +1740,7 @@ impl Pallet { quote_asset: any::Asset, orders: u32, ) -> Result { - let orders = sp_std::cmp::max(sp_std::cmp::min(orders, 16384), 1); + let orders = orders.clamp(1, 16384); let asset_pair = AssetPair::try_new::(base_asset, quote_asset)?; let pool_state = diff --git a/state-chain/pallets/cf-pools/src/mock.rs b/state-chain/pallets/cf-pools/src/mock.rs index b2ff9d47cd..b5f4b810be 100644 --- a/state-chain/pallets/cf-pools/src/mock.rs +++ b/state-chain/pallets/cf-pools/src/mock.rs @@ -11,18 +11,13 @@ use cf_traits::{ }; use frame_support::{derive_impl, parameter_types}; use frame_system as system; -use sp_core::H256; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - DispatchResult, -}; +use sp_runtime::DispatchResult; use sp_std::collections::btree_map::BTreeMap; -type AccountId = u64; - pub const ALICE: ::AccountId = 123u64; pub const BOB: ::AccountId = 124u64; +type AccountId = u64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -33,36 +28,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-reputation/Cargo.toml b/state-chain/pallets/cf-reputation/Cargo.toml index 535b7de491..f44f022c0e 100644 --- a/state-chain/pallets/cf-reputation/Cargo.toml +++ b/state-chain/pallets/cf-reputation/Cargo.toml @@ -22,29 +22,29 @@ cf-traits = { path = '../../traits', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-staking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-staking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -60,10 +60,9 @@ std = [ 'scale-info/std', 'sp-staking/std', 'sp-std/std', - 'serde/std' + 'serde/std', ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-reputation/src/mock.rs b/state-chain/pallets/cf-reputation/src/mock.rs index 584c5e6fa7..51fb089672 100644 --- a/state-chain/pallets/cf-reputation/src/mock.rs +++ b/state-chain/pallets/cf-reputation/src/mock.rs @@ -4,8 +4,6 @@ use cf_primitives::FlipBalance; use cf_traits::{impl_mock_chainflip, impl_mock_runtime_safe_mode, AccountRoleRegistry, Slashing}; use frame_support::{assert_ok, construct_runtime, derive_impl, parameter_types}; use serde::{Deserialize, Serialize}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use sp_std::cell::RefCell; type Block = frame_system::mocking::MockBlock; @@ -26,35 +24,10 @@ construct_runtime!( impl_mock_runtime_safe_mode! { reputation: PalletSafeMode } -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] 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 = ValidatorId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-reputation/src/tests.rs b/state-chain/pallets/cf-reputation/src/tests.rs index e666dcbd21..54f6c8eadf 100644 --- a/state-chain/pallets/cf-reputation/src/tests.rs +++ b/state-chain/pallets/cf-reputation/src/tests.rs @@ -258,6 +258,7 @@ fn suspensions() { #[test] fn forgiveness() { + #[allow(non_local_definitions)] impl OffenceList for AllOffences { const OFFENCES: &'static [Self] = &[ AllOffences::ForgettingYourYubiKey, diff --git a/state-chain/pallets/cf-swapping/Cargo.toml b/state-chain/pallets/cf-swapping/Cargo.toml index 9a7639d203..1704eae434 100644 --- a/state-chain/pallets/cf-swapping/Cargo.toml +++ b/state-chain/pallets/cf-swapping/Cargo.toml @@ -19,7 +19,7 @@ workspace = true # Internal dependencies cf-chains = { path = '../../chains', default-features = false } cf-primitives = { path = '../../primitives', default-features = false } -cf-amm = { path = '../../amm', default_features = false } +cf-amm = { path = '../../amm', default-features = false } cf-runtime-utilities = { path = '../../runtime-utilities', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } cf-traits = { path = '../../traits', default-features = false } @@ -27,21 +27,21 @@ cf-traits = { path = '../../traits', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = "2.10.0", default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ "derive", ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -49,10 +49,10 @@ serde = { default_features = false, version = '1.0.126', features = [ [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } pallet-cf-account-roles = { path = '../cf-account-roles' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -itertools = "0.11" +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +itertools = "0.13" [features] default = ['std'] @@ -72,10 +72,11 @@ std = [ 'sp-std/std', 'sp-runtime/std', 'serde/std', + "cf-runtime-utilities/std", + "itertools/use_std", ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-swapping/src/benchmarking.rs b/state-chain/pallets/cf-swapping/src/benchmarking.rs index a874333895..0ffaecf629 100644 --- a/state-chain/pallets/cf-swapping/src/benchmarking.rs +++ b/state-chain/pallets/cf-swapping/src/benchmarking.rs @@ -12,6 +12,7 @@ use frame_support::{ }; use frame_system::RawOrigin; +#[allow(clippy::multiple_bound_locations)] #[benchmarks( where ::Amount: From )] diff --git a/state-chain/pallets/cf-swapping/src/lib.rs b/state-chain/pallets/cf-swapping/src/lib.rs index 8026ddd866..40158c9bc3 100644 --- a/state-chain/pallets/cf-swapping/src/lib.rs +++ b/state-chain/pallets/cf-swapping/src/lib.rs @@ -1,7 +1,4 @@ #![cfg_attr(not(feature = "std"), no_std)] -// lazy_cell has been stabilized in a newer version of rust -// (feature directive can be removed once we upgrade) -#![feature(lazy_cell)] #![feature(extract_if)] use cf_amm::common::Side; @@ -363,6 +360,9 @@ pub enum PalletConfigUpdate { SetMaxSwapRetryDuration { blocks: BlockNumber }, /// Set the max allowed total duration of a DCA swap request. SetMaxSwapRequestDuration { blocks: BlockNumber }, + /// Set the minimum chunk size for DCA swaps. The number of chunks of a DCA swap will be + /// reduced to meet this requirement. + SetMinimumChunkSize { asset: Asset, size: AssetAmount }, } impl_pallet_safe_mode! { @@ -505,6 +505,14 @@ pub mod pallet { ConstU32, >; + /// The minimum chunk size for DCA swaps. The number of chunks of a DCA swap will be reduced + /// so that the chunk size is greater than or equal to this value. Setting to zero will disable + /// the check for that asset. + #[pallet::storage] + #[pallet::getter(fn minimum_chunk_size)] + pub type MinimumChunkSize = + StorageMap<_, Twox64Concat, Asset, AssetAmount, ValueQuery>; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -629,6 +637,10 @@ pub mod pallet { MaxSwapRequestDurationSet { blocks: BlockNumber, }, + MinimumChunkSizeSet { + asset: Asset, + amount: AssetAmount, + }, } #[pallet::error] pub enum Error { @@ -897,6 +909,10 @@ pub mod pallet { MaxSwapRequestDurationBlocks::::set(blocks); Self::deposit_event(Event::::MaxSwapRequestDurationSet { blocks }); }, + PalletConfigUpdate::SetMinimumChunkSize { asset, size: amount } => { + MinimumChunkSize::::set(asset, amount); + Self::deposit_event(Event::::MinimumChunkSizeSet { asset, amount }); + }, } } @@ -1964,6 +1980,18 @@ pub mod pallet { swap_amount }; + // Restrict the number of chunks based on the minimum chunk size. + let dca_params = dca_params.map(|mut dca_params| { + let minimum_chunk_size = MinimumChunkSize::::get(input_asset); + if minimum_chunk_size > 0 { + dca_params.number_of_chunks = core::cmp::min( + max((input_amount / minimum_chunk_size) as u32, 1), + dca_params.number_of_chunks, + ); + } + dca_params + }); + Self::deposit_event(Event::::SwapRequested { swap_request_id: request_id, input_asset, diff --git a/state-chain/pallets/cf-swapping/src/mock.rs b/state-chain/pallets/cf-swapping/src/mock.rs index f713c11420..f44abab276 100644 --- a/state-chain/pallets/cf-swapping/src/mock.rs +++ b/state-chain/pallets/cf-swapping/src/mock.rs @@ -15,14 +15,9 @@ use cf_traits::{ AccountRoleRegistry, SwappingApi, }; use frame_support::{derive_impl, pallet_prelude::DispatchError, parameter_types, weights::Weight}; -use frame_system as system; -use sp_core::{ConstU32, H256}; -use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BoundedBTreeMap, Permill, -}; +use sp_core::ConstU32; +use sp_runtime::{BoundedBTreeMap, Permill}; -type AccountId = u64; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -33,36 +28,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] -impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; +impl frame_system::Config for Test { type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-swapping/src/tests/config.rs b/state-chain/pallets/cf-swapping/src/tests/config.rs index dc055ac115..2195ed4530 100644 --- a/state-chain/pallets/cf-swapping/src/tests/config.rs +++ b/state-chain/pallets/cf-swapping/src/tests/config.rs @@ -9,6 +9,7 @@ fn can_update_all_config_items() { let new_flip_buy_interval = BlockNumberFor::::from(5678u32); const NEW_MAX_SWAP_RETRY_DURATION: u32 = 69_u32; const MAX_SWAP_REQUEST_DURATION: u32 = 420_u32; + const NEW_MINIMUM_CHUNK_SIZE: AssetAmount = 1; // Check that the default values are different from the new ones assert!(MaximumSwapAmount::::get(Asset::Btc).is_none()); @@ -17,6 +18,7 @@ fn can_update_all_config_items() { assert_ne!(FlipBuyInterval::::get(), new_flip_buy_interval); assert_ne!(MaxSwapRetryDurationBlocks::::get(), NEW_MAX_SWAP_RETRY_DURATION); assert_ne!(MaxSwapRequestDurationBlocks::::get(), MAX_SWAP_REQUEST_DURATION); + assert_ne!(MinimumChunkSize::::get(Asset::Eth), NEW_MINIMUM_CHUNK_SIZE); // Update all config items at the same time, and updates 2 separate max swap amounts. assert_ok!(Swapping::update_pallet_config( @@ -34,6 +36,10 @@ fn can_update_all_config_items() { PalletConfigUpdate::FlipBuyInterval { interval: new_flip_buy_interval }, PalletConfigUpdate::SetMaxSwapRetryDuration { blocks: NEW_MAX_SWAP_RETRY_DURATION }, PalletConfigUpdate::SetMaxSwapRequestDuration { blocks: MAX_SWAP_REQUEST_DURATION }, + PalletConfigUpdate::SetMinimumChunkSize { + asset: Asset::Eth, + size: NEW_MINIMUM_CHUNK_SIZE + }, ] .try_into() .unwrap() @@ -46,6 +52,7 @@ fn can_update_all_config_items() { assert_eq!(FlipBuyInterval::::get(), new_flip_buy_interval); assert_eq!(MaxSwapRetryDurationBlocks::::get(), NEW_MAX_SWAP_RETRY_DURATION); assert_eq!(MaxSwapRequestDurationBlocks::::get(), MAX_SWAP_REQUEST_DURATION); + assert_eq!(MinimumChunkSize::::get(Asset::Eth), NEW_MINIMUM_CHUNK_SIZE); // Check that the events were emitted assert_events_eq!( @@ -69,7 +76,11 @@ fn can_update_all_config_items() { }), RuntimeEvent::Swapping(crate::Event::MaxSwapRequestDurationSet { blocks: MAX_SWAP_REQUEST_DURATION - }) + }), + RuntimeEvent::Swapping(crate::Event::MinimumChunkSizeSet { + asset: Asset::Eth, + amount: NEW_MINIMUM_CHUNK_SIZE + }), ); // Make sure that only governance can update the config diff --git a/state-chain/pallets/cf-swapping/src/tests/dca.rs b/state-chain/pallets/cf-swapping/src/tests/dca.rs index 37f5e12161..2fa9b6e6e7 100644 --- a/state-chain/pallets/cf-swapping/src/tests/dca.rs +++ b/state-chain/pallets/cf-swapping/src/tests/dca.rs @@ -1001,3 +1001,57 @@ mod ccm_tests { }); } } + +#[test] +fn test_minimum_chunk_size() { + #[track_caller] + fn set_and_test_chunk_size( + asset_amount: AssetAmount, + number_of_chunks: u32, + expected_number_of_chunks: u32, + minimum_chunk_size: AssetAmount, + ) { + // Update the minimum chunk size + assert_ok!(Swapping::update_pallet_config( + OriginTrait::root(), + vec![PalletConfigUpdate::SetMinimumChunkSize { + asset: Asset::Eth, + size: minimum_chunk_size + },] + .try_into() + .unwrap() + )); + + // Init a swap, this is where the minimum chunk size will kick in + let dca_params = DcaParameters { number_of_chunks, chunk_interval: CHUNK_INTERVAL }; + let expected_swap_request_id = Swapping::init_swap_request( + Asset::Eth, + asset_amount, + Asset::Btc, + SwapRequestType::Regular { output_address: ForeignChainAddress::Eth([1; 20].into()) }, + vec![].try_into().unwrap(), + None, + Some(dca_params), + SwapOrigin::Vault { tx_hash: Default::default() }, + ); + + // Check that the swap was initiated with the updated number of chunks + let expected_dca_params = DcaParameters { + number_of_chunks: expected_number_of_chunks, + chunk_interval: CHUNK_INTERVAL, + }; + assert_has_matching_event!( + Test, + RuntimeEvent::Swapping(Event::SwapRequested {swap_request_id, dca_parameters, .. }) + if dca_parameters == &Some(expected_dca_params.clone()) && *swap_request_id == expected_swap_request_id + ); + } + + new_test_ext().execute_with(|| { + set_and_test_chunk_size(100, 10, 10, 9); + set_and_test_chunk_size(100, 10, 10, 10); + set_and_test_chunk_size(100, 10, 9, 11); + set_and_test_chunk_size(1, 10, 1, 10); + set_and_test_chunk_size(1, 1000, 1000, 0); + }); +} diff --git a/state-chain/pallets/cf-threshold-signature/Cargo.toml b/state-chain/pallets/cf-threshold-signature/Cargo.toml index fabe4f693c..74d25601d0 100644 --- a/state-chain/pallets/cf-threshold-signature/Cargo.toml +++ b/state-chain/pallets/cf-threshold-signature/Cargo.toml @@ -20,12 +20,14 @@ cf-chains = { path = '../../chains', default-features = false } cf-primitives = { path = '../../primitives', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } cf-traits = { path = '../../traits', default-features = false } -cf-runtime-utilities = { path = '../../runtime-utilities', default-features = false } +cf-runtime-utilities = { path = '../../runtime-utilities', default-features = false, features = [ + 'derive', +] } cf-utilities = { package = 'utilities', path = '../../../utilities', default-features = false } cfe-events = { path = '../../cfe-events', default-features = false } log = { version = '0.4.16', default-features = false } -serde = { default_features = false, version = '1.0.126', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -34,24 +36,24 @@ pallet-cf-validator = { path = '../cf-validator', optional = true, default-featu pallet-cf-reputation = { path = '../cf-reputation', optional = true, default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] hex-literal = { version = '0.4.1' } cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -77,7 +79,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-threshold-signature/src/benchmarking.rs b/state-chain/pallets/cf-threshold-signature/src/benchmarking.rs index a48afd6df4..941b32547f 100644 --- a/state-chain/pallets/cf-threshold-signature/src/benchmarking.rs +++ b/state-chain/pallets/cf-threshold-signature/src/benchmarking.rs @@ -54,6 +54,7 @@ fn generate_authority_set, I: 'static>( authority_set } +#[allow(clippy::multiple_bound_locations)] #[instance_benchmarks( where T: frame_system::Config + pallet_cf_validator::Config diff --git a/state-chain/pallets/cf-threshold-signature/src/mock.rs b/state-chain/pallets/cf-threshold-signature/src/mock.rs index affa71c942..0e018f26f4 100644 --- a/state-chain/pallets/cf-threshold-signature/src/mock.rs +++ b/state-chain/pallets/cf-threshold-signature/src/mock.rs @@ -25,8 +25,7 @@ pub use frame_support::{ }; use frame_system::{self, pallet_prelude::BlockNumberFor}; use scale_info::TypeInfo; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; + type Block = frame_system::mocking::MockBlock; pub type ValidatorId = u64; @@ -39,36 +38,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-tokenholder-governance/Cargo.toml b/state-chain/pallets/cf-tokenholder-governance/Cargo.toml index 834ea6a781..52ced53d8d 100644 --- a/state-chain/pallets/cf-tokenholder-governance/Cargo.toml +++ b/state-chain/pallets/cf-tokenholder-governance/Cargo.toml @@ -22,24 +22,24 @@ cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', defau cf-traits = { path = '../../traits', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } pallet-cf-flip = { path = '../cf-flip' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -57,7 +57,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-tokenholder-governance/src/mock.rs b/state-chain/pallets/cf-tokenholder-governance/src/mock.rs index 3c387f5e86..04288502c6 100644 --- a/state-chain/pallets/cf-tokenholder-governance/src/mock.rs +++ b/state-chain/pallets/cf-tokenholder-governance/src/mock.rs @@ -7,8 +7,6 @@ use cf_traits::{ use codec::{Decode, Encode}; use frame_support::{derive_impl, parameter_types, traits::HandleLifetime}; use frame_system as system; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; use system::pallet_prelude::BlockNumberFor; @@ -25,8 +23,6 @@ frame_support::construct_runtime!( ); parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; pub const VotingPeriod: BlockNumberFor = 10; pub const ProposalFee: Balance = 100; pub const EnactmentDelay: BlockNumberFor = 20; @@ -34,29 +30,7 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-validator/Cargo.toml b/state-chain/pallets/cf-validator/Cargo.toml index a6c8d9cafc..60818693c6 100644 --- a/state-chain/pallets/cf-validator/Cargo.toml +++ b/state-chain/pallets/cf-validator/Cargo.toml @@ -30,32 +30,32 @@ log = { version = '0.4.16', default-features = false } nanorand = { version = '0.7.0', default-features = false, features = [ 'wyrand', ] } -serde = { default_features = false, version = '1.0.195', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-application-crypto = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, optional = true } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-application-crypto = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, optional = true } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } lazy_static = "1.4" [features] @@ -82,7 +82,6 @@ std = [ 'sp-std/std', ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-validator/src/benchmarking.rs b/state-chain/pallets/cf-validator/src/benchmarking.rs index 026a95b2b9..9cb59c58b7 100644 --- a/state-chain/pallets/cf-validator/src/benchmarking.rs +++ b/state-chain/pallets/cf-validator/src/benchmarking.rs @@ -101,6 +101,7 @@ pub fn try_start_keygen( assert!(matches!(CurrentRotationPhase::::get(), RotationPhase::KeygensInProgress(..))); } +#[allow(clippy::multiple_bound_locations)] #[benchmarks(where T: RuntimeConfig)] mod benchmarks { use super::*; diff --git a/state-chain/pallets/cf-validator/src/lib.rs b/state-chain/pallets/cf-validator/src/lib.rs index 9a6f6381d0..98058b1417 100644 --- a/state-chain/pallets/cf-validator/src/lib.rs +++ b/state-chain/pallets/cf-validator/src/lib.rs @@ -1,7 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![doc = include_str!("../README.md")] #![doc = include_str!("../../cf-doc-head.md")] -#![feature(is_sorted)] mod mock; mod tests; @@ -752,11 +751,7 @@ pub mod pallet { ::AccountId, >>::from_ref(&account_id); - ensure!( - (LastExpiredEpoch::::get() + 1..=CurrentEpoch::::get()) - .all(|epoch| !HistoricalAuthorities::::get(epoch).contains(validator_id)), - Error::::StillKeyHolder - ); + ensure!(!EpochHistory::::is_keyholder(validator_id), Error::::StillKeyHolder); // This can only error if the validator didn't register any keys, in which case we want // to continue with the deregistration anyway. @@ -1399,10 +1394,11 @@ impl pallet_session::SessionManager> for Pallet { /// These Validators' keys must be registered as part of the session pallet genesis. fn new_session_genesis(_new_index: SessionIndex) -> Option>> { let genesis_authorities = Self::current_authorities(); - assert!( - !genesis_authorities.is_empty(), - "No genesis authorities found! Make sure the Validator pallet is initialised before the Session pallet." - ); + if !genesis_authorities.is_empty() { + frame_support::print( + "No genesis authorities found! Make sure the Validator pallet is initialised before the Session pallet." + ); + }; Some(genesis_authorities.into_iter().collect()) } diff --git a/state-chain/pallets/cf-validator/src/mock.rs b/state-chain/pallets/cf-validator/src/mock.rs index 90b2c73e86..b79d0b2a34 100644 --- a/state-chain/pallets/cf-validator/src/mock.rs +++ b/state-chain/pallets/cf-validator/src/mock.rs @@ -12,13 +12,8 @@ use cf_traits::{ }, AccountRoleRegistry, RotationBroadcastsPending, }; -use frame_support::{construct_runtime, derive_impl, parameter_types}; -use sp_core::H256; -use sp_runtime::{ - impl_opaque_keys, - testing::UintAuthorityId, - traits::{BlakeTwo256, ConvertInto, IdentityLookup}, -}; +use frame_support::{construct_runtime, derive_impl}; +use sp_runtime::{impl_opaque_keys, testing::UintAuthorityId, traits::ConvertInto}; use std::{cell::RefCell, collections::HashMap}; pub type Amount = u128; @@ -40,34 +35,10 @@ construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; -} #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] 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 = ValidatorId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-validator/src/tests.rs b/state-chain/pallets/cf-validator/src/tests.rs index 529fd7a056..d3d0aefc7c 100644 --- a/state-chain/pallets/cf-validator/src/tests.rs +++ b/state-chain/pallets/cf-validator/src/tests.rs @@ -1232,6 +1232,7 @@ fn validator_deregistration_after_expired_epoch() { new_test_ext().execute_with(|| { assert_ok!(ValidatorPallet::register_as_validator(RuntimeOrigin::signed(ALICE),)); ValidatorPallet::transition_to_next_epoch(vec![1, ALICE], 100); + let first_epoch_to_expire = ValidatorPallet::current_epoch(); // Can't deregister assert_noop!( @@ -1239,9 +1240,12 @@ fn validator_deregistration_after_expired_epoch() { Error::::StillKeyHolder ); - let epoch_to_expire = ValidatorPallet::current_epoch(); + ValidatorPallet::transition_to_next_epoch(vec![1, ALICE], 100); + let second_epoch_to_expire = ValidatorPallet::current_epoch(); ValidatorPallet::transition_to_next_epoch(vec![1, 2], 100); - ValidatorPallet::expire_epoch(epoch_to_expire); + + ValidatorPallet::expire_epoch(second_epoch_to_expire); + ValidatorPallet::expire_epoch(first_epoch_to_expire); // Now you can deregister assert_ok!(ValidatorPallet::deregister_as_validator(RuntimeOrigin::signed(ALICE),)); diff --git a/state-chain/pallets/cf-vaults/Cargo.toml b/state-chain/pallets/cf-vaults/Cargo.toml index c29a58eb5c..0b482de406 100644 --- a/state-chain/pallets/cf-vaults/Cargo.toml +++ b/state-chain/pallets/cf-vaults/Cargo.toml @@ -29,24 +29,24 @@ cfe-events = { path = '../../cfe-events', default-features = false } log = { version = '0.4.16', default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -hex = { version = '0.4' } +hex = { version = '0.4.3' } cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -68,7 +68,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-vaults/src/mock.rs b/state-chain/pallets/cf-vaults/src/mock.rs index 3044828a61..372c2afcb3 100644 --- a/state-chain/pallets/cf-vaults/src/mock.rs +++ b/state-chain/pallets/cf-vaults/src/mock.rs @@ -16,8 +16,6 @@ use cf_traits::{ }, }; use frame_support::{construct_runtime, derive_impl, parameter_types}; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; thread_local! { pub static SET_AGG_KEY_WITH_AGG_KEY_REQUIRED: RefCell = const { RefCell::new(true) }; @@ -32,35 +30,9 @@ construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] 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 = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type DbWeight = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_chainflip!(Test); diff --git a/state-chain/pallets/cf-witnesser/Cargo.toml b/state-chain/pallets/cf-witnesser/Cargo.toml index b3335ef039..9aa32094d7 100644 --- a/state-chain/pallets/cf-witnesser/Cargo.toml +++ b/state-chain/pallets/cf-witnesser/Cargo.toml @@ -16,8 +16,8 @@ targets = ['x86_64-unknown-linux-gnu'] workspace = true [dependencies] -hex = { version = '0.4', default-features = false } -serde = { version = '1.0.195', default_features = false, features = [ +hex = { version = '0.4.3', default-features = false } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -33,23 +33,23 @@ cf-utilities = { package = 'utilities', path = '../../../utilities', default-fea bitvec = { default-features = false, version = '1.0', features = ['alloc'] } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] cf-test-utilities = { path = '../../test-utilities' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] @@ -68,7 +68,6 @@ std = [ 'serde/std', ] runtime-benchmarks = [ - 'cf-primitives/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', diff --git a/state-chain/pallets/cf-witnesser/src/mock.rs b/state-chain/pallets/cf-witnesser/src/mock.rs index 9fb3e80e3f..418caa4854 100644 --- a/state-chain/pallets/cf-witnesser/src/mock.rs +++ b/state-chain/pallets/cf-witnesser/src/mock.rs @@ -9,10 +9,6 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{derive_impl, pallet_prelude::RuntimeDebug, parameter_types}; use frame_system as system; use scale_info::TypeInfo; -use sp_core::H256; -use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; - -type AccountId = u64; pub mod dummy; type Block = frame_system::mocking::MockBlock; @@ -26,36 +22,9 @@ frame_support::construct_runtime!( } ); -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } impl_mock_runtime_safe_mode! { witnesser: pallet_cf_witness::PalletSafeMode } diff --git a/state-chain/pallets/cf-witnesser/src/tests.rs b/state-chain/pallets/cf-witnesser/src/tests.rs index 5f45c80461..fd5e44b509 100644 --- a/state-chain/pallets/cf-witnesser/src/tests.rs +++ b/state-chain/pallets/cf-witnesser/src/tests.rs @@ -489,10 +489,9 @@ fn setup_witness_authorities( ) -> (Box, CallHash) { // Setup authorities and variables. let authorities = authority_ids - .map(|v| { + .inspect(|v| { let _ = - >::register_as_validator(&v); - v + >::register_as_validator(v); }) .collect::>(); MockEpochInfo::next_epoch(authorities.clone()); diff --git a/state-chain/primitives/Cargo.toml b/state-chain/primitives/Cargo.toml index ef53b761ad..0cd6c6e6d8 100644 --- a/state-chain/primitives/Cargo.toml +++ b/state-chain/primitives/Cargo.toml @@ -9,32 +9,32 @@ description = 'Common primitive types used across Chainflip' workspace = true [dependencies] -serde = { default_features = false, version = '1.0.195', features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } -hex = { optional = true, version = '0.4' } +hex = { optional = true, version = '0.4.3' } ethabi = { default-features = false, version = '18.0' } strum = { default-features = false, version = '0.24' } strum_macros = { default-features = false, version = '0.24' } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default_features = false } -sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default_features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-arithmetic = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } lazy_format = "2.0" cf-utilities = { package = 'utilities', path = '../../utilities', default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = "2.10.0", default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ "derive", ] } [dev-dependencies] -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } serde_json = "1.0" [features] @@ -52,4 +52,3 @@ std = [ 'sp-std/std', 'strum/std', ] -runtime-benchmarks = ['frame-support/runtime-benchmarks'] diff --git a/state-chain/primitives/src/chains/assets.rs b/state-chain/primitives/src/chains/assets.rs index d88dfc1a1f..8f6500e129 100644 --- a/state-chain/primitives/src/chains/assets.rs +++ b/state-chain/primitives/src/chains/assets.rs @@ -256,7 +256,7 @@ macro_rules! assets { impl TryFrom for SerdeImplicitChainAsset { type Error = (); - #[allow(unreachable_patterns)] + #[allow(unused_variables)] fn try_from(value: any::Asset) -> Result { match value { diff --git a/state-chain/primitives/src/lib.rs b/state-chain/primitives/src/lib.rs index 8c3b398cf6..6daa6b210e 100644 --- a/state-chain/primitives/src/lib.rs +++ b/state-chain/primitives/src/lib.rs @@ -101,13 +101,18 @@ pub type PrewitnessedDepositId = u64; pub type BoostPoolTier = u16; -// TODO: Consider increasing Price to U512 or switch to a f64 (f64 would only be for the external +// TODO: Consider alternative representation for Price: +// +// increasing Price to U512 or switch to a f64 (f64 would only be for the external // price representation), as at low ticks the precision in the price is VERY LOW, but this does not // cause any problems for the AMM code in terms of correctness -/// This is the ratio of equivalently valued amounts of asset One and asset Zero. The price is -/// always measured in amount of asset One per unit of asset Zero. Therefore as asset zero becomes -/// more valuable relative to asset one the price's literal value goes up, and vice versa. This -/// ratio is represented as a fixed point number with `PRICE_FRACTIONAL_BITS` fractional bits. + +/// This is the ratio of equivalently valued amounts of asset One and asset Zero. +/// +/// The price is always measured in amount of asset One per unit of asset Zero. Therefore as asset +/// zero becomes more valuable relative to asset one the price's literal value goes up, and vice +/// versa. This ratio is represented as a fixed point number with `PRICE_FRACTIONAL_BITS` fractional +/// bits. pub type Price = U256; /// The type of the Id given to threshold signature requests. Note a single request may @@ -173,6 +178,7 @@ pub const OUTPUT_UTXO_SIZE_IN_BYTES: u64 = 51; pub const MINIMUM_BTC_TX_SIZE_IN_BYTES: u64 = 16; /// This determines the average expected block time that we are targeting. +/// /// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. /// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked /// up by `pallet_aura` to implement `fn slot_duration()`. diff --git a/state-chain/runtime-upgrade-utilities/Cargo.toml b/state-chain/runtime-upgrade-utilities/Cargo.toml index 6dd9fb62d6..571afe0d85 100644 --- a/state-chain/runtime-upgrade-utilities/Cargo.toml +++ b/state-chain/runtime-upgrade-utilities/Cargo.toml @@ -12,12 +12,12 @@ workspace = true log = { version = '0.4.16', default-features = false } hex-literal = { version = '0.4.1', default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } diff --git a/state-chain/runtime-upgrade-utilities/README.md b/state-chain/runtime-upgrade-utilities/README.md index bdb64bfe92..42696c11eb 100644 --- a/state-chain/runtime-upgrade-utilities/README.md +++ b/state-chain/runtime-upgrade-utilities/README.md @@ -25,7 +25,7 @@ This crate provides a `VersionedMigration` type that can be used to structure su 2. Add a migrations module and pallet `StorageVersion` to the pallet's `lib.rs` file if you haven't done so already: - ```rust + ```rust,ignore mod migrations; // <--- We will create this module file next // These imports are required if not already present. @@ -49,7 +49,7 @@ This crate provides a `VersionedMigration` type that can be used to structure su 3. Create `migrations.rs` based on the following template: - ```rust + ```rust,ignore pub mod my_migration; use cf_runtime_upgrade_utilities::VersionedMigration; @@ -62,7 +62,7 @@ This crate provides a `VersionedMigration` type that can be used to structure su 5. If this is the first migration for this pallet, ensure that the `PalletMigration` for this pallet is added to the tuple of PalletMigrations in `state-chain/runtime/src/lib.rs`. Remember to add all the pallet's instances! - ```rust + ```rust,ignore type PalletMigrations = ( pallet_cf_environment::migrations::PalletMigration, pallet_cf_funding::migrations::PalletMigration, @@ -91,7 +91,7 @@ This crate provides a `VersionedMigration` type that can be used to structure su 6. Additional migrations can be added to the `PalletMigration` tuple. For example, the following defines migrations from version 0 through 4. Only the required migrations will be applied on-chain. For example, if the on-chain storage version is 2 and the pallet version is 4, the migrations `change_storage_type_b` and `purge_old_values` would be run, and the on-chain storage version would be updated to 4. - ```rust + ```rust,ignore pub mod rename_pallet_storage; pub mod change_storage_type_a; pub mod change_storage_type_b; @@ -107,7 +107,7 @@ This crate provides a `VersionedMigration` type that can be used to structure su 7. When removing migrations, it can be helpful to leave a placeholder migration to avoid deleting the boilerplate. For example, if the above migrations were no longer needed, we could remove them and leave a placeholder at the latest pallet version, like this: - ```rust + ```rust,ignore use cf_runtime_upgrade_utilities::PlaceholderMigration; type PalletMigration = PlaceholderMigration, 4>; diff --git a/state-chain/runtime-upgrade-utilities/src/lib.rs b/state-chain/runtime-upgrade-utilities/src/lib.rs index 19156d5924..610a228f30 100644 --- a/state-chain/runtime-upgrade-utilities/src/lib.rs +++ b/state-chain/runtime-upgrade-utilities/src/lib.rs @@ -44,7 +44,7 @@ pub mod genesis_hashes { /// As long as both conditions are met, the upgrade `U` will run and then the pallet's stored /// version is set to `TO`. pub struct VersionedMigration< - P: PalletInfoAccess + GetStorageVersion, + P: PalletInfoAccess + GetStorageVersion, U: OnRuntimeUpgrade, const FROM: u16, const TO: u16, @@ -53,13 +53,13 @@ pub struct VersionedMigration< /// A placeholder migration that does nothing. Useful too allow us to keep the boilerplate in the /// runtime consistent. pub struct PlaceholderMigration< - P: PalletInfoAccess + GetStorageVersion, + P: PalletInfoAccess + GetStorageVersion, const AT: u16, >(PhantomData

); impl OnRuntimeUpgrade for PlaceholderMigration where - P: PalletInfoAccess + GetStorageVersion, + P: PalletInfoAccess + GetStorageVersion, { fn on_runtime_upgrade() -> frame_support::weights::Weight { if

::on_chain_storage_version() == AT { @@ -99,12 +99,12 @@ pub enum VersionedPostUpgradeData { } fn should_upgrade< - P: GetStorageVersion, + P: GetStorageVersion, const FROM: u16, const TO: u16, >() -> bool {

::on_chain_storage_version() == FROM && -

::current_storage_version() >= TO +

::in_code_storage_version() >= TO } // TODO: Replace this with the `VersionedMigration` that will be merged to polkadot-sdk soon. @@ -113,7 +113,7 @@ fn should_upgrade< impl OnRuntimeUpgrade for VersionedMigration where - P: PalletInfoAccess + GetStorageVersion, + P: PalletInfoAccess + GetStorageVersion, Inner: OnRuntimeUpgrade, { #[cfg(feature = "try-runtime")] @@ -215,9 +215,9 @@ mod test_versioned_upgrade { } impl GetStorageVersion for Pallet { - type CurrentStorageVersion = StorageVersion; + type InCodeStorageVersion = StorageVersion; - fn current_storage_version() -> StorageVersion { + fn in_code_storage_version() -> StorageVersion { PALLET_VERSION } diff --git a/state-chain/runtime-utilities/Cargo.toml b/state-chain/runtime-utilities/Cargo.toml index b6b02e606a..964794b632 100644 --- a/state-chain/runtime-utilities/Cargo.toml +++ b/state-chain/runtime-utilities/Cargo.toml @@ -10,17 +10,17 @@ workspace = true [dependencies] log = { version = '0.4.16', default-features = false } -cf-runtime-macros = { path = './macros', optional = true, default-features = false } +cf-runtime-macros = { path = './macros', optional = true } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } # Not used in this crate but required in order to import sp-io without conflicts. -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [features] default = ['std'] diff --git a/state-chain/runtime/Cargo.toml b/state-chain/runtime/Cargo.toml index 491f354a3d..57fdc6ed7b 100644 --- a/state-chain/runtime/Cargo.toml +++ b/state-chain/runtime/Cargo.toml @@ -11,17 +11,17 @@ repository = 'https://github.com/chainflip-io/chainflip-backend' targets = ['x86_64-unknown-linux-gnu'] [build-dependencies] -substrate-wasm-builder = { version = "5.0.0-dev", git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.6+1', optional = true } +substrate-wasm-builder = { git = 'https://github.com/chainflip-io/polkadot-sdk.git', tag = 'chainflip-substrate-1.15.2+2', optional = true } [lints] workspace = true [dependencies] hex-literal = "0.4.1" -hex = { version = "0.4", default-features = false } +hex = { version = "0.4.3", default-features = false } log = { version = '0.4.16', default-features = false } nanorand = { version = '0.7', default-features = false, features = ['wyrand'] } -serde = { version = '1.0.195', default_features = false, features = [ +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -38,11 +38,13 @@ cf-runtime-upgrade-utilities = { path = '../runtime-upgrade-utilities', default- cf-traits = { path = '../traits', default-features = false } cf-utilities = { package = 'utilities', path = '../../utilities', default-features = false } +sol-prim = { path = '../../foreign-chains/solana/sol-prim', default-features = false } + pallet-cf-account-roles = { path = '../pallets/cf-account-roles', default-features = false } pallet-cf-asset-balances = { path = "../pallets/cf-asset-balances", default-features = false } pallet-cf-broadcast = { path = '../pallets/cf-broadcast', default-features = false } pallet-cf-chain-tracking = { path = '../pallets/cf-chain-tracking', default-features = false } -pallet-cf-elections = { path = '../pallets/cf-elections', default_features = false } +pallet-cf-elections = { path = '../pallets/cf-elections', default-features = false } pallet-cf-emissions = { path = '../pallets/cf-emissions', default-features = false } pallet-cf-environment = { path = '../pallets/cf-environment', default-features = false } pallet-cf-flip = { path = '../pallets/cf-flip', default-features = false } @@ -58,74 +60,72 @@ pallet-cf-tokenholder-governance = { path = '../pallets/cf-tokenholder-governanc pallet-cf-validator = { path = '../pallets/cf-validator', default-features = false } pallet-cf-vaults = { path = '../pallets/cf-vaults', default-features = false } pallet-cf-witnesser = { path = '../pallets/cf-witnesser', default-features = false } -pallet-cf-cfe-interface = { path = '../pallets/cf-cfe-interface', default_features = false } -sol-prim = { path = '../../foreign-chains/solana/sol-prim' } +pallet-cf-cfe-interface = { path = '../pallets/cf-cfe-interface', default-features = false } # SCALE -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } # Additional FRAME pallets -pallet-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +pallet-authorship = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'historical', ] } # Substrate dependencies -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } -frame-executive = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true, default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } +frame-executive = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true, default-features = false } -pallet-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +pallet-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-timestamp = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-transaction-payment = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +sp-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-block-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-consensus-aura = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'serde', ] } -sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +sp-consensus-grandpa = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'serde', ] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'serde', ] } -sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, features = [ +sp-inherents = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-offchain = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, features = [ 'serde', ] } -sp-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { version = "8.0.0", git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-session = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-transaction-pool = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-version = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -sp-genesis-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +sp-genesis-builder = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } -frame-try-runtime = { optional = true, tag = 'chainflip-substrate-1.6+1', default-features = false, git = 'https://github.com/chainflip-io/polkadot-sdk.git' } +frame-try-runtime = { optional = true, tag = 'chainflip-substrate-1.15.2+2', default-features = false, git = 'https://github.com/chainflip-io/polkadot-sdk.git' } # Used for RPCs -frame-system-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } cf-test-utilities = { path = '../test-utilities', optional = true } [dev-dependencies] -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [features] default = ['std'] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'cf-session-benchmarking/runtime-benchmarks', 'cf-traits/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', @@ -208,6 +208,7 @@ std = [ 'pallet-cf-cfe-interface/std', 'scale-info/std', 'serde/std', + 'sol-prim/std', 'sp-api/std', 'sp-block-builder/std', 'sp-consensus-aura/std', @@ -221,8 +222,8 @@ std = [ 'sp-std/std', 'sp-transaction-pool/std', 'sp-version/std', - 'substrate-wasm-builder', 'dep:cf-test-utilities', + "dep:substrate-wasm-builder", ] try-runtime = [ 'cf-runtime-upgrade-utilities/try-runtime', diff --git a/state-chain/runtime/src/chainflip/missed_authorship_slots.rs b/state-chain/runtime/src/chainflip/missed_authorship_slots.rs index 83c2ea84cd..859ef3582d 100644 --- a/state-chain/runtime/src/chainflip/missed_authorship_slots.rs +++ b/state-chain/runtime/src/chainflip/missed_authorship_slots.rs @@ -18,7 +18,6 @@ fn extract_slot_from_digest_item(item: &DigestItem) -> Option { } }) } - pub struct MissedAuraSlots; impl MissedAuthorshipSlots for MissedAuraSlots { @@ -50,8 +49,8 @@ mod test_missed_authorship_slots { use super::*; use codec::Encode; use frame_support::{ - construct_runtime, derive_impl, parameter_types, - sp_runtime::{testing::UintAuthorityId, traits::IdentityLookup, BuildStorage, Digest}, + construct_runtime, derive_impl, + sp_runtime::{testing::UintAuthorityId, BuildStorage, Digest}, traits::{ConstU32, ConstU64, OnInitialize}, }; use sp_consensus_aura::ed25519::AuthorityId; @@ -59,6 +58,10 @@ mod test_missed_authorship_slots { type Block = frame_system::mocking::MockBlock; + fn current_aura_slot() -> Slot { + pallet_aura::CurrentSlot::::get() + } + construct_runtime!( pub enum Test { @@ -68,35 +71,9 @@ mod test_missed_authorship_slots { } ); - parameter_types! { - pub const BlockHashCount: u64 = 250; - } - #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type Nonce = u64; - type RuntimeCall = RuntimeCall; - type Hash = sp_core::H256; - type Hashing = ::sp_runtime::traits::BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; } const SLOT_DURATION: u64 = 6; @@ -113,6 +90,7 @@ mod test_missed_authorship_slots { type DisabledValidators = (); type MaxAuthorities = ConstU32<10>; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } pub fn new_test_ext(authorities: Vec) -> sp_io::TestExternalities { @@ -180,19 +158,19 @@ mod test_missed_authorship_slots { simulate_block_authorship(3, |missed_slots| { assert_eq!(missed_slots, [2].map(to_slot)); }); - assert_eq!(Aura::current_slot(), to_slot(3)); + assert_eq!(current_aura_slot(), to_slot(3)); // Author for the next slot, assert we haven't missed a slot. simulate_block_authorship(4, |missed_slots| { assert!(missed_slots.is_empty()); }); - assert_eq!(Aura::current_slot(), to_slot(4)); + assert_eq!(current_aura_slot(), to_slot(4)); // Author for slot 7, assert we missed slots 5 and 6. simulate_block_authorship(7, |missed_slots| { assert_eq!(missed_slots, [5, 6].map(to_slot)); }); - assert_eq!(Aura::current_slot(), to_slot(7)); + assert_eq!(current_aura_slot(), to_slot(7)); }); } } diff --git a/state-chain/runtime/src/chainflip/offences.rs b/state-chain/runtime/src/chainflip/offences.rs index 91e1c7d81d..48dc4ba1ff 100644 --- a/state-chain/runtime/src/chainflip/offences.rs +++ b/state-chain/runtime/src/chainflip/offences.rs @@ -1,4 +1,5 @@ use crate::Runtime; +use cf_chains::ForeignChain; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::pallet_prelude::RuntimeDebug; use pallet_cf_reputation::OffenceList; @@ -36,6 +37,8 @@ pub enum Offence { ParticipateKeyHandoverFailed, /// A authority failed to Witness a call in time. FailedToWitnessInTime, + /// Failed to Complete Liveness Check for chain. + FailedLivenessCheck(ForeignChain), } /// Nodes should be excluded from keygen if they have been reported for any of the offences in this diff --git a/state-chain/runtime/src/chainflip/solana_elections.rs b/state-chain/runtime/src/chainflip/solana_elections.rs index 9ee808d3cc..ac26202983 100644 --- a/state-chain/runtime/src/chainflip/solana_elections.rs +++ b/state-chain/runtime/src/chainflip/solana_elections.rs @@ -1,23 +1,28 @@ -use crate::{Environment, Runtime, SolanaBroadcaster, SolanaChainTracking, SolanaThresholdSigner}; +use crate::{ + Environment, Offence, Reputation, Runtime, SolanaBroadcaster, SolanaChainTracking, + SolanaThresholdSigner, +}; use cf_chains::{ instances::ChainInstanceAlias, sol::{SolAddress, SolAmount, SolHash, SolSignature, SolTrackedData, SolanaCrypto}, - Chain, FeeEstimationApi, Solana, + Chain, FeeEstimationApi, ForeignChain, Solana, }; use cf_runtime_utilities::log_or_panic; use cf_traits::{ - AdjustedFeeEstimationApi, Chainflip, ElectionEgressWitnesser, GetBlockHeight, IngressSource, - SolanaNonceWatch, + offence_reporting::OffenceReporter, AdjustedFeeEstimationApi, Chainflip, + ElectionEgressWitnesser, GetBlockHeight, IngressSource, SolanaNonceWatch, }; use codec::{Decode, Encode}; +use frame_system::pallet_prelude::BlockNumberFor; use pallet_cf_elections::{ electoral_system::{ElectoralReadAccess, ElectoralSystem}, electoral_systems::{ self, change::OnChangeHook, - composite::{tuple_5_impls::Hooks, Composite, Translator}, + composite::{tuple_6_impls::Hooks, Composite, Translator}, egress_success::OnEgressSuccess, + liveness::OnCheckComplete, monotonic_median::MedianChangeHook, }, CorruptStorageError, ElectionIdentifier, InitialState, InitialStateOf, @@ -26,7 +31,7 @@ use pallet_cf_elections::{ use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_runtime::{DispatchResult, FixedPointNumber, FixedU128}; -use sp_std::vec::Vec; +use sp_std::{collections::btree_set::BTreeSet, vec::Vec}; #[cfg(feature = "runtime-benchmarks")] use cf_chains::benchmarking_value::BenchmarkValue; @@ -40,11 +45,14 @@ pub type SolanaElectoralSystem = Composite< SolanaIngressTracking, SolanaNonceTracking, SolanaEgressWitnessing, + SolanaLiveness, ), ::ValidatorId, SolanaElectionHooks, >; +const LIVENESS_CHECK_DURATION: BlockNumberFor = 10; + /// Creates an initial state to initialize the pallet with. pub fn initial_state( priority_fee: SolAmount, @@ -60,6 +68,7 @@ pub fn initial_state( (), (), (), + (), ), unsynchronised_settings: ( (), @@ -67,8 +76,16 @@ pub fn initial_state( (), (), (), + (), + ), + settings: ( + (), + (), + SolanaIngressSettings { vault_program, usdc_token_mint_pubkey }, + (), + (), + LIVENESS_CHECK_DURATION, ), - settings: ((), (), SolanaIngressSettings { vault_program, usdc_token_mint_pubkey }, (), ()), } } @@ -107,6 +124,22 @@ pub type SolanaEgressWitnessing = electoral_systems::egress_success::EgressSucce ::ValidatorId, >; +pub type SolanaLiveness = electoral_systems::liveness::Liveness< + ::ChainBlockNumber, + SolHash, + cf_primitives::BlockNumber, + OnCheckCompleteHook, + ::ValidatorId, +>; + +pub struct OnCheckCompleteHook; + +impl OnCheckComplete<::ValidatorId> for OnCheckCompleteHook { + fn on_check_complete(validator_ids: BTreeSet<::ValidatorId>) { + Reputation::report_many(Offence::FailedLivenessCheck(ForeignChain::Solana), validator_ids); + } +} + #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, TypeInfo)] pub struct TransactionSuccessDetails { pub tx_fee: u64, @@ -167,6 +200,7 @@ impl SolanaIngressTracking, SolanaNonceTracking, SolanaEgressWitnessing, + SolanaLiveness, > for SolanaElectionHooks { type OnFinalizeContext = (); @@ -179,6 +213,7 @@ impl IngressTranslator: Translator, NonceTrackingTranslator: Translator, EgressWitnessingTranslator: Translator, + LivenessTranslator: Translator, >( generic_electoral_access: &mut GenericElectoralAccess, ( @@ -187,12 +222,14 @@ impl ingress_translator, nonce_tracking_translator, egress_witnessing_translator, + liveness_translator, ): ( BlockHeightTranslator, FeeTranslator, IngressTranslator, NonceTrackingTranslator, EgressWitnessingTranslator, + LivenessTranslator, ), ( block_height_identifiers, @@ -200,6 +237,7 @@ impl ingress_identifiers, nonce_tracking_identifiers, egress_witnessing_identifiers, + liveness_identifiers, ): ( Vec< ElectionIdentifier< @@ -224,6 +262,7 @@ impl ::ElectionIdentifierExtra, >, >, + Vec::ElectionIdentifierExtra>>, ), _context: &Self::OnFinalizeContext, ) -> Result { @@ -232,6 +271,11 @@ impl block_height_identifiers, &(), )?; + SolanaLiveness::on_finalize( + &mut liveness_translator.translate_electoral_access(generic_electoral_access), + liveness_identifiers, + &(crate::System::block_number(), block_height), + )?; SolanaFeeTracking::on_finalize( &mut fee_translator.translate_electoral_access(generic_electoral_access), fee_identifiers, @@ -429,7 +473,7 @@ impl ElectionEgressWitnesser for SolanaEgressWitnessingTrigger { pallet_cf_elections::Pallet::::with_electoral_access( |electoral_access| { SolanaElectoralSystem::with_access_translators(|access_translators| { - let (_, _, _, _, access_translator) = &access_translators; + let (_, _, _, _, access_translator, ..) = &access_translators; let mut electoral_access = access_translator.translate_electoral_access(electoral_access); diff --git a/state-chain/runtime/src/lib.rs b/state-chain/runtime/src/lib.rs index 0f51a3f9bd..81226256aa 100644 --- a/state-chain/runtime/src/lib.rs +++ b/state-chain/runtime/src/lib.rs @@ -1,5 +1,4 @@ #![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] pub mod chainflip; pub mod constants; @@ -58,8 +57,9 @@ use cf_traits::{ }; use codec::{alloc::string::ToString, Decode, Encode}; use core::ops::Range; -use frame_support::instances::*; +use frame_support::{derive_impl, instances::*}; pub use frame_system::Call as SystemCall; +use migrations::add_liveness_electoral_system_solana::LivenessSettingsMigration; use pallet_cf_governance::GovCallHash; use pallet_cf_ingress_egress::{ ChannelAction, DepositWitness, IngressOrEgress, OwedAmount, TargetChainAsset, @@ -79,7 +79,7 @@ use scale_info::prelude::string::String; use sp_std::collections::btree_map::BTreeMap; pub use frame_support::{ - construct_runtime, debug, parameter_types, + debug, parameter_types, traits::{ ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Get, KeyOwnerProofSystem, Randomness, StorageInfo, @@ -104,13 +104,13 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, NumberFor, - One, OpaqueKeys, Saturating, UniqueSaturatedInto, Verify, + BlakeTwo256, Block as BlockT, ConvertInto, IdentifyAccount, NumberFor, One, OpaqueKeys, + Saturating, UniqueSaturatedInto, Verify, }, BoundedVec, }; -use frame_support::genesis_builder_helper::{build_config, create_default_config}; +use frame_support::genesis_builder_helper::build_state; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ @@ -555,41 +555,22 @@ parameter_types! { } // Configure FRAME pallets to include in runtime. +#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)] impl frame_system::Config for Runtime { - /// The basic call filter to use in dispatchable. - type BaseCallFilter = frame_support::traits::Everything; /// The block type for the runtime. type Block = Block; /// Block & extrinsics weights: base values and limits. type BlockWeights = BlockWeights; /// The maximum length of a block (in bytes). type BlockLength = BlockLength; - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The type for storing how many extrinsics an account has signed. - type Nonce = Nonce; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// The type for hashing blocks and tries. - type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// The weight of database operations that the runtime can invoke. type DbWeight = DbWeight; /// Version of the runtime. type Version = Version; - /// Converts a module to the index of the module in `construct_runtime!`. - /// - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; /// What to do if a new account is created. type OnNewAccount = AccountRoles; /// What to do if an account is fully reaped from the system. @@ -608,9 +589,8 @@ impl frame_system::Config for Runtime { type SystemWeightInfo = weights::frame_system::SubstrateWeight; /// This is used as an identifier of the chain. type SS58Prefix = ConstU16; - /// The set code logic, just the default since we're not a parachain. - type OnSetCode = (); - type MaxConsumers = ConstU32<16>; + + /// We don't use RuntimeTask. type RuntimeTask = (); } @@ -624,6 +604,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } parameter_types! { @@ -1018,71 +999,122 @@ impl pallet_cf_elections::Config for Runtime { type WeightInfo = pallet_cf_elections::weights::PalletWeight; } -construct_runtime!( - pub struct Runtime - { - System: frame_system, - Timestamp: pallet_timestamp, - Environment: pallet_cf_environment, - Flip: pallet_cf_flip, - Emissions: pallet_cf_emissions, - // AccountRoles after funding, since account creation comes first. - Funding: pallet_cf_funding, - AccountRoles: pallet_cf_account_roles, - TransactionPayment: pallet_transaction_payment, - Witnesser: pallet_cf_witnesser, - Validator: pallet_cf_validator, - Session: pallet_session, - Historical: session_historical::{Pallet}, - Aura: pallet_aura, - Authorship: pallet_authorship, - Grandpa: pallet_grandpa, - Governance: pallet_cf_governance, - TokenholderGovernance: pallet_cf_tokenholder_governance, - Reputation: pallet_cf_reputation, - - EthereumChainTracking: pallet_cf_chain_tracking::, - PolkadotChainTracking: pallet_cf_chain_tracking::, - BitcoinChainTracking: pallet_cf_chain_tracking::, - - EthereumVault: pallet_cf_vaults::, - PolkadotVault: pallet_cf_vaults::, - BitcoinVault: pallet_cf_vaults::, - - EvmThresholdSigner: pallet_cf_threshold_signature::, - PolkadotThresholdSigner: pallet_cf_threshold_signature::, - BitcoinThresholdSigner: pallet_cf_threshold_signature::, - - EthereumBroadcaster: pallet_cf_broadcast::, - PolkadotBroadcaster: pallet_cf_broadcast::, - BitcoinBroadcaster: pallet_cf_broadcast::, - - Swapping: pallet_cf_swapping, - LiquidityProvider: pallet_cf_lp, - - EthereumIngressEgress: pallet_cf_ingress_egress::, - PolkadotIngressEgress: pallet_cf_ingress_egress::, - BitcoinIngressEgress: pallet_cf_ingress_egress::, - - LiquidityPools: pallet_cf_pools, - - CfeInterface: pallet_cf_cfe_interface, - - ArbitrumChainTracking: pallet_cf_chain_tracking::, - ArbitrumVault: pallet_cf_vaults::, - ArbitrumBroadcaster: pallet_cf_broadcast::, - ArbitrumIngressEgress: pallet_cf_ingress_egress::, - - SolanaVault: pallet_cf_vaults::, - SolanaThresholdSigner: pallet_cf_threshold_signature::, - SolanaBroadcaster: pallet_cf_broadcast::, - SolanaIngressEgress: pallet_cf_ingress_egress::, - SolanaElections: pallet_cf_elections::, - SolanaChainTracking: pallet_cf_chain_tracking::, - - AssetBalances: pallet_cf_asset_balances, - } -); +#[frame_support::runtime] +mod runtime { + #[runtime::runtime] + #[runtime::derive(RuntimeCall, RuntimeEvent, RuntimeError, RuntimeOrigin)] + pub struct Runtime; + + #[runtime::pallet_index(0)] + pub type System = frame_system; + #[runtime::pallet_index(1)] + pub type Timestamp = pallet_timestamp; + #[runtime::pallet_index(2)] + pub type Environment = pallet_cf_environment; + #[runtime::pallet_index(3)] + pub type Flip = pallet_cf_flip; + #[runtime::pallet_index(4)] + pub type Emissions = pallet_cf_emissions; + + // AccountRoles after funding; since account creation comes first. + #[runtime::pallet_index(5)] + pub type Funding = pallet_cf_funding; + #[runtime::pallet_index(6)] + pub type AccountRoles = pallet_cf_account_roles; + #[runtime::pallet_index(7)] + pub type TransactionPayment = pallet_transaction_payment; + #[runtime::pallet_index(8)] + pub type Witnesser = pallet_cf_witnesser; + #[runtime::pallet_index(9)] + pub type Validator = pallet_cf_validator; + #[runtime::pallet_index(10)] + pub type Session = pallet_session; + #[runtime::pallet_index(11)] + pub type Historical = session_historical; + #[runtime::pallet_index(12)] + pub type Aura = pallet_aura; + #[runtime::pallet_index(13)] + pub type Authorship = pallet_authorship; + #[runtime::pallet_index(14)] + pub type Grandpa = pallet_grandpa; + #[runtime::pallet_index(15)] + pub type Governance = pallet_cf_governance; + #[runtime::pallet_index(16)] + pub type TokenholderGovernance = pallet_cf_tokenholder_governance; + #[runtime::pallet_index(17)] + pub type Reputation = pallet_cf_reputation; + + #[runtime::pallet_index(18)] + pub type EthereumChainTracking = pallet_cf_chain_tracking; + #[runtime::pallet_index(19)] + pub type PolkadotChainTracking = pallet_cf_chain_tracking; + #[runtime::pallet_index(20)] + pub type BitcoinChainTracking = pallet_cf_chain_tracking; + + #[runtime::pallet_index(21)] + pub type EthereumVault = pallet_cf_vaults; + #[runtime::pallet_index(22)] + pub type PolkadotVault = pallet_cf_vaults; + #[runtime::pallet_index(23)] + pub type BitcoinVault = pallet_cf_vaults; + + #[runtime::pallet_index(24)] + pub type EvmThresholdSigner = pallet_cf_threshold_signature; + #[runtime::pallet_index(25)] + pub type PolkadotThresholdSigner = pallet_cf_threshold_signature; + #[runtime::pallet_index(26)] + pub type BitcoinThresholdSigner = pallet_cf_threshold_signature; + + #[runtime::pallet_index(27)] + pub type EthereumBroadcaster = pallet_cf_broadcast; + #[runtime::pallet_index(28)] + pub type PolkadotBroadcaster = pallet_cf_broadcast; + #[runtime::pallet_index(29)] + pub type BitcoinBroadcaster = pallet_cf_broadcast; + + #[runtime::pallet_index(30)] + pub type Swapping = pallet_cf_swapping; + #[runtime::pallet_index(31)] + pub type LiquidityProvider = pallet_cf_lp; + + #[runtime::pallet_index(32)] + pub type EthereumIngressEgress = pallet_cf_ingress_egress; + #[runtime::pallet_index(33)] + pub type PolkadotIngressEgress = pallet_cf_ingress_egress; + #[runtime::pallet_index(34)] + pub type BitcoinIngressEgress = pallet_cf_ingress_egress; + + #[runtime::pallet_index(35)] + pub type LiquidityPools = pallet_cf_pools; + + #[runtime::pallet_index(36)] + pub type CfeInterface = pallet_cf_cfe_interface; + + #[runtime::pallet_index(37)] + pub type ArbitrumChainTracking = pallet_cf_chain_tracking; + #[runtime::pallet_index(38)] + pub type ArbitrumVault = pallet_cf_vaults; + #[runtime::pallet_index(39)] + pub type ArbitrumBroadcaster = pallet_cf_broadcast; + #[runtime::pallet_index(40)] + pub type ArbitrumIngressEgress = pallet_cf_ingress_egress; + + #[runtime::pallet_index(41)] + pub type SolanaVault = pallet_cf_vaults; + #[runtime::pallet_index(42)] + pub type SolanaThresholdSigner = pallet_cf_threshold_signature; + #[runtime::pallet_index(43)] + pub type SolanaBroadcaster = pallet_cf_broadcast; + #[runtime::pallet_index(44)] + pub type SolanaIngressEgress = pallet_cf_ingress_egress; + #[runtime::pallet_index(45)] + pub type SolanaElections = pallet_cf_elections; + #[runtime::pallet_index(46)] + pub type SolanaChainTracking = pallet_cf_chain_tracking; + + #[runtime::pallet_index(47)] + pub type AssetBalances = pallet_cf_asset_balances; +} /// The address format for describing accounts. pub type Address = sp_runtime::MultiAddress; @@ -1110,20 +1142,6 @@ pub type UncheckedExtrinsic = pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; -#[cfg(not(feature = "try-runtime"))] -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - PalletExecutionOrder, - AllMigrations, ->; - -// NOTE: This should be a temporary workaround. When paritytech/polkadot-sdk#2560 is merged into our -// substrate fork, we can remove this. -#[cfg(feature = "try-runtime")] /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, @@ -1132,7 +1150,6 @@ pub type Executive = frame_executive::Executive< Runtime, PalletExecutionOrder, AllMigrations, - AllPalletsWithoutSystem, >; pub type PalletExecutionOrder = ( @@ -1264,6 +1281,12 @@ type MigrationsForV1_7 = ( VersionedMigration, NoopUpgrade, 8, 9>, VersionedMigration, NoopUpgrade, 8, 9>, VersionedMigration, NoopUpgrade, 8, 9>, + VersionedMigration< + pallet_cf_elections::Pallet, + LivenessSettingsMigration, + 0, + 1, + >, ); #[cfg(feature = "runtime-benchmarks")] @@ -1799,6 +1822,10 @@ impl_runtime_apis! { pallet_cf_swapping::Pallet::::get_swap_limits() } + fn cf_minimum_chunk_size(asset: Asset) -> AssetAmount { + Swapping::minimum_chunk_size(asset) + } + /// This should *not* be fully trusted as if the deposits that are pre-witnessed will definitely go through. /// This returns a list of swaps in the requested direction that are pre-witnessed in the current block. fn cf_prewitness_swaps(base_asset: Asset, quote_asset: Asset, side: Side) -> Vec { @@ -2221,7 +2248,7 @@ impl_runtime_apis! { Executive::execute_block(block); } - fn initialize_block(header: &::Header) { + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { Executive::initialize_block(header) } } @@ -2283,7 +2310,7 @@ impl_runtime_apis! { } fn authorities() -> Vec { - Aura::authorities().into_inner() + pallet_aura::Authorities::::get().into_inner() } } @@ -2408,12 +2435,16 @@ impl_runtime_apis! { } impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(_id: &Option) -> Option> { + None } - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) + fn preset_names() -> Vec { + Default::default() } } @@ -2438,6 +2469,7 @@ impl_runtime_apis! { (list, storage_info) } + #[allow(non_local_definitions)] fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { diff --git a/state-chain/runtime/src/migrations.rs b/state-chain/runtime/src/migrations.rs index 03fc5f0beb..ba3424202f 100644 --- a/state-chain/runtime/src/migrations.rs +++ b/state-chain/runtime/src/migrations.rs @@ -1,5 +1,6 @@ //! Chainflip runtime storage migrations. +pub mod add_liveness_electoral_system_solana; pub mod housekeeping; pub mod reap_old_accounts; pub mod serialize_solana_broadcast; diff --git a/state-chain/runtime/src/migrations/add_liveness_electoral_system_solana.rs b/state-chain/runtime/src/migrations/add_liveness_electoral_system_solana.rs new file mode 100644 index 0000000000..9773b7cf2f --- /dev/null +++ b/state-chain/runtime/src/migrations/add_liveness_electoral_system_solana.rs @@ -0,0 +1,39 @@ +use crate::*; +use frame_support::{pallet_prelude::Weight, storage::unhashed, traits::OnRuntimeUpgrade}; +use frame_system::pallet_prelude::BlockNumberFor; + +use pallet_cf_elections::{electoral_system::ElectoralSystem, Config, ElectoralSettings}; +#[cfg(feature = "try-runtime")] +use sp_runtime::DispatchError; + +use codec::{Decode, Encode}; + +pub struct LivenessSettingsMigration; + +const LIVENESS_CHECK_DURATION: BlockNumberFor = 10; + +// Because the Liveness electoral system is added to the end, and the rest of its types are the same +// we can simply append the encoded bytes to the raw storage. +impl OnRuntimeUpgrade for LivenessSettingsMigration { + fn on_runtime_upgrade() -> Weight { + for key in ElectoralSettings::::iter_keys() { + let mut raw_storage_at_key = unhashed::get_raw(&ElectoralSettings::< + Runtime, + SolanaInstance, + >::hashed_key_for(key)) + .expect("We just got the keys directly from the storage"); + raw_storage_at_key.extend(LIVENESS_CHECK_DURATION.encode()); + ElectoralSettings::::insert(key, <>::ElectoralSystem as ElectoralSystem>::ElectoralSettings::decode(&mut &raw_storage_at_key[..]).unwrap()); + } + + Weight::zero() + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), DispatchError> { + for (.., liveness_duration) in ElectoralSettings::::iter_values() { + assert_eq!(liveness_duration, LIVENESS_CHECK_DURATION); + } + Ok(()) + } +} diff --git a/state-chain/runtime/src/migrations/housekeeping.rs b/state-chain/runtime/src/migrations/housekeeping.rs index e7dd513b19..8e8a296285 100644 --- a/state-chain/runtime/src/migrations/housekeeping.rs +++ b/state-chain/runtime/src/migrations/housekeeping.rs @@ -1,17 +1,38 @@ use crate::Runtime; +use cf_chains::instances::{ArbitrumInstance, EthereumInstance, PolkadotInstance}; +use cf_runtime_upgrade_utilities::genesis_hashes; use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; +use pallet_cf_broadcast::migrations::remove_aborted_broadcasts; +#[cfg(feature = "try-runtime")] +use sp_runtime::DispatchError; +#[cfg(feature = "try-runtime")] +use sp_std::vec::Vec; pub struct Migration; impl OnRuntimeUpgrade for Migration { fn on_runtime_upgrade() -> Weight { - use cf_runtime_upgrade_utilities::genesis_hashes; match genesis_hashes::genesis_hash::() { genesis_hashes::BERGHAIN => { - log::info!("🧹 No housekeeping required for Berghain."); + log::info!("🧹 Housekeeping, removing stale aborted broadcasts"); + remove_aborted_broadcasts::remove_stale_and_all_older::( + remove_aborted_broadcasts::ETHEREUM_MAX_ABORTED_BROADCAST_BERGHAIN, + ); + remove_aborted_broadcasts::remove_stale_and_all_older::( + remove_aborted_broadcasts::ARBITRUM_MAX_ABORTED_BROADCAST_BERGHAIN, + ); }, genesis_hashes::PERSEVERANCE => { - log::info!("🧹 No housekeeping required for Perseverance."); + log::info!("🧹 Housekeeping, removing stale aborted broadcasts"); + remove_aborted_broadcasts::remove_stale_and_all_older::( + remove_aborted_broadcasts::ETHEREUM_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); + remove_aborted_broadcasts::remove_stale_and_all_older::( + remove_aborted_broadcasts::ARBITRUM_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); + remove_aborted_broadcasts::remove_stale_and_all_older::( + remove_aborted_broadcasts::POLKADOT_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); }, genesis_hashes::SISYPHOS => { log::info!("🧹 No housekeeping required for Sisyphos."); @@ -21,4 +42,40 @@ impl OnRuntimeUpgrade for Migration { Weight::zero() } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), DispatchError> { + match genesis_hashes::genesis_hash::() { + genesis_hashes::BERGHAIN => { + log::info!( + "Housekeeping post_upgrade, checking stale aborted broadcasts are removed." + ); + remove_aborted_broadcasts::assert_removed::( + remove_aborted_broadcasts::ETHEREUM_MAX_ABORTED_BROADCAST_BERGHAIN, + ); + remove_aborted_broadcasts::assert_removed::( + remove_aborted_broadcasts::ARBITRUM_MAX_ABORTED_BROADCAST_BERGHAIN, + ); + }, + genesis_hashes::PERSEVERANCE => { + log::info!( + "Housekeeping post_upgrade, checking stale aborted broadcasts are removed." + ); + remove_aborted_broadcasts::assert_removed::( + remove_aborted_broadcasts::ETHEREUM_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); + remove_aborted_broadcasts::assert_removed::( + remove_aborted_broadcasts::ARBITRUM_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); + remove_aborted_broadcasts::assert_removed::( + remove_aborted_broadcasts::POLKADOT_MAX_ABORTED_BROADCAST_PERSEVERANCE, + ); + }, + genesis_hashes::SISYPHOS => { + log::info!("Skipping housekeeping post_upgrade for Sisyphos."); + }, + _ => {}, + } + Ok(()) + } } diff --git a/state-chain/runtime/src/migrations/reap_old_accounts.rs b/state-chain/runtime/src/migrations/reap_old_accounts.rs index d10f215a60..3241dd2e1a 100644 --- a/state-chain/runtime/src/migrations/reap_old_accounts.rs +++ b/state-chain/runtime/src/migrations/reap_old_accounts.rs @@ -25,7 +25,7 @@ impl OnRuntimeUpgrade for Migration { log::info!("🪓 Reaping old accounts."); for (account_id, account) in pallet_cf_flip::Account::::iter() { if account.total() == 0u128 { - let account_id_hex = hex::encode(&account_id.encode()); + let account_id_hex = hex::encode(account_id.encode()); if let Some(PendingRedemptionInfo { total, .. }) = pallet_cf_funding::PendingRedemptions::::get(&account_id) { diff --git a/state-chain/runtime/src/migrations/serialize_solana_broadcast.rs b/state-chain/runtime/src/migrations/serialize_solana_broadcast.rs index bd2ae744e3..7c262ce6a6 100644 --- a/state-chain/runtime/src/migrations/serialize_solana_broadcast.rs +++ b/state-chain/runtime/src/migrations/serialize_solana_broadcast.rs @@ -3,7 +3,6 @@ use pallet_cf_broadcast::BroadcastData; use crate::*; use frame_support::pallet_prelude::Weight; -#[cfg(feature = "try-runtime")] use sp_runtime::DispatchError; use cf_chains::sol::{SolTransaction, SolanaTransactionData}; @@ -37,7 +36,7 @@ pub struct SerializeSolanaBroadcastMigration; impl OnRuntimeUpgrade for SerializeSolanaBroadcastMigration { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, DispatchError> { - Ok((old::AwaitingBroadcast::iter().count() as u64).encode()) + pre_upgrade_check() } fn on_runtime_upgrade() -> Weight { @@ -64,16 +63,23 @@ impl OnRuntimeUpgrade for SerializeSolanaBroadcastMigration { #[cfg(feature = "try-runtime")] fn post_upgrade(state: Vec) -> Result<(), DispatchError> { - let pre_awaiting_broadcast_count = ::decode(&mut state.as_slice()) - .map_err(|_| DispatchError::from("Failed to decode state"))?; + post_upgrade_check(state) + } +} + +pub fn pre_upgrade_check() -> Result, DispatchError> { + Ok((old::AwaitingBroadcast::iter().count() as u64).encode()) +} - let post_awaiting_broadcast_count = - pallet_cf_broadcast::AwaitingBroadcast::::iter().count() - as u64; +pub fn post_upgrade_check(state: Vec) -> Result<(), DispatchError> { + let pre_awaiting_broadcast_count = ::decode(&mut state.as_slice()) + .map_err(|_| DispatchError::from("Failed to decode state"))?; - assert_eq!(pre_awaiting_broadcast_count, post_awaiting_broadcast_count); - Ok(()) - } + let post_awaiting_broadcast_count = + pallet_cf_broadcast::AwaitingBroadcast::::iter().count() as u64; + + assert_eq!(pre_awaiting_broadcast_count, post_awaiting_broadcast_count); + Ok(()) } pub struct NoopUpgrade; diff --git a/state-chain/runtime/src/monitoring_apis.rs b/state-chain/runtime/src/monitoring_apis.rs index 324dc39e43..9ee775c74a 100644 --- a/state-chain/runtime/src/monitoring_apis.rs +++ b/state-chain/runtime/src/monitoring_apis.rs @@ -14,7 +14,7 @@ use sp_api::decl_runtime_apis; use sp_runtime::BoundedVec; use sp_std::vec::Vec; -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct ExternalChainsBlockHeight { pub bitcoin: u64, pub ethereum: u64, @@ -22,13 +22,13 @@ pub struct ExternalChainsBlockHeight { pub solana: u64, pub arbitrum: u64, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct BtcUtxos { pub total_balance: u64, pub count: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct EpochState { pub blocks_per_epoch: u32, pub current_epoch_started_at: u32, @@ -37,12 +37,12 @@ pub struct EpochState { pub rotation_phase: String, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct RedemptionsInfo { pub total_balance: u128, pub count: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct PendingBroadcasts { pub ethereum: u32, pub bitcoin: u32, @@ -50,14 +50,14 @@ pub struct PendingBroadcasts { pub arbitrum: u32, pub solana: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct PendingTssCeremonies { pub evm: u32, pub bitcoin: u32, pub polkadot: u32, pub solana: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct OpenDepositChannels { pub ethereum: u32, pub bitcoin: u32, @@ -65,7 +65,7 @@ pub struct OpenDepositChannels { pub arbitrum: u32, pub solana: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct FeeImbalance { pub ethereum: VaultImbalance, pub polkadot: VaultImbalance, @@ -86,7 +86,7 @@ impl FeeImbalance { } } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct AuthoritiesInfo { pub authorities: u32, pub online_authorities: u32, @@ -94,25 +94,25 @@ pub struct AuthoritiesInfo { pub online_backups: u32, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct LastRuntimeUpgradeInfo { pub spec_version: u32, pub spec_name: sp_runtime::RuntimeString, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct FlipSupply { pub total_supply: u128, pub offchain_supply: u128, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct SolanaNonces { pub available: Vec, pub unavailable: Vec, } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct ActivateKeysBroadcastIds { pub ethereum: Option, pub bitcoin: Option, @@ -121,7 +121,7 @@ pub struct ActivateKeysBroadcastIds { pub solana: (Option, Option), } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct MonitoringData { pub external_chains_height: ExternalChainsBlockHeight, pub btc_utxos: BtcUtxos, diff --git a/state-chain/runtime/src/runtime_apis.rs b/state-chain/runtime/src/runtime_apis.rs index ec310b1730..509a99389a 100644 --- a/state-chain/runtime/src/runtime_apis.rs +++ b/state-chain/runtime/src/runtime_apis.rs @@ -62,7 +62,7 @@ pub struct ValidatorInfo { pub restricted_balances: BTreeMap, } -#[derive(Encode, Decode, Eq, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Eq, PartialEq, TypeInfo, Clone)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct BoostPoolDepth { #[cfg_attr(feature = "std", serde(flatten))] @@ -162,7 +162,7 @@ impl From for DispatchErrorWithMessage { } } -#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug)] +#[derive(Serialize, Deserialize, Encode, Decode, Eq, PartialEq, TypeInfo, Debug, Clone)] pub struct FailingWitnessValidators { pub failing_count: u32, pub validators: Vec<(cf_primitives::AccountId, String, bool)>, @@ -285,6 +285,7 @@ decl_runtime_apis!( fn cf_swap_retry_delay_blocks() -> u32; fn cf_swap_limits() -> SwapLimits; fn cf_lp_events() -> Vec>; + fn cf_minimum_chunk_size(asset: Asset) -> AssetAmount; } ); diff --git a/state-chain/test-utilities/Cargo.toml b/state-chain/test-utilities/Cargo.toml index 4d8a6fbbd6..a10f3752d9 100644 --- a/state-chain/test-utilities/Cargo.toml +++ b/state-chain/test-utilities/Cargo.toml @@ -9,14 +9,14 @@ description = 'Chainflip test utilities used in multiple crates' workspace = true [dependencies] -codec = { package = 'parity-scale-codec', version = '3.6.1' } +codec = { package = "parity-scale-codec", version = "3.6.12" } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } [dev-dependencies] -scale-info = { version = "2.10.0", features = ["derive"] } +scale-info = { version = "2.11.1", features = ["derive"] } diff --git a/state-chain/test-utilities/src/lib.rs b/state-chain/test-utilities/src/lib.rs index f23edc4074..ae24cee550 100644 --- a/state-chain/test-utilities/src/lib.rs +++ b/state-chain/test-utilities/src/lib.rs @@ -1,4 +1,6 @@ #![feature(closure_track_caller)] +#![allow(clippy::doc_lazy_continuation)] + use frame_system::Config; mod rich_test_externalities; @@ -104,7 +106,7 @@ macro_rules! assert_events_eq { /// It provides a `new_test_ext` function that optionally uses a custom genesis and initialization /// function. /// -/// Use this macro in conjuction with `construct_runtime!(..)`. In addition to the runtime type +/// Use this macro in conjunction with `construct_runtime!(..)`. In addition to the runtime type /// itself, the `RuntimeGenesisConfig` and `AllPalletsWithSystem` type that are generated by /// construct_runtime must also be in scope. /// diff --git a/state-chain/test-utilities/src/rich_test_externalities.rs b/state-chain/test-utilities/src/rich_test_externalities.rs index c394d39b28..248cd419dc 100644 --- a/state-chain/test-utilities/src/rich_test_externalities.rs +++ b/state-chain/test-utilities/src/rich_test_externalities.rs @@ -385,15 +385,10 @@ where #[cfg(test)] mod test_examples { use super::*; - use frame_support::traits::OriginTrait; - use sp_core::{ConstU16, ConstU64, H256}; - use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - DispatchError, - }; + use frame_support::{derive_impl, traits::OriginTrait}; + use sp_runtime::DispatchError; type Block = frame_system::mocking::MockBlock; - type AccountId = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( @@ -403,31 +398,9 @@ mod test_examples { } ); + #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = ConstU16<42>; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<5>; - type RuntimeTask = (); } impl HasAllPallets for Test { diff --git a/state-chain/traits/Cargo.toml b/state-chain/traits/Cargo.toml index dce1ec6f01..7f98263cd2 100644 --- a/state-chain/traits/Cargo.toml +++ b/state-chain/traits/Cargo.toml @@ -15,25 +15,25 @@ log = { version = '0.4.16', default-features = false } cf-chains = { path = '../chains', default-features = false } cf-primitives = { path = '../primitives', default-features = false } cfe-events = { path = '../cfe-events', default-features = false } -cf-amm = { path = "../amm", default-features = false} +cf-amm = { path = "../amm", default-features = false } # Parity deps -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } -frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false, optional = true } -frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } -sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", default-features = false } +frame-benchmarking = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false, optional = true } +frame-support = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +frame-system = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } +sp-std = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1" } -serde = { default_features = false, version = '1.0.126', features = [ +sp-io = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +sp-runtime = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2" } +serde = { default-features = false, version = '1.0.197', features = [ 'alloc', 'derive', ] } @@ -55,7 +55,6 @@ std = [ ] runtime-benchmarks = [ 'cf-chains/runtime-benchmarks', - 'cf-primitives/runtime-benchmarks', 'frame-benchmarking/runtime-benchmarks', 'frame-support/runtime-benchmarks', 'frame-system/runtime-benchmarks', diff --git a/state-chain/traits/src/lib.rs b/state-chain/traits/src/lib.rs index fa82ca329e..8a8e73869f 100644 --- a/state-chain/traits/src/lib.rs +++ b/state-chain/traits/src/lib.rs @@ -334,6 +334,7 @@ pub trait EmissionsTrigger { } /// A representation of the current network state for this heartbeat interval. +/// /// A node is regarded online if we have received a heartbeat during the last heartbeat interval /// otherwise they are considered offline. #[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug, PartialEq, Eq, Default)] @@ -608,6 +609,7 @@ pub trait QualifyNode { } /// Qualify if the node has registered +#[allow(dead_code)] pub struct SessionKeysRegistered((PhantomData, PhantomData)); impl> @@ -674,6 +676,10 @@ pub trait HistoricalEpoch { fn active_bond(authority: &Self::ValidatorId) -> Self::Amount; /// Returns the number of active epochs a authority is still active in fn number_of_active_epochs_for_authority(id: &Self::ValidatorId) -> u32; + /// Is the validator a keyholder for an active epoch? + fn is_keyholder(id: &Self::ValidatorId) -> bool { + Self::number_of_active_epochs_for_authority(id) > 0 + } } /// Handles the bonding logic diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index bb27797a82..2a2e70face 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -12,18 +12,18 @@ version = '0.1.0' workspace = true [dependencies] -jsonrpsee = { version = "0.16.2", features = [ +jsonrpsee = { version = "0.23.2", features = [ "jsonrpsee-types", ], optional = true } anyhow = { version = '1.0', optional = true } async-broadcast = { version = "0.5", optional = true } async-channel = { version = "1.7.1", optional = true } bs58 = { version = "0.5.1", default-features = false } -clap = { version = "3.2.23", features = ["derive"], optional = true } -futures = { version = "0.3.14", optional = true } +clap = { version = "4.5.3", features = ["derive"], optional = true } +futures = { version = "0.3.30", optional = true } futures-util = { version = "0.3.14", optional = true } hex = { version = "0.4.3", default-features = false } -itertools = { version = "0.11", default_features = false } +itertools = { version = "0.13", default-features = false } lazy_format = "2.0" lazy_static = "1.4" log = "0.4" @@ -31,16 +31,16 @@ mockall = { version = "0.11.0", optional = true } num-traits = { version = "0.2", optional = true } pin-project = { version = "1.0.12", optional = true } predicates = { version = "3.0", optional = true } -prometheus = { version = "0.13.0", default-features = false } +prometheus = { version = "0.13.0", default-features = false, optional = true } regex = { version = "1", optional = true } -scale-info = { version = "2.10", optional = true } +scale-info = { version = "2.11.1", optional = true } scopeguard = { version = "1.2.0" } -serde = { version = "1.0", optional = true, default_features = false, features = [ +serde = { optional = true, version = "1.0.197", default-features = false, features = [ "alloc", "derive", ] } -sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true } -sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.6+1", optional = true } +sp-core = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true } +sp-rpc = { git = "https://github.com/chainflip-io/polkadot-sdk.git", tag = "chainflip-substrate-1.15.2+2", optional = true } tempfile = { version = "3.7.0", optional = true } thiserror = { version = "1.0.26", optional = true } tokio = { version = "1.13.1", features = ["full"], optional = true } @@ -62,8 +62,6 @@ tempfile = "3.7.0" reqwest = { version = "0.11.4", features = ["rustls-tls"] } [features] -default = ['std'] -test-utils = ['dep:tempfile', 'dep:tracing', 'dep:tracing-subscriber'] std = [ 'dep:anyhow', 'dep:async-broadcast', @@ -76,6 +74,7 @@ std = [ 'dep:async-channel', 'itertools/use_std', 'dep:pin-project', + 'dep:prometheus', 'dep:serde', 'serde?/std', 'dep:scale-info', @@ -92,3 +91,5 @@ std = [ 'dep:url', 'dep:clap', ] +default = ['std'] +test-utils = ['dep:tempfile', 'dep:tracing', 'dep:tracing-subscriber'] diff --git a/utilities/scale-json-event-logger/Cargo.toml b/utilities/scale-json-event-logger/Cargo.toml index 45c698916f..97dee6144b 100644 --- a/utilities/scale-json-event-logger/Cargo.toml +++ b/utilities/scale-json-event-logger/Cargo.toml @@ -10,6 +10,6 @@ log = "0.4.16" subxt = { version = "0.33", features = ["substrate-compat"] } tokio = { version = "1.22", features = ["full"] } cf-utilities = { package = "utilities", path = ".." } -hex = "0.4" -hex-literal = "0.4" +hex = "0.4.3" +hex-literal = "0.4.1" anyhow = "1.0" diff --git a/utilities/scale-json/Cargo.toml b/utilities/scale-json/Cargo.toml index 8adb54bf57..e1b3baa370 100644 --- a/utilities/scale-json/Cargo.toml +++ b/utilities/scale-json/Cargo.toml @@ -12,17 +12,17 @@ version = '0.1.0' workspace = true [dependencies] -hex = "0.4" +hex = "0.4.3" scale-decode = "0.13" scale-type-resolver = "0.2" -serde = { version = "1.0.195", features = ["derive"] } +serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.111" [dev-dependencies] insta = { version = "1.38.0", features = ["json"] } -codec = { package = 'parity-scale-codec', version = '3.6.1', default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ 'derive', ] } -scale-info = { version = '2.10.0', default-features = false, features = [ +scale-info = { version = "2.11.1", default-features = false, features = [ 'derive', ] } diff --git a/utilities/src/lib.rs b/utilities/src/lib.rs index 844ce242f2..c4b4632353 100644 --- a/utilities/src/lib.rs +++ b/utilities/src/lib.rs @@ -34,8 +34,9 @@ macro_rules! assert_err { }; } -/// Note that the resulting `threshold` is the maximum number -/// of parties *not* enough to generate a signature, +/// Note that the resulting `threshold` is the maximum number of parties *not* enough to generate a +/// signature, +/// /// i.e. at least `t+1` parties are required. /// This follows the notation in the multisig library that /// we are using and in the corresponding literature. diff --git a/utilities/src/with_std.rs b/utilities/src/with_std.rs index c8b1cd3e2c..77944f9e3e 100644 --- a/utilities/src/with_std.rs +++ b/utilities/src/with_std.rs @@ -93,9 +93,10 @@ pub fn assert_stream_send<'u, R>( stream } -/// Makes a tick that outputs every duration and if ticks are "missed" (as tick() wasn't called for -/// some time) it will immediately output a single tick on the next call to tick() and resume -/// ticking every duration. +/// Makes a tick that outputs every duration. +/// +/// If ticks are "missed" (as tick() wasn't called for some time) it will immediately output a +/// single tick on the next call to tick() and resume ticking every duration. /// /// The supplied duration should be >> 5ms due to the underlying implementation of /// [Interval::poll_tick]. diff --git a/utilities/src/with_std/cached_stream.rs b/utilities/src/with_std/cached_stream.rs index 2a0bd41c95..44ead7c195 100644 --- a/utilities/src/with_std/cached_stream.rs +++ b/utilities/src/with_std/cached_stream.rs @@ -104,9 +104,6 @@ mod tests { #[tokio::test] async fn next_and_cached() { - #[derive(Debug, PartialEq)] - struct Wrappedi32(i32); - let mut cached_stream = test_stream().make_cached(0); assert_eq!(*cached_stream.cache(), 0); diff --git a/utilities/src/with_std/logging.rs b/utilities/src/with_std/logging.rs index 2afa9d2706..7b096f5a7c 100644 --- a/utilities/src/with_std/logging.rs +++ b/utilities/src/with_std/logging.rs @@ -67,11 +67,12 @@ macro_rules! print_start_and_end { }; } -/// Install a tracing subscriber that uses json formatting for the logs. The initial filtering -/// directives can be set using the RUST_LOG environment variable, if it is not set the subscriber -/// will default to INFO, meaning all INFO, WARN, or ERROR logs will be output, all the other logs -/// will be ignored. The filtering directives can also be controlled via a REST api while the -/// application is running, for example: +/// Install a tracing subscriber that uses json formatting for the logs. +/// +/// The initial filtering directives can be set using the RUST_LOG environment variable, if it is +/// not set the subscriber will default to INFO, meaning all INFO, WARN, or ERROR logs will be +/// output, all the other logs will be ignored. The filtering directives can also be controlled via +/// a REST api while the application is running, for example: /// /// `curl -X GET 127.0.0.1:36079/tracing` - This returns the current filtering directives /// `curl --json '"debug,warp=off,hyper=off,jsonrpc=off,web3=off,reqwest=off"' diff --git a/utilities/src/with_std/metrics.rs b/utilities/src/with_std/metrics.rs index b1244fd338..99738a4381 100644 --- a/utilities/src/with_std/metrics.rs +++ b/utilities/src/with_std/metrics.rs @@ -1,5 +1,6 @@ //! Metric monitoring for the CFE -//! allowing prometheus server to query metrics from the CFE +//! +//! Allowing prometheus server to query metrics from the CFE //! Returns the metrics encoded in a prometheus format //! Method returns a Sender, allowing graceful termination of the infinite loop use super::{super::Port, task_scope}; diff --git a/utilities/src/with_std/rle_bitmap.rs b/utilities/src/with_std/rle_bitmap.rs index 64e36a57d2..9fbff8ae19 100644 --- a/utilities/src/with_std/rle_bitmap.rs +++ b/utilities/src/with_std/rle_bitmap.rs @@ -114,10 +114,11 @@ impl RleBitmap { pub fn iter(&self, value: bool) -> impl Iterator + '_ { self.iter_ranges(value).flat_map(|(start, option_end)| { - itertools::unfold(Some(start), |option_t| { + let mut option_t = Some(start); + std::iter::from_fn(move || { if let Some(t) = option_t { - let next = *t; - *option_t = ::forward_checked(*t, 1); + let next = t; + option_t = ::forward_checked(t, 1); Some(next) } else { None diff --git a/utilities/src/with_std/task_scope.rs b/utilities/src/with_std/task_scope.rs index d44893f758..e83c948dae 100644 --- a/utilities/src/with_std/task_scope.rs +++ b/utilities/src/with_std/task_scope.rs @@ -39,7 +39,7 @@ //! task_scope system has no method to force spawn_blocking tasks to end/cancel, so they must handle //! exiting themselves. For example: //! -//! ```rust(ignore) +//! ```rust,ignore //! { //! let (sender, receiver) = std::sync::mpsc::channel(10); //! @@ -73,7 +73,7 @@ //! If you don't do the above when an error occurs the scope will not ever exit, and will wait for //! the spawn_blocking to exit forever i.e. if the spawn_blocking was like this instead: //! -//! ```rust(ignore) +//! ```rust,ignore //! { //! scope.spawn_blocking(|| { //! loop { @@ -175,6 +175,8 @@ pub trait UnwrapOrCancel { } impl UnwrapOrCancel for T where T: Future {} +/// Creates a top level tasks that spawns other tasks. +/// /// This function allows a top level task to spawn tasks such that if any tasks panic or error, /// all other tasks will be cancelled, and the panic or error will be propagated by this function. /// It guarantees all tasks spawned using its scope object will finish before this function exits. diff --git a/utilities/src/with_std/try_cached_stream.rs b/utilities/src/with_std/try_cached_stream.rs index f8698f7a5c..d24ab56516 100644 --- a/utilities/src/with_std/try_cached_stream.rs +++ b/utilities/src/with_std/try_cached_stream.rs @@ -122,9 +122,6 @@ mod tests { #[tokio::test] async fn next_and_cached() { - #[derive(Debug, PartialEq)] - struct Wrappedi32(i32); - let mut cached_stream = test_stream().make_try_cached(0); assert_eq!(*cached_stream.cache(), 0);