diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 121fbcc07..2b69a18aa 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -10,7 +10,7 @@ jobs: max-parallel: 2 matrix: rust: [ stable, nightly ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: RUST_BACKTRACE: full # Make sure CI fails on all warnings, including Clippy lints @@ -45,6 +45,13 @@ jobs: # Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed run: rustup show + - name: Use cargo.toml with polkadot-sdk fork + if: matrix.rust == 'nightly' + # To make sure that our polkadot-sdk fork will be used + run: | + rm /home/runner/work/spacewalk/spacewalk/Cargo.toml + mv /home/runner/work/spacewalk/spacewalk/Cargo_CI.toml /home/runner/work/spacewalk/spacewalk/Cargo.toml + - name: Remove rust-toolchain.toml for nightly if: matrix.rust == 'nightly' # To make sure that the nightly version will be used all throughout @@ -90,8 +97,8 @@ jobs: DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }} with: toolchain: nightly-2024-02-09 - command: test - args: --all --all-features + command: test + args: --all --all-features - name: Rustfmt if: matrix.rust == 'nightly' diff --git a/Cargo.lock b/Cargo.lock index a79fc6471..da761b8b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,11 +14,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli 0.27.3", ] [[package]] @@ -36,25 +36,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", -] - [[package]] name = "aead" version = "0.5.2" @@ -65,29 +46,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if 1.0.0", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.1", -] - [[package]] name = "aes" version = "0.8.4" @@ -95,58 +53,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if 1.0.0", - "cipher 0.4.4", + "cipher", "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.4", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.1", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.1", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.1", -] - [[package]] name = "ahash" version = "0.7.8" @@ -275,16 +199,220 @@ dependencies = [ ] [[package]] -name = "arc-swap" -version = "1.7.1" +name = "aquamarine" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[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-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + +[[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=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +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" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" @@ -292,6 +420,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -304,29 +441,13 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -336,18 +457,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -371,12 +480,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert_matches" version = "1.5.0" @@ -429,6 +532,18 @@ dependencies = [ "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "async-global-executor" version = "2.4.1" @@ -503,6 +618,52 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +dependencies = [ + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if 1.0.0", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.34", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" +dependencies = [ + "async-io 2.3.2", + "async-lock 3.3.0", + "atomic-waker", + "cfg-if 1.0.0", + "futures-core", + "futures-io", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", +] + [[package]] name = "async-std" version = "1.12.0" @@ -582,6 +743,12 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -617,8 +784,8 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", - "http-body", - "hyper", + "http-body 0.4.6", + "hyper 0.14.28", "itoa", "matchit", "memchr", @@ -627,7 +794,7 @@ dependencies = [ "pin-project-lite 0.2.14", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -643,7 +810,7 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", @@ -679,18 +846,34 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-scale 0.0.12", + "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", + "zeroize", +] + [[package]] name = "base-x" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -715,6 +898,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -741,9 +930,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ "bitflags 1.3.2", "cexpr", @@ -751,14 +940,34 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", + "prettyplease 0.2.20", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn 2.0.66", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", ] +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -792,6 +1001,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", +] + [[package]] name = "blake2b_simd" version = "1.0.2" @@ -800,7 +1019,7 @@ checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -811,7 +1030,7 @@ checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -824,7 +1043,7 @@ dependencies = [ "arrayvec 0.7.4", "cc", "cfg-if 1.0.0", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -833,7 +1052,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -857,16 +1076,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -876,12 +1085,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "1.6.0" @@ -914,6 +1117,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" version = "1.9.1" @@ -1065,17 +1277,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -1087,9 +1288,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -1119,7 +1320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if 1.0.0", - "cipher 0.4.4", + "cipher", "cpufeatures", ] @@ -1129,9 +1330,9 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.5.2", + "aead", "chacha20", - "cipher 0.4.4", + "cipher", "poly1305", "zeroize", ] @@ -1151,35 +1352,17 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "cid" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" -dependencies = [ - "core2", - "multibase", - "multihash 0.16.3", - "serde", - "unsigned-varint", -] - -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "cipher" -version = "0.3.0" +[[package]] +name = "cid" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ - "generic-array 0.14.7", + "core2", + "multibase", + "multihash", + "serde", + "unsigned-varint", ] [[package]] @@ -1293,11 +1476,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", ] [[package]] @@ -1318,15 +1501,35 @@ checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "comfy-table" -version = "6.2.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ - "strum", - "strum_macros", + "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?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -1379,12 +1582,44 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "constant_time_eq" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" + [[package]] name = "convert_case" version = "0.4.0" @@ -1436,28 +1671,27 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", - "hashbrown 0.12.3", + "gimli 0.27.3", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -1466,33 +1700,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -1502,15 +1736,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -1519,9 +1753,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1533,21 +1767,6 @@ 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.4.2" @@ -1585,6 +1804,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -1597,18 +1825,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1644,9 +1860,9 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", "subtle", @@ -1662,22 +1878,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "ctr" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -1701,11 +1908,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", ] @@ -1746,7 +1953,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms 3.4.0", + "platforms", "rustc_version", "subtle", "zeroize", @@ -1916,17 +2123,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.9" @@ -1937,27 +2133,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -1998,34 +2180,14 @@ dependencies = [ ] [[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" +name = "derive-syn-parse" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ - "darling 0.14.4", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -2044,7 +2206,7 @@ dependencies = [ [[package]] name = "dia-oracle" version = "0.1.0" -source = "git+https://github.com/pendulum-chain/oracle-pallet?branch=polkadot-v0.9.42#79ab575220f3c59935e0e4ff73124604c9aeac6d" +source = "git+https://github.com/pendulum-chain/oracle-pallet?branch=polkadot-v1.1.0#b98aa3436f3a94d78904357923a98a35affe3677" dependencies = [ "frame-benchmarking", "frame-support", @@ -2054,9 +2216,9 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] @@ -2159,6 +2321,50 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale 0.0.10", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "docify" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +dependencies = [ + "common-path", + "derive-syn-parse 0.2.0", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.66", + "termcolor", + "toml 0.8.15", + "walkdir", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -2216,39 +2422,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.9", + "der", "digest 0.10.7", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", - "signature 2.2.0", - "spki 0.7.3", -] - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature 1.6.4", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -2257,22 +2442,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8 0.10.2", - "signature 2.2.0", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519 1.5.3", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", + "pkcs8", + "signature", ] [[package]] @@ -2282,7 +2453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek 4.1.2", - "ed25519 2.2.3", + "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.8", @@ -2305,48 +2476,41 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "elliptic-curve" -version = "0.12.3" +name = "ed25519-zebra" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", + "curve25519-dalek 4.1.2", + "ed25519", + "hashbrown 0.14.5", + "hex", "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", + "sha2 0.10.8", "zeroize", ] +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", + "sec1", "subtle", "zeroize", ] @@ -2466,6 +2630,17 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.14", +] + [[package]] name = "event-listener" version = "4.0.3" @@ -2519,15 +2694,17 @@ dependencies = [ [[package]] name = "expander" -version = "1.0.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ "blake2", + "file-guard", "fs-err", + "prettyplease 0.2.20", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -2587,33 +2764,36 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", ] [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", ] [[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" dependencies = [ - "rand_core 0.6.4", - "subtle", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", ] [[package]] @@ -2622,6 +2802,16 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "file-guard" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "file-per-thread-logger" version = "0.1.6" @@ -2741,7 +2931,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "parity-scale-codec", ] @@ -2773,7 +2963,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-support-procedural", @@ -2785,20 +2975,20 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std 5.0.0", - "sp-storage", + "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", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "Inflector", "array-bytes", @@ -2828,16 +3018,17 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-database", - "sp-externalities", + "sp-externalities 0.19.0", "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-std 5.0.0", - "sp-storage", - "sp-trie", + "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", "thiserror", "thousands", ] @@ -2845,17 +3036,19 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-system", + "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", - "sp-tracing", + "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", ] [[package]] @@ -2863,6 +3056,17 @@ name = "frame-metadata" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if 1.0.0", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", @@ -2873,46 +3077,55 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "aquamarine", "bitflags 1.3.2", + "docify", "environmental", - "frame-metadata", + "frame-metadata 16.0.0", "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", - "sp-arithmetic", - "sp-core", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", "sp-core-hashing-proc-macro", + "sp-debug-derive 8.0.0", + "sp-genesis-builder", "sp-inherents", - "sp-io", - "sp-runtime", + "sp-io 23.0.0", + "sp-metadata-ir", + "sp-runtime 24.0.0", "sp-staking", - "sp-state-machine", - "sp-std 5.0.0", - "sp-tracing", - "sp-weights", + "sp-state-machine 0.28.0", + "sp-std 8.0.0", + "sp-tracing 10.0.0", + "sp-weights 20.0.0", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.1.5", + "expander", "frame-support-procedural-tools", "itertools 0.10.5", + "macro_magic", "proc-macro-warning", "proc-macro2", "quote", @@ -2922,7 +3135,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.3", @@ -2934,7 +3147,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "proc-macro2", "quote", @@ -2944,43 +3157,56 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "cfg-if 1.0.0", "frame-support", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "sp-version", - "sp-weights", + "sp-weights 20.0.0", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "frame-support", "parity-scale-codec", "sp-api", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] @@ -3002,16 +3228,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fs4" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" -dependencies = [ - "rustix 0.38.34", - "windows-sys 0.48.0", -] - [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -3126,7 +3342,7 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.9", - "webpki 0.22.4", + "webpki", ] [[package]] @@ -3242,16 +3458,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.1", - "polyval 0.5.3", -] - [[package]] name = "ghash" version = "0.5.1" @@ -3259,14 +3465,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug 0.3.1", - "polyval 0.6.2", + "polyval", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", "indexmap 1.9.3", @@ -3307,7 +3513,28 @@ dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.1.7", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils 0.2.0", + "http 0.2.12", "js-sys", "pin-project", "serde", @@ -3343,6 +3570,19 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "governor" version = "0.5.1" @@ -3361,24 +3601,13 @@ dependencies = [ "smallvec", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", "subtle", ] @@ -3402,6 +3631,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "handlebars" version = "4.5.0" @@ -3457,6 +3705,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", + "serde", ] [[package]] @@ -3579,7 +3828,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -3656,6 +3905,29 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +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 = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "pin-project-lite 0.2.14", +] + [[package]] name = "http-range-header" version = "0.3.1" @@ -3699,9 +3971,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -3714,18 +3986,23 @@ dependencies = [ ] [[package]] -name = "hyper-rustls" -version = "0.23.2" +name = "hyper" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ - "http 0.2.12", - "hyper", - "log", - "rustls 0.20.9", - "rustls-native-certs", + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite 0.2.14", + "smallvec", "tokio", - "tokio-rustls 0.23.4", + "want", ] [[package]] @@ -3736,7 +4013,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.28", "log", "rustls 0.21.12", "rustls-native-certs", @@ -3745,13 +4022,30 @@ dependencies = [ "webpki-roots 0.25.4", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.12", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] + [[package]] name = "hyper-timeout" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.28", "pin-project-lite 0.2.14", "tokio", "tokio-io-timeout", @@ -3764,10 +4058,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.28", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite 0.2.14", + "socket2 0.5.7", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -3889,6 +4219,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "index-fixed" version = "0.3.1" @@ -3916,6 +4265,12 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + [[package]] name = "inout" version = "0.1.3" @@ -3943,25 +4298,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -3988,7 +4324,7 @@ dependencies = [ "socket2 0.5.7", "widestring", "windows-sys 0.48.0", - "winreg", + "winreg 0.50.0", ] [[package]] @@ -4041,11 +4377,11 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", "stellar-relay", @@ -4061,6 +4397,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -4102,8 +4447,8 @@ checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", "futures 0.3.30", - "hyper", - "hyper-tls", + "hyper 0.14.28", + "hyper-tls 0.5.0", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -4159,14 +4504,30 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", - "jsonrpsee-proc-macros", + "jsonrpsee-client-transport 0.16.3", + "jsonrpsee-core 0.16.3", + "jsonrpsee-http-client 0.16.3", + "jsonrpsee-proc-macros 0.16.3", "jsonrpsee-server", - "jsonrpsee-types", - "jsonrpsee-wasm-client", - "jsonrpsee-ws-client", + "jsonrpsee-types 0.16.3", + "jsonrpsee-wasm-client 0.16.3", + "jsonrpsee-ws-client 0.16.3", + "tracing", +] + +[[package]] +name = "jsonrpsee" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +dependencies = [ + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-http-client 0.20.3", + "jsonrpsee-proc-macros 0.20.3", + "jsonrpsee-types 0.20.3", + "jsonrpsee-wasm-client 0.20.3", + "jsonrpsee-ws-client 0.20.3", "tracing", ] @@ -4180,10 +4541,32 @@ dependencies = [ "futures-channel", "futures-timer", "futures-util", - "gloo-net", + "gloo-net 0.2.6", + "http 0.2.12", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.24.1", + "tokio-util", + "tracing", + "webpki-roots 0.25.4", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +dependencies = [ + "futures-channel", + "futures-util", + "gloo-net 0.4.0", "http 0.2.12", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.20.3", "pin-project", "rustls-native-certs", "soketto", @@ -4192,6 +4575,7 @@ dependencies = [ "tokio-rustls 0.24.1", "tokio-util", "tracing", + "url 2.5.0", "webpki-roots 0.25.4", ] @@ -4210,8 +4594,8 @@ dependencies = [ "futures-timer", "futures-util", "globset", - "hyper", - "jsonrpsee-types", + "hyper 0.14.28", + "jsonrpsee-types 0.16.3", "parking_lot 0.12.2", "rand 0.8.5", "rustc-hash", @@ -4224,6 +4608,29 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "jsonrpsee-core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +dependencies = [ + "anyhow", + "async-lock 2.8.0", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "hyper 0.14.28", + "jsonrpsee-types 0.20.3", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen-futures", +] + [[package]] name = "jsonrpsee-http-client" version = "0.16.3" @@ -4231,10 +4638,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", - "hyper", + "hyper 0.14.28", "hyper-rustls 0.24.2", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", "rustc-hash", "serde", "serde_json", @@ -4243,11 +4650,44 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +dependencies = [ + "async-trait", + "hyper 0.14.28", + "hyper-rustls 0.24.2", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url 2.5.0", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" dependencies = [ "heck 0.4.1", "proc-macro-crate 1.1.3", @@ -4265,9 +4705,9 @@ dependencies = [ "futures-channel", "futures-util", "http 0.2.12", - "hyper", - "jsonrpsee-core", - "jsonrpsee-types", + "hyper 0.14.28", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", "serde", "serde_json", "soketto", @@ -4292,15 +4732,40 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-types" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "jsonrpsee-wasm-client" version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18e5df77c8f625d36e4cfb583c5a674eccebe32403fcfe42f7ceff7fac9324dd" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.16.3", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", +] + +[[package]] +name = "jsonrpsee-wasm-client" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c7cbb3447cf14fd4d2f407c3cc96e6c9634d5440aa1fbed868a31f3c02b27f0" +dependencies = [ + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", ] [[package]] @@ -4310,9 +4775,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ "http 0.2.12", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.16.3", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" +dependencies = [ + "http 0.2.12", + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "url 2.5.0", ] [[package]] @@ -4322,8 +4800,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if 1.0.0", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.8", ] @@ -4367,9 +4845,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7a749456510c45f795e8b04a6a3e0976d0139213ecbf465843830ad55e2217" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", @@ -4418,22 +4896,24 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.50.1" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", "futures 0.3.30", "futures-timer", "getrandom 0.2.15", "instant", - "libp2p-core 0.38.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", "libp2p-dns", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", "libp2p-ping", "libp2p-quic", @@ -4441,47 +4921,34 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.16.0", - "parking_lot 0.12.2", + "multiaddr", "pin-project", - "smallvec", ] [[package]] -name = "libp2p-core" -version = "0.38.0" +name = "libp2p-allow-block-list" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek 1.0.1", - "either", - "fnv", - "futures 0.3.30", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.2", - "pin-project", - "prost 0.11.9", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1 0.3.0", - "sha2 0.10.8", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "void", - "zeroize", ] [[package]] @@ -4497,8 +4964,8 @@ dependencies = [ "instant", "libp2p-identity", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "multistream-select", "once_cell", "parking_lot 0.12.2", @@ -4514,12 +4981,12 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ "futures 0.3.30", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.2", "smallvec", @@ -4528,20 +4995,21 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", + "either", "futures 0.3.30", "futures-timer", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "lru", - "prost 0.11.9", - "prost-build", - "prost-codec", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", "smallvec", "thiserror", "void", @@ -4553,11 +5021,11 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "bs58", - "ed25519-dalek 2.1.1", + "bs58 0.4.0", + "ed25519-dalek", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", @@ -4567,9 +5035,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.42.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", @@ -4579,11 +5047,11 @@ dependencies = [ "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost 0.11.9", - "prost-build", + "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", "smallvec", @@ -4595,14 +5063,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", "futures 0.3.30", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", @@ -4615,11 +5084,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -4627,38 +5096,20 @@ dependencies = [ "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures 0.3.30", - "libp2p-core 0.38.0", - "log", - "nohash-hasher", - "parking_lot 0.12.2", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-noise" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures 0.3.30", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost 0.11.9", - "prost-build", + "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", "snow", @@ -4670,14 +5121,15 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ + "either", "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -4686,15 +5138,16 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha" +version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", "futures 0.3.30", "futures-timer", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", "parking_lot 0.12.2", @@ -4707,49 +5160,46 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "bytes", "futures 0.3.30", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", - "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm-derive", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ "heck 0.4.1", "quote", @@ -4758,15 +5208,15 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ "futures 0.3.30", "futures-timer", "if-watch", "libc", - "libp2p-core 0.38.0", + "libp2p-core", "log", "socket2 0.4.10", "tokio", @@ -4780,72 +5230,41 @@ checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ "futures 0.3.30", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring 0.16.20", "rustls 0.20.9", "thiserror", - "webpki 0.22.4", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] [[package]] name = "libp2p-wasm-ext" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ "futures 0.3.30", "js-sys", - "libp2p-core 0.38.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures 0.3.30", - "futures-timer", - "hex", - "if-watch", - "libp2p-core 0.38.0", - "libp2p-noise", - "log", - "multihash 0.16.3", - "prost 0.11.9", - "prost-build", - "prost-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", "futures 0.3.30", "futures-rustls", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.2", "quicksink", @@ -4857,14 +5276,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ "futures 0.3.30", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "parking_lot 0.12.2", "thiserror", "yamux", ] @@ -4881,9 +5299,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.10.0+7.9.2" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d5874f5ff2bc616e55e8c6086d478fcda13faf9495768a4aa1c22042d30b" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -5025,11 +5443,20 @@ dependencies = [ [[package]] name = "lru" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.13.2", +] + +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.5", ] [[package]] @@ -5071,12 +5498,51 @@ dependencies = [ ] [[package]] -name = "mach2" +name = "macro_magic" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" dependencies = [ - "libc", + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse 0.1.5", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.66", ] [[package]] @@ -5125,16 +5591,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.7.2" @@ -5168,6 +5624,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.32.0" @@ -5177,12 +5642,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -5327,12 +5786,12 @@ dependencies = [ name = "module-issue-rpc" version = "1.0.10" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "module-issue-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] @@ -5342,19 +5801,19 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "module-oracle-rpc" version = "1.0.10" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "module-oracle-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", "spacewalk-primitives", ] @@ -5367,7 +5826,7 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-std 5.0.0", + "sp-std 8.0.0", "spacewalk-primitives", ] @@ -5375,12 +5834,12 @@ dependencies = [ name = "module-redeem-rpc" version = "1.0.10" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "module-redeem-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] @@ -5390,19 +5849,19 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "module-replace-rpc" version = "1.0.10" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "module-replace-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] @@ -5412,20 +5871,20 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "module-vault-registry-rpc" version = "1.0.10" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "module-oracle-rpc-runtime-api", "module-vault-registry-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] @@ -5436,7 +5895,7 @@ dependencies = [ "module-oracle-rpc-runtime-api", "parity-scale-codec", "sp-api", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] @@ -5457,24 +5916,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding 2.3.1", - "serde", - "static_assertions", - "unsigned-varint", - "url 2.5.0", -] - [[package]] name = "multiaddr" version = "0.17.1" @@ -5486,7 +5927,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash 0.17.0", + "multihash", "percent-encoding 2.3.1", "serde", "static_assertions", @@ -5507,9 +5948,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.16.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "blake2b_simd", "blake2s_simd", @@ -5522,17 +5963,6 @@ dependencies = [ "unsigned-varint", ] -[[package]] -name = "multihash" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" -dependencies = [ - "core2", - "multihash-derive", - "unsigned-varint", -] - [[package]] name = "multihash-derive" version = "0.8.1" @@ -5696,7 +6126,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -5705,6 +6135,18 @@ 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5743,11 +6185,11 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", "vault-registry", @@ -5892,12 +6334,12 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] @@ -5906,18 +6348,9 @@ dependencies = [ name = "object" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "asn1-rs 0.3.1", + "memchr", ] [[package]] @@ -5926,7 +6359,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] @@ -5979,6 +6412,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.102" @@ -5987,6 +6429,7 @@ checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -6011,11 +6454,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "security", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "spin 0.9.8", "staking", @@ -6024,7 +6467,7 @@ dependencies = [ [[package]] name = "orml-currencies" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -6033,15 +6476,15 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "orml-oracle" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -6050,59 +6493,62 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-application-crypto 23.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", + "log", "orml-traits", "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-runtime", - "sp-std 5.0.0", + "sp-arithmetic 16.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "impl-trait-for-tuples", "num-traits", "orml-utilities", "parity-scale-codec", + "paste", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", - "xcm", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", + "staging-xcm", ] [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.42#4ae0372e2c624e6acc98305564b9d395f70814c0" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", "serde", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] @@ -6120,62 +6566,41 @@ dependencies = [ "winapi", ] -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-system", + "log", "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 23.0.0", "sp-consensus-aura", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6183,14 +6608,14 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6200,20 +6625,20 @@ dependencies = [ "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 23.0.0", "sp-consensus-grandpa", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", "sp-session", "sp-staking", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-system", @@ -6222,33 +6647,35 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", "sp-session", "sp-staking", - "sp-std 5.0.0", - "sp-trie", + "sp-state-machine 0.28.0", + "sp-std 8.0.0", + "sp-trie 22.0.0", ] [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-benchmarking", "frame-support", @@ -6257,54 +6684,55 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-rpc", - "sp-runtime", - "sp-weights", + "sp-runtime 24.0.0", + "sp-weights 20.0.0", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", - "sp-runtime", - "sp-weights", + "sp-runtime 24.0.0", + "sp-weights 20.0.0", ] [[package]] @@ -6323,7 +6751,7 @@ dependencies = [ "memmap2", "parking_lot 0.12.2", "rand 0.8.5", - "siphasher", + "siphasher 0.3.11", "snap", "winapi", ] @@ -6421,6 +6849,12 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "paste" version = "1.0.15" @@ -6433,7 +6867,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", ] [[package]] @@ -6445,6 +6879,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -6460,15 +6903,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "1.0.1" @@ -6585,24 +7019,14 @@ dependencies = [ "futures-io", ] -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.9", - "spki 0.7.3", + "der", + "spki", ] [[package]] @@ -6611,12 +7035,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" - [[package]] name = "platforms" version = "3.4.0" @@ -6662,19 +7080,7 @@ checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug 0.3.1", - "universal-hash 0.5.1", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug 0.3.1", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -6686,7 +7092,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "opaque-debug 0.3.1", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -6704,11 +7110,11 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", ] @@ -6789,6 +7195,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -6853,9 +7269,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-warning" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", @@ -6918,25 +7334,25 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", "parking_lot 0.12.2", - "prometheus-client-derive-text-encode", + "prometheus-client-derive-encode", ] [[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -6972,7 +7388,7 @@ dependencies = [ "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.1.25", "prost 0.11.9", "prost-types 0.11.9", "regex", @@ -6981,19 +7397,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost 0.11.9", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -7084,6 +7487,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + [[package]] name = "quicksink" version = "0.1.2" @@ -7110,7 +7526,7 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] @@ -7271,19 +7687,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring 0.16.20", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -7315,6 +7718,7 @@ dependencies = [ "frame-support", "frame-system", "hex", + "log", "mocktopus", "oracle", "orml-currencies", @@ -7328,11 +7732,11 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", "stellar-relay", @@ -7399,9 +7803,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -7453,18 +7857,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" -[[package]] -name = "region" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" -dependencies = [ - "bitflags 1.3.2", - "libc", - "mach2", - "windows-sys 0.52.0", -] - [[package]] name = "remove_dir_all" version = "0.5.3" @@ -7484,6 +7876,7 @@ dependencies = [ "frame-support", "frame-system", "hex", + "log", "mocktopus", "nomination", "oracle", @@ -7498,11 +7891,11 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", "stellar-relay", @@ -7511,20 +7904,23 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http 0.2.12", - "http-body", - "hyper", - "hyper-tls", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-tls 0.6.0", + "hyper-util", "ipnet", "js-sys", "log", @@ -7533,11 +7929,11 @@ dependencies = [ "once_cell", "percent-encoding 2.3.1", "pin-project-lite 0.2.14", - "rustls-pemfile", + "rustls-pemfile 2.1.2", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -7546,7 +7942,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "winreg 0.52.0", ] [[package]] @@ -7573,11 +7969,11 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", ] @@ -7601,26 +7997,15 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -7631,6 +8016,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "common", + "fflonk", + "merlin 3.0.0", +] + [[package]] name = "ring" version = "0.16.20" @@ -7663,9 +8063,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015439787fce1e75d55f279078d33ff14b4af5d93d995e8838ee4631301c8a99" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -7682,17 +8082,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -7718,20 +8107,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] - [[package]] name = "runner" version = "1.0.10" @@ -7750,8 +8125,8 @@ dependencies = [ "sha2 0.8.2", "signal-hook", "signal-hook-tokio", - "sp-core", - "subxt 0.29.0", + "sp-core 21.0.0", + "subxt", "sysinfo 0.25.3", "tempdir", "thiserror", @@ -7770,7 +8145,7 @@ dependencies = [ "env_logger 0.8.4", "frame-support", "futures 0.3.30", - "jsonrpsee", + "jsonrpsee 0.20.3", "log", "module-oracle-rpc-runtime-api", "oracle", @@ -7780,17 +8155,18 @@ dependencies = [ "runtime", "serde", "serde_json", - "sp-arithmetic", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", "sp-keyring", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "sp-version", "spacewalk-primitives", "spacewalk-runtime-standalone-mainnet", "spacewalk-runtime-standalone-testnet", "spacewalk-standalone", "substrate-stellar-sdk", - "subxt 0.25.0", + "subxt", "subxt-client", "tempdir", "thiserror", @@ -7878,39 +8254,39 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "base64 0.13.1", "log", "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", - "sct 0.7.1", - "webpki 0.22.4", + "ring 0.17.8", + "rustls-webpki 0.101.7", + "sct", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki", - "sct 0.7.1", + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.6", + "subtle", + "zeroize", ] [[package]] @@ -7920,7 +8296,7 @@ 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", ] @@ -7934,6 +8310,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -7944,12 +8336,34 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.3.0" @@ -7988,18 +8402,18 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "log", - "sp-core", - "sp-wasm-interface", + "sp-core 21.0.0", + "sp-wasm-interface 14.0.0", "thiserror", ] [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "futures 0.3.30", "futures-timer", @@ -8013,31 +8427,31 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-runtime", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "parity-scale-codec", "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -8048,15 +8462,15 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -8067,14 +8481,14 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", "chrono", "clap 4.5.4", "fdlimit", "futures 0.3.30", - "libp2p", + "libp2p-identity", "log", "names", "parity-scale-codec", @@ -8085,7 +8499,6 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", - "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -8093,11 +8506,11 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", + "sp-keystore 0.27.0", + "sp-panic-handler 8.0.0", + "sp-runtime 24.0.0", "sp-version", "thiserror", "tiny-bip39", @@ -8107,7 +8520,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "fnv", "futures 0.3.30", @@ -8120,20 +8533,20 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 21.0.0", "sp-database", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", + "sp-externalities 0.19.0", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", + "sp-statement-store", + "sp-storage 13.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "hash-db", "kvdb", @@ -8147,24 +8560,24 @@ dependencies = [ "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic", + "sp-arithmetic 16.0.0", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", + "sp-trie 22.0.0", ] [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", - "libp2p", + "libp2p-identity", "log", "mockall 0.11.4", "parking_lot 0.12.2", @@ -8174,9 +8587,9 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8184,7 +8597,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", @@ -8196,16 +8609,16 @@ dependencies = [ "sc-consensus-slots", "sc-telemetry", "sp-api", - "sp-application-crypto", + "sp-application-crypto 23.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8213,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "fork-tree", @@ -8228,20 +8641,20 @@ dependencies = [ "sc-consensus", "sc-consensus-epochs", "sc-consensus-slots", - "sc-keystore", "sc-telemetry", + "sc-transaction-pool-api", "scale-info", "sp-api", - "sp-application-crypto", + "sp-application-crypto 23.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8249,20 +8662,20 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "fork-tree", "parity-scale-codec", "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "ahash 0.8.11", "array-bytes", @@ -8284,17 +8697,18 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", + "sc-transaction-pool-api", "sc-utils", "serde_json", "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-application-crypto 23.0.0", + "sp-arithmetic 16.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 21.0.0", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8302,12 +8716,13 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "assert_matches", "async-trait", "futures 0.3.30", - "jsonrpsee", + "futures-timer", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "sc-client-api", @@ -8324,10 +8739,10 @@ dependencies = [ "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-slots", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "sp-timestamp", "substrate-prometheus-endpoint", "thiserror", @@ -8336,7 +8751,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", @@ -8346,88 +8761,71 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic", + "sp-arithmetic 16.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "lru", "parity-scale-codec", "parking_lot 0.12.2", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", + "schnellru", "sp-api", - "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-trie", + "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-version", - "sp-wasm-interface", + "sp-wasm-interface 14.0.0", "tracing", - "wasmi", ] [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface", + "sp-wasm-interface 14.0.0", "thiserror", "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "anyhow", "cfg-if 1.0.0", "libc", "log", - "once_cell", "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-runtime-interface 17.0.0", + "sp-wasm-interface 14.0.0", "wasmtime", ] [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "ansi_term", "futures 0.3.30", @@ -8437,28 +8835,27 @@ dependencies = [ "sc-network", "sc-network-common", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", - "async-trait", "parking_lot 0.12.2", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 23.0.0", + "sp-core 21.0.0", + "sp-keystore 0.27.0", "thiserror", ] [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -8473,49 +8870,45 @@ dependencies = [ "libp2p", "linked_hash_set", "log", - "lru", "mockall 0.11.4", "parity-scale-codec", "parking_lot 0.12.2", + "partial_sort", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-client-api", - "sc-consensus", "sc-network-common", - "sc-peerset", "sc-utils", "serde", "serde_json", "smallvec", - "snow", - "sp-arithmetic", + "sp-arithmetic 16.0.0", "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", + "wasm-timer", "zeroize", ] [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "async-channel 1.9.0", "cid", "futures 0.3.30", - "libp2p", + "libp2p-identity", "log", "prost 0.11.9", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", "sp-blockchain", - "sp-runtime", + "sp-runtime 24.0.0", "thiserror", "unsigned-varint", ] @@ -8523,46 +8916,34 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "array-bytes", "async-trait", "bitflags 1.3.2", - "bytes", "futures 0.3.30", - "futures-timer", - "libp2p", + "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset", - "sc-utils", - "serde", - "smallvec", - "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "zeroize", + "sp-runtime 24.0.0", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "ahash 0.8.11", "futures 0.3.30", "futures-timer", "libp2p", "log", - "lru", "sc-network", "sc-network-common", - "sc-peerset", - "sp-runtime", + "schnellru", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "tracing", ] @@ -8570,38 +8951,37 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", + "async-channel 1.9.0", "futures 0.3.30", - "libp2p", + "libp2p-identity", "log", "parity-scale-codec", "prost 0.11.9", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", - "sc-peerset", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", "thiserror", ] [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", + "async-channel 1.9.0", "async-trait", "fork-tree", "futures 0.3.30", "futures-timer", "libp2p", "log", - "lru", "mockall 0.11.4", "parity-scale-codec", "prost 0.11.9", @@ -8610,15 +8990,15 @@ dependencies = [ "sc-consensus", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", + "schnellru", "smallvec", - "sp-arithmetic", + "sp-arithmetic 16.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", "thiserror", ] @@ -8626,36 +9006,35 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", "futures 0.3.30", "libp2p", "log", "parity-scale-codec", - "pin-project", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-consensus", - "sp-runtime", + "sp-runtime 24.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", "bytes", "fnv", "futures 0.3.30", "futures-timer", - "hyper", - "hyper-rustls 0.23.2", + "hyper 0.14.28", + "hyper-rustls 0.24.2", "libp2p", + "log", "num_cpus", "once_cell", "parity-scale-codec", @@ -8664,33 +9043,22 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", - "sc-peerset", + "sc-transaction-pool-api", "sc-utils", "sp-api", - "sp-core", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "sp-keystore 0.27.0", "sp-offchain", - "sp-runtime", + "sp-runtime 24.0.0", "threadpool", "tracing", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "futures 0.3.30", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8699,10 +9067,10 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "futures 0.3.30", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.2", @@ -8716,12 +9084,13 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core", - "sp-keystore", + "sp-core 21.0.0", + "sp-keystore 0.27.0", "sp-offchain", "sp-rpc", - "sp-runtime", + "sp-runtime 24.0.0", "sp-session", + "sp-statement-store", "sp-version", "tokio", ] @@ -8729,18 +9098,18 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "parity-scale-codec", "sc-chain-spec", "sc-transaction-pool-api", "scale-info", "serde", "serde_json", - "sp-core", + "sp-core 21.0.0", "sp-rpc", - "sp-runtime", + "sp-runtime 24.0.0", "sp-version", "thiserror", ] @@ -8748,10 +9117,10 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "http 0.2.12", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "serde_json", "substrate-prometheus-endpoint", @@ -8763,40 +9132,42 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", "futures 0.3.30", "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.2", "sc-chain-spec", "sc-client-api", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", "sp-version", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "directories", "exit-future", "futures 0.3.30", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.2", @@ -8816,11 +9187,9 @@ dependencies = [ "sc-network-light", "sc-network-sync", "sc-network-transactions", - "sc-offchain", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", - "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -8832,16 +9201,16 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "sp-session", - "sp-state-machine", - "sp-storage", + "sp-state-machine 0.28.0", + "sp-storage 13.0.0", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie", + "sp-trie 22.0.0", "sp-version", "static_init", "substrate-prometheus-endpoint", @@ -8855,34 +9224,18 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.2", - "sp-core", -] - -[[package]] -name = "sc-storage-monitor" -version = "0.1.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "clap 4.5.4", - "fs4", - "futures 0.3.30", - "log", - "sc-client-db", - "sc-utils", - "sp-core", - "thiserror", - "tokio", + "sp-core 21.0.0", ] [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "futures 0.3.30", "libc", @@ -8893,15 +9246,15 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core", - "sp-io", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-std 8.0.0", ] [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "chrono", "futures 0.3.30", @@ -8920,7 +9273,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "ansi_term", "atty", @@ -8928,20 +9281,18 @@ dependencies = [ "lazy_static", "libc", "log", - "once_cell", "parking_lot 0.12.2", "regex", "rustc-hash", "sc-client-api", - "sc-rpc-server", "sc-tracing-proc-macro", "serde", "sp-api", "sp-blockchain", - "sp-core", + "sp-core 21.0.0", "sp-rpc", - "sp-runtime", - "sp-tracing", + "sp-runtime 24.0.0", + "sp-tracing 10.0.0", "thiserror", "tracing", "tracing-log", @@ -8951,7 +9302,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "proc-macro-crate 1.1.3", "proc-macro2", @@ -8962,14 +9313,13 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", "linked-hash-map", "log", - "num-traits", "parity-scale-codec", "parking_lot 0.12.2", "sc-client-api", @@ -8978,9 +9328,9 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-tracing 10.0.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -8989,21 +9339,23 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", "log", + "parity-scale-codec", "serde", "sp-blockchain", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", "thiserror", ] [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-channel 1.9.0", "futures 0.3.30", @@ -9012,14 +9364,14 @@ dependencies = [ "log", "parking_lot 0.12.2", "prometheus 0.13.4", - "sp-arithmetic", + "sp-arithmetic 16.0.0", ] [[package]] name = "scale-bits" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" dependencies = [ "parity-scale-codec", "scale-info", @@ -9027,37 +9379,49 @@ dependencies = [ ] [[package]] -name = "scale-decode" -version = "0.4.0" +name = "scale-bits" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" dependencies = [ "parity-scale-codec", - "scale-bits", - "scale-info", - "thiserror", + "scale-type-resolver", ] [[package]] name = "scale-decode" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0459d00b0dbd2e765009924a78ef36b2ff7ba116292d732f00eb0ed8e465d15" +checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-decode-derive", + "scale-bits 0.4.0", + "scale-decode-derive 0.10.0", "scale-info", "smallvec", - "thiserror", +] + +[[package]] +name = "scale-decode" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-bits 0.6.0", + "scale-decode-derive 0.13.1", + "scale-type-resolver", + "smallvec", ] [[package]] name = "scale-decode-derive" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4391f0dfbb6690f035f6d2a15d6a12f88cc5395c36bcc056db07ffa2a90870ec" +checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ "darling 0.14.4", "proc-macro-crate 1.1.3", @@ -9066,26 +9430,64 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-decode-derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb22f574168103cdd3133b19281639ca65ad985e24612728f727339dcaf4021" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-encode" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0401b7cdae8b8aa33725f3611a051358d5b32887ecaa0fda5953a775b2d4d76" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ + "derive_more", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-encode-derive", + "scale-bits 0.4.0", + "scale-encode-derive 0.5.0", "scale-info", "smallvec", - "thiserror", +] + +[[package]] +name = "scale-encode" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba0b9c48dc0eb20c60b083c29447c0c4617cb7c4a4c9fef72aa5c5bc539e15e" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-encode-derive 0.7.1", + "scale-type-resolver", + "smallvec", ] [[package]] name = "scale-encode-derive" -version = "0.3.0" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-encode-derive" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316e0fb10ec0fee266822bd641bab5e332a4ab80ef8c5b5ff35e5401a394f5a6" +checksum = "82ab7e60e2d9c8d47105f44527b26f04418e5e624ffc034f6b4a86c0ba19c5bf" dependencies = [ "darling 0.14.4", "proc-macro-crate 1.1.3", @@ -9121,40 +9523,32 @@ dependencies = [ ] [[package]] -name = "scale-value" -version = "0.6.0" +name = "scale-type-resolver" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" dependencies = [ - "either", - "frame-metadata", - "parity-scale-codec", - "scale-bits", - "scale-decode 0.4.0", - "scale-info", - "serde", - "thiserror", - "yap 0.7.2", + "smallvec", ] [[package]] name = "scale-value" -version = "0.10.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2096d36e94ce9bf87d8addb752423b6b19730dc88edd7cc452bb2b90573f7a7" +checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" dependencies = [ "base58", "blake2", + "derive_more", "either", - "frame-metadata", + "frame-metadata 15.1.0", "parity-scale-codec", - "scale-bits", - "scale-decode 0.7.0", - "scale-encode", + "scale-bits 0.4.0", + "scale-decode 0.10.0", + "scale-encode 0.5.0", "scale-info", "serde", - "thiserror", - "yap 0.10.0", + "yap", ] [[package]] @@ -9201,12 +9595,14 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ + "aead", "arrayref", "arrayvec 0.7.4", "curve25519-dalek 4.1.2", "getrandom_or_panic", "merlin 3.0.0", "rand_core 0.6.4", + "serde_bytes", "sha2 0.10.8", "subtle", "zeroize", @@ -9230,16 +9626,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" @@ -9250,42 +9636,16 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url 2.5.0", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.9", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -9328,10 +9688,10 @@ dependencies = [ "scale-info", "serde", "sha2 0.8.2", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] @@ -9396,6 +9756,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.202" @@ -9501,8 +9870,8 @@ dependencies = [ "clap 3.2.25", "futures 0.3.30", "governor", - "hyper", - "hyper-tls", + "hyper 0.14.28", + "hyper-tls 0.5.0", "nonzero_ext", "runtime", "serde", @@ -9632,16 +10001,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.2.0" @@ -9671,6 +10030,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -9692,6 +10057,114 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +dependencies = [ + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "smoldot" +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", + "atomic-take", + "base64 0.21.7", + "bip39", + "blake2-rfc", + "bs58 0.5.1", + "chacha20", + "crossbeam-queue", + "derive_more", + "ed25519-zebra 4.0.3", + "either", + "event-listener 3.1.0", + "fnv", + "futures-lite 2.3.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "hmac 0.12.1", + "itertools 0.11.0", + "libm", + "libsecp256k1", + "merlin 3.0.0", + "no-std-net", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "poly1305", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel 0.11.4", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "siphasher 1.0.1", + "slab", + "smallvec", + "soketto", + "twox-hash", + "wasmi", + "x25519-dalek 2.0.1", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e6f1898682b618b81570047b9d870b3faaff6ae1891b468eddd94d7f903c2fe" +dependencies = [ + "async-channel 2.3.1", + "async-lock 3.3.0", + "base64 0.21.7", + "blake2-rfc", + "derive_more", + "either", + "event-listener 3.1.0", + "fnv", + "futures-channel", + "futures-lite 2.3.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "itertools 0.11.0", + "log", + "lru 0.12.3", + "no-std-net", + "parking_lot 0.12.2", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher 1.0.1", + "slab", + "smol", + "smoldot", + "zeroize", +] + [[package]] name = "snap" version = "1.1.1" @@ -9704,7 +10177,7 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "blake2", "chacha20poly1305", "curve25519-dalek 4.1.2", @@ -9764,19 +10237,20 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "hash-db", "log", "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core", + "sp-core 21.0.0", + "sp-externalities 0.19.0", "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", - "sp-std 5.0.0", - "sp-trie", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", + "sp-std 8.0.0", + "sp-trie 22.0.0", "sp-version", "thiserror", ] @@ -9784,7 +10258,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "Inflector", "blake2", @@ -9797,119 +10271,144 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "23.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-std 8.0.0", +] + +[[package]] +name = "sp-application-crypto" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23030de8eae0272c705cf3e2ce0523a64708a6b53aa23f3cf9053ca63abd08d7" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-std 5.0.0", + "sp-core 26.0.0", + "sp-io 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "16.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", + "sp-std 8.0.0", + "static_assertions", +] + +[[package]] +name = "sp-arithmetic" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cf6e5c0c7c2e7be3a4a10af5316d2d40182915509a70f632a66c238a05c37b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std 12.0.0", "static_assertions", ] [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "parity-scale-codec", "sp-api", "sp-inherents", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "futures 0.3.30", "log", - "lru", "parity-scale-codec", "parking_lot 0.12.2", + "schnellru", "sp-api", "sp-consensus", "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", "thiserror", ] [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "futures 0.3.30", "log", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-runtime 24.0.0", + "sp-state-machine 0.28.0", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "sp-api", - "sp-application-crypto", - "sp-consensus", + "sp-application-crypto 23.0.0", "sp-consensus-slots", "sp-inherents", - "sp-runtime", - "sp-std 5.0.0", + "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/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "serde", "sp-api", - "sp-application-crypto", - "sp-consensus", + "sp-application-crypto 23.0.0", "sp-consensus-slots", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "finality-grandpa", "log", @@ -9917,37 +10416,39 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std 5.0.0", + "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", ] [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", + "sp-std 8.0.0", "sp-timestamp", ] [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "21.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "array-bytes", + "arrayvec 0.7.4", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2", "bounded-collections", - "bs58", + "bs58 0.5.1", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "futures 0.3.30", "hash-db", "hash256-std-hasher", @@ -9967,63 +10468,109 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing 5.0.0", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std 5.0.0", - "sp-storage", + "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", "ss58-registry", "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0db34a19be2efa0398a9506a365392d93a85220856d55e0eb78165ad2e1bedc" +dependencies = [ + "array-bytes", + "bip39", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58 0.5.1", + "dyn-clonable", + "ed25519-zebra 3.1.0", + "futures 0.3.30", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.10.5", + "lazy_static", + "libsecp256k1", + "log", + "merlin 2.0.1", + "parity-scale-codec", + "parking_lot 0.12.2", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel 0.9.1", + "secp256k1", + "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", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tracing", + "w3f-bls", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "9.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.8", "sha3", - "sp-std 5.0.0", "twox-hash", ] [[package]] name = "sp-core-hashing" -version = "9.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee599a8399448e65197f9a6cee338ad192e9023e35e31f22382964c3c174c68" +checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.8", "sha3", - "sp-std 8.0.0", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "9.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "proc-macro2", "quote", - "sp-core-hashing 5.0.0", + "sp-core-hashing 9.0.0", "syn 2.0.66", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "kvdb", "parking_lot 0.12.2", @@ -10031,8 +10578,19 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-debug-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50535e1a5708d3ba5c1195b59ebefac61cc8679c2c24716b87a86e8b7ed2e4a1" dependencies = [ "proc-macro2", "quote", @@ -10041,85 +10599,141 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.19.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 8.0.0", + "sp-storage 13.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884d05160bc89d0943d1c9fb8006c3d44b80f37f8af607aeff8d4d9cc82e279a" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 5.0.0", - "sp-storage", + "sp-std 12.0.0", + "sp-storage 17.0.0", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "thiserror", ] [[package]] name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "23.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "bytes", - "ed25519 1.5.3", - "ed25519-dalek 1.0.1", - "futures 0.3.30", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301c0ce94f80b324465a6f6173183aa07b26bd71d67f94a44de1fd11dea4a7cb" +dependencies = [ + "bytes", + "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", "rustversion", "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std 5.0.0", - "sp-tracing", - "sp-trie", + "sp-core 26.0.0", + "sp-externalities 0.23.0", + "sp-keystore 0.32.0", + "sp-runtime-interface 22.0.0", + "sp-state-machine 0.33.0", + "sp-std 12.0.0", + "sp-tracing 14.0.0", + "sp-trie 27.0.0", "tracing", "tracing-core", ] [[package]] name = "sp-keyring" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "24.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", - "strum", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.27.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "futures 0.3.30", "parity-scale-codec", "parking_lot 0.12.2", - "serde", - "sp-core", - "sp-externalities", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "thiserror", +] + +[[package]] +name = "sp-keystore" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db18ab01b2684856904c973d2be7dbf9ab3607cf706a7bd6648812662e5e7c5" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.2", + "sp-core 26.0.0", + "sp-externalities 0.23.0", "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "thiserror", "zstd 0.12.4", @@ -10128,28 +10742,39 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "frame-metadata", + "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "sp-api", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", ] [[package]] name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-panic-handler" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" dependencies = [ "backtrace", "lazy_static", @@ -10159,17 +10784,40 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "rustc-hash", "serde", - "sp-core", + "sp-core 21.0.0", +] + +[[package]] +name = "sp-runtime" +version = "24.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "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", ] [[package]] name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082bae4a164b8b629ce9cee79ff3c6b20e66d11d8ef37398796567d616325da4" dependencies = [ "either", "hash256-std-hasher", @@ -10180,36 +10828,68 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std 5.0.0", - "sp-weights", + "sp-application-crypto 28.0.0", + "sp-arithmetic 21.0.0", + "sp-core 26.0.0", + "sp-io 28.0.0", + "sp-std 12.0.0", + "sp-weights 25.0.0", +] + +[[package]] +name = "sp-runtime-interface" +version = "17.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "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", ] [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "695bba5d981a6fd3131b098d65f620601bd822501612bfb65897d4bb660762b1" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std 5.0.0", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.23.0", + "sp-runtime-interface-proc-macro 15.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", + "sp-tracing 14.0.0", + "sp-wasm-interface 18.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "11.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "Inflector", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2afcbd1bd18d323371111b66b7ac2870bdc1c86c3d7b0dae67b112ca52b4d8" dependencies = [ "Inflector", "proc-macro-crate 1.1.3", @@ -10221,34 +10901,36 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-keystore 0.27.0", + "sp-runtime 24.0.0", "sp-staking", - "sp-std 5.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "0.28.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "hash-db", "log", @@ -10256,61 +10938,133 @@ dependencies = [ "parking_lot 0.12.2", "rand 0.8.5", "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std 5.0.0", - "sp-trie", + "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", "thiserror", "tracing", + "trie-db 0.27.1", ] [[package]] -name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +name = "sp-state-machine" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df7c6680d9342c22c10d8272ebf9f0339b0e439b3e67b68f5627f9dfc6926a07" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot 0.12.2", + "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", + "thiserror", + "tracing", + "trie-db 0.28.0", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "aes-gcm", + "curve25519-dalek 4.1.2", + "ed25519-dalek", + "hkdf", + "parity-scale-codec", + "rand 0.8.5", + "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", + "thiserror", + "x25519-dalek 2.0.1", +] [[package]] name = "sp-std" version = "8.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" + +[[package]] +name = "sp-std" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" +checksum = "54c78c5a66682568cc7b153603c5d01a2cc8f5c221c7b1e921517a0eef18ae05" + +[[package]] +name = "sp-storage" +version = "13.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016f20812cc51bd479cc88d048c35d44cd3adde4accdb159d49d6050f2953595" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", - "sp-std 5.0.0", + "sp-debug-derive 12.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", - "futures-timer", - "log", "parity-scale-codec", "sp-inherents", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "thiserror", ] [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "10.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d727cb5265641ffbb7d4e42c18b63e29f6cfdbd240aae3bcf093c3d6eb29a19" dependencies = [ "parity-scale-codec", - "sp-std 5.0.0", + "sp-std 12.0.0", "tracing", "tracing-core", "tracing-subscriber 0.2.25", @@ -10319,32 +11073,55 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "sp-api", - "sp-runtime", + "sp-runtime 24.0.0", ] [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "async-trait", - "log", "parity-scale-codec", "scale-info", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-runtime", - "sp-std 5.0.0", - "sp-trie", + "sp-runtime 24.0.0", + "sp-std 8.0.0", + "sp-trie 22.0.0", +] + +[[package]] +name = "sp-trie" +version = "22.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot 0.12.2", + "scale-info", + "schnellru", + "sp-core 21.0.0", + "sp-std 8.0.0", + "thiserror", + "tracing", + "trie-db 0.27.1", + "trie-root", ] [[package]] name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c4bf89a5bd74f696cd1f23d83bb6abe6bd0abad1f3c70d4b0d7ebec4098cfe" dependencies = [ "ahash 0.8.11", "hash-db", @@ -10354,20 +11131,21 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.2", + "rand 0.8.5", "scale-info", "schnellru", - "sp-core", - "sp-std 5.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-version" -version = "5.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "22.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10375,16 +11153,16 @@ dependencies = [ "scale-info", "serde", "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "8.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10394,31 +11172,60 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "14.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 5.0.0", - "wasmi", + "sp-std 8.0.0", + "wasmtime", +] + +[[package]] +name = "sp-wasm-interface" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d85813d46a22484cdf5e5afddbbe85442dd1b4d84d67a8c7792f92f9f93607" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 12.0.0", "wasmtime", ] [[package]] name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +version = "20.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] + +[[package]] +name = "sp-weights" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1689f9594c2c4d09ede3d8a991a9eb900654e424fb00b62f2b370170af347acd" dependencies = [ "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std 5.0.0", + "sp-arithmetic 21.0.0", + "sp-core 26.0.0", + "sp-debug-derive 12.0.0", + "sp-std 12.0.0", ] [[package]] @@ -10430,11 +11237,13 @@ dependencies = [ "frame-support", "hex", "parity-scale-codec", + "scale-decode 0.13.1", + "scale-encode 0.7.1", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "substrate-stellar-sdk", ] @@ -10491,13 +11300,13 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-io", + "sp-io 23.0.0", "sp-offchain", - "sp-runtime", + "sp-runtime 24.0.0", "sp-session", - "sp-std 5.0.0", + "sp-std 8.0.0", "sp-transaction-pool", "sp-version", "spacewalk-primitives", @@ -10560,13 +11369,13 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-io", + "sp-io 23.0.0", "sp-offchain", - "sp-runtime", + "sp-runtime 24.0.0", "sp-session", - "sp-std 5.0.0", + "sp-std 8.0.0", "sp-transaction-pool", "sp-version", "spacewalk-primitives", @@ -10588,7 +11397,7 @@ dependencies = [ "futures 0.3.30", "hex-literal 0.2.2", "jsonrpc-core", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "module-issue-rpc", "module-oracle-rpc", @@ -10607,6 +11416,8 @@ dependencies = [ "sc-consensus-manual-seal", "sc-executor", "sc-keystore", + "sc-network", + "sc-offchain", "sc-rpc", "sc-rpc-api", "sc-service", @@ -10616,19 +11427,19 @@ dependencies = [ "serde", "serde_json", "sp-api", - "sp-arithmetic", + "sp-arithmetic 16.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core", + "sp-core 21.0.0", "sp-inherents", - "sp-io", + "sp-io 23.0.0", "sp-keyring", - "sp-keystore", + "sp-keystore 0.27.0", "sp-offchain", - "sp-runtime", + "sp-runtime 24.0.0", "sp-session", "sp-timestamp", "sp-transaction-pool", @@ -10638,6 +11449,7 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-stellar-sdk", + "tokio", ] [[package]] @@ -10655,16 +11467,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.3" @@ -10672,7 +11474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.9", + "der", ] [[package]] @@ -10696,6 +11498,23 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "staging-xcm" +version = "1.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" +dependencies = [ + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights 20.0.0", + "xcm-procedural", +] + [[package]] name = "staking" version = "1.0.10" @@ -10712,11 +11531,11 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", ] @@ -10770,10 +11589,10 @@ dependencies = [ "scale-info", "serde", "sha2 0.10.8", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "spacewalk-primitives", ] @@ -10818,9 +11637,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", ] +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + [[package]] name = "strum_macros" version = "0.24.3" @@ -10835,22 +11660,16 @@ dependencies = [ ] [[package]] -name = "stun" -version = "0.4.4" +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "subtle", - "thiserror", - "tokio", - "url 2.5.0", - "webrtc-util", + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.66", ] [[package]] @@ -10869,19 +11688,16 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "platforms 2.0.0", -] +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.30", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "sc-rpc-api", @@ -10889,16 +11705,16 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 21.0.0", + "sp-runtime 24.0.0", ] [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ - "hyper", + "hyper 0.14.28", "log", "prometheus 0.13.4", "thiserror", @@ -10907,8 +11723,8 @@ dependencies = [ [[package]] name = "substrate-stellar-sdk" -version = "0.2.4" -source = "git+https://github.com/pendulum-chain/substrate-stellar-sdk?branch=polkadot-v0.9.42#cda1a1cf2c8e99a8c3c2e739b80e5caea4cd99a7" +version = "0.3.0" +source = "git+https://github.com/pendulum-chain/substrate-stellar-sdk?branch=polkadot-v1.1.0#22bd78d713d4992ca7f52975995fe12bae9e220f" dependencies = [ "base64 0.13.1", "hex", @@ -10917,101 +11733,68 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "sodalite", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "sp-io 23.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", + "parity-wasm", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", "toml 0.7.8", "walkdir", "wasm-opt", ] -[[package]] -name = "substring" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] - [[package]] name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "subxt" -version = "0.25.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cbc78fd36035a24883eada29e0205b9b1416172530a7d00a60c07d0337db0c" -dependencies = [ - "bitvec", - "derivative", - "frame-metadata", - "futures 0.3.30", - "getrandom 0.2.15", - "hex", - "jsonrpsee", - "parity-scale-codec", - "parking_lot 0.12.2", - "scale-decode 0.4.0", - "scale-info", - "scale-value 0.6.0", - "serde", - "serde_json", - "sp-core", - "sp-runtime", - "subxt-macro 0.25.0", - "subxt-metadata 0.25.0", - "thiserror", - "tracing", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a734d66fa935fbda56ba6a71d7e969f424c8c5608d416ba8499d71d8cbfc1f" +checksum = "f7cf683962113b84ce5226bdf6f27d7f92a7e5bb408a5231f6c205407fbb20df" dependencies = [ + "async-trait", "base58", "blake2", "derivative", "either", - "frame-metadata", + "frame-metadata 16.0.0", "futures 0.3.30", - "getrandom 0.2.15", "hex", "impl-serde", - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "primitive-types", - "scale-bits", - "scale-decode 0.7.0", - "scale-encode", + "scale-bits 0.4.0", + "scale-decode 0.10.0", + "scale-encode 0.5.0", "scale-info", - "scale-value 0.10.0", + "scale-value", "serde", "serde_json", - "sp-core-hashing 9.0.0", - "subxt-macro 0.29.0", - "subxt-metadata 0.29.0", + "sp-core 26.0.0", + "sp-core-hashing 13.0.0", + "sp-runtime 29.0.0", + "subxt-lightclient", + "subxt-macro", + "subxt-metadata", "thiserror", "tracing", ] @@ -11022,107 +11805,80 @@ version = "1.0.10" dependencies = [ "futures 0.1.31", "futures 0.3.30", - "jsonrpsee", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", "log", "sc-client-db", "sc-network", "sc-service", "serde_json", "sp-keyring", - "subxt 0.25.0", + "subxt", "thiserror", "tokio", ] [[package]] name = "subxt-codegen" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7722c31febf55eb300c73d977da5d65cfd6fb443419b1185b9abcdd9925fd7be" -dependencies = [ - "darling 0.14.4", - "frame-metadata", - "heck 0.4.1", - "hex", - "jsonrpsee", - "parity-scale-codec", - "proc-macro-error", - "proc-macro2", - "quote", - "scale-info", - "subxt-metadata 0.25.0", - "syn 1.0.109", - "tokio", -] - -[[package]] -name = "subxt-codegen" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2f231d97c145c564bd544212c0cc0c29c09ff516af199f4ce00c8e055f8138" +checksum = "12800ad6128b4bfc93d2af89b7d368bff7ea2f6604add35f96f6a8c06c7f9abf" dependencies = [ - "frame-metadata", + "frame-metadata 16.0.0", "heck 0.4.1", "hex", - "jsonrpsee", + "jsonrpsee 0.20.3", "parity-scale-codec", "proc-macro2", "quote", "scale-info", - "subxt-metadata 0.29.0", + "subxt-metadata", "syn 2.0.66", "thiserror", "tokio", ] [[package]] -name = "subxt-macro" -version = "0.25.0" +name = "subxt-lightclient" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f64826f2c4ba20e3b2a86ec81a6ae8655ca6b6a4c2a6ccc888b6615efc2df14" +checksum = "243765099b60d97dc7fc80456ab951758a07ed0decb5c09283783f06ca04fc69" dependencies = [ - "darling 0.14.4", - "proc-macro-error", - "subxt-codegen 0.25.0", - "syn 1.0.109", + "futures 0.3.30", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror", + "tokio", + "tokio-stream", + "tracing", ] [[package]] name = "subxt-macro" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e544e41e1c84b616632cd2f86862342868f62e11e4cd9062a9e3dbf5fc871f64" +checksum = "d5086ce2a90e723083ff19b77f06805d00e732eac3e19c86f6cd643d4255d334" dependencies = [ "darling 0.20.9", + "parity-scale-codec", "proc-macro-error", - "subxt-codegen 0.29.0", + "subxt-codegen", "syn 2.0.66", ] [[package]] name = "subxt-metadata" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869af75e23513538ad0af046af4a97b8d684e8d202e35ff4127ee061c1110813" -dependencies = [ - "frame-metadata", - "parity-scale-codec", - "scale-info", - "sp-core", -] - -[[package]] -name = "subxt-metadata" -version = "0.29.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01ce5044c81db3404d38c56f1e69d72eff72c54e5913c9bba4c0b58d376031f" +checksum = "19dc60f779bcab44084053e12d4ad5ac18ee217dbe8e26c919e7086fc0228d30" dependencies = [ - "frame-metadata", + "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-core-hashing 9.0.0", + "sp-core-hashing 13.0.0", "thiserror", ] @@ -11154,6 +11910,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -11378,13 +12140,12 @@ dependencies = [ ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "serde", - "serde_json", + "crunchy", ] [[package]] @@ -11465,22 +12226,22 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.9", + "rustls 0.21.12", "tokio", - "webpki 0.22.4", ] [[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.12", + "rustls-pki-types", "tokio", ] @@ -11543,6 +12304,18 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "toml" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.16", +] + [[package]] name = "toml_datetime" version = "0.6.6" @@ -11562,7 +12335,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -11573,7 +12346,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.6", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.16", ] [[package]] @@ -11587,10 +12373,10 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", - "hyper", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-timeout", "percent-encoding 2.3.1", "pin-project", @@ -11625,16 +12411,16 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", "http-range-header", "pin-project-lite 0.2.14", "tower-layer", @@ -11768,6 +12554,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-db" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +dependencies = [ + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-root" version = "0.18.0" @@ -11854,25 +12653,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures 0.3.30", - "log", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "tweetnacl" version = "0.4.0" @@ -11951,9 +12731,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -11970,16 +12750,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -12048,15 +12818,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" -dependencies = [ - "getrandom 0.2.15", -] - [[package]] name = "valuable" version = "0.1.0" @@ -12107,15 +12868,15 @@ dependencies = [ "sha2 0.8.2", "signal-hook", "signal-hook-tokio", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", "sp-keyring", - "sp-runtime", - "sp-std 5.0.0", + "sp-runtime 24.0.0", + "sp-std 8.0.0", "spacewalk-primitives", "stellar-relay-lib", - "subxt 0.25.0", + "subxt", "sysinfo 0.26.9", "tempdir", "thiserror", @@ -12154,11 +12915,11 @@ dependencies = [ "scale-info", "security", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 5.0.0", + "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", "spacewalk-primitives", "staking", "visibility", @@ -12194,12 +12955,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] -name = "waitgroup" -version = "0.1.2" +name = "w3f-bls" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ - "atomic-waker", + "ark-bls12-377", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-serialize-derive", + "arrayref", + "constcat", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.8", + "sha3", + "thiserror", + "zeroize", ] [[package]] @@ -12264,7 +13040,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper", + "hyper 0.14.28", "log", "mime", "mime_guess", @@ -12377,14 +13153,14 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +checksum = "effbef3bd1dde18acb401f73e740a6f3d4a1bc651e9773bddc512fe4d8d68f67" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -12393,9 +13169,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +checksum = "c09e24eb283919ace2ed5733bda4842a59ce4c8de110ef5c6d98859513d17047" dependencies = [ "anyhow", "cxx", @@ -12405,15 +13181,14 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +checksum = "36f2f817bed2e8d65eb779fa37317e74de15585751f903c9118342d1970703a4" dependencies = [ "anyhow", "cc", "cxx", "cxx-build", - "regex", ] [[package]] @@ -12433,53 +13208,59 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.13.2" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" dependencies = [ - "parity-wasm", - "wasmi-validation", + "smallvec", + "spin 0.9.8", + "wasmi_arena", "wasmi_core", + "wasmparser-nostd", ] [[package]] -name = "wasmi-validation" -version = "0.5.0" +name = "wasmi_arena" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" [[package]] name = "wasmi_core" -version = "0.2.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", "libm", - "memory_units", - "num-rational", "num-traits", - "region", + "paste", ] [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", "url 2.5.0", ] +[[package]] +name = "wasmparser-nostd" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" +dependencies = [ + "indexmap-nostd", +] + [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -12487,7 +13268,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -12500,26 +13281,26 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.7", "bincode", "directories-next", "file-per-thread-logger", @@ -12528,15 +13309,15 @@ dependencies = [ "serde", "sha2 0.10.8", "toml 0.5.11", - "windows-sys 0.42.0", + "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -12544,27 +13325,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli 0.27.3", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -12574,18 +13371,18 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if 1.0.0", "cpp_demangle", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", @@ -12593,36 +13390,36 @@ dependencies = [ "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object 0.30.4", "once_cell", "rustix 0.36.17", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if 1.0.0", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -12632,21 +13429,21 @@ dependencies = [ "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand 0.8.5", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -12664,16 +13461,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "webpki" version = "0.22.4" @@ -12690,7 +13477,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.4", + "webpki", ] [[package]] @@ -12699,214 +13486,6 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring 0.16.20", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.8", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url 2.5.0", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.3", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.8", - "signature 1.6.4", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.1", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url 2.5.0", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.10", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1", - "subtle", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", -] - [[package]] name = "which" version = "4.4.2" @@ -12994,21 +13573,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[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]] name = "windows-sys" version = "0.45.0" @@ -13223,6 +13787,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -13233,6 +13806,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + [[package]] name = "wyz" version = "0.5.1" @@ -13265,63 +13848,28 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring 0.16.20", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", ] -[[package]] -name = "xcm" -version = "0.9.42" -source = "git+https://github.com/paritytech//polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" -dependencies = [ - "bounded-collections", - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights", - "xcm-procedural", -] - [[package]] name = "xcm-procedural" -version = "0.9.42" -source = "git+https://github.com/paritytech//polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" +version = "1.0.0" +source = "git+https://github.com/paritytech//polkadot-sdk?branch=release-polkadot-v1.1.0#e51a91fcac27d2f95ad631989622848aa8043f9e" dependencies = [ "Inflector", "proc-macro2", @@ -13345,15 +13893,9 @@ dependencies = [ [[package]] name = "yap" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" - -[[package]] -name = "yap" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a7eb6d82a11e4d0b8e6bda8347169aff4ccd8235d039bba7c47482d977dcf7" +checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" [[package]] name = "yasna" diff --git a/Cargo.toml b/Cargo.toml index 530d6bcb6..019bb5d46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,122 +36,118 @@ lto = "fat" codegen-units = 1 -[patch."https://github.com/paritytech/substrate"] -frame-support = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-support-procedural = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-support-procedural-tools = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-support-procedural-tools-derive = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-system = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-externalities = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-storage = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-wasm-interface = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } +[patch."https://github.com/paritytech/polkadot-sdk"] +frame-support = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-support-procedural = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-support-procedural-tools = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-support-procedural-tools-derive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-system = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-externalities = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-std = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-storage = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-wasm-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } -frame-benchmarking = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-benchmarking-cli = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-executive = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-system-benchmarking = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-aura = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-authorship = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-balances = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-grandpa = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-session = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-sudo = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-timestamp = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-allocator = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-basic-authorship = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-block-builder = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-chain-spec = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-chain-spec-derive = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-cli = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-client-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-client-db = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-aura = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-babe = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-epochs = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-slots = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-executor = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-executor-common = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-executor-wasmi = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-executor-wasmtime = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-consensus-grandpa = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-informant = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-keystore = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-bitswap = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-common = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-gossip = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-light = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-sync = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-network-transactions = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-offchain = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-peerset = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-proposer-metrics = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-rpc = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-rpc-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-rpc-server = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-rpc-spec-v2 = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-service = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-state-db = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-sysinfo = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-telemetry = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-tracing = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-tracing-proc-macro = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sc-utils = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-api-proc-macro = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-application-crypto = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-arithmetic = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-block-builder = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-consensus = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-consensus-aura = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-consensus-babe = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-consensus-slots = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-core-hashing = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-core-hashing-proc-macro = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-database = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-debug-derive = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-consensus-grandpa = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-inherents = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-keyring = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-keystore = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-maybe-compressed-blob = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-offchain = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-panic-handler = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-rpc = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-runtime-interface = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-session = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-staking = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-state-machine = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-tracing = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-transaction-pool = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-transaction-storage-proof = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-trie = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-timestamp = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-version = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-version-proc-macro = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-weights = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -substrate-build-script-utils = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -substrate-wasm-builder = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } - -[patch."https://github.com/paritytech/polkadot"] -xcm = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.42" } +frame-benchmarking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-benchmarking-cli = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-executive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-system-benchmarking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-aura = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-authorship = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-balances = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-grandpa = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-sudo = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-allocator = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-basic-authorship = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-block-builder = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-chain-spec = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-chain-spec-derive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-cli = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-db = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-aura = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-babe = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-epochs = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-slots = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor-common = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor-wasmtime = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-informant = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-keystore = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-bitswap = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-common = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-gossip = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-light = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-sync = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-transactions = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-offchain = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-proposer-metrics = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-server = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-spec-v2 = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-state-db = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-sysinfo = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-telemetry = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-tracing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-tracing-proc-macro = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-utils = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api-proc-macro = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-application-crypto = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-arithmetic = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-block-builder = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-aura = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-babe = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-slots = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core-hashing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core-hashing-proc-macro = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-database = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-debug-derive = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-grandpa = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-inherents = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keyring = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keystore = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-offchain = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-panic-handler = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-rpc = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime-interface = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-session = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-staking = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-state-machine = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-tracing = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-transaction-pool = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-transaction-storage-proof = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-trie = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-timestamp = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-version = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-version-proc-macro = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-weights = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-build-script-utils = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-wasm-builder = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +staging-xcm = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } [patch.crates-io] -sp-core = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech//polkadot-sdk", branch = "release-polkadot-v1.1.0" } \ No newline at end of file diff --git a/Cargo_CI.toml b/Cargo_CI.toml new file mode 100644 index 000000000..91f811c37 --- /dev/null +++ b/Cargo_CI.toml @@ -0,0 +1,154 @@ +[workspace] +resolver = "2" +members = [ + "clients/runner", + "clients/runtime", + "clients/runtime/client", + "clients/vault", + "clients/wallet", + "clients/service", + "clients/stellar-relay-lib", + "pallets/clients-info", + "pallets/currency", + "pallets/fee", + "pallets/nomination", + "pallets/oracle", + "pallets/pooled-rewards", + "pallets/reward-distribution", + "pallets/staking", + "pallets/stellar-relay", + "pallets/vault-registry", + "primitives", + "pallets/*/rpc", + "testchain/node", + "testchain/runtime/mainnet", + "testchain/runtime/testnet", +] +[profile.release] +panic = "unwind" + +[profile.production] +inherits = "release" +# Sacrifice compile speed for execution speed by using optimization flags: +# https://doc.rust-lang.org/rustc/linker-plugin-lto.html +lto = "fat" +# https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units +codegen-units = 1 + + +[patch."https://github.com/paritytech/polkadot-sdk"] +frame-support = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-support-procedural = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-support-procedural-tools = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-support-procedural-tools-derive = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-system = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-core = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-externalities = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-io = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-runtime = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-std = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-storage = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-wasm-interface = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } + +frame-benchmarking = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-benchmarking-cli = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-executive = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-system-benchmarking = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +frame-system-rpc-runtime-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-aura = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-authorship = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-balances = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-grandpa = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-session = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-sudo = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-timestamp = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-transaction-payment = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-transaction-payment-rpc = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-allocator = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-basic-authorship = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-block-builder = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-chain-spec = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-chain-spec-derive = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-cli = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-client-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-client-db = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-aura = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-babe = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-epochs = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-manual-seal = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-slots = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-executor = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-executor-common = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-executor-wasmtime = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-consensus-grandpa = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-informant = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-keystore = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-bitswap = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-common = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-gossip = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-light = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-sync = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-network-transactions = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-offchain = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-proposer-metrics = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-rpc = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-rpc-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-rpc-server = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-rpc-spec-v2 = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-service = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-state-db = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-sysinfo = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-telemetry = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-tracing = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-tracing-proc-macro = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-transaction-pool = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-transaction-pool-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sc-utils = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-api = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-api-proc-macro = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-application-crypto = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-arithmetic = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-block-builder = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-blockchain = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-consensus = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-consensus-aura = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-consensus-babe = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-consensus-slots = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-core-hashing = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-core-hashing-proc-macro = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-database = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-debug-derive = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-consensus-grandpa = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-inherents = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-keyring = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-keystore = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-maybe-compressed-blob = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-offchain = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-panic-handler = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-rpc = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-runtime-interface = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-runtime-interface-proc-macro = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-session = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-staking = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-state-machine = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-tracing = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-transaction-pool = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-transaction-storage-proof = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-trie = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-timestamp = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-version = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-version-proc-macro = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-weights = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +substrate-build-script-utils = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +substrate-frame-rpc-system = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +substrate-prometheus-endpoint = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +substrate-wasm-builder = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +staging-xcm = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } + +[patch.crates-io] +sp-core = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } +sp-runtime = { git = "https://github.com/pendulum-chain/polkadot-sdk", branch = "main" } + \ No newline at end of file diff --git a/clients/runner/Cargo.toml b/clients/runner/Cargo.toml index 88ba0f499..de4b958f1 100644 --- a/clients/runner/Cargo.toml +++ b/clients/runner/Cargo.toml @@ -9,11 +9,11 @@ clap = { version = "4.0.17", features = ["derive"] } hex = "0.4.3" tokio = { version = "1.37", features = ["rt-multi-thread", "macros", "time"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } thiserror = "1.0.0" log = "0.4.0" env_logger = "0.7.1" -reqwest = "0.11.11" +reqwest = { version = "0.12.4", features = ["native-tls-vendored"]} # reuse version of `url` depended on by `reqwest` url = "2.2.2" nix = "0.24.2" @@ -22,7 +22,7 @@ bytes = "1.1.0" signal-hook = "0.3.14" signal-hook-tokio = { version = "0.3.1", features = ["futures-v0_3"] } futures = "0.3.21" -subxt = { version = "0.29.0", default-features = false, features = ["jsonrpsee-ws"] } +subxt = { version = "0.33.0", default-features = false, features = ["jsonrpsee", "native"]} sha2 = "0.8.2" [dev-dependencies] diff --git a/clients/runner/src/runner.rs b/clients/runner/src/runner.rs index 00372a8e1..c0005ea84 100644 --- a/clients/runner/src/runner.rs +++ b/clients/runner/src/runner.rs @@ -145,7 +145,7 @@ impl Runner { if let Some(downloaded_release) = runner.downloaded_release() { if runner.checksum_matches(downloaded_release.checksum, &release).is_ok() { log::info!("The on-chain release is already downloaded, skipping re-download"); - return Ok(downloaded_release.clone()) + return Ok(downloaded_release.clone()); } } @@ -209,7 +209,7 @@ impl Runner { fn checksum_matches(checksum: H256, client_release: &ClientRelease) -> Result<(), Error> { if checksum != client_release.checksum { - return Err(Error::IncorrectChecksum) + return Err(Error::IncorrectChecksum); } Ok(()) @@ -247,7 +247,7 @@ impl Runner { Some(x) => x, None => { log::warn!("No child process to terminate."); - return Ok(0) + return Ok(0); }, }; @@ -309,7 +309,7 @@ impl Runner { .storage() .at_latest() .await? - .fetch_raw(&lookup_bytes) + .fetch_raw(lookup_bytes) .await? .map(Bytes::from); @@ -416,7 +416,7 @@ impl Runner { Some(status) => { log::info!("Child exited with: {status}"); runner.set_child_proc(None); - return Ok(false) + return Ok(false); }, None => return Ok(true), } @@ -429,7 +429,7 @@ impl Runner { stdout_mode: impl Into, ) -> Result { if runner.child_proc().is_some() { - return Err(Error::ChildProcessExists) + return Err(Error::ChildProcessExists); } let downloaded_release = runner.downloaded_release().as_ref().ok_or(Error::NoDownloadedRelease)?; diff --git a/clients/runtime/Cargo.toml b/clients/runtime/Cargo.toml index f9575d045..83c954bd4 100644 --- a/clients/runtime/Cargo.toml +++ b/clients/runtime/Cargo.toml @@ -10,6 +10,7 @@ standalone-metadata = [] parachain-metadata-pendulum = [] parachain-metadata-amplitude = [] parachain-metadata-foucoco = [] + testing-utils = [ "tempdir", "rand", @@ -36,16 +37,17 @@ prometheus = { version = "0.12.0", features = ["process"] } url = "2" # Substrate dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Subxt dependencies -subxt = "0.25.0" -jsonrpsee = { version = "0.16.0", features = ["macros", "jsonrpsee-types", "client", "jsonrpsee-ws-client", "jsonrpsee-client-transport"] } +subxt = { version = "0.33.0", features = [ "substrate-compat"] } +jsonrpsee = { version = "0.20.0", features = ["macros", "jsonrpsee-types", "client", "jsonrpsee-ws-client", "jsonrpsee-client-transport"] } # Used for performing the integration tests subxt-client = { path = "./client", optional = true } @@ -62,7 +64,7 @@ testchain-runtime = { package = "spacewalk-runtime-standalone-testnet", path = " mainnet-runtime = { package = "spacewalk-runtime-standalone-mainnet", path = "../../testchain/runtime/mainnet", optional = true } # Substrate Stellar Dependencies -substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v0.9.42" } +substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v1.1.0" } wallet = { path = "../wallet" } diff --git a/clients/runtime/client/Cargo.toml b/clients/runtime/client/Cargo.toml index fcc669cf3..794e29e64 100644 --- a/clients/runtime/client/Cargo.toml +++ b/clients/runtime/client/Cargo.toml @@ -15,17 +15,17 @@ keywords = ["parity", "substrate", "blockchain"] tokio = { version = "1.37", features = ["time", "rt-multi-thread"] } futures = { version = "0.3.9", features = ["compat"], package = "futures" } futures01 = { package = "futures", version = "0.1.29" } -jsonrpsee = "0.16.0" -jsonrpsee-types = "0.16.0" -jsonrpsee-core = { version = "0.16.0", features = ["async-client"] } +jsonrpsee = "0.20.0" +jsonrpsee-types = "0.20.0" +jsonrpsee-core = { version = "0.20.0", features = ["async-client"] } log = "0.4.13" serde_json = "1.0.61" thiserror = "1.0.23" -subxt = "0.25.0" +subxt = { version = "0.33.0", features = [ "substrate-compat"] } -sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sc-client-db = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } diff --git a/clients/runtime/client/src/lib.rs b/clients/runtime/client/src/lib.rs index fb80eeeeb..d972039d2 100644 --- a/clients/runtime/client/src/lib.rs +++ b/clients/runtime/client/src/lib.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use futures::{ channel::mpsc, future::{select, FutureExt}, @@ -18,7 +20,7 @@ pub use sc_service::{ }; use sc_service::{ config::{NetworkConfiguration, TelemetryEndpoints, TransportConfig}, - ChainSpec, Configuration, RpcHandlers, TaskManager, + BasePath, ChainSpec, Configuration, RpcHandlers, TaskManager, }; pub use sp_keyring::AccountKeyring; use thiserror::Error; @@ -239,35 +241,31 @@ impl SubxtClientConfig { tokio_handle: self.tokio_handle, default_heap_pages: Default::default(), disable_grandpa: Default::default(), - execution_strategies: Default::default(), force_authoring: Default::default(), offchain_worker: Default::default(), prometheus_config: Default::default(), rpc_cors: Default::default(), - rpc_http: Default::default(), - rpc_ipc: Default::default(), - rpc_ws: Default::default(), - rpc_ws_max_connections: Default::default(), + rpc_max_connections: 100, rpc_methods: Default::default(), tracing_receiver: Default::default(), tracing_targets: Default::default(), transaction_pool: Default::default(), wasm_method: self.wasm_method, - base_path: Default::default(), + base_path: BasePath::new_temp_dir().expect("should create a default path"), + data_path: PathBuf::new(), informant_output_format: Default::default(), state_pruning: Default::default(), wasm_runtime_overrides: Default::default(), - rpc_max_payload: Default::default(), - ws_max_out_buffer_capacity: Default::default(), runtime_cache_size: 2, - rpc_max_request_size: None, - rpc_max_response_size: None, + rpc_addr: None, rpc_id_provider: None, - rpc_max_subs_per_conn: None, + rpc_max_subs_per_conn: 1024, + rpc_max_request_size: 15, + rpc_max_response_size: 15, + rpc_port: 9944, trie_cache_maximum_size: None, blocks_pruning: BlocksPruning::KeepAll, }; - log::info!("{}", service_config.impl_name); log::info!("✌️ version {}", service_config.impl_version); log::info!("❤️ by {}, {}", self.author, self.copyright_start_year); diff --git a/clients/runtime/metadata-standalone-explicit.json b/clients/runtime/metadata-standalone-explicit.json new file mode 100644 index 000000000..e5f0b58cd Binary files /dev/null and b/clients/runtime/metadata-standalone-explicit.json differ diff --git a/clients/runtime/metadata-standalone-explicit.scale b/clients/runtime/metadata-standalone-explicit.scale new file mode 100644 index 000000000..e5f0b58cd Binary files /dev/null and b/clients/runtime/metadata-standalone-explicit.scale differ diff --git a/clients/runtime/metadata-standalone.json b/clients/runtime/metadata-standalone.json index 1e60ccffd..f3d984ce1 100644 Binary files a/clients/runtime/metadata-standalone.json and b/clients/runtime/metadata-standalone.json differ diff --git a/clients/runtime/metadata-standalone.scale b/clients/runtime/metadata-standalone.scale index 7f5282fd8..f3d984ce1 100644 Binary files a/clients/runtime/metadata-standalone.scale and b/clients/runtime/metadata-standalone.scale differ diff --git a/clients/runtime/src/assets.rs b/clients/runtime/src/assets.rs index 4dd5a26bb..460018b8f 100644 --- a/clients/runtime/src/assets.rs +++ b/clients/runtime/src/assets.rs @@ -17,7 +17,7 @@ impl TryFromSymbol for CurrencyId { let uppercase_symbol = symbol.to_uppercase(); if uppercase_symbol.trim() == "XLM" { - return Ok(CurrencyId::StellarNative) + return Ok(CurrencyId::StellarNative); } // Try to build stellar asset @@ -25,7 +25,7 @@ impl TryFromSymbol for CurrencyId { if parts.len() == 2 { let issuer = parts[0].trim(); let code = parts[1].trim(); - return CurrencyId::try_from((code, issuer)).map_err(|_| Error::InvalidCurrency) + return CurrencyId::try_from((code, issuer)).map_err(|_| Error::InvalidCurrency); } // We assume that it is an XCM currency so we try to parse it as a number diff --git a/clients/runtime/src/cli.rs b/clients/runtime/src/cli.rs index 9d566c720..68000481e 100644 --- a/clients/runtime/src/cli.rs +++ b/clients/runtime/src/cli.rs @@ -33,8 +33,9 @@ impl ProviderUserOpts { // load parachain credentials let (pair, user_name) = match (self.keyfile.as_ref(), self.keyname.as_ref(), &self.keyring) { - (Some(file_path), Some(keyname), None) => - (get_credentials_from_file(file_path, keyname)?, keyname.to_string()), + (Some(file_path), Some(keyname), None) => { + (get_credentials_from_file(file_path, keyname)?, keyname.to_string()) + }, (None, None, Some(keyring)) => { let pair = Pair::from_string(keyring.to_seed().as_str(), None) .map_err(|_| Error::KeyringAccountParsingError)?; @@ -42,7 +43,7 @@ impl ProviderUserOpts { }, _ => { // should never occur, due to clap constraints - return Err(Error::KeyringArgumentError) + return Err(Error::KeyringArgumentError); }, }; Ok((pair, user_name)) @@ -99,10 +100,6 @@ pub struct ConnectionOpts { /// Maximum number of concurrent requests #[clap(long, env = "MAX_CONCURRENT_REQUESTS")] pub max_concurrent_requests: Option, - - /// Maximum notification capacity for each subscription - #[clap(long, env = "MAX_NOTIFS_PER_SUBSCRIPTION")] - pub max_notifs_per_subscription: Option, } impl ConnectionOpts { @@ -115,7 +112,6 @@ impl ConnectionOpts { &self.spacewalk_parachain_url, signer, self.max_concurrent_requests, - self.max_notifs_per_subscription, self.spacewalk_parachain_connection_timeout_ms, shutdown_tx, ) diff --git a/clients/runtime/src/conn.rs b/clients/runtime/src/conn.rs index 2b1b321c2..b89e65ee2 100644 --- a/clients/runtime/src/conn.rs +++ b/clients/runtime/src/conn.rs @@ -1,7 +1,7 @@ use std::time::Duration; use jsonrpsee::{ - client_transport::ws::{Receiver, Sender, Uri, WsTransportClientBuilder}, + client_transport::ws::{Receiver, Sender, Url, WsTransportClientBuilder}, core::client::{Client, ClientBuilder}, }; use tokio::time::{sleep, timeout}; @@ -12,7 +12,8 @@ const RETRY_TIMEOUT: Duration = Duration::from_millis(1000); const CONNECTION_TIMEOUT: Duration = Duration::from_secs(10); async fn ws_transport(url: &str) -> Result<(Sender, Receiver), Error> { - let url: Uri = url.parse().map_err(Error::UrlParseError)?; + let url: Url = url.parse::().map_err(Error::UrlParseError)?; + WsTransportClientBuilder::default() .build(url) .await @@ -22,13 +23,11 @@ async fn ws_transport(url: &str) -> Result<(Sender, Receiver), Error> { pub(crate) async fn new_websocket_client( url: &str, max_concurrent_requests: Option, - max_notifs_per_subscription: Option, ) -> Result { let (sender, receiver) = ws_transport(url).await?; let ws_client = ClientBuilder::default() .request_timeout(CONNECTION_TIMEOUT) .max_concurrent_requests(max_concurrent_requests.unwrap_or(1024)) - .max_notifs_per_subscription(max_notifs_per_subscription.unwrap_or(256)) .build_with_tokio(sender, receiver); Ok(ws_client) @@ -37,24 +36,21 @@ pub(crate) async fn new_websocket_client( pub(crate) async fn new_websocket_client_with_retry( url: &str, max_concurrent_requests: Option, - max_notifs_per_subscription: Option, connection_timeout: Duration, ) -> Result { log::info!("Connecting to the spacewalk-parachain..."); timeout(connection_timeout, async move { loop { - match new_websocket_client(url, max_concurrent_requests, max_notifs_per_subscription) - .await - { + match new_websocket_client(url, max_concurrent_requests).await { Err(err) if err.is_ws_invalid_url_error() => return Err(err), Err(Error::JsonRpseeError(JsonRpseeError::Transport(err))) => { log::trace!("could not connect to parachain: {}", err); sleep(RETRY_TIMEOUT).await; - continue + continue; }, Ok(rpc) => { log::info!("Connected!"); - return Ok(rpc) + return Ok(rpc); }, Err(err) => return Err(err), } diff --git a/clients/runtime/src/error.rs b/clients/runtime/src/error.rs index dd96d6c47..bd9747f87 100644 --- a/clients/runtime/src/error.rs +++ b/clients/runtime/src/error.rs @@ -2,14 +2,11 @@ use std::{array::TryFromSliceError, fmt::Debug, io::Error as IoError, num::TryFr use codec::Error as CodecError; pub use jsonrpsee::core::Error as JsonRpseeError; -use jsonrpsee::{ - client_transport::ws::{InvalidUri as UrlParseError, WsHandshakeError}, - types::{error::CallError, ErrorObjectOwned}, -}; +use jsonrpsee::{client_transport::ws::WsHandshakeError, types::ErrorObjectOwned}; use serde_json::Error as SerdeJsonError; pub use subxt::{error::RpcError, Error as SubxtError}; use subxt::{ - error::{DispatchError, ModuleError, TransactionError}, + error::{DispatchError, TransactionError}, ext::sp_core::crypto::SecretStringError, }; use thiserror::Error; @@ -81,7 +78,7 @@ pub enum Error { #[error("Timeout: {0}")] TimeElapsed(#[from] Elapsed), #[error("UrlParseError: {0}")] - UrlParseError(#[from] UrlParseError), + UrlParseError(#[from] url::ParseError), #[error("Constant not found: {0}")] ConstantNotFound(String), #[error("Currency not found")] @@ -104,9 +101,12 @@ impl Error { pub fn is_module_err(&self, pallet_name: &str, error_name: &str) -> bool { matches!( self, - Error::SubxtRuntimeError(SubxtError::Runtime(DispatchError::Module(ModuleError{ - pallet, error, .. - }))) if pallet == pallet_name && error == error_name, + Error::SubxtRuntimeError(SubxtError::Runtime(DispatchError::Module(module_error))) if { + match module_error.details() { + Ok(details) => details.pallet.name() == pallet_name && &details.variant.name == error_name, + Err(_) => false + } + }, ) } @@ -118,7 +118,7 @@ impl Error { if let Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::ClientError(e))) = self { match e.downcast_ref::() { Some(e) => match e { - JsonRpseeError::Call(CallError::Custom(err)) => call(err), + JsonRpseeError::Call(err) => call(err), _ => None, }, None => { @@ -137,10 +137,10 @@ impl Error { let data_string = custom_error.data().map(ToString::to_string).unwrap_or_default(); if RecoverableError::is_recoverable(&data_string) { - return Some(Recoverability::Recoverable(data_string)) + return Some(Recoverability::Recoverable(data_string)); } - return Some(Recoverability::Unrecoverable(data_string)) + return Some(Recoverability::Unrecoverable(data_string)); } else { None } @@ -160,7 +160,7 @@ impl Error { pub fn is_rpc_disconnect_error(&self) -> bool { match self { - Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::ClientError(e))) => + Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::ClientError(e))) => { match e.downcast_ref::() { Some(e) => matches!(e, JsonRpseeError::RestartNeeded(_)), None => { @@ -169,7 +169,8 @@ impl Error { ); false }, - }, + } + }, Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::SubscriptionDropped)) => true, _ => false, } @@ -182,7 +183,7 @@ impl Error { pub fn is_block_hash_not_found_error(&self) -> bool { matches!( self, - Error::SubxtRuntimeError(SubxtError::Transaction(TransactionError::BlockHashNotFound)) + Error::SubxtRuntimeError(SubxtError::Transaction(TransactionError::BlockNotFound)) ) } @@ -203,7 +204,7 @@ impl Error { pub fn is_timeout_error(&self) -> bool { match self { - Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::ClientError(e))) => + Error::SubxtRuntimeError(SubxtError::Rpc(RpcError::ClientError(e))) => { match e.downcast_ref::() { Some(e) => matches!(e, JsonRpseeError::RequestTimeout), None => { @@ -212,14 +213,14 @@ impl Error { ); false }, - }, + } + }, _ => false, } } } impl RecoverableError { - // The string which is used to match the error type // For definitions, see: https://github.com/paritytech/substrate/blob/033d4e86cc7eff0066cd376b9375f815761d653c/primitives/runtime/src/transaction_validity.rs#L99 fn as_str(&self) -> &'static str { diff --git a/clients/runtime/src/integration/mod.rs b/clients/runtime/src/integration/mod.rs index 9fad7b104..70f4a76a0 100644 --- a/clients/runtime/src/integration/mod.rs +++ b/clients/runtime/src/integration/mod.rs @@ -48,9 +48,9 @@ impl XCMCurrencyConversion for MockValue { fn convert_from_dia_currency_id(blockchain: Vec, symbol: Vec) -> Option { // We assume that the blockchain is always 0 and the symbol represents the token symbol if blockchain.len() != 1 && blockchain[0] != 0 || symbol.len() != 1 { - return None + return None; } - return Some(symbol[0]) + return Some(symbol[0]); } } diff --git a/clients/runtime/src/lib.rs b/clients/runtime/src/lib.rs index 726c685a1..fef30d728 100644 --- a/clients/runtime/src/lib.rs +++ b/clients/runtime/src/lib.rs @@ -2,14 +2,14 @@ use codec::{Decode, Encode}; pub use prometheus; pub use sp_arithmetic::{traits as FixedPointTraits, FixedI128, FixedPointNumber, FixedU128}; use sp_std::marker::PhantomData; +use subxt::{ + config::polkadot::PolkadotExtrinsicParams, ext::sp_runtime::MultiSignature, subxt, Config, +}; pub use subxt::{ + config::substrate::BlakeTwo256, events::StaticEvent, ext::sp_core::{crypto::Ss58Codec, sr25519::Pair}, }; -use subxt::{ - ext::sp_runtime::{generic::Header, traits::BlakeTwo256, MultiSignature}, - subxt, Config, -}; pub use assets::TryFromSymbol; pub use error::{Error, Recoverability, SubxtError}; @@ -61,45 +61,73 @@ pub const STABLE_PARACHAIN_CONFIRMATIONS: &str = "StableParachainConfirmations"; )))] compile_error!("You need to select at least one of the metadata features"); -// All of the parachain features use the same metadata (from Foucoco) for now. -// We can change this once the spacewalk pallets were added to the runtimes of the other chains as -// well. +// If all features are selected, then we need to select only one metadata feature. +// Since this is done for testing, we can select the standalone metadata. #[cfg_attr( feature = "standalone-metadata", subxt( runtime_metadata_path = "metadata-standalone.scale", derive_for_all_types = "Clone, PartialEq, Eq", + substitute_type(path = "sp_core::crypto::AccountId32", with = "crate::AccountId"), + substitute_type( + path = "spacewalk_primitives::CurrencyId", + with = "::subxt::utils::Static" + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static" + ), ) )] #[cfg_attr( - feature = "parachain-metadata-pendulum", + all(feature = "parachain-metadata-pendulum", not(feature = "standalone-metadata")), subxt( runtime_metadata_path = "metadata-parachain-pendulum.scale", derive_for_all_types = "Clone, PartialEq, Eq", + substitute_type(path = "sp_core::crypto::AccountId32", with = "crate::AccountId"), + substitute_type( + path = "spacewalk_primitives::CurrencyId", + with = "::subxt::utils::Static" + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static" + ), ) )] #[cfg_attr( - feature = "parachain-metadata-amplitude", + all(feature = "parachain-metadata-amplitude", not(feature = "standalone-metadata")), subxt( runtime_metadata_path = "metadata-parachain-amplitude.scale", derive_for_all_types = "Clone, PartialEq, Eq", + substitute_type(path = "sp_core::crypto::AccountId32", with = "crate::AccountId"), + substitute_type( + path = "spacewalk_primitives::CurrencyId", + with = "::subxt::utils::Static" + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static" + ), ) )] #[cfg_attr( - feature = "parachain-metadata-foucoco", + all(feature = "parachain-metadata-foucoco", not(feature = "standalone-metadata")), subxt( runtime_metadata_path = "metadata-parachain-foucoco.scale", derive_for_all_types = "Clone, PartialEq, Eq", + substitute_type(path = "sp_core::crypto::AccountId32", with = "crate::AccountId"), + substitute_type( + path = "spacewalk_primitives::CurrencyId", + with = "::subxt::utils::Static" + ), + substitute_type( + path = "sp_arithmetic::fixed_point::FixedU128", + with = "::subxt::utils::Static" + ), ) )] -pub mod metadata { - #[subxt(substitute_type = "sp_core::crypto::AccountId32")] - use crate::AccountId; - #[subxt(substitute_type = "spacewalk_primitives::CurrencyId")] - use crate::CurrencyId; - #[subxt(substitute_type = "sp_arithmetic::fixed_point::FixedU128")] - use crate::FixedU128; -} +pub mod metadata {} #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Default, Clone, Decode, Encode)] pub struct WrapperKeepOpaque { @@ -111,13 +139,12 @@ pub struct WrapperKeepOpaque { pub struct SpacewalkRuntime; impl Config for SpacewalkRuntime { - type Index = Index; - type BlockNumber = BlockNumber; + type AssetId = (); type Hash = H256; - type Hashing = BlakeTwo256; + type Header = subxt::config::substrate::SubstrateHeader; + type Hasher = BlakeTwo256; type AccountId = AccountId; type Address = Address; - type Header = Header; type Signature = MultiSignature; - type ExtrinsicParams = subxt::tx::PolkadotExtrinsicParams; + type ExtrinsicParams = PolkadotExtrinsicParams; } diff --git a/clients/runtime/src/retry.rs b/clients/runtime/src/retry.rs index 2155311f3..f477574eb 100644 --- a/clients/runtime/src/retry.rs +++ b/clients/runtime/src/retry.rs @@ -39,7 +39,6 @@ where Err(RetryPolicy::Skip(err)) => err, Err(RetryPolicy::Throw(err)) => return Err(err), }; - match backoff.next_backoff() { Some(wait) => { // error occurred, sleep before retrying diff --git a/clients/runtime/src/rpc.rs b/clients/runtime/src/rpc.rs index f3ea338fb..9cd7d3c28 100644 --- a/clients/runtime/src/rpc.rs +++ b/clients/runtime/src/rpc.rs @@ -6,13 +6,14 @@ use codec::Encode; use futures::{future::join_all, stream::StreamExt, FutureExt, SinkExt}; use jsonrpsee::core::{client::Client, JsonValue}; use subxt::{ + backend::{legacy::LegacyRpcMethods, rpc::RpcClient}, blocks::ExtrinsicEvents, client::OnlineClient, events::StaticEvent, - metadata::DecodeWithMetadata, - rpc::rpc_params, + rpc_params, storage::{address::Yes, StorageAddress}, tx::TxPayload, + utils::Static, Error as BasicError, }; use tokio::{sync::RwLock, time::timeout}; @@ -61,9 +62,6 @@ cfg_if::cfg_if! { // timeout before retrying parachain calls (5 minutes) const TRANSACTION_TIMEOUT: Duration = Duration::from_secs(300); // 5 minutes -// number of storage entries to fetch at a time -const DEFAULT_PAGE_SIZE: u32 = 10; - pub(crate) type FeeRateUpdateSender = tokio::sync::broadcast::Sender; pub type FeeRateUpdateReceiver = tokio::sync::broadcast::Receiver; @@ -72,12 +70,13 @@ pub struct SpacewalkParachain { signer: Arc>, account_id: AccountId, api: OnlineClient, + legacy_rpc: LegacyRpcMethods, + rpc: RpcClient, shutdown_tx: ShutdownSender, fee_rate_update_tx: FeeRateUpdateSender, pub native_currency_id: CurrencyId, pub relay_chain_currency_id: CurrencyId, } - impl SpacewalkParachain { pub async fn new( rpc_client: Client, @@ -85,18 +84,22 @@ impl SpacewalkParachain { shutdown_tx: ShutdownSender, ) -> Result { let account_id = signer.read().await.account_id().clone(); - let api = OnlineClient::::from_rpc_client(Arc::new(rpc_client)).await?; + let rpc = RpcClient::new(Arc::new(rpc_client)); + + let api = OnlineClient::::from_rpc_client(rpc.clone()).await?; + let legacy_rpc = LegacyRpcMethods::new(rpc.clone()); - let runtime_version = api.rpc().runtime_version(None).await?; + let runtime_version = legacy_rpc.state_get_runtime_version(None).await?; let default_spec_name = &JsonValue::default(); let spec_name = runtime_version.other.get("specName").unwrap_or(default_spec_name); + if spec_name == DEFAULT_SPEC_NAME { log::info!("spec_name={}", spec_name); } else { return Err(Error::ParachainMetadataMismatch( DEFAULT_SPEC_NAME.into(), spec_name.as_str().unwrap_or_default().into(), - )) + )); } if DEFAULT_SPEC_VERSION.contains(&runtime_version.spec_version) { @@ -107,7 +110,7 @@ impl SpacewalkParachain { DEFAULT_SPEC_VERSION.start, DEFAULT_SPEC_VERSION.end, runtime_version.spec_version, - )) + )); } let currency_constants = metadata::constants().currency(); @@ -120,13 +123,16 @@ impl SpacewalkParachain { let parachain_rpc = Self { api, + rpc, + legacy_rpc, shutdown_tx, signer, account_id, fee_rate_update_tx, native_currency_id: CurrencyId::Native, - relay_chain_currency_id, + relay_chain_currency_id: *relay_chain_currency_id, }; + Ok(parachain_rpc) } @@ -157,11 +163,23 @@ impl SpacewalkParachain { pub aux: ImportedAux, } - let head = self.get_finalized_block_hash().await.unwrap(); + let _head = self.get_finalized_block_hash().await.unwrap(); + let _: CreatedBlock = self - .api - .rpc() - .request("engine_createBlock", rpc_params![true, true, head]) + .rpc + .request("engine_createBlock", rpc_params![true, true]) + .await + .expect("failed to create block"); + } + + /// This function is used in tests to finalize the current block. + #[cfg(feature = "testing-utils")] + pub async fn manual_finalize(&self) { + let head = self.get_finalized_block_hash().await.unwrap(); + + let _: bool = self + .rpc + .request("engine_finalizeBlock", rpc_params![head]) .await .expect("failed to create block"); } @@ -171,7 +189,7 @@ impl SpacewalkParachain { signer: Arc>, shutdown_tx: ShutdownSender, ) -> Result { - let ws_client = new_websocket_client(url, None, None).await?; + let ws_client = new_websocket_client(url, None).await?; Self::new(ws_client, signer, shutdown_tx).await } @@ -181,32 +199,20 @@ impl SpacewalkParachain { connection_timeout: Duration, shutdown_tx: ShutdownSender, ) -> Result { - Self::from_url_and_config_with_retry( - url, - signer, - None, - None, - connection_timeout, - shutdown_tx, - ) - .await + Self::from_url_and_config_with_retry(url, signer, None, connection_timeout, shutdown_tx) + .await } pub async fn from_url_and_config_with_retry( url: &str, signer: Arc>, max_concurrent_requests: Option, - max_notifs_per_subscription: Option, connection_timeout: Duration, shutdown_tx: ShutdownSender, ) -> Result { - let ws_client = new_websocket_client_with_retry( - url, - max_concurrent_requests, - max_notifs_per_subscription, - connection_timeout, - ) - .await?; + let ws_client = + new_websocket_client_with_retry(url, max_concurrent_requests, connection_timeout) + .await?; Self::new(ws_client, signer, shutdown_tx).await } @@ -236,10 +242,12 @@ impl SpacewalkParachain { match result.map_err(Into::::into) { Ok(ok) => Ok(ok), Err(err) => match err.is_invalid_transaction() { - Some(Recoverability::Recoverable(data)) => - Err(RetryPolicy::Skip(Error::InvalidTransaction(data))), - Some(Recoverability::Unrecoverable(data)) => - Err(RetryPolicy::Throw(Error::InvalidTransaction(data))), + Some(Recoverability::Recoverable(data)) => { + Err(RetryPolicy::Skip(Error::InvalidTransaction(data))) + }, + Some(Recoverability::Unrecoverable(data)) => { + Err(RetryPolicy::Throw(Error::InvalidTransaction(data))) + }, None => { // Handle other errors if err.is_pool_too_low_priority() { @@ -267,7 +275,10 @@ impl SpacewalkParachain { let on_chain_nonce = self .api .storage() - .fetch(&storage_key, None) + .at_latest() + .await + .unwrap() + .fetch(&storage_key) .await .transpose() .and_then(|x| x.ok()) @@ -280,18 +291,17 @@ impl SpacewalkParachain { async fn query_finalized
( &self, address: Address, - ) -> Result::Target>, Error> + ) -> Result, Error> where Address: StorageAddress, { - let hash = self.get_finalized_block_hash().await?; - Ok(self.api.storage().fetch(&address, hash).await?) + Ok(self.api.storage().at_latest().await.unwrap().fetch(&address).await?) } async fn query_finalized_or_error
( &self, address: Address, - ) -> Result<::Target, Error> + ) -> Result where Address: StorageAddress, { @@ -301,16 +311,15 @@ impl SpacewalkParachain { async fn query_finalized_or_default
( &self, address: Address, - ) -> Result<::Target, Error> + ) -> Result where Address: StorageAddress, { - let hash = self.get_finalized_block_hash().await?; - Ok(self.api.storage().fetch_or_default(&address, hash).await?) + Ok(self.api.storage().at_latest().await.unwrap().fetch_or_default(&address).await?) } pub async fn get_finalized_block_hash(&self) -> Result, Error> { - Ok(Some(self.api.rpc().finalized_head().await?)) + Ok(Some(self.api.backend().latest_finalized_block_ref().await?.hash())) } /// Subscribe to new parachain blocks. @@ -319,7 +328,7 @@ impl SpacewalkParachain { F: Fn(SpacewalkHeader) -> R, R: Future>, { - let mut sub = self.api.rpc().subscribe_finalized_block_headers().await?; + let mut sub = self.legacy_rpc.chain_subscribe_finalized_heads().await?; loop { on_block(sub.next().await.ok_or(Error::ChannelClosed)??).await?; } @@ -379,7 +388,7 @@ impl SpacewalkParachain { if let Ok(Some(target_event)) = target_event { log::trace!("event: {:?}", target_event); if tx.clone().send(target_event).await.is_err() { - break + break; } } }, @@ -410,8 +419,8 @@ impl SpacewalkParachain { #[cfg(test)] pub async fn get_invalid_tx_error(&self, recipient: AccountId) -> Error { let call = metadata::tx().tokens().transfer( - subxt::ext::sp_runtime::MultiAddress::Id(recipient), - CurrencyId::XCM(0), + subxt::utils::MultiAddress::::Id(recipient), + subxt::utils::Static(CurrencyId::XCM(0)), 100, ); let nonce = self.get_fresh_nonce().await; @@ -419,7 +428,7 @@ impl SpacewalkParachain { self.api .tx() - .create_signed_with_nonce(&call, &signer, nonce, Default::default()) + .create_signed_with_nonce(&call, &signer, nonce.into(), Default::default()) .unwrap() .submit_and_watch() .await @@ -442,8 +451,8 @@ impl SpacewalkParachain { #[cfg(test)] pub async fn get_too_low_priority_error(&self, recipient: AccountId) -> Error { let call = metadata::tx().tokens().transfer( - subxt::ext::sp_runtime::MultiAddress::Id(recipient), - CurrencyId::XCM(0), + subxt::utils::MultiAddress::Id(recipient), + subxt::utils::Static(CurrencyId::XCM(0)), 100, ); @@ -454,7 +463,7 @@ impl SpacewalkParachain { // submit tx but don't watch self.api .tx() - .create_signed_with_nonce(&call, &signer, nonce, Default::default()) + .create_signed_with_nonce(&call, &signer, nonce.into(), Default::default()) .unwrap() .submit() .await @@ -464,7 +473,7 @@ impl SpacewalkParachain { let result = self .api .tx() - .create_signed_with_nonce(&call, &signer, nonce, Default::default()) + .create_signed_with_nonce(&call, &signer, nonce.into(), Default::default()) .unwrap() .submit_and_watch() .await; @@ -492,7 +501,7 @@ pub trait UtilFuncs { impl UtilFuncs for SpacewalkParachain { async fn get_current_chain_height(&self) -> Result { let height_query = metadata::storage().system().number(); - let height = self.api.storage().fetch(&height_query, None).await?; + let height = self.api.storage().at_latest().await.unwrap().fetch(&height_query).await?; match height { Some(height) => Ok(height), None => Err(Error::BlockNotFound), @@ -563,8 +572,9 @@ impl VaultRegistryPallet for SpacewalkParachain { let query = metadata::storage().vault_registry().vaults(&vault_id.clone()); match self.query_finalized(query).await? { - Some(SpacewalkVault { status: VaultStatus::Liquidated, .. }) => - Err(Error::VaultLiquidated), + Some(SpacewalkVault { status: VaultStatus::Liquidated, .. }) => { + Err(Error::VaultLiquidated) + }, Some(vault) if &vault.id == vault_id => Ok(vault), _ => Err(Error::VaultNotFound), } @@ -576,8 +586,7 @@ impl VaultRegistryPallet for SpacewalkParachain { ) -> Result, Error> { let head = self.get_finalized_block_hash().await?; let result = self - .api - .rpc() + .rpc .request("vaultRegistry_getVaultsByAccountId", rpc_params![account_id, head]) .await?; @@ -587,11 +596,9 @@ impl VaultRegistryPallet for SpacewalkParachain { /// Fetch all active vaults. async fn get_all_vaults(&self) -> Result, Error> { let mut vaults = Vec::new(); - let head = self.get_finalized_block_hash().await?; - let key_addr = metadata::storage().vault_registry().vaults_root(); - - let mut iter = self.api.storage().iter(key_addr, DEFAULT_PAGE_SIZE, head).await?; - while let Some((_, account)) = iter.next().await? { + let key_addr = metadata::storage().vault_registry().vaults_iter(); + let mut iter = self.api.storage().at_latest().await.unwrap().iter(key_addr).await?; + while let Ok((_, account)) = iter.next().await.ok_or(Error::VaultNotFound)? { if let VaultStatus::Active(..) = account.status { vaults.push(account); } @@ -607,7 +614,7 @@ impl VaultRegistryPallet for SpacewalkParachain { async fn register_vault(&self, vault_id: &VaultId, collateral: u128) -> Result<(), Error> { // TODO: check MinimumDeposit if collateral == 0 { - return Err(Error::InsufficientFunds) + return Err(Error::InsufficientFunds); } let register_vault_tx = metadata::tx() @@ -683,8 +690,7 @@ impl VaultRegistryPallet for SpacewalkParachain { ) -> Result { let head = self.get_finalized_block_hash().await?; let result: BalanceWrapper<_> = self - .api - .rpc() + .rpc .request( "vaultRegistry_getRequiredCollateralForWrapped", rpc_params![ @@ -704,8 +710,7 @@ impl VaultRegistryPallet for SpacewalkParachain { async fn get_required_collateral_for_vault(&self, vault_id: VaultId) -> Result { let head = self.get_finalized_block_hash().await?; let result: BalanceWrapper<_> = self - .api - .rpc() + .rpc .request("vaultRegistry_getRequiredCollateralForVault", rpc_params![vault_id, head]) .await?; @@ -715,8 +720,7 @@ impl VaultRegistryPallet for SpacewalkParachain { async fn get_vault_total_collateral(&self, vault_id: VaultId) -> Result { let head = self.get_finalized_block_hash().await?; let result: BalanceWrapper<_> = self - .api - .rpc() + .rpc .request("vaultRegistry_getVaultTotalCollateral", rpc_params![vault_id, head]) .await?; @@ -730,8 +734,7 @@ impl VaultRegistryPallet for SpacewalkParachain { ) -> Result { let head = self.get_finalized_block_hash().await?; let result: UnsignedFixedPoint = self - .api - .rpc() + .rpc .request( "vaultRegistry_getCollateralizationFromVault", rpc_params![vault_id, only_issued, head], @@ -777,10 +780,9 @@ impl CollateralBalancesPallet for SpacewalkParachain { } async fn get_native_balance_for_id(&self, id: &AccountId) -> Result { - let head = self.get_finalized_block_hash().await?; let query = metadata::storage().system().account(id); - let result = self.api.storage().fetch(&query, head).await?; + let result = self.api.storage().at_latest().await.unwrap().fetch(&query).await?; Ok(result.map(|x| x.data.free).unwrap_or_default()) } @@ -789,10 +791,9 @@ impl CollateralBalancesPallet for SpacewalkParachain { id: AccountId, currency_id: CurrencyId, ) -> Result { - let head = self.get_finalized_block_hash().await?; - let query = metadata::storage().tokens().accounts(&id, ¤cy_id); + let query = metadata::storage().tokens().accounts(&id, &Static(currency_id)); - let result = self.api.storage().fetch(&query, head).await?; + let result = self.api.storage().at_latest().await.unwrap().fetch(&query).await?; Ok(result.map(|x| x.free).unwrap_or_default()) } @@ -805,10 +806,9 @@ impl CollateralBalancesPallet for SpacewalkParachain { id: AccountId, currency_id: CurrencyId, ) -> Result { - let head = self.get_finalized_block_hash().await?; - let query = metadata::storage().tokens().accounts(&id, ¤cy_id); + let query = metadata::storage().tokens().accounts(&id, &Static(currency_id)); - let result = self.api.storage().fetch(&query, head).await?; + let result = self.api.storage().at_latest().await.unwrap().fetch(&query).await?; Ok(result.map(|x| x.reserved).unwrap_or_default()) } @@ -819,8 +819,8 @@ impl CollateralBalancesPallet for SpacewalkParachain { currency_id: CurrencyId, ) -> Result<(), Error> { let transfer_tx = metadata::tx().tokens().transfer( - subxt::ext::sp_runtime::MultiAddress::Id(recipient.clone()), - currency_id, + subxt::utils::MultiAddress::::Id(recipient.clone()), + Static(currency_id), amount, ); @@ -880,7 +880,7 @@ impl OraclePallet for SpacewalkParachain { /// * `value` - the current exchange rate async fn feed_values(&self, values: Vec<((Vec, Vec), FixedU128)>) -> Result<(), Error> { if values.is_empty() { - return Err(Error::FeedingEmptyList) + return Err(Error::FeedingEmptyList); } use crate::metadata::runtime_types::dia_oracle::dia::CoinInfo; @@ -913,8 +913,7 @@ impl OraclePallet for SpacewalkParachain { async fn currency_to_usd(&self, amount: u128, currency_id: CurrencyId) -> Result { let head = self.get_finalized_block_hash().await?; let result: BalanceWrapper<_> = self - .api - .rpc() + .rpc .request( "oracle_currencyToUsd", rpc_params![BalanceWrapper { amount }, currency_id, head], @@ -929,8 +928,7 @@ impl OraclePallet for SpacewalkParachain { async fn usd_to_currency(&self, amount: u128, currency_id: CurrencyId) -> Result { let head = self.get_finalized_block_hash().await?; let result: BalanceWrapper<_> = self - .api - .rpc() + .rpc .request( "oracle_usdToCurrency", rpc_params![BalanceWrapper { amount }, currency_id, head], @@ -1055,8 +1053,7 @@ impl IssuePallet for SpacewalkParachain { ) -> Result, Error> { let head = self.get_finalized_block_hash().await?; let result: Vec = self - .api - .rpc() + .rpc .request("issue_getVaultIssueRequests", rpc_params![account_id, head]) .await?; futures::future::join_all( @@ -1079,15 +1076,16 @@ impl IssuePallet for SpacewalkParachain { let mut issue_requests = Vec::new(); - let head = self.get_finalized_block_hash().await?; - let key_addr = metadata::storage().issue().issue_requests_root(); - let mut iter = self.api.storage().iter(key_addr, DEFAULT_PAGE_SIZE, head).await?; + let key_addr = metadata::storage().issue().issue_requests_iter(); + let mut iter = self.api.storage().at_latest().await.unwrap().iter(key_addr).await?; - while let Some((issue_id, request)) = iter.next().await? { - if request.status == IssueRequestStatus::Pending && - request.opentime + issue_period > current_height + while let Ok((issue_id, request)) = + iter.next().await.ok_or(Error::RequestIssueIDNotFound)? + { + if request.status == IssueRequestStatus::Pending + && request.opentime + issue_period > current_height { - let key_hash = issue_id.0.as_slice(); + let key_hash = issue_id.as_slice(); // last bytes are the raw key let key = &key_hash[key_hash.len() - 32..]; issue_requests.push((H256::from_slice(key), request)); @@ -1186,8 +1184,7 @@ impl RedeemPallet for SpacewalkParachain { ) -> Result, Error> { let head = self.get_finalized_block_hash().await?; let result: Vec = self - .api - .rpc() + .rpc .request("redeem_getVaultRedeemRequests", rpc_params![account_id, head]) .await?; @@ -1368,8 +1365,7 @@ impl ReplacePallet for SpacewalkParachain { ) -> Result, Error> { let head = self.get_finalized_block_hash().await?; let result: Vec = self - .api - .rpc() + .rpc .request("replace_getNewVaultReplaceRequests", rpc_params![account_id, head]) .await?; join_all(result.into_iter().map(|key| async move { @@ -1388,8 +1384,7 @@ impl ReplacePallet for SpacewalkParachain { ) -> Result, Error> { let head = self.get_finalized_block_hash().await?; let result: Vec = self - .api - .rpc() + .rpc .request("replace_getOldVaultReplaceRequests", rpc_params![account_id, head]) .await?; diff --git a/clients/runtime/src/tests.rs b/clients/runtime/src/tests.rs index ddb93da97..8680a8be2 100644 --- a/clients/runtime/src/tests.rs +++ b/clients/runtime/src/tests.rs @@ -13,6 +13,8 @@ use super::{ }; use sp_runtime::traits::Convert; +use subxt::utils::AccountId32 as AccountId; + const DEFAULT_TESTING_CURRENCY: CurrencyId = CurrencyId::XCM(0); const DEFAULT_WRAPPED_CURRENCY: CurrencyId = CurrencyId::AlphaNum4( *b"USDC", @@ -26,6 +28,7 @@ fn dummy_public_key() -> StellarPublicKeyRaw { [0u8; 32] } +#[allow(dead_code)] async fn set_exchange_rate(client: SubxtClient) { let oracle_provider = setup_provider(client, AccountKeyring::Bob).await; let key = primitives::oracle::Key::ExchangeRate(DEFAULT_TESTING_CURRENCY); @@ -68,7 +71,7 @@ async fn test_invalid_tx_matching() { let (client, _tmp_dir) = default_provider_client(AccountKeyring::Alice, is_public_network).await; let parachain_rpc = setup_provider(client.clone(), AccountKeyring::Alice).await; - let err = parachain_rpc.get_invalid_tx_error(AccountKeyring::Bob.into()).await; + let err = parachain_rpc.get_invalid_tx_error(AccountId(AccountKeyring::Bob.into())).await; assert!(err.is_invalid_transaction().is_some()) } @@ -79,7 +82,9 @@ async fn test_too_low_priority_matching() { let (client, _tmp_dir) = default_provider_client(AccountKeyring::Alice, is_public_network).await; let parachain_rpc = setup_provider(client.clone(), AccountKeyring::Alice).await; - let err = parachain_rpc.get_too_low_priority_error(AccountKeyring::Bob.into()).await; + let err = parachain_rpc + .get_too_low_priority_error(AccountId(AccountKeyring::Bob.to_account_id().into())) + .await; assert!(err.is_pool_too_low_priority()) } @@ -112,14 +117,17 @@ async fn test_register_vault() { let (client, _tmp_dir) = default_provider_client(AccountKeyring::Alice, is_public_network).await; let parachain_rpc = setup_provider(client.clone(), AccountKeyring::Alice).await; - set_exchange_rate(client.clone()).await; + let oracle_rpc = setup_provider(client.clone(), AccountKeyring::Bob).await; + + let exchange_rate = FixedU128::saturating_from_rational(1u128, 100u128); + set_exchange_rate_and_wait(&oracle_rpc, DEFAULT_TESTING_CURRENCY, exchange_rate).await; + set_exchange_rate_and_wait(&oracle_rpc, DEFAULT_WRAPPED_CURRENCY, exchange_rate).await; let vault_id = VaultId::new( - AccountKeyring::Alice.into(), + AccountId(AccountKeyring::Alice.to_account_id().into()), DEFAULT_TESTING_CURRENCY, DEFAULT_WRAPPED_CURRENCY, ); - parachain_rpc.register_public_key(dummy_public_key()).await.unwrap(); parachain_rpc.register_vault(&vault_id, 3 * 10u128.pow(12)).await.unwrap(); parachain_rpc.get_vault(&vault_id).await.unwrap(); diff --git a/clients/runtime/src/types.rs b/clients/runtime/src/types.rs index ec9c74515..4e5cfd6fe 100644 --- a/clients/runtime/src/types.rs +++ b/clients/runtime/src/types.rs @@ -1,16 +1,18 @@ -pub use subxt::ext::sp_core::sr25519::Pair as KeyPair; - pub use metadata_aliases::*; pub use primitives::{CurrencyId, TextMemo}; +use sp_runtime::{generic, traits::BlakeTwo256}; use std::str::from_utf8; +pub use subxt::ext::sp_core::sr25519::Pair as KeyPair; +use subxt::utils::Static; use crate::{metadata, Config, SpacewalkRuntime, SS58_PREFIX}; -pub type AccountId = subxt::ext::sp_runtime::AccountId32; +pub type AccountId = subxt::utils::AccountId32; pub type Address = subxt::ext::sp_runtime::MultiAddress; pub type Balance = u128; pub type BlockNumber = u32; -pub type Index = u32; +pub type Header = generic::Header; +pub type Nonce = u32; pub type H256 = subxt::ext::sp_core::H256; pub type SpacewalkSigner = subxt::tx::PairSigner; pub type FixedU128 = sp_arithmetic::FixedU128; @@ -67,7 +69,7 @@ mod metadata_aliases { AccountId, BlockNumber, Balance, - CurrencyId, + Static, >; pub type SpacewalkRedeemRequest = @@ -75,7 +77,7 @@ mod metadata_aliases { AccountId, BlockNumber, Balance, - CurrencyId, + Static, >; pub type SpacewalkIssueRequest = @@ -83,7 +85,7 @@ mod metadata_aliases { AccountId, BlockNumber, Balance, - CurrencyId, + Static, >; pub type SpacewalkHeader = ::Header; @@ -92,20 +94,21 @@ mod metadata_aliases { AccountId, BlockNumber, Balance, - CurrencyId, - FixedU128, + Static, + Static, >; pub type VaultId = - metadata::runtime_types::spacewalk_primitives::VaultId; + metadata::runtime_types::spacewalk_primitives::VaultId>; + pub type VaultCurrencyPair = - metadata::runtime_types::spacewalk_primitives::VaultCurrencyPair; + metadata::runtime_types::spacewalk_primitives::VaultCurrencyPair>; pub type IssueRequestsMap = HashMap; pub type IssueIdLookup = HashMap; cfg_if::cfg_if! { if #[cfg(feature = "standalone-metadata")] { - pub type EncodedCall = metadata::runtime_types::spacewalk_runtime_standalone::RuntimeCall; + pub type EncodedCall = metadata::runtime_types::spacewalk_runtime_standalone_testnet::RuntimeCall; } else if #[cfg(feature = "parachain-metadata-pendulum")] { pub type EncodedCall = metadata::runtime_types::pendulum_runtime::RuntimeCall; } else if #[cfg(feature = "parachain-metadata-amplitude")] { @@ -152,11 +155,12 @@ pub mod currency_id { ) .replace('\"', "")), }, - CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => + CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => { Ok(format!( "ZenlinkLPToken({},{},{},{})", token1_id, token1_type, token2_id, token2_type - )), + )) + }, CurrencyId::Token(token_id) => Ok(format!("Token({})", token_id)), } } @@ -168,13 +172,15 @@ pub trait PrettyPrint { } mod account_id { - use subxt::ext::sp_core::crypto::Ss58Codec; - use super::*; + use sp_core::crypto::Ss58Codec; + use sp_runtime::AccountId32; impl PrettyPrint for AccountId { fn pretty_print(&self) -> String { - self.to_ss58check_with_version(SS58_PREFIX.into()) + // convert it to an sp_core type AccountId + let sp_account_id = AccountId32::new(self.0); + sp_account_id.to_ss58check_with_version(SS58_PREFIX.into()) } } } @@ -184,6 +190,8 @@ mod vault_id { type RichVaultId = primitives::VaultId; + type RichVaultHashable = primitives::VaultId; + impl crate::VaultId { pub fn new( account_id: AccountId, @@ -193,18 +201,18 @@ mod vault_id { Self { account_id, currencies: VaultCurrencyPair { - collateral: collateral_currency, - wrapped: wrapped_currency, + collateral: Static(collateral_currency), + wrapped: Static(wrapped_currency), }, } } pub fn collateral_currency(&self) -> CurrencyId { - self.currencies.collateral + *self.currencies.collateral } pub fn wrapped_currency(&self) -> CurrencyId { - self.currencies.wrapped + *self.currencies.wrapped } } @@ -226,8 +234,8 @@ mod vault_id { Self { account_id: value.account_id, currencies: primitives::VaultCurrencyPair { - collateral: value.currencies.collateral, - wrapped: value.currencies.wrapped, + collateral: *value.currencies.collateral, + wrapped: *value.currencies.wrapped, }, } } @@ -238,8 +246,8 @@ mod vault_id { Self { account_id: value.account_id, currencies: crate::VaultCurrencyPair { - collateral: value.currencies.collateral, - wrapped: value.currencies.wrapped, + collateral: Static(value.currencies.collateral), + wrapped: Static(value.currencies.wrapped), }, } } @@ -267,8 +275,17 @@ mod vault_id { impl std::hash::Hash for crate::VaultId { fn hash(&self, state: &mut H) { + // Extract rich vault, then create a hashable version of it + // defined with sp_runtime::AccountId32, which is hashable let vault: RichVaultId = self.clone().into(); - vault.hash(state) + let vault_hashable = RichVaultHashable { + account_id: sp_runtime::AccountId32::new(vault.account_id.0), + currencies: primitives::VaultCurrencyPair { + collateral: vault.currencies.collateral, + wrapped: vault.currencies.collateral, + }, + }; + vault_hashable.hash(state) } } } @@ -310,6 +327,7 @@ mod dispatch_error { OnlyProvider, CannotCreateHold, NotExpendable, + Blocked, ); convert_enum!(RichArithmeticError, ArithmeticError, Underflow, Overflow, DivisionByZero,); @@ -322,19 +340,23 @@ mod dispatch_error { RichDispatchError::Other(_) => DispatchError::Other, RichDispatchError::CannotLookup => DispatchError::CannotLookup, RichDispatchError::BadOrigin => DispatchError::BadOrigin, - RichDispatchError::Module(RichModuleError { index, error, .. }) => - DispatchError::Module(ModuleError { index, error }), + RichDispatchError::Module(RichModuleError { index, error, .. }) => { + DispatchError::Module(ModuleError { index, error }) + }, RichDispatchError::ConsumerRemaining => DispatchError::ConsumerRemaining, RichDispatchError::NoProviders => DispatchError::NoProviders, RichDispatchError::TooManyConsumers => DispatchError::TooManyConsumers, RichDispatchError::Token(token_error) => DispatchError::Token(token_error.into()), - RichDispatchError::Arithmetic(arithmetic_error) => - DispatchError::Arithmetic(arithmetic_error.into()), - RichDispatchError::Transactional(transactional_error) => - DispatchError::Transactional(transactional_error.into()), + RichDispatchError::Arithmetic(arithmetic_error) => { + DispatchError::Arithmetic(arithmetic_error.into()) + }, + RichDispatchError::Transactional(transactional_error) => { + DispatchError::Transactional(transactional_error.into()) + }, RichDispatchError::Exhausted => DispatchError::Exhausted, sp_runtime::DispatchError::Corruption => DispatchError::Corruption, sp_runtime::DispatchError::Unavailable => DispatchError::Unavailable, + sp_runtime::DispatchError::RootNotAllowed => todo!(), } } } diff --git a/clients/service/src/lib.rs b/clients/service/src/lib.rs index ab01949ea..c950db8f0 100644 --- a/clients/service/src/lib.rs +++ b/clients/service/src/lib.rs @@ -111,7 +111,6 @@ impl ConnectionManager { &self.parachain_config.spacewalk_parachain_url, signer, self.parachain_config.max_concurrent_requests, - self.parachain_config.max_notifs_per_subscription, self.parachain_config.spacewalk_parachain_connection_timeout_ms, shutdown_tx.clone(), ) @@ -129,7 +128,7 @@ impl ConnectionManager { match service.start().await { Err(err @ Error::Abort(_)) => { tracing::warn!("Disconnected: {}", err); - return Err(err) + return Err(err); }, Err(err) => { tracing::warn!("Disconnected: {}", err); @@ -162,7 +161,7 @@ impl ConnectionManager { tracing::info!("Restarting in {restart_in_secs} seconds"); sleep(Duration::from_secs(restart_in_secs)).await; - continue + continue; }, }; } diff --git a/clients/stellar-relay-lib/Cargo.toml b/clients/stellar-relay-lib/Cargo.toml index c1efb8c83..5f465c8f0 100644 --- a/clients/stellar-relay-lib/Cargo.toml +++ b/clients/stellar-relay-lib/Cargo.toml @@ -30,7 +30,7 @@ serde_json = "1.0.93" serde_with = "2.2.0" -substrate-stellar-sdk = {git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v0.9.42", default-features = false, features = ['all-types']} +substrate-stellar-sdk = {git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v1.1.0", default-features = false, features = ['all-types']} err-derive = "0.3.1" diff --git a/clients/stellar-relay-lib/resources/config/mainnet/stellar_relay_config_mainnet_iowa.json b/clients/stellar-relay-lib/resources/config/mainnet/stellar_relay_config_mainnet_iowa.json index 4c4d575fa..697f731af 100644 --- a/clients/stellar-relay-lib/resources/config/mainnet/stellar_relay_config_mainnet_iowa.json +++ b/clients/stellar-relay-lib/resources/config/mainnet/stellar_relay_config_mainnet_iowa.json @@ -5,9 +5,9 @@ }, "node_info": { "ledger_version": 21, - "overlay_version": 33, + "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.0.0 (c6f474133738ae5f6d11b07963ca841909210273)", + "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", "is_pub_net": true }, "stellar_history_archive_urls": [ diff --git a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest1.json b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest1.json index a5b57a8c0..44e908d25 100644 --- a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest1.json +++ b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest1.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "34.235.168.98", + "address": "54.166.220.249", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest2.json b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest2.json index 7ad8eed70..3b431ef78 100644 --- a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest2.json +++ b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest2.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "3.82.209.201", + "address": "54.159.138.198", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest3.json b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest3.json index 6295f7fb5..404ded3bb 100644 --- a/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest3.json +++ b/clients/stellar-relay-lib/resources/config/testnet/stellar_relay_config_sdftest3.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "3.239.7.78", + "address": "44.223.45.116", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/stellar-relay-lib/src/connection/authentication/certificate.rs b/clients/stellar-relay-lib/src/connection/authentication/certificate.rs index 7c457d3e7..c66f21d05 100644 --- a/clients/stellar-relay-lib/src/connection/authentication/certificate.rs +++ b/clients/stellar-relay-lib/src/connection/authentication/certificate.rs @@ -68,7 +68,7 @@ pub fn verify_remote_auth_cert( ) -> bool { let expiration = auth_cert.expiration; if expiration <= (time_in_millisecs / 1000) { - return false + return false; } let mut raw_data: Vec = vec![]; diff --git a/clients/stellar-relay-lib/src/connection/connector/connector.rs b/clients/stellar-relay-lib/src/connection/connector/connector.rs index deea0bc4e..e84d67de1 100644 --- a/clients/stellar-relay-lib/src/connection/connector/connector.rs +++ b/clients/stellar-relay-lib/src/connection/connector/connector.rs @@ -95,7 +95,7 @@ impl Connector { if remote_info.sequence() != auth_msg.sequence { // must be handled on main thread because workers could mix up order of messages. - return Err(Error::InvalidSequenceNumber) + return Err(Error::InvalidSequenceNumber); } let keys = self.hmac_keys.as_ref().ok_or(Error::MissingHmacKeys)?; diff --git a/clients/stellar-relay-lib/src/connection/connector/message_creation.rs b/clients/stellar-relay-lib/src/connection/connector/message_creation.rs index 16f1e3db1..e7473976f 100644 --- a/clients/stellar-relay-lib/src/connection/connector/message_creation.rs +++ b/clients/stellar-relay-lib/src/connection/connector/message_creation.rs @@ -35,7 +35,7 @@ impl Connector { let empty = HmacSha256Mac { mac: [0; 32] }; if self.remote().is_none() || self.hmac_keys().is_none() { - return empty + return empty; } let sending_mac_key = self.hmac_keys().map(|keys| keys.sending().mac).unwrap_or([0; 32]); diff --git a/clients/stellar-relay-lib/src/connection/connector/message_handler.rs b/clients/stellar-relay-lib/src/connection/connector/message_handler.rs index 276372ff1..69ac3a4bc 100644 --- a/clients/stellar-relay-lib/src/connection/connector/message_handler.rs +++ b/clients/stellar-relay-lib/src/connection/connector/message_handler.rs @@ -37,7 +37,7 @@ impl Connector { "process_raw_message(): Received ErrorMsg during authentication: {}", error_to_string(e.clone()) ); - return Err(Error::from(e)) + return Err(Error::from(e)); }, other => error!( "process_raw_message(): Received ErrorMsg during authentication: {:?}", @@ -53,7 +53,7 @@ impl Connector { trace!("process_raw_message(): Processing {msg_type:?} message: auth verified"); } - return self.process_stellar_message(auth_msg.message, msg_type).await + return self.process_stellar_message(auth_msg.message, msg_type).await; }, } Ok(None) @@ -88,15 +88,15 @@ impl Connector { StellarMessage::ErrorMsg(e) => { error!("process_stellar_message(): Received ErrorMsg during authentication: {e:?}"); if e.code == ErrorCode::ErrConf || e.code == ErrorCode::ErrAuth { - return Err(Error::from(e)) + return Err(Error::from(e)); } - return Ok(Some(StellarMessage::ErrorMsg(e))) + return Ok(Some(StellarMessage::ErrorMsg(e))); }, // we do not handle other messages. Return to caller other => { self.check_to_send_more(msg_type).await?; - return Ok(Some(other)) + return Ok(Some(other)); }, } @@ -127,7 +127,7 @@ impl Connector { let mut network_id = self.connection_auth.network_id().to_xdr(); if !verify_remote_auth_cert(time_now(), &hello.peer_id, &hello.cert, &mut network_id) { - return Err(Error::AuthCertInvalid) + return Err(Error::AuthCertInvalid); } let remote_info = RemoteInfo::new(&hello); diff --git a/clients/stellar-relay-lib/src/connection/connector/message_reader.rs b/clients/stellar-relay-lib/src/connection/connector/message_reader.rs index d04d9bb25..1509e61e1 100644 --- a/clients/stellar-relay-lib/src/connection/connector/message_reader.rs +++ b/clients/stellar-relay-lib/src/connection/connector/message_reader.rs @@ -29,15 +29,16 @@ pub(crate) async fn poll_messages_from_stellar( if send_to_user_sender.is_closed() { info!("poll_messages_from_stellar(): closing receiver during disconnection"); // close this channel as communication to user was closed. - break + break; } // check for messages from user. match send_to_node_receiver.try_recv() { - Ok(msg) => + Ok(msg) => { if let Err(e) = connector.send_to_node(msg).await { error!("poll_messages_from_stellar(): Error occurred during sending message to node: {e:?}"); - }, + } + }, Err(TryRecvError::Disconnected) => break, Err(TryRecvError::Empty) => {}, } @@ -46,7 +47,7 @@ pub(crate) async fn poll_messages_from_stellar( let xdr = match read_message_from_stellar(&mut connector).await { Err(e) => { error!("poll_messages_from_stellar(): {e:?}"); - break + break; }, Ok(xdr) => xdr, }; @@ -54,16 +55,18 @@ pub(crate) async fn poll_messages_from_stellar( match connector.process_raw_message(xdr).await { Ok(Some(stellar_msg)) => // push message to user + { if let Err(e) = send_to_user_sender.send(stellar_msg.clone()).await { warn!("poll_messages_from_stellar(): Error occurred during sending message {} to user: {e:?}", String::from_utf8(stellar_msg.to_base64_xdr()) .unwrap_or_else(|_| format!("{:?}", stellar_msg.to_base64_xdr())) ); - }, + } + }, Ok(None) => {}, Err(e) => { error!("poll_messages_from_stellar(): Error occurred during processing xdr message: {e:?}"); - break + break; }, } } @@ -104,7 +107,7 @@ async fn read_message_from_stellar(connector: &mut Connector) -> Result Result return Ok(xdr), Err(e) => { trace!("read_message_from_stellar(): ERROR: {e:?}"); - return Err(e) + return Err(e); }, } }, @@ -141,17 +144,17 @@ async fn read_message_from_stellar(connector: &mut Connector) -> Result return Ok(xdr), Err(e) => { trace!("read_message_from_stellar(): ERROR: {e:?}"); - return Err(e) + return Err(e); }, } }, Ok(Err(e)) => { trace!("read_message_from_stellar(): ERROR reading messages: {e:?}"); - return Err(Error::ReadFailed(e.to_string())) + return Err(Error::ReadFailed(e.to_string())); }, Err(_) => { trace!("read_message_from_stellar(): reading time elapsed."); - return Err(Error::Timeout) + return Err(Error::Timeout); }, } } @@ -180,7 +183,7 @@ async fn read_message( // only when the message has the exact expected size bytes, should we send to user. if actual_msg_len == xpect_msg_len { - return Ok(Some(readbuf.clone())) + return Ok(Some(readbuf.clone())); } // The next bytes are remnants from the previous stellar message. @@ -221,7 +224,7 @@ async fn read_unfinished_message( trace!("read_unfinished_message(): received continuation from the previous message."); readbuf.append(&mut cont_buf); - return Ok(Some(readbuf.clone())) + return Ok(Some(readbuf.clone())); } // this partial message is not enough to complete the previous message. diff --git a/clients/stellar-relay-lib/src/connection/connector/message_sender.rs b/clients/stellar-relay-lib/src/connection/connector/message_sender.rs index 4c13f6efd..4075d3ab2 100644 --- a/clients/stellar-relay-lib/src/connection/connector/message_sender.rs +++ b/clients/stellar-relay-lib/src/connection/connector/message_sender.rs @@ -46,7 +46,7 @@ impl Connector { message_type: MessageType, ) -> Result<(), Error> { if !self.inner_check_to_send_more(message_type) { - return Ok(()) + return Ok(()); } let msg = StellarMessage::SendMore(SendMore { num_messages: MAX_FLOOD_MSG_CAP }); diff --git a/clients/stellar-relay-lib/src/connection/flow_controller.rs b/clients/stellar-relay-lib/src/connection/flow_controller.rs index d1f273a7e..3d70e31a3 100644 --- a/clients/stellar-relay-lib/src/connection/flow_controller.rs +++ b/clients/stellar-relay-lib/src/connection/flow_controller.rs @@ -15,7 +15,7 @@ impl FlowController { pub fn send_more(&mut self, message_type: MessageType) -> bool { if !self.enabled { - return false + return false; } if is_flood_message(message_type) { @@ -24,7 +24,7 @@ impl FlowController { if self.flood_msg_cap == 0 { self.flood_msg_cap = MAX_FLOOD_MSG_CAP; - return true + return true; } false @@ -33,10 +33,10 @@ impl FlowController { pub fn is_flood_message(message_type: MessageType) -> bool { match message_type { - MessageType::Transaction | - MessageType::ScpMessage | - MessageType::FloodAdvert | - MessageType::FloodDemand => true, + MessageType::Transaction + | MessageType::ScpMessage + | MessageType::FloodAdvert + | MessageType::FloodDemand => true, _ => false, } } diff --git a/clients/stellar-relay-lib/src/connection/hmac.rs b/clients/stellar-relay-lib/src/connection/hmac.rs index 6655229ea..fb29229d2 100644 --- a/clients/stellar-relay-lib/src/connection/hmac.rs +++ b/clients/stellar-relay-lib/src/connection/hmac.rs @@ -99,7 +99,7 @@ pub fn create_sha256_hmac(data_buffer: &[u8], mac_key_buffer: &Buffer) -> Option warn!("failed to convert hmac of size {} into an array of 32.", hmac_vec_len); None }, - } + }; } warn!("Invalid length of mac key buffer size {}", mac_key_buffer.len()); diff --git a/clients/stellar-relay-lib/src/connection/xdr_converter.rs b/clients/stellar-relay-lib/src/connection/xdr_converter.rs index 97c5698ff..8162fd211 100644 --- a/clients/stellar-relay-lib/src/connection/xdr_converter.rs +++ b/clients/stellar-relay-lib/src/connection/xdr_converter.rs @@ -29,7 +29,7 @@ impl From for Error { /// Returns 0 if the array of u8 is less than 4 bytes, or exceeds the max of u32. pub(crate) fn get_xdr_message_length(data: &[u8]) -> usize { if data.len() < 4 { - return 0 + return 0; } let mut message_len = data[0..4].to_vec(); @@ -53,7 +53,7 @@ pub(crate) fn parse_authenticated_message( let msg_vers = parse_message_version(&xdr_message[0..4])?; if msg_vers != 0 { - return Err(Error::UnsupportedMessageVersion) + return Err(Error::UnsupportedMessageVersion); } let msg_type = parse_message_type(&xdr_message[12..16])?; diff --git a/clients/stellar-relay-lib/src/overlay.rs b/clients/stellar-relay-lib/src/overlay.rs index 3731b98bd..6ff44320a 100644 --- a/clients/stellar-relay-lib/src/overlay.rs +++ b/clients/stellar-relay-lib/src/overlay.rs @@ -6,7 +6,7 @@ use tokio::sync::{ Sender, }, }; -use tracing::{debug, error, info}; +use tracing::{error, info}; use crate::{ connection::{poll_messages_from_stellar, ConnectionInfo, Connector}, @@ -59,18 +59,17 @@ impl StellarOverlayConnection { pub fn listen(&mut self) -> Result, Error> { loop { if !self.is_alive() { - debug!("listen(): sender half of overlay has closed."); - return Err(Error::Disconnected) + return Err(Error::Disconnected); } match self.receiver.try_recv() { Ok(StellarMessage::ErrorMsg(e)) => { error!("listen(): received error message: {e:?}"); if e.code == ErrorCode::ErrConf || e.code == ErrorCode::ErrAuth { - return Err(Error::ConnectionFailed(error_to_string(e))) + return Err(Error::ConnectionFailed(error_to_string(e))); } - return Ok(None) + return Ok(None); }, Ok(msg) => return Ok(Some(msg)), Err(TryRecvError::Disconnected) => return Err(Error::Disconnected), @@ -97,7 +96,6 @@ impl StellarOverlayConnection { impl Drop for StellarOverlayConnection { fn drop(&mut self) { - debug!("drop(): shutting down StellarOverlayConnection"); self.stop(); } } diff --git a/clients/stellar-relay-lib/src/tests/mod.rs b/clients/stellar-relay-lib/src/tests/mod.rs index 96454d6ab..e635a3493 100644 --- a/clients/stellar-relay-lib/src/tests/mod.rs +++ b/clients/stellar-relay-lib/src/tests/mod.rs @@ -91,7 +91,7 @@ async fn stellar_overlay_should_receive_tx_set() { while let Ok(Some(msg)) = ov_conn_locked.listen() { match msg { - StellarMessage::ScpMessage(msg) => + StellarMessage::ScpMessage(msg) => { if let ScpStatementPledges::ScpStExternalize(stmt) = &msg.statement.pledges { let tx_set_hash = get_tx_set_hash(stmt); tx_set_hashes_clone.lock().await.push(tx_set_hash.clone()); @@ -99,16 +99,17 @@ async fn stellar_overlay_should_receive_tx_set() { .send_to_node(StellarMessage::GetTxSet(tx_set_hash)) .await .unwrap(); - }, + } + }, StellarMessage::TxSet(set) => { let tx_set_hash = set.into_hash().expect("should return a hash"); actual_tx_set_hashes_clone.lock().await.push(tx_set_hash); - break + break; }, StellarMessage::GeneralizedTxSet(set) => { let tx_set_hash = set.into_hash().expect("should return a hash"); actual_tx_set_hashes_clone.lock().await.push(tx_set_hash); - break + break; }, _ => {}, } diff --git a/clients/vault/Cargo.toml b/clients/vault/Cargo.toml index eb1a35628..ffe1027c8 100644 --- a/clients/vault/Cargo.toml +++ b/clients/vault/Cargo.toml @@ -36,7 +36,7 @@ itertools = "0.10.5" lazy_static = "1.4" nonzero_ext = "0.3.0" parity-scale-codec = "3.0.0" -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.12.4", features = ["json"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = "1.0.136" serde_json = { version = '1.0.45', default-features = false, features = ['alloc'] } @@ -59,6 +59,8 @@ tracing-subscriber = { version = "0.2.12", features = ["registry", "env-filter", jsonrpc-core = "18.0.0" jsonrpc-core-client = { version = "18.0.0", features = ["http", "tls"] } +subxt = { version = "0.33.0", features = [ "substrate-compat"] } + # Workspace dependencies runtime = { path = "../runtime" } service = { path = "../service" } @@ -67,12 +69,12 @@ stellar-relay-lib = { package = "stellar-relay-lib", path = "../stellar-relay-li primitives = { path = "../../primitives", package = "spacewalk-primitives", default-features = false } # Substrate dependencies -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } parking_lot = "0.12.1" err-derive = "0.3.1" @@ -89,7 +91,6 @@ tempdir = "0.3.7" # Workspace dependencies runtime = { path = "../runtime", features = ["testing-utils", "standalone-metadata"] } wallet = { path = "../wallet", features = ["testing-utils"] } -subxt = { version = "0.25.0" } # Substrate dependencies -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } diff --git a/clients/vault/resources/config/mainnet/stellar_relay_config_frankfurt.json b/clients/vault/resources/config/mainnet/stellar_relay_config_frankfurt.json index 3d33f9638..7a93a15aa 100644 --- a/clients/vault/resources/config/mainnet/stellar_relay_config_frankfurt.json +++ b/clients/vault/resources/config/mainnet/stellar_relay_config_frankfurt.json @@ -5,9 +5,9 @@ }, "node_info": { "ledger_version": 21, - "overlay_version": 33, + "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.0.0 (c6f474133738ae5f6d11b07963ca841909210273)", + "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", "is_pub_net": true }, "stellar_history_archive_urls": [ diff --git a/clients/vault/resources/config/mainnet/stellar_relay_config_iowa.json b/clients/vault/resources/config/mainnet/stellar_relay_config_iowa.json index 4c4d575fa..697f731af 100644 --- a/clients/vault/resources/config/mainnet/stellar_relay_config_iowa.json +++ b/clients/vault/resources/config/mainnet/stellar_relay_config_iowa.json @@ -5,9 +5,9 @@ }, "node_info": { "ledger_version": 21, - "overlay_version": 33, + "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.0.0 (c6f474133738ae5f6d11b07963ca841909210273)", + "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", "is_pub_net": true }, "stellar_history_archive_urls": [ diff --git a/clients/vault/resources/config/mainnet/stellar_relay_config_singapore.json b/clients/vault/resources/config/mainnet/stellar_relay_config_singapore.json index 32bdc7497..504213c9e 100644 --- a/clients/vault/resources/config/mainnet/stellar_relay_config_singapore.json +++ b/clients/vault/resources/config/mainnet/stellar_relay_config_singapore.json @@ -5,9 +5,9 @@ }, "node_info": { "ledger_version": 21, - "overlay_version": 33, + "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.0.0 (c6f474133738ae5f6d11b07963ca841909210273)", + "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", "is_pub_net": true }, "stellar_history_archive_urls": [ diff --git a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest1.json b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest1.json index a5b57a8c0..44e908d25 100644 --- a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest1.json +++ b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest1.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "34.235.168.98", + "address": "54.166.220.249", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest2.json b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest2.json index 7ad8eed70..3b431ef78 100644 --- a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest2.json +++ b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest2.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "3.82.209.201", + "address": "54.159.138.198", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest3.json b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest3.json index 6295f7fb5..404ded3bb 100644 --- a/clients/vault/resources/config/testnet/stellar_relay_config_sdftest3.json +++ b/clients/vault/resources/config/testnet/stellar_relay_config_sdftest3.json @@ -1,13 +1,13 @@ { "connection_info": { - "address": "3.239.7.78", + "address": "44.223.45.116", "port": 11625 }, "node_info": { "ledger_version": 21, "overlay_version": 34, "overlay_min_version": 32, - "version_str": "stellar-core 21.1.0 (b3aeb14cc798f6d11deb2be913041be916f3b0cc)", + "version_str": "stellar-core 21.2.0 (d78f48eacabb51753e34443de7618b956e61c59f)", "is_pub_net": false }, "stellar_history_archive_urls": [ diff --git a/clients/vault/src/cancellation.rs b/clients/vault/src/cancellation.rs index f680e11a3..246922b81 100644 --- a/clients/vault/src/cancellation.rs +++ b/clients/vault/src/cancellation.rs @@ -47,7 +47,7 @@ impl Debug for UnconvertedOpenTime { f, "UnconvertedOpenTime:{{ id: {}, parachain_open_height: {}, period: {} }}", id, self.parachain_open_height, self.period - ) + ); } } @@ -241,7 +241,7 @@ impl Cancel T::TYPE_NAME, request.id ); - return ListState::Invalid + return ListState::Invalid; }, } } @@ -299,7 +299,7 @@ impl Cancel tracing::trace!("List of open {} requests: {open_requests:?}", T::TYPE_NAME); if open_requests.is_empty() { - return Ok(vec![]) + return Ok(vec![]); } // get current block height and request period diff --git a/clients/vault/src/issue.rs b/clients/vault/src/issue.rs index bf1ef6f3e..00dd324e3 100644 --- a/clients/vault/src/issue.rs +++ b/clients/vault/src/issue.rs @@ -17,7 +17,7 @@ use wallet::{ use crate::{oracle::OracleAgent, ArcRwLock, Error, Event}; fn is_vault(p1: &PublicKey, p2_raw: [u8; 32]) -> bool { - return *p1.as_binary() == p2_raw + return *p1.as_binary() == p2_raw; } // Initialize the `issue_set` with currently open issues @@ -184,7 +184,7 @@ fn create_task_status_sender( // An existing task is found. if let Some(existing) = processed_map.get_mut(slot) { // Only recoverable errors can be given a new task. - return existing.recover_with_new_sender() + return existing.recover_with_new_sender(); } // Not finding the slot in the map means there's no existing task for it. @@ -264,7 +264,7 @@ pub async fn process_issues_requests( // create a one shot sender let Some(sender) = create_task_status_sender(&mut processed_map, slot) else { // for ongoing tasks, move on - continue + continue; }; tokio::spawn(execute_issue( @@ -313,7 +313,7 @@ pub async fn execute_issue( if let Err(e) = sender.send(SlotTaskStatus::RecoverableError) { tracing::error!("Execute Issue for slot {slot}: Failed to send {e:?} status."); } - return + return; }, }; @@ -356,7 +356,7 @@ pub async fn execute_issue( "Execute Issue #{issue_id:?} for slot {slot}: Failed to send {e:?} status" ); } - return + return; }, Err(err) if err.is_issue_completed() => { tracing::debug!( @@ -367,7 +367,7 @@ pub async fn execute_issue( "Execute Issue #{issue_id:?} for slot {slot}: Failed to send {e:?} status" ); } - return + return; }, Err(e) => { if let Err(e) = sender.send(SlotTaskStatus::Failed(format!("{:?}", e))) { @@ -375,7 +375,7 @@ pub async fn execute_issue( "Execute Issue #{issue_id:?} for slot {slot}: Failed to send {e:?} status" ); } - return + return; }, } } @@ -409,12 +409,13 @@ impl FilterWith for IssueFilter { ) -> bool { let issue_id = match tx.memo_text() { None => return false, - Some(memo_text) => + Some(memo_text) => { if let Some(issue_id) = memos_to_issue_ids.get(memo_text) { issue_id } else { - return false - }, + return false; + } + }, }; // check if the issue id is in the list of issues. @@ -426,12 +427,12 @@ impl FilterWith for IssueFilter { let tx_env = TransactionEnvelope::from_base64_xdr(tx.envelope_xdr); match tx_env { Ok(tx_env) => { - let asset = primitives::AssetConversion::lookup(request.asset); + let asset = primitives::AssetConversion::lookup(*request.asset); if let Ok(asset) = asset { let payment_amount_to_vault = tx_env.get_payment_amount_for_asset_to(self.vault_address, asset); if payment_amount_to_vault > 0 { - return true + return true; } } false diff --git a/clients/vault/src/main.rs b/clients/vault/src/main.rs index dc8840179..5a2d13f7e 100644 --- a/clients/vault/src/main.rs +++ b/clients/vault/src/main.rs @@ -5,6 +5,7 @@ use std::{ use clap::Parser; use futures::Future; +use sp_runtime::AccountId32 as AccountId; use sysinfo::{System, SystemExt}; use tokio::sync::RwLock; use tokio_stream::StreamExt; @@ -129,11 +130,11 @@ async fn start() -> Result<(), ServiceError> { // Create a PID file to signal to other processes that a vault is running. // This file is auto-removed when `drop`ped. - let _pidfile = PidFile::create( - &String::from(DEFAULT_SPEC_NAME), - signer.read().await.account_id(), - &mut sys, - )?; + + // First get the raw [u8] from the signer's account id and + // convert it to an sp_core type AccountId + let sp_account_id = AccountId::new(signer.read().await.account_id().0); + let _pidfile = PidFile::create(&String::from(DEFAULT_SPEC_NAME), &sp_account_id, &mut sys)?; // Unless termination signals are caught, the PID file is not dropped. let main_task = async move { vault_connection_manager.start::().await }; @@ -163,8 +164,6 @@ async fn main() { mod tests { use std::{thread, time::Duration}; - use runtime::AccountId; - use super::*; #[tokio::test] diff --git a/clients/vault/src/metrics.rs b/clients/vault/src/metrics.rs index 3bb32cd7f..bef201b34 100644 --- a/clients/vault/src/metrics.rs +++ b/clients/vault/src/metrics.rs @@ -155,10 +155,12 @@ impl PerCurrencyMetrics { fn format_currency_for_display(currency: CurrencyId) -> String { match currency { CurrencyId::Stellar(asset) => match asset { - Asset::AlphaNum4 { code, .. } => - String::from_utf8(code.to_vec()).unwrap_or_default().replace('\"', ""), - Asset::AlphaNum12 { code, .. } => - String::from_utf8(code.to_vec()).unwrap_or_default().replace('\"', ""), + Asset::AlphaNum4 { code, .. } => { + String::from_utf8(code.to_vec()).unwrap_or_default().replace('\"', "") + }, + Asset::AlphaNum12 { code, .. } => { + String::from_utf8(code.to_vec()).unwrap_or_default().replace('\"', "") + }, Asset::StellarNative => "XLM".to_owned(), }, CurrencyId::Native => "Native".to_owned(), @@ -372,15 +374,15 @@ fn get_balances_for_asset(asset: stellar::Asset, balances: Vec) stellar::Asset::AssetTypeCreditAlphanum4(a4) => balances .iter() .find(|i| { - i.asset_issuer.clone().unwrap_or_default() == a4.issuer.to_encoding() && - i.asset_code.clone().unwrap_or_default() == a4.asset_code.to_vec() + i.asset_issuer.clone().unwrap_or_default() == a4.issuer.to_encoding() + && i.asset_code.clone().unwrap_or_default() == a4.asset_code.to_vec() }) .map(|i| i.balance), stellar::Asset::AssetTypeCreditAlphanum12(a12) => balances .iter() .find(|i| { - i.asset_issuer.clone().unwrap_or_default() == a12.issuer.to_encoding() && - i.asset_code.clone().unwrap_or_default() == a12.asset_code.to_vec() + i.asset_issuer.clone().unwrap_or_default() == a12.issuer.to_encoding() + && i.asset_code.clone().unwrap_or_default() == a12.asset_code.to_vec() }) .map(|i| i.balance), _ => { @@ -497,7 +499,7 @@ pub async fn monitor_bridge_metrics( for currency_id in updated_currencies { for vault in vaults .iter() - .filter(|vault| &vault.vault_id.collateral_currency() == currency_id) + .filter(|vault| vault.vault_id.collateral_currency() == **currency_id) { let _ = publish_locked_collateral(vault, parachain_rpc.clone()).await; let _ = publish_required_collateral(vault, parachain_rpc.clone()).await; diff --git a/clients/vault/src/oracle/agent.rs b/clients/vault/src/oracle/agent.rs index 7a5e14f0d..575085b46 100644 --- a/clients/vault/src/oracle/agent.rs +++ b/clients/vault/src/oracle/agent.rs @@ -42,10 +42,11 @@ async fn handle_message( StellarMessage::ScpMessage(env) => { collector.write().await.handle_envelope(env, message_sender).await?; }, - StellarMessage::TxSet(set) => + StellarMessage::TxSet(set) => { if let Err(e) = collector.read().await.add_txset(set) { tracing::error!(e); - }, + } + }, StellarMessage::GeneralizedTxSet(set) => { if let Err(e) = collector.read().await.add_txset(set) { tracing::error!(e); @@ -91,7 +92,7 @@ pub async fn start_oracle_agent( // if a disconnect signal was sent, disconnect from Stellar. Ok(_) | Err(TryRecvError::Disconnected) => { tracing::info!("start_oracle_agent(): disconnect overlay..."); - break + break; }, Err(TryRecvError::Empty) => {}, } @@ -118,7 +119,7 @@ pub async fn start_oracle_agent( "start_oracle_agent(): Failed to send shutdown signal in thread: {e:?}" ); } - break + break; }, } } @@ -163,12 +164,12 @@ impl OracleAgent { drop(collector); // give 10 seconds interval for every retry sleep(Duration::from_secs(10)).await; - continue + continue; }, Some(proof) => { tracing::info!("get_proof(): Successfully build proof for slot {slot}"); tracing::trace!(" with proof: {proof:?}"); - return Ok(proof) + return Ok(proof); }, } } diff --git a/clients/vault/src/oracle/collector/collector.rs b/clients/vault/src/oracle/collector/collector.rs index 52999145c..b8b57bb66 100644 --- a/clients/vault/src/oracle/collector/collector.rs +++ b/clients/vault/src/oracle/collector/collector.rs @@ -198,7 +198,7 @@ impl ScpMessageCollector { if slot.is_none() { tracing::warn!("Collecting TxSet for slot: tx_set_hash: {hash_str} has no slot."); - return Err(format!("TxSetHash {hash_str} has no slot.")) + return Err(format!("TxSetHash {hash_str} has no slot.")); } Ok(()) diff --git a/clients/vault/src/oracle/collector/proof_builder.rs b/clients/vault/src/oracle/collector/proof_builder.rs index 4f1d74523..8ddc3ff54 100644 --- a/clients/vault/src/oracle/collector/proof_builder.rs +++ b/clients/vault/src/oracle/collector/proof_builder.rs @@ -91,7 +91,7 @@ impl ScpMessageCollector { tracing::error!( "ask_node_for_envelopes(): Proof Building for slot {slot:} failed to convert slot value into u32 datatype: {e:?}" ); - return + return; }, }; @@ -99,7 +99,7 @@ impl ScpMessageCollector { tracing::error!( "ask_node_for_envelopes(): Proof Building for slot {slot}: failed to send `GetScpState` message: {e:?}" ); - return + return; } tracing::info!("ask_node_for_envelopes(): Proof Building for slot {slot}: requesting to StellarNode for messages..."); } @@ -123,22 +123,22 @@ impl ScpMessageCollector { if let Some(envelopes) = self.envelopes_map().get(&slot) { // If the data was provided from the archive, no need to check for the minimum // Otherwise, we are still lacking envelopes. - if !self.is_envelopes_data_from_archive(&slot) && - envelopes.len() < get_min_externalized_messages(self.is_public()) + if !self.is_envelopes_data_from_archive(&slot) + && envelopes.len() < get_min_externalized_messages(self.is_public()) { tracing::warn!( "get_envelopes(): Proof Building for slot {slot}: {:?} envelopes is not enough to build proof", envelopes.len() ); } else { - return UnlimitedVarArray::new(envelopes.clone()).ok() + return UnlimitedVarArray::new(envelopes.clone()).ok(); } } // forcefully retrieve envelopes self.fetch_missing_envelopes(slot, sender).await; - return None + return None; } /// Returns a TransactionSet if a txset is found; None if the slot does not have a txset @@ -194,12 +194,12 @@ impl ScpMessageCollector { // return early if we don't have enough envelopes or the tx_set if let Some(envelopes) = envelopes_maybe { let tx_set = self.get_txset(slot, sender).await?; - return Some(Proof { slot, envelopes, tx_set }) + return Some(Proof { slot, envelopes, tx_set }); } else { tracing::warn!( "build_proof(): Couldn't build proof for slot {slot} due to missing envelopes" ); - return None + return None; } } @@ -218,7 +218,7 @@ impl ScpMessageCollector { async move { if archive_urls.is_empty() { tracing::error!("get_envelopes_from_horizon_archive(): Cannot get envelopes from horizon archive for slot {slot}: no archive URLs configured"); - return + return; } // We try to get the SCPArchive from each archive URL until we succeed or run out of @@ -230,7 +230,7 @@ impl ScpMessageCollector { tracing::error!( "get_envelopes_from_horizon_archive(): Could not get SCPArchive for slot {slot} from Horizon Archive: {e:?}" ); - continue + continue; } let scp_archive: XdrArchive = scp_archive_result.expect("Should unwrap SCPArchive"); @@ -252,8 +252,8 @@ impl ScpMessageCollector { let relevant_envelopes = vec_scp .into_iter() .filter(|scp| match scp.statement.pledges { - ScpStatementPledges::ScpStExternalize(_) | - ScpStatementPledges::ScpStConfirm(_) => true, + ScpStatementPledges::ScpStExternalize(_) + | ScpStatementPledges::ScpStConfirm(_) => true, _ => false, }) .collect::>(); @@ -274,7 +274,7 @@ impl ScpMessageCollector { ); // remove the file since it's invalid. scp_archive_storage.remove_file(slot); - continue + continue; } let mut envelopes_map = envelopes_map_arc.write(); @@ -292,7 +292,7 @@ impl ScpMessageCollector { // remove the archive file after successfully retrieving envelopes scp_archive_storage.remove_file(slot); - break + break; } } } else { @@ -326,7 +326,7 @@ impl ScpMessageCollector { tracing::error!( "get_txset_from_horizon_archive(): Could not get TransactionsArchive for slot {slot} from horizon archive: {e:?}" ); - continue + continue; }, }; @@ -345,14 +345,16 @@ impl ScpMessageCollector { let tx_set_type = match target_history_entry.clone().ext { TransactionHistoryEntryExt::V1(generalized_tx_set) => // If the type of `ext` is `V1` we use the contained generalized tx set - TransactionSetType::new(generalized_tx_set), + { + TransactionSetType::new(generalized_tx_set) + }, // Otherwise we can use the regular `tx_set` contained in the entry _ => TransactionSetType::new(target_history_entry.tx_set.clone()), }; tx_set_map.insert(slot, tx_set_type); // remove the archive file after a txset has been found tx_archive_storage.remove_file(slot); - break + break; } else { tracing::warn!( "get_txset_from_horizon_archive(): Could not get TransactionHistory entry from archive for slot {slot}" diff --git a/clients/vault/src/oracle/storage/impls.rs b/clients/vault/src/oracle/storage/impls.rs index 0af31bd4c..556f52c6e 100644 --- a/clients/vault/src/oracle/storage/impls.rs +++ b/clients/vault/src/oracle/storage/impls.rs @@ -41,7 +41,7 @@ impl FileHandler for EnvelopesFileHandler { if let Some(start_slot) = parse_slot(splits.next()) { if let Some(end_slot) = parse_slot(splits.next()) { - return (slot_param >= start_slot) && (slot_param <= end_slot) + return (slot_param >= start_slot) && (slot_param <= end_slot); } } diff --git a/clients/vault/src/oracle/storage/traits.rs b/clients/vault/src/oracle/storage/traits.rs index a48891620..9faaaf966 100644 --- a/clients/vault/src/oracle/storage/traits.rs +++ b/clients/vault/src/oracle/storage/traits.rs @@ -52,7 +52,7 @@ pub trait FileHandler { let read_size = file.read_to_end(&mut bytes)?; if read_size > 0 { - return Self::deserialize_bytes(bytes) + return Self::deserialize_bytes(bytes); } Ok(T::default()) @@ -68,7 +68,7 @@ pub trait FileHandler { let mut splits: Split = filename.split('_'); if Self::check_slot_in_splitted_filename(slot_param, &mut splits) { - return Ok(filename) + return Ok(filename); } } @@ -134,7 +134,7 @@ pub trait ArchiveStorage { fn find_last_slot_index_in_batch(&self, slot_index: Slot) -> Slot { let rest = (slot_index + 1) % ARCHIVE_NODE_LEDGER_BATCH; if rest == 0 { - return slot_index + return slot_index; } slot_index + ARCHIVE_NODE_LEDGER_BATCH - rest } diff --git a/clients/vault/src/process.rs b/clients/vault/src/process.rs index d80526350..ef5097b25 100644 --- a/clients/vault/src/process.rs +++ b/clients/vault/src/process.rs @@ -6,8 +6,8 @@ use std::{ str::FromStr, }; -use runtime::AccountId; use service::Error as ServiceError; +use sp_runtime::AccountId32 as AccountId; use sysinfo::{Pid, PidExt, ProcessExt, System, SystemExt}; use crate::Error; diff --git a/clients/vault/src/replace.rs b/clients/vault/src/replace.rs index dba55fbe4..5c96e8914 100644 --- a/clients/vault/src/replace.rs +++ b/clients/vault/src/replace.rs @@ -104,7 +104,7 @@ pub async fn listen_for_replace_requests( |event| async move { if parachain_rpc.is_this_vault(&event.old_vault_id) { // don't respond to requests we placed ourselves - return + return; } tracing::info!( @@ -133,7 +133,7 @@ pub async fn listen_for_replace_requests( // the only way it can fail is if the channel is closed let _ = event_channel.clone().send(Event::Opened).await; - return // no need to iterate over the rest of the vault ids + return; // no need to iterate over the rest of the vault ids }, Err(e) => tracing::error!( "Failed to accept Replace from {} with [{}] due to error: {}", @@ -307,7 +307,11 @@ mod tests { } fn dummy_vault_id() -> VaultId { - VaultId::new(AccountId::new([1u8; 32]), CurrencyId::XCM(0), CurrencyId::Native) + VaultId::new( + subxt::ext::sp_runtime::AccountId32::new([1u8; 32]).into(), + CurrencyId::XCM(0), + CurrencyId::Native, + ) } fn wallet(is_public_network: bool, path: &Path) -> ArcRwLock { @@ -336,7 +340,7 @@ mod tests { let event = RequestReplaceEvent { old_vault_id: dummy_vault_id(), amount: Default::default(), - asset: Default::default(), + asset: subxt::utils::Static(Default::default()), griefing_collateral: Default::default(), }; assert_err!( @@ -362,7 +366,7 @@ mod tests { let event = RequestReplaceEvent { old_vault_id: dummy_vault_id(), amount: Default::default(), - asset: Default::default(), + asset: subxt::utils::Static(Default::default()), griefing_collateral: Default::default(), }; handle_replace_request(parachain_rpc, wallet_arc, &event, &dummy_vault_id()) diff --git a/clients/vault/src/requests/execution.rs b/clients/vault/src/requests/execution.rs index 11b27e742..3273e836d 100644 --- a/clients/vault/src/requests/execution.rs +++ b/clients/vault/src/requests/execution.rs @@ -62,7 +62,7 @@ async fn spawn_tasks_to_execute_open_requests_async( // stop the loop if requests.is_empty() { - break + break; } if let Some(request) = get_request_for_stellar_tx(&transaction, &requests) { @@ -167,7 +167,7 @@ async fn execute_open_request_async( request.hash() ); - break // There is no need to retry again, so exit from while loop + break; // There is no need to retry again, so exit from while loop }; tracing::error!( @@ -175,7 +175,7 @@ async fn execute_open_request_async( request.request_type(), request.hash() ); - break // There is also no need to retry on an unrecoverable error. + break; // There is also no need to retry on an unrecoverable error. }, Err(error) => { retry_count += 1; // increase retry count @@ -247,7 +247,7 @@ where request.vault_id().pretty_print() ); - return // nothing we can do - bail + return; // nothing we can do - bail }; // We rate limit the number of transactions we pay and execute simultaneously because diff --git a/clients/vault/src/requests/helper.rs b/clients/vault/src/requests/helper.rs index 405c4a2c9..f5f2a62bc 100644 --- a/clients/vault/src/requests/helper.rs +++ b/clients/vault/src/requests/helper.rs @@ -94,7 +94,7 @@ pub(crate) fn get_request_for_stellar_tx( envelope.get_payment_amount_for_asset_to(request.stellar_address(), request.asset()); if paid_amount >= request.amount() { - return Some(request.clone()) + return Some(request.clone()); } None diff --git a/clients/vault/src/requests/structs.rs b/clients/vault/src/requests/structs.rs index 196a1325b..475a74db7 100644 --- a/clients/vault/src/requests/structs.rs +++ b/clients/vault/src/requests/structs.rs @@ -84,7 +84,7 @@ impl Request { // Convert the currency ID contained in the request to a Stellar asset and store both // in the request struct for convenience let asset = - primitives::AssetConversion::lookup(request.asset).map_err(|_| Error::LookupError)?; + primitives::AssetConversion::lookup(*request.asset).map_err(|_| Error::LookupError)?; Ok(Request { hash, @@ -95,7 +95,7 @@ impl Request { )?), amount: request.amount, asset, - currency: request.asset, + currency: *request.asset, stellar_address: request.stellar_address, request_type: RequestType::Redeem, vault_id: request.vault, @@ -112,7 +112,7 @@ impl Request { // Convert the currency ID contained in the request to a Stellar asset and store both // in the request struct for convenience let asset = - primitives::AssetConversion::lookup(request.asset).map_err(|_| Error::LookupError)?; + primitives::AssetConversion::lookup(*request.asset).map_err(|_| Error::LookupError)?; Ok(Request { hash, @@ -123,7 +123,7 @@ impl Request { )?), amount: request.amount, asset, - currency: request.asset, + currency: *request.asset, stellar_address: request.stellar_address, request_type: RequestType::Replace, vault_id: request.old_vault, @@ -152,7 +152,7 @@ impl Request { // ensure the deadline has not expired yet if let Some(ref deadline) = self.deadline { if parachain_rpc.get_current_active_block_number().await? >= deadline.parachain { - return Err(Error::DeadlineExpired) + return Err(Error::DeadlineExpired); } } @@ -198,10 +198,12 @@ impl Request { match result.map_err(Into::::into) { Ok(ok) => Ok(ok), Err(err) => match err.is_invalid_transaction() { - Some(Recoverability::Recoverable(data)) => - Err(RetryPolicy::Skip(EnrichedError::InvalidTransaction(data))), - Some(Recoverability::Unrecoverable(data)) => - Err(RetryPolicy::Throw(EnrichedError::InvalidTransaction(data))), + Some(Recoverability::Recoverable(data)) => { + Err(RetryPolicy::Skip(EnrichedError::InvalidTransaction(data))) + }, + Some(Recoverability::Unrecoverable(data)) => { + Err(RetryPolicy::Throw(EnrichedError::InvalidTransaction(data))) + }, None => { // Handle other errors if err.is_pool_too_low_priority() { @@ -282,7 +284,7 @@ impl Request { ); let response = match self.request_type { - RequestType::Redeem => + RequestType::Redeem => { wallet .send_payment_to_address( destination_public_key.clone(), @@ -291,8 +293,9 @@ impl Request { request_id, true, ) - .await, - RequestType::Replace => + .await + }, + RequestType::Replace => { wallet .send_payment_to_address( destination_public_key.clone(), @@ -301,7 +304,8 @@ impl Request { request_id, false, ) - .await, + .await + }, } .map_err(|e| Error::StellarWalletError(e))?; diff --git a/clients/vault/src/system.rs b/clients/vault/src/system.rs index eb08d9256..615269c29 100644 --- a/clients/vault/src/system.rs +++ b/clients/vault/src/system.rs @@ -315,8 +315,9 @@ async fn run_and_monitor_tasks( let monitor = tokio_metrics::TaskMonitor::new(); let metrics_iterator = monitor.intervals(); let task = match task { - ServiceTask::Optional(true, t) | ServiceTask::Essential(t) => - Some(wait_or_shutdown(shutdown_tx.clone(), t)), + ServiceTask::Optional(true, t) | ServiceTask::Essential(t) => { + Some(wait_or_shutdown(shutdown_tx.clone(), t)) + }, _ => None, }?; let task = monitor.instrument(task); @@ -389,7 +390,7 @@ impl VaultService { // exit if auto-register uses faucet and faucet url not set if amount_is_none && self.config.faucet_url.is_none() { - return Err(ServiceError::Abort(Error::FaucetUrlNotSet)) + return Err(ServiceError::Abort(Error::FaucetUrlNotSet)); } Ok(parsed_auto_register) @@ -421,7 +422,7 @@ impl VaultService { // check if both the config file and the wallet are the same. if is_public_network != stellar_overlay_cfg.is_public_network() { - return Err(ServiceError::IncompatibleNetwork) + return Err(ServiceError::IncompatibleNetwork); } let oracle_agent = crate::oracle::start_oracle_agent( @@ -743,8 +744,8 @@ impl VaultService { VaultId { account_id: self.spacewalk_parachain.get_account_id().clone(), currencies: VaultCurrencyPair { - collateral: collateral_currency, - wrapped: wrapped_currency, + collateral: subxt::utils::Static(collateral_currency), + wrapped: subxt::utils::Static(wrapped_currency), }, } } @@ -848,7 +849,7 @@ impl VaultService { match reqwest::get(url.clone()).await { Ok(response) if response.status().is_success() => { tracing::info!("try_fund_from_faucet(): successful funded {account_id}"); - return true + return true; }, Ok(response) => { tracing::error!("try_fund_from_faucet(): failed to fund {account_id} from faucet: {response:#?}"); @@ -891,7 +892,7 @@ impl VaultService { }, ) .await - .map_err(|e| Error::RuntimeError(e)) + .map_err(|e| Error::RuntimeError(e)); } else if self.try_fund_from_faucet().await { Ok(()) } else { diff --git a/clients/vault/tests/helper/helper.rs b/clients/vault/tests/helper/helper.rs index 0d01f3dcc..60c8e3123 100644 --- a/clients/vault/tests/helper/helper.rs +++ b/clients/vault/tests/helper/helper.rs @@ -15,6 +15,7 @@ use sp_keyring::AccountKeyring; use sp_runtime::traits::StaticLookup; use std::{sync::Arc, time::Duration}; use stellar_relay_lib::sdk::{PublicKey, SecretKey}; +use subxt::utils::AccountId32 as AccountId; use vault::{oracle::OracleAgent, ArcRwLock}; use wallet::{error::Error, StellarWallet, TransactionResponse}; @@ -64,7 +65,11 @@ pub async fn create_vault( account: AccountKeyring, wrapped_currency: CurrencyId, ) -> (VaultId, SpacewalkParachain) { - let vault_id = VaultId::new(account.clone().into(), DEFAULT_TESTING_CURRENCY, wrapped_currency); + let vault_id = VaultId::new( + AccountId(account.to_account_id().clone().into()), + DEFAULT_TESTING_CURRENCY, + wrapped_currency, + ); let vault_provider = setup_provider(client, account).await; @@ -152,11 +157,12 @@ pub async fn send_payment_to_address( match &result { // if the error is `tx_bad_seq` perform the process again - Err(Error::HorizonSubmissionError { reason, .. }) if reason.contains("tx_bad_seq") => - continue, + Err(Error::HorizonSubmissionError { reason, .. }) if reason.contains("tx_bad_seq") => { + continue + }, _ => { response = result; - break + break; }, } } @@ -179,7 +185,7 @@ pub async fn assert_issue( .await .expect("Failed to request issue"); - let asset = primitives::AssetConversion::lookup(issue.asset).expect("Invalid asset"); + let asset = primitives::AssetConversion::lookup(*issue.asset).expect("Invalid asset"); let stroop_amount = primitives::BalanceConversion::lookup(amount).expect("Invalid amount"); let destination_public_key = PublicKey::from_binary(issue.vault_stellar_public_key); diff --git a/clients/vault/tests/helper/mod.rs b/clients/vault/tests/helper/mod.rs index c516928dc..115c574eb 100644 --- a/clients/vault/tests/helper/mod.rs +++ b/clients/vault/tests/helper/mod.rs @@ -18,6 +18,7 @@ use sp_arithmetic::FixedPointNumber; use sp_keyring::AccountKeyring; use std::{future::Future, sync::Arc}; use stellar_relay_lib::StellarOverlayConfig; +use subxt::utils::AccountId32 as AccountId; use tokio::sync::RwLock; use vault::{ oracle::{random_stellar_relay_config, start_oracle_agent, OracleAgent}, @@ -27,7 +28,6 @@ use wallet::{ keys::{get_dest_secret_key_from_env, get_source_secret_key_from_env}, StellarWallet, }; - pub type StellarPublicKey = [u8; 32]; #[async_trait] @@ -92,7 +92,7 @@ async fn setup_chain_providers( let (vault_wallet, user_wallet) = initialize_wallets(&vault_stellar_secret, &user_stellar_secret, path, stellar_config).await; - return (client, vault_wallet, user_wallet) + return (client, vault_wallet, user_wallet); } pub async fn test_with( @@ -134,7 +134,7 @@ where }; let vault_id = VaultId::new( - AccountKeyring::Charlie.into(), + AccountId(AccountKeyring::Charlie.to_account_id().into()), DEFAULT_TESTING_CURRENCY, default_wrapped_currency, ); diff --git a/clients/vault/tests/vault_integration_tests.rs b/clients/vault/tests/vault_integration_tests.rs index 755740ab5..6e4a615ca 100644 --- a/clients/vault/tests/vault_integration_tests.rs +++ b/clients/vault/tests/vault_integration_tests.rs @@ -23,6 +23,7 @@ mod helper; use helper::*; use primitives::DecimalsLookup; +use subxt::utils::AccountId32 as AccountId; use vault::oracle::{random_stellar_relay_config, start_oracle_agent}; use wallet::keys::get_source_secret_key_from_env; @@ -654,7 +655,7 @@ async fn test_issue_execution_succeeds_from_archive_on_network(is_public_network .expect("Conversion should not fail"); let destination_public_key = PublicKey::from_binary(issue.vault_stellar_public_key); let stellar_asset = - primitives::AssetConversion::lookup(issue.asset).expect("Asset not found"); + primitives::AssetConversion::lookup(*issue.asset).expect("Asset not found"); let transaction_response = send_payment_to_address( user_wallet, @@ -755,7 +756,7 @@ async fn test_issue_overpayment_succeeds() { .expect("Conversion should not fail"); let destination_public_key = PublicKey::from_binary(issue.vault_stellar_public_key); let stellar_asset = - primitives::AssetConversion::lookup(issue.asset).expect("Asset not found"); + primitives::AssetConversion::lookup(*issue.asset).expect("Asset not found"); let transaction_response = send_payment_to_address( user_wallet, @@ -855,7 +856,7 @@ async fn test_automatic_issue_execution_succeeds_on_network(is_public_network: b let stroop_amount = primitives::BalanceConversion::lookup(issue.amount + issue.fee) .expect("Invalid amount"); let stellar_asset = - primitives::AssetConversion::lookup(issue.asset).expect("Asset not found"); + primitives::AssetConversion::lookup(*issue.asset).expect("Asset not found"); let result = send_payment_to_address( user_wallet, @@ -935,7 +936,7 @@ async fn test_automatic_issue_execution_succeeds_for_other_vault() { let user_provider = setup_provider(client.clone(), AccountKeyring::Dave).await; let vault2_provider = setup_provider(client.clone(), AccountKeyring::Eve).await; let vault2_id = VaultId::new( - AccountKeyring::Eve.into(), + AccountId(AccountKeyring::Eve.to_account_id().into()), DEFAULT_TESTING_CURRENCY, default_wrapped_currency(is_public_network), ); @@ -985,7 +986,7 @@ async fn test_automatic_issue_execution_succeeds_for_other_vault() { let stroop_amount = primitives::BalanceConversion::lookup(issue.amount + issue.fee) .expect("Invalid amount"); let stellar_asset = - primitives::AssetConversion::lookup(issue.asset).expect("Asset not found"); + primitives::AssetConversion::lookup(*issue.asset).expect("Asset not found"); // Sleep 1 second to give other thread some time to receive the RequestIssue event // and add it to the set @@ -1144,7 +1145,7 @@ async fn test_execute_open_requests_succeeds() { let stroop_amount = primitives::BalanceConversion::lookup(redeems[0].amount).expect("Invalid amount"); let asset = - primitives::AssetConversion::lookup(redeems[0].asset).expect("Invalid asset"); + primitives::AssetConversion::lookup(*redeems[0].asset).expect("Invalid asset"); // do stellar transfer for redeem 0 assert_ok!( @@ -1250,7 +1251,7 @@ async fn test_shutdown() { let user_provider = setup_provider(client.clone(), AccountKeyring::Dave).await; let sudo_vault_id = VaultId::new( - AccountKeyring::Alice.into(), + AccountId(AccountKeyring::Alice.to_account_id().into()), DEFAULT_TESTING_CURRENCY, default_wrapped_currency(is_public_network), ); diff --git a/clients/wallet/Cargo.toml b/clients/wallet/Cargo.toml index 1bd0f2525..cc67cdbe0 100644 --- a/clients/wallet/Cargo.toml +++ b/clients/wallet/Cargo.toml @@ -14,7 +14,7 @@ futures = "0.3.5" cached = { version = "0.47.0", features = ["async"]} parity-scale-codec = "3.0.0" rand = "0.8.5" -reqwest = { version = "0.11", features = ["json"] } +reqwest = { version = "0.12.4", features = ["json"] } serde = "1.0.136" serde_json = { version = '1.0.45', default-features = false, features = ['alloc'] } thiserror = "1.0" diff --git a/clients/wallet/src/cache.rs b/clients/wallet/src/cache.rs index 002b7f1a8..60da3c89f 100644 --- a/clients/wallet/src/cache.rs +++ b/clients/wallet/src/cache.rs @@ -20,7 +20,7 @@ macro_rules! unwrap_or_return { Ok(result) => result, Err(e) => { tracing::warn!("{:?}: {:?}", $log, e); - return $ret + return $ret; }, } }; @@ -66,7 +66,7 @@ impl WalletStateStorage { let path = self.cursor_path(); let path = Path::new(&path); if !path.exists() { - return 0 + return 0; } let Ok(content_from_file) = read_content_from_path(path) else { return 0 }; @@ -131,7 +131,7 @@ impl WalletStateStorage { return Err(Error::cache_error_with_seq( CacheErrorKind::SequenceNumberAlreadyUsed, sequence, - )) + )); } let mut file = OpenOptions::new() @@ -189,7 +189,7 @@ impl WalletStateStorage { if let Err(e) = create_dir_all(&full_path) { tracing::warn!("Failed to create directory of {full_path}: {:?}", e); } - return + return; }; for entry in directory.flatten() { @@ -207,7 +207,7 @@ impl WalletStateStorage { let path = Path::new(&full_file_path); if !path.exists() { - return Err(Error::cache_error_with_seq(CacheErrorKind::FileDoesNotExist, sequence)) + return Err(Error::cache_error_with_seq(CacheErrorKind::FileDoesNotExist, sequence)); } extract_tx_envelope_from_path(path).map(|(tx, _)| tx) @@ -251,7 +251,7 @@ impl WalletStateStorage { // return an error if all the files have errors. if tx_envelopes.is_empty() && !errors.is_empty() { - return Err(errors) + return Err(errors); } // sort in ascending order, based on the sequence number. @@ -290,7 +290,7 @@ fn extract_tx_envelope_from_path + std::fmt::Debug + Clone>( // convert the content into `Vec` let Some(content_as_vec_u8) = parse_xdr_string_to_vec_u8(&content_from_file) else { - return Err(Error::cache_error_with_path(CacheErrorKind::InvalidFile, format!("{path:?}"))) + return Err(Error::cache_error_with_path(CacheErrorKind::InvalidFile, format!("{path:?}"))); }; // convert the content to TransactionEnvelope diff --git a/clients/wallet/src/error.rs b/clients/wallet/src/error.rs index 56c7255c3..b73e4e3b3 100644 --- a/clients/wallet/src/error.rs +++ b/clients/wallet/src/error.rs @@ -46,14 +46,14 @@ impl Error { Error::HorizonResponseError { status, error, .. } => { if let Some(e) = error { if e.is_timeout() { - return true + return true; } } if let Some(status) = status { // forbidden error if *status == 403 { - return true + return true; } } @@ -61,11 +61,11 @@ impl Error { }, Error::HorizonSubmissionError { status, .. } if *status == 504 => true, Error::CacheError(e) => match e.kind { - CacheErrorKind::CreateDirectoryFailed | - CacheErrorKind::FileCreationFailed | - CacheErrorKind::WriteToFileFailed | - CacheErrorKind::DeleteFileFailed | - CacheErrorKind::FileDoesNotExist => true, + CacheErrorKind::CreateDirectoryFailed + | CacheErrorKind::FileCreationFailed + | CacheErrorKind::WriteToFileFailed + | CacheErrorKind::DeleteFileFailed + | CacheErrorKind::FileDoesNotExist => true, _ => false, }, _ => false, @@ -81,11 +81,11 @@ impl Error { return e .status() .map(|code| server_errors.contains(&code.as_u16())) - .unwrap_or(false) + .unwrap_or(false); } if let Some(status) = status { - return server_errors.contains(status) + return server_errors.contains(status); } // by default, assume that it will be a client error. @@ -149,15 +149,15 @@ impl Display for CacheError { impl Debug for CacheError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { if let Some(env) = &self.envelope { - return write!(f, "kind: {:?}, envelope: {:?}", self.kind, env) + return write!(f, "kind: {:?}, envelope: {:?}", self.kind, env); } if let Some(seq) = &self.sequence_number { - return write!(f, "kind: {:?}, sequence_number: {}", self.kind, seq) + return write!(f, "kind: {:?}, sequence_number: {}", self.kind, seq); } if let Some(path) = &self.path { - return write!(f, "kind: {:?}, path: {}", self.kind, path) + return write!(f, "kind: {:?}, path: {}", self.kind, path); } write!(f, "kind: {:?}", self.kind) diff --git a/clients/wallet/src/horizon/horizon.rs b/clients/wallet/src/horizon/horizon.rs index bd14e9ed8..5e54de558 100644 --- a/clients/wallet/src/horizon/horizon.rs +++ b/clients/wallet/src/horizon/horizon.rs @@ -39,7 +39,7 @@ pub fn horizon_url(is_public_network: bool, is_need_fallback: bool) -> &'static return other_urls .choose(&mut rand::thread_rng()) - .unwrap_or(&"https://horizon.stellar.org") + .unwrap_or(&"https://horizon.stellar.org"); } "https://horizon.stellar.org" @@ -180,7 +180,7 @@ impl HorizonClient for reqwest::Client { if sleep_duration < u64::from(max_backoff_delay_in_secs) { backoff_delay_counter += 1; } - continue + continue; }, Err(Error::HorizonSubmissionError { @@ -200,7 +200,7 @@ impl HorizonClient for reqwest::Client { reason, result_code_op, envelope_xdr, - }) + }); }, other => return other, @@ -270,7 +270,7 @@ impl HorizonFetcher { future::join(issue_map.read(), memos_to_issue_ids.read()).await; if issue_map.is_empty() || memos_to_issue_ids.is_empty() { - return Ok(last_cursor) + return Ok(last_cursor); } let mut txs_iter = self.fetch_transactions_iter(last_cursor).await?; diff --git a/clients/wallet/src/horizon/responses.rs b/clients/wallet/src/horizon/responses.rs index a78cb12cc..a540fd63f 100644 --- a/clients/wallet/src/horizon/responses.rs +++ b/clients/wallet/src/horizon/responses.rs @@ -59,13 +59,13 @@ pub(crate) async fn interpret_response( "interpret_response(): response was a success but failed with conversion: {e:?}" ); Error::response_decode_error(status.as_u16(), &response_body) - }) + }); } let Ok(resp) = serde_json::from_slice::(&response_body) else { tracing::warn!("interpret_response(): cannot convert error response to json"); - return Err(Error::response_decode_error(status.as_u16(), &response_body)) + return Err(Error::response_decode_error(status.as_u16(), &response_body)); }; let status = @@ -279,7 +279,7 @@ impl TransactionResponse { .map_err(|_| Error::DecodeError)? .result { - return Ok(res.get_vec().to_vec()) + return Ok(res.get_vec().to_vec()); } Ok(vec![]) @@ -318,7 +318,7 @@ impl HorizonAccountResponse { for balance in &self.balances { if let Some(balance_asset) = balance.get_asset() { if &balance_asset == asset { - return true + return true; } } } @@ -345,7 +345,7 @@ impl HorizonBalance { /// returns what kind of asset the Balance is pub fn get_asset(&self) -> Option { if &self.asset_type == ASSET_TYPE_NATIVE.as_bytes() { - return Some(Asset::AssetTypeNative) + return Some(Asset::AssetTypeNative); } match Asset::from_asset_code(&self.asset_code.clone()?, &self.asset_issuer.clone()?) { @@ -490,7 +490,7 @@ impl TransactionsResponseIter { // returns the first transaction response of the list fn get_top_record(&mut self) -> Option { if !self.is_empty() { - return Some(self.records.remove(0)) + return Some(self.records.remove(0)); } None } @@ -515,7 +515,7 @@ impl TransactionsResponseIter { pub fn middle(&mut self) -> Option { if !self.is_empty() { let idx = self.records.len() / 2; - return Some(self.records.remove(idx)) + return Some(self.records.remove(idx)); } None } diff --git a/clients/wallet/src/horizon/tests.rs b/clients/wallet/src/horizon/tests.rs index 7949f6003..60e9b2bb1 100644 --- a/clients/wallet/src/horizon/tests.rs +++ b/clients/wallet/src/horizon/tests.rs @@ -210,7 +210,7 @@ async fn fetch_horizon_and_process_new_transactions_success() { let mut iter = fetcher.fetch_transactions_iter(0).await.expect("should return a response"); let Some(response) = iter.next_back() else { assert!(false, "should have at least one transaction"); - return + return; }; let slot = response.ledger(); diff --git a/clients/wallet/src/operations.rs b/clients/wallet/src/operations.rs index 1550a60a7..d06763d0a 100644 --- a/clients/wallet/src/operations.rs +++ b/clients/wallet/src/operations.rs @@ -84,12 +84,14 @@ pub trait RedeemOperationsExt: HorizonClient { // if account exists and trustline exists, use normal payment operation Ok(account) if account.is_trustline_exist(&to_be_redeemed_asset) => // normal operation + { create_payment_operation( destination_address, to_be_redeemed_asset.clone(), to_be_redeemed_amount, source_address, - ), + ) + }, // if account exists and NO trustline, use claimable balance operation Ok(_) => claimable_balance_operation(), // if INactive account... @@ -97,8 +99,8 @@ pub trait RedeemOperationsExt: HorizonClient { let to_be_redeemed_amount_u128 = stellar_stroops_to_u128(to_be_redeemed_amount); // ... and redeeming amount >= 1 XLM, use create account operation - if to_be_redeemed_asset == Asset::AssetTypeNative && - to_be_redeemed_amount_u128 >= + if to_be_redeemed_asset == Asset::AssetTypeNative + && to_be_redeemed_amount_u128 >= // It's okay to use the default here because the Stellar decimals are the same primitives::DefaultDecimalsLookup::one( primitives::CurrencyId::StellarNative, diff --git a/clients/wallet/src/resubmissions.rs b/clients/wallet/src/resubmissions.rs index 4e44b388e..7b7760963 100644 --- a/clients/wallet/src/resubmissions.rs +++ b/clients/wallet/src/resubmissions.rs @@ -33,10 +33,11 @@ impl StellarWallet { None => { debug!("try_stop_periodic_resubmission_of_transactions(): no schedule to stop"); }, - Some(sender) => + Some(sender) => { if let Err(e) = sender.send(()).await { warn!("try_stop_periodic_resubmission_of_transactions(): failed to send a stop message to scheduler: {e:?}"); - }, + } + }, } } /// reads in storage the failed (but recoverable) transactions and submit again to Stellar. @@ -87,7 +88,7 @@ impl StellarWallet { }, Err(errors) => { warn!("_resubmit_transactions_from_cache(): errors from cache: {errors:?}"); - return + return; }, }; @@ -98,7 +99,7 @@ impl StellarWallet { // there's nothing to resubmit if envelopes.is_empty() { - return + return; } info!( "_resubmit_transactions_from_cache(): resubmitting {:?} envelopes in cache...", @@ -150,8 +151,9 @@ impl StellarWallet { Ok(None) => self.remove_tx_envelope_from_cache(&env), // Resubmission was successful - Ok(Some(resp)) => - debug!("handle_errors(): successfully processed envelope: {resp:?}"), + Ok(Some(resp)) => { + debug!("handle_errors(): successfully processed envelope: {resp:?}") + }, } } } @@ -168,12 +170,15 @@ impl StellarWallet { async fn handle_error(&self, error: Error) -> Result, Error> { match &error { Error::HorizonSubmissionError { reason, envelope_xdr, .. } => match &reason[..] { - "tx_bad_seq" => - return self.handle_tx_bad_seq_error_with_xdr(envelope_xdr).await.map(Some), - "tx_internal_error" => - return self.handle_tx_internal_error(envelope_xdr).await.map(Some), - "tx_insufficient_fee" => - return self.handle_tx_insufficient_fee_error(envelope_xdr).await.map(Some), + "tx_bad_seq" => { + return self.handle_tx_bad_seq_error_with_xdr(envelope_xdr).await.map(Some) + }, + "tx_internal_error" => { + return self.handle_tx_internal_error(envelope_xdr).await.map(Some) + }, + "tx_insufficient_fee" => { + return self.handle_tx_insufficient_fee_error(envelope_xdr).await.map(Some) + }, _ => { if let Ok(env) = decode_to_envelope(envelope_xdr) { self.remove_tx_envelope_from_cache(&env); @@ -191,7 +196,7 @@ impl StellarWallet { return self .handle_tx_bad_seq_error_with_envelope(transaction_envelope.clone()) .await - .map(Some) + .map(Some); } warn!("handle_error(): SequenceNumberAlreadyUsed error but no envelope"); @@ -236,7 +241,7 @@ impl StellarWallet { tx.fee = MAXIMUM_TX_FEE; } - return self.bump_sequence_number_and_submit(tx).await + return self.bump_sequence_number_and_submit(tx).await; } error!("handle_tx_insufficient_fee_error(): Similar transaction already submitted. Skipping {:?}", tx); @@ -258,7 +263,7 @@ fn is_memo_match(tx1: &Transaction, tx2: &TransactionResponse) -> bool { let Memo::MemoText(tx_memo) = &tx1.memo else { return false }; if are_memos_eq(response_memo, tx_memo.get_vec()) { - return true + return true; } } false @@ -285,18 +290,18 @@ fn _check_transaction_match( // attacker could send a transaction to us with the target memo and we'd wrongly // assume that we already submitted this transaction. if !is_source_account_match(public_key, &tx_resp) { - return Err(None) + return Err(None); } let Ok(source_account_sequence) = tx_resp.source_account_sequence() else { warn!("_check_transaction_match(): cannot extract sequence number of transaction response: {tx_resp:?}"); - return Err(None) + return Err(None); }; // check if the sequence number is the same as this response if tx.seq_num == source_account_sequence { // Check if the transaction contains the memo we want to send - return Ok(is_memo_match(tx, &tx_resp)) + return Ok(is_memo_match(tx, &tx_resp)); } Err(Some(source_account_sequence)) @@ -367,7 +372,7 @@ async fn check_last_transaction_match( if tx_sequence_num < source_account_sequence { if let None = iter.jump_to_next_page().await { // there's no pages left, meaning there's no other transactions to compare - return Some(false) + return Some(false); } } }, @@ -399,7 +404,7 @@ impl StellarWallet { // The same envelope will be saved again using a different sequence number self.remove_tx_envelope_from_cache(&tx_envelope); - return self.bump_sequence_number_and_submit(tx).await + return self.bump_sequence_number_and_submit(tx).await; } error!("handle_tx_bad_seq_error_with_envelope(): Similar transaction already submitted. Skipping {:?}", tx); @@ -438,7 +443,7 @@ impl StellarWallet { Ok(iter) => iter, Err(e) => { warn!("is_transaction_already_submitted(): failed to get iterator: {e:?}"); - return false + return false; }, }; @@ -457,20 +462,20 @@ impl StellarWallet { // if the sequence number is GREATER than this response, // no other transaction will ever match with it. if tx_sequence_num > top_sequence_num { - break + break; } // check the middle response OR remove half of the responses that won't match. if let Some(result) = check_middle_transaction_match(&mut iter, tx, &own_public_key) { // if the middle response matched (both source account and sequence number), // return that result - return result + return result; } // if no match was found, check the last response OR jump to the next page if let Some(result) = check_last_transaction_match(&mut iter, tx, &own_public_key).await { - return result + return result; } // if no match was found, continue to the next response @@ -495,7 +500,7 @@ fn decode_to_envelope( ) -> Result { let Some(envelope_xdr) = envelope_xdr_as_str_opt else { warn!("handle_error(): no envelope_xdr found"); - return Err(ResubmissionError("no envelope_xdr".to_string())) + return Err(ResubmissionError("no envelope_xdr".to_string())); }; TransactionEnvelope::from_base64_xdr(envelope_xdr).map_err(|_| DecodeError) @@ -1003,7 +1008,7 @@ mod test { wallet.get_sequence().await.expect("should return a sequence"), seq_number + 2 ); - break + break; } } diff --git a/clients/wallet/src/stellar_wallet.rs b/clients/wallet/src/stellar_wallet.rs index 5af7de985..b0c2ab60a 100644 --- a/clients/wallet/src/stellar_wallet.rs +++ b/clients/wallet/src/stellar_wallet.rs @@ -233,7 +233,7 @@ impl StellarWallet { pub fn remove_tx_envelope_from_cache(&self, tx_envelope: &TransactionEnvelope) { if let Some(sequence) = tx_envelope.sequence_number() { - return self.cache.remove_tx_envelope(sequence) + return self.cache.remove_tx_envelope(sequence); } tracing::warn!("remove_tx_envelope_from_cache(): cannot find sequence number in transaction envelope: {tx_envelope:?}"); @@ -348,7 +348,7 @@ impl StellarWallet { ) -> Result { // user must not send to self if self.secret_key.get_public() == &destination_address { - return Err(Error::SelfPaymentError) + return Err(Error::SelfPaymentError); } // create payment operation diff --git a/clients/wallet/src/task.rs b/clients/wallet/src/task.rs index 0bc78606d..f81a04ca9 100644 --- a/clients/wallet/src/task.rs +++ b/clients/wallet/src/task.rs @@ -86,7 +86,7 @@ impl SlotTask { tracing::trace!("Creating new sender for failed task of slot {}", self.slot); self.latest_status = SlotTaskStatus::Ready; - return Some(sender) + return Some(sender); } } diff --git a/pallets/clients-info/Cargo.toml b/pallets/clients-info/Cargo.toml index 038c1a0b9..72b2471fb 100644 --- a/pallets/clients-info/Cargo.toml +++ b/pallets/clients-info/Cargo.toml @@ -10,15 +10,15 @@ scale-info = {version = "2.2.0", default-features = false, features = ["derive"] serde = {version = "1.0.130", default-features = false, features = ["derive"], optional = true} # Substrate dependencies -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } [features] default = ["std"] diff --git a/pallets/clients-info/src/mock.rs b/pallets/clients-info/src/mock.rs index 0a1c7f554..b2ca84b0c 100644 --- a/pallets/clients-info/src/mock.rs +++ b/pallets/clients-info/src/mock.rs @@ -6,29 +6,22 @@ use frame_support::{ }; use sp_core::H256; use sp_runtime::{ - generic::Header as GenericHeader, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; -type Header = GenericHeader; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - ClientsInfo: clients_info::{Pallet, Call, Storage, Event} + pub enum Test { + System: frame_system, + ClientsInfo: clients_info } ); pub type AccountId = u64; -pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; pub type TestError = Error; parameter_types! { @@ -37,19 +30,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -74,7 +66,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/currency/Cargo.toml b/pallets/currency/Cargo.toml index 06fb19de4..d0519e38d 100644 --- a/pallets/currency/Cargo.toml +++ b/pallets/currency/Cargo.toml @@ -11,29 +11,29 @@ serde = { version = "1.0.130", default-features = false, features = ["derive"], codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } # for other pallets wanting to mock functions mocktopus = { version = "0.8.0", optional = true } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/currency/src/amount.rs b/pallets/currency/src/amount.rs index bfb7dd8be..9a9398ebf 100644 --- a/pallets/currency/src/amount.rs +++ b/pallets/currency/src/amount.rs @@ -5,10 +5,7 @@ forgetting_references, forgetting_copy_types )] -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError}; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use sp_runtime::{ traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, UniqueSaturatedInto, Zero}, @@ -92,7 +89,7 @@ mod math { pub fn ensure_is_compatible_with_target_chain(&self) -> Result<(), DispatchError> { if !T::AmountCompatibility::is_compatible_with_target(self.amount) { - return Err(Error::::IncompatibleAmount.into()) + return Err(Error::::IncompatibleAmount.into()); } Ok(()) } @@ -115,7 +112,7 @@ mod math { F: Fn(&BalanceOf, &BalanceOf) -> Option>, { if self.currency_id != other.currency_id { - return Err(Error::::InvalidCurrency.into()) + return Err(Error::::InvalidCurrency.into()); } let amount = f(&self.amount, &other.amount).ok_or(err)?; diff --git a/pallets/currency/src/lib.rs b/pallets/currency/src/lib.rs index cd236940c..33d59f2db 100644 --- a/pallets/currency/src/lib.rs +++ b/pallets/currency/src/lib.rs @@ -154,9 +154,9 @@ impl Pallet { let Claimant::ClaimantTypeV0(claimant) = payment.claimants.get_vec()[0].clone(); - if claimant.destination.eq(&recipient_account_pk) && - payment.asset == asset && claimant.predicate == - ClaimPredicate::ClaimPredicateUnconditional + if claimant.destination.eq(&recipient_account_pk) + && payment.asset == asset && claimant.predicate + == ClaimPredicate::ClaimPredicateUnconditional { transferred_amount = transferred_amount.saturating_add(payment.amount); } diff --git a/pallets/currency/src/mock.rs b/pallets/currency/src/mock.rs index 7b59ebe9d..b71e6cf93 100644 --- a/pallets/currency/src/mock.rs +++ b/pallets/currency/src/mock.rs @@ -7,30 +7,26 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use crate::testing_constants::{DEFAULT_COLLATERAL_CURRENCY, DEFAULT_NATIVE_CURRENCY}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { // substrate pallets - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + System: frame_system, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, // Operational - Currency: crate::{Pallet}, + Currency: crate, } ); @@ -42,7 +38,7 @@ pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type CurrencyId = primitives::CurrencyId; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; parameter_types! { pub const BlockHashCount: u64 = 250; @@ -50,19 +46,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -96,7 +91,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } parameter_types! { @@ -188,7 +183,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); sp_io::TestExternalities::from(storage) } diff --git a/pallets/currency/src/types.rs b/pallets/currency/src/types.rs index e6cd1dbc7..5e99cfb22 100644 --- a/pallets/currency/src/types.rs +++ b/pallets/currency/src/types.rs @@ -1,4 +1,5 @@ -use frame_support::dispatch::DispatchError; +use frame_support::sp_runtime::DispatchError; + use orml_traits::MultiCurrency; use crate::Config; diff --git a/pallets/fee/Cargo.toml b/pallets/fee/Cargo.toml index 9e503c22d..797998ad8 100644 --- a/pallets/fee/Cargo.toml +++ b/pallets/fee/Cargo.toml @@ -11,16 +11,16 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } # Substrate dependencies -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies currency = { path = "../currency", default-features = false } @@ -35,15 +35,15 @@ primitives = { package = "spacewalk-primitives", path = "../../primitives", defa [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } security = { path = "../security", features = ['testing-utils'] } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/fee/src/lib.rs b/pallets/fee/src/lib.rs index 0e6ce40f3..162e3b532 100644 --- a/pallets/fee/src/lib.rs +++ b/pallets/fee/src/lib.rs @@ -11,9 +11,7 @@ use mocktopus::macros::mockable; use codec::EncodeLike; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - traits::Get, - transactional, PalletId, + dispatch::DispatchResult, sp_runtime::DispatchError, traits::Get, transactional, PalletId, }; use sp_arithmetic::{traits::*, FixedPointNumber, FixedPointOperand}; use sp_runtime::traits::{AccountIdConversion, AtLeast32BitUnsigned}; @@ -121,7 +119,7 @@ pub mod pallet { type VaultStaking: staking::Staking< DefaultVaultId, Self::AccountId, - Self::Index, + Self::Nonce, BalanceOf, Self::CurrencyId, >; @@ -202,7 +200,6 @@ pub mod pallet { pub replace_griefing_collateral: UnsignedFixedPoint, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { Self { @@ -217,7 +214,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { IssueFee::::put(self.issue_fee); IssueGriefingCollateral::::put(self.issue_griefing_collateral); diff --git a/pallets/fee/src/mock.rs b/pallets/fee/src/mock.rs index 620cabbbf..03dd716f1 100644 --- a/pallets/fee/src/mock.rs +++ b/pallets/fee/src/mock.rs @@ -9,9 +9,8 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup, Zero}, - DispatchError, FixedPointNumber, Perquintill, + BuildStorage, DispatchError, FixedPointNumber, Perquintill, }; use crate as fee; @@ -20,31 +19,27 @@ pub use currency::testing_constants::{DEFAULT_COLLATERAL_CURRENCY, DEFAULT_NATIV pub use primitives::CurrencyId; use primitives::VaultId; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, + Rewards: pooled_rewards, + Staking: staking, + RewardDistribution: reward_distribution, // Operational - Security: security::{Pallet, Call, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, + Security: security, + Fee: fee, } ); @@ -53,7 +48,7 @@ pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -65,19 +60,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -111,7 +105,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } pub type Amount = i128; @@ -291,7 +285,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/issue/Cargo.toml b/pallets/issue/Cargo.toml index eb3ad89dd..7217276cb 100644 --- a/pallets/issue/Cargo.toml +++ b/pallets/issue/Cargo.toml @@ -14,17 +14,17 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive" log = { version = "0.4.14", default-features = false } # Substrate dependencies -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies currency = { path = "../currency", default-features = false } @@ -39,13 +39,13 @@ reward-distribution = { path = "../reward-distribution", default-features = fals primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } nomination = {path = "../nomination", default-features = false} currency = { path = "../currency", features = ['testing-utils', 'testing-constants'] } @@ -56,8 +56,8 @@ security = { path = "../security", features = ['testing-utils'] } oracle = { path = "../oracle", features = ['testing-utils'] } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } [features] diff --git a/pallets/issue/rpc/Cargo.toml b/pallets/issue/rpc/Cargo.toml index 15c373431..0e5250146 100644 --- a/pallets/issue/rpc/Cargo.toml +++ b/pallets/issue/rpc/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } jsonrpsee = { version = "0.16.0", features = ["client", "server", "macros"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } module-issue-rpc-runtime-api = { path = "runtime-api" } diff --git a/pallets/issue/rpc/runtime-api/Cargo.toml b/pallets/issue/rpc/runtime-api/Cargo.toml index 28109c866..89510da17 100644 --- a/pallets/issue/rpc/runtime-api/Cargo.toml +++ b/pallets/issue/rpc/runtime-api/Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/issue/src/benchmarking.rs b/pallets/issue/src/benchmarking.rs index 76a3be51b..948e15d14 100644 --- a/pallets/issue/src/benchmarking.rs +++ b/pallets/issue/src/benchmarking.rs @@ -7,6 +7,7 @@ use sp_runtime::{traits::One, FixedPointNumber}; use sp_std::prelude::*; use currency::getters::{get_relay_chain_currency_id as get_collateral_currency_id, *}; +use frame_system::pallet_prelude::BlockNumberFor; use oracle::Pallet as Oracle; use primitives::{CurrencyId, VaultCurrencyPair, VaultId}; use security::Pallet as Security; @@ -113,7 +114,7 @@ benchmarks! { Security::::set_active_block_number(1u32.into()); let (validators, organizations) = get_validators_and_organizations::(); - let enactment_block_height = T::BlockNumber::default(); + let enactment_block_height = BlockNumberFor::::default(); StellarRelay::::_update_tier_1_validator_set(validators, organizations, enactment_block_height).unwrap(); let public_network = ::IsPublicNetwork::get(); let (tx_env_xdr_encoded, scp_envs_xdr_encoded, tx_set_xdr_encoded) = build_dummy_proof_for::(issue_id, public_network); @@ -174,7 +175,7 @@ benchmarks! { rate_limit_update { let limit_volume_amount: Option> = Some(1u32.into()); let limit_volume_currency_id: T::CurrencyId = get_wrapped_currency_id::(); - let interval_length: T::BlockNumber = 1u32.into(); + let interval_length: BlockNumberFor = 1u32.into(); }: _(RawOrigin::Root, limit_volume_amount, limit_volume_currency_id, interval_length) minimum_transfer_amount_update { diff --git a/pallets/issue/src/default_weights.rs b/pallets/issue/src/default_weights.rs index 393fd97cd..1f83ca588 100644 --- a/pallets/issue/src/default_weights.rs +++ b/pallets/issue/src/default_weights.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-05-23, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-04-02, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `Bogdans-M2-MacBook-Pro.local`, CPU: `` //! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 @@ -77,8 +77,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2192` // Estimated: `5657` - // Minimum execution time: 55_000_000 picoseconds. - Weight::from_parts(58_000_000, 5657) + // Minimum execution time: 57_000_000 picoseconds. + Weight::from_parts(60_000_000, 5657) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -104,8 +104,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2190` // Estimated: `71867` - // Minimum execution time: 3_926_000_000 picoseconds. - Weight::from_parts(3_982_000_000, 71867) + // Minimum execution time: 3_807_000_000 picoseconds. + Weight::from_parts(3_911_000_000, 71867) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -121,8 +121,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1199` // Estimated: `4664` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4664) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4664) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -146,8 +146,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Issue IssueMinimumTransferAmount (r:0 w:1) @@ -156,7 +156,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. + // Minimum execution time: 4_000_000 picoseconds. Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -200,8 +200,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2192` // Estimated: `5657` - // Minimum execution time: 55_000_000 picoseconds. - Weight::from_parts(58_000_000, 5657) + // Minimum execution time: 57_000_000 picoseconds. + Weight::from_parts(60_000_000, 5657) .saturating_add(RocksDbWeight::get().reads(15_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2190` // Estimated: `71867` - // Minimum execution time: 3_926_000_000 picoseconds. - Weight::from_parts(3_982_000_000, 71867) + // Minimum execution time: 3_807_000_000 picoseconds. + Weight::from_parts(3_911_000_000, 71867) .saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -244,8 +244,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1199` // Estimated: `4664` - // Minimum execution time: 23_000_000 picoseconds. - Weight::from_parts(24_000_000, 4664) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(25_000_000, 4664) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -269,8 +269,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(5_000_000, 0) + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Issue IssueMinimumTransferAmount (r:0 w:1) @@ -279,7 +279,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. + // Minimum execution time: 4_000_000 picoseconds. Weight::from_parts(4_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/issue/src/ext.rs b/pallets/issue/src/ext.rs index 90c1e71cc..858e98e83 100644 --- a/pallets/issue/src/ext.rs +++ b/pallets/issue/src/ext.rs @@ -66,12 +66,13 @@ pub(crate) mod stellar_relay { #[cfg_attr(test, mockable)] pub(crate) mod security { + use frame_system::pallet_prelude::BlockNumberFor; use sp_core::H256; use sp_runtime::DispatchError; pub fn parachain_block_expired( - opentime: T::BlockNumber, - period: T::BlockNumber, + opentime: BlockNumberFor, + period: BlockNumberFor, ) -> Result { >::parachain_block_expired(opentime, period) } @@ -80,14 +81,14 @@ pub(crate) mod security { >::get_secure_id() } - pub fn active_block_number() -> T::BlockNumber { + pub fn active_block_number() -> BlockNumberFor { >::active_block_number() } } #[cfg_attr(test, mockable)] pub(crate) mod vault_registry { - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use primitives::StellarPublicKeyRaw; use vault_registry::{ @@ -171,7 +172,7 @@ pub(crate) mod vault_registry { #[cfg_attr(test, mockable)] pub(crate) mod fee { - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use currency::Amount; diff --git a/pallets/issue/src/lib.rs b/pallets/issue/src/lib.rs index e4d3dbe11..0d08807e4 100644 --- a/pallets/issue/src/lib.rs +++ b/pallets/issue/src/lib.rs @@ -8,7 +8,8 @@ #[cfg(test)] extern crate mocktopus; -use frame_support::{dispatch::DispatchError, ensure, traits::Get, transactional}; +use frame_support::{ensure, sp_runtime::DispatchError, traits::Get, transactional}; +use frame_system::pallet_prelude::BlockNumberFor; #[cfg(test)] use mocktopus::macros::mockable; use primitives::{ @@ -22,9 +23,6 @@ use sp_core::H256; use sp_runtime::traits::{CheckedDiv, Convert, Saturating, Zero}; use sp_std::vec::Vec; -#[cfg(feature = "std")] -use std::str::FromStr; - use currency::Amount; pub use default_weights::{SubstrateWeight, WeightInfo}; pub use pallet::*; @@ -71,7 +69,7 @@ pub mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Convert the block number into a balance. - type BlockNumberToBalance: Convert>; + type BlockNumberToBalance: Convert, BalanceOf>; // Weight information for the extrinsics in this module. type WeightInfo: WeightInfo; @@ -111,12 +109,12 @@ pub mod pallet { griefing_collateral: BalanceOf, }, IssuePeriodChange { - period: T::BlockNumber, + period: BlockNumberFor, }, RateLimitUpdate { limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, }, IssueMinimumTransferAmountUpdate { new_minimum_amount: BalanceOf, @@ -155,7 +153,7 @@ pub mod pallet { /// to prevent griefing of vault collateral. #[pallet::storage] #[pallet::getter(fn issue_period)] - pub(super) type IssuePeriod = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type IssuePeriod = StorageValue<_, BlockNumberFor, ValueQuery>; /// The minimum amount of wrapped assets that is required for issue requests #[pallet::storage] @@ -176,24 +174,23 @@ pub mod pallet { /// Represent interval define regular 24 hour intervals (every 24 * 3600 / 12 blocks) #[pallet::storage] - pub(super) type IntervalLength = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type IntervalLength = StorageValue<_, BlockNumberFor, ValueQuery>; /// Represent current interval current_block_number / IntervalLength #[pallet::storage] - pub(super) type LastIntervalIndex = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type LastIntervalIndex = StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::genesis_config] pub struct GenesisConfig { - pub issue_period: T::BlockNumber, + pub issue_period: BlockNumberFor, pub issue_minimum_transfer_amount: BalanceOf, pub limit_volume_amount: Option>, pub limit_volume_currency_id: T::CurrencyId, pub current_volume_amount: BalanceOf, - pub interval_length: T::BlockNumber, - pub last_interval_index: T::BlockNumber, + pub interval_length: BlockNumberFor, + pub last_interval_index: BlockNumberFor, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { const SECONDS_PER_BLOCK: u32 = 12; @@ -207,17 +204,14 @@ pub mod pallet { limit_volume_amount: None, limit_volume_currency_id: T::CurrencyId::default(), current_volume_amount: BalanceOf::::zero(), - interval_length: T::BlockNumber::from_str( - &(DAY_IN_SECONDS / SECONDS_PER_BLOCK).to_string(), - ) - .unwrap_or_default(), - last_interval_index: T::BlockNumber::zero(), + interval_length: (DAY_IN_SECONDS / SECONDS_PER_BLOCK).into(), + last_interval_index: BlockNumberFor::::zero(), } } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { IssuePeriod::::put(self.issue_period); IssueMinimumTransferAmount::::put(self.issue_minimum_transfer_amount); @@ -322,7 +316,7 @@ pub mod pallet { #[transactional] pub fn set_issue_period( origin: OriginFor, - period: T::BlockNumber, + period: BlockNumberFor, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; >::set(period); @@ -337,7 +331,7 @@ pub mod pallet { origin: OriginFor, limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; Self::_rate_limit_update( @@ -374,7 +368,7 @@ impl Pallet { pub fn _rate_limit_update( limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, ) { >::set(limit_volume_amount); >::set(limit_volume_currency_id); @@ -557,7 +551,7 @@ impl Pallet { // TODO: update `issue.griefing_collateral`? slashed_collateral } else { - return Err(Error::::TimeNotExpired.into()) + return Err(Error::::TimeNotExpired.into()); }; if ext::vault_registry::is_vault_liquidated::(&issue.vault)? { @@ -760,8 +754,8 @@ impl Pallet { fn check_volume(amount_requested: Amount) -> Result<(), DispatchError> { let limit_volume: Option> = LimitVolumeAmount::::get(); if let Some(limit_volume) = limit_volume { - let current_block: T::BlockNumber = >::block_number(); - let interval_length: T::BlockNumber = IntervalLength::::get(); + let current_block: BlockNumberFor = >::block_number(); + let interval_length: BlockNumberFor = IntervalLength::::get(); let current_index = current_block.checked_div(&interval_length); let mut current_volume = BalanceOf::::zero(); @@ -869,8 +863,8 @@ impl Pallet { expected_total_amount, )? } else { - if amount_transferred.gt(&expected_total_amount)? && - !ext::vault_registry::is_vault_liquidated::(&issue.vault)? + if amount_transferred.gt(&expected_total_amount)? + && !ext::vault_registry::is_vault_liquidated::(&issue.vault)? { Self::try_increase_issue_amount( issue_id, diff --git a/pallets/issue/src/mock.rs b/pallets/issue/src/mock.rs index c0ddb05cf..b9bc0de91 100644 --- a/pallets/issue/src/mock.rs +++ b/pallets/issue/src/mock.rs @@ -1,6 +1,6 @@ use frame_support::{ assert_ok, parameter_types, - traits::{ConstU32, ConstU64, Everything, GenesisBuild}, + traits::{ConstU32, ConstU64, Everything}, PalletId, }; use mocktopus::{macros::mockable, mocking::clear_mocks}; @@ -16,9 +16,9 @@ use primitives::CurrencyId::XCM; use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::{Header, TestXt}, + testing::TestXt, traits::{BlakeTwo256, Convert, IdentityLookup, One, Zero}, - DispatchError, Perquintill, + BuildStorage, DispatchError, Perquintill, }; pub use currency::{ @@ -35,36 +35,32 @@ use crate as issue; use crate::{Config, Error}; type TestExtrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, + RewardDistribution: reward_distribution, + Rewards: pooled_rewards, // Operational - Currency: currency::{Pallet}, - StellarRelay: stellar_relay::{Pallet, Call, Config, Storage, Event}, - Security: security::{Pallet, Call, Storage, Event}, - Issue: issue::{Pallet, Call, Config, Storage, Event}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Staking: staking::{Pallet, Storage, Event}, - Nomination: nomination::{Pallet, Call, Config, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event}, + Currency: currency, + StellarRelay: stellar_relay, + Security: security, + Issue: issue, + Oracle: oracle, + Fee: fee, + Staking: staking, + Nomination: nomination, + VaultRegistry: vault_registry, } ); @@ -73,7 +69,7 @@ pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -85,19 +81,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -131,7 +126,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -459,7 +454,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build_with(balances: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); balances.assimilate_storage(&mut storage).unwrap(); @@ -476,11 +471,9 @@ impl ExtBuilder { .assimilate_storage(&mut storage) .unwrap(); - frame_support::traits::GenesisBuild::::assimilate_storage( - &nomination::GenesisConfig { is_nomination_enabled: true }, - &mut storage, - ) - .unwrap(); + nomination::GenesisConfig:: { is_nomination_enabled: true, ..Default::default() } + .assimilate_storage(&mut storage) + .unwrap(); fee::GenesisConfig:: { issue_fee: UnsignedFixedPoint::checked_from_rational(5, 1000).unwrap(), // 0.5% diff --git a/pallets/issue/src/tests.rs b/pallets/issue/src/tests.rs index ea9f36bdb..3d2ea2531 100644 --- a/pallets/issue/src/tests.rs +++ b/pallets/issue/src/tests.rs @@ -1,4 +1,4 @@ -use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; +use frame_support::{assert_noop, assert_ok, sp_runtime::DispatchError}; use mocktopus::mocking::*; use sp_arithmetic::FixedU128; use sp_core::H256; @@ -926,7 +926,7 @@ mod integration_tests { //Vault 1 and 4 share and vault 2 and 5 share the same wrapped currency //so we must take into account the combined issuance of these pairs - return (issue_fee_1 + issue_fee_4, issue_fee_2 + issue_fee_5, issue_fee_3) + return (issue_fee_1 + issue_fee_4, issue_fee_2 + issue_fee_5, issue_fee_3); } #[test] @@ -972,43 +972,43 @@ mod integration_tests { let vault_4_collateral_usd = to_usd(&collateral_4, &VAULT_4.collateral_currency()); let vault_5_collateral_usd = to_usd(&collateral_5, &VAULT_5.collateral_currency()); - let total_amount_usd = vault_1_collateral_usd + - vault_2_collateral_usd + - vault_3_collateral_usd + - vault_4_collateral_usd + - vault_5_collateral_usd; + let total_amount_usd = vault_1_collateral_usd + + vault_2_collateral_usd + + vault_3_collateral_usd + + vault_4_collateral_usd + + vault_5_collateral_usd; // In order to calculate the value corresponding to each vault on the pool, // we must take into account that vault 1 and 2, vault 3 and 4 share the same // collateral, so in the calculations for the pooled rewards, these must be grouped let get_expected_value_vault_1 = |fee: Balance| -> Balance { - ((((vault_1_collateral_usd + vault_2_collateral_usd) as f64 / - total_amount_usd as f64) * - fee as f64) + ((((vault_1_collateral_usd + vault_2_collateral_usd) as f64 + / total_amount_usd as f64) + * fee as f64) .floor() * (collateral_1 as f64 / (collateral_2 + collateral_1) as f64)) .floor() as u128 }; let get_expected_value_vault_2 = |fee: Balance| -> Balance { - ((((vault_1_collateral_usd + vault_2_collateral_usd) as f64 / - total_amount_usd as f64) * - fee as f64) + ((((vault_1_collateral_usd + vault_2_collateral_usd) as f64 + / total_amount_usd as f64) + * fee as f64) .floor() * (collateral_2 as f64 / (collateral_2 + collateral_1) as f64)) .floor() as u128 }; let get_expected_value_vault_3 = |fee: Balance| -> Balance { - ((((vault_3_collateral_usd + vault_4_collateral_usd) as f64 / - total_amount_usd as f64) * - fee as f64) + ((((vault_3_collateral_usd + vault_4_collateral_usd) as f64 + / total_amount_usd as f64) + * fee as f64) .floor() * (collateral_3 as f64 / (collateral_3 + collateral_4) as f64)) .floor() as u128 }; let get_expected_value_vault_4 = |fee: Balance| -> Balance { - ((((vault_3_collateral_usd + vault_4_collateral_usd) as f64 / - total_amount_usd as f64) * - fee as f64) + ((((vault_3_collateral_usd + vault_4_collateral_usd) as f64 + / total_amount_usd as f64) + * fee as f64) .floor() * (collateral_4 as f64 / (collateral_3 + collateral_4) as f64)) .floor() as u128 }; @@ -1149,47 +1149,47 @@ mod integration_tests { let vault_4_collateral_usd = to_usd(&collateral_4, &VAULT_4.collateral_currency()); let vault_5_collateral_usd = to_usd(&collateral_5, &VAULT_5.collateral_currency()); - let total_amount_usd = vault_1_collateral_usd + - nominator_amount_usd + - vault_2_collateral_usd + - vault_3_collateral_usd + - vault_4_collateral_usd + - vault_5_collateral_usd; + let total_amount_usd = vault_1_collateral_usd + + nominator_amount_usd + + vault_2_collateral_usd + + vault_3_collateral_usd + + vault_4_collateral_usd + + vault_5_collateral_usd; let reward_for_pool_1_asset_1 = ((((vault_1_collateral_usd + vault_2_collateral_usd + nominator_amount_usd) - as f64 / total_amount_usd as f64) * - issue_fee_1 as f64) - .floor() * ((collateral_1 + nominator_amount) as f64 / - (collateral_1 + collateral_2 + nominator_amount) as f64)) + as f64 / total_amount_usd as f64) + * issue_fee_1 as f64) + .floor() * ((collateral_1 + nominator_amount) as f64 + / (collateral_1 + collateral_2 + nominator_amount) as f64)) .floor(); - let reward_for_nominator_asset_1 = (reward_for_pool_1_asset_1 * - (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) + let reward_for_nominator_asset_1 = (reward_for_pool_1_asset_1 + * (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) as u128; let reward_for_pool_1_asset_2 = ((((vault_1_collateral_usd + vault_2_collateral_usd + nominator_amount_usd) - as f64 / total_amount_usd as f64) * - issue_fee_2 as f64) - .floor() * ((collateral_1 + nominator_amount) as f64 / - (collateral_1 + collateral_2 + nominator_amount) as f64)) + as f64 / total_amount_usd as f64) + * issue_fee_2 as f64) + .floor() * ((collateral_1 + nominator_amount) as f64 + / (collateral_1 + collateral_2 + nominator_amount) as f64)) .floor(); - let reward_for_nominator_asset_2 = (reward_for_pool_1_asset_2 * - (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) + let reward_for_nominator_asset_2 = (reward_for_pool_1_asset_2 + * (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) as u128; let reward_for_pool_1_asset_3 = ((((vault_1_collateral_usd + vault_2_collateral_usd + nominator_amount_usd) - as f64 / total_amount_usd as f64) * - issue_fee_3 as f64) - .floor() * ((collateral_1 + nominator_amount) as f64 / - (collateral_1 + collateral_2 + nominator_amount) as f64)) + as f64 / total_amount_usd as f64) + * issue_fee_3 as f64) + .floor() * ((collateral_1 + nominator_amount) as f64 + / (collateral_1 + collateral_2 + nominator_amount) as f64)) .floor(); - let reward_for_nominator_asset_3 = (reward_for_pool_1_asset_3 * - (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) + let reward_for_nominator_asset_3 = (reward_for_pool_1_asset_3 + * (nominator_amount as f64 / (nominator_amount + collateral_1) as f64)) as u128; assert_ok!(>::collect_reward( diff --git a/pallets/issue/src/types.rs b/pallets/issue/src/types.rs index 776d1385f..edf300614 100644 --- a/pallets/issue/src/types.rs +++ b/pallets/issue/src/types.rs @@ -1,6 +1,7 @@ use frame_support::traits::Get; use currency::Amount; +pub use frame_system::pallet_prelude::BlockNumberFor; pub use primitives::issue::{IssueRequest, IssueRequestStatus}; use primitives::VaultId; pub use vault_registry::types::CurrencyId; @@ -12,7 +13,7 @@ pub(crate) type DefaultVaultId = VaultId<::Account pub type DefaultIssueRequest = IssueRequest< ::AccountId, - ::BlockNumber, + BlockNumberFor, BalanceOf, CurrencyId, >; diff --git a/pallets/nomination/Cargo.toml b/pallets/nomination/Cargo.toml index 0bb18e2a5..7f1bcfefe 100644 --- a/pallets/nomination/Cargo.toml +++ b/pallets/nomination/Cargo.toml @@ -10,17 +10,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } # Substrate dependencies -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies currency = { path = "../currency", default-features = false } @@ -35,21 +35,21 @@ reward-distribution = { path = "../reward-distribution", default-features = fals primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } security = { path = "../security", features = ['testing-utils'] } oracle = { path = "../oracle", features = ['testing-utils'] } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/nomination/src/ext.rs b/pallets/nomination/src/ext.rs index 9a0366f62..594e5b431 100644 --- a/pallets/nomination/src/ext.rs +++ b/pallets/nomination/src/ext.rs @@ -14,7 +14,7 @@ pub(crate) mod security { pub(crate) mod vault_registry { use crate::BalanceOf; use currency::Amount; - pub use frame_support::dispatch::{DispatchError, DispatchResult}; + pub use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use vault_registry::{types::DefaultVaultCurrencyPair, DefaultVaultId}; pub fn get_backing_collateral( @@ -76,7 +76,7 @@ pub(crate) mod vault_registry { vault_id: &DefaultVaultId, nominator_id: &T::AccountId, maybe_amount: &Amount, - nonce: Option, + nonce: Option, ) -> Result<(), DispatchError> { >::withdraw_collateral( vault_id, @@ -97,11 +97,11 @@ pub(crate) mod vault_registry { #[cfg_attr(test, mockable)] pub(crate) mod staking { use crate::BalanceOf; - use frame_support::dispatch::DispatchError; + use frame_support::sp_runtime::DispatchError; use staking::Staking; use vault_registry::DefaultVaultId; - pub fn nonce(vault_id: &DefaultVaultId) -> T::Index { + pub fn nonce(vault_id: &DefaultVaultId) -> T::Nonce { T::VaultStaking::nonce(vault_id) } diff --git a/pallets/nomination/src/lib.rs b/pallets/nomination/src/lib.rs index d70ec3b30..32bd2ab6e 100644 --- a/pallets/nomination/src/lib.rs +++ b/pallets/nomination/src/lib.rs @@ -25,10 +25,7 @@ mod default_weights; pub use default_weights::{SubstrateWeight, WeightInfo}; use currency::Amount; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, transactional, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError, transactional}; use frame_system::{ensure_root, ensure_signed}; pub use pallet::*; use primitives::VaultId; @@ -98,7 +95,7 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} /// Flag indicating whether this feature is enabled #[pallet::storage] @@ -111,13 +108,19 @@ pub mod pallet { StorageMap<_, Blake2_128Concat, DefaultVaultId, bool, ValueQuery>; #[pallet::genesis_config] - #[cfg_attr(feature = "std", derive(Default))] - pub struct GenesisConfig { + pub struct GenesisConfig { pub is_nomination_enabled: bool, + pub _phantom: sp_std::marker::PhantomData, + } + + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { is_nomination_enabled: false, _phantom: Default::default() } + } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { { NominationEnabled::::put(self.is_nomination_enabled); @@ -197,7 +200,7 @@ pub mod pallet { origin: OriginFor, vault_id: DefaultVaultId, amount: BalanceOf, - index: Option, + index: Option, ) -> DispatchResultWithPostInfo { let nominator_id = ensure_signed(origin)?; ext::security::ensure_parachain_status_running::()?; @@ -219,7 +222,7 @@ impl Pallet { vault_id: &DefaultVaultId, nominator_id: &T::AccountId, amount: BalanceOf, - index: T::Index, + index: T::Nonce, ) -> DispatchResult { let nonce = ext::staking::nonce::(vault_id); let index = sp_std::cmp::min(index, nonce); diff --git a/pallets/nomination/src/mock.rs b/pallets/nomination/src/mock.rs index 0f2616dcb..7df186a2d 100644 --- a/pallets/nomination/src/mock.rs +++ b/pallets/nomination/src/mock.rs @@ -1,6 +1,6 @@ use frame_support::{ assert_ok, parameter_types, - traits::{ConstU32, ConstU64, Everything, GenesisBuild}, + traits::{ConstU32, ConstU64, Everything}, PalletId, }; use mocktopus::{macros::mockable, mocking::clear_mocks}; @@ -9,9 +9,9 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::{Header, TestXt}, + testing::TestXt, traits::{BlakeTwo256, IdentityLookup, One, Zero}, - DispatchError, FixedPointNumber, Perquintill, + BuildStorage, DispatchError, FixedPointNumber, Perquintill, }; pub use currency::testing_constants::{ @@ -31,34 +31,30 @@ use crate as nomination; use crate::{Config, Error}; type TestExtrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, + Rewards: pooled_rewards, + RewardDistribution: reward_distribution, // Operational - Security: security::{Pallet, Call, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Nomination: nomination::{Pallet, Call, Config, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, - Currency: currency::{Pallet}, + Security: security, + VaultRegistry: vault_registry, + Fee: fee, + Oracle: oracle, + Nomination: nomination, + Staking: staking, + Currency: currency, } ); @@ -68,7 +64,7 @@ pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -80,18 +76,17 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type DbWeight = (); @@ -126,7 +121,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -374,7 +369,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build_with(balances: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); balances.assimilate_storage(&mut storage).unwrap(); @@ -391,10 +386,11 @@ impl ExtBuilder { .assimilate_storage(&mut storage) .unwrap(); - frame_support::traits::GenesisBuild::::assimilate_storage( - &nomination::GenesisConfig { is_nomination_enabled: true }, - &mut storage, - ) + nomination::GenesisConfig:: { + is_nomination_enabled: true, + _phantom: Default::default(), + } + .assimilate_storage(&mut storage) .unwrap(); fee::GenesisConfig:: { diff --git a/pallets/oracle/Cargo.toml b/pallets/oracle/Cargo.toml index dd40b3fbc..66c604de6 100644 --- a/pallets/oracle/Cargo.toml +++ b/pallets/oracle/Cargo.toml @@ -9,20 +9,20 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } # Substrate dependencies -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v0.9.42", default-features = false } +orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v1.1.0", default-features = false } # Parachain dependencies security = { path = "../security", default-features = false } @@ -36,15 +36,15 @@ once_cell = { version = "1.18.0", default-features = false, features = ["alloc", [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } security = { path = "../security", features = ['testing-utils'] } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/oracle/rpc/Cargo.toml b/pallets/oracle/rpc/Cargo.toml index d0058d135..83f8389d1 100644 --- a/pallets/oracle/rpc/Cargo.toml +++ b/pallets/oracle/rpc/Cargo.toml @@ -8,8 +8,8 @@ version = "1.0.10" codec = {package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"]} jsonrpsee = {version = "0.16.0", features = ["client","server", "macros"]} module-oracle-rpc-runtime-api = {path = "runtime-api"} -sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sp-blockchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} primitives = { package = "spacewalk-primitives", path = "../../../primitives", default-features = false } diff --git a/pallets/oracle/rpc/runtime-api/Cargo.toml b/pallets/oracle/rpc/runtime-api/Cargo.toml index 0a932ce91..5d6379e81 100644 --- a/pallets/oracle/rpc/runtime-api/Cargo.toml +++ b/pallets/oracle/rpc/runtime-api/Cargo.toml @@ -6,10 +6,10 @@ version = "1.0.10" [dependencies] codec = {package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"]} -frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +frame-support = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} serde = {version = "1.0.130", default-features = false, optional = true, features = ["derive"]} -sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-std = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } primitives = { package = "spacewalk-primitives", path = "../../../../primitives", default-features = false } diff --git a/pallets/oracle/rpc/runtime-api/src/lib.rs b/pallets/oracle/rpc/runtime-api/src/lib.rs index df9b3c541..32535fe78 100644 --- a/pallets/oracle/rpc/runtime-api/src/lib.rs +++ b/pallets/oracle/rpc/runtime-api/src/lib.rs @@ -2,7 +2,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Codec, Decode, Encode}; -use frame_support::dispatch::DispatchError; +use frame_support::sp_runtime::DispatchError; use primitives::UnsignedFixedPoint; use scale_info::TypeInfo; #[cfg(feature = "std")] diff --git a/pallets/oracle/src/dia.rs b/pallets/oracle/src/dia.rs index ccb52b36d..d97a86d6f 100644 --- a/pallets/oracle/src/dia.rs +++ b/pallets/oracle/src/dia.rs @@ -74,8 +74,8 @@ impl Convert None, + CurrencyId::Stellar(primitives::Asset::AlphaNum12 { .. }) + | CurrencyId::ZenlinkLPToken(_, _, _, _) => None, CurrencyId::Token(_) => None, }, } @@ -93,8 +93,8 @@ impl Convert<(Vec, Vec), O Some(OracleKey::ExchangeRate(CurrencyId::XCM(xcm_currency_id))) } else if blockchain == T::native_chain() && symbol == T::native_symbol() { Some(OracleKey::ExchangeRate(CurrencyId::Native)) - } else if blockchain == STELLAR_DIA_BLOCKCHAIN.as_bytes().to_vec() && - symbol == STELLAR_DIA_SYMBOL.as_bytes().to_vec() + } else if blockchain == STELLAR_DIA_BLOCKCHAIN.as_bytes().to_vec() + && symbol == STELLAR_DIA_SYMBOL.as_bytes().to_vec() { Some(OracleKey::ExchangeRate(CurrencyId::StellarNative)) } else if blockchain == FIAT_DIA_BLOCKCHAIN.as_bytes().to_vec() { @@ -143,7 +143,7 @@ where let value = ConvertPrice::convert(coin_info.price)?; let Some(timestamp) = ConvertMoment::convert(coin_info.last_update_timestamp) else { - return None + return None; }; Some(TimestampedValue { value, timestamp }) diff --git a/pallets/oracle/src/lib.rs b/pallets/oracle/src/lib.rs index 0d7ba2f81..85ebb5e9b 100644 --- a/pallets/oracle/src/lib.rs +++ b/pallets/oracle/src/lib.rs @@ -9,7 +9,9 @@ extern crate mocktopus; #[cfg(feature = "testing-utils")] use frame_support::dispatch::DispatchResult; -use frame_support::{dispatch::DispatchError, transactional}; +use frame_support::{pallet_prelude::DispatchError, transactional}; +use frame_system::pallet_prelude::BlockNumberFor; + #[cfg(test)] use mocktopus::macros::mockable; use sp_runtime::{ @@ -73,6 +75,7 @@ const USD_DECIMALS: u32 = 12; pub mod pallet { use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; + use sp_std::vec; use super::*; @@ -125,8 +128,8 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(n: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(n: BlockNumberFor) -> Weight { Self::begin_block(n); ::WeightInfo::on_initialize() } @@ -153,15 +156,25 @@ pub mod pallet { pub(super) type StorageVersion = StorageValue<_, Version, ValueQuery, DefaultForStorageVersion>; - #[derive(Default)] #[pallet::genesis_config] - pub struct GenesisConfig { + pub struct GenesisConfig { pub max_delay: u32, pub oracle_keys: Vec, + pub _phantom: sp_std::marker::PhantomData, + } + + impl Default for GenesisConfig { + fn default() -> Self { + Self { + max_delay: Default::default(), + oracle_keys: vec![], + _phantom: Default::default(), + } + } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { MaxDelay::::put(T::Moment::from(self.max_delay)); OracleKeys::::put(self.oracle_keys.clone()); @@ -213,7 +226,7 @@ pub mod pallet { impl Pallet { // the function is public only for testing purposes. function should be use only by this pallet // inside on_initialize hook - pub fn begin_block(_height: T::BlockNumber) { + pub fn begin_block(_height: BlockNumberFor) { let oracle_keys: Vec<_> = OracleKeys::::get(); let current_time = Self::get_current_time(); @@ -234,9 +247,9 @@ impl Pallet { } let current_status_is_online = Self::is_oracle_online(); - let new_status_is_online = oracle_keys.len() > 0 && - updated_items_len > 0 && - updated_items_len == oracle_keys.len(); + let new_status_is_online = oracle_keys.len() > 0 + && updated_items_len > 0 + && updated_items_len == oracle_keys.len(); if current_status_is_online != new_status_is_online { if new_status_is_online { @@ -263,7 +276,7 @@ impl Pallet { for (key, value) in values { let timestamped = orml_oracle::TimestampedValue { timestamp: Self::get_current_time(), value }; - T::DataFeeder::feed_value(oracle.clone(), key.clone(), timestamped) + T::DataFeeder::feed_value(Some(oracle.clone()), key.clone(), timestamped) .expect("Expect store value by key"); if !oracle_keys.contains(&key) { oracle_keys.push(key); @@ -294,7 +307,7 @@ impl Pallet { ext::security::ensure_parachain_status_running::()?; let Some(price) = T::DataProvider::get_no_op(&key) else { - return Err(Error::::MissingExchangeRate.into()) + return Err(Error::::MissingExchangeRate.into()); }; Ok(price.value) } @@ -360,7 +373,7 @@ impl Pallet { to_decimals: u32, ) -> Result, DispatchError> { if from_amount.is_zero() { - return Ok(Zero::zero()) + return Ok(Zero::zero()); } let from_amount = T::UnsignedFixedPoint::from_inner(from_amount); diff --git a/pallets/oracle/src/mock.rs b/pallets/oracle/src/mock.rs index 48119bd74..6275beeba 100644 --- a/pallets/oracle/src/mock.rs +++ b/pallets/oracle/src/mock.rs @@ -8,8 +8,8 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; pub use currency::testing_constants::{ @@ -23,28 +23,24 @@ use crate::{ Config, Error, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { // substrate pallets - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, // Operational - Security: security::{Pallet, Call, Storage, Event}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, - Currency: currency::{Pallet}, + Security: security, + Oracle: oracle, + Staking: staking, + Currency: currency, } ); @@ -56,7 +52,7 @@ pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type CurrencyId = primitives::CurrencyId; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; parameter_types! { pub const BlockHashCount: u64 = 250; @@ -64,19 +60,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -110,7 +105,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -239,12 +234,14 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); - frame_support::traits::GenesisBuild::::assimilate_storage( - &oracle::GenesisConfig { oracle_keys: vec![], max_delay: 0 }, - &mut storage, - ) + oracle::GenesisConfig:: { + oracle_keys: vec![], + max_delay: 0, + _phantom: Default::default(), + } + .assimilate_storage(&mut storage) .unwrap(); sp_io::TestExternalities::from(storage) diff --git a/pallets/oracle/src/oracle_mock.rs b/pallets/oracle/src/oracle_mock.rs index bec944a97..22698c0d5 100644 --- a/pallets/oracle/src/oracle_mock.rs +++ b/pallets/oracle/src/oracle_mock.rs @@ -41,12 +41,15 @@ impl Convert, Vec)>> for MockOracleKeyConvertor { CurrencyId::XCM(token_symbol) => Some((vec![0u8], vec![token_symbol])), CurrencyId::Native => Some((vec![2u8], vec![])), CurrencyId::StellarNative => Some((vec![3u8], vec![])), - CurrencyId::Stellar(Asset::AlphaNum4 { code, .. }) => - Some((vec![4u8], code.to_vec())), - CurrencyId::Stellar(Asset::AlphaNum12 { code, .. }) => - Some((vec![5u8], code.to_vec())), - CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => - Some((vec![6], vec![token1_id, token1_type, token2_id, token2_type])), + CurrencyId::Stellar(Asset::AlphaNum4 { code, .. }) => { + Some((vec![4u8], code.to_vec())) + }, + CurrencyId::Stellar(Asset::AlphaNum12 { code, .. }) => { + Some((vec![5u8], code.to_vec())) + }, + CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => { + Some((vec![6], vec![token1_id, token1_type, token2_id, token2_type])) + }, CurrencyId::Token(token_symbol) => { let token_symbol = token_symbol.to_be_bytes().to_vec(); Some((vec![7], token_symbol)) diff --git a/pallets/oracle/src/testing_utils/mock_collector.rs b/pallets/oracle/src/testing_utils/mock_collector.rs index 41cd35e0d..74444bd1e 100644 --- a/pallets/oracle/src/testing_utils/mock_collector.rs +++ b/pallets/oracle/src/testing_utils/mock_collector.rs @@ -105,7 +105,7 @@ impl> for MockDataFeeder { fn feed_value( - _who: AccountId, + _who: Option, key: Key, value: TimestampedValue, ) -> DispatchResult { diff --git a/pallets/oracle/src/testing_utils/mock_convertors.rs b/pallets/oracle/src/testing_utils/mock_convertors.rs index 5646dc1ed..ec24bb3cf 100644 --- a/pallets/oracle/src/testing_utils/mock_convertors.rs +++ b/pallets/oracle/src/testing_utils/mock_convertors.rs @@ -13,12 +13,15 @@ impl Convert, Vec)>> for MockOracleKeyConvertor { CurrencyId::XCM(token_symbol) => Some((vec![0u8], vec![token_symbol])), CurrencyId::Native => Some((vec![2u8], vec![0])), CurrencyId::StellarNative => Some((vec![3u8], vec![0])), - CurrencyId::Stellar(Asset::AlphaNum4 { code, .. }) => - Some((vec![4u8], code.to_vec())), - CurrencyId::Stellar(Asset::AlphaNum12 { code, .. }) => - Some((vec![5u8], code.to_vec())), - CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => - Some((vec![6u8], vec![token1_id, token1_type, token2_id, token2_type])), + CurrencyId::Stellar(Asset::AlphaNum4 { code, .. }) => { + Some((vec![4u8], code.to_vec())) + }, + CurrencyId::Stellar(Asset::AlphaNum12 { code, .. }) => { + Some((vec![5u8], code.to_vec())) + }, + CurrencyId::ZenlinkLPToken(token1_id, token1_type, token2_id, token2_type) => { + Some((vec![6u8], vec![token1_id, token1_type, token2_id, token2_type])) + }, CurrencyId::Token(token_symbol) => { let token_symbol = token_symbol.to_be_bytes().to_vec(); Some((vec![7], token_symbol)) diff --git a/pallets/oracle/src/tests.rs b/pallets/oracle/src/tests.rs index 7a12a8a5d..d32437c02 100644 --- a/pallets/oracle/src/tests.rs +++ b/pallets/oracle/src/tests.rs @@ -170,11 +170,13 @@ fn test_amount_conversion() { OracleKey::ExchangeRate(currency) => { match currency { // XCM(0) is worth 5 USD - CurrencyId::XCM(0) => - MockResult::Return(Ok(FixedU128::from_rational(5, 1))), + CurrencyId::XCM(0) => { + MockResult::Return(Ok(FixedU128::from_rational(5, 1))) + }, // XCM(1) is worth 1 USD - CurrencyId::XCM(1) => - MockResult::Return(Ok(FixedU128::from_rational(1, 1))), + CurrencyId::XCM(1) => { + MockResult::Return(Ok(FixedU128::from_rational(1, 1))) + }, _ => { panic!("Unexpected currency") }, diff --git a/pallets/pooled-rewards/Cargo.toml b/pallets/pooled-rewards/Cargo.toml index 80c4410bc..30e17e477 100644 --- a/pallets/pooled-rewards/Cargo.toml +++ b/pallets/pooled-rewards/Cargo.toml @@ -15,21 +15,21 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive" primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Substrate dependencies -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" rand = "0.8.3" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } [features] diff --git a/pallets/pooled-rewards/src/lib.rs b/pallets/pooled-rewards/src/lib.rs index b60fe6921..333daf2fa 100644 --- a/pallets/pooled-rewards/src/lib.rs +++ b/pallets/pooled-rewards/src/lib.rs @@ -12,11 +12,8 @@ mod mock; mod tests; use codec::{Decode, Encode, EncodeLike}; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::Get, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError, traits::Get}; +use frame_system::pallet_prelude::BlockNumberFor; use primitives::{BalanceToFixedPoint, TruncateFixedPointToInt}; use scale_info::TypeInfo; use sp_arithmetic::FixedPointNumber; @@ -113,7 +110,7 @@ pub mod pallet { } #[pallet::hooks] - impl, I: 'static> Hooks for Pallet {} + impl, I: 'static> Hooks> for Pallet {} /// The total stake deposited to this reward pool. #[pallet::storage] @@ -278,7 +275,7 @@ impl, I: 'static> Pallet { reward: SignedFixedPoint, ) -> DispatchResult { if reward.is_zero() { - return Ok(()) + return Ok(()); } let total_stake = Self::total_stake(pool_id); ensure!(!total_stake.is_zero(), Error::::ZeroTotalStake); @@ -325,7 +322,7 @@ impl, I: 'static> Pallet { amount: SignedFixedPoint, ) -> Result<(), DispatchError> { if amount > Self::stake(pool_id, stake_id) { - return Err(Error::::InsufficientFunds.into()) + return Err(Error::::InsufficientFunds.into()); } checked_sub_mut!(Stake, (pool_id, stake_id), &amount); @@ -542,7 +539,7 @@ where pool_vec.push((pool_id, pool_stake_as_balance)); } - return Ok(pool_vec) + return Ok(pool_vec); } } diff --git a/pallets/pooled-rewards/src/mock.rs b/pallets/pooled-rewards/src/mock.rs index 4a372580d..a0f4a9590 100644 --- a/pallets/pooled-rewards/src/mock.rs +++ b/pallets/pooled-rewards/src/mock.rs @@ -2,8 +2,8 @@ use frame_support::{parameter_types, traits::Everything}; use sp_arithmetic::FixedI128; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; pub use currency::testing_constants::{ @@ -15,24 +15,19 @@ pub use primitives::CurrencyId; use crate as pooled_rewards; use crate::{Config, Error}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Reward: pooled_rewards::{Pallet, Call, Storage, Event}, + System: frame_system, + Reward: pooled_rewards, } ); pub type AccountId = u64; -pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; parameter_types! { @@ -42,19 +37,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -91,7 +85,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/redeem/Cargo.toml b/pallets/redeem/Cargo.toml index 9657546f5..114cfff4e 100644 --- a/pallets/redeem/Cargo.toml +++ b/pallets/redeem/Cargo.toml @@ -10,19 +10,20 @@ serde = { version = "1.0.130", default-features = false, features = ['derive'], codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex = { version = "0.4.3", default-features = false, features = ['alloc'] } scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } +log = { version = "0.4.17", default-features = false } # Substrate dependencies -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies currency = { path = "../currency", default-features = false } @@ -36,13 +37,13 @@ reward-distribution = { path = "../reward-distribution", default-features = fals primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Parachain dependencies pooled-rewards = { path = "../pooled-rewards", default-features = false } @@ -53,8 +54,8 @@ security = { path = "../security", features = ['testing-utils'] } oracle = { path = "../oracle", features = ['testing-utils'] } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } [features] default = ["std"] diff --git a/pallets/redeem/rpc/Cargo.toml b/pallets/redeem/rpc/Cargo.toml index 921b551be..b40c925ac 100644 --- a/pallets/redeem/rpc/Cargo.toml +++ b/pallets/redeem/rpc/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } jsonrpsee = { version = "0.16.0", features = ["client", "server", "macros"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } module-redeem-rpc-runtime-api = { path = "runtime-api" } diff --git a/pallets/redeem/rpc/runtime-api/Cargo.toml b/pallets/redeem/rpc/runtime-api/Cargo.toml index f7a3079f0..aa99d347c 100644 --- a/pallets/redeem/rpc/runtime-api/Cargo.toml +++ b/pallets/redeem/rpc/runtime-api/Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/redeem/src/benchmarking.rs b/pallets/redeem/src/benchmarking.rs index d667cc7ce..ac7fa629b 100644 --- a/pallets/redeem/src/benchmarking.rs +++ b/pallets/redeem/src/benchmarking.rs @@ -1,6 +1,6 @@ use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::assert_ok; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use orml_traits::MultiCurrency; use sp_core::{Get, H256}; use sp_runtime::{traits::One, FixedPointNumber}; @@ -189,7 +189,7 @@ benchmarks! { ); let (validators, organizations) = get_validators_and_organizations::(); - let enactment_block_height = T::BlockNumber::default(); + let enactment_block_height = BlockNumberFor::::default(); StellarRelay::::_update_tier_1_validator_set(validators, organizations, enactment_block_height).unwrap(); let public_network = ::IsPublicNetwork::get(); let (tx_env_xdr_encoded, scp_envs_xdr_encoded, tx_set_xdr_encoded) = build_dummy_proof_for::(redeem_id, public_network); @@ -339,7 +339,7 @@ benchmarks! { rate_limit_update { let limit_volume_amount: Option> = Some(1u32.into()); let limit_volume_currency_id: T::CurrencyId = get_wrapped_currency_id::(); - let interval_length: T::BlockNumber = 1u32.into(); + let interval_length: BlockNumberFor = 1u32.into(); }: _(RawOrigin::Root, limit_volume_amount, limit_volume_currency_id, interval_length) minimum_transfer_amount_update { diff --git a/pallets/redeem/src/ext.rs b/pallets/redeem/src/ext.rs index f37d8be1b..b4f6622da 100644 --- a/pallets/redeem/src/ext.rs +++ b/pallets/redeem/src/ext.rs @@ -64,7 +64,7 @@ pub(crate) mod stellar_relay { #[cfg_attr(test, mockable)] pub(crate) mod vault_registry { - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use currency::Amount; use vault_registry::types::{CurrencyId, CurrencySource, DefaultVault}; @@ -217,12 +217,13 @@ pub(crate) mod treasury { #[cfg_attr(test, mockable)] pub(crate) mod security { use frame_support::dispatch::DispatchResult; + use frame_system::pallet_prelude::BlockNumberFor; use sp_core::H256; use sp_runtime::DispatchError; pub fn parachain_block_expired( - opentime: T::BlockNumber, - period: T::BlockNumber, + opentime: BlockNumberFor, + period: BlockNumberFor, ) -> Result { >::parachain_block_expired(opentime, period) } @@ -235,14 +236,14 @@ pub(crate) mod security { >::ensure_parachain_status_running() } - pub fn active_block_number() -> T::BlockNumber { + pub fn active_block_number() -> BlockNumberFor { >::active_block_number() } } #[cfg_attr(test, mockable)] pub(crate) mod fee { - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use currency::Amount; diff --git a/pallets/redeem/src/lib.rs b/pallets/redeem/src/lib.rs index b2d2071f8..cea007a37 100644 --- a/pallets/redeem/src/lib.rs +++ b/pallets/redeem/src/lib.rs @@ -8,13 +8,8 @@ #[cfg(test)] extern crate mocktopus; -#[cfg(feature = "std")] -use std::str::FromStr; - -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, log, transactional, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError, transactional}; +use frame_system::pallet_prelude::BlockNumberFor; #[cfg(test)] use mocktopus::macros::mockable; @@ -120,7 +115,7 @@ pub mod pallet { amount: BalanceOf, }, RedeemPeriodChange { - period: T::BlockNumber, + period: BlockNumberFor, }, SelfRedeem { vault_id: DefaultVaultId, @@ -130,7 +125,7 @@ pub mod pallet { RateLimitUpdate { limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, }, RedeemMinimumTransferAmountUpdate { new_minimum_amount: BalanceOf, @@ -169,7 +164,7 @@ pub mod pallet { /// Stellar assets. #[pallet::storage] #[pallet::getter(fn redeem_period)] - pub(super) type RedeemPeriod = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type RedeemPeriod = StorageValue<_, BlockNumberFor, ValueQuery>; /// Users create redeem requests to receive stellar assets in return for their previously issued /// tokens. This mapping provides access from a unique hash redeemId to a Redeem struct. @@ -198,11 +193,11 @@ pub mod pallet { /// Represent interval define regular 24 hour intervals (every 24 * 3600 / 12 blocks) #[pallet::storage] - pub(super) type IntervalLength = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type IntervalLength = StorageValue<_, BlockNumberFor, ValueQuery>; /// Represent current interval current_block_number / IntervalLength #[pallet::storage] - pub(super) type LastIntervalIndex = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type LastIntervalIndex = StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::storage] pub(super) type CancelledRedeemAmount = @@ -210,16 +205,15 @@ pub mod pallet { #[pallet::genesis_config] pub struct GenesisConfig { - pub redeem_period: T::BlockNumber, + pub redeem_period: BlockNumberFor, pub redeem_minimum_transfer_amount: BalanceOf, pub limit_volume_amount: Option>, pub limit_volume_currency_id: T::CurrencyId, pub current_volume_amount: BalanceOf, - pub interval_length: T::BlockNumber, - pub last_interval_index: T::BlockNumber, + pub interval_length: BlockNumberFor, + pub last_interval_index: BlockNumberFor, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { const SECONDS_PER_BLOCK: u32 = 12; @@ -233,17 +227,14 @@ pub mod pallet { limit_volume_amount: None, limit_volume_currency_id: T::CurrencyId::default(), current_volume_amount: BalanceOf::::zero(), - interval_length: T::BlockNumber::from_str( - &(DAY_IN_SECONDS / SECONDS_PER_BLOCK).to_string(), - ) - .unwrap_or_default(), - last_interval_index: T::BlockNumber::zero(), + interval_length: (DAY_IN_SECONDS / SECONDS_PER_BLOCK).into(), + last_interval_index: BlockNumberFor::::zero(), } } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { RedeemPeriod::::put(self.redeem_period); RedeemMinimumTransferAmount::::put(self.redeem_minimum_transfer_amount); @@ -256,7 +247,7 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] pub struct Pallet(_); @@ -385,7 +376,7 @@ pub mod pallet { #[transactional] pub fn set_redeem_period( origin: OriginFor, - period: T::BlockNumber, + period: BlockNumberFor, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; >::set(period); @@ -444,7 +435,7 @@ pub mod pallet { origin: OriginFor, limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; Self::_rate_limit_update( @@ -564,7 +555,7 @@ impl Pallet { pub fn _rate_limit_update( limit_volume_amount: Option>, limit_volume_currency_id: T::CurrencyId, - interval_length: T::BlockNumber, + interval_length: BlockNumberFor, ) { >::set(limit_volume_amount); >::set(limit_volume_currency_id); @@ -1068,8 +1059,9 @@ impl Pallet { match request.status { RedeemRequestStatus::Pending => Ok(request), RedeemRequestStatus::Completed => Err(Error::::RedeemCompleted.into()), - RedeemRequestStatus::Reimbursed(_) | RedeemRequestStatus::Retried => - Err(Error::::RedeemCancelled.into()), + RedeemRequestStatus::Reimbursed(_) | RedeemRequestStatus::Retried => { + Err(Error::::RedeemCancelled.into()) + }, } } @@ -1114,8 +1106,8 @@ impl Pallet { fn check_volume(amount_requested: Amount) -> Result<(), DispatchError> { let limit_volume: Option> = LimitVolumeAmount::::get(); if let Some(limit_volume) = limit_volume { - let current_block: T::BlockNumber = >::block_number(); - let interval_length: T::BlockNumber = IntervalLength::::get(); + let current_block: BlockNumberFor = >::block_number(); + let interval_length: BlockNumberFor = IntervalLength::::get(); let current_index = current_block.checked_div(&interval_length); let mut current_volume = BalanceOf::::zero(); diff --git a/pallets/redeem/src/mock.rs b/pallets/redeem/src/mock.rs index 4e9ac2d24..568fc7440 100644 --- a/pallets/redeem/src/mock.rs +++ b/pallets/redeem/src/mock.rs @@ -1,25 +1,15 @@ -use frame_support::{ - assert_ok, parameter_types, - traits::{ConstU32, ConstU64, Everything, GenesisBuild}, - PalletId, -}; -use mocktopus::{macros::mockable, mocking::clear_mocks}; -use orml_currencies::BasicCurrencyAdapter; -use orml_traits::parameter_type_with_key; -pub use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; -use sp_core::H256; -use sp_runtime::{ - testing::{Header, TestXt}, - traits::{BlakeTwo256, IdentityLookup, One, Zero}, - DispatchError, Perquintill, -}; - pub use currency::{ testing_constants::{ DEFAULT_COLLATERAL_CURRENCY, DEFAULT_NATIVE_CURRENCY, DEFAULT_WRAPPED_CURRENCY, }, Amount, }; +use frame_support::{ + assert_ok, parameter_types, + traits::{ConstU32, ConstU64, Everything}, + PalletId, +}; +use mocktopus::{macros::mockable, mocking::clear_mocks}; pub use oracle::CurrencyId; use oracle::{ dia::DiaOracleAdapter, @@ -27,51 +17,58 @@ use oracle::{ MockConvertMoment, MockConvertPrice, MockDataFeeder, MockDiaOracle, MockOracleKeyConvertor, }, }; +use orml_currencies::BasicCurrencyAdapter; +use orml_traits::parameter_type_with_key; use primitives::{AmountCompatibility, DefaultDecimalsLookup, VaultCurrencyPair, VaultId}; +pub use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; +use sp_core::H256; +use sp_runtime::{ + testing::TestXt, + traits::{BlakeTwo256, IdentityLookup, One, Zero}, + BuildStorage, DispatchError, Perquintill, +}; use crate as redeem; use crate::{Config, Error}; type TestExtrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, + Rewards: pooled_rewards, + RewardDistribution: reward_distribution, // Operational - StellarRelay: stellar_relay::{Pallet, Call, Config, Storage, Event}, - Security: security::{Pallet, Call, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Redeem: redeem::{Pallet, Call, Config, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Staking: staking::{Pallet, Storage, Event}, - Currency: currency::{Pallet}, + StellarRelay: stellar_relay, + Security: security, + VaultRegistry: vault_registry, + Oracle: oracle, + Redeem: redeem, + Fee: fee, + Staking: staking, + Currency: currency, } ); +//add default to struct Test + pub type AccountId = u64; pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -83,19 +80,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -129,7 +125,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -407,7 +403,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build_with(balances: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: balances @@ -464,10 +460,12 @@ impl ExtBuilder { .assimilate_storage(&mut storage) .unwrap(); - frame_support::traits::GenesisBuild::::assimilate_storage( - &oracle::GenesisConfig { oracle_keys: vec![], max_delay: 0 }, - &mut storage, - ) + oracle::GenesisConfig:: { + oracle_keys: vec![], + max_delay: 0, + _phantom: Default::default(), + } + .assimilate_storage(&mut storage) .unwrap(); storage.into() diff --git a/pallets/redeem/src/tests.rs b/pallets/redeem/src/tests.rs index 2e59c5184..c9b12b74c 100644 --- a/pallets/redeem/src/tests.rs +++ b/pallets/redeem/src/tests.rs @@ -1,4 +1,4 @@ -use frame_support::{assert_err, assert_noop, assert_ok, dispatch::DispatchError}; +use frame_support::{assert_err, assert_noop, assert_ok, sp_runtime::DispatchError}; use mocktopus::mocking::*; use sp_core::H256; use sp_runtime::traits::Zero; diff --git a/pallets/redeem/src/types.rs b/pallets/redeem/src/types.rs index 2e06804eb..5c2fa748d 100644 --- a/pallets/redeem/src/types.rs +++ b/pallets/redeem/src/types.rs @@ -1,4 +1,5 @@ use currency::Amount; +use frame_system::pallet_prelude::BlockNumberFor; pub use primitives::redeem::{RedeemRequest, RedeemRequestStatus}; use primitives::VaultId; pub use vault_registry::types::CurrencyId; @@ -11,7 +12,7 @@ pub(crate) type DefaultVaultId = VaultId<::Account pub type DefaultRedeemRequest = RedeemRequest< ::AccountId, - ::BlockNumber, + BlockNumberFor, BalanceOf, CurrencyId, >; @@ -24,7 +25,7 @@ pub trait RedeemRequestExt { } impl RedeemRequestExt - for RedeemRequest, CurrencyId> + for RedeemRequest, BalanceOf, CurrencyId> { fn amount(&self) -> Amount { Amount::new(self.amount, self.asset) diff --git a/pallets/replace/Cargo.toml b/pallets/replace/Cargo.toml index a8b71370c..a93ce3ab3 100644 --- a/pallets/replace/Cargo.toml +++ b/pallets/replace/Cargo.toml @@ -10,19 +10,20 @@ serde = { version = "1.0.130", default-features = false, features = ['derive'], codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } hex = { version = "0.4.3", default-features = false, features = ['alloc'] } scale-info = { version = "2.0.0", default-features = false, features = ["derive"] } +log = { version = "0.4.14", default-features = false } # Substrate dependencies -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Parachain dependencies currency = { path = "../currency", default-features = false } @@ -37,13 +38,13 @@ pooled-rewards = { path = "../pooled-rewards", default-features = false } reward-distribution = { path = "../reward-distribution", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false, optional = true } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Parachain dependencies pooled-rewards = { path = "../pooled-rewards", default-features = false } @@ -55,8 +56,8 @@ oracle = { path = "../oracle", features = ['testing-utils'] } # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } [features] default = ["std"] diff --git a/pallets/replace/rpc/Cargo.toml b/pallets/replace/rpc/Cargo.toml index 0b4f5b132..8453dcaa8 100644 --- a/pallets/replace/rpc/Cargo.toml +++ b/pallets/replace/rpc/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } jsonrpsee = { version = "0.16.0", features = ["client","server", "macros"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } module-replace-rpc-runtime-api = { path = "runtime-api" } diff --git a/pallets/replace/rpc/runtime-api/Cargo.toml b/pallets/replace/rpc/runtime-api/Cargo.toml index c141a24de..92e82b1ad 100644 --- a/pallets/replace/rpc/runtime-api/Cargo.toml +++ b/pallets/replace/rpc/runtime-api/Cargo.toml @@ -6,9 +6,9 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } [features] default = ["std"] diff --git a/pallets/replace/src/benchmarking.rs b/pallets/replace/src/benchmarking.rs index 6a4f48314..5ac85decc 100644 --- a/pallets/replace/src/benchmarking.rs +++ b/pallets/replace/src/benchmarking.rs @@ -1,6 +1,6 @@ use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::assert_ok; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use orml_traits::MultiCurrency; use sp_core::{Get, H256}; use sp_runtime::{traits::One, FixedPointNumber}; @@ -233,7 +233,7 @@ benchmarks! { VaultRegistry::::_set_system_collateral_ceiling(get_currency_pair::(), 1_000_000_000u32.into()); let (validators, organizations) = get_validators_and_organizations::(); - let enactment_block_height = T::BlockNumber::default(); + let enactment_block_height = BlockNumberFor::::default(); StellarRelay::::_update_tier_1_validator_set(validators, organizations, enactment_block_height).unwrap(); let public_network = ::IsPublicNetwork::get(); let (tx_env_xdr_encoded, scp_envs_xdr_encoded, tx_set_xdr_encoded) = build_dummy_proof_for::(replace_id, public_network); diff --git a/pallets/replace/src/ext.rs b/pallets/replace/src/ext.rs index 5b053fd53..a22b06e79 100644 --- a/pallets/replace/src/ext.rs +++ b/pallets/replace/src/ext.rs @@ -64,7 +64,7 @@ pub(crate) mod stellar_relay { #[cfg_attr(test, mockable)] pub(crate) mod vault_registry { - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use currency::Amount; use vault_registry::types::CurrencySource; @@ -179,12 +179,13 @@ pub(crate) mod vault_registry { #[cfg_attr(test, mockable)] pub(crate) mod security { + use frame_system::pallet_prelude::BlockNumberFor; use sp_core::H256; use sp_runtime::DispatchError; pub fn parachain_block_expired( - opentime: T::BlockNumber, - period: T::BlockNumber, + opentime: BlockNumberFor, + period: BlockNumberFor, ) -> Result { >::parachain_block_expired(opentime, period) } @@ -193,14 +194,14 @@ pub(crate) mod security { >::get_secure_id() } - pub fn active_block_number() -> T::BlockNumber { + pub fn active_block_number() -> BlockNumberFor { >::active_block_number() } } #[cfg_attr(test, mockable)] pub(crate) mod fee { - use frame_support::dispatch::DispatchError; + use frame_support::sp_runtime::DispatchError; use currency::Amount; diff --git a/pallets/replace/src/lib.rs b/pallets/replace/src/lib.rs index 28272af5e..6746caac0 100644 --- a/pallets/replace/src/lib.rs +++ b/pallets/replace/src/lib.rs @@ -9,10 +9,7 @@ extern crate mocktopus; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, log, - traits::Get, - transactional, + dispatch::DispatchResult, ensure, sp_runtime::DispatchError, traits::Get, transactional, }; #[cfg(test)] use mocktopus::macros::mockable; @@ -110,7 +107,7 @@ pub mod pallet { griefing_collateral: BalanceOf, }, ReplacePeriodChange { - period: T::BlockNumber, + period: BlockNumberFor, }, ReplaceMinimumTransferAmountUpdate { new_minimum_amount: BalanceOf, @@ -156,7 +153,7 @@ pub mod pallet { /// to prevent griefing of vault collateral. #[pallet::storage] #[pallet::getter(fn replace_period)] - pub(super) type ReplacePeriod = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type ReplacePeriod = StorageValue<_, BlockNumberFor, ValueQuery>; /// The minimum amount of wrapped assets that is accepted for replace requests #[pallet::storage] @@ -166,11 +163,10 @@ pub mod pallet { #[pallet::genesis_config] pub struct GenesisConfig { - pub replace_period: T::BlockNumber, + pub replace_period: BlockNumberFor, pub replace_minimum_transfer_amount: BalanceOf, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { Self { @@ -181,7 +177,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { ReplacePeriod::::put(self.replace_period); ReplaceMinimumTransferAmount::::put(self.replace_minimum_transfer_amount); @@ -189,7 +185,7 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] pub struct Pallet(_); @@ -330,7 +326,7 @@ pub mod pallet { #[transactional] pub fn set_replace_period( origin: OriginFor, - period: T::BlockNumber, + period: BlockNumberFor, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; >::set(period); @@ -423,7 +419,7 @@ impl Pallet { ext::vault_registry::withdraw_replace_request::(&vault_id, &amount)?; if withdrawn_tokens.is_zero() { - return Err(Error::::NoPendingRequest.into()) + return Err(Error::::NoPendingRequest.into()); } // Emit WithdrawReplaceRequest event. @@ -632,7 +628,7 @@ impl Pallet { ReplaceRequestStatus::Completed => { // We should never enter this branch as completed requests are filtered // but handle it just in case - return Err(Error::::ReplaceCompleted.into()) + return Err(Error::::ReplaceCompleted.into()); }, }; @@ -690,8 +686,8 @@ impl Pallet { // if the new_vault locked additional collateral especially for this replace, // release it if it does not cause them to be undercollateralized - if !ext::vault_registry::is_vault_liquidated::(&new_vault_id)? && - ext::vault_registry::is_allowed_to_withdraw_collateral::( + if !ext::vault_registry::is_vault_liquidated::(&new_vault_id)? + && ext::vault_registry::is_allowed_to_withdraw_collateral::( &new_vault_id, &collateral, )? { diff --git a/pallets/replace/src/mock.rs b/pallets/replace/src/mock.rs index 5269f9903..95ee4364e 100644 --- a/pallets/replace/src/mock.rs +++ b/pallets/replace/src/mock.rs @@ -1,6 +1,6 @@ use frame_support::{ assert_ok, parameter_types, - traits::{ConstU32, ConstU64, Everything, GenesisBuild}, + traits::{ConstU32, ConstU64, Everything}, PalletId, }; use mocktopus::{macros::mockable, mocking::clear_mocks}; @@ -9,9 +9,9 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::{Header, TestXt}, + testing::TestXt, traits::{BlakeTwo256, IdentityLookup, One, Zero}, - DispatchError, Perquintill, + BuildStorage, DispatchError, Perquintill, }; pub use currency::{ @@ -33,37 +33,33 @@ use crate as replace; use crate::{Config, Error}; type TestExtrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, + Rewards: pooled_rewards, + RewardDistribution: reward_distribution, // Operational - StellarRelay: stellar_relay::{Pallet, Call, Config, Storage, Event}, - Security: security::{Pallet, Call, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Replace: replace::{Pallet, Call, Config, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Nomination: nomination::{Pallet, Call, Config, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, - Currency: currency::{Pallet}, + StellarRelay: stellar_relay, + Security: security, + VaultRegistry: vault_registry, + Oracle: oracle, + Replace: replace, + Fee: fee, + Nomination: nomination, + Staking: staking, + Currency: currency, } ); @@ -72,7 +68,7 @@ pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -84,19 +80,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -130,7 +125,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -409,7 +404,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build_with(balances: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: balances diff --git a/pallets/replace/src/types.rs b/pallets/replace/src/types.rs index f26be2513..607c17ecf 100644 --- a/pallets/replace/src/types.rs +++ b/pallets/replace/src/types.rs @@ -1,6 +1,7 @@ use crate::Config; use currency::Amount; use frame_support::traits::Get; +use frame_system::pallet_prelude::BlockNumberFor; pub use primitives::replace::{ReplaceRequest, ReplaceRequestStatus}; use primitives::VaultId; pub use vault_registry::types::CurrencyId; @@ -11,7 +12,7 @@ pub(crate) type DefaultVaultId = VaultId<::Account pub type DefaultReplaceRequest = ReplaceRequest< ::AccountId, - ::BlockNumber, + BlockNumberFor, BalanceOf, CurrencyId, >; diff --git a/pallets/reward-distribution/Cargo.toml b/pallets/reward-distribution/Cargo.toml index 7969cae8a..4eb04bdf7 100644 --- a/pallets/reward-distribution/Cargo.toml +++ b/pallets/reward-distribution/Cargo.toml @@ -11,23 +11,23 @@ serde = { version = "1.0.130", default-features = false, features = ["derive"], log = {version = "0.4.14", default-features = false} # Substrate dependencies -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } #orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens= { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens= { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } diff --git a/pallets/reward-distribution/src/benchmarking.rs b/pallets/reward-distribution/src/benchmarking.rs index a649ef2d2..a2c4cfc2c 100644 --- a/pallets/reward-distribution/src/benchmarking.rs +++ b/pallets/reward-distribution/src/benchmarking.rs @@ -4,12 +4,10 @@ use super::Pallet as RewardDistribution; use super::*; use crate::types::DefaultVaultId; use currency::getters::get_relay_chain_currency_id as get_collateral_currency_id; -use frame_benchmarking::{ - v2::{account, benchmarks, impl_benchmark_test_suite}, - vec, -}; +use frame_benchmarking::v2::{account, benchmarks, impl_benchmark_test_suite}; use frame_system::RawOrigin; use pooled_rewards::RewardsApi; +use sp_std::vec; use staking::Staking; #[benchmarks] pub mod benchmarks { diff --git a/pallets/reward-distribution/src/ext.rs b/pallets/reward-distribution/src/ext.rs index 43eed2d6b..79d05f683 100644 --- a/pallets/reward-distribution/src/ext.rs +++ b/pallets/reward-distribution/src/ext.rs @@ -4,6 +4,7 @@ use mocktopus::macros::mockable; #[cfg_attr(test, mockable)] pub(crate) mod security { use frame_support::dispatch::DispatchResult; + use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::DispatchError; pub fn ensure_parachain_status_running() -> DispatchResult { @@ -11,13 +12,13 @@ pub(crate) mod security { } pub fn parachain_block_expired( - opentime: T::BlockNumber, - period: T::BlockNumber, + opentime: BlockNumberFor, + period: BlockNumberFor, ) -> Result { >::parachain_block_expired(opentime, period) } - pub fn get_active_block() -> T::BlockNumber { + pub fn get_active_block() -> BlockNumberFor { >::active_block_number() } } @@ -56,7 +57,7 @@ pub(crate) mod pooled_rewards { pub(crate) mod staking { use crate::{types::BalanceOf, DefaultVaultId}; use currency::CurrencyId; - use frame_support::dispatch::DispatchError; + use frame_support::sp_runtime::DispatchError; use sp_std::vec::Vec; use staking::Staking; @@ -71,7 +72,7 @@ pub(crate) mod staking { pub fn withdraw_reward( vault_id: &DefaultVaultId, nominator_id: &T::AccountId, - index: Option, + index: Option, currency_id: CurrencyId, ) -> Result, DispatchError> { T::VaultStaking::withdraw_reward(vault_id, nominator_id, index, currency_id) diff --git a/pallets/reward-distribution/src/lib.rs b/pallets/reward-distribution/src/lib.rs index 7223db8ce..65ff731a0 100644 --- a/pallets/reward-distribution/src/lib.rs +++ b/pallets/reward-distribution/src/lib.rs @@ -21,6 +21,7 @@ use frame_support::{ traits::{Currency, Get}, transactional, PalletId, }; +use frame_system::pallet_prelude::BlockNumberFor; use oracle::OracleApi; use orml_traits::GetByKey; use sp_arithmetic::{traits::AtLeast32BitUnsigned, FixedPointOperand, Perquintill}; @@ -90,7 +91,7 @@ pub mod pallet { type VaultStaking: staking::Staking< DefaultVaultId, Self::AccountId, - Self::Index, + Self::Nonce, BalanceOf, CurrencyId, >; @@ -108,7 +109,7 @@ pub mod pallet { /// Defines the interval (in number of blocks) at which the reward per block decays. #[pallet::constant] - type DecayInterval: Get; + type DecayInterval: Get>; /// Defines the rate at which the reward per block decays. #[pallet::constant] @@ -140,8 +141,8 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(n: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(n: BlockNumberFor) -> Weight { Self::execute_on_init(n); ::WeightInfo::on_initialize() } @@ -188,7 +189,7 @@ pub mod pallet { origin: OriginFor, vault_id: DefaultVaultId, reward_currency_id: CurrencyId, - index: Option, + index: Option, ) -> DispatchResult { //distribute reward from reward pool to staking pallet store let caller = ensure_signed(origin)?; @@ -207,11 +208,11 @@ pub mod pallet { ext::staking::compute_reward::(&vault_id, &caller, reward_currency_id)?; if expected_rewards == BalanceOf::::zero() { - return Err(Error::::NoRewardsForAccount.into()) + return Err(Error::::NoRewardsForAccount.into()); } if expected_rewards < minimum_transfer_amount { - return Err(Error::::CollectAmountTooSmall.into()) + return Err(Error::::CollectAmountTooSmall.into()); } //withdraw the reward for specific nominator @@ -219,7 +220,7 @@ pub mod pallet { ext::staking::withdraw_reward::(&vault_id, &caller, index, reward_currency_id)?; if caller_rewards == (BalanceOf::::zero()) { - return Err(Error::::NoRewardsForAccount.into()) + return Err(Error::::NoRewardsForAccount.into()); } //transfer rewards @@ -242,7 +243,7 @@ impl Pallet { None => { // Pay the whole reward from the fee pool let amount: currency::Amount = Amount::new(reward, reward_currency_id); - return amount.transfer(&Self::fee_pool_account_id(), &beneficiary) + return amount.transfer(&Self::fee_pool_account_id(), &beneficiary); }, Some(remaining) => { //check if the to-be-minted amount is consistent @@ -251,7 +252,7 @@ impl Pallet { .ok_or(Error::::NotEnoughRewardsRegistered)?; if liability < remaining { - return Err(Error::::NotEnoughRewardsRegistered.into()) + return Err(Error::::NotEnoughRewardsRegistered.into()); } // Use the available funds from the fee pool @@ -275,9 +276,9 @@ impl Pallet { } } - pub fn execute_on_init(_height: T::BlockNumber) { + pub fn execute_on_init(_height: BlockNumberFor) { if let Err(_) = ext::security::ensure_parachain_status_running::() { - return + return; } //get reward per block @@ -285,7 +286,7 @@ impl Pallet { Some(value) => value, None => { log::warn!("Reward per block is None"); - return + return; }, }; @@ -293,16 +294,16 @@ impl Pallet { Some(value) => value, None => { log::warn!("RewardsAdaptedAt is None"); - return + return; }, }; let mut reward_this_block = reward_per_block; - if Ok(true) == - ext::security::parachain_block_expired::( + if Ok(true) + == ext::security::parachain_block_expired::( rewards_adapted_at, - T::DecayInterval::get().saturating_sub(T::BlockNumber::one()), + T::DecayInterval::get().saturating_sub(BlockNumberFor::::one()), ) { let decay_rate = T::DecayRate::get(); reward_this_block = diff --git a/pallets/reward-distribution/src/mock.rs b/pallets/reward-distribution/src/mock.rs index ac695e0db..efea053fb 100644 --- a/pallets/reward-distribution/src/mock.rs +++ b/pallets/reward-distribution/src/mock.rs @@ -10,12 +10,9 @@ use primitives::{Balance, CurrencyId, CurrencyId::XCM, VaultId}; use sp_arithmetic::{FixedI128, FixedU128}; use sp_core::H256; use sp_runtime::{ - generic::Header as GenericHeader, traits::{BlakeTwo256, IdentityLookup}, - DispatchError, Perquintill, + BuildStorage, DispatchError, Perquintill, }; -type Header = GenericHeader; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; use orml_traits::parameter_type_with_key; use sp_arithmetic::traits::Zero; @@ -24,29 +21,26 @@ pub use currency::testing_constants::{DEFAULT_COLLATERAL_CURRENCY, DEFAULT_NATIV // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system, //Tokens and Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, - RewardDistribution: reward_distribution::{Pallet, Call, Storage, Event}, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, + RewardDistribution: reward_distribution, + Rewards: pooled_rewards, + Staking: staking, //Operational - Security: security::{Pallet, Call, Storage, Event}, + Security: security, } ); pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; pub type AccountId = u64; pub type SignedFixedPoint = FixedI128; pub type RawAmount = i128; @@ -59,19 +53,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -106,7 +99,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl security::Config for Test { @@ -258,7 +251,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/reward-distribution/src/tests.rs b/pallets/reward-distribution/src/tests.rs index 648e03211..b343ad2c2 100644 --- a/pallets/reward-distribution/src/tests.rs +++ b/pallets/reward-distribution/src/tests.rs @@ -2,6 +2,7 @@ use crate::{ext, mock::*, pallet, DefaultVaultId, Error, NativeLiability}; pub use currency::testing_constants::{DEFAULT_COLLATERAL_CURRENCY, DEFAULT_WRAPPED_CURRENCY}; use frame_benchmarking::account; use frame_support::{assert_err, assert_ok, traits::Get}; +use frame_system::pallet_prelude::BlockNumberFor; use mocktopus::mocking::*; use oracle::OracleApi; use primitives::CurrencyId::XCM; @@ -33,20 +34,20 @@ fn to_usd( fn expected_vault_rewards( reward: ::Balance, ) -> Vec<::Balance> { - let total_collateral_in_usd = to_usd(&COLLATERAL_POOL_1, &DEFAULT_COLLATERAL_CURRENCY) + - to_usd(&COLLATERAL_POOL_2, &XCM(1)) + - to_usd(&COLLATERAL_POOL_3, &XCM(2)) + - to_usd(&COLLATERAL_POOL_4, &XCM(3)); - - let reward_pool_1 = (reward as f64 * - (to_usd(&COLLATERAL_POOL_1, &DEFAULT_COLLATERAL_CURRENCY) as f64) / - (total_collateral_in_usd as f64)) as u128; - let reward_pool_2 = (reward as f64 * (to_usd(&COLLATERAL_POOL_2, &XCM(1)) as f64) / - (total_collateral_in_usd as f64)) as u128; - let reward_pool_3 = (reward as f64 * (to_usd(&COLLATERAL_POOL_3, &XCM(2)) as f64) / - (total_collateral_in_usd as f64)) as u128; - let reward_pool_4 = (reward as f64 * (to_usd(&COLLATERAL_POOL_4, &XCM(3)) as f64) / - (total_collateral_in_usd as f64)) as u128; + let total_collateral_in_usd = to_usd(&COLLATERAL_POOL_1, &DEFAULT_COLLATERAL_CURRENCY) + + to_usd(&COLLATERAL_POOL_2, &XCM(1)) + + to_usd(&COLLATERAL_POOL_3, &XCM(2)) + + to_usd(&COLLATERAL_POOL_4, &XCM(3)); + + let reward_pool_1 = (reward as f64 + * (to_usd(&COLLATERAL_POOL_1, &DEFAULT_COLLATERAL_CURRENCY) as f64) + / (total_collateral_in_usd as f64)) as u128; + let reward_pool_2 = (reward as f64 * (to_usd(&COLLATERAL_POOL_2, &XCM(1)) as f64) + / (total_collateral_in_usd as f64)) as u128; + let reward_pool_3 = (reward as f64 * (to_usd(&COLLATERAL_POOL_3, &XCM(2)) as f64) + / (total_collateral_in_usd as f64)) as u128; + let reward_pool_4 = (reward as f64 * (to_usd(&COLLATERAL_POOL_4, &XCM(3)) as f64) + / (total_collateral_in_usd as f64)) as u128; vec![reward_pool_1, reward_pool_2, reward_pool_3, reward_pool_4] } @@ -140,8 +141,7 @@ fn on_initialize_hook_distribution_works() { MockResult::Return(Ok(())) }, ); - let block_number: ::BlockNumber = - ::DecayInterval::get(); + let block_number: BlockNumberFor = ::DecayInterval::get(); System::set_block_number(block_number); ext::security::get_active_block::.mock_safe(move || MockResult::Return(block_number)); @@ -153,7 +153,7 @@ fn on_initialize_hook_distribution_works() { assert_eq!(RewardDistribution::rewards_adapted_at(), Some(100)); - let new_block_number = block_number + ::BlockNumber::one(); + let new_block_number = block_number + BlockNumberFor::::one(); System::set_block_number(new_block_number); ext::security::get_active_block:: .mock_safe(move || MockResult::Return(new_block_number)); @@ -192,8 +192,7 @@ fn udpate_reward_does_not_trigger_incorrectly() { #[test] fn udpate_reward_per_block_works() { run_test(|| { - let block_number: ::BlockNumber = - ::DecayInterval::get(); + let block_number: BlockNumberFor = ::DecayInterval::get(); ext::pooled_rewards::get_total_stake_all_pools::.mock_safe(move || { let initial_stakes = build_total_stakes(); diff --git a/pallets/reward/Cargo.toml b/pallets/reward/Cargo.toml index 22a9beffc..4ec345951 100644 --- a/pallets/reward/Cargo.toml +++ b/pallets/reward/Cargo.toml @@ -14,21 +14,21 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive" primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Substrate dependencies -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } [dev-dependencies] mocktopus = "0.8.0" rand = "0.8.3" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } diff --git a/pallets/reward/src/lib.rs b/pallets/reward/src/lib.rs index c8f3b9e23..b9d48667d 100644 --- a/pallets/reward/src/lib.rs +++ b/pallets/reward/src/lib.rs @@ -6,11 +6,8 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::EncodeLike; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::Get, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError, traits::Get}; +use frame_system::pallet_prelude::BlockNumberFor; use sp_arithmetic::FixedPointNumber; use sp_runtime::{ traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, Saturating, Zero}, @@ -95,7 +92,7 @@ pub mod pallet { } #[pallet::hooks] - impl, I: 'static> Hooks for Pallet {} + impl, I: 'static> Hooks> for Pallet {} /// The total stake deposited to this reward pool. #[pallet::storage] @@ -261,7 +258,7 @@ impl, I: 'static> Pallet { wrapped_currency: T::CurrencyId, ) -> Result<(), DispatchError> { if amount > Self::stake(reward_id) { - return Err(Error::::InsufficientFunds.into()) + return Err(Error::::InsufficientFunds.into()); } checked_sub_mut!(Stake, &reward_id, &amount); diff --git a/pallets/reward/src/mock.rs b/pallets/reward/src/mock.rs index d40347786..818002241 100644 --- a/pallets/reward/src/mock.rs +++ b/pallets/reward/src/mock.rs @@ -2,8 +2,8 @@ use frame_support::{parameter_types, traits::Everything}; use sp_arithmetic::FixedI128; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; pub use currency::testing_constants::{DEFAULT_NATIVE_CURRENCY, DEFAULT_WRAPPED_CURRENCY}; @@ -12,24 +12,19 @@ pub use primitives::CurrencyId; use crate as reward; use crate::{Config, Error}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Reward: reward::{Pallet, Call, Storage, Event}, + System: frame_system, + Reward: reward, } ); pub type AccountId = u64; -pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; parameter_types! { @@ -38,19 +33,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -86,7 +80,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/security/Cargo.toml b/pallets/security/Cargo.toml index 89ebd533e..b25ff0363 100644 --- a/pallets/security/Cargo.toml +++ b/pallets/security/Cargo.toml @@ -7,26 +7,27 @@ version = "1.0.10" [dependencies] codec = {package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "max-encoded-len"]} scale-info = {version = "2.2.0", default-features = false, features = ["derive"]} -serde = {version = "1.0.130", default-features = false, features = ["derive"], optional = true} +serde = {version = "1.0.130", default-features = false, features = ["derive"]} sha2 = {version = "0.8.2", default-features = false} # Substrate dependencies -frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -frame-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +frame-support = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-system = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-std = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} [dev-dependencies] mocktopus = "0.8.0" -sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +sp-io = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + [features] default = ["std"] std = [ - "serde", + "serde/std", "codec/std", "sha2/std", "sp-core/std", diff --git a/pallets/security/src/lib.rs b/pallets/security/src/lib.rs index 792f7df96..bd2477963 100644 --- a/pallets/security/src/lib.rs +++ b/pallets/security/src/lib.rs @@ -7,12 +7,9 @@ #[cfg(test)] extern crate mocktopus; - use codec::Encode; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - transactional, -}; +use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError, transactional}; +use frame_system::pallet_prelude::BlockNumberFor; #[cfg(test)] use mocktopus::macros::mockable; use sha2::{Digest, Sha256}; @@ -58,7 +55,7 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { RecoverFromErrors { new_status: StatusCode, cleared_errors: Vec }, - UpdateActiveBlock { block_number: T::BlockNumber }, + UpdateActiveBlock { block_number: BlockNumberFor }, } #[pallet::error] @@ -68,27 +65,27 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(_n: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(_n: BlockNumberFor) -> Weight { Self::increment_active_block(); ::WeightInfo::on_initialize() } } #[pallet::genesis_config] - pub struct GenesisConfig { + pub struct GenesisConfig { pub initial_status: StatusCode, + pub _phantom: sp_std::marker::PhantomData, } - #[cfg(feature = "std")] - impl Default for GenesisConfig { + impl Default for GenesisConfig { fn default() -> Self { - Self { initial_status: StatusCode::Error } + Self { initial_status: StatusCode::Error, _phantom: Default::default() } } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { Pallet::::set_status(self.initial_status); @@ -118,7 +115,7 @@ pub mod pallet { /// time to submit their proof. #[pallet::storage] #[pallet::getter(fn active_block_number)] - pub type ActiveBlockCount = StorageValue<_, T::BlockNumber, ValueQuery>; + pub type ActiveBlockCount = StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::pallet] #[pallet::without_storage_info] @@ -214,8 +211,8 @@ impl Pallet { /// Checks if the Parachain has a OracleOffline Error state pub fn is_parachain_error_oracle_offline() -> bool { - Self::parachain_status() == StatusCode::Error && - >::get().contains(&ErrorCode::OracleOffline) + Self::parachain_status() == StatusCode::Error + && >::get().contains(&ErrorCode::OracleOffline) } /// Sets the given `StatusCode`. @@ -255,8 +252,8 @@ impl Pallet { } pub fn parachain_block_expired( - opentime: T::BlockNumber, - period: T::BlockNumber, + opentime: BlockNumberFor, + period: BlockNumberFor, ) -> Result { let expiration_block = opentime.checked_add(&period).ok_or(ArithmeticError::Overflow)?; Ok(Self::active_block_number() > expiration_block) @@ -322,7 +319,7 @@ impl Pallet { /// for testing purposes only! #[cfg(feature = "testing-utils")] - pub fn set_active_block_number(n: T::BlockNumber) { + pub fn set_active_block_number(n: BlockNumberFor) { ActiveBlockCount::::set(n); } } diff --git a/pallets/security/src/mock.rs b/pallets/security/src/mock.rs index f98fe63cb..eb5ecfbe2 100644 --- a/pallets/security/src/mock.rs +++ b/pallets/security/src/mock.rs @@ -5,47 +5,41 @@ pub use frame_support::traits::Everything; use mocktopus::mocking::clear_mocks; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Security: security::{Pallet, Call, Storage, Event}, + System: frame_system, + Security: security, } ); pub type AccountId = u64; -pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; parameter_types! { pub const BlockHashCount: u64 = 250; pub const SS58Prefix: u8 = 42; } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -71,7 +65,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/security/src/types.rs b/pallets/security/src/types.rs index 1d52e379f..7be3efd93 100644 --- a/pallets/security/src/types.rs +++ b/pallets/security/src/types.rs @@ -1,10 +1,23 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use sp_std::{cmp::Ord, fmt::Debug}; /// Enum indicating the status of the Spacewalk Parachain. -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] -#[derive(Default, Encode, Decode, Clone, Copy, PartialEq, MaxEncodedLen, Eq, Debug, TypeInfo)] +#[derive( + Default, + Encode, + Decode, + Clone, + Copy, + PartialEq, + MaxEncodedLen, + Eq, + Debug, + TypeInfo, + Serialize, + Deserialize, +)] pub enum StatusCode { /// Spacewalk Parachain is fully operational. #[default] @@ -17,7 +30,19 @@ pub enum StatusCode { /// Enum specifying errors which lead to the Error status, tacked in Errors #[derive( - Default, Encode, Decode, Clone, PartialEq, Eq, Debug, Ord, MaxEncodedLen, PartialOrd, TypeInfo, + Default, + Encode, + Decode, + Clone, + PartialEq, + Eq, + Debug, + Ord, + MaxEncodedLen, + PartialOrd, + TypeInfo, + Serialize, + Deserialize, )] pub enum ErrorCode { /// No error. Used as default value diff --git a/pallets/staking/Cargo.toml b/pallets/staking/Cargo.toml index 1c8205602..b97c9bd1a 100644 --- a/pallets/staking/Cargo.toml +++ b/pallets/staking/Cargo.toml @@ -14,25 +14,25 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive" primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } # Substrate dependencies -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } # note: can be remove after removal of migration -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } [dev-dependencies] mocktopus = "0.8.0" rand = "0.8.3" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } currency = { path = "../currency", default-features = false, features = ["testing-constants"] } @@ -51,6 +51,10 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", + "pallet-timestamp/std", + "orml-traits/std", + "orml-tokens/std", + "primitives/std", ] runtime-benchmarks = [ "frame-benchmarking", diff --git a/pallets/staking/src/lib.rs b/pallets/staking/src/lib.rs index 115190baf..e0b59301d 100644 --- a/pallets/staking/src/lib.rs +++ b/pallets/staking/src/lib.rs @@ -54,10 +54,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::EncodeLike; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - traits::Get, -}; +use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError, traits::Get}; use sp_arithmetic::{FixedPointNumber, FixedPointOperand}; use sp_runtime::{ @@ -86,7 +83,7 @@ pub mod pallet { use super::*; use frame_support::{pallet_prelude::*, BoundedBTreeSet}; - + use frame_system::pallet_prelude::BlockNumberFor; /// ## Configuration /// The pallet's configuration trait. #[pallet::config] @@ -135,7 +132,7 @@ pub mod pallet { amount: T::SignedFixedPoint, }, WithdrawReward { - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: DefaultVaultId, nominator_id: T::AccountId, @@ -146,7 +143,7 @@ pub mod pallet { }, IncreaseNonce { vault_id: DefaultVaultId, - new_nonce: T::Index, + new_nonce: T::Nonce, }, } @@ -163,7 +160,7 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} /// The total stake - this will increase on deposit and decrease on withdrawal. #[pallet::storage] @@ -171,7 +168,7 @@ pub mod pallet { pub type TotalStake = StorageDoubleMap< _, Blake2_128Concat, - T::Index, + T::Nonce, Blake2_128Concat, DefaultVaultId, SignedFixedPoint, @@ -184,7 +181,7 @@ pub mod pallet { pub type TotalCurrentStake = StorageDoubleMap< _, Blake2_128Concat, - T::Index, + T::Nonce, Blake2_128Concat, DefaultVaultId, SignedFixedPoint, @@ -201,7 +198,7 @@ pub mod pallet { Blake2_128Concat, T::CurrencyId, Blake2_128Concat, - (T::Index, DefaultVaultId), + (T::Nonce, DefaultVaultId), SignedFixedPoint, ValueQuery, >; @@ -214,7 +211,7 @@ pub mod pallet { Blake2_128Concat, T::CurrencyId, Blake2_128Concat, - (T::Index, DefaultVaultId), + (T::Nonce, DefaultVaultId), SignedFixedPoint, ValueQuery, >; @@ -224,7 +221,7 @@ pub mod pallet { pub type SlashPerToken = StorageDoubleMap< _, Blake2_128Concat, - T::Index, + T::Nonce, Blake2_128Concat, DefaultVaultId, SignedFixedPoint, @@ -236,7 +233,7 @@ pub mod pallet { pub type Stake = StorageDoubleMap< _, Blake2_128Concat, - T::Index, + T::Nonce, Blake2_128Concat, (DefaultVaultId, T::AccountId), SignedFixedPoint, @@ -250,7 +247,7 @@ pub mod pallet { Blake2_128Concat, T::CurrencyId, Blake2_128Concat, - (T::Index, DefaultVaultId, T::AccountId), + (T::Nonce, DefaultVaultId, T::AccountId), SignedFixedPoint, ValueQuery, >; @@ -260,7 +257,7 @@ pub mod pallet { pub type SlashTally = StorageDoubleMap< _, Blake2_128Concat, - T::Index, + T::Nonce, Blake2_128Concat, (DefaultVaultId, T::AccountId), SignedFixedPoint, @@ -271,7 +268,7 @@ pub mod pallet { /// This is a strictly increasing value. #[pallet::storage] pub type Nonce = - StorageMap<_, Blake2_128Concat, DefaultVaultId, T::Index, ValueQuery>; + StorageMap<_, Blake2_128Concat, DefaultVaultId, T::Nonce, ValueQuery>; /// store with all the reward currencies in use #[pallet::storage] @@ -326,7 +323,7 @@ impl Pallet { } fn stake_at_index( - nonce: T::Index, + nonce: T::Nonce, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, ) -> SignedFixedPoint { @@ -343,7 +340,7 @@ impl Pallet { } fn reward_tally( - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, @@ -361,7 +358,7 @@ impl Pallet { } fn slash_tally_at_index( - nonce: T::Index, + nonce: T::Nonce, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, ) -> SignedFixedPoint { @@ -369,7 +366,7 @@ impl Pallet { } /// Get the newest nonce for the staking pool. - pub fn nonce(vault_id: &DefaultVaultId) -> T::Index { + pub fn nonce(vault_id: &DefaultVaultId) -> T::Nonce { >::get(vault_id) } @@ -380,7 +377,7 @@ impl Pallet { } fn slash_per_token_at_index( - nonce: T::Index, + nonce: T::Nonce, vault_id: &DefaultVaultId, ) -> SignedFixedPoint { >::get(nonce, vault_id) @@ -443,9 +440,9 @@ impl Pallet { let nonce = Self::nonce(vault_id); let total_stake = Self::total_stake_at_index(nonce, vault_id); if amount.is_zero() { - return Ok(()) + return Ok(()); } else if total_stake.is_zero() { - return Err(Error::::SlashZeroTotalStake.into()) + return Err(Error::::SlashZeroTotalStake.into()); } let amount_div_total_stake = @@ -473,9 +470,9 @@ impl Pallet { let nonce = Self::nonce(vault_id); let total_stake = Self::total_stake_at_index(nonce, vault_id); if amount.is_zero() { - return Ok(()) + return Ok(()); } else if total_stake.is_zero() { - return Err(Error::::SlashZeroTotalStake.into()) + return Err(Error::::SlashZeroTotalStake.into()); } let amount_div_total_stake = @@ -527,7 +524,7 @@ impl Pallet { /// Compute the stake in `vault_id` owned by `nominator_id`. pub fn compute_stake_at_index( - nonce: T::Index, + nonce: T::Nonce, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, ) -> Result< as FixedPointNumber>::Inner, DispatchError> { @@ -545,14 +542,14 @@ impl Pallet { } fn increase_rewards( - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: &DefaultVaultId, reward: SignedFixedPoint, ) -> Result, DispatchError> { let total_current_stake = Self::total_current_stake_at_index(nonce, vault_id); if total_current_stake.is_zero() { - return Ok(Zero::zero()) + return Ok(Zero::zero()); } let reward_div_total_current_stake = @@ -576,7 +573,7 @@ impl Pallet { let reward = Self::increase_rewards(nonce, currency_id, vault_id, reward)?; if reward.is_zero() { - return Ok(Zero::zero()) + return Ok(Zero::zero()); } checked_add_mut!(TotalRewards, currency_id, (nonce, vault_id), &reward); @@ -600,7 +597,7 @@ impl Pallet { /// Compute the expected reward for `nominator_id` who is nominating `vault_id`. pub fn compute_reward_at_index( - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, @@ -652,15 +649,15 @@ impl Pallet { vault_id: &DefaultVaultId, nominator_id: &T::AccountId, amount: SignedFixedPoint, - index: Option, + index: Option, ) -> DispatchResult { let nonce = index.unwrap_or_else(|| Self::nonce(vault_id)); let stake = Self::apply_slash(vault_id, nominator_id)?; if amount.is_zero() { - return Ok(()) + return Ok(()); } else if amount > stake { - return Err(Error::::InsufficientFunds.into()) + return Err(Error::::InsufficientFunds.into()); } checked_sub_mut!(Stake, nonce, (vault_id, nominator_id), &amount); @@ -716,7 +713,7 @@ impl Pallet { /// Withdraw all rewards earned by `vault_id` for the `nominator_id`. pub fn withdraw_reward_at_index( - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, @@ -779,7 +776,7 @@ impl Pallet { pub fn increment_nonce(vault_id: &DefaultVaultId) -> DispatchResult { >::mutate(vault_id, |nonce| { - *nonce = nonce.checked_add(&T::Index::one()).ok_or(ArithmeticError::Overflow)?; + *nonce = nonce.checked_add(&T::Nonce::one()).ok_or(ArithmeticError::Overflow)?; Ok::<_, DispatchError>(()) })?; Self::deposit_event(Event::::IncreaseNonce { @@ -868,7 +865,7 @@ pub trait Staking { fn get_all_reward_currencies() -> Result, DispatchError>; } -impl Staking, T::AccountId, T::Index, Balance, T::CurrencyId> +impl Staking, T::AccountId, T::Nonce, Balance, T::CurrencyId> for Pallet where T: Config, @@ -876,7 +873,7 @@ where Balance: BalanceToFixedPoint>, ::Inner: TryInto, { - fn nonce(vault_id: &DefaultVaultId) -> T::Index { + fn nonce(vault_id: &DefaultVaultId) -> T::Nonce { Pallet::::nonce(vault_id) } @@ -941,7 +938,7 @@ where vault_id: &DefaultVaultId, nominator_id: &T::AccountId, amount: Balance, - index: Option, + index: Option, ) -> DispatchResult { Pallet::::withdraw_stake( vault_id, @@ -954,7 +951,7 @@ where fn withdraw_reward( vault_id: &DefaultVaultId, nominator_id: &T::AccountId, - index: Option, + index: Option, currency_id: T::CurrencyId, ) -> Result { let nonce = index.unwrap_or_else(|| Pallet::::nonce(vault_id)); @@ -993,7 +990,7 @@ pub mod migration { /// The code as implemented befor the fix fn legacy_withdraw_reward_at_index( - nonce: T::Index, + nonce: T::Nonce, currency_id: T::CurrencyId, vault_id: &DefaultVaultId, nominator_id: &T::AccountId, diff --git a/pallets/staking/src/mock.rs b/pallets/staking/src/mock.rs index 460be9ff9..7de03023c 100644 --- a/pallets/staking/src/mock.rs +++ b/pallets/staking/src/mock.rs @@ -5,10 +5,9 @@ use frame_support::{ use orml_traits::parameter_type_with_key; use sp_arithmetic::FixedI128; use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, -}; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; + +use sp_runtime::BuildStorage; pub use currency::testing_constants::{ DEFAULT_COLLATERAL_CURRENCY, DEFAULT_NATIVE_CURRENCY, DEFAULT_WRAPPED_CURRENCY, @@ -19,25 +18,20 @@ use primitives::{VaultCurrencyPair, VaultId}; use crate as staking; use crate::{Config, Error}; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Staking: staking::{Pallet, Call, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Storage, Event}, + System: frame_system, + Staking: staking, + Tokens: orml_tokens, } ); pub type AccountId = u64; -pub type BlockNumber = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; @@ -47,19 +41,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -154,7 +147,7 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); storage.into() } diff --git a/pallets/stellar-relay/Cargo.toml b/pallets/stellar-relay/Cargo.toml index c42752dda..4fbf09eb6 100644 --- a/pallets/stellar-relay/Cargo.toml +++ b/pallets/stellar-relay/Cargo.toml @@ -17,14 +17,15 @@ base64 = { version = '0.13.0', default-features = false, features = ['alloc'] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } -serde = { version = '1.0.100', default-features = false, features = ['derive'] } +serde = {version = "1.0.130", default-features = false, features = ["derive"]} scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42", optional = true } +frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0", optional = true } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } currency = { default-features = false, path = "../currency" } @@ -33,12 +34,12 @@ sha2 = { version = "0.10.6", default-features = false } primitives = { package = "spacewalk-primitives", path = "../../primitives", default-features = false } [dev-dependencies] -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } + # Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } # For testing rand = "0.8.5" @@ -52,6 +53,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", + "sp-runtime/std", "sp-std/std", "currency/std", "sha2/std", diff --git a/pallets/stellar-relay/src/benchmarking.rs b/pallets/stellar-relay/src/benchmarking.rs index c403a6e0e..033cac1a4 100644 --- a/pallets/stellar-relay/src/benchmarking.rs +++ b/pallets/stellar-relay/src/benchmarking.rs @@ -2,7 +2,7 @@ use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; use frame_support::BoundedVec; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_std::vec; #[allow(unused)] @@ -38,7 +38,7 @@ benchmarks! { }; let organizations = vec![organization; 1]; - let enactment_block_height = T::BlockNumber::default(); + let enactment_block_height = BlockNumberFor::::default(); // After calling the extrinsic, the current validators and organizations will be the old ones let old_organizations = Organizations::::get(); diff --git a/pallets/stellar-relay/src/lib.rs b/pallets/stellar-relay/src/lib.rs index a2ba26857..58e74dd1f 100644 --- a/pallets/stellar-relay/src/lib.rs +++ b/pallets/stellar-relay/src/lib.rs @@ -31,7 +31,7 @@ use primitives::{derive_shortened_request_id, get_text_memo_from_tx_env, TextMem #[frame_support::pallet] pub mod pallet { use codec::FullCodec; - use frame_support::{pallet_prelude::*, transactional}; + use frame_support::{pallet_prelude::*, sp_runtime, transactional}; use frame_system::pallet_prelude::*; use primitives::stellar::{ compound_types::UnlimitedVarArray, @@ -39,8 +39,9 @@ pub mod pallet { types::{NodeId, ScpEnvelope, StellarValue, Value}, Hash, TransactionEnvelope, TransactionSetType, XdrCodec, }; + use sp_core::H256; - use sp_std::{collections::btree_map::BTreeMap, fmt::Debug, vec::Vec}; + use sp_std::{collections::btree_map::BTreeMap, fmt::Debug, vec, vec::Vec}; use default_weights::WeightInfo; @@ -96,7 +97,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub (super) fn deposit_event)] pub enum Event { - UpdateTier1ValidatorSet { new_validators_enactment_block_height: T::BlockNumber }, + UpdateTier1ValidatorSet { new_validators_enactment_block_height: BlockNumberFor }, } // Errors inform users that something went wrong. @@ -153,7 +154,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn new_validators_enactment_block_height)] pub type NewValidatorsEnactmentBlockHeight = - StorageValue<_, T::BlockNumber, ValueQuery>; + StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::genesis_config] pub struct GenesisConfig { @@ -161,11 +162,10 @@ pub mod pallet { pub old_organizations: Vec>, pub validators: Vec>, pub organizations: Vec>, - pub enactment_block_height: T::BlockNumber, + pub enactment_block_height: BlockNumberFor, pub phantom: PhantomData, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { // Create public network organizations @@ -373,7 +373,7 @@ pub mod pallet { // save space on chain let old_organizations = vec![]; let old_validators = vec![]; - let enactment_block_height = T::BlockNumber::default(); + let enactment_block_height = BlockNumberFor::::default(); GenesisConfig { old_organizations, @@ -387,7 +387,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { let old_validator_vec = BoundedVec::, T::ValidatorLimit>::try_from( self.old_validators.clone(), @@ -436,7 +436,7 @@ pub mod pallet { origin: OriginFor, validators: Vec>, organizations: Vec>, - enactment_block_height: T::BlockNumber, + enactment_block_height: BlockNumberFor, ) -> DispatchResult { // Limit this call to root ensure_root(origin)?; @@ -450,7 +450,7 @@ pub mod pallet { pub fn _update_tier_1_validator_set( validators: Vec>, organizations: Vec>, - enactment_block_height: T::BlockNumber, + enactment_block_height: BlockNumberFor, ) -> DispatchResult { // Ensure that the number of validators does not exceed the limit ensure!( @@ -512,8 +512,8 @@ pub mod pallet { // update only when new organization or validators not equal to old organization or // validators - if new_organization_vec != current_organizations || - new_validator_vec != current_validators + if new_organization_vec != current_organizations + || new_validator_vec != current_validators { OldValidators::::put(current_validators); OldOrganizations::::put(current_organizations); @@ -622,7 +622,7 @@ pub mod pallet { if let Some(included_memo) = tx_memo_text { ensure!(included_memo == expected_memo, Error::TransactionMemoDoesNotMatch); } else { - return Err(Error::TransactionMemoDoesNotMatch) + return Err(Error::TransactionMemoDoesNotMatch); } Ok(()) @@ -651,7 +651,6 @@ pub mod pallet { // Used to create bounded vecs for genesis config // Does not return a result but panics because the genesis config is hardcoded - #[cfg(feature = "std")] fn create_bounded_vec(input: &str) -> BoundedVec { let bounded_vec = BoundedVec::try_from(input.as_bytes().to_vec()); diff --git a/pallets/stellar-relay/src/mock.rs b/pallets/stellar-relay/src/mock.rs index 08dc2a16d..92ea8150b 100644 --- a/pallets/stellar-relay/src/mock.rs +++ b/pallets/stellar-relay/src/mock.rs @@ -1,5 +1,4 @@ use frame_support::{ - pallet_prelude::GenesisBuild, parameter_types, traits::{ConstU16, ConstU64}, BoundedVec, @@ -9,8 +8,8 @@ use primitives::stellar::SecretKey; use rand::Rng; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use crate as pallet_spacewalk_relay; @@ -20,35 +19,30 @@ use crate::{ Error, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - SpacewalkRelay: pallet_spacewalk_relay::{Pallet, Call, Storage, Event}, + System: frame_system, + SpacewalkRelay: pallet_spacewalk_relay, } ); impl system::Config for Test { + type Block = Block; type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -182,7 +176,7 @@ impl ExtBuilder { organizations: Vec>, validators: Vec>, ) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); crate::GenesisConfig:: { old_validators: vec![], diff --git a/pallets/stellar-relay/src/traits.rs b/pallets/stellar-relay/src/traits.rs index fcf528083..090f8d155 100644 --- a/pallets/stellar-relay/src/traits.rs +++ b/pallets/stellar-relay/src/traits.rs @@ -1,5 +1,5 @@ use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::{traits::Get, BoundedVec, RuntimeDebug}; +use frame_support::{pallet_prelude::RuntimeDebug, traits::Get, BoundedVec}; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; @@ -12,17 +12,37 @@ impl Get for FieldLength { } #[derive( - Clone, Decode, Encode, Eq, MaxEncodedLen, Ord, PartialEq, PartialOrd, RuntimeDebug, TypeInfo, + Clone, + Decode, + Encode, + Eq, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, + RuntimeDebug, + TypeInfo, + Serialize, + Deserialize, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct Validator { pub name: BoundedVec, pub public_key: BoundedVec, pub organization_id: OrganizationId, } -#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive( + Clone, + Decode, + Encode, + Eq, + MaxEncodedLen, + PartialEq, + RuntimeDebug, + TypeInfo, + Serialize, + Deserialize, +)] pub struct Organization { pub id: OrganizationId, pub name: BoundedVec, diff --git a/pallets/stellar-relay/src/validation.rs b/pallets/stellar-relay/src/validation.rs index 347f32d43..b4324493c 100644 --- a/pallets/stellar-relay/src/validation.rs +++ b/pallets/stellar-relay/src/validation.rs @@ -66,10 +66,12 @@ fn targeted_organization_map( /// Returns a tuple of Externalized Value and Externalized n_h pub fn get_externalized_info(envelope: &ScpEnvelope) -> Result<(&Value, u32), Error> { match &envelope.statement.pledges { - ScpStatementPledges::ScpStExternalize(externalized_statement) => - Ok((&externalized_statement.commit.value, externalized_statement.n_h)), - ScpStatementPledges::ScpStConfirm(confirmed_statement) => - Ok((&confirmed_statement.ballot.value, confirmed_statement.n_h)), + ScpStatementPledges::ScpStExternalize(externalized_statement) => { + Ok((&externalized_statement.commit.value, externalized_statement.n_h)) + }, + ScpStatementPledges::ScpStConfirm(confirmed_statement) => { + Ok((&confirmed_statement.ballot.value, confirmed_statement.n_h)) + }, _ => return Err(Error::::InvalidScpPledge), } } diff --git a/pallets/vault-registry/Cargo.toml b/pallets/vault-registry/Cargo.toml index 624eb0a85..a6cb658ca 100644 --- a/pallets/vault-registry/Cargo.toml +++ b/pallets/vault-registry/Cargo.toml @@ -15,17 +15,17 @@ log = {version = "0.4.14", default-features = false} visibility = {version = "0.0.1", optional = true} # Substrate dependencies -sp-arithmetic = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +sp-arithmetic = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-io = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-std = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} -frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true} -frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -frame-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +frame-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true} +frame-support = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-system = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} # Parachain dependencies currency = {path = "../currency", default-features = false} @@ -40,14 +40,14 @@ reward-distribution = {path = "../reward-distribution", default-features = false pooled-rewards = { path = "../pooled-rewards", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false} -orml-traits = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false} +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false} +orml-traits = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false} [dev-dependencies] currency = {path = "../currency", default-features = false, features = ["testing-utils", "testing-constants"]} security = { path = "../security", features = ['testing-utils'] } -frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +frame-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} oracle = { path = "../oracle", features = ['testing-utils'] } mocktopus = "0.8.0" pretty_assertions = "0.7.2" diff --git a/pallets/vault-registry/rpc/Cargo.toml b/pallets/vault-registry/rpc/Cargo.toml index 08aa6f8fd..66008ca92 100644 --- a/pallets/vault-registry/rpc/Cargo.toml +++ b/pallets/vault-registry/rpc/Cargo.toml @@ -9,6 +9,6 @@ codec = {package = "parity-scale-codec", version = "3.0.0"} jsonrpsee = {version = "0.16.0", features = ["client","server", "macros"]} module-oracle-rpc-runtime-api = {path = '../../oracle/rpc/runtime-api'} module-vault-registry-rpc-runtime-api = {path = "runtime-api"} -sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} -sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sp-blockchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} +sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} diff --git a/pallets/vault-registry/rpc/runtime-api/Cargo.toml b/pallets/vault-registry/rpc/runtime-api/Cargo.toml index c399821ea..9ef21d305 100644 --- a/pallets/vault-registry/rpc/runtime-api/Cargo.toml +++ b/pallets/vault-registry/rpc/runtime-api/Cargo.toml @@ -6,10 +6,10 @@ version = "1.0.10" [dependencies] codec = {package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"]} -frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +frame-support = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} module-oracle-rpc-runtime-api = {path = '../../../oracle/rpc/runtime-api', default-features = false} -sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-std = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} [features] default = ["std"] diff --git a/pallets/vault-registry/rpc/runtime-api/src/lib.rs b/pallets/vault-registry/rpc/runtime-api/src/lib.rs index 25959c0fe..829d04ec6 100644 --- a/pallets/vault-registry/rpc/runtime-api/src/lib.rs +++ b/pallets/vault-registry/rpc/runtime-api/src/lib.rs @@ -3,7 +3,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::Codec; -use frame_support::dispatch::DispatchError; +use frame_support::sp_runtime::DispatchError; use module_oracle_rpc_runtime_api::BalanceWrapper; use sp_std::vec::Vec; diff --git a/pallets/vault-registry/src/benchmarking.rs b/pallets/vault-registry/src/benchmarking.rs index 024c50b8f..64f5fbad4 100644 --- a/pallets/vault-registry/src/benchmarking.rs +++ b/pallets/vault-registry/src/benchmarking.rs @@ -1,6 +1,6 @@ use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite}; use frame_support::assert_ok; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use orml_traits::MultiCurrency; use sp_runtime::FixedPointNumber; use sp_std::prelude::*; @@ -176,10 +176,10 @@ benchmarks! { } set_punishment_delay { - let punishment_delay: T::BlockNumber = T::BlockNumber::default(); + let punishment_delay: BlockNumberFor = BlockNumberFor::::default(); }: _(RawOrigin::Root, punishment_delay) verify { - let punishment_delay: T::BlockNumber = T::BlockNumber::default(); + let punishment_delay: BlockNumberFor = BlockNumberFor::::default(); assert_eq!(PunishmentDelay::::get(), punishment_delay); } } diff --git a/pallets/vault-registry/src/ext.rs b/pallets/vault-registry/src/ext.rs index 0685f5a45..f144b7335 100644 --- a/pallets/vault-registry/src/ext.rs +++ b/pallets/vault-registry/src/ext.rs @@ -24,7 +24,8 @@ pub(crate) mod currency { #[cfg_attr(test, mockable)] pub(crate) mod security { - pub fn active_block_number() -> T::BlockNumber { + use frame_system::pallet_prelude::BlockNumberFor; + pub fn active_block_number() -> BlockNumberFor { >::active_block_number() } } @@ -33,7 +34,7 @@ pub(crate) mod security { pub(crate) mod staking { use crate::types::CurrencyId; use currency::Amount; - use frame_support::dispatch::{DispatchError, DispatchResult}; + use frame_support::{dispatch::DispatchResult, sp_runtime::DispatchError}; use staking::Staking; use crate::{types::BalanceOf, DefaultVaultId}; @@ -50,7 +51,7 @@ pub(crate) mod staking { vault_id: &DefaultVaultId, nominator_id: &T::AccountId, amount: &Amount, - index: Option, + index: Option, ) -> Result<(), DispatchError> { T::VaultStaking::withdraw_stake(vault_id, nominator_id, amount.amount(), index) } @@ -90,7 +91,7 @@ pub(crate) mod staking { pub(crate) mod pooled_rewards { use currency::Amount; - use frame_support::dispatch::DispatchError; + use frame_support::sp_runtime::DispatchError; use pooled_rewards::RewardsApi; use crate::DefaultVaultId; diff --git a/pallets/vault-registry/src/lib.rs b/pallets/vault-registry/src/lib.rs index 8874fc1cc..fb9da5c4b 100644 --- a/pallets/vault-registry/src/lib.rs +++ b/pallets/vault-registry/src/lib.rs @@ -10,10 +10,8 @@ extern crate mocktopus; use codec::FullCodec; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::Get, - transactional, PalletId, + dispatch::DispatchResult, ensure, sp_runtime::DispatchError, traits::Get, transactional, + PalletId, }; use frame_system::offchain::{SendTransactionTypes, SubmitTransaction}; #[cfg(test)] @@ -119,7 +117,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn offchain_worker(n: T::BlockNumber) { + fn offchain_worker(n: BlockNumberFor) { log::info!("Off-chain worker started on block {:?}", n); Self::_offchain_worker(); } @@ -133,7 +131,7 @@ pub mod pallet { match source { TransactionSource::External => { // receiving unsigned transaction from network - disallow - return InvalidTransaction::Call.into() + return InvalidTransaction::Call.into(); }, TransactionSource::Local => {}, // produced by off-chain worker TransactionSource::InBlock => {}, // some other node included it in a block @@ -149,8 +147,9 @@ pub mod pallet { }; match call { - Call::report_undercollateralized_vault { .. } => - valid_tx(b"report_undercollateralized_vault".to_vec()), + Call::report_undercollateralized_vault { .. } => { + valid_tx(b"report_undercollateralized_vault".to_vec()) + }, _ => InvalidTransaction::Call.into(), } } @@ -473,7 +472,7 @@ pub mod pallet { #[transactional] pub fn set_punishment_delay( origin: OriginFor, - punishment_delay: T::BlockNumber, + punishment_delay: BlockNumberFor, ) -> DispatchResult { ensure_root(origin)?; PunishmentDelay::::put(punishment_delay); @@ -588,7 +587,7 @@ pub mod pallet { }, BanVault { vault_id: DefaultVaultId, - banned_until: T::BlockNumber, + banned_until: BlockNumberFor, }, } @@ -672,7 +671,7 @@ pub mod pallet { /// of this ban (in number of blocks) . #[pallet::storage] #[pallet::getter(fn punishment_delay)] - pub(super) type PunishmentDelay = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(super) type PunishmentDelay = StorageValue<_, BlockNumberFor, ValueQuery>; /// Determines the over-collateralization rate for collateral locked by Vaults, necessary for /// wrapped tokens. This threshold should be greater than the LiquidationCollateralThreshold. @@ -730,7 +729,7 @@ pub mod pallet { #[pallet::genesis_config] pub struct GenesisConfig { pub minimum_collateral_vault: Vec<(CurrencyId, BalanceOf)>, - pub punishment_delay: T::BlockNumber, + pub punishment_delay: BlockNumberFor, pub system_collateral_ceiling: Vec<(DefaultVaultCurrencyPair, BalanceOf)>, pub secure_collateral_threshold: Vec<(DefaultVaultCurrencyPair, UnsignedFixedPoint)>, pub premium_redeem_threshold: Vec<(DefaultVaultCurrencyPair, UnsignedFixedPoint)>, @@ -738,7 +737,6 @@ pub mod pallet { Vec<(DefaultVaultCurrencyPair, UnsignedFixedPoint)>, } - #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { Self { @@ -753,7 +751,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { PunishmentDelay::::put(self.punishment_delay); for (currency_id, minimum) in self.minimum_collateral_vault.iter() { @@ -1594,7 +1592,7 @@ impl Pallet { if Self::is_vault_below_liquidation_threshold(&vault, liquidation_threshold) .unwrap_or(false) { - return Some(vault_id) + return Some(vault_id); } } None @@ -1758,7 +1756,7 @@ impl Pallet { denominator: &Amount, ) -> Result, DispatchError> { if numerator.is_zero() && denominator.is_zero() { - return Ok(collateral.clone()) + return Ok(collateral.clone()); } let currency = collateral.currency(); @@ -1807,8 +1805,8 @@ impl Pallet { let redeemable_tokens = rich_vault.redeemable_tokens().ok()?; - if !redeemable_tokens.is_zero() && - Self::is_vault_below_premium_threshold(&vault_id).unwrap_or(false) + if !redeemable_tokens.is_zero() + && Self::is_vault_below_premium_threshold(&vault_id).unwrap_or(false) { Some((vault_id, redeemable_tokens)) } else { @@ -1836,12 +1834,13 @@ impl Pallet { // iterator returns tuple of (AccountId, Vault), match Self::get_issuable_tokens_from_vault(&vault_id).ok() { - Some(issuable_tokens) => + Some(issuable_tokens) => { if !issuable_tokens.is_zero() { Some((vault_id, issuable_tokens)) } else { None - }, + } + }, None => None, } }) diff --git a/pallets/vault-registry/src/mock.rs b/pallets/vault-registry/src/mock.rs index 478fc7d19..d4d8af1ab 100644 --- a/pallets/vault-registry/src/mock.rs +++ b/pallets/vault-registry/src/mock.rs @@ -1,6 +1,6 @@ use frame_support::{ parameter_types, - traits::{ConstU32, ConstU64, Everything, GenesisBuild}, + traits::{ConstU32, ConstU64, Everything}, PalletId, }; use mocktopus::{macros::mockable, mocking::clear_mocks}; @@ -16,9 +16,9 @@ use orml_traits::parameter_type_with_key; use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; use sp_core::H256; use sp_runtime::{ - testing::{Header, TestXt}, + testing::TestXt, traits::{BlakeTwo256, IdentityLookup, One, Zero}, - DispatchError, Perquintill, + BuildStorage, DispatchError, Perquintill, }; pub use currency::testing_constants::{ @@ -31,34 +31,30 @@ use crate as vault_registry; use crate::{Config, Error}; pub(crate) type Extrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, // Tokens & Balances - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - Currencies: orml_currencies::{Pallet, Call}, + Balances: pallet_balances, + Tokens: orml_tokens, + Currencies: orml_currencies, - Rewards: pooled_rewards::{Pallet, Call, Storage, Event}, - RewardDistribution: reward_distribution::{Pallet, Storage, Event}, + Rewards: pooled_rewards, + RewardDistribution: reward_distribution, // Operational - Security: security::{Pallet, Call, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event, ValidateUnsigned}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Staking: staking::{Pallet, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Currency: currency::{Pallet}, + Security: security, + VaultRegistry: vault_registry, + Oracle: oracle, + Staking: staking, + Fee: fee, + Currency: currency, } ); @@ -68,7 +64,7 @@ pub type Balance = u128; pub type RawAmount = i128; pub type BlockNumber = u64; pub type Moment = u64; -pub type Index = u64; +pub type Nonce = u64; pub type SignedFixedPoint = FixedI128; pub type SignedInner = i128; pub type UnsignedFixedPoint = FixedU128; @@ -79,19 +75,18 @@ parameter_types! { } impl frame_system::Config for Test { + type Block = Block; type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = TestEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -125,7 +120,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl orml_currencies::Config for Test { @@ -393,7 +388,7 @@ pub const MULTI_VAULT_TEST_COLLATERAL: u128 = 100000; impl ExtBuilder { pub fn build_with(conf: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); conf.assimilate_storage(&mut storage).unwrap(); diff --git a/pallets/vault-registry/src/pool_staking_manager.rs b/pallets/vault-registry/src/pool_staking_manager.rs index b607b8af8..35af406c1 100644 --- a/pallets/vault-registry/src/pool_staking_manager.rs +++ b/pallets/vault-registry/src/pool_staking_manager.rs @@ -18,7 +18,7 @@ impl PoolManager { vault_id: &DefaultVaultId, nominator_id: &T::AccountId, amount: &Amount, - nonce: Option, + nonce: Option, ) -> Result<(), DispatchError> { ext::reward_distribution::withdraw_all_rewards_from_vault::(&vault_id)?; ext::staking::withdraw_stake::(vault_id, nominator_id, amount, nonce)?; diff --git a/pallets/vault-registry/src/tests.rs b/pallets/vault-registry/src/tests.rs index 095a6731f..f886134a2 100644 --- a/pallets/vault-registry/src/tests.rs +++ b/pallets/vault-registry/src/tests.rs @@ -1857,15 +1857,15 @@ mod integration { let vault_1_collateral_usd = to_usd(&collateral_vault_1, &DEFAULT_COLLATERAL_CURRENCY); let vault_2_collateral_usd = to_usd(&collateral_vault_2, &DEFAULT_COLLATERAL_CURRENCY); - let expected_value_vault_1: u128 = ((vault_1_collateral_usd as f64 / - (vault_1_collateral_usd + vault_2_collateral_usd) as f64) * - reward_per_block as f64) + let expected_value_vault_1: u128 = ((vault_1_collateral_usd as f64 + / (vault_1_collateral_usd + vault_2_collateral_usd) as f64) + * reward_per_block as f64) .floor() as u128; //collect rewards for vault 2 - let expected_value_vault_2: u128 = ((vault_2_collateral_usd as f64 / - (vault_1_collateral_usd + vault_2_collateral_usd) as f64) * - reward_per_block as f64) + let expected_value_vault_2: u128 = ((vault_2_collateral_usd as f64 + / (vault_1_collateral_usd + vault_2_collateral_usd) as f64) + * reward_per_block as f64) .floor() as u128; assert_eq!( @@ -1948,37 +1948,37 @@ mod integration { let vault_4_collateral_usd = to_usd(&collateral_vault_4, &COLLATERAL_2_VAULT_2.collateral_currency()); - let total_usd_amount = vault_1_collateral_usd + - vault_2_collateral_usd + - vault_3_collateral_usd + - vault_4_collateral_usd; + let total_usd_amount = vault_1_collateral_usd + + vault_2_collateral_usd + + vault_3_collateral_usd + + vault_4_collateral_usd; let expected_value_vault_1: u128 = ((((vault_1_collateral_usd + vault_2_collateral_usd) - as f64 / total_usd_amount as f64) * - reward_per_block as f64) - .floor() * (collateral_vault_1 as f64 / - (collateral_vault_1 + collateral_vault_2) as f64)) + as f64 / total_usd_amount as f64) + * reward_per_block as f64) + .floor() * (collateral_vault_1 as f64 + / (collateral_vault_1 + collateral_vault_2) as f64)) .floor() as u128; let expected_value_vault_2: u128 = ((((vault_1_collateral_usd + vault_2_collateral_usd) - as f64 / total_usd_amount as f64) * - reward_per_block as f64) - .floor() * (collateral_vault_2 as f64 / - (collateral_vault_1 + collateral_vault_2) as f64)) + as f64 / total_usd_amount as f64) + * reward_per_block as f64) + .floor() * (collateral_vault_2 as f64 + / (collateral_vault_1 + collateral_vault_2) as f64)) .floor() as u128; let expected_value_vault_3: u128 = ((((vault_4_collateral_usd + vault_3_collateral_usd) - as f64 / total_usd_amount as f64) * - reward_per_block as f64) - .floor() * (collateral_vault_3 as f64 / - (collateral_vault_3 + collateral_vault_4) as f64)) + as f64 / total_usd_amount as f64) + * reward_per_block as f64) + .floor() * (collateral_vault_3 as f64 + / (collateral_vault_3 + collateral_vault_4) as f64)) .floor() as u128; let expected_value_vault_4: u128 = ((((vault_4_collateral_usd + vault_3_collateral_usd) - as f64 / total_usd_amount as f64) * - reward_per_block as f64) - .floor() * (collateral_vault_4 as f64 / - (collateral_vault_3 + collateral_vault_4) as f64)) + as f64 / total_usd_amount as f64) + * reward_per_block as f64) + .floor() * (collateral_vault_4 as f64 + / (collateral_vault_3 + collateral_vault_4) as f64)) .floor() as u128; //ACT diff --git a/pallets/vault-registry/src/types.rs b/pallets/vault-registry/src/types.rs index 970f25a61..ed9f2a545 100644 --- a/pallets/vault-registry/src/types.rs +++ b/pallets/vault-registry/src/types.rs @@ -1,9 +1,5 @@ use codec::{Decode, Encode, HasCompact, MaxEncodedLen}; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - traits::Get, -}; +use frame_support::{dispatch::DispatchResult, ensure, sp_runtime::DispatchError, traits::Get}; #[cfg(test)] use mocktopus::macros::mockable; use scale_info::TypeInfo; @@ -13,6 +9,8 @@ use sp_runtime::{ ArithmeticError, }; +use frame_system::pallet_prelude::BlockNumberFor; + use currency::Amount; pub use primitives::{VaultCurrencyPair, VaultId}; @@ -40,17 +38,17 @@ pub enum CurrencySource { impl CurrencySource { pub fn account_id(&self) -> ::AccountId { match self { - CurrencySource::Collateral(DefaultVaultId:: { account_id: x, .. }) | - CurrencySource::AvailableReplaceCollateral(DefaultVaultId:: { + CurrencySource::Collateral(DefaultVaultId:: { account_id: x, .. }) + | CurrencySource::AvailableReplaceCollateral(DefaultVaultId:: { account_id: x, .. - }) | - CurrencySource::ActiveReplaceCollateral(DefaultVaultId:: { + }) + | CurrencySource::ActiveReplaceCollateral(DefaultVaultId:: { account_id: x, .. - }) | - CurrencySource::UserGriefing(x) | - CurrencySource::FreeBalance(x) | - CurrencySource::LiquidatedCollateral(DefaultVaultId:: { account_id: x, .. }) => x.clone(), + }) + | CurrencySource::UserGriefing(x) + | CurrencySource::FreeBalance(x) + | CurrencySource::LiquidatedCollateral(DefaultVaultId:: { account_id: x, .. }) => x.clone(), CurrencySource::LiquidationVault(_) => Pallet::::liquidation_vault_account_id(), } } @@ -72,8 +70,9 @@ impl CurrencySource { T::GetGriefingCollateralCurrencyId::get(), ) }, - CurrencySource::UserGriefing(x) => - ext::currency::get_reserved_balance::(currency_id, x), + CurrencySource::UserGriefing(x) => { + ext::currency::get_reserved_balance::(currency_id, x) + }, CurrencySource::FreeBalance(x) => ext::currency::get_free_balance::(currency_id, x), CurrencySource::LiquidatedCollateral(vault_id) => { let vault = Pallet::::get_vault_from_id(vault_id)?; @@ -199,7 +198,7 @@ impl< pub type DefaultVault = Vault< ::AccountId, - ::BlockNumber, + BlockNumberFor, BalanceOf, CurrencyId, UnsignedFixedPoint, @@ -412,7 +411,7 @@ impl RichVault { pub fn issuable_tokens(&self) -> Result, DispatchError> { // unable to issue additional tokens when banned if self.is_banned() { - return Ok(Amount::new(0u32.into(), self.wrapped_currency())) + return Ok(Amount::new(0u32.into(), self.wrapped_currency())); } // used_collateral = (exchange_rate * (issued_tokens + to_be_issued_tokens)) * @@ -434,7 +433,7 @@ impl RichVault { pub fn redeemable_tokens(&self) -> Result, DispatchError> { // unable to redeem additional tokens when banned if self.is_banned() { - return Ok(Amount::new(0u32.into(), self.wrapped_currency())) + return Ok(Amount::new(0u32.into(), self.wrapped_currency())); } self.issued_tokens().checked_sub(&self.to_be_redeemed_tokens()) @@ -653,7 +652,7 @@ impl RichVault { } } - pub fn ban_until(&mut self, height: T::BlockNumber) { + pub fn ban_until(&mut self, height: BlockNumberFor) { let _ = self.update(|v| { v.banned_until = Some(height); Ok(()) diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 2407fc75a..8a07ec28f 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -8,21 +8,25 @@ version = "1.0.10" bstringify = "0.1.2" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.130", default-features = false, optional = true } +scale-encode = {version = "0.7.1", default-features = false, features = ["derive"] } +scale-decode = {version = "0.13", default-features = false, features = ["derive"] } +serde = { version = "1.0.130", default-features = false, features = ["derive"]} base58 = { version = "0.2.0" } hex = { version = "0.4.3", optional = true } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" } -substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v0.9.42", default-features = false, features = ['offchain', 'all-types'] } +substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v1.1.0", default-features = false, features = ['offchain', 'all-types'] } [features] default = ["std"] std = [ + "scale-encode/std", + "scale-decode/std", "serde/std", "codec/std", "sp-core/std", diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9a56a19de..7b42cd61d 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -5,8 +5,9 @@ use base58::ToBase58; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::error::LookupError; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; #[cfg(feature = "std")] -use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde::{Deserializer, Serializer}; pub use sp_core::H256; use sp_core::{crypto::AccountId32, ed25519}; pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; @@ -66,15 +67,41 @@ impl TruncateFixedPointToInt for UnsignedFixedPoint { } } -#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, std::hash::Hash))] +#[derive( + Encode, + Decode, + Clone, + PartialEq, + Eq, + Debug, + PartialOrd, + Ord, + TypeInfo, + MaxEncodedLen, + Deserialize, + Serialize, +)] +#[cfg_attr(feature = "std", derive(std::hash::Hash))] pub struct VaultCurrencyPair { pub collateral: CurrencyId, pub wrapped: CurrencyId, } -#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, std::hash::Hash))] +#[derive( + Encode, + Decode, + Clone, + PartialEq, + Eq, + Debug, + PartialOrd, + Ord, + TypeInfo, + MaxEncodedLen, + Serialize, + Deserialize, +)] +#[cfg_attr(feature = "std", derive(std::hash::Hash))] pub struct VaultId { pub account_id: AccountId, pub currencies: VaultCurrencyPair, @@ -300,8 +327,9 @@ pub mod replace { pub mod oracle { use super::*; - #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen)] - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] + #[derive( + Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo, MaxEncodedLen, Serialize, Deserialize, + )] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] pub enum Key { ExchangeRate(CurrencyId), @@ -322,17 +350,14 @@ pub type AccountId = <::Signer as IdentifyAccount>::Account /// never know... pub type AccountIndex = u32; -/// Index of a transaction in the chain. 32-bit should be plenty. -pub type Nonce = u32; - /// Balance of an account. pub type Balance = u128; /// Signed version of Balance pub type Amount = i128; -/// Index of a transaction in the chain. -pub type Index = u32; +/// Nonce of a transaction in the chain. +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -424,9 +449,22 @@ pub fn remove_trailing_non_alphanum_bytes(input: &[u8]) -> &[u8] { } #[derive( - Encode, Decode, Eq, Hash, PartialEq, Copy, Clone, PartialOrd, Ord, TypeInfo, MaxEncodedLen, + Encode, + Decode, + Eq, + Hash, + PartialEq, + Copy, + Clone, + PartialOrd, + Ord, + TypeInfo, + MaxEncodedLen, + Serialize, + Deserialize, + scale_decode::DecodeAsType, + scale_encode::EncodeAsType, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[repr(u8)] #[allow(clippy::unnecessary_cast)] @@ -440,10 +478,12 @@ impl CurrencyInfo for Asset { fn name(&self) -> &str { match self { Asset::StellarNative => "Stellar", - Asset::AlphaNum4 { code, issuer: _ } => - from_utf8(&remove_trailing_non_alphanum_bytes(code)).unwrap_or("unspecified"), - Asset::AlphaNum12 { code, issuer: _ } => - from_utf8(&remove_trailing_non_alphanum_bytes(code)).unwrap_or("unspecified"), + Asset::AlphaNum4 { code, issuer: _ } => { + from_utf8(&remove_trailing_non_alphanum_bytes(code)).unwrap_or("unspecified") + }, + Asset::AlphaNum12 { code, issuer: _ } => { + from_utf8(&remove_trailing_non_alphanum_bytes(code)).unwrap_or("unspecified") + }, } } @@ -481,8 +521,11 @@ impl Asset { Ord, TypeInfo, MaxEncodedLen, + Serialize, + Deserialize, + scale_decode::DecodeAsType, + scale_encode::EncodeAsType, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[repr(u8)] #[allow(clippy::unnecessary_cast)] @@ -540,8 +583,9 @@ impl DecimalsLookup for PendulumDecimalsLookup { _ => 12, }, // We assume that all other assets have 12 decimals - CurrencyId::Native | CurrencyId::ZenlinkLPToken(_, _, _, _) | CurrencyId::Token(_) => - 12, + CurrencyId::Native | CurrencyId::ZenlinkLPToken(_, _, _, _) | CurrencyId::Token(_) => { + 12 + }, }) as u32 } } @@ -561,8 +605,9 @@ impl DecimalsLookup for AmplitudeDecimalsLookup { _ => 12, }, // We assume that all other assets have 12 decimals - CurrencyId::Native | CurrencyId::ZenlinkLPToken(_, _, _, _) | CurrencyId::Token(_) => - 12, + CurrencyId::Native | CurrencyId::ZenlinkLPToken(_, _, _, _) | CurrencyId::Token(_) => { + 12 + }, }) as u32 } } @@ -648,18 +693,21 @@ impl TryInto for CurrencyId { Self::XCM(_currency_id) => Err("XCM Foreign Asset not defined in the Stellar world."), Self::Native => Err("PEN token not defined in the Stellar world."), Self::StellarNative => Ok(stellar::Asset::native()), - Self::Stellar(Asset::AlphaNum4 { code, issuer }) => + Self::Stellar(Asset::AlphaNum4 { code, issuer }) => { Ok(stellar::Asset::AssetTypeCreditAlphanum4(AlphaNum4 { asset_code: code, issuer: PublicKey::PublicKeyTypeEd25519(issuer), - })), - Self::Stellar(Asset::AlphaNum12 { code, issuer }) => + })) + }, + Self::Stellar(Asset::AlphaNum12 { code, issuer }) => { Ok(stellar::Asset::AssetTypeCreditAlphanum12(AlphaNum12 { asset_code: code, issuer: PublicKey::PublicKeyTypeEd25519(issuer), - })), - Self::ZenlinkLPToken(_, _, _, _) => - Err("Zenlink LP Token not defined in the Stellar world."), + })) + }, + Self::ZenlinkLPToken(_, _, _, _) => { + Err("Zenlink LP Token not defined in the Stellar world.") + }, Self::Token(_) => Err("Token not defined in the Stellar world."), } } @@ -895,9 +943,9 @@ impl TransactionEnvelopeExt for TransactionEnvelope { if payment.claimants.len() == 1 { let Claimant::ClaimantTypeV0(claimant) = &payment.claimants.get_vec()[0]; - if claimant.destination.eq(&recipient_account_pk) && - payment.asset == asset && claimant.predicate == - ClaimPredicate::ClaimPredicateUnconditional + if claimant.destination.eq(&recipient_account_pk) + && payment.asset == asset && claimant.predicate + == ClaimPredicate::ClaimPredicateUnconditional { acc.saturating_add(payment.amount) } else { @@ -925,8 +973,9 @@ impl TransactionEnvelopeExt for TransactionEnvelope { fn get_transaction(&self) -> Option { match self { - TransactionEnvelope::EnvelopeTypeTxV0(transaction) => - Some(transaction.tx.clone().into()), + TransactionEnvelope::EnvelopeTypeTxV0(transaction) => { + Some(transaction.tx.clone().into()) + }, TransactionEnvelope::EnvelopeTypeTx(transaction) => Some(transaction.tx.clone()), _ => None, } diff --git a/testchain/.github/workflows/check.yml b/testchain/.github/workflows/check.yml index 6428ff9bf..55e1369a1 100644 --- a/testchain/.github/workflows/check.yml +++ b/testchain/.github/workflows/check.yml @@ -15,7 +15,7 @@ on: jobs: check: # The type of runner that the job will run on - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/testchain/node/Cargo.toml b/testchain/node/Cargo.toml index 99fe11230..741e09efb 100644 --- a/testchain/node/Cargo.toml +++ b/testchain/node/Cargo.toml @@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"] name = "spacewalk-standalone" [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [dependencies] clap = { version = "4.0.26", features = ["derive"] } @@ -22,6 +22,8 @@ log = "0.4.8" serde = { version = "1.0.130", features = ["derive"] } serde_json = "1.0.85" futures = "0.3.15" +tokio = { version = "1.37", features = ["full", "tracing"] } + # Parachain dependencies primitives = { package = "spacewalk-primitives", path = "../../primitives" } @@ -29,43 +31,45 @@ spacewalk-runtime-testnet = { package = "spacewalk-runtime-standalone-testnet", spacewalk-runtime-mainnet = { package = "spacewalk-runtime-standalone-mainnet", path = "../runtime/mainnet" } # Substrate dependencies -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.1.0" } -substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v0.9.42" } +substrate-stellar-sdk = { git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v1.1.0" } # RPC dependencies jsonrpc-core = "18.0.0" @@ -79,12 +83,12 @@ module-oracle-rpc = { path = "../../pallets/oracle/rpc" } module-vault-registry-rpc = { path = "../../pallets/vault-registry/rpc" } # Substrate dependencies -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sp-blockchain= { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain= { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = [] diff --git a/testchain/node/src/chain_spec.rs b/testchain/node/src/chain_spec.rs index 3870384be..12764fc88 100644 --- a/testchain/node/src/chain_spec.rs +++ b/testchain/node/src/chain_spec.rs @@ -12,16 +12,16 @@ use sp_runtime::traits::{IdentifyAccount, Verify}; use primitives::{oracle::Key, CurrencyId, VaultCurrencyPair}; use serde_json::{map::Map, Value}; use spacewalk_runtime_testnet::{ - AccountId, AuraConfig, BalancesConfig, FeeConfig, FieldLength, GenesisConfig, GrandpaConfig, - IssueConfig, NominationConfig, OracleConfig, Organization, RedeemConfig, ReplaceConfig, - SecurityConfig, Signature, StatusCode, StellarRelayConfig, SudoConfig, SystemConfig, - TokensConfig, Validator, VaultRegistryConfig, DAYS, + AccountId, AuraConfig, BalancesConfig, FeeConfig, FieldLength, GrandpaConfig, IssueConfig, + NominationConfig, OracleConfig, Organization, RedeemConfig, ReplaceConfig, + RuntimeGenesisConfig, SecurityConfig, Signature, StatusCode, StellarRelayConfig, SudoConfig, + SystemConfig, TokensConfig, Validator, VaultRegistryConfig, DAYS, }; // The URL for the telemetry server. // const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; /// Helper function to generate a crypto pair from seed pub fn get_from_seed(seed: &str) -> ::Public { @@ -176,7 +176,7 @@ fn genesis( authorized_oracles: Vec, start_shutdown: bool, is_public_network: bool, -) -> GenesisConfig { +) -> RuntimeGenesisConfig { let default_wrapped_currency = if is_public_network { WRAPPED_CURRENCY_ID_STELLAR_MAINNET } else { @@ -190,15 +190,17 @@ fn genesis( spacewalk_runtime_testnet::WASM_BINARY }; - GenesisConfig { + RuntimeGenesisConfig { system: SystemConfig { code: wasm_binary.expect("WASM binary was not build, please build it!").to_vec(), + ..Default::default() }, aura: AuraConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), }, grandpa: GrandpaConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), + ..Default::default() }, sudo: SudoConfig { // Assign network admin rights. @@ -245,6 +247,7 @@ fn genesis( }, security: SecurityConfig { initial_status: if start_shutdown { StatusCode::Shutdown } else { StatusCode::Error }, + ..Default::default() }, stellar_relay: if !is_public_network { create_stellar_testnet_config() @@ -260,6 +263,7 @@ fn genesis( Key::ExchangeRate(default_wrapped_currency), Key::ExchangeRate(MXN_CURRENCY_ID), ], + ..Default::default() }, vault_registry: VaultRegistryConfig { minimum_collateral_vault: vec![ @@ -365,7 +369,7 @@ fn genesis( punishment_fee: FixedU128::checked_from_rational(1, 10).unwrap(), // 10% replace_griefing_collateral: FixedU128::checked_from_rational(1, 10).unwrap(), // 10% }, - nomination: NominationConfig { is_nomination_enabled: false }, + nomination: NominationConfig { is_nomination_enabled: false, ..Default::default() }, dia_oracle_module: DiaOracleModuleConfig { authorized_accounts: authorized_oracles, supported_currencies: vec![ diff --git a/testchain/node/src/command.rs b/testchain/node/src/command.rs index ce716860e..8e0d0af57 100644 --- a/testchain/node/src/command.rs +++ b/testchain/node/src/command.rs @@ -15,13 +15,16 @@ // along with Substrate. If not, see . use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; -use sc_cli::{ChainSpec, Result, RuntimeVersion, SubstrateCli}; +use sc_cli::{Result, SubstrateCli}; use sc_service::{Configuration, PartialComponents, TaskManager}; use sp_keyring::Sr25519Keyring; use spacewalk_runtime::{Block, EXISTENTIAL_DEPOSIT}; use spacewalk_runtime_testnet as spacewalk_runtime; +use spacewalk_standalone::service::TestnetExecutor; + +use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; use crate::{ benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder}, @@ -70,10 +73,6 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> std::result::Result, String> { load_spec(id) } - - fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { - &spacewalk_runtime::VERSION - } } /// Parse command line arguments into service configuration. @@ -141,14 +140,18 @@ pub fn run() -> 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") { - cmd.run::(config) + cmd.run::::ExtendHostFunctions, + >>(config) } else { Err("Benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." .into()) - }, + } + }, BenchmarkCmd::Block(cmd) => { let PartialComponents { client, .. } = spacewalk_service::new_partial_testnet(&config, false)?; @@ -196,8 +199,9 @@ pub fn run() -> Result<()> { cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) }, - BenchmarkCmd::Machine(cmd) => - cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), + BenchmarkCmd::Machine(cmd) => { + cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()) + }, } }) }, diff --git a/testchain/node/src/service.rs b/testchain/node/src/service.rs index 98b94de78..3c44553aa 100644 --- a/testchain/node/src/service.rs +++ b/testchain/node/src/service.rs @@ -1,7 +1,7 @@ use std::{sync::Arc, time::Duration}; -use futures::StreamExt; -use sc_client_api::BlockBackend; +use futures::{FutureExt, StreamExt}; +use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use sc_consensus_grandpa::SharedVoterState; use sc_executor::{ @@ -12,6 +12,7 @@ use sc_service::{ TaskManager, }; use sc_telemetry::{Telemetry, TelemetryWorker}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use sp_core::crypto::KeyTypeId; @@ -24,6 +25,10 @@ use spacewalk_runtime_testnet::RuntimeApi as TestnetRuntimeApi; // Native executor instance. pub struct TestnetExecutor; +/// The minimum period of blocks on which justifications will be +/// imported and generated. +const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; + impl sc_executor::NativeExecutionDispatch for TestnetExecutor { /// Only enable the benchmarking host functions when we actually want to benchmark. #[cfg(feature = "runtime-benchmarks")] @@ -80,7 +85,7 @@ pub fn new_partial_mainnet( FullMainnetClient, FullBackend, FullSelectChain, - sc_consensus::DefaultImportQueue, + sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool, ( sc_consensus_grandpa::GrandpaBlockImport< @@ -145,6 +150,7 @@ pub fn new_partial_mainnet( 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()), @@ -206,7 +212,7 @@ pub fn new_partial_testnet( FullTestnetClient, FullBackend, FullSelectChain, - sc_consensus::DefaultImportQueue, + sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool, ( sc_consensus_grandpa::GrandpaBlockImport< @@ -271,6 +277,7 @@ pub fn new_partial_testnet( 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()), @@ -323,7 +330,7 @@ pub fn new_partial_testnet( } /// Builds a new service for a full client. -pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), ServiceError> { +pub fn new_full(config: Configuration) -> Result<(TaskManager, RpcHandlers), ServiceError> { let sc_service::PartialComponents { client, backend, @@ -340,14 +347,16 @@ pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), &config.chain_spec, ); - config - .network - .extra_sets - .push(sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone())); + let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + + net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), @@ -368,11 +377,23 @@ pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), sp_keystore::Keystore::sr25519_generate_new(&*keystore, KEY_TYPE, Some("//Bob")) .expect("Creating key with account Bob should succeed."); - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-worker", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + is_validator: config.role.is_authority(), + keystore: Some(keystore), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + enable_http_requests: true, + custom_extensions: |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -418,7 +439,7 @@ pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), let proposer_factory = sc_basic_authorship::ProposerFactory::new( task_manager.spawn_handle(), client.clone(), - transaction_pool, + transaction_pool.clone(), prometheus_registry.as_ref(), telemetry.as_ref().map(|x| x.handle()), ); @@ -467,13 +488,13 @@ pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), - justification_period: 512, name: Some(name), observer_enabled: false, keystore, local_role: role, telemetry: telemetry.as_ref().map(|x| x.handle()), protocol_name: grandpa_protocol_name, + justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, }; if enable_grandpa { @@ -492,6 +513,7 @@ pub fn new_full(mut config: Configuration) -> Result<(TaskManager, RpcHandlers), prometheus_registry, shared_voter_state: SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), + offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool), }; // the GRANDPA voter task is considered infallible, i.e. @@ -522,9 +544,12 @@ pub async fn start_instant_mainnet( other: (_, _, mut telemetry), } = new_partial_mainnet(&config, true)?; + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), @@ -534,11 +559,23 @@ pub async fn start_instant_mainnet( })?; if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-worker", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + is_validator: config.role.is_authority(), + keystore: Some(keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + enable_http_requests: true, + custom_extensions: |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); }; @@ -644,9 +681,12 @@ pub async fn start_instant_testnet( other: (_, _, mut telemetry), } = new_partial_testnet(&config, true)?; + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), @@ -656,11 +696,23 @@ pub async fn start_instant_testnet( })?; if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-worker", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + is_validator: config.role.is_authority(), + keystore: Some(keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + enable_http_requests: true, + custom_extensions: |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); }; diff --git a/testchain/runtime/mainnet/Cargo.toml b/testchain/runtime/mainnet/Cargo.toml index 78c2b794f..0b98e5ef9 100644 --- a/testchain/runtime/mainnet/Cargo.toml +++ b/testchain/runtime/mainnet/Cargo.toml @@ -16,43 +16,43 @@ cfg-if = "1.0.0" lazy_static = "1.4.0" # Substrate dependencies -sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-inherents = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-version = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} - -frame-executive = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -frame-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-balances = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-sudo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-transaction-payment = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} - -frame-system-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-block-builder = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-inherents = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-io = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-offchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-session = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-std = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-transaction-pool = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-version = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +frame-executive = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-support = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +frame-system = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-balances = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-sudo = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-timestamp = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-transaction-payment = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} + +frame-system-rpc-runtime-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-transaction-payment-rpc-runtime-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} # Used for runtime benchmarking -frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true} -frame-system-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true} +frame-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true} +frame-system-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true} hex-literal = {version = "0.3.4", optional = true, default-features = false} # Aura & GRANDPA dependencies -pallet-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -pallet-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} -sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false} +pallet-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +pallet-grandpa = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} +sp-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false} # Orml dependencies -orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false} -orml-tokens = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false} -orml-traits = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false} +orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false} +orml-tokens = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false} +orml-traits = {git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false} clients-info = {path = "../../../pallets/clients-info", default-features = false} currency = {path = "../../../pallets/currency", default-features = false} @@ -78,8 +78,8 @@ module-vault-registry-rpc-runtime-api = {path = "../../../pallets/vault-registry primitives = {package = "spacewalk-primitives", path = "../../../primitives", default-features = false} -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v0.9.42", default-features = false } +orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v1.1.0", default-features = false } [dev-dependencies] flate2 = "1.0" @@ -89,7 +89,7 @@ pretty_assertions = "0.7.2" serde_json = "1.0" [build-dependencies] -substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42"} +substrate-wasm-builder = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} [features] default = ["std"] diff --git a/testchain/runtime/mainnet/src/lib.rs b/testchain/runtime/mainnet/src/lib.rs index ef5aa04d2..b79ad1f7c 100644 --- a/testchain/runtime/mainnet/src/lib.rs +++ b/testchain/runtime/mainnet/src/lib.rs @@ -28,8 +28,8 @@ use sp_core::{OpaqueMetadata, H256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Convert, NumberFor, - Zero, + AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConstBool, Convert, + NumberFor, Zero, }, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, DispatchError, FixedPointNumber, Perbill, Perquintill, @@ -125,9 +125,8 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } -pub type Index = u32; - impl frame_system::Config for Runtime { + type Block = Block; type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = BlockWeights; type BlockLength = BlockLength; @@ -136,9 +135,7 @@ impl frame_system::Config for Runtime { /// The aggregated dispatch type that is available for extrinsics. type RuntimeCall = RuntimeCall; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. @@ -147,8 +144,6 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; - /// The header type. - type Header = generic::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -175,6 +170,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = ConstBool; } impl pallet_grandpa::Config for Runtime { @@ -184,6 +180,7 @@ impl pallet_grandpa::Config for Runtime { type MaxAuthorities = MaxAuthorities; type MaxSetIdSessionEntries = ConstU64<0>; type EquivocationReportSystem = (); + type MaxNominators = ConstU32<1000>; } parameter_types! { @@ -226,6 +223,7 @@ impl pallet_transaction_payment::Config for Runtime { impl pallet_sudo::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; + type WeightInfo = (); } // Pallet accounts @@ -315,7 +313,7 @@ impl pallet_balances::Config for Runtime { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl security::Config for Runtime { @@ -410,7 +408,7 @@ where call: RuntimeCall, public: ::Signer, account: AccountId, - index: Index, + index: Nonce, ) -> Option<( RuntimeCall, ::SignaturePayload, @@ -623,39 +621,36 @@ impl pooled_rewards::Config for Runtime { } construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = primitives::Block, - UncheckedExtrinsic = UncheckedExtrinsic + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 1, - Aura: pallet_aura::{Pallet, Config} = 2, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event} = 3, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 4, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event} = 5, - Currencies: orml_currencies::{Pallet, Call, Storage} = 7, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 8, + System: frame_system = 0, + Timestamp: pallet_timestamp = 1, + Aura: pallet_aura = 2, + Grandpa: pallet_grandpa = 3, + Sudo: pallet_sudo = 4, + Tokens: orml_tokens = 5, + Currencies: orml_currencies = 7, + Balances: pallet_balances = 8, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 9, - StellarRelay: stellar_relay::{Pallet, Call, Config, Storage, Event} = 10, + StellarRelay: stellar_relay = 10, - VaultRewards: pooled_rewards::{Pallet, Storage, Event} = 15, - VaultStaking: staking::{Pallet, Storage, Event} = 16, + VaultRewards: pooled_rewards = 15, + VaultStaking: staking = 16, - Currency: currency::{Pallet} = 17, + Currency: currency = 17, - Security: security::{Pallet, Call, Config, Storage, Event} = 19, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event, ValidateUnsigned} = 21, - Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 22, - Issue: issue::{Pallet, Call, Config, Storage, Event} = 23, - Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 24, - Replace: replace::{Pallet, Call, Config, Storage, Event} = 25, - Fee: fee::{Pallet, Call, Config, Storage} = 26, - Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 28, - DiaOracleModule: dia_oracle::{Pallet, Call, Config, Storage, Event} = 29, - ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 30, - RewardDistribution: reward_distribution::{Pallet, Call, Storage, Event} = 31, + Security: security = 19, + VaultRegistry: vault_registry = 21, + Oracle: oracle = 22, + Issue: issue = 23, + Redeem: redeem = 24, + Replace: replace = 25, + Fee: fee = 26, + Nomination: nomination = 28, + DiaOracleModule: dia_oracle = 29, + ClientsInfo: clients_info = 30, + RewardDistribution: reward_distribution = 31, } } @@ -881,7 +876,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; diff --git a/testchain/runtime/testnet/Cargo.toml b/testchain/runtime/testnet/Cargo.toml index 48ba5043f..8b5309a3c 100644 --- a/testchain/runtime/testnet/Cargo.toml +++ b/testchain/runtime/testnet/Cargo.toml @@ -16,43 +16,43 @@ cfg-if = "1.0.0" lazy_static = "1.4.0" # Substrate dependencies -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } - -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } - -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } + +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Used for runtime benchmarking -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false, optional = true } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } hex-literal = { version = "0.3.4", optional = true, default-features = false } # Aura & GRANDPA dependencies -pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Orml dependencies -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } clients-info = { path = "../../../pallets/clients-info", default-features = false } currency = { path = "../../../pallets/currency", default-features = false } @@ -78,8 +78,8 @@ module-vault-registry-rpc-runtime-api = { path = "../../../pallets/vault-registr primitives = { package = "spacewalk-primitives", path = "../../../primitives", default-features = false } -orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.42", default-features = false } -dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v0.9.42", default-features = false } +orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +dia-oracle = { git = "https://github.com/pendulum-chain/oracle-pallet", branch = "polkadot-v1.1.0", default-features = false } [dev-dependencies] flate2 = "1.0" @@ -89,7 +89,7 @@ pretty_assertions = "0.7.2" serde_json = "1.0" [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } [features] default = ["std"] diff --git a/testchain/runtime/testnet/src/lib.rs b/testchain/runtime/testnet/src/lib.rs index 62868f3c8..847df3a2a 100644 --- a/testchain/runtime/testnet/src/lib.rs +++ b/testchain/runtime/testnet/src/lib.rs @@ -24,7 +24,7 @@ use pallet_grandpa::{ pub use pallet_timestamp::Call as TimestampCall; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; -use sp_core::{OpaqueMetadata, H256}; +use sp_core::{ConstBool, OpaqueMetadata, H256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -124,8 +124,8 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } -pub type Index = u32; impl frame_system::Config for Runtime { + type Block = Block; type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = BlockWeights; type BlockLength = BlockLength; @@ -134,9 +134,7 @@ impl frame_system::Config for Runtime { /// The aggregated dispatch type that is available for extrinsics. type RuntimeCall = RuntimeCall; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. @@ -145,8 +143,6 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; - /// The header type. - type Header = generic::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). @@ -173,6 +169,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = ConstBool; } impl pallet_grandpa::Config for Runtime { @@ -182,6 +179,7 @@ impl pallet_grandpa::Config for Runtime { type MaxAuthorities = MaxAuthorities; type MaxSetIdSessionEntries = ConstU64<0>; type EquivocationReportSystem = (); + type MaxNominators = ConstU32<1000>; } parameter_types! { @@ -224,6 +222,7 @@ impl pallet_transaction_payment::Config for Runtime { impl pallet_sudo::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; + type WeightInfo = (); } // Pallet accounts @@ -311,7 +310,7 @@ impl pallet_balances::Config for Runtime { type FreezeIdentifier = (); type MaxFreezes = (); type MaxHolds = ConstU32<1>; - type HoldIdentifier = RuntimeHoldReason; + type RuntimeHoldReason = RuntimeHoldReason; } impl security::Config for Runtime { @@ -405,7 +404,7 @@ where call: RuntimeCall, public: ::Signer, account: AccountId, - index: Index, + index: Nonce, ) -> Option<( RuntimeCall, ::SignaturePayload, @@ -613,39 +612,36 @@ impl pooled_rewards::Config for Runtime { } construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = primitives::Block, - UncheckedExtrinsic = UncheckedExtrinsic + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 1, - Aura: pallet_aura::{Pallet, Config} = 2, - Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event} = 3, - Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 4, - Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event} = 5, - Currencies: orml_currencies::{Pallet, Call, Storage} = 7, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 8, + System: frame_system = 0, + Timestamp: pallet_timestamp = 1, + Aura: pallet_aura = 2, + Grandpa: pallet_grandpa = 3, + Sudo: pallet_sudo = 4, + Tokens: orml_tokens = 5, + Currencies: orml_currencies = 7, + Balances: pallet_balances = 8, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 9, - StellarRelay: stellar_relay::{Pallet, Call, Config, Storage, Event} = 10, + StellarRelay: stellar_relay = 10, - VaultRewards: pooled_rewards::{Pallet, Storage, Event} = 15, - VaultStaking: staking::{Pallet, Storage, Event} = 16, + VaultRewards: pooled_rewards = 15, + VaultStaking: staking = 16, - Currency: currency::{Pallet} = 17, + Currency: currency = 17, - Security: security::{Pallet, Call, Config, Storage, Event} = 19, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event, ValidateUnsigned} = 21, - Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 22, - Issue: issue::{Pallet, Call, Config, Storage, Event} = 23, - Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 24, - Replace: replace::{Pallet, Call, Config, Storage, Event} = 25, - Fee: fee::{Pallet, Call, Config, Storage} = 26, - Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 28, - DiaOracleModule: dia_oracle::{Pallet, Call, Config, Storage, Event} = 29, - ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 30, - RewardDistribution: reward_distribution::{Pallet, Call, Storage, Event} = 31, + Security: security = 19, + VaultRegistry: vault_registry = 21, + Oracle: oracle = 22, + Issue: issue = 23, + Redeem: redeem = 24, + Replace: replace = 25, + Fee: fee = 26, + Nomination: nomination = 28, + DiaOracleModule: dia_oracle = 29, + ClientsInfo: clients_info = 30, + RewardDistribution: reward_distribution = 31, } } @@ -871,7 +867,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench;