diff --git a/.github/workflows/rust_checks.yml b/.github/workflows/rust_checks.yml index cbdbf58a..e6241480 100644 --- a/.github/workflows/rust_checks.yml +++ b/.github/workflows/rust_checks.yml @@ -54,10 +54,10 @@ jobs: toolchain: nightly #-2022-11-15 # toolchain command: clippy args: --all-targets -- -D warnings -W clippy::cognitive_complexity - #- name: Test - # uses: actions-rs/cargo@v1 - # env: - # SUBVT_ENV: 'test' - # with: - # command: test - # args: -- --test-threads=1 + - name: Test + uses: actions-rs/cargo@v1 + env: + SUBVT_ENV: 'test' + with: + command: test + args: -- --test-threads=1 diff --git a/Cargo.lock b/Cargo.lock index 79adb558..d3bfa1db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1042,15 +1042,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-entity" -version = "0.92.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e39cfc857e7e539aa623e03bb6bec11f54aef3dfdef41adcfa7b594af3b54" -dependencies = [ - "serde", -] - [[package]] name = "cranelift-entity" version = "0.93.1" @@ -1242,41 +1233,6 @@ dependencies = [ "syn 2.0.11", ] -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", -] - [[package]] name = "data-url" version = "0.2.0" @@ -1901,13 +1857,13 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 7.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-runtime-interface 7.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", "static_assertions", ] @@ -1932,11 +1888,11 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", + "sp-arithmetic", + "sp-core", "sp-npos-elections", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -1970,17 +1926,17 @@ dependencies = [ "serde", "smallvec", "sp-api", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", + "sp-arithmetic", + "sp-core", "sp-core-hashing-proc-macro", "sp-inherents", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-io", + "sp-runtime", "sp-staking", - "sp-state-machine 0.13.0", - "sp-std 5.0.0", - "sp-tracing 6.0.0", - "sp-weights 4.0.0", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", "tt-call", ] @@ -2031,12 +1987,12 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", "sp-version", - "sp-weights 4.0.0", + "sp-weights", ] [[package]] @@ -2217,10 +2173,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -2348,12 +2302,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - [[package]] name = "hash-db" version = "0.16.0" @@ -2681,12 +2629,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.3.0" @@ -3339,23 +3281,13 @@ dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "memory-db" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" -dependencies = [ - "hash-db 0.15.2", - "hashbrown 0.12.3", -] - [[package]] name = "memory-db" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db 0.16.0", + "hash-db", ] [[package]] @@ -3723,10 +3655,10 @@ dependencies = [ "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto 7.0.0", + "sp-application-crypto", "sp-authority-discovery", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -3739,8 +3671,8 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -3757,14 +3689,14 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto 7.0.0", + "sp-application-crypto", "sp-consensus-babe", "sp-consensus-vrf", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-io", + "sp-runtime", "sp-session", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -3778,8 +3710,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -3794,9 +3726,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -3811,10 +3743,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -3831,12 +3763,12 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-npos-elections", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", "strum", ] @@ -3850,7 +3782,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "sp-npos-elections", - "sp-runtime 7.0.0", + "sp-runtime", ] [[package]] @@ -3865,10 +3797,10 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-io", + "sp-runtime", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -3882,9 +3814,9 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -3899,12 +3831,12 @@ dependencies = [ "pallet-authorship", "parity-scale-codec", "scale-info", - "sp-application-crypto 7.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -3918,9 +3850,9 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -3935,10 +3867,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 6.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -3953,13 +3885,13 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-session", "sp-staking", - "sp-std 5.0.0", - "sp-trie 7.0.0", + "sp-std", + "sp-trie", ] [[package]] @@ -3977,11 +3909,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", + "sp-application-crypto", + "sp-io", + "sp-runtime", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -3990,7 +3922,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" dependencies = [ "log", - "sp-arithmetic 6.0.0", + "sp-arithmetic", ] [[package]] @@ -4005,9 +3937,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-io", + "sp-runtime", + "sp-std", "sp-timestamp", ] @@ -4021,10 +3953,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -4040,8 +3972,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -4055,8 +3987,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -4341,9 +4273,9 @@ source = "git+https://github.com/paritytech/polkadot.git?tag=v0.9.40#a2b62fb872b dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -4358,9 +4290,9 @@ dependencies = [ "polkadot-core-primitives", "scale-info", "serde", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -4376,17 +4308,17 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 7.0.0", - "sp-arithmetic 6.0.0", + "sp-application-crypto", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", - "sp-core 7.0.0", + "sp-core", "sp-inherents", - "sp-io 7.0.0", - "sp-keystore 0.13.0", - "sp-runtime 7.0.0", + "sp-io", + "sp-keystore", + "sp-runtime", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -4421,14 +4353,14 @@ dependencies = [ "serde_derive", "slot-range-helper", "sp-api", - "sp-core 7.0.0", + "sp-core", "sp-inherents", - "sp-io 7.0.0", + "sp-io", "sp-npos-elections", - "sp-runtime 7.0.0", + "sp-runtime", "sp-session", "sp-staking", - "sp-std 5.0.0", + "sp-std", "static_assertions", "xcm", ] @@ -4441,8 +4373,8 @@ dependencies = [ "bs58", "parity-scale-codec", "polkadot-primitives", - "sp-std 5.0.0", - "sp-tracing 6.0.0", + "sp-std", + "sp-tracing", ] [[package]] @@ -4474,14 +4406,14 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-core 7.0.0", + "sp-core", "sp-inherents", - "sp-io 7.0.0", - "sp-keystore 0.13.0", - "sp-runtime 7.0.0", + "sp-io", + "sp-keystore", + "sp-runtime", "sp-session", "sp-staking", - "sp-std 5.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -4545,30 +4477,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check 0.9.4", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check 0.9.4", -] - [[package]] name = "proc-macro2" version = "1.0.54" @@ -5259,18 +5167,6 @@ dependencies = [ "serde", ] -[[package]] -name = "scale-decode" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" -dependencies = [ - "parity-scale-codec", - "scale-bits", - "scale-info", - "thiserror", -] - [[package]] name = "scale-info" version = "2.5.0" @@ -5297,23 +5193,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-value" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" -dependencies = [ - "either", - "frame-metadata", - "parity-scale-codec", - "scale-bits", - "scale-decode", - "scale-info", - "serde", - "thiserror", - "yap", -] - [[package]] name = "schannel" version = "0.1.21" @@ -5664,8 +5543,8 @@ dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", ] [[package]] @@ -5714,15 +5593,15 @@ name = "sp-api" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "sp-api-proc-macro", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-state-machine 0.13.0", - "sp-std 5.0.0", - "sp-trie 7.0.0", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", "sp-version", "thiserror", ] @@ -5749,23 +5628,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-std 5.0.0", -] - -[[package]] -name = "sp-application-crypto" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f08604ba4bd856311946722958711a08bded5c929e1227f7a697c58deb09468" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 16.0.0", - "sp-io 17.0.0", - "sp-std 6.0.0", + "sp-core", + "sp-io", + "sp-std", ] [[package]] @@ -5778,22 +5643,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", - "static_assertions", -] - -[[package]] -name = "sp-arithmetic" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7796939f2e3b68a3b9410ea17a2063b78038cd366f57fa772dd3be0798bd3412" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std 6.0.0", + "sp-std", "static_assertions", ] @@ -5805,9 +5655,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-application-crypto 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-application-crypto", + "sp-runtime", + "sp-std", ] [[package]] @@ -5818,10 +5668,10 @@ dependencies = [ "async-trait", "futures", "log", - "sp-core 7.0.0", + "sp-core", "sp-inherents", - "sp-runtime 7.0.0", - "sp-state-machine 0.13.0", + "sp-runtime", + "sp-state-machine", "thiserror", ] @@ -5836,15 +5686,15 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 7.0.0", + "sp-application-crypto", "sp-consensus", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core 7.0.0", + "sp-core", "sp-inherents", - "sp-keystore 0.13.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-keystore", + "sp-runtime", + "sp-std", "sp-timestamp", ] @@ -5856,7 +5706,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 5.0.0", + "sp-std", "sp-timestamp", ] @@ -5868,9 +5718,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "schnorrkel", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -5886,51 +5736,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra", "futures", - "hash-db 0.16.0", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "parity-scale-codec", - "parking_lot 0.12.1", - "primitive-types", - "rand 0.8.5", - "regex", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing 5.0.0", - "sp-debug-derive 5.0.0", - "sp-externalities 0.13.0", - "sp-runtime-interface 7.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "zeroize", -] - -[[package]] -name = "sp-core" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c96dc3debbe5c22ebf18f99e6a53199efe748e6e584a1902adb88cbad66ae7c" -dependencies = [ - "array-bytes", - "base58", - "bitflags", - "blake2", - "bounded-collections", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db 0.15.2", + "hash-db", "hash256-std-hasher", "impl-serde", "lazy_static", @@ -5947,12 +5753,12 @@ dependencies = [ "secp256k1", "secrecy", "serde", - "sp-core-hashing 6.0.0", - "sp-debug-derive 6.0.0", - "sp-externalities 0.17.0", - "sp-runtime-interface 13.0.0", - "sp-std 6.0.0", - "sp-storage 11.0.0", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", "ss58-registry", "substrate-bip39", "thiserror", @@ -5970,22 +5776,7 @@ dependencies = [ "digest 0.10.6", "sha2 0.10.6", "sha3", - "sp-std 5.0.0", - "twox-hash", -] - -[[package]] -name = "sp-core-hashing" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc2d1947252b7a4e403b0a260f596920443742791765ec111daa2bbf98eff25" -dependencies = [ - "blake2", - "byteorder", - "digest 0.10.6", - "sha2 0.10.6", - "sha3", - "sp-std 6.0.0", + "sp-std", "twox-hash", ] @@ -5996,7 +5787,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.4 dependencies = [ "proc-macro2", "quote", - "sp-core-hashing 5.0.0", + "sp-core-hashing", "syn 1.0.109", ] @@ -6010,17 +5801,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "sp-debug-derive" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fb9dc63d54de7d7bed62a505b6e0bd66c122525ea1abb348f6564717c3df2d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sp-externalities" version = "0.13.0" @@ -6028,20 +5808,8 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.4 dependencies = [ "environmental", "parity-scale-codec", - "sp-std 5.0.0", - "sp-storage 7.0.0", -] - -[[package]] -name = "sp-externalities" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57052935c9c9b070ea6b339ef0da3bf241b7e065fc37f9c551669ee83ecfc3c1" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 6.0.0", - "sp-storage 11.0.0", + "sp-std", + "sp-storage", ] [[package]] @@ -6053,9 +5821,9 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-runtime", + "sp-std", "thiserror", ] @@ -6072,40 +5840,14 @@ dependencies = [ "log", "parity-scale-codec", "secp256k1", - "sp-core 7.0.0", - "sp-externalities 0.13.0", - "sp-keystore 0.13.0", - "sp-runtime-interface 7.0.0", - "sp-state-machine 0.13.0", - "sp-std 5.0.0", - "sp-tracing 6.0.0", - "sp-trie 7.0.0", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-io" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578959f9a7e44fd2dd96e8b8bc893cea04fcd7c00a4ffbb0b91c5013899dd02b" -dependencies = [ - "bytes", - "ed25519", - "ed25519-dalek", - "futures", - "libsecp256k1", - "log", - "parity-scale-codec", - "secp256k1", - "sp-core 16.0.0", - "sp-externalities 0.17.0", - "sp-keystore 0.22.0", - "sp-runtime-interface 13.0.0", - "sp-state-machine 0.22.0", - "sp-std 6.0.0", - "sp-tracing 8.0.0", - "sp-trie 16.0.0", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", "tracing", "tracing-core", ] @@ -6122,25 +5864,8 @@ dependencies = [ "parking_lot 0.12.1", "schnorrkel", "serde", - "sp-core 7.0.0", - "sp-externalities 0.13.0", - "thiserror", -] - -[[package]] -name = "sp-keystore" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480dbd54b281c638209fbcfce69902b82a0a1af0e22219d46825eadced3136b6" -dependencies = [ - "async-trait", - "futures", - "merlin", - "parity-scale-codec", - "parking_lot 0.12.1", - "schnorrkel", - "sp-core 16.0.0", - "sp-externalities 0.17.0", + "sp-core", + "sp-externalities", "thiserror", ] @@ -6152,10 +5877,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -6168,17 +5893,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-panic-handler" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abed79c3d5b3622f65ab065676addd9923b9b122cd257df23e2757ce487c6d2" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - [[package]] name = "sp-runtime" version = "7.0.0" @@ -6193,35 +5907,12 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-application-crypto 7.0.0", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-std 5.0.0", - "sp-weights 4.0.0", -] - -[[package]] -name = "sp-runtime" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ab2fd44668d3e8674e2253a43852857a47d49be7db737e98bf157e4bcebefd" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "sp-application-crypto 17.0.0", - "sp-arithmetic 12.0.0", - "sp-core 16.0.0", - "sp-io 17.0.0", - "sp-std 6.0.0", - "sp-weights 14.0.0", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", ] [[package]] @@ -6233,31 +5924,12 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities 0.13.0", - "sp-runtime-interface-proc-macro 6.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", - "sp-tracing 6.0.0", - "sp-wasm-interface 7.0.0", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb7707246cee4967a8cc71e3ef0e82f562e8b1020606447a6a12b99c7c1b443" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities 0.17.0", - "sp-runtime-interface-proc-macro 9.0.0", - "sp-std 6.0.0", - "sp-storage 11.0.0", - "sp-tracing 8.0.0", - "sp-wasm-interface 10.0.0", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] @@ -6273,19 +5945,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773c90e5765847c5e8b4a24b553d38a9ca52ded47c142cfcfb7948f42827af9" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sp-session" version = "4.0.0-dev" @@ -6294,10 +5953,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core 7.0.0", - "sp-runtime 7.0.0", + "sp-core", + "sp-runtime", "sp-staking", - "sp-std 5.0.0", + "sp-std", ] [[package]] @@ -6307,9 +5966,9 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.4 dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-runtime", + "sp-std", ] [[package]] @@ -6317,38 +5976,17 @@ name = "sp-state-machine" version = "0.13.0" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.1", "rand 0.8.5", "smallvec", - "sp-core 7.0.0", - "sp-externalities 0.13.0", - "sp-panic-handler 5.0.0", - "sp-std 5.0.0", - "sp-trie 7.0.0", - "thiserror", - "tracing", -] - -[[package]] -name = "sp-state-machine" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c957b8b4c252507c12674948db427c5e34fd1760ce256922f1ec5f89f781a4f" -dependencies = [ - "hash-db 0.15.2", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "sp-core 16.0.0", - "sp-externalities 0.17.0", - "sp-panic-handler 6.0.0", - "sp-std 6.0.0", - "sp-trie 16.0.0", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", "thiserror", "tracing", ] @@ -6358,12 +5996,6 @@ name = "sp-std" version = "5.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" -[[package]] -name = "sp-std" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0ee286f98455272f64ac5bb1384ff21ac029fbb669afbaf48477faff12760e" - [[package]] name = "sp-storage" version = "7.0.0" @@ -6373,22 +6005,8 @@ dependencies = [ "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", -] - -[[package]] -name = "sp-storage" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c20cb0c562d1a159ecb2c7ca786828c81e432c535474967d2df3a484977cea4" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 6.0.0", - "sp-std 6.0.0", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -6401,8 +6019,8 @@ dependencies = [ "log", "parity-scale-codec", "sp-inherents", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", "thiserror", ] @@ -6412,20 +6030,7 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" dependencies = [ "parity-scale-codec", - "sp-std 5.0.0", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "sp-tracing" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46bd547da89a9cda69b4ce4c91a5b7e1f86915190d83cd407b715d0c6bac042" -dependencies = [ - "parity-scale-codec", - "sp-std 6.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -6437,45 +6042,21 @@ version = "7.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.40#76fed9b9082daade5392663f25ed8968f8e8c11c" dependencies = [ "ahash 0.8.3", - "hash-db 0.16.0", + "hash-db", "hashbrown 0.12.3", "lazy_static", - "memory-db 0.32.0", + "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", "scale-info", "schnellru", - "sp-core 7.0.0", - "sp-std 5.0.0", + "sp-core", + "sp-std", "thiserror", "tracing", - "trie-db 0.27.1", - "trie-root 0.18.0", -] - -[[package]] -name = "sp-trie" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8efbe5b6d29a18fea7c2f52e0098135f2f864b31d335d5105b40a349866ba874" -dependencies = [ - "ahash 0.8.3", - "hash-db 0.15.2", - "hashbrown 0.12.3", - "lazy_static", - "memory-db 0.31.0", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.12.1", - "scale-info", - "schnellru", - "sp-core 16.0.0", - "sp-std 6.0.0", - "thiserror", - "tracing", - "trie-db 0.24.0", - "trie-root 0.17.0", + "trie-db", + "trie-root", ] [[package]] @@ -6489,8 +6070,8 @@ dependencies = [ "scale-info", "serde", "sp-core-hashing-proc-macro", - "sp-runtime 7.0.0", - "sp-std 5.0.0", + "sp-runtime", + "sp-std", "sp-version-proc-macro", "thiserror", ] @@ -6515,24 +6096,9 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 5.0.0", - "wasmi", - "wasmtime 6.0.1", -] - -[[package]] -name = "sp-wasm-interface" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbc05650b6338808892a7b04f0c56bb1f7f928bfa9ac58e0af2c1e5bef33229" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 6.0.0", + "sp-std", "wasmi", - "wasmtime 5.0.1", + "wasmtime", ] [[package]] @@ -6544,26 +6110,10 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", -] - -[[package]] -name = "sp-weights" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ebab7696f915aa548494aef3ca8d15217baf10458fe6edb87e60587a47de358" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 12.0.0", - "sp-core 16.0.0", - "sp-debug-derive 6.0.0", - "sp-std 6.0.0", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", ] [[package]] @@ -7101,7 +6651,7 @@ dependencies = [ "async-trait", "log", "serde_json", - "sp-core 7.0.0", + "sp-core", "subvt-config", "subvt-logging", "subvt-metrics", @@ -7130,7 +6680,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "sp-core 7.0.0", + "sp-core", "subvt-config", "subvt-types", "subvt-utility", @@ -7227,18 +6777,18 @@ dependencies = [ "polkadot-runtime-common", "polkadot-runtime-parachains", "rustc-hash", + "scale-bits", "scale-info", "serde", "serde_json", "sp-consensus-babe", - "sp-core 7.0.0", - "sp-runtime 7.0.0", + "sp-core", + "sp-runtime", "sp-session", "sp-staking", "sqlx", "subvt-proc-macro", "subvt-utility", - "subxt", "thiserror", ] @@ -7329,84 +6879,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "subxt" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54639dba6a113584083968b6a8f457dedae612abe1bd214762101ca29f12e332" -dependencies = [ - "base58", - "blake2", - "derivative", - "frame-metadata", - "futures", - "getrandom 0.2.8", - "hex", - "impl-serde", - "jsonrpsee", - "parity-scale-codec", - "parking_lot 0.12.1", - "primitive-types", - "scale-bits", - "scale-decode", - "scale-info", - "scale-value", - "serde", - "serde_json", - "sp-core 16.0.0", - "sp-core-hashing 6.0.0", - "sp-runtime 18.0.0", - "subxt-macro", - "subxt-metadata", - "thiserror", - "tracing", -] - -[[package]] -name = "subxt-codegen" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e86cb719003f1cedf2710a6e55ca4c37aba4c989bbd3b81dd1c52af9e4827e" -dependencies = [ - "darling", - "frame-metadata", - "heck", - "hex", - "jsonrpsee", - "parity-scale-codec", - "proc-macro-error", - "proc-macro2", - "quote", - "scale-info", - "subxt-metadata", - "syn 1.0.109", - "tokio", -] - -[[package]] -name = "subxt-macro" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c08de402a78c4c06c3ee3702c80e519efdcb65911348e018b6998d04404916" -dependencies = [ - "darling", - "proc-macro-error", - "subxt-codegen", - "syn 1.0.109", -] - -[[package]] -name = "subxt-metadata" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2593ab5f53435e6352675af4f9851342607f37785d84c7a3fb3139550d3c35f0" -dependencies = [ - "frame-metadata", - "parity-scale-codec", - "scale-info", - "sp-core-hashing 6.0.0", -] - [[package]] name = "svg" version = "0.13.1" @@ -7868,48 +7340,26 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trie-db" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" -dependencies = [ - "hash-db 0.15.2", - "hashbrown 0.12.3", - "log", - "rustc-hex", - "smallvec", -] - [[package]] name = "trie-db" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db 0.16.0", + "hash-db", "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", ] -[[package]] -name = "trie-root" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" -dependencies = [ - "hash-db 0.15.2", -] - [[package]] name = "trie-root" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db 0.16.0", + "hash-db", ] [[package]] @@ -8411,16 +7861,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "wasmparser" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde01ade41ab9a5d10ec8ed0bb954238cf8625b5cd5a13093d6de2ad9c2be1a" -dependencies = [ - "indexmap", - "url", -] - [[package]] name = "wasmparser" version = "0.100.0" @@ -8431,31 +7871,6 @@ dependencies = [ "url", ] -[[package]] -name = "wasmtime" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ffcc607adc9da024e87ca814592d4bc67f5c5b58e488f5608d5734a1ebc23e" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap", - "libc", - "log", - "object 0.29.0", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser 0.96.0", - "wasmtime-environ 5.0.1", - "wasmtime-jit 5.0.1", - "wasmtime-runtime 5.0.1", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime" version = "6.0.1" @@ -8474,22 +7889,13 @@ dependencies = [ "psm", "serde", "target-lexicon", - "wasmparser 0.100.0", - "wasmtime-environ 6.0.1", - "wasmtime-jit 6.0.1", - "wasmtime-runtime 6.0.1", + "wasmparser", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", "windows-sys 0.42.0", ] -[[package]] -name = "wasmtime-asm-macros" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cb5dc4d79cd7b2453c395f64e9013d2ad90bd083be556d5565cb224ebe8d57" -dependencies = [ - "cfg-if", -] - [[package]] name = "wasmtime-asm-macros" version = "6.0.1" @@ -8499,25 +7905,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "wasmtime-environ" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9350c919553cddf14f78f9452119c8004d7ef6bfebb79a41a21819ed0c5604d8" -dependencies = [ - "anyhow", - "cranelift-entity 0.92.1", - "gimli 0.26.2", - "indexmap", - "log", - "object 0.29.0", - "serde", - "target-lexicon", - "thiserror", - "wasmparser 0.96.0", - "wasmtime-types 5.0.1", -] - [[package]] name = "wasmtime-environ" version = "6.0.1" @@ -8525,7 +7912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a6db9fc52985ba06ca601f2ff0ff1f526c5d724c7ac267b47326304b0c97883" dependencies = [ "anyhow", - "cranelift-entity 0.93.1", + "cranelift-entity", "gimli 0.26.2", "indexmap", "log", @@ -8533,31 +7920,8 @@ dependencies = [ "serde", "target-lexicon", "thiserror", - "wasmparser 0.100.0", - "wasmtime-types 6.0.1", -] - -[[package]] -name = "wasmtime-jit" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ba5779ea786386432b94c9fc9ad5597346c319e8239db0d98d5be5cc109a7e" -dependencies = [ - "addr2line 0.17.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.26.2", - "log", - "object 0.29.0", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ 5.0.1", - "wasmtime-jit-icache-coherence 5.0.1", - "wasmtime-runtime 5.0.1", - "windows-sys 0.42.0", + "wasmparser", + "wasmtime-types", ] [[package]] @@ -8577,21 +7941,12 @@ dependencies = [ "rustc-demangle", "serde", "target-lexicon", - "wasmtime-environ 6.0.1", - "wasmtime-jit-icache-coherence 6.0.1", - "wasmtime-runtime 6.0.1", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", "windows-sys 0.42.0", ] -[[package]] -name = "wasmtime-jit-debug" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9841a44c82c74101c10ad4f215392761a2523b3c6c838597962bdb6de75fdb3" -dependencies = [ - "once_cell", -] - [[package]] name = "wasmtime-jit-debug" version = "6.0.1" @@ -8601,17 +7956,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4356c2493002da3b111d470c2ecea65a3017009afce8adc46eaa5758739891" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime-jit-icache-coherence" version = "6.0.1" @@ -8623,30 +7967,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "wasmtime-runtime" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26efea7a790fcf430e663ba2519f0ab6eb8980adf8b0c58c62b727da77c2ec" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand 0.8.5", - "rustix 0.36.11", - "wasmtime-asm-macros 5.0.1", - "wasmtime-environ 5.0.1", - "wasmtime-jit-debug 5.0.1", - "windows-sys 0.42.0", -] - [[package]] name = "wasmtime-runtime" version = "6.0.1" @@ -8665,34 +7985,22 @@ dependencies = [ "paste", "rand 0.8.5", "rustix 0.36.11", - "wasmtime-asm-macros 6.0.1", - "wasmtime-environ 6.0.1", - "wasmtime-jit-debug 6.0.1", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", "windows-sys 0.42.0", ] -[[package]] -name = "wasmtime-types" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e1e4f66a2b9a114f9def450ab9971828c968db6ea6fccd613724b771fa4913" -dependencies = [ - "cranelift-entity 0.92.1", - "serde", - "thiserror", - "wasmparser 0.96.0", -] - [[package]] name = "wasmtime-types" version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6688d6f96d4dbc1f89fab626c56c1778936d122b5f4ae7a57c2eb42b8d982e2" dependencies = [ - "cranelift-entity 0.93.1", + "cranelift-entity", "serde", "thiserror", - "wasmparser 0.100.0", + "wasmparser", ] [[package]] @@ -8986,7 +8294,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 4.0.0", + "sp-weights", "xcm-procedural", ] @@ -9000,12 +8308,12 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-runtime 7.0.0", - "sp-std 5.0.0", - "sp-weights 4.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", "xcm", ] @@ -9035,12 +8343,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "yap" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" - [[package]] name = "zeroize" version = "1.6.0" diff --git a/subvt-types/Cargo.toml b/subvt-types/Cargo.toml index afbb7d51..ba84c0ca 100644 --- a/subvt-types/Cargo.toml +++ b/subvt-types/Cargo.toml @@ -37,5 +37,5 @@ sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "po sqlx = { git = "https://github.com/helikon-labs/sqlx.git", branch = "helikon-increased-field-count", features = ["postgres", "runtime-tokio-rustls", "chrono"] } subvt-proc-macro = { path = "../subvt-proc-macro" } subvt-utility = { path = "../subvt-utility" } -subxt = "0.27" +scale-bits = "0.3.0" thiserror = { workspace = true } \ No newline at end of file diff --git a/subvt-types/src/substrate/bits.rs b/subvt-types/src/substrate/bits.rs new file mode 100644 index 00000000..a0107aa0 --- /dev/null +++ b/subvt-types/src/substrate/bits.rs @@ -0,0 +1,119 @@ +use parity_scale_codec::{Compact, Decode, Encode, Error, Input}; +use scale_bits::{ + decode_using_format_from, + scale::format::{Format, OrderFormat, StoreFormat}, + Bits, +}; +use std::marker::PhantomData; + +fn bit_format() -> Format { + Format { + order: Order::FORMAT, + store: Store::FORMAT, + } +} + +macro_rules! store { + ($ident: ident; $(($ty: ident, $wrapped: ty)),*) => { + /// Associates `bitvec::store::BitStore` trait with corresponding, type-erased `scale_bits::StoreFormat` enum. + /// + /// Used to decode bit sequences by providing `scale_bits::StoreFormat` using + /// `bitvec`-like type type parameters. + pub trait $ident { + /// Corresponding `scale_bits::StoreFormat` value. + const FORMAT: StoreFormat; + /// Number of bits that the backing store types holds. + const BITS: u32; + } + + $( + impl $ident for $wrapped { + const FORMAT: StoreFormat = StoreFormat::$ty; + const BITS: u32 = <$wrapped>::BITS; + } + )* + }; +} + +macro_rules! order { + ($ident: ident; $($ty: ident),*) => { + /// Associates `bitvec::order::BitOrder` trait with corresponding, type-erased `scale_bits::OrderFormat` enum. + /// + /// Used to decode bit sequences in runtime by providing `scale_bits::OrderFormat` using + /// `bitvec`-like type type parameters. + pub trait $ident { + /// Corresponding `scale_bits::OrderFormat` value. + const FORMAT: OrderFormat; + } + + $( + #[doc = concat!("Type-level value that corresponds to `scale_bits::OrderFormat::", stringify!($ty), "` at run-time")] + #[doc = concat!(" and `bitvec::order::BitOrder::", stringify!($ty), "` at the type level.")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub enum $ty {} + impl $ident for $ty { + const FORMAT: OrderFormat = OrderFormat::$ty; + } + )* + }; +} + +store!(BitStore; (U8, u8), (U16, u16), (U32, u32), (U64, u64)); +order!(BitOrder; Lsb0, Msb0); + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct DecodedBits( + Bits, + PhantomData, + PhantomData, +); + +impl DecodedBits { + /// Extracts the underlying `scale_bits::Bits` value. + pub fn into_bits(self) -> Bits { + self.0 + } + + /// References the underlying `scale_bits::Bits` value. + pub fn as_bits(&self) -> &Bits { + &self.0 + } +} + +impl FromIterator for DecodedBits { + fn from_iter>(iter: T) -> Self { + DecodedBits(Bits::from_iter(iter), PhantomData, PhantomData) + } +} + +impl Decode for DecodedBits { + fn decode(input: &mut I) -> Result { + /// Equivalent of `BitSlice::MAX_BITS` on 32bit machine. + const ARCH32BIT_BITSLICE_MAX_BITS: u32 = 0x1fff_ffff; + + let Compact(bits) = >::decode(input)?; + // Otherwise it is impossible to store it on 32bit machine. + if bits > ARCH32BIT_BITSLICE_MAX_BITS { + return Err("Attempt to decode a BitVec with too many bits".into()); + } + // NOTE: Replace with `bits.div_ceil(Store::BITS)` if `int_roundings` is stabilised + let elements = (bits / Store::BITS) + u32::from(bits % Store::BITS != 0); + let bytes_in_elem = Store::BITS.saturating_div(u8::BITS); + let bytes_needed = (elements * bytes_in_elem) as usize; + + // NOTE: We could reduce allocations if it would be possible to directly + // decode from an `Input` type using a custom format (rather than default ) + // for the `Bits` type. + let mut storage = Encode::encode(&Compact(bits)); + let prefix_len = storage.len(); + storage.reserve_exact(bytes_needed); + storage.extend(vec![0; bytes_needed]); + input.read(&mut storage[prefix_len..])?; + + let decoder = decode_using_format_from(&storage, bit_format::())?; + let bits = decoder.collect::, _>>()?; + let bits = Bits::from_iter(bits); + + Ok(DecodedBits(bits, PhantomData, PhantomData)) + } +} diff --git a/subvt-types/src/substrate/metadata.rs b/subvt-types/src/substrate/metadata.rs index d8760bdd..c0ef1959 100644 --- a/subvt-types/src/substrate/metadata.rs +++ b/subvt-types/src/substrate/metadata.rs @@ -1,3 +1,4 @@ +use crate::substrate::bits::{DecodedBits, Lsb0, Msb0}; use crate::substrate::error::DecodeError; use crate::substrate::legacy::{LegacyDispatchError, LegacyDispatchInfo}; use frame_metadata::{v14::StorageHasher, RuntimeMetadataV14}; @@ -8,7 +9,6 @@ use scale_info::form::PortableForm; use scale_info::{Type, TypeDefPrimitive, Variant}; use sp_core::U256; use sp_runtime::DispatchError; -use subxt::utils::bits::{DecodedBits, Lsb0, Msb0}; pub fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { match hasher { diff --git a/subvt-types/src/substrate/mod.rs b/subvt-types/src/substrate/mod.rs index 8f644b34..c31703b0 100644 --- a/subvt-types/src/substrate/mod.rs +++ b/subvt-types/src/substrate/mod.rs @@ -27,6 +27,7 @@ pub type CallHash = [u8; 32]; pub type OpaqueTimeSlot = Vec; pub type Balance = polkadot_core_primitives::Balance; +pub mod bits; pub mod democracy; pub mod error; #[macro_use]