diff --git a/Cargo.lock b/Cargo.lock index e39665fd3..444580d7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,7 +200,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -607,7 +607,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", "synstructure 0.13.1", ] @@ -630,7 +630,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -688,7 +688,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -738,7 +738,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -825,7 +825,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -864,6 +864,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -1246,7 +1247,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1645,7 +1646,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1672,7 +1673,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1689,7 +1690,7 @@ checksum = "98532a60dedaebc4848cb2cba5023337cc9ea3af16a5b062633fabfd9f18fb60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1713,7 +1714,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1724,7 +1725,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1833,7 +1834,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1846,7 +1847,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1935,7 +1936,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -1959,7 +1960,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.93", "termcolor", "toml 0.8.19", "walkdir", @@ -2121,7 +2122,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -2141,7 +2142,18 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.93", ] [[package]] @@ -2187,9 +2199,9 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] @@ -2220,12 +2232,12 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom", "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", - "primitive-types", + "impl-serde 0.4.0", + "primitive-types 0.12.2", "scale-info", - "uint", + "uint 0.9.5", ] [[package]] @@ -2269,7 +2281,7 @@ dependencies = [ "evm-runtime", "log", "parity-scale-codec", - "primitive-types", + "primitive-types 0.12.2", "rlp", "scale-info", "serde", @@ -2283,7 +2295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1da6cedc5cedb4208e59467106db0d1f50db01b920920589f8e672c02fdc04f" dependencies = [ "parity-scale-codec", - "primitive-types", + "primitive-types 0.12.2", "scale-info", "serde", ] @@ -2297,7 +2309,7 @@ dependencies = [ "environmental", "evm-core", "evm-runtime", - "primitive-types", + "primitive-types 0.12.2", ] [[package]] @@ -2309,7 +2321,7 @@ dependencies = [ "auto_impl", "environmental", "evm-core", - "primitive-types", + "primitive-types 0.12.2", "sha3", ] @@ -2334,7 +2346,7 @@ dependencies = [ "prettyplease 0.2.22", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -2640,12 +2652,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foldhash" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" - [[package]] name = "foreign-types" version = "0.3.2" @@ -2694,7 +2700,7 @@ version = "1.0.0-dev" source = "git+https://github.com/gztensor/frontier?rev=b9c606f9#b9c606f9baac5f3111f73c3bb857aa6ea862d7b8" dependencies = [ "hex", - "impl-serde", + "impl-serde 0.4.0", "libsecp256k1", "log", "parity-scale-codec", @@ -2872,6 +2878,33 @@ dependencies = [ "thousands", ] +[[package]] +name = "frame-election-provider-solution-type" +version = "14.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.93", +] + +[[package]] +name = "frame-election-provider-support" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", +] + [[package]] name = "frame-executive" version = "38.0.0" @@ -2975,7 +3008,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -2988,7 +3021,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -3000,7 +3033,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -3011,7 +3044,7 @@ checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -3021,7 +3054,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -3192,7 +3225,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -3481,11 +3514,6 @@ name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] [[package]] name = "hashlink" @@ -3709,9 +3737,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -3745,15 +3773,15 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.4.1", "pin-project-lite", "tokio", "tower-service", @@ -3876,6 +3904,26 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67aa010c1e3da95bf151bd8b4c059b2ed7e75387cdb969b4f8f2723a43f9941" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + [[package]] name = "impl-rlp" version = "0.3.0" @@ -3894,6 +3942,15 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -4077,9 +4134,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" +checksum = "126b48a5acc3c52fbd5381a77898cb60e145123179588a29e7ac48f9c06e401b" dependencies = [ "jsonrpsee-core", "jsonrpsee-proc-macros", @@ -4091,9 +4148,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2882f6f8acb9fdaec7cefc4fd607119a9bd709831df7d7672a1d3b644628280" +checksum = "b0e503369a76e195b65af35058add0e6900b794a4e9a9316900ddd3a87a80477" dependencies = [ "async-trait", "bytes", @@ -4114,28 +4171,28 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06c01ae0007548e73412c08e2285ffe5d723195bf268bce67b1b77c3bb2a14d" +checksum = "fc660a9389e2748e794a40673a4155d501f32db667757cdb80edeff0306b489b" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] name = "jsonrpsee-server" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ad8ddc14be1d4290cd68046e7d1d37acd408efed6d3ca08aefcc3ad6da069c" +checksum = "af6e6c9b6d975edcb443565d648b605f3e85a04ec63aa6941811a8894cc9cded" dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.4.1", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -4154,9 +4211,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a178c60086f24cc35bb82f57c651d0d25d99c4742b4d335de04e97fa1f08a8a1" +checksum = "d8fb16314327cbc94fdf7965ef7e4422509cd5597f76d137bd104eb34aeede67" dependencies = [ "http 1.1.0", "serde", @@ -4335,7 +4392,7 @@ dependencies = [ "libp2p-identity", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.1", "multistream-select", "once_cell", "parking_lot 0.12.3", @@ -4380,7 +4437,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "lru 0.12.5", + "lru 0.12.4", "quick-protobuf", "quick-protobuf-codec", "smallvec", @@ -4397,7 +4454,7 @@ dependencies = [ "bs58 0.5.1", "ed25519-dalek", "hkdf", - "multihash 0.19.2", + "multihash 0.19.1", "quick-protobuf", "rand", "sha2 0.10.8", @@ -4430,7 +4487,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "thiserror", - "uint", + "uint 0.9.5", "unsigned-varint 0.7.2", "void", ] @@ -4486,7 +4543,7 @@ dependencies = [ "libp2p-identity", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.1", "once_cell", "quick-protobuf", "rand", @@ -4591,7 +4648,7 @@ dependencies = [ "proc-macro-warning 0.4.2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -4892,7 +4949,7 @@ dependencies = [ "tokio-util", "tracing", "trust-dns-resolver", - "uint", + "uint 0.9.5", "unsigned-varint 0.8.0", "url", "webpki", @@ -4929,11 +4986,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.14.5", ] [[package]] @@ -4982,7 +5039,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -4996,7 +5053,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5007,7 +5064,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5018,7 +5075,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5181,6 +5238,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mmr-rpc" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + [[package]] name = "mockall" version = "0.11.4" @@ -5232,7 +5304,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5265,7 +5337,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.2", + "multihash 0.19.1", "percent-encoding", "serde", "static_assertions", @@ -5320,12 +5392,12 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint 0.8.0", + "unsigned-varint 0.7.2", ] [[package]] @@ -5348,6 +5420,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multistream-select" version = "0.13.0" @@ -5386,7 +5464,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5551,10 +5629,12 @@ dependencies = [ "node-subtensor-runtime", "pallet-commitments", "pallet-drand", + "pallet-staking", "pallet-transaction-payment", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", + "polkadot-rpc", "sc-basic-authorship", "sc-chain-spec", "sc-chain-spec-derive", @@ -5562,6 +5642,8 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-babe", + "sc-consensus-babe-rpc", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-consensus-manual-seal", @@ -5580,10 +5662,12 @@ dependencies = [ "serde", "serde_json", "sp-api", + "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-consensus-babe", "sp-consensus-grandpa", "sp-core", "sp-crypto-ec-utils 0.14.0", @@ -5594,8 +5678,10 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", + "sp-staking", "sp-timestamp", "sp-transaction-pool", + "sp-transaction-storage-proof", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -5615,6 +5701,7 @@ dependencies = [ "fp-rpc", "fp-self-contained", "frame-benchmarking", + "frame-election-provider-support", "frame-executive", "frame-metadata", "frame-metadata-hash-extension", @@ -5628,28 +5715,42 @@ dependencies = [ "log", "pallet-admin-utils", "pallet-aura", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", "pallet-balances", "pallet-base-fee", "pallet-collective", "pallet-commitments", "pallet-drand", "pallet-dynamic-fee", + "pallet-election-provider-multi-phase", "pallet-ethereum", "pallet-evm", "pallet-evm-chain-id", "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-fast-unstake", "pallet-grandpa", "pallet-hotfix-sufficients", "pallet-insecure-randomness-collective-flip", "pallet-membership", "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-runtime-api", + "pallet-offences", "pallet-preimage", "pallet-proxy", "pallet-registry", "pallet-safe-mode", "pallet-scheduler", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-reward-fn", + "pallet-staking-runtime-api", "pallet-subtensor", "pallet-sudo", "pallet-timestamp", @@ -5657,21 +5758,27 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-runtime-common", "rand_chacha", "scale-info", "serde_json", "sha2 0.10.8", "smallvec", "sp-api", + "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", + "sp-consensus-babe", "sp-core", "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-session", + "sp-staking", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", "sp-storage 21.0.0", "sp-tracing 17.0.1", @@ -5846,7 +5953,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5920,9 +6027,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -5941,7 +6048,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -5952,18 +6059,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.3.2+3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -6012,6 +6119,38 @@ dependencies = [ "subtensor-macros", ] +[[package]] +name = "pallet-asset-conversion" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-asset-rate" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-aura" version = "37.0.0" @@ -6028,6 +6167,21 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-authority-discovery" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", +] + [[package]] name = "pallet-authorship" version = "38.0.0" @@ -6041,6 +6195,50 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-babe" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", +] + +[[package]] +name = "pallet-bags-list" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "aquamarine", + "docify", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-tracing 17.0.1", +] + [[package]] name = "pallet-balances" version = "39.0.0" @@ -6070,6 +6268,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-broker" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-collective" version = "4.0.0-dev" @@ -6153,6 +6369,41 @@ dependencies = [ "sp-inherents", ] +[[package]] +name = "pallet-election-provider-multi-phase" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec", + "rand", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "strum 0.26.3", +] + +[[package]] +name = "pallet-election-provider-support-benchmarking" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec", + "sp-npos-elections", + "sp-runtime", +] + [[package]] name = "pallet-ethereum" version = "4.0.0-dev" @@ -6237,6 +6488,24 @@ dependencies = [ "sp-io", ] +[[package]] +name = "pallet-fast-unstake" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", +] + [[package]] name = "pallet-grandpa" version = "38.0.0" @@ -6275,32 +6544,84 @@ dependencies = [ ] [[package]] -name = "pallet-insecure-randomness-collective-flip" -version = "26.0.0" +name = "pallet-identity" +version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ + "enumflags2", + "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", - "safe-mix", "scale-info", + "sp-io", "sp-runtime", ] [[package]] -name = "pallet-membership" -version = "38.0.0" +name = "pallet-insecure-randomness-collective-flip" +version = "26.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", - "log", + "parity-scale-codec", + "safe-mix", + "scale-info", + "sp-runtime", +] + +[[package]] +name = "pallet-membership" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-message-queue" +version = "41.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-arithmetic", "sp-core", "sp-io", "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-mmr" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", ] [[package]] @@ -6318,6 +6639,50 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-nomination-pools" +version = "35.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-tracing 17.0.1", +] + +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "33.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "pallet-nomination-pools", + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "pallet-offences" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-staking", +] + [[package]] name = "pallet-preimage" version = "38.0.0" @@ -6421,6 +6786,58 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "pallet-staking" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand_chacha", + "scale-info", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", +] + +[[package]] +name = "pallet-staking-reward-curve" +version = "12.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.93", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-staking-runtime-api" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-staking", +] + [[package]] name = "pallet-subtensor" version = "4.0.0-dev" @@ -6543,6 +6960,24 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "pallet-treasury" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-utility" version = "38.0.0" @@ -6558,6 +6993,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-vesting" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "parity-bip39" version = "2.0.1" @@ -6632,7 +7081,7 @@ dependencies = [ "lru 0.8.1", "parity-util-mem-derive", "parking_lot 0.12.3", - "primitive-types", + "primitive-types 0.12.2", "smallvec", "winapi", ] @@ -6793,7 +7242,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -6834,7 +7283,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -6865,6 +7314,215 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + +[[package]] +name = "polkadot-core-primitives" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "polkadot-parachain-primitives" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bounded-collections", + "derive_more", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-primitives" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bitvec", + "hex-literal", + "log", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", +] + +[[package]] +name = "polkadot-rpc" +version = "18.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-rpc-spec-v2", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime-common" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-identity", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bs58 0.5.1", + "frame-benchmarking", + "parity-scale-codec", + "polkadot-primitives", + "sp-tracing 17.0.1", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-message-queue", + "pallet-mmr", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand", + "rand_chacha", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", + "staging-xcm", + "staging-xcm-executor", + "static_assertions", +] + [[package]] name = "polkavm" version = "0.9.3" @@ -6874,7 +7532,7 @@ dependencies = [ "libc", "log", "polkavm-assembler", - "polkavm-common", + "polkavm-common 0.9.0", "polkavm-linux-raw", ] @@ -6896,13 +7554,28 @@ dependencies = [ "log", ] +[[package]] +name = "polkavm-common" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" + [[package]] name = "polkavm-derive" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.9.0", +] + +[[package]] +name = "polkavm-derive" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +dependencies = [ + "polkavm-derive-impl-macro 0.18.0", ] [[package]] @@ -6911,10 +7584,22 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ - "polkavm-common", + "polkavm-common 0.9.0", + "proc-macro2", + "quote", + "syn 2.0.93", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12d2840cc62a0550156b1676fed8392271ddf2fab4a00661db56231424674624" +dependencies = [ + "polkavm-common 0.18.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -6923,8 +7608,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ - "polkavm-derive-impl", - "syn 2.0.90", + "polkavm-derive-impl 0.9.0", + "syn 2.0.93", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +dependencies = [ + "polkavm-derive-impl 0.18.0", + "syn 2.0.93", ] [[package]] @@ -6937,7 +7632,7 @@ dependencies = [ "hashbrown 0.14.5", "log", "object 0.32.2", - "polkavm-common", + "polkavm-common 0.9.0", "regalloc2 0.9.3", "rustc-demangle", ] @@ -7064,7 +7759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7074,11 +7769,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", - "uint", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec 0.7.0", + "impl-num-traits", + "uint 0.10.0", ] [[package]] @@ -7132,7 +7839,7 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7143,7 +7850,7 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7171,7 +7878,7 @@ dependencies = [ "quote", "regex", "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7208,7 +7915,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7242,7 +7949,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", "prettyplease 0.1.25", "prost 0.11.9", @@ -7263,14 +7970,14 @@ dependencies = [ "heck 0.5.0", "itertools 0.12.1", "log", - "multimap", + "multimap 0.10.0", "once_cell", "petgraph", "prettyplease 0.2.22", "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.93", "tempfile", ] @@ -7297,7 +8004,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -7624,7 +8331,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -8094,7 +8801,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -8280,6 +8987,84 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.45.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "futures", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-beefy" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "array-bytes", + "async-channel", + "async-trait", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", + "sc-network-types", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "tokio", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-application-crypto", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-consensus-epochs" version = "0.44.0" @@ -8716,7 +9501,7 @@ dependencies = [ "litep2p", "log", "multiaddr 0.18.2", - "multihash 0.19.2", + "multihash 0.19.1", "rand", "thiserror", "zeroize", @@ -8828,7 +9613,7 @@ dependencies = [ "governor", "http 1.1.0", "http-body-util", - "hyper 1.5.0", + "hyper 1.4.1", "ip_network", "jsonrpsee", "log", @@ -8948,6 +9733,25 @@ dependencies = [ "sp-core", ] +[[package]] +name = "sc-sync-state-rpc" +version = "0.45.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-sysinfo" version = "38.0.0" @@ -9026,7 +9830,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -9324,9 +10128,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -9361,13 +10165,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -9428,7 +10232,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -9590,6 +10394,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" +[[package]] +name = "slot-range-helper" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -9688,7 +10503,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -9726,6 +10541,18 @@ dependencies = [ "sp-crypto-ec-utils 0.10.0", ] +[[package]] +name = "sp-authority-discovery" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", +] + [[package]] name = "sp-block-builder" version = "34.0.0" @@ -9804,6 +10631,27 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "22.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", + "sp-io", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "sp-weights", + "strum 0.26.3", +] + [[package]] name = "sp-consensus-grandpa" version = "21.0.0" @@ -9847,7 +10695,7 @@ dependencies = [ "futures", "hash-db", "hash256-std-hasher", - "impl-serde", + "impl-serde 0.4.0", "itertools 0.11.0", "k256", "libsecp256k1", @@ -9857,7 +10705,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "paste", - "primitive-types", + "primitive-types 0.12.2", "rand", "scale-info", "schnorrkel", @@ -9881,7 +10729,7 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -9952,7 +10800,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -9971,23 +10819,23 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "environmental", "parity-scale-codec", @@ -10040,7 +10888,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.9.1", "rustversion", "secp256k1", "sp-core", @@ -10106,6 +10954,36 @@ dependencies = [ "sp-application-crypto", ] +[[package]] +name = "sp-mmr-primitives" +version = "34.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sp-npos-elections" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", +] + [[package]] name = "sp-offchain" version = "34.0.0" @@ -10165,13 +11043,13 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.18.0", + "primitive-types 0.13.1", "sp-externalities 0.25.0", "sp-runtime-interface-proc-macro 17.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", @@ -10189,8 +11067,8 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", - "primitive-types", + "polkavm-derive 0.9.1", + "primitive-types 0.12.2", "sp-externalities 0.29.0", "sp-runtime-interface-proc-macro 18.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409)", @@ -10203,14 +11081,14 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "Inflector", "expander", "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10223,7 +11101,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10305,14 +11183,14 @@ source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ - "impl-serde", + "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", @@ -10324,7 +11202,7 @@ name = "sp-storage" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "impl-serde", + "impl-serde 0.4.0", "parity-scale-codec", "ref-cast", "serde", @@ -10346,7 +11224,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "parity-scale-codec", "tracing", @@ -10416,7 +11294,7 @@ name = "sp-version" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ - "impl-serde", + "impl-serde 0.4.0", "parity-scale-codec", "parity-wasm", "scale-info", @@ -10436,13 +11314,13 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#8614dc0e055d06de4a3774ac1da0a422b33f34e2" +source = "git+https://github.com/paritytech/polkadot-sdk#cdf3a2dc1385debf50096d54d4abf838c6cad4f7" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10580,7 +11458,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10601,7 +11479,7 @@ dependencies = [ "sha2 0.10.8", "sqlx-core", "sqlx-sqlite", - "syn 2.0.90", + "syn 2.0.93", "tempfile", "tokio", "url", @@ -10670,6 +11548,48 @@ dependencies = [ "xcm-procedural", ] +[[package]] +name = "staging-xcm-builder" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", +] + +[[package]] +name = "staging-xcm-executor" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "tracing", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -10768,7 +11688,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10825,7 +11745,7 @@ version = "0.17.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" dependencies = [ "http-body-util", - "hyper 1.5.0", + "hyper 1.4.1", "hyper-util", "log", "prometheus", @@ -10833,6 +11753,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2409#87971b3e92721bdf10bf40b410eaae779d494ca0" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-client-api", + "sc-rpc-api", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + [[package]] name = "substrate-wasm-builder" version = "24.0.1" @@ -10872,7 +11809,7 @@ dependencies = [ "quote", "rayon", "subtensor-linting", - "syn 2.0.90", + "syn 2.0.93", "walkdir", ] @@ -10908,7 +11845,7 @@ dependencies = [ "proc-macro2", "procedural-fork", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10918,7 +11855,7 @@ dependencies = [ "ahash 0.8.11", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -10956,9 +11893,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -10985,7 +11922,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -11076,7 +12013,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -11223,7 +12160,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -11383,7 +12320,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -11616,6 +12553,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicode-bidi" version = "0.3.17" @@ -11817,7 +12766,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", "wasm-bindgen-shared", ] @@ -11851,7 +12800,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -12555,7 +13504,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -12615,7 +13564,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] @@ -12635,7 +13584,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.93", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 132533d80..2e8a7ae11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,6 +85,41 @@ walkdir = "2" subtensor-macros = { path = "support/macros" } +frame-election-provider-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-bags-list = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-fast-unstake = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-nomination-pools = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-staking-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +runtime-common = { package = "polkadot-runtime-common", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } + +sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } + +sp-authority-discovery-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sp-transaction-storage-proof = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } + + +authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +polkadot-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +parity-scale-codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ + "derive", + "max-encoded-len", +] } frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } @@ -108,35 +143,35 @@ pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk.git", tag pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-chain-spec-derive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-network = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-service = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-chain-spec-derive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false} +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } @@ -150,16 +185,16 @@ sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "po sp-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-storage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-version = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sp-weights = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } -substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -substrate-fixed = { git = "https://github.com/opentensor/substrate-fixed.git", tag = "v0.5.9" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } -substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +substrate-fixed = { git = "https://github.com/opentensor/substrate-fixed.git", tag = "v0.5.9", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index 123ef44a3..a948d61f8 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -48,13 +48,19 @@ sc-consensus = { workspace = true } sc-consensus-grandpa = { workspace = true } sc-consensus-grandpa-rpc = { workspace = true } sp-consensus-grandpa = { workspace = true } +sp-authority-discovery = { workspace = true } sc-chain-spec-derive = { workspace = true } sc-chain-spec = { workspace = true } sc-consensus-slots = { workspace = true } +sc-consensus-babe = { workspace = true } +sc-consensus-babe-rpc = { workspace = true, default-features = true } +babe-primitives = { workspace = true } sc-client-api = { workspace = true } sp-runtime = { workspace = true } sp-io = { workspace = true } sp-timestamp = { workspace = true } +sp-transaction-storage-proof = { workspace = true } +sp-staking = { workspace = true } sp-transaction-pool = { workspace = true, features = ["default"] } sp-inherents = { workspace = true } sp-keyring = { workspace = true } @@ -64,6 +70,11 @@ frame-metadata-hash-extension = { workspace = true } frame-system = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-commitments = { path = "../pallets/commitments" } +pallet-staking = { workspace = true } +polkadot-rpc = { workspace = true } +pallet-drand = { workspace = true } +sp-crypto-ec-utils = { workspace = true } +sp-keystore = { workspace = true, default-features = false } pallet-drand = { workspace = true } sp-crypto-ec-utils = { workspace = true } sp-keystore = { workspace = true, default-features = false } @@ -114,13 +125,14 @@ substrate-build-script-utils = { workspace = true } [features] default = ["rocksdb", "sql", "txpool"] -fast-blocks = ["node-subtensor-runtime/fast-blocks"] +fast-runtime = ["node-subtensor-runtime/fast-runtime"] sql = ["fc-db/sql", "fc-mapping-sync/sql"] rocksdb = [ "sc-service/rocksdb", "fc-db/rocksdb", "fc-mapping-sync/rocksdb", "fc-rpc/rocksdb", + "sc-cli/rocksdb" ] txpool = ["fc-rpc/txpool", "fc-rpc-core/txpool"] @@ -133,6 +145,8 @@ runtime-benchmarks = [ "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "pallet-commitments/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "sp-staking/runtime-benchmarks", "pallet-drand/runtime-benchmarks" ] pow-faucet = [] @@ -145,6 +159,7 @@ try-runtime = [ "pallet-transaction-payment/try-runtime", "sp-runtime/try-runtime", "pallet-commitments/try-runtime", + "pallet-staking/try-runtime", "pallet-drand/try-runtime" ] diff --git a/node/src/chain_spec/localnet.rs b/node/src/chain_spec/localnet.rs index 06ff5b755..95df80671 100644 --- a/node/src/chain_spec/localnet.rs +++ b/node/src/chain_spec/localnet.rs @@ -1,6 +1,14 @@ // Allowed since it's actually better to panic during chain setup when there is an error #![allow(clippy::unwrap_used)] +use babe_primitives::AuthorityId as BabeId; +use node_subtensor_runtime::{opaque::SessionKeys, BABE_GENESIS_EPOCH_CONFIG, UNITS}; +use pallet_staking::Forcing; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_runtime::Perbill; +use sp_staking::StakerStatus; + use super::*; pub fn localnet_config(single_authority: bool) -> Result { @@ -49,7 +57,7 @@ pub fn localnet_config(single_authority: bool) -> Result { } fn localnet_genesis( - initial_authorities: Vec<(AuraId, GrandpaId)>, + initial_authorities: Vec<(AccountId, GrandpaId, BabeId, AuthorityDiscoveryId)>, _enable_println: bool, ) -> serde_json::Value { let mut balances = vec![ @@ -79,6 +87,10 @@ fn localnet_genesis( ), ]; + for a in initial_authorities.iter() { + balances.push((a.0.clone(), 2000000000000u128)); + } + // Check if the environment variable is set if let Ok(bt_wallet) = env::var("BT_DEFAULT_TOKEN_WALLET") { if let Ok(decoded_wallet) = Ss58Codec::from_ss58check(&bt_wallet) { @@ -100,17 +112,37 @@ fn localnet_genesis( get_account_id_from_seed::("Ferdie"), ]; + const STAKE: u64 = 1000 * UNITS; serde_json::json!({ "balances": { "balances": balances }, - "aura": { - "authorities": initial_authorities.iter().map(|x| (x.0.clone())).collect::>() + "session": { + "keys": initial_authorities + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + SessionKeys { + grandpa: x.1.clone(), + babe: x.2.clone(), + authority_discovery: x.3.clone(), + }, + ) + }) + .collect::>(), }, - "grandpa": { - "authorities": initial_authorities + "staking": { + "minimumValidatorCount": 1, + "validatorCount": initial_authorities.len() as u32, + "stakers": initial_authorities .iter() - .map(|x| (x.1.clone(), 1)) - .collect::>() + .map(|x| (x.0.clone(), x.0.clone(), STAKE, StakerStatus::::Validator)) + .collect::>(), + "invulnerables": initial_authorities.iter().map(|x| x.0.clone()).collect::>(), + "forceEra": Forcing::NotForcing, + "slashRewardFraction": Perbill::from_percent(10), }, + "babe": { "epochConfig": BABE_GENESIS_EPOCH_CONFIG }, "sudo": { "key": Some(get_account_id_from_seed::("Alice")) }, diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 5d908430a..7beb9f124 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -6,9 +6,11 @@ pub mod finney; pub mod localnet; pub mod testnet; +use babe_primitives::AuthorityId as BabeId; use node_subtensor_runtime::{AccountId, Block, Signature, WASM_BINARY}; use sc_chain_spec_derive::ChainSpecExtension; use sc_service::ChainType; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::crypto::Ss58Codec; @@ -52,9 +54,14 @@ where AccountPublic::from(get_from_seed::(seed)).into_account() } -/// Generate an Aura authority key. -pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { - (get_from_seed::(s), get_from_seed::(s)) +/// Generates authority keys. +pub fn authority_keys_from_seed(s: &str) -> (AccountId, GrandpaId, BabeId, AuthorityDiscoveryId) { + ( + get_account_id_from_seed::(&format!("{}//stash", s)), + get_from_seed::(s), + get_from_seed::(s), + get_from_seed::(s), + ) } pub fn authority_keys_from_ss58(s_aura: &str, s_grandpa: &str) -> (AuraId, GrandpaId) { diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index d709c70c5..4ff58fc6a 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -45,22 +45,9 @@ pub mod pallet { /// Because this pallet emits events, it depends on the runtime's definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Implementation of the AuraInterface - type Aura: crate::AuraInterface<::AuthorityId, Self::MaxAuthorities>; - /// Implementation of [`GrandpaInterface`] type Grandpa: crate::GrandpaInterface; - /// The identifier type for an authority. - type AuthorityId: Member - + Parameter - + RuntimeAppPublic - + MaybeSerializeDeserialize - + MaxEncodedLen; - - /// The maximum number of authorities that the pallet can hold. - type MaxAuthorities: Get; - /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; @@ -85,28 +72,11 @@ pub mod pallet { /// Dispatchable functions allows users to interact with the pallet and invoke state changes. #[pallet::call] impl Pallet { - /// The extrinsic sets the new authorities for Aura consensus. - /// It is only callable by the root account. - /// The extrinsic will call the Aura pallet to change the authorities. - #[pallet::call_index(0)] - #[pallet::weight(::WeightInfo::swap_authorities(new_authorities.len() as u32))] - pub fn swap_authorities( - origin: OriginFor, - new_authorities: BoundedVec<::AuthorityId, T::MaxAuthorities>, - ) -> DispatchResult { - ensure_root(origin)?; - - T::Aura::change_authorities(new_authorities.clone()); - - log::debug!("Aura authorities changed: {:?}", new_authorities); - - // Return a successful DispatchResultWithPostInfo - Ok(()) - } - /// The extrinsic sets the default take for the network. /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the default take. + /// + /// Start at call_index(1) because index 0 was used for a now removed call. #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::sudo_set_default_take())] pub fn sudo_set_default_take(origin: OriginFor, default_take: u16) -> DispatchResult { @@ -1279,21 +1249,6 @@ pub mod pallet { } } -impl sp_runtime::BoundToRuntimeAppPublic for Pallet { - type Public = ::AuthorityId; -} - -// Interfaces to interact with other pallets -use sp_runtime::BoundedVec; - -pub trait AuraInterface { - fn change_authorities(new: BoundedVec); -} - -impl AuraInterface for () { - fn change_authorities(_: BoundedVec) {} -} - pub trait GrandpaInterface where Runtime: frame_system::Config, diff --git a/pallets/subtensor/Cargo.toml b/pallets/subtensor/Cargo.toml index da4cac3be..a715e2e63 100644 --- a/pallets/subtensor/Cargo.toml +++ b/pallets/subtensor/Cargo.toml @@ -131,4 +131,4 @@ try-runtime = [ "pallet-drand/try-runtime" ] pow-faucet = [] -fast-blocks = [] +fast-runtime = [] diff --git a/pallets/subtensor/src/coinbase/root.rs b/pallets/subtensor/src/coinbase/root.rs index 9d53151b4..3f62eb534 100644 --- a/pallets/subtensor/src/coinbase/root.rs +++ b/pallets/subtensor/src/coinbase/root.rs @@ -333,7 +333,7 @@ impl Pallet { if blocks_until_next_epoch != 0 { // Not the block to update emission values. log::debug!("blocks_until_next_epoch: {:?}", blocks_until_next_epoch); - return Err(""); + // return Err(""); } // --- 2. Retrieves the number of root validators on subnets. @@ -341,7 +341,7 @@ impl Pallet { log::debug!("n:\n{:?}\n", n); if n == 0 { // No validators. - return Err("No validators to validate emission values."); + // return Err("No validators to validate emission values."); } // --- 3. Obtains the number of registered subnets. @@ -349,13 +349,25 @@ impl Pallet { log::debug!("k:\n{:?}\n", k); if k == 0 { // No networks to validate. - return Err("No networks to validate emission values."); + // return Err("No networks to validate emission values."); } - // --- 4. Determines the total block emission across all the subnetworks. This is the - // value which will be distributed based on the computation below. - let block_emission: I64F64 = I64F64::from_num(Self::get_block_emission()?); - log::debug!("block_emission:\n{:?}\n", block_emission); + // --- 4. Determines the total block emission across all the subnetworks, node + // validators and node validator nominators. This is the value which will be + // distributed based on the computation below. + // + // The node validator emission is set aside in a seperate tracked storage for later + // distribution. + let total_block_emission: I64F64 = I64F64::from_num(Self::get_block_emission()?); + let subnetwork_block_emission = total_block_emission.saturating_mul(I64F64::from_num(0.2)); + let node_validator_block_emission = total_block_emission.saturating_mul(I64F64::from_num(0.8)); + PendingNodeValidatorEmissions::::mutate(|cur| { + cur.saturating_accrue(node_validator_block_emission.to_num::()); + }); + + log::debug!("total_block_emission:\n{:?}\n", total_block_emission); + log::debug!("node_validator_block_emission:\n{:?}\n", node_validator_block_emission); + log::debug!("subnetwork_block_emission:\n{:?}\n", subnetwork_block_emission); // --- 5. A collection of all registered hotkeys on the root network. Hotkeys // pairs with network UIDs and stake values. @@ -450,7 +462,7 @@ impl Pallet { // -- 11. Converts the normalized 64-bit fixed point rank values to u64 for the final emission calculation. let emission_as_tao: Vec = weighted_emission .iter() - .map(|v: &I64F64| v.saturating_mul(block_emission)) + .map(|v: &I64F64| v.saturating_mul(subnetwork_block_emission)) .collect(); // --- 12. Converts the normalized 64-bit fixed point rank values to u64 for the final emission calculation. diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 2f92fd60e..3e118a13c 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -936,6 +936,9 @@ pub mod pallet { /// ITEM( nominator_min_required_stake ) pub type NominatorMinRequiredStake = StorageValue<_, u64, ValueQuery, DefaultNominatorMinRequiredStake>; + #[pallet::storage] + /// ITEM ( pending_node_validator_emission ) + pub type PendingNodeValidatorEmissions = StorageValue<_, u64, ValueQuery>; /// ============================ /// ==== Subnet Parameters ===== diff --git a/pallets/subtensor/src/subnets/registration.rs b/pallets/subtensor/src/subnets/registration.rs index 516fd8cf3..aaa4c4571 100644 --- a/pallets/subtensor/src/subnets/registration.rs +++ b/pallets/subtensor/src/subnets/registration.rs @@ -381,7 +381,7 @@ impl Pallet { ); // --- 3. Ensure the supplied work passes the difficulty. - let difficulty: U256 = if !cfg!(feature = "fast-blocks") { + let difficulty: U256 = if !cfg!(feature = "fast-runtime") { U256::from(1_000_000) // Base faucet difficulty. } else { U256::from(100) // Lowered for fast blocks diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index cdb8fd52f..b491f79a8 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -56,6 +56,10 @@ sp-session = { workspace = true } sp-std = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } +babe-primitives = { workspace = true } +authority-discovery-primitives = { workspace = true } +runtime-common = { workspace = true } +polkadot-core-primitives = { workspace = true } # Temporary sudo pallet-sudo = { workspace = true } @@ -94,6 +98,25 @@ pallet-registry = { default-features = false, path = "../pallets/registry" } # Metadata commitment pallet pallet-commitments = { default-features = false, path = "../pallets/commitments" } +# PoS +frame-election-provider-support = { workspace = true } +pallet-authority-discovery = { workspace = true } +pallet-babe = { workspace = true } +pallet-bags-list = { workspace = true } +pallet-staking = { workspace = true } +pallet-staking-runtime-api = { workspace = true } +pallet-session = { workspace = true } +pallet-fast-unstake = { workspace = true } +pallet-nomination-pools = { workspace = true } +pallet-nomination-pools-runtime-api = { workspace = true } +pallet-offences = { workspace = true } +pallet-authorship = { workspace = true } +pallet-election-provider-multi-phase = { workspace = true } +pallet-staking-reward-fn = { workspace = true } +pallet-staking-reward-curve = { workspace = true } +sp-staking = { workspace = true } +sp-npos-elections = { workspace = true } + # Frontier fp-evm = { workspace = true } fp-rpc = { workspace = true } @@ -132,8 +155,7 @@ substrate-wasm-builder = { workspace = true, optional = true } [features] default = ["std"] pow-faucet = ["pallet-subtensor/pow-faucet"] -fast-blocks = [ - "pallet-subtensor/fast-blocks" +fast-runtime = [ "pallet-subtensor/fast-runtime" ] std = [ "frame-try-runtime?/std", @@ -187,6 +209,26 @@ std = [ "log/std", "sp-storage/std", "sp-genesis-builder/std", + "pallet-babe/std", + "pallet-session/std", + "pallet-staking/std", + "pallet-election-provider-multi-phase/std", + "frame-election-provider-support/std", + "pallet-authority-discovery/std", + "pallet-authorship/std", + "pallet-bags-list/std", + "pallet-fast-unstake/std", + "pallet-nomination-pools-runtime-api/std", + "pallet-nomination-pools/std", + "pallet-offences/std", + "pallet-staking-reward-fn/std", + "pallet-staking-runtime-api/std", + "runtime-common/std", + "authority-discovery-primitives/std", + "babe-primitives/std", + "sp-npos-elections/std", + "sp-staking/std", + "polkadot-core-primitives/std", # Frontier "fp-evm/std", "fp-rpc/std", @@ -233,6 +275,16 @@ runtime-benchmarks = [ "pallet-preimage/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", + "pallet-babe/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-election-provider-multi-phase/runtime-benchmarks", + "frame-election-provider-support/runtime-benchmarks", + "pallet-bags-list/runtime-benchmarks", + "pallet-fast-unstake/runtime-benchmarks", + "pallet-nomination-pools/runtime-benchmarks", + "pallet-offences/runtime-benchmarks", + "runtime-common/runtime-benchmarks", + "sp-staking/runtime-benchmarks", # EVM + Frontier "pallet-ethereum/runtime-benchmarks", @@ -266,6 +318,18 @@ try-runtime = [ "pallet-admin-utils/try-runtime", "pallet-commitments/try-runtime", "pallet-registry/try-runtime", + "pallet-babe/try-runtime", + "pallet-session/try-runtime", + "pallet-staking/try-runtime", + "pallet-election-provider-multi-phase/try-runtime", + "frame-election-provider-support/try-runtime", + "pallet-authority-discovery/try-runtime", + "pallet-authorship/try-runtime", + "pallet-bags-list/try-runtime", + "pallet-fast-unstake/try-runtime", + "pallet-nomination-pools/try-runtime", + "pallet-offences/try-runtime", + "runtime-common/try-runtime", # EVM + Frontier "fp-self-contained/try-runtime", diff --git a/runtime/src/bag_thresholds.rs b/runtime/src/bag_thresholds.rs new file mode 100644 index 000000000..e44018c38 --- /dev/null +++ b/runtime/src/bag_thresholds.rs @@ -0,0 +1,425 @@ +//! Autogenerated bag thresholds. +//! +//! Generated on 2024-10-25T10:50:27.800738+00:00 +//! Arguments +//! Total issuance: 21000000000000000 +//! Minimum balance: 500 +//! for the Subtensor node runtime. + +/// Existential weight for this runtime. +#[cfg(any(test, feature = "std"))] +#[allow(unused)] +pub const EXISTENTIAL_WEIGHT: u64 = 500; + +/// Constant ratio between bags for this runtime. +#[cfg(any(test, feature = "std"))] +#[allow(unused)] +pub const CONSTANT_RATIO: f64 = 1.2112980096490553; + +/// Upper thresholds delimiting the bag list. +pub const THRESHOLDS: [u64; 200] = [ + 500, + 606, + 734, + 889, + 1_077, + 1_305, + 1_581, + 1_915, + 2_320, + 2_810, + 3_404, + 4_123, + 4_994, + 6_049, + 7_327, + 8_875, + 10_750, + 13_021, + 15_772, + 19_105, + 23_142, + 28_032, + 33_955, + 41_130, + 49_821, + 60_348, + 73_099, + 88_545, + 107_254, + 129_917, + 157_368, + 190_620, + 230_898, + 279_686, + 338_783, + 410_367, + 497_077, + 602_108, + 729_332, + 883_438, + 1_070_107, + 1_296_218, + 1_570_106, + 1_901_866, + 2_303_727, + 2_790_500, + 3_380_127, + 4_094_341, + 4_959_467, + 6_007_393, + 7_276_743, + 8_814_304, + 10_676_749, + 12_932_725, + 15_665_384, + 18_975_448, + 22_984_922, + 27_841_590, + 33_724_463, + 40_850_375, + 49_481_978, + 59_937_421, + 72_602_079, + 87_942_754, + 106_524_883, + 129_033_379, + 156_297_875, + 189_323_305, + 229_326_943, + 277_783_270, + 336_478_322, + 407_575_522, + 493_695_419, + 598_012_278, + 724_371_082, + 877_429_250, + 1_062_828_304, + 1_287_401_809, + 1_559_427_249, + 1_888_931_123, + 2_288_058_510, + 2_771_520_719, + 3_357_137_531, + 4_066_494_009, + 4_925_736_099, + 5_966_534_333, + 7_227_251_162, + 8_754_354_948, + 10_604_132_724, + 12_844_764_863, + 15_558_838_113, + 18_846_389_639, + 22_828_594_259, + 27_652_230_789, + 33_495_092_117, + 40_572_538_414, + 49_145_435_027, + 59_529_767_632, + 72_108_289_048, + 87_344_627_003, + 105_800_372_842, + 128_155_781_044, + 155_234_842_504, + 188_035_655_753, + 227_767_215_557, + 275_893_974_868, + 334_189_822_632, + 404_803_466_999, + 490_337_633_875, + 593_944_999_969, + 719_444_396_303, + 871_461_565_295, + 1_055_599_659_527, + 1_278_645_766_571, + 1_548_821_072_094, + 1_876_083_881_930, + 2_272_496_672_116, + 2_752_670_695_868, + 3_334_304_535_124, + 4_038_836_446_960, + 4_892_234_549_501, + 5_925_953_972_547, + 7_178_096_252_218, + 8_694_813_703_381, + 10_532_010_533_175, + 12_757_403_396_438, + 15_453_017_342_395, + 18_718_209_149_915, + 22_673_329_487_487, + 27_464_158_880_310, + 33_267_280_988_405, + 40_296_591_247_691, + 48_811_180_773_970, + 59_124_886_120_130, + 71_617_856_878_041, + 86_750_567_491_702, + 105_080_789_738_625, + 127_284_151_462_747, + 154_179_039_326_694, + 186_756_763_466_028, + 226_218_095_874_899, + 274_017_529_279_864, + 331_916_887_825_651, + 402_050_265_592_120, + 487_002_686_490_609, + 589_905_384_839_818, + 714_551_218_537_732, + 865_534_468_807_062, + 1_048_420_179_348_647, + 1_269_949_276_520_922, + 1_538_287_031_005_051, + 1_863_324_018_925_373, + 2_257_040_675_455_583, + 2_733_948_877_876_307, + 3_311_626_834_253_839, + 4_011_366_993_032_077, + 4_858_960_854_631_671, + 5_885_649_612_178_016, + 7_129_275_660_722_965, + 8_635_677_418_073_181, + 10_460_378_868_483_338, + 12_670_636_103_568_904, + 15_347_916_293_240_474, + 18_590_900_458_262_492, + 22_519_120_722_677_068, + 27_277_366_110_425_528, + 33_041_019_278_027_036, + 40_022_520_888_250_216, + 48_479_199_893_075_232, + 58_722_758_339_860_720, + 71_130_760_298_175_752, + 86_160_548_374_004_336, + 104_366_100_755_702_608, + 126_418_450_120_215_344, + 153_130_417_013_535_232, + 185_486_569_345_225_056, + 224_679_512_264_502_592, + 272_153_846_014_912_512, + 329_659_411_996_199_040, + 399_315_789_613_073_792, + 483_690_421_179_757_184, + 585_893_244_461_353_088, + 709_691_320_882_864_384, + 859_647_684_450_622_720, + 1_041_289_529_174_458_496, + 1_261_311_934_157_423_616, + 1_527_824_635_391_487_488, + 1_850_650_939_942_502_400, + 2_241_689_800_107_506_688, + 2_715_354_393_120_811_520, + 3_289_103_371_879_057_408, + 3_984_084_367_887_098_880, + 4_825_913_465_095_557_120, + 5_845_619_375_008_824_320, + 7_080_787_114_114_143_232, + 8_576_943_338_075_140_096, + 10_389_234_394_283_141_120, + 12_584_458_943_572_678_656, + 15_243_530_070_859_839_488, + 18_446_744_073_709_551_615, +]; + +/// Upper thresholds delimiting the bag list. +pub const THRESHOLDS_BALANCES: [u128; 200] = [ + 500, + 606, + 734, + 889, + 1_077, + 1_305, + 1_581, + 1_915, + 2_320, + 2_810, + 3_404, + 4_123, + 4_994, + 6_049, + 7_327, + 8_875, + 10_750, + 13_021, + 15_772, + 19_105, + 23_142, + 28_032, + 33_955, + 41_130, + 49_821, + 60_348, + 73_099, + 88_545, + 107_254, + 129_917, + 157_368, + 190_620, + 230_898, + 279_686, + 338_783, + 410_367, + 497_077, + 602_108, + 729_332, + 883_438, + 1_070_107, + 1_296_218, + 1_570_106, + 1_901_866, + 2_303_727, + 2_790_500, + 3_380_127, + 4_094_341, + 4_959_467, + 6_007_393, + 7_276_743, + 8_814_304, + 10_676_749, + 12_932_725, + 15_665_384, + 18_975_448, + 22_984_922, + 27_841_590, + 33_724_463, + 40_850_375, + 49_481_978, + 59_937_421, + 72_602_079, + 87_942_754, + 106_524_883, + 129_033_379, + 156_297_875, + 189_323_305, + 229_326_943, + 277_783_270, + 336_478_322, + 407_575_522, + 493_695_419, + 598_012_278, + 724_371_082, + 877_429_250, + 1_062_828_304, + 1_287_401_809, + 1_559_427_249, + 1_888_931_123, + 2_288_058_510, + 2_771_520_719, + 3_357_137_531, + 4_066_494_009, + 4_925_736_099, + 5_966_534_333, + 7_227_251_162, + 8_754_354_948, + 10_604_132_724, + 12_844_764_863, + 15_558_838_113, + 18_846_389_639, + 22_828_594_259, + 27_652_230_789, + 33_495_092_117, + 40_572_538_414, + 49_145_435_027, + 59_529_767_632, + 72_108_289_048, + 87_344_627_003, + 105_800_372_842, + 128_155_781_044, + 155_234_842_504, + 188_035_655_753, + 227_767_215_557, + 275_893_974_868, + 334_189_822_632, + 404_803_466_999, + 490_337_633_875, + 593_944_999_969, + 719_444_396_303, + 871_461_565_295, + 1_055_599_659_527, + 1_278_645_766_571, + 1_548_821_072_094, + 1_876_083_881_930, + 2_272_496_672_116, + 2_752_670_695_868, + 3_334_304_535_124, + 4_038_836_446_960, + 4_892_234_549_501, + 5_925_953_972_547, + 7_178_096_252_218, + 8_694_813_703_381, + 10_532_010_533_175, + 12_757_403_396_438, + 15_453_017_342_395, + 18_718_209_149_915, + 22_673_329_487_487, + 27_464_158_880_310, + 33_267_280_988_405, + 40_296_591_247_691, + 48_811_180_773_970, + 59_124_886_120_130, + 71_617_856_878_041, + 86_750_567_491_702, + 105_080_789_738_625, + 127_284_151_462_747, + 154_179_039_326_694, + 186_756_763_466_028, + 226_218_095_874_899, + 274_017_529_279_864, + 331_916_887_825_651, + 402_050_265_592_120, + 487_002_686_490_609, + 589_905_384_839_818, + 714_551_218_537_732, + 865_534_468_807_062, + 1_048_420_179_348_647, + 1_269_949_276_520_922, + 1_538_287_031_005_051, + 1_863_324_018_925_373, + 2_257_040_675_455_583, + 2_733_948_877_876_307, + 3_311_626_834_253_839, + 4_011_366_993_032_077, + 4_858_960_854_631_671, + 5_885_649_612_178_016, + 7_129_275_660_722_965, + 8_635_677_418_073_181, + 10_460_378_868_483_338, + 12_670_636_103_568_904, + 15_347_916_293_240_474, + 18_590_900_458_262_492, + 22_519_120_722_677_068, + 27_277_366_110_425_528, + 33_041_019_278_027_036, + 40_022_520_888_250_216, + 48_479_199_893_075_232, + 58_722_758_339_860_720, + 71_130_760_298_175_752, + 86_160_548_374_004_336, + 104_366_100_755_702_608, + 126_418_450_120_215_344, + 153_130_417_013_535_232, + 185_486_569_345_225_056, + 224_679_512_264_502_592, + 272_153_846_014_912_512, + 329_659_411_996_199_040, + 399_315_789_613_073_792, + 483_690_421_179_757_184, + 585_893_244_461_353_088, + 709_691_320_882_864_384, + 859_647_684_450_622_720, + 1_041_289_529_174_458_496, + 1_261_311_934_157_423_616, + 1_527_824_635_391_487_488, + 1_850_650_939_942_502_400, + 2_241_689_800_107_506_688, + 2_715_354_393_120_811_520, + 3_289_103_371_879_057_408, + 3_984_084_367_887_098_880, + 4_825_913_465_095_557_120, + 5_845_619_375_008_824_320, + 7_080_787_114_114_143_232, + 8_576_943_338_075_140_096, + 10_389_234_394_283_141_120, + 12_584_458_943_572_678_656, + 15_243_530_070_859_839_488, + 18_446_744_073_709_551_615, +]; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 212226f9a..794ad4fec 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -8,11 +8,16 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +mod bag_thresholds; pub mod check_nonce; mod migrations; use codec::{Decode, Encode, MaxEncodedLen}; +use frame_election_provider_support::bounds::ElectionBoundsBuilder; +use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen}; +use frame_support::pallet_prelude::DispatchClass; use frame_support::traits::Imbalance; +use frame_support::PalletId; use frame_support::{ dispatch::DispatchResultWithPostInfo, genesis_builder_helper::{build_state, get_preset}, @@ -26,19 +31,27 @@ use frame_support::{ }; use frame_system::{EnsureNever, EnsureRoot, EnsureRootWithSuccess, RawOrigin}; use pallet_commitments::CanCommit; +use pallet_election_provider_multi_phase::GeometricDepositBase; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, }; use pallet_registry::CanRegisterIdentity; +use pallet_session::historical as session_historical; +use pallet_staking::UseValidatorsMap; +use polkadot_core_primitives::Moment; +use runtime_common::prod_or_fast; use scale_info::TypeInfo; use smallvec::smallvec; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; -use sp_core::{ - crypto::{ByteArray, KeyTypeId}, - OpaqueMetadata, H160, H256, U256, -}; +use sp_core::{crypto::ByteArray, H160, H256, U256}; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; +use sp_runtime::curve::PiecewiseLinear; use sp_runtime::generic::Era; +use sp_runtime::traits::OpaqueKeys; +use sp_runtime::transaction_validity::TransactionPriority; +use sp_runtime::Percent; +use sp_runtime::SaturatedConversion; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -48,6 +61,8 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, AccountId32, ApplyExtrinsicResult, ConsensusEngineId, MultiSignature, }; +use sp_staking::currency_to_vote::SaturatingCurrencyToVote; +use sp_staking::SessionIndex; use sp_std::cmp::Ordering; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -184,6 +199,38 @@ pub const fn deposit(items: u32, bytes: u32) -> Balance { .saturating_add((bytes as Balance).saturating_mul(BYTES_FEE)) } +parameter_types! { + /// A limit for off-chain phragmen unsigned solution submission. + /// + /// We want to keep it as high as possible, but can't risk having it reject, + /// so we always subtract the base block execution weight. + pub OffchainSolutionWeightLimit: Weight = BlockWeights::get() + .get(DispatchClass::Normal) + .max_extrinsic + .expect("Normal extrinsics have weight limit configured by default; qed") + .saturating_sub(BlockExecutionWeight::get()); + + /// A limit for off-chain phragmen unsigned solution length. + /// + /// We allow up to 90% of the block's size to be consumed by the solution. + pub OffchainSolutionLengthLimit: u32 = Perbill::from_rational(90_u32, 100) * + *BlockLength::get() + .max + .get(DispatchClass::Normal); +} + +/// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. +/// The choice of is done in accordance to the slot duration and expected target +/// block time, for safely resisting network delays of maximum two seconds. +/// +pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); + +/// RAO per TAO +pub const UNITS: Balance = 1_000_000_000; + +/// TODO: Check this +pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, 1 * MINUTES); + // Opaque types. These are used by the CLI to instantiate machinery that don't need to know // the specifics of the runtime. They can then be made to be agnostic over specific formats // of data like extrinsics, allowing for them to continue syncing the network through upgrades @@ -202,8 +249,9 @@ pub mod opaque { impl_opaque_keys! { pub struct SessionKeys { - pub aura: Aura, pub grandpa: Grandpa, + pub babe: Babe, + pub authority_discovery: AuthorityDiscovery, } } } @@ -227,18 +275,20 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { state_version: 1, }; +/// The BABE epoch configuration at genesis. +pub const BABE_GENESIS_EPOCH_CONFIG: babe_primitives::BabeEpochConfiguration = + babe_primitives::BabeEpochConfiguration { + c: PRIMARY_PROBABILITY, + allowed_slots: babe_primitives::AllowedSlots::PrimaryAndSecondaryVRFSlots, + }; + /// This determines the average expected block time that we are targeting. /// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. /// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked /// up by `pallet_aura` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -#[cfg(not(feature = "fast-blocks"))] -pub const MILLISECS_PER_BLOCK: u64 = 12000; - -/// Fast blocks for development -#[cfg(feature = "fast-blocks")] -pub const MILLISECS_PER_BLOCK: u64 = 250; +pub const MILLISECS_PER_BLOCK: u64 = prod_or_fast!(12_000, 1000); // NOTE: Currently it is not possible to change the slot duration after the chain has started. // Attempting to do so will brick block production. @@ -334,33 +384,423 @@ impl frame_system::Config for Runtime { type PostTransactions = (); } +parameter_types! { + pub EpochDuration: u64 = prod_or_fast!( + EPOCH_DURATION_IN_SLOTS as u64, + 2 * MINUTES as u64, + "TAO_EPOCH_DURATION" + ); + pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; + pub ReportLongevity: u64 = + BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); +} + +impl pallet_babe::Config for Runtime { + type EpochDuration = EpochDuration; + type ExpectedBlockTime = ExpectedBlockTime; + + // session module is the trigger + type EpochChangeTrigger = pallet_babe::ExternalTrigger; + + type DisabledValidators = Session; + + type WeightInfo = (); + + type MaxAuthorities = MaxAuthorities; + type MaxNominators = MaxNominators; + + type KeyOwnerProof = + >::Proof; + + type EquivocationReportSystem = + pallet_babe::EquivocationReportSystem; +} + +impl pallet_authorship::Config for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; + type EventHandler = Staking; +} + +impl pallet_session::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ValidatorId = AccountId; + type ValidatorIdOf = pallet_staking::StashOf; + type ShouldEndSession = Babe; + type NextSessionRotation = Babe; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; + type SessionHandler = ::KeyTypeIdProviders; + type Keys = opaque::SessionKeys; + type WeightInfo = (); +} + +impl pallet_session::historical::Config for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; +} + +parameter_types! { + // phase durations. 1/4 of the last session for each. + // in testing: 1min or half of the session for each + pub SignedPhase: u32 = prod_or_fast!( + EPOCH_DURATION_IN_SLOTS / 4, + (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + "TAO_SIGNED_PHASE" + ); + pub UnsignedPhase: u32 = prod_or_fast!( + EPOCH_DURATION_IN_SLOTS / 4, + (1 * MINUTES).min(EpochDuration::get().saturated_into::() / 2), + "TAO_UNSIGNED_PHASE" + ); + + // signed config + pub const SignedMaxSubmissions: u32 = 16; + pub const SignedMaxRefunds: u32 = 16 / 4; + pub const SignedFixedDeposit: Balance = deposit(2, 0); + pub const SignedDepositIncreaseFactor: Percent = Percent::from_percent(10); + // 0.01 TAO per KB of solution data. + pub const SignedDepositByte: Balance = deposit(0, 10) / 1024; + // Each good submission will get 1 TAO as reward + pub SignedRewardBase: Balance = 1 * UNITS; + + // 4 hour session, 1 hour unsigned phase, 32 offchain executions. + pub OffchainRepeat: BlockNumber = UnsignedPhase::get() / 32; + + pub const MaxElectingVoters: u32 = 22_500; + /// We take the top 22500 nominators as electing voters and all of the validators as electable + /// targets. Whilst this is the case, we cannot and shall not increase the size of the + /// validator intentions. + pub ElectionBounds: frame_election_provider_support::bounds::ElectionBounds = + ElectionBoundsBuilder::default().voters_count(MaxElectingVoters::get().into()).build(); + /// Setup election pallet to support maximum winners upto 1200. This will mean Staking Pallet + /// cannot have active validators higher than this count. + pub const MaxActiveValidators: u32 = 1200; +} + +generate_solution_type!( + #[compact] + pub struct NposCompactSolution16::< + VoterIndex = u32, + TargetIndex = u16, + Accuracy = sp_runtime::PerU16, + MaxVoters = MaxElectingVoters, + >(16) +); + +pub struct OnChainSeqPhragmen; +impl onchain::Config for OnChainSeqPhragmen { + type System = Runtime; + type Solver = SequentialPhragmen; + type DataProvider = Staking; + type WeightInfo = (); + type MaxWinners = MaxActiveValidators; + type Bounds = ElectionBounds; +} + +impl pallet_election_provider_multi_phase::MinerConfig for Runtime { + type AccountId = AccountId; + type MaxLength = OffchainSolutionLengthLimit; + type MaxWeight = OffchainSolutionWeightLimit; + type Solution = NposCompactSolution16; + type MaxVotesPerVoter = < + ::DataProvider + as + frame_election_provider_support::ElectionDataProvider + >::MaxVotesPerVoter; + type MaxWinners = MaxActiveValidators; + + // The unsigned submissions have to respect the weight of the submit_unsigned call, thus their + // weight estimate function is wired to this call's weight. + fn solution_weight(v: u32, t: u32, a: u32, d: u32) -> Weight { + < + ::WeightInfo + as + pallet_election_provider_multi_phase::WeightInfo + >::submit_unsigned(v, t, a, d) + } +} + +impl pallet_election_provider_multi_phase::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type EstimateCallFee = TransactionPayment; + type SignedPhase = SignedPhase; + type UnsignedPhase = UnsignedPhase; + type SignedMaxSubmissions = SignedMaxSubmissions; + type SignedMaxRefunds = SignedMaxRefunds; + type SignedRewardBase = SignedRewardBase; + type SignedDepositBase = + GeometricDepositBase; + type SignedDepositByte = SignedDepositByte; + type SignedDepositWeight = (); + type SignedMaxWeight = + ::MaxWeight; + type MinerConfig = Self; + type SlashHandler = (); // burn slashes + type RewardHandler = (); // nothing to do upon rewards + type BetterSignedThreshold = (); + type OffchainRepeat = OffchainRepeat; + type MinerTxPriority = NposSolutionPriority; + type DataProvider = Staking; + #[cfg(any(feature = "fast-runtime", feature = "runtime-benchmarks"))] + type Fallback = onchain::OnChainExecution; + #[cfg(not(any(feature = "fast-runtime", feature = "runtime-benchmarks")))] + type Fallback = frame_election_provider_support::NoElection<( + AccountId, + BlockNumber, + Staking, + MaxActiveValidators, + )>; + type GovernanceFallback = onchain::OnChainExecution; + type Solver = SequentialPhragmen< + AccountId, + pallet_election_provider_multi_phase::SolutionAccuracyOf, + (), + >; + type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig; + type ForceOrigin = EnsureRoot; + type WeightInfo = (); + type MaxWinners = MaxActiveValidators; + type ElectionBounds = ElectionBounds; +} + +parameter_types! { + pub const BagThresholds: &'static [u64] = &bag_thresholds::THRESHOLDS; +} + +type VoterBagsListInstance = pallet_bags_list::Instance1; +impl pallet_bags_list::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ScoreProvider = Staking; + type WeightInfo = (); + type BagThresholds = BagThresholds; + type Score = sp_npos_elections::VoteWeight; +} + +// TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and +// re-built in case input parameters have changed. The `ideal_stake` should be determined by the +// amount of parachain slots being bid on: this should be around `(75 - 25.min(slots / 4))%`. +pallet_staking_reward_curve::build! { + const REWARD_CURVE: PiecewiseLinear<'static> = curve!( + min_inflation: 0_025_000, + max_inflation: 0_100_000, + // 3:2:1 staked : parachains : float. + // while there's no parachains, then this is 75% staked : 25% float. + ideal_stake: 0_750_000, + falloff: 0_050_000, + max_piece_count: 40, + test_precision: 0_005_000, + ); +} + +parameter_types! { + // Six sessions in an era (24 hours). + pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1); + + // 28 eras for unbonding (28 days). + pub BondingDuration: sp_staking::EraIndex = prod_or_fast!( + 28, + 28, + "DOT_BONDING_DURATION" + ); + pub SlashDeferDuration: sp_staking::EraIndex = prod_or_fast!( + 27, + 27, + "DOT_SLASH_DEFER_DURATION" + ); + pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; + pub const MaxExposurePageSize: u32 = 512; + // Note: this is not really correct as Max Nominators is (MaxExposurePageSize * page_count) but + // this is an unbounded number. We just set it to a reasonably high value, 1 full page + // of nominators. + pub const MaxNominators: u32 = 512; + // pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17); + // 16 + pub const MaxNominations: u32 = ::LIMIT as u32; +} + +/// Custom version of `runtime_commong::era_payout` somewhat tailored for Polkadot's crowdloan +/// unlock history. The only tweak should be +/// +/// ```diff +/// - let auction_proportion = Perquintill::from_rational(auctioned_slots.min(60), 200u64); +/// + let auction_proportion = Perquintill::from_rational(auctioned_slots.min(60), 300u64); +/// ``` +/// +/// See . +// fn polkadot_era_payout( +// _total_staked: Balance, +// _total_stakable: Balance, +// _max_annual_inflation: Perquintill, +// _period_fraction: Perquintill, +// _auctioned_slots: u64, +// ) -> (Balance, Balance) { +// todo!() + +// let min_annual_inflation = Perquintill::from_rational(25u64, 1000u64); +// let delta_annual_inflation = max_annual_inflation.saturating_sub(min_annual_inflation); +// +// // 20% reserved for up to 60 slots. +// let auction_proportion = Perquintill::from_rational(auctioned_slots.min(60), 300u64); +// +// // Therefore the ideal amount at stake (as a percentage of total issuance) is 75% less the +// // amount that we expect to be taken up with auctions. +// let ideal_stake = Perquintill::from_percent(75).saturating_sub(auction_proportion); +// +// let stake = Perquintill::from_rational(total_staked, total_stakable); +// let falloff = Perquintill::from_percent(5); +// let adjustment = compute_inflation(stake, ideal_stake, falloff); +// let staking_inflation = +// min_annual_inflation.saturating_add(delta_annual_inflation * adjustment); +// +// let max_payout = period_fraction * max_annual_inflation * total_stakable; +// let staking_payout = (period_fraction * staking_inflation) * total_stakable; +// let rest = max_payout.saturating_sub(staking_payout); +// +// let other_issuance = total_stakable.saturating_sub(total_staked); +// if total_staked > other_issuance { +// let _cap_rest = Perquintill::from_rational(other_issuance, total_staked) * staking_payout; +// // We don't do anything with this, but if we wanted to, we could introduce a cap on the +// // treasury amount with: `rest = rest.min(cap_rest);` +// } +// (staking_payout, rest) +// } + +pub struct EraPayout; +impl pallet_staking::EraPayout for EraPayout { + fn era_payout( + _total_staked: Balance, + _total_issuance: Balance, + _era_duration_millis: u64, + ) -> (Balance, Balance) { + todo!() + + // all para-ids that are not active. + // let auctioned_slots = Paras::parachains() + // .into_iter() + // // all active para-ids that do not belong to a system chain is the number + // // of parachains that we should take into account for inflation. + // .filter(|i| *i >= LOWEST_PUBLIC_ID) + // .count() as u64; + // + // const MAX_ANNUAL_INFLATION: Perquintill = Perquintill::from_percent(10); + // const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100; + // + // polkadot_era_payout( + // total_staked, + // total_issuance, + // MAX_ANNUAL_INFLATION, + // Perquintill::from_rational(era_duration_millis, MILLISECONDS_PER_YEAR), + // auctioned_slots, + // ) + } +} + +impl pallet_staking::Config for Runtime { + type Currency = Balances; + type CurrencyBalance = Balance; + type UnixTime = Timestamp; + type CurrencyToVote = SaturatingCurrencyToVote; + type RewardRemainder = (); + // type RewardRemainder = Treasury; + type RuntimeEvent = RuntimeEvent; + type Slash = (); + // type Slash = Treasury; + type Reward = (); + type SessionsPerEra = SessionsPerEra; + type BondingDuration = BondingDuration; + type SlashDeferDuration = SlashDeferDuration; + type AdminOrigin = EnsureRoot; + type SessionInterface = Self; + type EraPayout = EraPayout; + type MaxExposurePageSize = MaxExposurePageSize; + type NextNewSession = Session; + type ElectionProvider = ElectionProviderMultiPhase; + type GenesisElectionProvider = onchain::OnChainExecution; + type VoterList = VoterList; + type TargetList = UseValidatorsMap; + type NominationsQuota = pallet_staking::FixedNominationsQuota<{ MaxNominations::get() }>; + type MaxUnlockingChunks = frame_support::traits::ConstU32<32>; + type HistoryDepth = frame_support::traits::ConstU32<84>; + type MaxControllersInDeprecationBatch = ConstU32<5314>; + type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig; + type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy; + // type EventListeners = NominationPools; + type EventListeners = (); + type WeightInfo = (); +} + +impl pallet_fast_unstake::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type BatchSize = frame_support::traits::ConstU32<16>; + type Deposit = frame_support::traits::ConstU64<{ UNITS }>; + type ControlOrigin = EnsureRoot; + type Staking = Staking; + type MaxErasToCheckPerBlock = ConstU32<1>; + type WeightInfo = (); +} + +impl pallet_offences::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; + type OnOffenceHandler = Staking; +} + +parameter_types! { + // TODO: Polkadot default 👇 + // pub const MaxAuthorities: u32 = 100_000; + pub const MaxAuthorities: u32 = 32; + pub NposSolutionPriority: TransactionPriority = + Perbill::from_percent(90) * TransactionPriority::max_value(); +} + +impl pallet_authority_discovery::Config for Runtime { + type MaxAuthorities = MaxAuthorities; +} + +parameter_types! { + pub const PoolsPalletId: PalletId = PalletId(*b"py/nopls"); + // Allow pools that got slashed up to 90% to remain operational. + pub const MaxPointsToBalance: u8 = 10; +} + impl pallet_insecure_randomness_collective_flip::Config for Runtime {} -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = ConstU32<32>; - type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = pallet_aura::MinimumPeriodTimesTwo; +parameter_types! { + pub MaxSetIdSessionEntries: u32 = BondingDuration::get() * SessionsPerEra::get(); } impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type KeyOwnerProof = sp_core::Void; + type KeyOwnerProof = >::Proof; type WeightInfo = (); - type MaxAuthorities = ConstU32<32>; - type MaxSetIdSessionEntries = ConstU64<0>; - type MaxNominators = ConstU32<20>; + type MaxAuthorities = MaxAuthorities; + type MaxSetIdSessionEntries = MaxSetIdSessionEntries; + type MaxNominators = MaxNominators; + + type EquivocationReportSystem = + pallet_grandpa::EquivocationReportSystem; +} + +impl frame_system::offchain::SigningTypes for Runtime { + type Public = ::Signer; + type Signature = Signature; +} - type EquivocationReportSystem = (); +impl frame_system::offchain::SendTransactionTypes for Runtime +where + RuntimeCall: From, +{ + type Extrinsic = UncheckedExtrinsic; + type OverarchingCall = RuntimeCall; } impl pallet_timestamp::Config for Runtime { // A timestamp: milliseconds since the unix epoch. type Moment = u64; - type OnTimestampSet = Aura; + type OnTimestampSet = Babe; type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } @@ -977,17 +1417,9 @@ impl pallet_commitments::Config for Runtime { type RateLimit = CommitmentRateLimit; } -#[cfg(not(feature = "fast-blocks"))] -pub const INITIAL_SUBNET_TEMPO: u16 = 99; - -#[cfg(feature = "fast-blocks")] -pub const INITIAL_SUBNET_TEMPO: u16 = 10; +pub const INITIAL_SUBNET_TEMPO: u16 = prod_or_fast!(99, 10); -#[cfg(not(feature = "fast-blocks"))] -pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = 216000; // 30 days at 12 seconds per block - -#[cfg(feature = "fast-blocks")] -pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = 5; +pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = prod_or_fast!(216000, 5); // 30 days at 12 seconds per block // Configure the pallet subtensor. parameter_types! { @@ -1114,10 +1546,14 @@ impl pallet_subtensor::Config for Runtime { use sp_runtime::BoundedVec; -pub struct AuraPalletIntrf; -impl pallet_admin_utils::AuraInterface> for AuraPalletIntrf { - fn change_authorities(new: BoundedVec>) { - Aura::change_authorities(new); +pub struct GrandpaInterfaceImpl; +impl pallet_admin_utils::GrandpaInterface for GrandpaInterfaceImpl { + fn schedule_change( + next_authorities: Vec<(pallet_grandpa::AuthorityId, u64)>, + in_blocks: BlockNumber, + forced: Option, + ) -> sp_runtime::DispatchResult { + Grandpa::schedule_change(next_authorities, in_blocks, forced) } } @@ -1134,9 +1570,6 @@ impl pallet_admin_utils::GrandpaInterface for GrandpaInterfaceImpl { impl pallet_admin_utils::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type AuthorityId = AuraId; - type MaxAuthorities = ConstU32<32>; - type Aura = AuraPalletIntrf; type Grandpa = GrandpaInterfaceImpl; type Balance = Balance; type WeightInfo = pallet_admin_utils::weights::SubstrateWeight; @@ -1163,10 +1596,10 @@ impl> FindAuthor for FindAuthorTruncated { I: 'a + IntoIterator, { if let Some(author_index) = F::find_author(digests) { - pallet_aura::Authorities::::get() + pallet_babe::Authorities::::get() .get(author_index as usize) .and_then(|authority_id| { - let raw_vec = authority_id.to_raw_vec(); + let raw_vec = authority_id.0.to_raw_vec(); raw_vec.get(4..24).map(H160::from_slice) }) } else { @@ -1245,7 +1678,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type OnChargeTransaction = (); type OnCreate = (); - type FindAuthor = FindAuthorTruncated; + type FindAuthor = FindAuthorTruncated; type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type SuicideQuickClearLimit = SuicideQuickClearLimit; type Timestamp = Timestamp; @@ -1383,7 +1816,7 @@ construct_runtime!( System: frame_system = 0, RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip = 1, Timestamp: pallet_timestamp = 2, - Aura: pallet_aura = 3, + // Aura: pallet_aura = 3, Grandpa: pallet_grandpa = 4, Balances: pallet_balances = 5, TransactionPayment: pallet_transaction_payment = 6, @@ -1410,6 +1843,22 @@ construct_runtime!( BaseFee: pallet_base_fee = 25, Drand: pallet_drand = 26, + + // PoS Consensus. + // Authorship must be before session in order to note author in the correct session and era + // for staking. + Authorship: pallet_authorship = 30, + Staking: pallet_staking = 31, + Offences: pallet_offences = 32, + Historical: session_historical = 33, + Session: pallet_session = 34, + AuthorityDiscovery: pallet_authority_discovery = 35, + Babe: pallet_babe = 36, + ElectionProviderMultiPhase: pallet_election_provider_multi_phase = 37, + VoterList: pallet_bags_list:: = 38, + FastUnstake: pallet_fast_unstake = 39, + // TODO: Evaluate if we need nomination pools... + // NominationPools: pallet_nomination_pools = 40, } ); @@ -1562,16 +2011,6 @@ impl_runtime_apis! { } } - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) - } - - fn authorities() -> Vec { - pallet_aura::Authorities::::get().into_inner() - } - } - impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { opaque::SessionKeys::generate(seed) @@ -2086,6 +2525,18 @@ impl_runtime_apis! { } } + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + unimplemented!() + // sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) + } + + fn authorities() -> Vec { + unimplemented!() + // pallet_aura::Authorities::::get().into_inner() + } + } + impl subtensor_custom_rpc_runtime_api::StakeInfoRuntimeApi for Runtime { fn get_stake_info_for_coldkey( coldkey_account_vec: Vec ) -> Vec { let result = SubtensorModule::get_stake_info_for_coldkey( coldkey_account_vec ); @@ -2103,6 +2554,69 @@ impl_runtime_apis! { SubtensorModule::get_network_lock_cost() } } + + impl pallet_staking_runtime_api::StakingApi for Runtime { + fn nominations_quota(balance: Balance) -> u32 { + Staking::api_nominations_quota(balance) + } + + fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page { + Staking::api_eras_stakers_page_count(era, account) + } + + fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool { + Staking::api_pending_rewards(era, account) + } + } + + impl babe_primitives::BabeApi for Runtime { + fn configuration() -> babe_primitives::BabeConfiguration { + let epoch_config = Babe::epoch_config().unwrap_or(BABE_GENESIS_EPOCH_CONFIG); + babe_primitives::BabeConfiguration { + slot_duration: Babe::slot_duration(), + epoch_length: EpochDuration::get(), + c: epoch_config.c, + authorities: Babe::authorities().to_vec(), + randomness: Babe::randomness(), + allowed_slots: epoch_config.allowed_slots, + } + } + + fn current_epoch_start() -> babe_primitives::Slot { + Babe::current_epoch_start() + } + + fn current_epoch() -> babe_primitives::Epoch { + Babe::current_epoch() + } + + fn next_epoch() -> babe_primitives::Epoch { + Babe::next_epoch() + } + + fn generate_key_ownership_proof( + _slot: babe_primitives::Slot, + authority_id: babe_primitives::AuthorityId, + ) -> Option { + use codec::Encode; + + Historical::prove((babe_primitives::KEY_TYPE, authority_id)) + .map(|p| p.encode()) + .map(babe_primitives::OpaqueKeyOwnershipProof::new) + } + + fn submit_report_equivocation_unsigned_extrinsic( + equivocation_proof: babe_primitives::EquivocationProof<::Header>, + key_owner_proof: babe_primitives::OpaqueKeyOwnershipProof, + ) -> Option<()> { + let key_owner_proof = key_owner_proof.decode()?; + + Babe::submit_unsigned_equivocation_report( + equivocation_proof, + key_owner_proof, + ) + } + } } #[test] @@ -2127,72 +2641,3 @@ fn check_whitelist() { // System Events assert!(whitelist.contains("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7")); } - -#[test] -fn test_into_substrate_balance_valid() { - // Valid conversion within u64 range - let evm_balance = U256::from(1_000_000_000_000_000_000u128); // 1 TAO in EVM - let expected_substrate_balance = U256::from(1_000_000_000u128); // 1 TAO in Substrate - - let result = SubtensorEvmBalanceConverter::into_substrate_balance(evm_balance); - assert_eq!(result, Some(expected_substrate_balance)); -} - -#[test] -fn test_into_substrate_balance_large_value() { - // Maximum valid balance for u64 - let evm_balance = U256::from(u64::MAX) * U256::from(EVM_DECIMALS_FACTOR); // Max u64 TAO in EVM - let expected_substrate_balance = U256::from(u64::MAX); - - let result = SubtensorEvmBalanceConverter::into_substrate_balance(evm_balance); - assert_eq!(result, Some(expected_substrate_balance)); -} - -#[test] -fn test_into_substrate_balance_exceeds_u64() { - // EVM balance that exceeds u64 after conversion - let evm_balance = (U256::from(u64::MAX) + U256::from(1)) * U256::from(EVM_DECIMALS_FACTOR); - - let result = SubtensorEvmBalanceConverter::into_substrate_balance(evm_balance); - assert_eq!(result, None); // Exceeds u64, should return None -} - -#[test] -fn test_into_substrate_balance_precision_loss() { - // EVM balance with precision loss - let evm_balance = U256::from(1_000_000_000_123_456_789u128); // 1 TAO + extra precision in EVM - let expected_substrate_balance = U256::from(1_000_000_000u128); // Truncated to 1 TAO in Substrate - - let result = SubtensorEvmBalanceConverter::into_substrate_balance(evm_balance); - assert_eq!(result, Some(expected_substrate_balance)); -} - -#[test] -fn test_into_substrate_balance_zero_value() { - // Zero balance should convert to zero - let evm_balance = U256::from(0); - let expected_substrate_balance = U256::from(0); - - let result = SubtensorEvmBalanceConverter::into_substrate_balance(evm_balance); - assert_eq!(result, Some(expected_substrate_balance)); -} - -#[test] -fn test_into_evm_balance_valid() { - // Valid conversion from Substrate to EVM - let substrate_balance = U256::from(1_000_000_000u128); // 1 TAO in Substrate - let expected_evm_balance = U256::from(1_000_000_000_000_000_000u128); // 1 TAO in EVM - - let result = SubtensorEvmBalanceConverter::into_evm_balance(substrate_balance); - assert_eq!(result, Some(expected_evm_balance)); -} - -#[test] -fn test_into_evm_balance_overflow() { - // Substrate balance larger than u64::MAX but valid within U256 - let substrate_balance = U256::from(u64::MAX) + U256::from(1); // Large balance - let expected_evm_balance = substrate_balance * U256::from(EVM_DECIMALS_FACTOR); - - let result = SubtensorEvmBalanceConverter::into_evm_balance(substrate_balance); - assert_eq!(result, Some(expected_evm_balance)); // Should return the scaled value -} diff --git a/scripts/localnet.sh b/scripts/localnet.sh index b82b5f9f5..16ed5d9f6 100755 --- a/scripts/localnet.sh +++ b/scripts/localnet.sh @@ -16,22 +16,22 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" BASE_DIR="$SCRIPT_DIR/.." # get parameters -# Get the value of fast_blocks from the first argument -fast_blocks=${1:-"True"} +# Get the value of fast_runtime from the first argument +fast_runtime=${1:-"True"} -# Check the value of fast_blocks -if [ "$fast_blocks" == "False" ]; then - # Block of code to execute if fast_blocks is False - echo "fast_blocks is Off" +# Check the value of fast_runtime +if [ "$fast_runtime" == "False" ]; then + # Block of code to execute if fast_runtime is False + echo "fast_runtime is Off" : "${CHAIN:=local}" : "${BUILD_BINARY:=1}" : "${FEATURES:="pow-faucet"}" else - # Block of code to execute if fast_blocks is not False - echo "fast_blocks is On" + # Block of code to execute if fast_runtime is not False + echo "fast_runtime is On" : "${CHAIN:=local}" : "${BUILD_BINARY:=1}" - : "${FEATURES:="pow-faucet fast-blocks"}" + : "${FEATURES:="pow-faucet fast-runtime"}" fi SPEC_PATH="${SCRIPT_DIR}/specs/" @@ -54,7 +54,11 @@ fi echo "*** Building chainspec..." "$BASE_DIR/target/release/node-subtensor" build-spec --disable-default-bootnode --raw --chain $CHAIN >$FULL_PATH -echo "*** Chainspec built and output to file" +echo "*** Chainspec built and output to $FULL_PATH" + +# generate node keys +$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice +$BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/bob # generate node keys $BASE_DIR/target/release/node-subtensor key generate-node-key --chain="$FULL_PATH" --base-path /tmp/alice @@ -66,6 +70,8 @@ else echo "*** Purging previous state..." "$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/bob --chain="$FULL_PATH" >/dev/null 2>&1 "$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/alice --chain="$FULL_PATH" >/dev/null 2>&1 + "$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/charlie --chain="$FULL_PATH" >/dev/null 2>&1 + "$BASE_DIR/target/release/node-subtensor" purge-chain -y --base-path /tmp/dave --chain="$FULL_PATH" >/dev/null 2>&1 echo "*** Previous chainstate purged" fi @@ -99,10 +105,40 @@ bob_start=( # --offchain-worker=Never ) +charlie_start=( + "$BASE_DIR"/target/release/node-subtensor + --base-path /tmp/charlie + --chain="$FULL_PATH" + --charlie + --port 30335 + --rpc-port 9944 + --validator + --rpc-cors=all + --allow-private-ipv4 + --discover-local + --unsafe-force-node-key-generation +) + +dave_start=( + "$BASE_DIR"/target/release/node-subtensor + --base-path /tmp/dave + --chain="$FULL_PATH" + --dave + --port 30335 + --rpc-port 9943 + --validator + --rpc-cors=all + --allow-private-ipv4 + --discover-local + --unsafe-force-node-key-generation +) + trap 'pkill -P $$' EXIT SIGINT SIGTERM ( - ("${alice_start[@]}" 2>&1) & - ("${bob_start[@]}" 2>&1) + # ("${alice_start[@]}" 2>&1) & + ("${bob_start[@]}" 2>&1) & + ("${charlie_start[@]}" 2>&1) & + ("${dave_start[@]}" 2>&1) wait ) diff --git a/zepter.yaml b/zepter.yaml index e448fa228..02a2cc979 100644 --- a/zepter.yaml +++ b/zepter.yaml @@ -12,7 +12,7 @@ workflows: # Check that `A` activates the features of `B`. "propagate-feature", # These are the features to check: - "--features=try-runtime,runtime-benchmarks,std,sql,rocksdb,txpool", + "--features=try-runtime,runtime-benchmarks,std,sql,rocksdb,txpool,fast-runtime", # Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually. "--left-side-feature-missing=ignore", # Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.