From 348626fc4e93ff6831a77cb41e27dda0310ee05c Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 22 Jul 2025 18:17:57 +1200 Subject: [PATCH 01/24] hybrid node --- Cargo.lock | 841 +++++++++++++++++- Cargo.toml | 38 +- node/Cargo.toml | 24 +- node/src/cli.rs | 52 +- node/src/command.rs | 128 ++- node/src/conditional_evm_block_import.rs | 111 +++ node/src/consensus/aura_consensus.rs | 219 +++++ .../consensus/aura_wrapped_import_queue.rs | 136 +++ node/src/consensus/babe_consensus.rs | 232 +++++ node/src/consensus/consensus_mechanism.rs | 136 +++ node/src/consensus/mod.rs | 9 + node/src/consensus_mechanism.rs | 0 node/src/ethereum.rs | 12 +- node/src/lib.rs | 2 + node/src/main.rs | 7 +- node/src/rpc.rs | 31 +- node/src/service.rs | 308 ++----- pallets/subtensor/Cargo.toml | 4 +- runtime/Cargo.toml | 90 +- runtime/src/lib.rs | 56 +- zepter.yaml | 2 +- 21 files changed, 2133 insertions(+), 305 deletions(-) create mode 100644 node/src/conditional_evm_block_import.rs create mode 100644 node/src/consensus/aura_consensus.rs create mode 100644 node/src/consensus/aura_wrapped_import_queue.rs create mode 100644 node/src/consensus/babe_consensus.rs create mode 100644 node/src/consensus/consensus_mechanism.rs create mode 100644 node/src/consensus/mod.rs create mode 100644 node/src/consensus_mechanism.rs diff --git a/Cargo.lock b/Cargo.lock index 0d0487707a..baa3c95217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2756,6 +2756,17 @@ dependencies = [ "syn 2.0.104", ] +[[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.104", +] + [[package]] name = "env_logger" version = "0.10.2" @@ -3073,6 +3084,22 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "fc-babe" +version = "1.0.0-dev" +source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +dependencies = [ + "fc-rpc", + "sc-client-api", + "sc-consensus-babe", + "sp-api", + "sp-blockchain", + "sp-consensus-babe", + "sp-inherents", + "sp-runtime", + "sp-timestamp", +] + [[package]] name = "fc-consensus" version = "2.0.0-dev" @@ -3594,6 +3621,33 @@ dependencies = [ "thousands", ] +[[package]] +name = "frame-election-provider-solution-type" +version = "14.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "frame-election-provider-support" +version = "39.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "39.1.0" @@ -6398,6 +6452,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "mmr-rpc" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "jsonrpsee 0.24.9", + "parity-scale-codec", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + [[package]] name = "mockall" version = "0.11.4" @@ -6748,6 +6817,7 @@ dependencies = [ "cumulus-primitives-proof-size-hostfunction", "fc-api", "fc-aura", + "fc-babe", "fc-consensus", "fc-db", "fc-mapping-sync", @@ -6764,17 +6834,20 @@ dependencies = [ "futures", "hex", "jsonrpsee 0.24.9", + "log", "memmap2 0.9.7", "node-subtensor-runtime", "num-traits", "pallet-commitments", "pallet-drand", + "pallet-staking", "pallet-subtensor-swap-rpc", "pallet-subtensor-swap-runtime-api", "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", @@ -6782,6 +6855,9 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-epochs", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-consensus-manual-seal", @@ -6800,11 +6876,15 @@ dependencies = [ "serde", "serde_json", "sp-api", + "sp-application-crypto", + "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-consensus-babe", "sp-consensus-grandpa", + "sp-consensus-slots", "sp-core", "sp-crypto-ec-utils 0.15.0", "sp-inherents", @@ -6814,8 +6894,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", @@ -6830,11 +6912,13 @@ name = "node-subtensor-runtime" version = "4.0.0-dev" dependencies = [ "ark-serialize 0.4.2", + "array-bytes", "fp-account", "fp-evm", "fp-rpc", "fp-self-contained", "frame-benchmarking", + "frame-election-provider-support", "frame-executive", "frame-metadata 18.0.0", "frame-metadata-hash-extension", @@ -6848,28 +6932,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-crowdloan", "pallet-drand", + "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 38.0.0", "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-subtensor-swap", "pallet-subtensor-swap-runtime-api", @@ -6879,6 +6977,8 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility 38.0.0", "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-runtime-common", "precompile-utils", "rand_chacha 0.3.1", "scale-info", @@ -6886,15 +6986,21 @@ dependencies = [ "sha2 0.10.9", "smallvec", "sp-api", + "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-grandpa", + "sp-consensus-slots", "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-stable2412-6)", "sp-storage 22.0.0", "sp-tracing 17.0.1", @@ -7282,6 +7388,38 @@ dependencies = [ "subtensor-swap-interface", ] +[[package]] +name = "pallet-asset-conversion" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-aura" version = "38.1.0" @@ -7298,6 +7436,21 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-authority-discovery" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "39.0.0" @@ -7311,6 +7464,50 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-babe" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "40.1.0" @@ -7340,6 +7537,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-broker" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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" @@ -7437,6 +7652,41 @@ dependencies = [ "w3f-bls", ] +[[package]] +name = "pallet-election-provider-multi-phase" +version = "38.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec", + "rand 0.8.5", + "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 = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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" @@ -7535,6 +7785,24 @@ dependencies = [ "sp-io", ] +[[package]] +name = "pallet-fast-unstake" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "39.1.0" @@ -7572,6 +7840,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-identity" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-insecure-randomness-collective-flip" version = "27.0.0" @@ -7602,19 +7886,27 @@ dependencies = [ ] [[package]] -name = "pallet-multisig" -version = "39.1.1" +name = "pallet-message-queue" +version = "42.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", - "polkadot-sdk-frame", "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", ] [[package]] -name = "pallet-preimage" -version = "39.1.0" +name = "pallet-mmr" +version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" dependencies = [ "frame-benchmarking", @@ -7625,14 +7917,86 @@ dependencies = [ "scale-info", "sp-core", "sp-io", + "sp-mmr-primitives", "sp-runtime", ] [[package]] -name = "pallet-proxy" -version = "38.0.0" -dependencies = [ - "frame-benchmarking", +name = "pallet-multisig" +version = "39.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + +[[package]] +name = "pallet-nomination-pools" +version = "37.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "35.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "pallet-nomination-pools", + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "pallet-offences" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", + "sp-staking", +] + +[[package]] +name = "pallet-preimage" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-proxy" +version = "38.0.0" +dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "pallet-balances", @@ -7742,6 +8106,58 @@ dependencies = [ "sp-trie", ] +[[package]] +name = "pallet-staking" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand_chacha 0.3.1", + "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-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-staking-runtime-api" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-staking", +] + [[package]] name = "pallet-subtensor" version = "4.0.0-dev" @@ -7924,6 +8340,25 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "pallet-treasury" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-utility" version = "38.0.0" @@ -7958,6 +8393,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-vesting" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "parity-bip39" version = "2.0.1" @@ -8287,6 +8736,16 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[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 = "16.0.0" @@ -8463,6 +8922,153 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "polkadot-rpc" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "jsonrpsee 0.24.9", + "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 = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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-keyring", + "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 = "18.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "bs58", + "frame-benchmarking", + "parity-scale-codec", + "polkadot-primitives", + "sp-tracing 17.0.1", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "derive_more 0.99.20", + "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 0.8.5", + "rand_chacha 0.3.1", + "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-stable2412-6)", + "staging-xcm", + "staging-xcm-executor", + "static_assertions", +] + [[package]] name = "polkadot-sdk-frame" version = "0.8.1" @@ -10264,6 +10870,84 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "futures", + "jsonrpsee 0.24.9", + "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 1.0.69", +] + +[[package]] +name = "sc-consensus-beefy" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "async-trait", + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.4", + "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-stable2412-6)", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "futures", + "jsonrpsee 0.24.9", + "log", + "parity-scale-codec", + "parking_lot 0.12.4", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-application-crypto", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sc-consensus-epochs" version = "0.47.0" @@ -10934,6 +11618,25 @@ dependencies = [ "sp-core", ] +[[package]] +name = "sc-sync-state-rpc" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "jsonrpsee 0.24.9", + "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 1.0.69", +] + [[package]] name = "sc-sysinfo" version = "41.0.0" @@ -11715,6 +12418,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" +[[package]] +name = "slot-range-helper" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", +] + [[package]] name = "smallvec" version = "1.15.1" @@ -12064,6 +12778,26 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-beefy" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "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-stable2412-6)", + "sp-io", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "sp-weights", + "strum 0.26.3", +] + [[package]] name = "sp-consensus-grandpa" version = "22.0.0" @@ -12366,6 +13100,36 @@ dependencies = [ "sp-application-crypto", ] +[[package]] +name = "sp-mmr-primitives" +version = "35.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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-stable2412-6)", + "sp-runtime", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-npos-elections" +version = "35.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", +] + [[package]] name = "sp-offchain" version = "35.0.0" @@ -12920,6 +13684,48 @@ dependencies = [ "xcm-procedural", ] +[[package]] +name = "staging-xcm-builder" +version = "18.2.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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 = "18.0.3" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +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" @@ -13069,6 +13875,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "41.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +dependencies = [ + "jsonrpsee 0.24.9", + "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 = "25.0.1" diff --git a/Cargo.toml b/Cargo.toml index bda4967955..859dd2c010 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,6 +81,7 @@ libsecp256k1 = { version = "0.7.2", default-features = false } log = { version = "0.4.21", default-features = false } memmap2 = "0.9.4" ndarray = { version = "0.15.6", default-features = false } +array-bytes = { version = "6.2.2", default-features = false } parity-util-mem = "0.12.0" rand = "0.8.5" scale-codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ @@ -120,8 +121,10 @@ frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk. frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } frame-metadata = "18.0.0" +frame-election-provider-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } @@ -139,19 +142,39 @@ pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/parityt pallet-utility = { path = "pallets/utility", default-features = false } pallet-root-testing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +# NPoS +pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-bags-list = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-fast-unstake = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-nomination-pools = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-staking-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } + sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +sc-consensus-epochs = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sc-chain-spec-derive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-network = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } @@ -161,11 +184,17 @@ sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } @@ -181,17 +210,19 @@ sp-storage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "po sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-transaction-storage-proof = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-version = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } sp-weights = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } 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-stable2412-6" } substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +runtime-common = { package = "polkadot-runtime-common", git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +polkadot-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } # Frontier fp-evm = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } @@ -211,6 +242,7 @@ fc-rpc = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda69 ] } fc-rpc-core = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } fc-aura = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } +fc-babe = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } fc-mapping-sync = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } precompile-utils = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } diff --git a/node/Cargo.toml b/node/Cargo.toml index 0ee30ab9f3..9200ab0ac7 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -20,6 +20,7 @@ targets = ["x86_64-unknown-linux-gnu"] name = "node-subtensor" [dependencies] +log = { workspace = true } async-trait = { workspace = true } clap = { workspace = true, features = ["derive"] } futures = { workspace = true, features = ["thread-pool"] } @@ -41,20 +42,29 @@ sc-transaction-pool = { workspace = true } sc-transaction-pool-api = { workspace = true } sc-offchain = { workspace = true } sc-network = { workspace = true } +sc-consensus-babe = { workspace = true } sc-consensus-aura = { workspace = true } -sp-consensus-aura = { workspace = true } +sp-consensus-babe = { workspace = true } sp-consensus = { workspace = true } +sp-consensus-slots = { workspace = true } +sp-consensus-aura = { workspace = true } 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 } +sp-application-crypto = { workspace = true } sc-chain-spec-derive = { workspace = true } sc-chain-spec = { workspace = true } sc-consensus-slots = { workspace = true } +sc-consensus-epochs = { workspace = true } +sc-consensus-babe-rpc = { workspace = true, default-features = 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 +74,8 @@ 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 } @@ -100,6 +112,7 @@ fc-api = { workspace = true } fc-rpc = { workspace = true } fc-rpc-core = { workspace = true } fp-rpc = { workspace = true } +fc-babe = { workspace = true } fc-aura = { workspace = true } fc-mapping-sync = { workspace = true } fp-consensus = { workspace = true } @@ -119,13 +132,17 @@ substrate-build-script-utils = { workspace = true } [features] default = ["rocksdb", "sql", "txpool"] -fast-blocks = ["node-subtensor-runtime/fast-blocks"] +fast-blocks = [ + "node-subtensor-runtime/fast-blocks", + "subtensor-runtime-common/fast-blocks" +] 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"] @@ -137,8 +154,10 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "sp-staking/runtime-benchmarks", "pallet-commitments/runtime-benchmarks", "pallet-drand/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", ] pow-faucet = [] @@ -152,6 +171,7 @@ try-runtime = [ "sp-runtime/try-runtime", "pallet-commitments/try-runtime", "pallet-drand/try-runtime", + "pallet-staking/try-runtime", ] metadata-hash = ["node-subtensor-runtime/metadata-hash"] diff --git a/node/src/cli.rs b/node/src/cli.rs index d9744d44df..db963b237e 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -1,5 +1,14 @@ -use crate::ethereum::EthConfiguration; +use crate::{ + client::{FullBackend, FullClient}, + consensus::{AuraConsensus, BabeConsensus}, + ethereum::{EthConfiguration, FrontierBackend}, + service::new_chain_ops, +}; +use node_subtensor_runtime::opaque::Block; use sc_cli::RunCmd; +use sc_consensus::BasicQueue; +use sc_service::{Configuration, TaskManager}; +use std::sync::Arc; #[derive(Debug, clap::Parser)] pub struct Cli { @@ -13,6 +22,13 @@ pub struct Cli { #[arg(long, value_enum, ignore_case = true)] pub sealing: Option, + /// Whether to try Aura or Babe consensus on first start. + /// + /// After starting, the consensus used by the node will automatically + /// switch to whatever is required to continue validating / syncing. + #[arg(long, value_enum, ignore_case = true, default_value_t=SupportedConsensusMechanism::default())] + pub initial_consensus: SupportedConsensusMechanism, + #[command(flatten)] pub eth: EthConfiguration, } @@ -63,3 +79,37 @@ pub enum Sealing { /// Seal when transaction is executed. Instant, } + +/// Supported consensus mechanisms. +#[derive(Copy, Clone, Debug, Default, clap::ValueEnum)] +pub enum SupportedConsensusMechanism { + // Babe + Babe, + /// Aura + #[default] + Aura, +} + +// Convinience methods for static dispatch of different service methods with +// different consensus mechanisms. +impl SupportedConsensusMechanism { + pub fn new_chain_ops( + &self, + config: &mut Configuration, + eth_config: &EthConfiguration, + ) -> Result< + ( + Arc, + Arc, + BasicQueue, + TaskManager, + FrontierBackend, + ), + sc_service::Error, + > { + match self { + SupportedConsensusMechanism::Aura => new_chain_ops::(config, eth_config), + SupportedConsensusMechanism::Babe => new_chain_ops::(config, eth_config), + } + } +} diff --git a/node/src/command.rs b/node/src/command.rs index f8f4990d0f..2ccdc5a506 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,13 +1,16 @@ +use std::sync::{Arc, atomic::AtomicBool}; + use crate::{ chain_spec, - cli::{Cli, Subcommand}, + cli::{Cli, Subcommand, SupportedConsensusMechanism}, + consensus::BabeConsensus, ethereum::db_config_dir, service, }; use fc_db::{DatabaseSource, kv::frontier_database_dir}; -use clap::{CommandFactory, FromArgMatches, parser::ValueSource}; -use futures::TryFutureExt; +use crate::consensus::AuraConsensus; +use clap::{ArgMatches, CommandFactory, FromArgMatches, parser::ValueSource}; use node_subtensor_runtime::Block; use sc_cli::SubstrateCli; use sc_service::{ @@ -70,7 +73,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.async_run(|mut config| { let (client, _, import_queue, task_manager, _) = - service::new_chain_ops(&mut config, &cli.eth)?; + cli.initial_consensus.new_chain_ops(&mut config, &cli.eth)?; Ok((cmd.run(client, import_queue), task_manager)) }) } @@ -78,7 +81,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.async_run(|mut config| { let (client, _, _, task_manager, _) = - service::new_chain_ops(&mut config, &cli.eth)?; + cli.initial_consensus.new_chain_ops(&mut config, &cli.eth)?; Ok((cmd.run(client, config.database), task_manager)) }) } @@ -86,7 +89,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.async_run(|mut config| { let (client, _, _, task_manager, _) = - service::new_chain_ops(&mut config, &cli.eth)?; + cli.initial_consensus.new_chain_ops(&mut config, &cli.eth)?; Ok((cmd.run(client, config.chain_spec), task_manager)) }) } @@ -94,7 +97,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.async_run(|mut config| { let (client, _, import_queue, task_manager, _) = - service::new_chain_ops(&mut config, &cli.eth)?; + cli.initial_consensus.new_chain_ops(&mut config, &cli.eth)?; Ok((cmd.run(client, import_queue), task_manager)) }) } @@ -149,7 +152,7 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.async_run(|mut config| { let (client, backend, _, task_manager, _) = - service::new_chain_ops(&mut config, &cli.eth)?; + cli.initial_consensus.new_chain_ops(&mut config, &cli.eth)?; let aux_revert = Box::new(move |client, _, blocks| { sc_consensus_grandpa::revert(client, blocks)?; Ok(()) @@ -230,36 +233,97 @@ pub fn run() -> sc_cli::Result<()> { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run::(&config)) } + // Start with the initial consensus type asked. None => { - let runner = cli.create_runner(&cli.run)?; - runner.run_node_until_exit(|config| async move { - let mut config = override_default_heap_pages(config, 60_000); + let arg_matches = Cli::command().get_matches(); + let cli = Cli::from_args(); + match cli.initial_consensus { + SupportedConsensusMechanism::Babe => run_babe(&arg_matches), + SupportedConsensusMechanism::Aura => run_aura(&arg_matches), + } + } + } +} - // If the operator did **not** supply `--rpc-rate-limit`, disable the limiter. - if cli.run.rpc_params.rpc_rate_limit.is_none() { - config.rpc.rate_limit = None; - } - // If the operator did **not** supply `--rpc-max-subscriptions-per-connection` set to high value. - config.rpc.max_subs_per_conn = - match arg_matches.value_source("rpc_max_subscriptions_per_connection") { - Some(ValueSource::CommandLine) => { - cli.run.rpc_params.rpc_max_subscriptions_per_connection - } - _ => 10000, - }; - // If the operator did **not** supply `--rpc-max-connections` set to high value. - config.rpc.max_connections = match arg_matches.value_source("rpc_max_connections") { - Some(ValueSource::CommandLine) => cli.run.rpc_params.rpc_max_connections, - _ => 10000, - }; - service::build_full(config, cli.eth, cli.sealing) - .map_err(Into::into) - .await - }) +fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { + let cli = Cli::from_arg_matches(arg_matches).expect("Bad arg_matches"); + let runner = cli.create_runner(&cli.run)?; + match runner.run_node_until_exit(|config| async move { + let config = customise_config(arg_matches, config); + service::build_full::(config, cli.eth, cli.sealing, None).await + }) { + Ok(_) => Ok(()), + Err(e) => { + if e.to_string().contains("BabeApi") { + log::info!( + "💡 Chain is using Aura consensus. Switching to Aura service until Babe block is detected.", + ); + run_aura(arg_matches) + } else if e.to_string().contains("lock hold by current process") { + log::warn!("Failed to aquire DB lock, trying again in 1s..."); + std::thread::sleep(std::time::Duration::from_secs(1)); + return run_babe(arg_matches); + } else { + Err(e.into()) + } + } + } +} + +fn run_aura(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { + let cli = Cli::from_arg_matches(arg_matches).expect("Bad arg_matches"); + let runner = cli.create_runner(&cli.run)?; + + // Unlike when the Babe node fails to build due to missing BabeApi in the runtime, + // there is no way to detect the exit reason for the Aura node when it encounters a Babe block. + // + // Passing this atomic bool is a hacky solution, allowing the node to set it to true to indicate + // a Babe service should be spawned on exit instead of a regular shutdown. + let babe_switch = Arc::new(AtomicBool::new(false)); + let babe_switch_clone = babe_switch.clone(); + match runner.run_node_until_exit(|config| async move { + let config = customise_config(arg_matches, config); + service::build_full::(config, cli.eth, cli.sealing, Some(babe_switch_clone)) + .await + }) { + Ok(()) => Ok(()), + Err(e) => { + if babe_switch.load(std::sync::atomic::Ordering::Relaxed) { + run_babe(arg_matches) + } else { + Err(e.into()) + } } } } +fn customise_config(arg_matches: &ArgMatches, config: Configuration) -> Configuration { + let cli = Cli::from_arg_matches(arg_matches).expect("Bad arg_matches"); + + let mut config = override_default_heap_pages(config, 60_000); + + // If the operator did **not** supply `--rpc-rate-limit`, disable the limiter. + if cli.run.rpc_params.rpc_rate_limit.is_none() { + config.rpc.rate_limit = None; + } + + // If the operator did **not** supply `--rpc-max-subscriptions-per-connection` set to high value. + config.rpc.max_subs_per_conn = match arg_matches + .value_source("rpc-max-subscriptions-per-connection") + { + Some(ValueSource::CommandLine) => cli.run.rpc_params.rpc_max_subscriptions_per_connection, + _ => 10000, + }; + + // If the operator did **not** supply `--rpc-max-connections` set to high value. + config.rpc.max_connections = match arg_matches.value_source("rpc-max-connections") { + Some(ValueSource::CommandLine) => cli.run.rpc_params.rpc_max_connections, + _ => 10000, + }; + + config +} + /// Override default heap pages fn override_default_heap_pages(config: Configuration, pages: u64) -> Configuration { Configuration { diff --git a/node/src/conditional_evm_block_import.rs b/node/src/conditional_evm_block_import.rs new file mode 100644 index 0000000000..f9453e935d --- /dev/null +++ b/node/src/conditional_evm_block_import.rs @@ -0,0 +1,111 @@ +use fp_consensus::{FindLogError, ensure_log}; +use fp_rpc::EthereumRuntimeRPCApi; +use sc_consensus::{ + BlockCheckParams, BlockImport, BlockImportParams, ImportResult, +}; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_consensus::Error as ConsensusError; +use sp_runtime::traits::{Block as BlockT, Header}; +use std::{marker::PhantomData, sync::Arc}; + + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("Multiple runtime Ethereum blocks, rejecting!")] + MultipleRuntimeLogs, + #[error("Runtime Ethereum block not found, rejecting!")] + NoRuntimeLog, + #[error("Cannot access the runtime at genesis, rejecting!")] + RuntimeApiCallFailed, +} + +pub struct ConditionalEVMBlockImport { + inner: I, + frontier_block_import: F, + client: Arc, + _marker: PhantomData, +} + +impl Clone for ConditionalEVMBlockImport +where + B: BlockT, + I: Clone + BlockImport, + F: Clone + BlockImport, +{ + fn clone(&self) -> Self { + ConditionalEVMBlockImport { + inner: self.inner.clone(), + frontier_block_import: self.frontier_block_import.clone(), + client: self.client.clone(), + _marker: PhantomData, + } + } +} + +impl ConditionalEVMBlockImport +where + B: BlockT, + I: BlockImport, + I::Error: Into, + F: BlockImport, + F::Error: Into, + C: ProvideRuntimeApi, + C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, +{ + pub fn new(inner: I, frontier_block_import: F, client: Arc) -> Self { + Self { + inner, + frontier_block_import, + client, + _marker: PhantomData, + } + } +} + +#[async_trait::async_trait] +impl BlockImport for ConditionalEVMBlockImport +where + B: BlockT, + I: BlockImport + Send + Sync, + I::Error: Into, + F: BlockImport + Send + Sync, + F::Error: Into, + C: ProvideRuntimeApi + Send + Sync, + C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, +{ + type Error = ConsensusError; + + async fn check_block(&self, block: BlockCheckParams) -> Result { + self.inner.check_block(block).await.map_err(Into::into) + } + + async fn import_block(&self, block: BlockImportParams) -> Result { + // Import like Frontier, but fallback to grandpa import for errors + match ensure_log(block.header.digest()).map_err(Error::from) { + Ok(()) => self.inner.import_block(block).await.map_err(Into::into), + _ => self.inner.import_block(block).await.map_err(Into::into), + } + } +} + +impl From for String { + fn from(error: Error) -> String { + error.to_string() + } +} + +impl From for Error { + fn from(error: FindLogError) -> Error { + match error { + FindLogError::NotFound => Error::NoRuntimeLog, + FindLogError::MultipleLogs => Error::MultipleRuntimeLogs, + } + } +} + +impl From for ConsensusError { + fn from(error: Error) -> ConsensusError { + ConsensusError::ClientImport(error.to_string()) + } +} diff --git a/node/src/consensus/aura_consensus.rs b/node/src/consensus/aura_consensus.rs new file mode 100644 index 0000000000..8a6f8167ec --- /dev/null +++ b/node/src/consensus/aura_consensus.rs @@ -0,0 +1,219 @@ +use crate::consensus::{ConsensusMechanism, StartAuthoringParams}; +use crate::{ + client::{FullBackend, FullClient}, + conditional_evm_block_import::ConditionalEVMBlockImport, + ethereum::EthConfiguration, + service::{BIQ, FullSelectChain, GrandpaBlockImport}, +}; +use fc_consensus::FrontierBlockImport; +use jsonrpsee::tokio; +use node_subtensor_runtime::opaque::Block; +use sc_client_api::{AuxStore, BlockOf}; +use sc_consensus::{BlockImport, BoxBlockImport}; +use sc_consensus_grandpa::BlockNumberOps; +use sc_consensus_slots::{BackoffAuthoringBlocksStrategy, InherentDataProviderExt}; +use sc_service::{Configuration, TaskManager}; +use sc_telemetry::TelemetryHandle; +use sc_transaction_pool::TransactionPoolHandle; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::{HeaderBackend, HeaderMetadata}; +use sp_consensus::{Environment, Proposer, SelectChain, SyncOracle}; +use sp_consensus_aura::sr25519::AuthorityId; +use sp_consensus_aura::{AuraApi, sr25519::AuthorityPair as AuraPair}; +use sp_consensus_slots::SlotDuration; +use sp_inherents::CreateInherentDataProviders; +use sp_keystore::KeystorePtr; +use sp_runtime::traits::NumberFor; +use std::{error::Error, sync::Arc}; + +pub struct AuraConsensus; + +impl ConsensusMechanism for AuraConsensus { + type InherentDataProviders = ( + sp_consensus_aura::inherents::InherentDataProvider, + sp_timestamp::InherentDataProvider, + ); + + fn start_authoring( + self, + task_manager: &mut TaskManager, + params: StartAuthoringParams, + ) -> Result<(), sp_consensus::Error> + where + C: ProvideRuntimeApi + + BlockOf + + AuxStore + + HeaderBackend + + HeaderMetadata + + Send + + Sync + + 'static, + C::Api: AuraApi, + SC: SelectChain + 'static, + I: BlockImport + Send + Sync + 'static, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + SO: SyncOracle + Send + Sync + Clone + 'static, + L: sc_consensus::JustificationSyncLink + 'static, + CIDP: CreateInherentDataProviders + Send + Sync + 'static, + CIDP::InherentDataProviders: InherentDataProviderExt + Send, + BS: BackoffAuthoringBlocksStrategy> + Send + Sync + 'static, + Error: std::error::Error + Send + From + From + 'static, + { + let aura = sc_consensus_aura::start_aura::( + sc_consensus_aura::StartAuraParams { + slot_duration: params.slot_duration, + client: params.client, + select_chain: params.select_chain, + block_import: params.block_import, + proposer_factory: params.proposer_factory, + sync_oracle: params.sync_oracle, + justification_sync_link: params.justification_sync_link, + create_inherent_data_providers: params.create_inherent_data_providers, + force_authoring: params.force_authoring, + backoff_authoring_blocks: params.backoff_authoring_blocks, + keystore: params.keystore, + block_proposal_slot_portion: params.block_proposal_slot_portion, + max_block_proposal_slot_portion: params.max_block_proposal_slot_portion, + telemetry: params.telemetry, + compatibility_mode: Default::default(), + }, + )?; + + // the AURA authoring task is considered essential, i.e. if it + // fails we take down the service with it. + task_manager + .spawn_essential_handle() + .spawn_blocking("aura", Some("block-authoring"), aura); + + Ok(()) + } + + fn frontier_consensus_data_provider( + client: Arc, + ) -> Result>, sp_blockchain::Error> { + Ok(Box::new(fc_aura::AuraConsensusDataProvider::new(client))) + } + + fn create_inherent_data_providers( + slot_duration: SlotDuration, + ) -> Result> { + let current = sp_timestamp::InherentDataProvider::from_system_time(); + let next_slot = current + .timestamp() + .as_millis() + .saturating_add(slot_duration.as_millis()); + let timestamp = sp_timestamp::InherentDataProvider::new(next_slot.into()); + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + } + + fn new() -> Self { + Self {} + } + + fn build_biq(&mut self) -> Result + where + NumberFor: BlockNumberOps, + { + let build_import_queue = Box::new( + move |client: Arc, + _backend: Arc, + config: &Configuration, + _eth_config: &EthConfiguration, + task_manager: &TaskManager, + telemetry: Option, + grandpa_block_import: GrandpaBlockImport, + _transaction_pool: Arc>| { + let conditional_block_import = ConditionalEVMBlockImport::new( + grandpa_block_import.clone(), + FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), + client.clone(), + ); + + let slot_duration = sc_consensus_aura::slot_duration(&*client)?; + let create_inherent_data_providers = move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + }; + + let import_queue = super::aura_wrapped_import_queue::import_queue( + sc_consensus_aura::ImportQueueParams { + block_import: conditional_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client, + create_inherent_data_providers, + spawner: &task_manager.spawn_essential_handle(), + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry, + compatibility_mode: sc_consensus_aura::CompatibilityMode::None, + }, + ) + .map_err::(Into::into)?; + + Ok(( + import_queue, + Box::new(conditional_block_import) as BoxBlockImport, + )) + }, + ); + + Ok(build_import_queue) + } + + fn slot_duration(&self, client: &FullClient) -> Result { + sc_consensus_aura::slot_duration(&*client).map_err(Into::into) + } + + fn spawn_essential_handles( + &self, + task_manager: &mut TaskManager, + client: Arc, + triggered: Option>, + ) -> Result<(), sc_service::Error> { + let client_clone = client.clone(); + let triggered_clone = triggered.clone(); + let slot_duration = self.slot_duration(&client)?; + task_manager.spawn_essential_handle().spawn( + "babe-switch", + None, + Box::pin(async move { + let client = client_clone; + let triggered = triggered_clone; + loop { + // Check if the runtime is Babe once per block. + if let Ok(c) = sc_consensus_babe::configuration(&*client) { + if !c.authorities.is_empty() { + log::info!("Babe runtime detected! Intentionally failing the essential handle `babe-switch` to trigger switch to Babe service."); + if let Some(triggered) = triggered { + triggered.store(true, std::sync::atomic::Ordering::SeqCst); + }; + break; + } + }; + tokio::time::sleep(slot_duration.as_duration()).await; + } + })); + Ok(()) + } + + fn rpc_methods( + &self, + _client: Arc, + _keystore: KeystorePtr, + _select_chain: FullSelectChain, + ) -> Result, sc_service::Error> { + // Aura requires no special RPC methods. + Ok(Default::default()) + } +} diff --git a/node/src/consensus/aura_wrapped_import_queue.rs b/node/src/consensus/aura_wrapped_import_queue.rs new file mode 100644 index 0000000000..1b1adc0526 --- /dev/null +++ b/node/src/consensus/aura_wrapped_import_queue.rs @@ -0,0 +1,136 @@ +use futures::future::pending; +use log; +use sc_client_api::AuxStore; +use sc_client_api::BlockOf; +use sc_client_api::UsageProvider; +use sc_consensus::BlockImport; +use sc_consensus::BlockImportParams; +use sc_consensus::Verifier; +use sc_consensus::{BasicQueue, DefaultImportQueue}; +use sc_consensus_aura::AuraVerifier; +use sc_consensus_aura::CheckForEquivocation; +use sc_consensus_aura::ImportQueueParams; +use sc_consensus_slots::InherentDataProviderExt; +use sc_telemetry::TelemetryHandle; +use sp_api::ApiExt; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::HeaderBackend; +use sp_consensus::error::Error as ConsensusError; +use sp_consensus_aura::AuraApi; +use sp_consensus_aura::sr25519::AuthorityId; +use sp_consensus_aura::sr25519::AuthorityPair; +use sp_consensus_babe::BABE_ENGINE_ID; +use sp_inherents::CreateInherentDataProviders; +use sp_runtime::Digest; +use sp_runtime::DigestItem; +use sp_runtime::traits::NumberFor; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use std::sync::Arc; + +/// A wrapped Aura verifier which will stall verification if it encounters a +/// Babe block, rather than error out. +struct AuraWrappedVerifier { + inner: AuraVerifier, + _phantom: std::marker::PhantomData, +} + +impl AuraWrappedVerifier { + pub fn new( + client: Arc, + create_inherent_data_providers: CIDP, + telemetry: Option, + check_for_equivocation: CheckForEquivocation, + compatibility_mode: sc_consensus_aura::CompatibilityMode, + ) -> Self { + let verifier_params = sc_consensus_aura::BuildVerifierParams:: { + client, + create_inherent_data_providers, + telemetry, + check_for_equivocation, + compatibility_mode, + }; + let verifier = + sc_consensus_aura::build_verifier::(verifier_params); + + AuraWrappedVerifier { + inner: verifier, + _phantom: std::marker::PhantomData, + } + } +} + +#[async_trait::async_trait] +impl Verifier for AuraWrappedVerifier> +where + C: ProvideRuntimeApi + Send + Sync + sc_client_api::backend::AuxStore, + C::Api: BlockBuilderApi + AuraApi + ApiExt, + CIDP: CreateInherentDataProviders + Send + Sync, + CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, +{ + async fn verify(&self, block: BlockImportParams) -> Result, String> { + let number: NumberFor = block.post_header().number().clone(); + log::debug!("Verifying block: {:?}", number); + if is_babe_digest(block.header.digest()) { + log::debug!( + "Detected Babe block! Verifier cannot continue, upgrade must be triggered elsewhere..." + ); + pending::<()>().await; + unreachable!("Should not reach here, pending forever."); + } else { + self.inner.verify(block).await + } + } +} + +/// Start an import queue for the Aura consensus algorithm. +pub fn import_queue( + params: ImportQueueParams, +) -> Result, sp_consensus::Error> +where + B: BlockT, + C::Api: BlockBuilderApi + AuraApi + ApiExt, + C: 'static + + ProvideRuntimeApi + + BlockOf + + Send + + Sync + + AuxStore + + UsageProvider + + HeaderBackend, + I: BlockImport + Send + Sync + 'static, + S: sp_core::traits::SpawnEssentialNamed, + CIDP: CreateInherentDataProviders + Sync + Send + 'static, + CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, +{ + let verifier = AuraWrappedVerifier::>::new( + params.client, + params.create_inherent_data_providers, + params.telemetry, + params.check_for_equivocation, + params.compatibility_mode, + ); + + Ok(BasicQueue::new( + verifier, + Box::new(params.block_import), + params.justification_import, + params.spawner, + params.registry, + )) +} + +fn is_babe_digest(digest: &Digest) -> bool { + digest + .log(|d| match d { + DigestItem::PreRuntime(engine_id, _) => { + if engine_id.clone() == BABE_ENGINE_ID { + Some(d) + } else { + None + } + } + _ => None, + }) + .is_some() +} diff --git a/node/src/consensus/babe_consensus.rs b/node/src/consensus/babe_consensus.rs new file mode 100644 index 0000000000..c58ef3b29b --- /dev/null +++ b/node/src/consensus/babe_consensus.rs @@ -0,0 +1,232 @@ +use crate::consensus::ConsensusMechanism; +use crate::consensus::StartAuthoringParams; +use crate::{ + client::{FullBackend, FullClient}, + conditional_evm_block_import::ConditionalEVMBlockImport, + ethereum::EthConfiguration, + service::{BIQ, FullSelectChain, GrandpaBlockImport}, +}; +use fc_consensus::FrontierBlockImport; +use jsonrpsee::Methods; +use node_subtensor_runtime::opaque::Block; +use sc_client_api::{AuxStore, BlockOf}; +use sc_consensus::{BlockImport, BoxBlockImport}; +use sc_consensus_babe::{BabeLink, BabeWorkerHandle}; +use sc_consensus_babe_rpc::{Babe, BabeApiServer}; +use sc_consensus_grandpa::BlockNumberOps; +use sc_consensus_slots::{BackoffAuthoringBlocksStrategy, InherentDataProviderExt}; +use sc_service::{Configuration, TaskManager}; +use sc_telemetry::TelemetryHandle; +use sc_transaction_pool::TransactionPoolHandle; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::{HeaderBackend, HeaderMetadata}; +use sp_consensus::{Environment, Proposer, SelectChain, SyncOracle}; +use sp_consensus_aura::AuraApi; +use sp_consensus_aura::sr25519::AuthorityId; +use sp_consensus_babe::BabeApi; +use sp_consensus_slots::SlotDuration; +use sp_inherents::CreateInherentDataProviders; +use sp_keystore::KeystorePtr; +use sp_runtime::traits::NumberFor; +use std::{error::Error, sync::Arc}; + +pub struct BabeConsensus { + babe_link: Option>, + babe_worker_handle: Option>, +} + +impl ConsensusMechanism for BabeConsensus { + type InherentDataProviders = ( + sp_consensus_babe::inherents::InherentDataProvider, + sp_timestamp::InherentDataProvider, + ); + + fn start_authoring( + self, + task_manager: &mut TaskManager, + params: StartAuthoringParams, + ) -> Result<(), sp_consensus::Error> + where + C: ProvideRuntimeApi + + BlockOf + + AuxStore + + HeaderBackend + + HeaderMetadata + + Send + + Sync + + 'static, + C::Api: AuraApi + BabeApi, + SC: SelectChain + 'static, + I: BlockImport + Send + Sync + 'static, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + SO: SyncOracle + Send + Sync + Clone + 'static, + L: sc_consensus::JustificationSyncLink + 'static, + CIDP: CreateInherentDataProviders + Send + Sync + 'static, + CIDP::InherentDataProviders: InherentDataProviderExt + Send, + BS: BackoffAuthoringBlocksStrategy> + Send + Sync + 'static, + Error: std::error::Error + Send + From + From + 'static, + { + let babe = sc_consensus_babe::start_babe::( + sc_consensus_babe::BabeParams { + keystore: params.keystore, + client: params.client, + select_chain: params.select_chain, + env: params.proposer_factory, + block_import: params.block_import, + sync_oracle: params.sync_oracle, + justification_sync_link: params.justification_sync_link, + create_inherent_data_providers: params.create_inherent_data_providers, + force_authoring: params.force_authoring, + backoff_authoring_blocks: params.backoff_authoring_blocks, + babe_link: self + .babe_link + .expect("Must build the import queue before starting authoring."), + block_proposal_slot_portion: params.block_proposal_slot_portion, + max_block_proposal_slot_portion: params.max_block_proposal_slot_portion, + telemetry: params.telemetry, + }, + )?; + + // the BABE authoring task is considered essential, i.e. if it + // fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking( + "babe-proposer", + Some("block-authoring"), + babe, + ); + + Ok(()) + } + + fn frontier_consensus_data_provider( + client: Arc, + ) -> Result>, sp_blockchain::Error> { + Ok(Box::new(fc_babe::BabeConsensusDataProvider::new(client)?)) + } + + fn create_inherent_data_providers( + slot_duration: SlotDuration, + ) -> Result> { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let slot = + sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + } + + fn new() -> Self { + Self { + babe_link: None, + babe_worker_handle: None, + } + } + + fn build_biq(&mut self) -> Result + where + NumberFor: BlockNumberOps, + { + let build_import_queue = Box::new( + move |client: Arc, + backend: Arc, + config: &Configuration, + _eth_config: &EthConfiguration, + task_manager: &TaskManager, + telemetry: Option, + grandpa_block_import: GrandpaBlockImport, + transaction_pool: Arc>| { + let (babe_import, babe_link) = sc_consensus_babe::block_import( + sc_consensus_babe::configuration(&*client)?, + grandpa_block_import.clone(), + client.clone(), + )?; + + let conditional_block_import = ConditionalEVMBlockImport::new( + babe_import.clone(), + FrontierBlockImport::new(babe_import.clone(), client.clone()), + client.clone(), + ); + + let slot_duration = babe_link.config().slot_duration(); + let create_inherent_data_providers = move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let slot = + sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + Ok((slot, timestamp)) + }; + + let (import_queue, babe_worker_handle) = + sc_consensus_babe::import_queue(sc_consensus_babe::ImportQueueParams { + link: babe_link.clone(), + block_import: conditional_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import)), + client, + select_chain: sc_consensus::LongestChain::new(backend.clone()), + create_inherent_data_providers, + spawner: &task_manager.spawn_essential_handle(), + registry: config.prometheus_registry(), + telemetry, + offchain_tx_pool_factory: OffchainTransactionPoolFactory::new( + transaction_pool, + ), + })?; + + self.babe_link = Some(babe_link); + self.babe_worker_handle = Some(babe_worker_handle); + Ok((import_queue, Box::new(babe_import) as BoxBlockImport)) + }, + ); + + Ok(build_import_queue) + } + + fn slot_duration(&self, _client: &FullClient) -> Result { + if let Some(ref babe_link) = self.babe_link { + Ok(babe_link.config().slot_duration().clone()) + } else { + Err(sc_service::Error::Other( + "Babe link not initialized. Ensure that the import queue has been built before calling slot_duration.".to_string() + )) + } + } + + fn spawn_essential_handles( + &self, + _task_manager: &mut TaskManager, + _client: Arc, + _triggered: Option>, + ) -> Result<(), sc_service::Error> { + // No additional Babe handles required. + Ok(()) + } + + fn rpc_methods( + &self, + client: Arc, + keystore: KeystorePtr, + select_chain: FullSelectChain, + ) -> Result, sc_service::Error> { + if let Some(ref babe_worker_handle) = self.babe_worker_handle { + Ok(vec![ + Babe::new( + client.clone(), + babe_worker_handle.clone(), + keystore, + select_chain, + ) + .into_rpc() + .into(), + ]) + } else { + Err(sc_service::Error::Other( + "Babe link not initialized. Ensure that the import queue has been built before calling slot_duration.".to_string() + )) + } + } +} diff --git a/node/src/consensus/consensus_mechanism.rs b/node/src/consensus/consensus_mechanism.rs new file mode 100644 index 0000000000..d5efb642b3 --- /dev/null +++ b/node/src/consensus/consensus_mechanism.rs @@ -0,0 +1,136 @@ +use jsonrpsee::Methods; +use node_subtensor_runtime::opaque::Block; +use sc_client_api::AuxStore; +use sc_client_api::BlockOf; +use sc_consensus::BlockImport; +use sc_consensus_aura::AuraApi; +use sc_consensus_slots::BackoffAuthoringBlocksStrategy; +use sc_consensus_slots::InherentDataProviderExt; +use sc_consensus_slots::SlotProportion; +use sc_service::{TaskManager, error::Error as ServiceError}; +use sc_telemetry::TelemetryHandle; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::HeaderBackend; +use sp_blockchain::HeaderMetadata; +use sp_consensus::Proposer; +use sp_consensus::SyncOracle; +use sp_consensus::{Environment, SelectChain}; +use sp_consensus_aura::sr25519::AuthorityId as AuraAuthorityId; +use sp_consensus_babe::BabeApi; +use sp_consensus_slots::SlotDuration; +use sp_inherents::CreateInherentDataProviders; +use sp_keystore::KeystorePtr; +use sp_runtime::traits::NumberFor; +use std::sync::Arc; +use std::sync::atomic::AtomicBool; + +use crate::client::FullClient; +use crate::service::BIQ; +use crate::service::FullSelectChain; + +pub struct StartAuthoringParams { + /// The duration of a slot. + pub slot_duration: SlotDuration, + /// The client to interact with the chain. + pub client: Arc, + /// A select chain implementation to select the best block. + pub select_chain: SC, + /// The block import. + pub block_import: I, + /// The proposer factory to build proposer instances. + pub proposer_factory: PF, + /// The sync oracle that can give us the current sync status. + pub sync_oracle: SO, + /// Hook into the sync module to control the justification sync process. + pub justification_sync_link: L, + /// Something that can create the inherent data providers. + pub create_inherent_data_providers: CIDP, + /// Should we force the authoring of blocks? + pub force_authoring: bool, + /// The backoff strategy when we miss slots. + pub backoff_authoring_blocks: Option, + /// The keystore used by the node. + pub keystore: KeystorePtr, + /// The proportion of the slot dedicated to proposing. + /// + /// The block proposing will be limited to this proportion of the slot from the starting of the + /// slot. However, the proposing can still take longer when there is some lenience factor + /// applied, because there were no blocks produced for some slots. + pub block_proposal_slot_portion: SlotProportion, + /// The maximum proportion of the slot dedicated to proposing with any lenience factor applied + /// due to no blocks being produced. + pub max_block_proposal_slot_portion: Option, + /// Telemetry instance used to report telemetry metrics. + pub telemetry: Option, +} + +/// All consensus mechanism specific node logic should be covered by this trait, +/// so files like service.rs and rpc.rs can be generic over consensus mechanisms. +pub trait ConsensusMechanism { + /// IDPs inserted into the block by the ConsensusMechanism. + type InherentDataProviders: sp_inherents::InherentDataProvider + + sc_consensus_slots::InherentDataProviderExt + + 'static; + + /// Creates a new instance of the ConsensusMechanism. + fn new() -> Self; + + /// Builds a `BIQ` that uses the ConsensusMechanism. + fn build_biq(&mut self) -> Result; + + /// Returns the slot duration. + fn slot_duration(&self, client: &FullClient) -> Result; + + /// Creates IDPs for the consensus mechanism. + fn create_inherent_data_providers( + slot_duration: SlotDuration, + ) -> Result>; + + /// Creates the frontier consensus data provider with this mechanism. + fn frontier_consensus_data_provider( + client: Arc, + ) -> Result>, sp_blockchain::Error>; + + /// Starts authoring process for the consensus mechanism. + fn start_authoring( + self, + task_manager: &mut TaskManager, + params: StartAuthoringParams, + ) -> Result<(), sp_consensus::Error> + where + C: ProvideRuntimeApi + + BlockOf + + AuxStore + + HeaderBackend + + HeaderMetadata + + Send + + Sync + + 'static, + C::Api: AuraApi + BabeApi, + SC: SelectChain + 'static, + I: BlockImport + Send + Sync + 'static, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + SO: SyncOracle + Send + Sync + Clone + 'static, + L: sc_consensus::JustificationSyncLink + 'static, + CIDP: CreateInherentDataProviders + Send + Sync + 'static, + CIDP::InherentDataProviders: InherentDataProviderExt + Send, + BS: BackoffAuthoringBlocksStrategy> + Send + Sync + 'static, + Error: std::error::Error + Send + From + From + 'static; + + /// Spawns any consensus mechanism specific essential handles. + fn spawn_essential_handles( + &self, + task_manager: &mut TaskManager, + client: Arc, + triggered: Option>, + ) -> Result<(), ServiceError>; + + /// Returns any consensus mechanism specific rpc methods to register. + fn rpc_methods( + &self, + client: Arc, + keystore: KeystorePtr, + select_chain: FullSelectChain, + ) -> Result, sc_service::Error>; +} diff --git a/node/src/consensus/mod.rs b/node/src/consensus/mod.rs new file mode 100644 index 0000000000..98dc2aa28f --- /dev/null +++ b/node/src/consensus/mod.rs @@ -0,0 +1,9 @@ +mod aura_consensus; +mod aura_wrapped_import_queue; +mod babe_consensus; +mod consensus_mechanism; + +pub use aura_consensus::AuraConsensus; +pub use babe_consensus::BabeConsensus; +pub use consensus_mechanism::ConsensusMechanism; +pub use consensus_mechanism::StartAuthoringParams; diff --git a/node/src/consensus_mechanism.rs b/node/src/consensus_mechanism.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/node/src/ethereum.rs b/node/src/ethereum.rs index 9179f30598..854826f18e 100644 --- a/node/src/ethereum.rs +++ b/node/src/ethereum.rs @@ -1,5 +1,4 @@ -use fc_aura::AuraConsensusDataProvider; -pub use fc_consensus::FrontierBlockImport; +use crate::rpc::EthDeps; use fc_rpc::{ Debug, DebugApiServer, Eth, EthApiServer, EthConfig, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub, EthPubSubApiServer, EthSigner, EthTask, Net, NetApiServer, Web3, @@ -28,7 +27,6 @@ use std::{ }; use crate::client::{FullBackend, FullClient}; -use crate::rpc::EthDeps; pub type FrontierBackend = fc_db::Backend; @@ -198,6 +196,7 @@ pub async fn spawn_frontier_tasks( fn extend_rpc_aet_api( io: &mut RpcModule<()>, deps: &EthDeps, + pending_consensus_data_provider: Option>>, ) -> Result<(), Box> where P: TransactionPool< @@ -233,9 +232,7 @@ where deps.execute_gas_limit_multiplier, deps.forced_parent_hashes.clone(), deps.pending_create_inherent_data_providers.clone(), - Some(Box::new(AuraConsensusDataProvider::new( - deps.client.clone(), - ))), + pending_consensus_data_provider, ) .replace_config::() .into_rpc(), @@ -393,6 +390,7 @@ pub fn create_eth( fc_mapping_sync::EthereumBlockNotification, >, >, + pending_consensus_data_provider: Option>>, ) -> Result, Box> where P: TransactionPool< @@ -406,7 +404,7 @@ where CIDP: CreateInherentDataProviders + Send + Clone + 'static, EC: EthConfig, { - extend_rpc_aet_api::(&mut io, &deps)?; + extend_rpc_aet_api::(&mut io, &deps, pending_consensus_data_provider)?; extend_rpc_eth_filter::(&mut io, &deps)?; extend_rpc_eth_pubsub::( &mut io, diff --git a/node/src/lib.rs b/node/src/lib.rs index 81cae51451..c447a07309 100644 --- a/node/src/lib.rs +++ b/node/src/lib.rs @@ -1,6 +1,8 @@ pub mod chain_spec; pub mod cli; pub mod client; +pub mod conditional_evm_block_import; +pub mod consensus; pub mod ethereum; pub mod rpc; pub mod service; diff --git a/node/src/main.rs b/node/src/main.rs index bb8cd8e8bc..64f25acc67 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,16 +1,17 @@ //! Substrate Node Subtensor CLI library. #![warn(missing_docs)] -mod chain_spec; -#[macro_use] -mod service; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; +mod chain_spec; mod cli; mod client; mod command; +mod conditional_evm_block_import; +mod consensus; mod ethereum; mod rpc; +mod service; fn main() -> sc_cli::Result<()> { command::run() diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 7f4f969bec..e34826462f 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -5,14 +5,19 @@ #![warn(missing_docs)] -use std::{collections::BTreeMap, sync::Arc}; +use std::sync::Arc; use futures::channel::mpsc; -pub use fc_rpc::EthBlockDataCacheTask; +use crate::{ + client::{FullBackend, FullClient}, + ethereum::create_eth, +}; +use fc_rpc::EthBlockDataCacheTask; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; -use fc_storage::StorageOverride; -use jsonrpsee::RpcModule; +/// Frontier DB backend type. +pub use fc_storage::StorageOverride; +use jsonrpsee::{Methods, RpcModule}; use node_subtensor_runtime::opaque::Block; use sc_consensus_manual_seal::EngineCommand; use sc_network::service::traits::NetworkService; @@ -22,13 +27,9 @@ use sc_transaction_pool_api::TransactionPool; use sp_core::H256; use sp_inherents::CreateInherentDataProviders; use sp_runtime::{OpaqueExtrinsic, traits::BlakeTwo256, traits::Block as BlockT}; +use std::collections::BTreeMap; use subtensor_runtime_common::Hash; -use crate::{ - client::{FullBackend, FullClient}, - ethereum::create_eth, -}; - /// Extra dependencies for Ethereum compatibility. pub struct EthDeps { /// The client instance to use. @@ -103,6 +104,10 @@ pub fn create_full( fc_mapping_sync::EthereumBlockNotification, >, >, + frontier_pending_consensus_data_provider: Box< + dyn fc_rpc::pending::ConsensusDataProvider, + >, + other_methods: &[Methods], ) -> Result, Box> where P: TransactionPool< @@ -136,7 +141,7 @@ where module.merge(Swap::new(client.clone()).into_rpc())?; module.merge(System::new(client.clone(), pool.clone()).into_rpc())?; - module.merge(TransactionPayment::new(client).into_rpc())?; + module.merge(TransactionPayment::new(client.clone()).into_rpc())?; // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed @@ -151,12 +156,18 @@ where )?; } + // Other methods provided by the caller + for m in other_methods { + module.merge(m.clone())?; + } + // Ethereum compatibility RPCs let module = create_eth::<_, _, _, DefaultEthConfig>( module, eth, subscription_task_executor, pubsub_notification_sinks, + Some(frontier_pending_consensus_data_provider), )?; Ok(module) diff --git a/node/src/service.rs b/node/src/service.rs index 2dc9cbd479..9481ee9c37 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,48 +1,59 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. +use crate::consensus::ConsensusMechanism; use futures::{FutureExt, channel::mpsc, future}; use node_subtensor_runtime::{RuntimeApi, TransactionConverter, opaque::Block}; use sc_chain_spec::ChainType; use sc_client_api::{Backend as BackendT, BlockBackend}; -use sc_consensus::{ - BasicQueue, BlockCheckParams, BlockImport, BlockImportParams, BoxBlockImport, ImportResult, -}; +use sc_consensus::{BasicQueue, BoxBlockImport}; use sc_consensus_grandpa::BlockNumberOps; use sc_consensus_slots::BackoffAuthoringOnFinalizedHeadLagging; +use sc_consensus_slots::SlotProportion; use sc_network::config::SyncMode; use sc_network_sync::strategy::warp::{WarpSyncConfig, WarpSyncProvider}; use sc_service::{Configuration, PartialComponents, TaskManager, error::Error as ServiceError}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, log}; use sc_transaction_pool::TransactionPoolHandle; use sc_transaction_pool_api::OffchainTransactionPoolFactory; -use sp_consensus::Error as ConsensusError; -use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use sp_core::H256; -use sp_runtime::traits::{Block as BlockT, Header, NumberFor}; +use sp_runtime::traits::{Block as BlockT, NumberFor}; use std::collections::HashSet; use std::str::FromStr; +use std::sync::atomic::AtomicBool; use std::{cell::RefCell, path::Path}; -use std::{marker::PhantomData, sync::Arc, time::Duration}; +use std::{sync::Arc, time::Duration}; use substrate_prometheus_endpoint::Registry; use crate::cli::Sealing; use crate::client::{FullBackend, FullClient, HostFunctions, RuntimeExecutor}; use crate::ethereum::{ - BackendType, EthConfiguration, FrontierBackend, FrontierBlockImport, FrontierPartialComponents, - StorageOverride, StorageOverrideHandler, db_config_dir, new_frontier_partial, - spawn_frontier_tasks, + BackendType, EthConfiguration, FrontierBackend, FrontierPartialComponents, StorageOverride, + StorageOverrideHandler, db_config_dir, new_frontier_partial, spawn_frontier_tasks, }; /// The minimum period of blocks on which justifications will be /// imported and generated. const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; -type FullSelectChain = sc_consensus::LongestChain; -type GrandpaBlockImport = +pub type FullSelectChain = sc_consensus::LongestChain; +pub type GrandpaBlockImport = sc_consensus_grandpa::GrandpaBlockImport; type GrandpaLinkHalf = sc_consensus_grandpa::LinkHalf; - -pub fn new_partial( +pub type BIQ<'a> = Box< + dyn FnOnce( + Arc, + Arc, + &Configuration, + &EthConfiguration, + &TaskManager, + Option, + GrandpaBlockImport, + Arc>, + ) -> Result<(BasicQueue, BoxBlockImport), sc_service::Error> + + 'a, +>; + +pub fn new_partial( config: &Configuration, eth_config: &EthConfiguration, build_import_queue: BIQ, @@ -62,17 +73,7 @@ pub fn new_partial( ), >, ServiceError, -> -where - BIQ: FnOnce( - Arc, - &Configuration, - &EthConfiguration, - &TaskManager, - Option, - GrandpaBlockImport, - ) -> Result<(BasicQueue, BoxBlockImport), ServiceError>, -{ +> { let telemetry = config .telemetry_endpoints .clone() @@ -166,15 +167,6 @@ where } }; - let (import_queue, block_import) = build_import_queue( - client.clone(), - config, - eth_config, - &task_manager, - telemetry.as_ref().map(|x| x.handle()), - grandpa_block_import, - )?; - let transaction_pool = Arc::from( sc_transaction_pool::Builder::new( task_manager.spawn_essential_handle(), @@ -186,6 +178,17 @@ where .build(), ); + let (import_queue, block_import) = build_import_queue( + client.clone(), + backend.clone(), + config, + eth_config, + &task_manager, + telemetry.as_ref().map(|x| x.handle()), + grandpa_block_import, + transaction_pool.clone(), + )?; + Ok(PartialComponents { client, backend, @@ -204,150 +207,17 @@ where }) } -pub struct ConditionalEVMBlockImport { - inner: I, - frontier_block_import: F, - _marker: PhantomData, -} - -impl Clone for ConditionalEVMBlockImport -where - B: BlockT, - I: Clone + BlockImport, - F: Clone + BlockImport, -{ - fn clone(&self) -> Self { - ConditionalEVMBlockImport { - inner: self.inner.clone(), - frontier_block_import: self.frontier_block_import.clone(), - _marker: PhantomData, - } - } -} - -impl ConditionalEVMBlockImport -where - B: BlockT, - I: BlockImport, - I::Error: Into, - F: BlockImport, - F::Error: Into, -{ - pub fn new(inner: I, frontier_block_import: F) -> Self { - Self { - inner, - frontier_block_import, - _marker: PhantomData, - } - } -} - -#[async_trait::async_trait] -impl BlockImport for ConditionalEVMBlockImport -where - B: BlockT, - I: BlockImport + Send + Sync, - I::Error: Into, - F: BlockImport + Send + Sync, - F::Error: Into, -{ - type Error = ConsensusError; - - async fn check_block(&self, block: BlockCheckParams) -> Result { - self.inner.check_block(block).await.map_err(Into::into) - } - - async fn import_block(&self, block: BlockImportParams) -> Result { - // 4345556 - mainnet runtime upgrade block with Frontier - if *block.header.number() < 4345557u32.into() { - self.inner.import_block(block).await.map_err(Into::into) - } else { - self.frontier_block_import - .import_block(block) - .await - .map_err(Into::into) - } - } -} - -/// Build the import queue for the template runtime (aura + grandpa). -pub fn build_aura_grandpa_import_queue( - client: Arc, - config: &Configuration, - _eth_config: &EthConfiguration, - task_manager: &TaskManager, - telemetry: Option, - grandpa_block_import: GrandpaBlockImport, -) -> Result<(BasicQueue, BoxBlockImport), ServiceError> -where - NumberFor: BlockNumberOps, -{ - let conditional_block_import = ConditionalEVMBlockImport::new( - grandpa_block_import.clone(), - FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), - ); - - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let create_inherent_data_providers = move |_, ()| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - Ok((slot, timestamp)) - }; - - let import_queue = sc_consensus_aura::import_queue::( - sc_consensus_aura::ImportQueueParams { - block_import: conditional_block_import.clone(), - justification_import: Some(Box::new(grandpa_block_import.clone())), - client, - create_inherent_data_providers, - spawner: &task_manager.spawn_essential_handle(), - registry: config.prometheus_registry(), - check_for_equivocation: Default::default(), - telemetry, - compatibility_mode: sc_consensus_aura::CompatibilityMode::None, - }, - ) - .map_err::(Into::into)?; - - Ok((import_queue, Box::new(conditional_block_import))) -} - -/// Build the import queue for the template runtime (manual seal). -pub fn build_manual_seal_import_queue( - client: Arc, - config: &Configuration, - _eth_config: &EthConfiguration, - task_manager: &TaskManager, - _telemetry: Option, - grandpa_block_import: GrandpaBlockImport, -) -> Result<(BasicQueue, BoxBlockImport), ServiceError> { - let conditional_block_import = ConditionalEVMBlockImport::new( - grandpa_block_import.clone(), - FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), - ); - Ok(( - sc_consensus_manual_seal::import_queue( - Box::new(conditional_block_import.clone()), - &task_manager.spawn_essential_handle(), - config.prometheus_registry(), - ), - Box::new(conditional_block_import), - )) -} - /// Builds a new service for a full client. -pub async fn new_full( +pub async fn new_full( mut config: Configuration, eth_config: EthConfiguration, sealing: Option, + custom_service_signal: Option>, ) -> Result where NumberFor: BlockNumberOps, NB: sc_network::NetworkBackend::Hash>, + CM: ConsensusMechanism, { // Substrate doesn't seem to support fast sync option in our configuration. if matches!(config.network.sync_mode, SyncMode::LightState { .. }) { @@ -358,11 +228,8 @@ where return Err(ServiceError::Other("Unsupported sync mode".to_string())); } - let build_import_queue = if sealing.is_some() { - build_manual_seal_import_queue - } else { - build_aura_grandpa_import_queue - }; + let mut consensus_mechanism = CM::new(); + let build_import_queue = consensus_mechanism.build_biq()?; let PartialComponents { client, @@ -375,6 +242,12 @@ where other: (mut telemetry, block_import, grandpa_link, frontier_backend, storage_override), } = new_partial(&config, ð_config, build_import_queue)?; + consensus_mechanism.spawn_essential_handles( + &mut task_manager, + client.clone(), + custom_service_signal, + )?; + let FrontierPartialComponents { filter_pool, fee_history_cache, @@ -530,21 +403,15 @@ where prometheus_registry.clone(), )); - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let pending_create_inherent_data_providers = move |_, ()| async move { - let current = sp_timestamp::InherentDataProvider::from_system_time(); - let next_slot = current - .timestamp() - .as_millis() - .saturating_add(slot_duration.as_millis()); - let timestamp = sp_timestamp::InherentDataProvider::new(next_slot.into()); - let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - Ok((slot, timestamp)) - }; + let slot_duration = consensus_mechanism.slot_duration(&*client)?; + let pending_create_inherent_data_providers = + move |_, ()| async move { CM::create_inherent_data_providers(slot_duration) }; + let rpc_methods = consensus_mechanism.rpc_methods( + client.clone(), + keystore_container.keystore(), + select_chain.clone(), + )?; Box::new(move |subscription_task_executor| { let eth_deps = crate::rpc::EthDeps { client: client.clone(), @@ -583,6 +450,8 @@ where deps, subscription_task_executor, pubsub_notification_sinks.clone(), + CM::frontier_consensus_data_provider(client.clone())?, + rpc_methods.as_slice(), ) .map_err(Into::into) }) @@ -624,7 +493,7 @@ where sealing, client, transaction_pool, - select_chain, + select_chain.clone(), block_import, &task_manager, prometheus_registry.as_ref(), @@ -645,18 +514,13 @@ where telemetry.as_ref().map(|x| x.handle()), ); - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let create_inherent_data_providers = move |_, ()| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - Ok((slot, timestamp)) - }; + let slot_duration = consensus_mechanism.slot_duration(&*client)?; + let create_inherent_data_providers = + move |_, ()| async move { CM::create_inherent_data_providers(slot_duration) }; - let aura = sc_consensus_aura::start_aura::( - sc_consensus_aura::StartAuraParams { + consensus_mechanism.start_authoring( + &mut task_manager, + crate::consensus::StartAuthoringParams { slot_duration, client, select_chain, @@ -668,17 +532,11 @@ where force_authoring, backoff_authoring_blocks, keystore: keystore_container.keystore(), - block_proposal_slot_portion: sc_consensus_aura::SlotProportion::new(2f32 / 3f32), + block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), max_block_proposal_slot_portion: None, telemetry: telemetry.as_ref().map(|x| x.handle()), - compatibility_mode: sc_consensus_aura::CompatibilityMode::None, }, )?; - // the AURA authoring task is considered essential, i.e. if it - // fails we take down the service with it. - task_manager - .spawn_essential_handle() - .spawn_blocking("aura", Some("block-authoring"), aura); } if enable_grandpa { @@ -733,26 +591,45 @@ where Ok(task_manager) } -pub async fn build_full( +pub async fn build_full( config: Configuration, eth_config: EthConfiguration, sealing: Option, + custom_service_signal: Option>, ) -> Result { match config.network.network_backend { Some(sc_network::config::NetworkBackendType::Libp2p) => { - new_full::>(config, eth_config, sealing).await + new_full::, CM>( + config, + eth_config, + sealing, + custom_service_signal, + ) + .await } Some(sc_network::config::NetworkBackendType::Litep2p) => { - new_full::(config, eth_config, sealing).await + new_full::( + config, + eth_config, + sealing, + custom_service_signal, + ) + .await } _ => { log::debug!("no network backend selected, falling back to libp2p"); - new_full::>(config, eth_config, sealing).await + new_full::, CM>( + config, + eth_config, + sealing, + custom_service_signal, + ) + .await } } } -pub fn new_chain_ops( +pub fn new_chain_ops( config: &mut Configuration, eth_config: &EthConfiguration, ) -> Result< @@ -766,6 +643,7 @@ pub fn new_chain_ops( ServiceError, > { config.keystore = sc_service::config::KeystoreConfig::InMemory; + let mut consensus_mechanism = CM::new(); let PartialComponents { client, backend, @@ -773,7 +651,7 @@ pub fn new_chain_ops( task_manager, other, .. - } = new_partial(config, eth_config, build_aura_grandpa_import_queue)?; + } = new_partial(config, eth_config, consensus_mechanism.build_biq()?)?; Ok((client, backend, import_queue, task_manager, other.3)) } @@ -802,7 +680,7 @@ fn run_manual_seal_authorship( thread_local!(static TIMESTAMP: RefCell = const { RefCell::new(0) }); /// Provide a mock duration starting at 0 in millisecond for timestamp inherent. - /// Each call will increment timestamp by slot_duration making Aura think time has passed. + /// Each call will increment timestamp by slot_duration making the consensus logic think time has passed. struct MockTimestampInherentDataProvider; #[async_trait::async_trait] diff --git a/pallets/subtensor/Cargo.toml b/pallets/subtensor/Cargo.toml index 2f3dc85995..380d42a83a 100644 --- a/pallets/subtensor/Cargo.toml +++ b/pallets/subtensor/Cargo.toml @@ -165,4 +165,6 @@ try-runtime = [ "pallet-crowdloan/try-runtime", ] pow-faucet = [] -fast-blocks = [] +fast-blocks = [ + "subtensor-runtime-common/fast-blocks" +] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2fa522b6bc..5d33e6d201 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -23,6 +23,7 @@ path = "src/spec_version.rs" subtensor-macros.workspace = true subtensor-custom-rpc-runtime-api = { workspace = true } smallvec = { workspace = true } +array-bytes = { workspace = true } log = { workspace = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", @@ -47,7 +48,9 @@ pallet-utility = { workspace = true } frame-executive = { workspace = true } frame-metadata-hash-extension = { workspace = true } sp-api = { workspace = true } +sp-authority-discovery = { workspace = true } sp-block-builder = { workspace = true } +sp-consensus-babe = { workspace = true } sp-consensus-aura = { workspace = true } sp-core = { workspace = true } sp-storage = { workspace = true } @@ -61,6 +64,8 @@ sp-transaction-pool = { workspace = true } sp-version = { workspace = true } subtensor-runtime-common = { workspace = true } subtensor-precompiles = { workspace = true } +runtime-common = { workspace = true } +polkadot-core-primitives = { workspace = true } # Temporary sudo pallet-sudo = { workspace = true } @@ -99,6 +104,27 @@ pallet-registry = { workspace = true } # Metadata commitment pallet pallet-commitments = { workspace = true } +# NPoS +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 } +sp-consensus-slots = { workspace = true } +sp-consensus-grandpa = { workspace = true } + # Frontier fp-evm = { workspace = true } fp-rpc = { workspace = true } @@ -142,7 +168,7 @@ default = ["std"] pow-faucet = ["pallet-subtensor/pow-faucet"] fast-blocks = [ "pallet-subtensor/fast-blocks", - "subtensor-runtime-common/fast-blocks", + "subtensor-runtime-common/fast-blocks" ] std = [ "frame-try-runtime?/std", @@ -157,11 +183,6 @@ std = [ "frame-system/std", "frame-try-runtime/std", "pallet-subtensor/std", - "pallet-subtensor-swap/std", - "pallet-subtensor-swap-runtime-api/std", - "substrate-fixed/std", - "subtensor-swap-interface/std", - "pallet-aura/std", "pallet-balances/std", "pallet-grandpa/std", "pallet-insecure-randomness-collective-flip/std", @@ -179,7 +200,6 @@ std = [ "precompile-utils/std", "sp-api/std", "sp-block-builder/std", - "sp-consensus-aura/std", "sp-core/std", "sp-inherents/std", "sp-offchain/std", @@ -203,6 +223,26 @@ std = [ "subtensor-precompiles/std", "subtensor-runtime-common/std", "pallet-crowdloan/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", + "sp-authority-discovery/std", + "sp-consensus-babe/std", + "sp-npos-elections/std", + "sp-staking/std", + "polkadot-core-primitives/std", # Frontier "fp-evm/std", "fp-rpc/std", @@ -225,6 +265,14 @@ std = [ "rand_chacha/std", "sha2/std", "w3f-bls/std", + "pallet-aura/std", + "sp-consensus-aura/std", + "sp-consensus-grandpa/std", + "sp-consensus-slots/std", + "substrate-fixed/std", + "pallet-subtensor-swap/std", + "pallet-subtensor-swap-runtime-api/std", + "subtensor-swap-interface/std" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -234,12 +282,10 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", - "pallet-transaction-payment/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "pallet-safe-mode/runtime-benchmarks", "pallet-subtensor/runtime-benchmarks", - "pallet-subtensor-swap/runtime-benchmarks", "pallet-collective/runtime-benchmarks", "pallet-membership/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", @@ -251,19 +297,30 @@ runtime-benchmarks = [ "pallet-scheduler/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", "pallet-crowdloan/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", "pallet-evm/runtime-benchmarks", "pallet-hotfix-sufficients/runtime-benchmarks", "pallet-drand/runtime-benchmarks", + "pallet-transaction-payment/runtime-benchmarks", + "pallet-subtensor-swap/runtime-benchmarks" ] try-runtime = [ "frame-try-runtime/try-runtime", "frame-executive/try-runtime", "frame-system/try-runtime", "frame-support/try-runtime", - "pallet-aura/try-runtime", "pallet-sudo/try-runtime", "pallet-balances/try-runtime", "pallet-grandpa/try-runtime", @@ -285,6 +342,18 @@ try-runtime = [ "pallet-commitments/try-runtime", "pallet-registry/try-runtime", "pallet-crowdloan/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", @@ -293,5 +362,6 @@ try-runtime = [ "pallet-evm/try-runtime", "pallet-evm-chain-id/try-runtime", "pallet-drand/try-runtime", + "pallet-aura/try-runtime" ] metadata-hash = ["substrate-wasm-builder/metadata-hash"] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index f56b89e84e..9e0f8b5498 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -32,9 +32,7 @@ use frame_support::{ }; use frame_system::{EnsureNever, EnsureRoot, EnsureRootWithSuccess, RawOrigin}; use pallet_commitments::{CanCommit, OnMetadataCommitment}; -use pallet_grandpa::{ - AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, fg_primitives, -}; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; use pallet_registry::CanRegisterIdentity; use pallet_subtensor::rpc_info::{ delegate_info::DelegateInfo, @@ -57,8 +55,8 @@ use sp_runtime::generic::Era; use sp_runtime::{ AccountId32, ApplyExtrinsicResult, ConsensusEngineId, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, NumberFor, - One, PostDispatchInfoOf, UniqueSaturatedInto, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, One, + PostDispatchInfoOf, UniqueSaturatedInto, Verify, }, transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError}, }; @@ -1902,7 +1900,7 @@ impl_runtime_apis! { } impl fg_primitives::GrandpaApi for Runtime { - fn grandpa_authorities() -> GrandpaAuthorityList { + fn grandpa_authorities() -> Vec<(GrandpaId, u64)> { Grandpa::grandpa_authorities() } @@ -1911,18 +1909,23 @@ impl_runtime_apis! { } fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: fg_primitives::EquivocationProof< + equivocation_proof: fg_primitives::EquivocationProof< ::Hash, - NumberFor, + sp_runtime::traits::NumberFor, >, - _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, + key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof, ) -> Option<()> { - None + let key_owner_proof = key_owner_proof.decode()?; + + Grandpa::submit_unsigned_equivocation_report( + equivocation_proof, + key_owner_proof, + ) } fn generate_key_ownership_proof( _set_id: fg_primitives::SetId, - _authority_id: GrandpaId, + _authority_id: fg_primitives::AuthorityId, ) -> Option { // NOTE: this is the only implementation possible since we've // defined our key owner proof type as a bottom type (i.e. a type @@ -2413,6 +2416,37 @@ impl_runtime_apis! { } } + impl sp_consensus_babe::BabeApi for Runtime { + fn configuration() -> sp_consensus_babe::BabeConfiguration { + unimplemented!(); + } + + fn current_epoch_start() -> sp_consensus_babe::Slot { + unimplemented!(); + } + + fn current_epoch() -> sp_consensus_babe::Epoch { + unimplemented!(); + } + + fn next_epoch() -> sp_consensus_babe::Epoch { + unimplemented!(); + } + + fn generate_key_ownership_proof( + _slot: sp_consensus_babe::Slot, + _authority_id: sp_consensus_babe::AuthorityId, + ) -> Option { + unimplemented!(); + } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: sp_consensus_babe::EquivocationProof<::Header>, + _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, + ) -> Option<()> { + unimplemented!(); + } + } impl pallet_subtensor_swap_runtime_api::SwapRuntimeApi for Runtime { fn current_alpha_price(netuid: u16) -> u64 { diff --git a/zepter.yaml b/zepter.yaml index e448fa228c..681f802066 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-blocks", # 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. From 1a20aab4d480ffe2923a17eef353125d1985bc2d Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 22 Jul 2025 21:33:42 +1200 Subject: [PATCH 02/24] comment --- node/src/consensus/aura_wrapped_import_queue.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/src/consensus/aura_wrapped_import_queue.rs b/node/src/consensus/aura_wrapped_import_queue.rs index 1b1adc0526..75dcc88982 100644 --- a/node/src/consensus/aura_wrapped_import_queue.rs +++ b/node/src/consensus/aura_wrapped_import_queue.rs @@ -30,6 +30,11 @@ use std::sync::Arc; /// A wrapped Aura verifier which will stall verification if it encounters a /// Babe block, rather than error out. +/// +/// This is required to prevent rapid validation failure and subsequent +/// re-fetching of the same block from peers, which triggers the peers to +/// blacklist the offending node and refuse to connect with them until they +/// are restarted struct AuraWrappedVerifier { inner: AuraVerifier, _phantom: std::marker::PhantomData, From c1e1fbeccb3c57d9bd2b2ee8159b860c0d61714f Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 23 Jul 2025 11:13:22 +1200 Subject: [PATCH 03/24] fix runtime-benchmark compile --- node/src/command.rs | 2 +- node/src/service.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/node/src/command.rs b/node/src/command.rs index 2ccdc5a506..6c01ab0a36 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -181,7 +181,7 @@ pub fn run() -> sc_cli::Result<()> { } = crate::service::new_partial( &config, &cli.eth, - crate::service::build_manual_seal_import_queue, + Box::new(crate::service::build_manual_seal_import_queue), )?; // This switch needs to be in the client, since the client decides diff --git a/node/src/service.rs b/node/src/service.rs index 9481ee9c37..937100d9f1 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,5 +1,6 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. +use crate::conditional_evm_block_import::ConditionalEVMBlockImport; use crate::consensus::ConsensusMechanism; use futures::{FutureExt, channel::mpsc, future}; use node_subtensor_runtime::{RuntimeApi, TransactionConverter, opaque::Block}; @@ -207,6 +208,32 @@ pub fn new_partial( }) } +/// Build the import queue for the template runtime (manual seal). +pub fn build_manual_seal_import_queue( + client: Arc, + _backend: Arc, + config: &Configuration, + _eth_config: &EthConfiguration, + task_manager: &TaskManager, + _telemetry: Option, + grandpa_block_import: GrandpaBlockImport, + _transaction_pool_handle: Arc>, +) -> Result<(BasicQueue, BoxBlockImport), ServiceError> { + let conditional_block_import = ConditionalEVMBlockImport::new( + grandpa_block_import.clone(), + fc_consensus::FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), + client.clone(), + ); + Ok(( + sc_consensus_manual_seal::import_queue( + Box::new(conditional_block_import.clone()), + &task_manager.spawn_essential_handle(), + config.prometheus_registry(), + ), + Box::new(conditional_block_import), + )) +} + /// Builds a new service for a full client. pub async fn new_full( mut config: Configuration, From 371761d97f8b53210041f756ec0bb62e4a744f5f Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 23 Jul 2025 11:17:08 +1200 Subject: [PATCH 04/24] update ConditionalEVMBlockImport --- node/src/conditional_evm_block_import.rs | 71 +++++------------------- node/src/consensus/aura_consensus.rs | 1 - node/src/consensus/babe_consensus.rs | 1 - node/src/service.rs | 1 - 4 files changed, 15 insertions(+), 59 deletions(-) diff --git a/node/src/conditional_evm_block_import.rs b/node/src/conditional_evm_block_import.rs index f9453e935d..b6ba445c1f 100644 --- a/node/src/conditional_evm_block_import.rs +++ b/node/src/conditional_evm_block_import.rs @@ -1,33 +1,15 @@ -use fp_consensus::{FindLogError, ensure_log}; -use fp_rpc::EthereumRuntimeRPCApi; -use sc_consensus::{ - BlockCheckParams, BlockImport, BlockImportParams, ImportResult, -}; -use sp_api::ProvideRuntimeApi; -use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sc_consensus::{BlockCheckParams, BlockImport, BlockImportParams, ImportResult}; use sp_consensus::Error as ConsensusError; use sp_runtime::traits::{Block as BlockT, Header}; -use std::{marker::PhantomData, sync::Arc}; +use std::marker::PhantomData; - -#[derive(Debug, thiserror::Error)] -pub enum Error { - #[error("Multiple runtime Ethereum blocks, rejecting!")] - MultipleRuntimeLogs, - #[error("Runtime Ethereum block not found, rejecting!")] - NoRuntimeLog, - #[error("Cannot access the runtime at genesis, rejecting!")] - RuntimeApiCallFailed, -} - -pub struct ConditionalEVMBlockImport { +pub struct ConditionalEVMBlockImport { inner: I, frontier_block_import: F, - client: Arc, _marker: PhantomData, } -impl Clone for ConditionalEVMBlockImport +impl Clone for ConditionalEVMBlockImport where B: BlockT, I: Clone + BlockImport, @@ -37,42 +19,36 @@ where ConditionalEVMBlockImport { inner: self.inner.clone(), frontier_block_import: self.frontier_block_import.clone(), - client: self.client.clone(), _marker: PhantomData, } } } -impl ConditionalEVMBlockImport +impl ConditionalEVMBlockImport where B: BlockT, I: BlockImport, I::Error: Into, F: BlockImport, F::Error: Into, - C: ProvideRuntimeApi, - C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, { - pub fn new(inner: I, frontier_block_import: F, client: Arc) -> Self { + pub fn new(inner: I, frontier_block_import: F) -> Self { Self { inner, frontier_block_import, - client, _marker: PhantomData, } } } #[async_trait::async_trait] -impl BlockImport for ConditionalEVMBlockImport +impl BlockImport for ConditionalEVMBlockImport where B: BlockT, I: BlockImport + Send + Sync, I::Error: Into, F: BlockImport + Send + Sync, F::Error: Into, - C: ProvideRuntimeApi + Send + Sync, - C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, { type Error = ConsensusError; @@ -81,31 +57,14 @@ where } async fn import_block(&self, block: BlockImportParams) -> Result { - // Import like Frontier, but fallback to grandpa import for errors - match ensure_log(block.header.digest()).map_err(Error::from) { - Ok(()) => self.inner.import_block(block).await.map_err(Into::into), - _ => self.inner.import_block(block).await.map_err(Into::into), + // 4345556 - mainnet runtime upgrade block with Frontier + if *block.header.number() < 4345557u32.into() { + self.inner.import_block(block).await.map_err(Into::into) + } else { + self.frontier_block_import + .import_block(block) + .await + .map_err(Into::into) } } } - -impl From for String { - fn from(error: Error) -> String { - error.to_string() - } -} - -impl From for Error { - fn from(error: FindLogError) -> Error { - match error { - FindLogError::NotFound => Error::NoRuntimeLog, - FindLogError::MultipleLogs => Error::MultipleRuntimeLogs, - } - } -} - -impl From for ConsensusError { - fn from(error: Error) -> ConsensusError { - ConsensusError::ClientImport(error.to_string()) - } -} diff --git a/node/src/consensus/aura_consensus.rs b/node/src/consensus/aura_consensus.rs index 8a6f8167ec..51846c74cb 100644 --- a/node/src/consensus/aura_consensus.rs +++ b/node/src/consensus/aura_consensus.rs @@ -132,7 +132,6 @@ impl ConsensusMechanism for AuraConsensus { let conditional_block_import = ConditionalEVMBlockImport::new( grandpa_block_import.clone(), FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), - client.clone(), ); let slot_duration = sc_consensus_aura::slot_duration(&*client)?; diff --git a/node/src/consensus/babe_consensus.rs b/node/src/consensus/babe_consensus.rs index c58ef3b29b..a6d7cc2b29 100644 --- a/node/src/consensus/babe_consensus.rs +++ b/node/src/consensus/babe_consensus.rs @@ -147,7 +147,6 @@ impl ConsensusMechanism for BabeConsensus { let conditional_block_import = ConditionalEVMBlockImport::new( babe_import.clone(), FrontierBlockImport::new(babe_import.clone(), client.clone()), - client.clone(), ); let slot_duration = babe_link.config().slot_duration(); diff --git a/node/src/service.rs b/node/src/service.rs index 937100d9f1..9073ccea9c 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -222,7 +222,6 @@ pub fn build_manual_seal_import_queue( let conditional_block_import = ConditionalEVMBlockImport::new( grandpa_block_import.clone(), fc_consensus::FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), - client.clone(), ); Ok(( sc_consensus_manual_seal::import_queue( From 35f7ff2820cc8cc0aa37a5325d17476731ace4c6 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 23 Jul 2025 11:25:12 +1200 Subject: [PATCH 05/24] clippy --- node/src/consensus/aura_consensus.rs | 2 +- node/src/consensus/aura_wrapped_import_queue.rs | 5 ++--- node/src/consensus/babe_consensus.rs | 2 +- node/src/service.rs | 8 +++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/node/src/consensus/aura_consensus.rs b/node/src/consensus/aura_consensus.rs index 51846c74cb..b8f4326fdf 100644 --- a/node/src/consensus/aura_consensus.rs +++ b/node/src/consensus/aura_consensus.rs @@ -171,7 +171,7 @@ impl ConsensusMechanism for AuraConsensus { } fn slot_duration(&self, client: &FullClient) -> Result { - sc_consensus_aura::slot_duration(&*client).map_err(Into::into) + sc_consensus_aura::slot_duration(client).map_err(Into::into) } fn spawn_essential_handles( diff --git a/node/src/consensus/aura_wrapped_import_queue.rs b/node/src/consensus/aura_wrapped_import_queue.rs index 75dcc88982..7595f4b044 100644 --- a/node/src/consensus/aura_wrapped_import_queue.rs +++ b/node/src/consensus/aura_wrapped_import_queue.rs @@ -1,5 +1,4 @@ use futures::future::pending; -use log; use sc_client_api::AuxStore; use sc_client_api::BlockOf; use sc_client_api::UsageProvider; @@ -74,7 +73,7 @@ where CIDP::InherentDataProviders: InherentDataProviderExt + Send + Sync, { async fn verify(&self, block: BlockImportParams) -> Result, String> { - let number: NumberFor = block.post_header().number().clone(); + let number: NumberFor = *block.post_header().number(); log::debug!("Verifying block: {:?}", number); if is_babe_digest(block.header.digest()) { log::debug!( @@ -129,7 +128,7 @@ fn is_babe_digest(digest: &Digest) -> bool { digest .log(|d| match d { DigestItem::PreRuntime(engine_id, _) => { - if engine_id.clone() == BABE_ENGINE_ID { + if *engine_id == BABE_ENGINE_ID { Some(d) } else { None diff --git a/node/src/consensus/babe_consensus.rs b/node/src/consensus/babe_consensus.rs index a6d7cc2b29..723bc7f7b7 100644 --- a/node/src/consensus/babe_consensus.rs +++ b/node/src/consensus/babe_consensus.rs @@ -187,7 +187,7 @@ impl ConsensusMechanism for BabeConsensus { fn slot_duration(&self, _client: &FullClient) -> Result { if let Some(ref babe_link) = self.babe_link { - Ok(babe_link.config().slot_duration().clone()) + Ok(babe_link.config().slot_duration()) } else { Err(sc_service::Error::Other( "Babe link not initialized. Ensure that the import queue has been built before calling slot_duration.".to_string() diff --git a/node/src/service.rs b/node/src/service.rs index 9073ccea9c..40c3727995 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,6 +1,5 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. -use crate::conditional_evm_block_import::ConditionalEVMBlockImport; use crate::consensus::ConsensusMechanism; use futures::{FutureExt, channel::mpsc, future}; use node_subtensor_runtime::{RuntimeApi, TransactionConverter, opaque::Block}; @@ -40,6 +39,7 @@ pub type FullSelectChain = sc_consensus::LongestChain; pub type GrandpaBlockImport = sc_consensus_grandpa::GrandpaBlockImport; type GrandpaLinkHalf = sc_consensus_grandpa::LinkHalf; +#[allow(clippy::upper_case_acronyms)] pub type BIQ<'a> = Box< dyn FnOnce( Arc, @@ -209,6 +209,8 @@ pub fn new_partial( } /// Build the import queue for the template runtime (manual seal). +#[allow(clippy::too_many_arguments)] +#[cfg(feature = "runtime-benchmarks")] pub fn build_manual_seal_import_queue( client: Arc, _backend: Arc, @@ -429,7 +431,7 @@ where prometheus_registry.clone(), )); - let slot_duration = consensus_mechanism.slot_duration(&*client)?; + let slot_duration = consensus_mechanism.slot_duration(&client)?; let pending_create_inherent_data_providers = move |_, ()| async move { CM::create_inherent_data_providers(slot_duration) }; @@ -540,7 +542,7 @@ where telemetry.as_ref().map(|x| x.handle()), ); - let slot_duration = consensus_mechanism.slot_duration(&*client)?; + let slot_duration = consensus_mechanism.slot_duration(&client)?; let create_inherent_data_providers = move |_, ()| async move { CM::create_inherent_data_providers(slot_duration) }; From 4789a88e2d41b221e3735daa08323dab8208601c Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 23 Jul 2025 11:53:22 +1200 Subject: [PATCH 06/24] fix runtime-benchmark compile again --- node/src/service.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/node/src/service.rs b/node/src/service.rs index 40c3727995..543059b948 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -221,10 +221,11 @@ pub fn build_manual_seal_import_queue( grandpa_block_import: GrandpaBlockImport, _transaction_pool_handle: Arc>, ) -> Result<(BasicQueue, BoxBlockImport), ServiceError> { - let conditional_block_import = ConditionalEVMBlockImport::new( - grandpa_block_import.clone(), - fc_consensus::FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), - ); + let conditional_block_import = + crate::conditional_evm_block_import::ConditionalEVMBlockImport::new( + grandpa_block_import.clone(), + fc_consensus::FrontierBlockImport::new(grandpa_block_import.clone(), client.clone()), + ); Ok(( sc_consensus_manual_seal::import_queue( Box::new(conditional_block_import.clone()), From db926469d10326381b1dfea507b27597657a9d13 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Fri, 25 Jul 2025 18:31:33 +1200 Subject: [PATCH 07/24] prefer matches! --- node/src/command.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/src/command.rs b/node/src/command.rs index 6c01ab0a36..ce70876224 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -254,7 +254,11 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { }) { Ok(_) => Ok(()), Err(e) => { - if e.to_string().contains("BabeApi") { + if matches!( + e, + sc_service::Error::Client(sp_blockchain::Error::VersionInvalid(ref msg)) + if msg == "Unsupported or invalid BabeApi version" + ) { log::info!( "💡 Chain is using Aura consensus. Switching to Aura service until Babe block is detected.", ); From 4b3beab4e9b2e86280ddc99a12fb6edb599783f1 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Fri, 25 Jul 2025 18:32:33 +1200 Subject: [PATCH 08/24] cleanup unused file --- node/src/consensus_mechanism.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 node/src/consensus_mechanism.rs diff --git a/node/src/consensus_mechanism.rs b/node/src/consensus_mechanism.rs deleted file mode 100644 index e69de29bb2..0000000000 From aec6b2958de09580f3bf87597e5e8fd3872b3507 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Sun, 27 Jul 2025 10:32:31 +1200 Subject: [PATCH 09/24] prefer matches! --- node/src/consensus/aura_wrapped_import_queue.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/node/src/consensus/aura_wrapped_import_queue.rs b/node/src/consensus/aura_wrapped_import_queue.rs index 7595f4b044..7c74eabfb7 100644 --- a/node/src/consensus/aura_wrapped_import_queue.rs +++ b/node/src/consensus/aura_wrapped_import_queue.rs @@ -126,15 +126,7 @@ where fn is_babe_digest(digest: &Digest) -> bool { digest - .log(|d| match d { - DigestItem::PreRuntime(engine_id, _) => { - if *engine_id == BABE_ENGINE_ID { - Some(d) - } else { - None - } - } - _ => None, - }) - .is_some() + .logs() + .iter() + .any(|d| matches!(d, DigestItem::PreRuntime(engine_id, _) if engine_id == &BABE_ENGINE_ID)) } From 5fd36bbfee9239e30cb9d2ca1307a7aa9bfe31fe Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Sun, 27 Jul 2025 10:49:15 +1200 Subject: [PATCH 10/24] prefer matches! --- node/src/command.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/node/src/command.rs b/node/src/command.rs index ce70876224..424b513f0f 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -254,6 +254,7 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { }) { Ok(_) => Ok(()), Err(e) => { + // Handle node needs to be in Aura mode. if matches!( e, sc_service::Error::Client(sp_blockchain::Error::VersionInvalid(ref msg)) @@ -263,10 +264,15 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { "💡 Chain is using Aura consensus. Switching to Aura service until Babe block is detected.", ); run_aura(arg_matches) - } else if e.to_string().contains("lock hold by current process") { - log::warn!("Failed to aquire DB lock, trying again in 1s..."); + // Handle Aura service still has DB lock. This never has been observed to take more + // than 1s to drop. + } else if matches!(e, sc_service::Error::Client(sp_blockchain::Error::Backend(ref msg)) + if msg.starts_with("IO error: lock hold by current process")) + { + log::info!("Failed to aquire DB lock, trying again in 1s..."); std::thread::sleep(std::time::Duration::from_secs(1)); return run_babe(arg_matches); + // Unknown error, return it. } else { Err(e.into()) } From adb96488095022de98e39735edd88b9bc3095ded Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Sun, 27 Jul 2025 11:58:55 +1200 Subject: [PATCH 11/24] patch vulnerability in meantime while wait for psdk fork --- node/src/consensus/aura_wrapped_import_queue.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/node/src/consensus/aura_wrapped_import_queue.rs b/node/src/consensus/aura_wrapped_import_queue.rs index 7c74eabfb7..c6433d8dd6 100644 --- a/node/src/consensus/aura_wrapped_import_queue.rs +++ b/node/src/consensus/aura_wrapped_import_queue.rs @@ -1,4 +1,3 @@ -use futures::future::pending; use sc_client_api::AuxStore; use sc_client_api::BlockOf; use sc_client_api::UsageProvider; @@ -76,11 +75,16 @@ where let number: NumberFor = *block.post_header().number(); log::debug!("Verifying block: {:?}", number); if is_babe_digest(block.header.digest()) { - log::debug!( - "Detected Babe block! Verifier cannot continue, upgrade must be triggered elsewhere..." - ); - pending::<()>().await; - unreachable!("Should not reach here, pending forever."); + // TODO: Use a BabeVerifier to verify Babe blocks. This will + // prevent rapid validation failure and subsequent re-fetching + // of the same block from peers, which triggers the peers to + // blacklist the offending node and refuse to connect with them until they + // are restarted. + // + // Unfortunately, BabeVerifier construction logic is NOT public outside of + // its crate in vanilla Polkadot SDK, so we are unable to use it until we + // migrate to our Polkadot SDK fork. + self.inner.verify(block).await } else { self.inner.verify(block).await } From f05522743286e67d60842df0e3e63c29890316c2 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 31 Jul 2025 13:33:23 +1200 Subject: [PATCH 12/24] add todo to remove initial_consensus flag. --- node/src/cli.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/src/cli.rs b/node/src/cli.rs index db963b237e..e46c71857b 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -26,6 +26,8 @@ pub struct Cli { /// /// After starting, the consensus used by the node will automatically /// switch to whatever is required to continue validating / syncing. + /// + /// TODO: Remove this after the Babe transition has settled. #[arg(long, value_enum, ignore_case = true, default_value_t=SupportedConsensusMechanism::default())] pub initial_consensus: SupportedConsensusMechanism, From 5a63327a8d68d010906a931b98b0cd7a6de9880d Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 31 Jul 2025 13:37:35 +1200 Subject: [PATCH 13/24] better fn names --- node/src/command.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/node/src/command.rs b/node/src/command.rs index 424b513f0f..8c32aeb0ad 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -238,14 +238,14 @@ pub fn run() -> sc_cli::Result<()> { let arg_matches = Cli::command().get_matches(); let cli = Cli::from_args(); match cli.initial_consensus { - SupportedConsensusMechanism::Babe => run_babe(&arg_matches), - SupportedConsensusMechanism::Aura => run_aura(&arg_matches), + SupportedConsensusMechanism::Babe => start_babe_service(&arg_matches), + SupportedConsensusMechanism::Aura => start_aura_service(&arg_matches), } } } } -fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { +fn start_babe_service(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { let cli = Cli::from_arg_matches(arg_matches).expect("Bad arg_matches"); let runner = cli.create_runner(&cli.run)?; match runner.run_node_until_exit(|config| async move { @@ -263,7 +263,7 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { log::info!( "💡 Chain is using Aura consensus. Switching to Aura service until Babe block is detected.", ); - run_aura(arg_matches) + start_aura_service(arg_matches) // Handle Aura service still has DB lock. This never has been observed to take more // than 1s to drop. } else if matches!(e, sc_service::Error::Client(sp_blockchain::Error::Backend(ref msg)) @@ -271,7 +271,7 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { { log::info!("Failed to aquire DB lock, trying again in 1s..."); std::thread::sleep(std::time::Duration::from_secs(1)); - return run_babe(arg_matches); + return start_babe_service(arg_matches); // Unknown error, return it. } else { Err(e.into()) @@ -280,7 +280,7 @@ fn run_babe(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { } } -fn run_aura(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { +fn start_aura_service(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { let cli = Cli::from_arg_matches(arg_matches).expect("Bad arg_matches"); let runner = cli.create_runner(&cli.run)?; @@ -299,7 +299,7 @@ fn run_aura(arg_matches: &ArgMatches) -> Result<(), sc_cli::Error> { Ok(()) => Ok(()), Err(e) => { if babe_switch.load(std::sync::atomic::Ordering::Relaxed) { - run_babe(arg_matches) + start_babe_service(arg_matches) } else { Err(e.into()) } From f8b783e4f531e66fdef996dbc50fdb2c1e9964b6 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Mon, 4 Aug 2025 14:51:05 +1200 Subject: [PATCH 14/24] Return default values in BabeApi instead of panic prior to Babe upgrade --- runtime/src/lib.rs | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index dc285d7e0d..ff2409b3df 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -46,6 +46,8 @@ use pallet_subtensor::rpc_info::{ use smallvec::smallvec; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; +use sp_consensus_babe::BabeConfiguration; +use sp_consensus_babe::BabeEpochConfiguration; use sp_core::{ H160, H256, OpaqueMetadata, U256, crypto::{ByteArray, KeyTypeId}, @@ -2416,34 +2418,58 @@ impl_runtime_apis! { } impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeConfiguration { - unimplemented!(); + fn configuration() -> BabeConfiguration { + let config = BabeEpochConfiguration::default(); + BabeConfiguration { + slot_duration: Default::default(), + epoch_length: Default::default(), + authorities: vec![], + randomness: Default::default(), + c: config.c, + allowed_slots: config.allowed_slots, + + } } fn current_epoch_start() -> sp_consensus_babe::Slot { - unimplemented!(); + Default::default() } fn current_epoch() -> sp_consensus_babe::Epoch { - unimplemented!(); + sp_consensus_babe::Epoch { + epoch_index: Default::default(), + start_slot: Default::default(), + duration: Default::default(), + authorities: vec![], + randomness: Default::default(), + config: BabeEpochConfiguration::default(), + } + } fn next_epoch() -> sp_consensus_babe::Epoch { - unimplemented!(); + sp_consensus_babe::Epoch { + epoch_index: Default::default(), + start_slot: Default::default(), + duration: Default::default(), + authorities: vec![], + randomness: Default::default(), + config: BabeEpochConfiguration::default(), + } } fn generate_key_ownership_proof( _slot: sp_consensus_babe::Slot, _authority_id: sp_consensus_babe::AuthorityId, ) -> Option { - unimplemented!(); + None } fn submit_report_equivocation_unsigned_extrinsic( _equivocation_proof: sp_consensus_babe::EquivocationProof<::Header>, _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, ) -> Option<()> { - unimplemented!(); + None } } From e886766ee85214223f19f25d9e02ac6e702c2822 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Mon, 4 Aug 2025 14:59:22 +1200 Subject: [PATCH 15/24] Bump spec version --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b8ec1d6c89..a5580ec38c 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -218,7 +218,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 299, + spec_version: 300, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 969a23edcbd324e5fa9ed70d19593846dfbf6173 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 5 Aug 2025 15:48:14 +1200 Subject: [PATCH 16/24] merge devnet-ready --- .github/workflows/cargo-audit.yml | 12 +- .github/workflows/check-devnet.yml | 2 +- .github/workflows/check-finney.yml | 2 +- .github/workflows/check-testnet.yml | 2 +- Cargo.lock | 3679 +++++++---------- Cargo.toml | 399 +- common/Cargo.toml | 21 +- common/src/currency.rs | 7 +- common/src/lib.rs | 20 +- node/Cargo.toml | 172 +- node/src/benchmarking.rs | 2 +- node/src/chain_spec/finney.rs | 2 +- node/src/chain_spec/mod.rs | 2 +- node/src/command.rs | 3 +- node/src/service.rs | 22 +- pallets/admin-utils/Cargo.toml | 54 +- pallets/admin-utils/src/lib.rs | 203 +- pallets/admin-utils/src/tests/mock.rs | 6 +- pallets/admin-utils/src/tests/mod.rs | 6 +- pallets/collective/Cargo.toml | 22 +- pallets/collective/src/lib.rs | 13 +- pallets/commitments/Cargo.toml | 47 +- pallets/commitments/src/lib.rs | 20 +- pallets/commitments/src/tests.rs | 25 +- pallets/commitments/src/types.rs | 16 +- pallets/crowdloan/Cargo.toml | 12 +- pallets/crowdloan/README.md | 34 +- pallets/crowdloan/src/mock.rs | 2 + pallets/drand/Cargo.toml | 61 +- pallets/drand/src/lib.rs | 14 +- pallets/drand/src/tests.rs | 6 +- pallets/drand/src/types.rs | 19 +- pallets/drand/src/verifier.rs | 10 +- pallets/proxy/Cargo.toml | 18 +- pallets/proxy/src/benchmarking.rs | 2 +- pallets/proxy/src/lib.rs | 14 +- pallets/proxy/src/tests.rs | 6 +- pallets/registry/Cargo.toml | 25 +- pallets/registry/src/types.rs | 18 +- pallets/subtensor/Cargo.toml | 90 +- pallets/subtensor/rpc/Cargo.toml | 18 +- pallets/subtensor/rpc/src/lib.rs | 69 +- pallets/subtensor/runtime-api/Cargo.toml | 14 +- .../subtensor/src/coinbase/block_emission.rs | 17 +- pallets/subtensor/src/coinbase/block_step.rs | 10 +- .../subtensor/src/coinbase/reveal_commits.rs | 32 +- pallets/subtensor/src/coinbase/root.rs | 41 +- .../subtensor/src/coinbase/run_coinbase.rs | 150 +- pallets/subtensor/src/epoch/run_epoch.rs | 43 +- pallets/subtensor/src/lib.rs | 6 +- pallets/subtensor/src/macros/dispatches.rs | 4 +- .../src/migrations/migrate_chain_identity.rs | 8 +- .../migrations/migrate_commit_reveal_v2.rs | 10 +- .../migrations/migrate_delete_subnet_21.rs | 2 +- .../src/migrations/migrate_delete_subnet_3.rs | 3 +- .../migrations/migrate_fix_root_subnet_tao.rs | 6 +- .../migrations/migrate_init_total_issuance.rs | 8 +- .../migrate_populate_owned_hotkeys.rs | 9 +- .../subtensor/src/migrations/migrate_rao.rs | 2 +- .../migrate_remove_commitments_rate_limit.rs | 2 +- .../migrations/migrate_remove_stake_map.rs | 7 +- ...tal_hotkey_coldkey_stakes_this_interval.rs | 15 +- .../migrate_remove_unused_maps_and_values.rs | 6 +- .../migrate_remove_zero_total_hotkey_alpha.rs | 5 +- .../migrate_reset_bonds_moving_average.rs | 5 +- .../src/migrations/migrate_reset_max_burn.rs | 2 +- .../src/migrations/migrate_subnet_volume.rs | 2 +- .../migrate_to_v1_separate_emission.rs | 9 +- .../migrate_to_v2_fixed_total_stake.rs | 3 +- ...igrate_transfer_ownership_to_foundation.rs | 5 +- .../migrate_upgrade_revealed_commitments.rs | 5 +- pallets/subtensor/src/migrations/mod.rs | 10 +- pallets/subtensor/src/staking/add_stake.rs | 12 +- .../subtensor/src/staking/decrease_take.rs | 14 +- .../subtensor/src/staking/increase_take.rs | 14 +- pallets/subtensor/src/staking/move_stake.rs | 28 +- pallets/subtensor/src/staking/remove_stake.rs | 20 +- pallets/subtensor/src/staking/set_children.rs | 12 +- pallets/subtensor/src/staking/stake_utils.rs | 122 +- pallets/subtensor/src/subnets/leasing.rs | 17 + pallets/subtensor/src/subnets/registration.rs | 58 +- pallets/subtensor/src/subnets/subnet.rs | 24 +- pallets/subtensor/src/subnets/symbols.rs | 3 +- pallets/subtensor/src/subnets/uids.rs | 16 +- pallets/subtensor/src/subnets/weights.rs | 58 +- pallets/subtensor/src/swap/swap_hotkey.rs | 4 +- pallets/subtensor/src/tests/children.rs | 221 +- pallets/subtensor/src/tests/coinbase.rs | 7 +- pallets/subtensor/src/tests/consensus.rs | 5 +- pallets/subtensor/src/tests/delegate_info.rs | 6 +- pallets/subtensor/src/tests/epoch.rs | 28 +- pallets/subtensor/src/tests/math.rs | 12 +- pallets/subtensor/src/tests/migration.rs | 5 +- pallets/subtensor/src/tests/mock.rs | 9 +- pallets/subtensor/src/tests/staking.rs | 24 +- pallets/subtensor/src/tests/staking2.rs | 19 +- pallets/subtensor/src/tests/subnet.rs | 4 +- pallets/subtensor/src/tests/swap_hotkey.rs | 2 +- .../src/tests/swap_hotkey_with_subnet.rs | 2 +- pallets/subtensor/src/tests/weights.rs | 71 +- pallets/subtensor/src/utils/identity.rs | 2 +- pallets/subtensor/src/utils/misc.rs | 4 +- pallets/swap-interface/Cargo.toml | 10 +- pallets/swap/Cargo.toml | 40 +- pallets/swap/rpc/Cargo.toml | 14 +- pallets/swap/rpc/src/lib.rs | 2 +- pallets/swap/runtime-api/Cargo.toml | 17 +- pallets/swap/src/pallet/impls.rs | 8 +- pallets/swap/src/pallet/tests.rs | 6 +- pallets/swap/src/position.rs | 16 +- pallets/swap/src/tick.rs | 5 +- pallets/utility/Cargo.toml | 36 +- pallets/utility/src/lib.rs | 5 +- pallets/utility/src/tests.rs | 3 +- precompiles/Cargo.toml | 54 +- precompiles/src/extensions.rs | 6 +- precompiles/src/lib.rs | 9 +- precompiles/src/staking.rs | 5 +- primitives/safe-math/Cargo.toml | 12 +- primitives/share-pool/Cargo.toml | 14 +- runtime/Cargo.toml | 175 +- runtime/src/check_nonce.rs | 6 +- runtime/src/lib.rs | 22 +- runtime/tests/pallet_proxy.rs | 1 + rust-toolchain.toml | 4 +- support/linting/Cargo.toml | 12 +- support/macros/Cargo.toml | 12 +- support/macros/src/lib.rs | 9 +- support/procedural-fork/Cargo.toml | 32 +- support/procedural-fork/src/benchmark.rs | 28 +- .../src/construct_runtime/expand/config.rs | 2 +- .../src/construct_runtime/expand/metadata.rs | 2 +- .../src/construct_runtime/expand/mod.rs | 2 +- .../construct_runtime/expand/outer_enums.rs | 2 +- .../src/construct_runtime/mod.rs | 2 +- .../src/construct_runtime/parse.rs | 7 +- support/procedural-fork/src/derive_impl.rs | 4 +- support/procedural-fork/src/dynamic_params.rs | 4 +- support/procedural-fork/src/key_prefix.rs | 2 +- .../procedural-fork/src/no_bound/default.rs | 4 +- .../procedural-fork/src/pallet/expand/call.rs | 8 +- .../src/pallet/expand/config.rs | 2 +- .../src/pallet/expand/documentation.rs | 2 +- .../src/pallet/expand/error.rs | 4 +- .../src/pallet/expand/event.rs | 4 +- .../src/pallet/expand/genesis_config.rs | 4 +- .../src/pallet/expand/inherent.rs | 4 +- .../src/pallet/expand/instances.rs | 2 +- .../src/pallet/expand/origin.rs | 4 +- .../src/pallet/expand/pallet_struct.rs | 2 +- .../src/pallet/expand/storage.rs | 14 +- .../src/pallet/expand/tasks.rs | 6 +- .../src/pallet/expand/tt_default_parts.rs | 26 +- .../src/pallet/expand/validate_unsigned.rs | 4 +- support/procedural-fork/src/pallet/mod.rs | 2 +- .../procedural-fork/src/pallet/parse/call.rs | 7 +- .../src/pallet/parse/composite.rs | 2 +- .../src/pallet/parse/config.rs | 33 +- .../procedural-fork/src/pallet/parse/error.rs | 2 +- .../src/pallet/parse/helper.rs | 29 +- .../procedural-fork/src/pallet/parse/mod.rs | 228 +- .../src/pallet/parse/storage.rs | 24 +- .../procedural-fork/src/pallet/parse/tasks.rs | 16 +- .../procedural-fork/src/runtime/expand/mod.rs | 2 +- .../procedural-fork/src/runtime/parse/mod.rs | 8 +- .../src/runtime/parse/pallet.rs | 10 +- .../src/runtime/parse/runtime_types.rs | 2 +- support/procedural-fork/src/storage_alias.rs | 6 +- support/tools/Cargo.toml | 15 +- .../tools}/src/spec_version.rs | 0 170 files changed, 3194 insertions(+), 4313 deletions(-) rename {runtime => support/tools}/src/spec_version.rs (100%) diff --git a/.github/workflows/cargo-audit.yml b/.github/workflows/cargo-audit.yml index 5ced91529c..efb0094a20 100644 --- a/.github/workflows/cargo-audit.yml +++ b/.github/workflows/cargo-audit.yml @@ -38,12 +38,6 @@ jobs: - name: cargo audit run: | - cargo audit --ignore RUSTSEC-2024-0336 \ - --ignore RUSTSEC-2021-0127 \ - --ignore RUSTSEC-2024-0370 \ - --ignore RUSTSEC-2022-0080 \ - --ignore RUSTSEC-2022-0061 \ - --ignore RUSTSEC-2020-0168 \ - --ignore RUSTSEC-2024-0384 \ - --ignore RUSTSEC-2024-0388 \ - --ignore RUSTSEC-2024-0421 + cargo audit --ignore RUSTSEC-2023-0091 \ + --ignore RUSTSEC-2025-0009 \ + --ignore RUSTSEC-2024-0438 diff --git a/.github/workflows/check-devnet.yml b/.github/workflows/check-devnet.yml index 867102a315..b370132e2c 100644 --- a/.github/workflows/check-devnet.yml +++ b/.github/workflows/check-devnet.yml @@ -38,7 +38,7 @@ jobs: spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://dev.chain.opentensor.ai:443 | tr -d '\n') echo "network spec_version: $spec_version" : ${spec_version:?bad spec version} - local_spec_version=$(cargo run -p node-subtensor-runtime --bin spec_version | tr -d '\n') + local_spec_version=$(cargo run -p subtensor-tools --bin spec-version | tr -d '\n') echo "local spec_version: $local_spec_version" echo "network spec_version: $spec_version" if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi diff --git a/.github/workflows/check-finney.yml b/.github/workflows/check-finney.yml index 4a99df7868..5b7cbdf749 100644 --- a/.github/workflows/check-finney.yml +++ b/.github/workflows/check-finney.yml @@ -36,7 +36,7 @@ jobs: spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://entrypoint-finney.opentensor.ai:443 | tr -d '\n') echo "network spec_version: $spec_version" : ${spec_version:?bad spec version} - local_spec_version=$(cargo run -p node-subtensor-runtime --bin spec_version | tr -d '\n') + local_spec_version=$(cargo run -p subtensor-tools --bin spec-version | tr -d '\n') echo "local spec_version: $local_spec_version" echo "network spec_version: $spec_version" if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi diff --git a/.github/workflows/check-testnet.yml b/.github/workflows/check-testnet.yml index 919af25637..6a405e45f3 100644 --- a/.github/workflows/check-testnet.yml +++ b/.github/workflows/check-testnet.yml @@ -37,7 +37,7 @@ jobs: spec_version=$(PATH=$PATH:$HOME/.cargo/.bin substrate-spec-version wss://test.finney.opentensor.ai:443 | tr -d '\n') echo "network spec_version: $spec_version" : ${spec_version:?bad spec version} - local_spec_version=$(cargo run -p node-subtensor-runtime --bin spec_version | tr -d '\n') + local_spec_version=$(cargo run -p subtensor-tools --bin spec-version | tr -d '\n') echo "local spec_version: $local_spec_version" echo "network spec_version: $spec_version" if (( $(echo "$local_spec_version <= $spec_version" | bc -l) )); then echo "$local_spec_version ≯ $spec_version ❌"; exit 1; fi diff --git a/Cargo.lock b/Cargo.lock index 292a0236cc..f15da9dce1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-std 0.4.0", ] @@ -258,7 +258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20c7021f180a0cbea0380eba97c2af3c57074cdaffe0eef7e840e1c9f2841e55" dependencies = [ "ark-bls12-377", - "ark-ec", + "ark-ec 0.4.2", "ark-models-ext", "ark-std 0.4.0", ] @@ -269,20 +269,32 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", ] +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-bls12-381-ext" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1dc4b3d08f19e8ec06e949712f95b8361e43f1391d94f65e4234df03480631c" dependencies = [ - "ark-bls12-381", - "ark-ec", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-models-ext", "ark-serialize 0.4.2", @@ -296,7 +308,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" dependencies = [ "ark-bls12-377", - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-std 0.4.0", ] @@ -308,7 +320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccee5fba47266f460067588ee1bf070a9c760bf2050c1c509982c5719aadb4f2" dependencies = [ "ark-bw6-761", - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-models-ext", "ark-std 0.4.0", @@ -320,7 +332,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-r1cs-std", "ark-relations", @@ -341,7 +353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ "ark-ff 0.4.2", - "ark-poly", + "ark-poly 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", "derivative", @@ -352,6 +364,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash 0.8.12", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + [[package]] name = "ark-ed-on-bls12-377" version = "0.4.0" @@ -359,7 +392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" dependencies = [ "ark-bls12-377", - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-std 0.4.0", ] @@ -370,7 +403,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524a4fb7540df2e1a8c2e67a83ba1d1e6c3947f4f9342cc2359fc2e789ad731d" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ed-on-bls12-377", "ark-ff 0.4.2", "ark-models-ext", @@ -383,20 +416,32 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" dependencies = [ - "ark-bls12-381", - "ark-ec", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-std 0.4.0", ] +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-ed-on-bls12-381-bandersnatch-ext" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15185f1acb49a07ff8cbe5f11a1adc5a93b19e211e325d826ae98e98e124346" dependencies = [ - "ark-ec", - "ark-ed-on-bls12-381-bandersnatch", + "ark-ec 0.4.2", + "ark-ed-on-bls12-381-bandersnatch 0.4.0", "ark-ff 0.4.2", "ark-models-ext", "ark-std 0.4.0", @@ -440,6 +485,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec 0.7.6", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + [[package]] name = "ark-ff-asm" version = "0.3.0" @@ -460,6 +525,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-ff-macros" version = "0.3.0" @@ -485,13 +560,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-models-ext" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9eab5d4b5ff2f228b763d38442adc9b084b0a465409b059fac5c2308835ec2" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", @@ -511,13 +599,28 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash 0.8.12", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.4", +] + [[package]] name = "ark-r1cs-std" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de1d1472e5cb020cb3405ce2567c91c8d43f21b674aef37b0202f5c3304761db" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-relations", "ark-std 0.4.0", @@ -546,7 +649,7 @@ version = "0.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51bd73bb6ddb72630987d37fa963e99196896c0d0ea81b7c894567e74a2f83af" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", @@ -560,7 +663,7 @@ version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", @@ -584,12 +687,25 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive", + "ark-serialize-derive 0.4.2", "ark-std 0.4.0", "digest 0.10.7", "num-bigint", ] +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec 0.7.6", + "digest 0.10.7", + "num-bigint", +] + [[package]] name = "ark-serialize-derive" version = "0.4.2" @@ -601,6 +717,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "ark-snark" version = "0.4.0" @@ -634,6 +761,49 @@ dependencies = [ "rayon", ] +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", +] + [[package]] name = "array-bytes" version = "6.2.3" @@ -663,12 +833,12 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive 0.4.0", - "asn1-rs-impl 0.1.0", + "asn1-rs-derive 0.5.1", + "asn1-rs-impl", "displaydoc", "nom", "num-traits", @@ -684,7 +854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" dependencies = [ "asn1-rs-derive 0.6.0", - "asn1-rs-impl 0.2.0", + "asn1-rs-impl", "displaydoc", "nom", "num-traits", @@ -695,14 +865,14 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", - "synstructure 0.12.6", + "syn 2.0.104", + "synstructure 0.13.2", ] [[package]] @@ -717,17 +887,6 @@ dependencies = [ "synstructure 0.13.2", ] -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "asn1-rs-impl" version = "0.2.0" @@ -784,9 +943,9 @@ dependencies = [ [[package]] name = "async-fs" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +checksum = "09f7e37c0ed80b2a977691c47dae8625cfb21e205827106c64f7c588766b2e50" dependencies = [ "async-lock", "blocking", @@ -795,9 +954,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3" +checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" dependencies = [ "async-lock", "cfg-if", @@ -808,17 +967,16 @@ dependencies = [ "polling", "rustix 1.0.8", "slab", - "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "async-lock" -version = "3.4.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "event-listener-strategy", "pin-project-lite", ] @@ -836,9 +994,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde3f4e40e6021d7acffc90095cbd6dc54cb593903d1de5832f435eb274b85dc" +checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" dependencies = [ "async-channel 2.5.0", "async-io", @@ -847,17 +1005,16 @@ dependencies = [ "async-task", "blocking", "cfg-if", - "event-listener 5.4.0", + "event-listener 5.4.1", "futures-lite", "rustix 1.0.8", - "tracing", ] [[package]] name = "async-signal" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7605a4e50d4b06df3898d5a70bf5fde51ed9059b0434b73105193bc27acce0d" +checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1" dependencies = [ "async-io", "async-lock", @@ -868,7 +1025,7 @@ dependencies = [ "rustix 1.0.8", "signal-hook-registry", "slab", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -901,6 +1058,19 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "atoi" version = "2.0.0" @@ -983,12 +1153,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -1007,19 +1171,10 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "binary-merkle-tree" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "hash-db", "log", @@ -1079,7 +1234,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.13.0", "serde", "unicode-normalization", ] @@ -1105,6 +1260,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -1112,7 +1273,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ "bitcoin-internals", - "hex-conservative", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", ] [[package]] @@ -1373,9 +1544,9 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.2.29" +version = "1.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "c3a42d84bb6b69d3a8b3eaacf0d88f179e1929695e1ad012b6cf64d9caaa5fd2" dependencies = [ "jobserver", "libc", @@ -1531,9 +1702,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.41" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" +checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" dependencies = [ "clap_builder", "clap_derive", @@ -1541,14 +1712,14 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.41" +version = "4.5.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" +checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", "terminal_size", ] @@ -1717,12 +1888,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" -[[package]] -name = "constcat" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" - [[package]] name = "convert_case" version = "0.4.0" @@ -1979,7 +2144,7 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "typenum 1.18.0", + "typenum", ] [[package]] @@ -2002,6 +2167,21 @@ dependencies = [ "subtle 2.6.1", ] +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher 0.4.4", + "generic-array 0.14.7", + "poly1305", + "salsa20", + "subtle 2.6.1", + "zeroize", +] + [[package]] name = "ctr" version = "0.9.2" @@ -2013,8 +2193,8 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" -version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2023,20 +2203,18 @@ dependencies = [ "cumulus-test-relay-sproof-builder", "parity-scale-codec", "sc-client-api", - "sp-api", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-inherents", "sp-runtime", "sp-state-machine", "sp-storage 22.0.0", - "sp-trie", "tracing", ] [[package]] name = "cumulus-primitives-core" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.18.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2051,8 +2229,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.18.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2065,18 +2243,18 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.12.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "sp-externalities 0.30.0", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-trie", ] [[package]] name = "cumulus-primitives-storage-weight-reclaim" -version = "9.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-proof-size-hostfunction", @@ -2092,13 +2270,13 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.22.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "cumulus-primitives-core", "futures", - "jsonrpsee-core 0.24.9", + "jsonrpsee-core", "parity-scale-codec", "polkadot-overseer", "sc-client-api", @@ -2111,8 +2289,8 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2151,9 +2329,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.160" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1149bab7a5580cb267215751389597c021bfad13c0bb00c54e19559333764c" +checksum = "a3523cc02ad831111491dd64b27ad999f1ae189986728e477604e61b81f828df" dependencies = [ "cc", "cxxbridge-cmd", @@ -2165,9 +2343,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.160" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeeaf1aefae8e0f5141920a7ecbc64a22ab038d4b4ac59f2d19e0effafd5b53" +checksum = "212b754247a6f07b10fa626628c157593f0abf640a3dd04cce2760eca970f909" dependencies = [ "cc", "codespan-reporting", @@ -2180,9 +2358,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.160" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36ac1f9a72064b1f41fd7b49a4c1b3bf33b9ccb1274874dda6d264f57c55964" +checksum = "f426a20413ec2e742520ba6837c9324b55ffac24ead47491a6e29f933c5b135a" dependencies = [ "clap", "codespan-reporting", @@ -2194,15 +2372,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.160" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170c6ff5d009663866857a91ebee55b98ea4d4b34e7d7aba6dc4a4c95cc7b748" +checksum = "a258b6069020b4e5da6415df94a50ee4f586a6c38b037a180e940a43d06a070d" [[package]] name = "cxxbridge-macro" -version = "1.0.160" +version = "1.0.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4984a142211026786011a7e79fa22faa1eca1e9cbf0e60bffecfd57fd3db88f1" +checksum = "e8dec184b52be5008d6eaf7e62fc1802caf1ad1227d11b3b7df2c409c7ffc3f4" dependencies = [ "indexmap 2.10.0", "proc-macro2", @@ -2211,38 +2389,14 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - [[package]] name = "darling" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -2255,28 +2409,17 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.104", ] -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - [[package]] name = "darling_macro" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.20.11", + "darling_core", "quote", "syn 2.0.104", ] @@ -2332,11 +2475,11 @@ dependencies = [ [[package]] name = "der-parser" -version = "8.2.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs 0.6.2", "displaydoc", "nom", "num-bigint", @@ -2441,6 +2584,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.104", + "unicode-xid", ] [[package]] @@ -2455,12 +2599,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - [[package]] name = "digest" version = "0.8.1" @@ -2510,6 +2648,15 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -2618,9 +2765,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "ecdsa" @@ -2678,8 +2825,20 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.15.0" +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "either" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ @@ -2714,23 +2873,31 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enum-as-inner" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] -name = "enum-as-inner" -version = "0.6.1" +name = "enum-ordinalize" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ - "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.104", @@ -2756,17 +2923,6 @@ dependencies = [ "syn 2.0.104", ] -[[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.104", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -2833,7 +2989,7 @@ dependencies = [ [[package]] name = "ethereum" version = "0.15.0" -source = "git+https://github.com/rust-ethereum/ethereum?rev=3be0d8fd4c2ad1ba216b69ef65b9382612efc8ba#3be0d8fd4c2ad1ba216b69ef65b9382612efc8ba" +source = "git+https://github.com/rust-ethereum/ethereum?rev=bbb544622208ef6e9890a2dbc224248f6dd13318#bbb544622208ef6e9890a2dbc224248f6dd13318" dependencies = [ "bytes", "ethereum-types 0.15.1", @@ -2885,19 +3041,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ "concurrent-queue", "parking", @@ -2910,14 +3056,14 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "pin-project-lite", ] [[package]] name = "evm" version = "0.42.0" -source = "git+https://github.com/rust-ethereum/evm?rev=e81732d6bb47e3d3d68d233e43919c4522598361#e81732d6bb47e3d3d68d233e43919c4522598361" +source = "git+https://github.com/rust-ethereum/evm?rev=6ca5a72bc8942f4860137155dd9033526fd362a5#6ca5a72bc8942f4860137155dd9033526fd362a5" dependencies = [ "auto_impl", "environmental", @@ -2937,7 +3083,7 @@ dependencies = [ [[package]] name = "evm-core" version = "0.42.0" -source = "git+https://github.com/rust-ethereum/evm?rev=e81732d6bb47e3d3d68d233e43919c4522598361#e81732d6bb47e3d3d68d233e43919c4522598361" +source = "git+https://github.com/rust-ethereum/evm?rev=6ca5a72bc8942f4860137155dd9033526fd362a5#6ca5a72bc8942f4860137155dd9033526fd362a5" dependencies = [ "parity-scale-codec", "primitive-types 0.13.1", @@ -2948,7 +3094,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.42.0" -source = "git+https://github.com/rust-ethereum/evm?rev=e81732d6bb47e3d3d68d233e43919c4522598361#e81732d6bb47e3d3d68d233e43919c4522598361" +source = "git+https://github.com/rust-ethereum/evm?rev=6ca5a72bc8942f4860137155dd9033526fd362a5#6ca5a72bc8942f4860137155dd9033526fd362a5" dependencies = [ "environmental", "evm-core", @@ -2959,7 +3105,7 @@ dependencies = [ [[package]] name = "evm-runtime" version = "0.42.0" -source = "git+https://github.com/rust-ethereum/evm?rev=e81732d6bb47e3d3d68d233e43919c4522598361#e81732d6bb47e3d3d68d233e43919c4522598361" +source = "git+https://github.com/rust-ethereum/evm?rev=6ca5a72bc8942f4860137155dd9033526fd362a5#6ca5a72bc8942f4860137155dd9033526fd362a5" dependencies = [ "auto_impl", "environmental", @@ -3059,7 +3205,7 @@ dependencies = [ [[package]] name = "fc-api" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "async-trait", "fp-storage", @@ -3071,7 +3217,7 @@ dependencies = [ [[package]] name = "fc-aura" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fc-rpc", "fp-storage", @@ -3087,7 +3233,7 @@ dependencies = [ [[package]] name = "fc-babe" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fc-rpc", "sc-client-api", @@ -3103,7 +3249,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "async-trait", "fp-consensus", @@ -3119,7 +3265,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "async-trait", "ethereum", @@ -3149,7 +3295,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fc-db", "fc-storage", @@ -3172,7 +3318,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", @@ -3186,13 +3332,13 @@ dependencies = [ "fp-storage", "futures", "hex", - "jsonrpsee 0.24.9", + "jsonrpsee", "libsecp256k1", "log", "pallet-evm", "parity-scale-codec", "prometheus", - "rand 0.9.1", + "rand 0.9.2", "rlp 0.6.1", "sc-client-api", "sc-network", @@ -3223,22 +3369,22 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", - "jsonrpsee 0.24.9", + "jsonrpsee", "rlp 0.6.1", "rustc-hex", "serde", "serde_json", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", ] [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", @@ -3326,16 +3472,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "finito" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2384245d85162258a14b43567a9ee3598f5ae746a1581fb5d3d2cb780f0dbf95" -dependencies = [ - "futures-timer", - "pin-project", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -3360,15 +3496,6 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" -[[package]] -name = "float-cmp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] - [[package]] name = "flume" version = "0.11.1" @@ -3410,7 +3537,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", ] @@ -3437,7 +3564,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "hex", "impl-serde 0.5.0", @@ -3449,14 +3576,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "staging-xcm", ] [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "parity-scale-codec", @@ -3467,7 +3594,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", @@ -3479,7 +3606,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "environmental", "evm", @@ -3495,7 +3622,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", @@ -3511,7 +3638,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "frame-support", "parity-scale-codec", @@ -3523,7 +3650,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "parity-scale-codec", "serde", @@ -3537,8 +3664,8 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-support-procedural", @@ -3554,15 +3681,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-storage 22.0.0", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" -version = "46.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "47.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "Inflector", "array-bytes", @@ -3576,7 +3703,6 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "hex", "itertools 0.11.0", "linked-hash-map", "log", @@ -3591,7 +3717,7 @@ dependencies = [ "sc-client-api", "sc-client-db", "sc-executor", - "sc-executor-common", + "sc-runtime-utilities", "sc-service", "sc-sysinfo", "serde", @@ -3600,7 +3726,6 @@ dependencies = [ "sp-block-builder", "sp-blockchain", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", "sp-database", "sp-externalities 0.30.0", "sp-genesis-builder", @@ -3621,10 +3746,24 @@ dependencies = [ "thousands", ] +[[package]] +name = "frame-decode" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6027a409bac4fe95b4d107f965fcdbc252fc89d884a360d076b3070b6128c094" +dependencies = [ + "frame-metadata 17.0.0", + "parity-scale-codec", + "scale-decode 0.14.0", + "scale-info", + "scale-type-resolver", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "frame-election-provider-solution-type" -version = "14.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "16.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3634,8 +3773,8 @@ dependencies = [ [[package]] name = "frame-election-provider-support" -version = "39.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3650,8 +3789,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "aquamarine", "frame-support", @@ -3663,25 +3802,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-tracing 17.0.1", -] - -[[package]] -name = "frame-metadata" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" -dependencies = [ - "cfg-if", - "parity-scale-codec", - "scale-info", + "sp-tracing 17.1.0", ] [[package]] name = "frame-metadata" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +checksum = "701bac17e9b55e0f95067c428ebcb46496587f08e8cf4ccc0fe5903bea10dbb8" dependencies = [ "cfg-if", "parity-scale-codec", @@ -3691,9 +3819,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "18.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daaf440c68eb2c3d88e5760fe8c7af3f9fee9181fab6c2f2c4e7cc48dcc40bb8" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" dependencies = [ "cfg-if", "parity-scale-codec", @@ -3703,8 +3831,8 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" -version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.8.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "const-hex", @@ -3719,8 +3847,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "aquamarine", "array-bytes", @@ -3728,7 +3856,7 @@ dependencies = [ "bitflags 1.3.2", "docify", "environmental", - "frame-metadata 18.0.0", + "frame-metadata 20.0.0", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -3739,12 +3867,11 @@ dependencies = [ "scale-info", "serde", "serde_json", - "smallvec", "sp-api", "sp-arithmetic", "sp-core", "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-genesis-builder", "sp-inherents", "sp-io", @@ -3752,18 +3879,17 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "sp-tracing 17.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-tracing 17.1.0", "sp-trie", "sp-weights", - "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "31.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "33.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "Inflector", "cfg-expr", @@ -3773,10 +3899,10 @@ dependencies = [ "frame-support-procedural-tools 13.0.1", "itertools 0.11.0", "macro_magic", - "proc-macro-warning 1.84.1", + "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "syn 2.0.104", ] @@ -3796,7 +3922,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support-procedural-tools-derive 12.0.0", "proc-macro-crate 3.3.0", @@ -3819,7 +3945,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro2", "quote", @@ -3828,8 +3954,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "cfg-if", "docify", @@ -3841,15 +3967,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", "sp-version", "sp-weights", ] [[package]] name = "frame-system-benchmarking" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3862,8 +3987,8 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "parity-scale-codec", @@ -3872,8 +3997,8 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.46.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "parity-scale-codec", @@ -3923,9 +4048,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.1.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" dependencies = [ "futures-timer", "futures-util", @@ -3978,9 +4103,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" dependencies = [ "fastrand", "futures-core", @@ -4002,12 +4127,13 @@ dependencies = [ [[package]] name = "futures-rustls" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.21.12", + "rustls", + "rustls-pki-types", ] [[package]] @@ -4075,7 +4201,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.18.0", + "typenum", ] [[package]] @@ -4084,7 +4210,7 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.18.0", + "typenum", "version_check", "zeroize", ] @@ -4106,8 +4232,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -4117,9 +4245,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -4155,20 +4285,14 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator 0.3.0", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "glob" version = "0.3.2" @@ -4376,12 +4500,46 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec 0.7.6", +] + [[package]] name = "hex-literal" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hickory-proto" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.8.5", + "socket2 0.5.10", + "thiserror 1.0.69", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-proto" version = "0.25.2" @@ -4391,14 +4549,14 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner 0.6.1", + "enum-as-inner", "futures-channel", "futures-io", "futures-util", - "idna 1.0.3", + "idna", "ipnet", "once_cell", - "rand 0.9.1", + "rand 0.9.2", "ring 0.17.14", "thiserror 2.0.12", "tinyvec", @@ -4407,6 +4565,27 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-resolver" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.24.4", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.4", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror 1.0.69", + "tokio", + "tracing", +] + [[package]] name = "hickory-resolver" version = "0.25.2" @@ -4415,12 +4594,12 @@ checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.25.2", "ipconfig", "moka", "once_cell", "parking_lot 0.12.4", - "rand 0.9.1", + "rand 0.9.2", "resolv-conf", "smallvec", "thiserror 2.0.12", @@ -4586,22 +4765,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.32", - "log", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.7" @@ -4612,19 +4775,19 @@ dependencies = [ "hyper 1.6.0", "hyper-util", "log", - "rustls 0.23.29", - "rustls-native-certs 0.8.1", + "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls", "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" dependencies = [ "bytes", "futures-channel", @@ -4635,7 +4798,7 @@ dependencies = [ "hyper 1.6.0", "libc", "pin-project-lite", - "socket2 0.5.10", + "socket2 0.6.0", "tokio", "tower-service", "tracing", @@ -4757,27 +4920,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -4965,6 +5107,7 @@ checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.4", + "serde", ] [[package]] @@ -5013,9 +5156,9 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" dependencies = [ "bitflags 2.9.1", "cfg-if", @@ -5090,6 +5233,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -5107,16 +5259,18 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jni" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror 1.0.69", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -5145,82 +5299,40 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" -dependencies = [ - "jsonrpsee-client-transport 0.22.5", - "jsonrpsee-core 0.22.5", - "jsonrpsee-http-client", - "jsonrpsee-types 0.22.5", -] - -[[package]] -name = "jsonrpsee" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" -dependencies = [ - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "jsonrpsee-ws-client", -] - [[package]] name = "jsonrpsee" version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b26c20e2178756451cfeb0661fb74c47dd5988cb7e3939de7e9241fd604d42" dependencies = [ - "jsonrpsee-core 0.24.9", + "jsonrpsee-client-transport", + "jsonrpsee-core", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types 0.24.9", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" -dependencies = [ - "futures-util", - "http 0.2.12", - "jsonrpsee-core 0.22.5", - "pin-project", - "rustls-native-certs 0.7.3", - "rustls-pki-types", - "soketto 0.7.1", - "thiserror 1.0.69", + "jsonrpsee-types", + "jsonrpsee-ws-client", "tokio", - "tokio-rustls 0.25.0", - "tokio-util", "tracing", - "url", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.23.2" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" +checksum = "bacb85abf4117092455e1573625e21b8f8ef4dec8aff13361140b2dc266cdff2" dependencies = [ "base64 0.22.1", "futures-util", "http 1.3.1", - "jsonrpsee-core 0.23.2", + "jsonrpsee-core", "pin-project", - "rustls 0.23.29", + "rustls", "rustls-pki-types", "rustls-platform-verifier", - "soketto 0.8.1", + "soketto", "thiserror 1.0.69", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls", "tokio-util", "tracing", "url", @@ -5228,19 +5340,22 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.22.5" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" +checksum = "456196007ca3a14db478346f58c7238028d55ee15c1df15115596e411ff27925" dependencies = [ - "anyhow", "async-trait", - "beef", + "bytes", "futures-timer", "futures-util", - "hyper 0.14.32", - "jsonrpsee-types 0.22.5", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "jsonrpsee-types", + "parking_lot 0.12.4", "pin-project", - "rustc-hash 1.1.0", + "rand 0.8.5", + "rustc-hash 2.1.1", "serde", "serde_json", "thiserror 1.0.69", @@ -5250,75 +5365,10 @@ dependencies = [ ] [[package]] -name = "jsonrpsee-core" -version = "0.23.2" +name = "jsonrpsee-proc-macros" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" -dependencies = [ - "anyhow", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "jsonrpsee-types 0.23.2", - "pin-project", - "rustc-hash 1.1.0", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.24.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456196007ca3a14db478346f58c7238028d55ee15c1df15115596e411ff27925" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "jsonrpsee-types 0.24.9", - "parking_lot 0.12.4", - "rand 0.8.5", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" -dependencies = [ - "async-trait", - "hyper 0.14.32", - "hyper-rustls 0.24.2", - "jsonrpsee-core 0.22.5", - "jsonrpsee-types 0.22.5", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-proc-macros" -version = "0.24.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e65763c942dfc9358146571911b0cd1c361c2d63e2d2305622d40d36376ca80" +checksum = "5e65763c942dfc9358146571911b0cd1c361c2d63e2d2305622d40d36376ca80" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.3.0", @@ -5339,13 +5389,13 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-util", - "jsonrpsee-core 0.24.9", - "jsonrpsee-types 0.24.9", + "jsonrpsee-core", + "jsonrpsee-types", "pin-project", "route-recognizer", "serde", "serde_json", - "soketto 0.8.1", + "soketto", "thiserror 1.0.69", "tokio", "tokio-stream", @@ -5354,32 +5404,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jsonrpsee-types" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" -dependencies = [ - "beef", - "http 1.3.1", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "jsonrpsee-types" version = "0.24.9" @@ -5394,14 +5418,14 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.23.2" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" +checksum = "01b3323d890aa384f12148e8d2a1fd18eb66e9e7e825f9de4fa53bcc19b93eef" dependencies = [ "http 1.3.1", - "jsonrpsee-client-transport 0.23.2", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", "url", ] @@ -5440,11 +5464,11 @@ dependencies = [ [[package]] name = "keccak-hash" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b286e6b663fb926e1eeb68528e69cb70ed46c6d65871a21b2215ae8154c6d3c" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" dependencies = [ - "primitive-types 0.12.2", + "primitive-types 0.13.1", "tiny-keccak", ] @@ -5492,6 +5516,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "lazycell" @@ -5512,7 +5539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.2", + "windows-targets 0.53.3", ] [[package]] @@ -5523,16 +5550,15 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libp2p" -version = "0.52.4" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom 0.2.16", - "instant", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", @@ -5549,7 +5575,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-upnp", - "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr 0.18.2", @@ -5560,9 +5585,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" dependencies = [ "libp2p-core", "libp2p-identity", @@ -5572,9 +5597,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.2.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ "libp2p-core", "libp2p-identity", @@ -5584,17 +5609,15 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-identity", - "log", "multiaddr 0.18.2", "multihash 0.19.3", "multistream-select", @@ -5606,33 +5629,35 @@ dependencies = [ "rw-stream-sink", "smallvec", "thiserror 1.0.69", - "unsigned-varint 0.7.2", + "tracing", + "unsigned-varint 0.8.0", "void", + "web-time", ] [[package]] name = "libp2p-dns" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" +checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", + "hickory-resolver 0.24.4", "libp2p-core", "libp2p-identity", - "log", "parking_lot 0.12.4", "smallvec", - "trust-dns-resolver", + "tracing", ] [[package]] name = "libp2p-identify" -version = "0.43.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", @@ -5640,12 +5665,12 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "lru 0.12.5", "quick-protobuf", "quick-protobuf-codec", "smallvec", "thiserror 1.0.69", + "tracing", "void", ] @@ -5669,83 +5694,84 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.44.6" +version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" +checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" dependencies = [ "arrayvec 0.7.6", - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "either", "fnv", "futures", + "futures-bounded", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "quick-protobuf", "quick-protobuf-codec", "rand 0.8.5", "sha2 0.10.9", "smallvec", "thiserror 1.0.69", + "tracing", "uint 0.9.5", - "unsigned-varint 0.7.2", "void", + "web-time", ] [[package]] name = "libp2p-mdns" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" +checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", + "hickory-proto 0.24.4", "if-watch", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", "socket2 0.5.10", "tokio", - "trust-dns-proto 0.22.0", + "tracing", "void", ] [[package]] name = "libp2p-metrics" -version = "0.13.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ - "instant", + "futures", "libp2p-core", "libp2p-identify", "libp2p-identity", "libp2p-kad", "libp2p-ping", "libp2p-swarm", - "once_cell", + "pin-project", "prometheus-client", + "web-time", ] [[package]] name = "libp2p-noise" -version = "0.43.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" +checksum = "36b137cb1ae86ee39f8e5d6245a296518912014eaa87427d24e6ff58cfc1b28c" dependencies = [ + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", "libp2p-core", "libp2p-identity", - "log", "multiaddr 0.18.2", "multihash 0.19.3", "once_cell", @@ -5755,33 +5781,34 @@ dependencies = [ "snow", "static_assertions", "thiserror 1.0.69", + "tracing", "x25519-dalek", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.43.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" +checksum = "005a34420359223b974ee344457095f027e51346e992d1e0dcd35173f4cdd422" dependencies = [ "either", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-quic" -version = "0.9.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" dependencies = [ "bytes", "futures", @@ -5790,66 +5817,68 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "log", "parking_lot 0.12.4", "quinn", "rand 0.8.5", - "ring 0.16.20", - "rustls 0.21.12", + "ring 0.17.14", + "rustls", "socket2 0.5.10", "thiserror 1.0.69", "tokio", + "tracing", ] [[package]] name = "libp2p-request-response" -version = "0.25.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" +checksum = "1356c9e376a94a75ae830c42cdaea3d4fe1290ba409a22c809033d1b7dcab0a6" dependencies = [ "async-trait", "futures", - "instant", + "futures-bounded", + "futures-timer", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm" -version = "0.43.7" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "log", + "lru 0.12.5", "multistream-select", "once_cell", "rand 0.8.5", "smallvec", "tokio", + "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" +checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" dependencies = [ - "heck 0.4.1", - "proc-macro-warning 0.4.2", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.104", @@ -5857,9 +5886,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.40.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" +checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" dependencies = [ "futures", "futures-timer", @@ -5867,103 +5896,91 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "log", "socket2 0.5.10", "tokio", + "tracing", ] [[package]] name = "libp2p-tls" -version = "0.2.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" +checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" dependencies = [ "futures", "futures-rustls", "libp2p-core", "libp2p-identity", "rcgen", - "ring 0.16.20", - "rustls 0.21.12", + "ring 0.17.14", + "rustls", "rustls-webpki 0.101.7", "thiserror 1.0.69", - "x509-parser 0.15.1", + "x509-parser 0.16.0", "yasna", ] [[package]] name = "libp2p-upnp" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", "igd-next", "libp2p-core", "libp2p-swarm", - "log", "tokio", + "tracing", "void", ] -[[package]] -name = "libp2p-wasm-ext" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5d8e3a9e07da0ef5b55a9f26c009c8fb3c725d492d8bb4b431715786eea79c" -dependencies = [ - "futures", - "js-sys", - "libp2p-core", - "send_wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "libp2p-websocket" -version = "0.42.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538" +checksum = "888b2ff2e5d8dcef97283daab35ad1043d18952b65e05279eecbe02af4c6e347" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", "libp2p-identity", - "log", "parking_lot 0.12.4", "pin-project-lite", "rw-stream-sink", - "soketto 0.8.1", + "soketto", "thiserror 1.0.69", + "tracing", "url", - "webpki-roots 0.25.4", + "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.44.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" +checksum = "788b61c80789dba9760d8c669a5bedb642c8267555c803fabd8396e4ca5c5882" dependencies = [ + "either", "futures", "libp2p-core", - "log", "thiserror 1.0.69", + "tracing", "yamux 0.12.1", + "yamux 0.13.6", ] [[package]] name = "libredox" -version = "0.1.4" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638" +checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" dependencies = [ "bitflags 2.9.1", "libc", - "redox_syscall 0.5.13", + "redox_syscall 0.5.17", ] [[package]] @@ -5997,7 +6014,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum 1.18.0", + "typenum", ] [[package]] @@ -6133,10 +6150,10 @@ dependencies = [ "ed25519-dalek", "futures", "futures-timer", - "hickory-resolver", + "hickory-resolver 0.25.2", "indexmap 2.10.0", "libc", - "mockall 0.13.1", + "mockall", "multiaddr 0.17.1", "multihash 0.17.0", "network-interface", @@ -6162,7 +6179,7 @@ dependencies = [ "url", "x25519-dalek", "x509-parser 0.17.0", - "yamux 0.13.5", + "yamux 0.13.6", "yasna", "zeroize", ] @@ -6223,6 +6240,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "lz4" version = "1.28.1" @@ -6308,12 +6331,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matrixmultiply" version = "0.3.10" @@ -6377,15 +6394,15 @@ dependencies = [ [[package]] name = "merkleized-metadata" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c592efaf1b3250df14c8f3c2d952233f0302bb81d3586db2f303666c1cd607" +checksum = "dc9b7ac0ce054412d9a85ff39bac27aec27483b06cef8756b57d9c29d448d081" dependencies = [ "array-bytes", "blake3", - "frame-metadata 18.0.0", + "frame-metadata 20.0.0", "parity-scale-codec", - "scale-decode", + "scale-decode 0.13.1", "scale-info", ] @@ -6452,36 +6469,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "mmr-rpc" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "jsonrpsee 0.24.9", - "parity-scale-codec", - "serde", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-mmr-primitives", - "sp-runtime", -] - -[[package]] -name = "mockall" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "lazy_static", - "mockall_derive 0.11.4", - "predicates 2.1.5", - "predicates-tree", -] - [[package]] name = "mockall" version = "0.13.1" @@ -6491,23 +6478,11 @@ dependencies = [ "cfg-if", "downcast", "fragile", - "mockall_derive 0.13.1", - "predicates 3.1.3", + "mockall_derive", + "predicates", "predicates-tree", ] -[[package]] -name = "mockall_derive" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "mockall_derive" version = "0.13.1" @@ -6539,6 +6514,12 @@ dependencies = [ "uuid", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "multiaddr" version = "0.17.1" @@ -6661,7 +6642,7 @@ dependencies = [ "num-rational", "num-traits", "simba", - "typenum 1.18.0", + "typenum", ] [[package]] @@ -6775,13 +6756,13 @@ dependencies = [ [[package]] name = "network-interface" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3329f515506e4a2de3aa6e07027a6758e22e0f0e8eaf64fa47261cec2282602" +checksum = "862f41f1276e7148fb597fc55ed8666423bebe045199a1298c3515a73ec5cdd9" dependencies = [ "cc", "libc", - "thiserror 1.0.69", + "thiserror 2.0.12", "winapi", ] @@ -6802,12 +6783,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" -[[package]] -name = "no-std-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" - [[package]] name = "node-subtensor" version = "4.0.0-dev" @@ -6833,21 +6808,18 @@ dependencies = [ "frame-system-rpc-runtime-api", "futures", "hex", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "memmap2 0.9.7", "node-subtensor-runtime", "num-traits", "pallet-commitments", "pallet-drand", - "pallet-staking", "pallet-subtensor-swap-rpc", "pallet-subtensor-swap-runtime-api", "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", @@ -6857,7 +6829,6 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-babe", "sc-consensus-babe-rpc", - "sc-consensus-epochs", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-consensus-manual-seal", @@ -6876,8 +6847,6 @@ dependencies = [ "serde", "serde_json", "sp-api", - "sp-application-crypto", - "sp-authority-discovery", "sp-block-builder", "sp-blockchain", "sp-consensus", @@ -6894,17 +6863,14 @@ 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", "subtensor-custom-rpc", "subtensor-custom-rpc-runtime-api", "subtensor-runtime-common", - "thiserror 1.0.69", ] [[package]] @@ -6912,7 +6878,6 @@ name = "node-subtensor-runtime" version = "4.0.0-dev" dependencies = [ "ark-serialize 0.4.2", - "array-bytes", "fp-account", "fp-evm", "fp-rpc", @@ -6920,7 +6885,7 @@ dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-executive", - "frame-metadata 18.0.0", + "frame-metadata 20.0.0", "frame-metadata-hash-extension", "frame-support", "frame-system", @@ -6977,8 +6942,6 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility 38.0.0", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-runtime-common", "precompile-utils", "rand_chacha 0.3.1", "scale-info", @@ -7001,9 +6964,9 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-storage 22.0.0", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "sp-transaction-pool", "sp-version", "substrate-fixed", @@ -7051,12 +7014,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -7107,15 +7064,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "num-format" -version = "0.4.4" +name = "num-derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "arrayvec 0.7.6", - "itoa", -] - + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.6", + "itoa", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -7201,15 +7169,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - [[package]] name = "object" version = "0.36.7" @@ -7221,11 +7180,11 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs 0.6.2", ] [[package]] @@ -7378,8 +7337,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "sp-tracing 17.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-tracing 17.1.0", "sp-weights", "substrate-fixed", "subtensor-macros", @@ -7387,42 +7346,10 @@ dependencies = [ "subtensor-swap-interface", ] -[[package]] -name = "pallet-asset-conversion" -version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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 = "18.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", -] - [[package]] name = "pallet-aura" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -7437,8 +7364,8 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -7452,8 +7379,8 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -7465,8 +7392,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -7488,8 +7415,8 @@ dependencies = [ [[package]] name = "pallet-bags-list" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "aquamarine", "docify", @@ -7504,13 +7431,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", ] [[package]] name = "pallet-balances" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "41.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -7519,13 +7446,14 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "sp-core", "sp-runtime", ] [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fp-evm", "frame-support", @@ -7536,24 +7464,6 @@ dependencies = [ "sp-runtime", ] -[[package]] -name = "pallet-broker" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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" @@ -7567,7 +7477,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "subtensor-macros", ] @@ -7592,7 +7502,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "subtensor-macros", "subtensor-runtime-common", "tle", @@ -7614,7 +7524,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "subtensor-macros", ] @@ -7623,9 +7533,9 @@ name = "pallet-drand" version = "0.0.1" dependencies = [ "anyhow", - "ark-bls12-381", + "ark-bls12-381 0.4.0", "ark-crypto-primitives", - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-scale 0.0.11", "ark-serialize 0.4.2", @@ -7653,8 +7563,8 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "38.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7675,8 +7585,8 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7689,7 +7599,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "ethereum", "ethereum-types 0.15.1", @@ -7712,7 +7622,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "cumulus-primitives-storage-weight-reclaim", "environmental", @@ -7736,7 +7646,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "frame-support", "frame-system", @@ -7744,10 +7654,20 @@ dependencies = [ "scale-info", ] +[[package]] +name = "pallet-evm-precompile-bn128" +version = "2.0.0-dev" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" +dependencies = [ + "fp-evm", + "sp-core", + "substrate-bn", +] + [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fp-evm", "frame-support", @@ -7759,7 +7679,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fp-evm", "num", @@ -7768,7 +7688,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fp-evm", "tiny-keccak", @@ -7777,7 +7697,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "fp-evm", "ripemd", @@ -7786,8 +7706,8 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -7804,8 +7724,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -7827,7 +7747,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "frame-benchmarking", "frame-support", @@ -7839,74 +7759,21 @@ dependencies = [ "sp-runtime", ] -[[package]] -name = "pallet-identity" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-io", - "sp-runtime", -] - [[package]] name = "pallet-insecure-randomness-collective-flip" -version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "frame-support", - "frame-system", "parity-scale-codec", + "polkadot-sdk-frame", "safe-mix", "scale-info", - "sp-runtime", ] [[package]] name = "pallet-membership" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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 = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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 = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -7916,14 +7783,13 @@ dependencies = [ "scale-info", "sp-core", "sp-io", - "sp-mmr-primitives", "sp-runtime", ] [[package]] name = "pallet-multisig" -version = "39.1.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "parity-scale-codec", @@ -7933,8 +7799,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "37.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -7946,13 +7812,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", ] [[package]] name = "pallet-nomination-pools-runtime-api" -version = "35.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -7961,13 +7827,12 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", "log", - "pallet-balances", "parity-scale-codec", "scale-info", "serde", @@ -7977,8 +7842,8 @@ dependencies = [ [[package]] name = "pallet-preimage" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8010,8 +7875,8 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8031,14 +7896,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "subtensor-macros", ] [[package]] name = "pallet-root-testing" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -8051,16 +7916,16 @@ dependencies = [ [[package]] name = "pallet-safe-mode" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", "frame-support", "frame-system", "pallet-balances", - "pallet-proxy 39.1.0", - "pallet-utility 39.1.0", + "pallet-proxy 40.1.0", + "pallet-utility 40.0.0", "parity-scale-codec", "scale-info", "sp-arithmetic", @@ -8069,8 +7934,8 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "40.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "41.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -8086,8 +7951,8 @@ dependencies = [ [[package]] name = "pallet-session" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-support", "frame-system", @@ -8107,8 +7972,8 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8130,7 +7995,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -8140,8 +8005,8 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "sp-arithmetic", @@ -8149,8 +8014,8 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "sp-api", @@ -8162,7 +8027,7 @@ name = "pallet-subtensor" version = "4.0.0-dev" dependencies = [ "approx", - "ark-bls12-381", + "ark-bls12-381 0.4.0", "ark-serialize 0.4.2", "frame-benchmarking", "frame-support", @@ -8200,8 +8065,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "sp-tracing 17.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-tracing 17.1.0", "sp-version", "substrate-fixed", "subtensor-macros", @@ -8230,8 +8095,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "sp-tracing 17.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-tracing 17.1.0", "substrate-fixed", "subtensor-macros", "subtensor-runtime-common", @@ -8242,7 +8107,7 @@ dependencies = [ name = "pallet-subtensor-swap-rpc" version = "1.0.0" dependencies = [ - "jsonrpsee 0.24.9", + "jsonrpsee", "pallet-subtensor-swap-runtime-api", "parity-scale-codec", "sp-api", @@ -8257,13 +8122,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", ] [[package]] name = "pallet-sudo" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -8277,8 +8142,8 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -8296,8 +8161,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8312,10 +8177,10 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "43.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "jsonrpsee 0.24.9", + "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -8328,8 +8193,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8338,25 +8203,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "pallet-treasury" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "docify", - "frame-benchmarking", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-runtime", -] - [[package]] name = "pallet-utility" version = "38.0.0" @@ -8378,8 +8224,8 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8391,27 +8237,13 @@ dependencies = [ "sp-runtime", ] -[[package]] -name = "pallet-vesting" -version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime", -] - [[package]] name = "parity-bip39" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.13.0", "rand 0.8.5", "rand_core 0.6.4", "serde", @@ -8552,7 +8384,7 @@ checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.13", + "redox_syscall 0.5.17", "smallvec", "windows-targets 0.52.6", ] @@ -8587,6 +8419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "hmac 0.12.1", "password-hash", ] @@ -8598,11 +8431,12 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pem" -version = "1.1.1" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", + "serde", ] [[package]] @@ -8734,20 +8568,10 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" -[[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 = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "17.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -8757,13 +8581,12 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bs58", "futures", "futures-timer", - "log", "parity-scale-codec", "polkadot-primitives", "prioritized-metered-channel", @@ -8771,13 +8594,12 @@ dependencies = [ "sc-service", "sc-tracing", "substrate-prometheus-endpoint", - "tracing-gum", ] [[package]] name = "polkadot-node-network-protocol" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -8801,8 +8623,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bitvec", "bounded-vec", @@ -8817,21 +8639,18 @@ dependencies = [ "sp-application-crypto", "sp-consensus-babe", "sp-consensus-slots", - "sp-core", "sp-keystore", "sp-maybe-compressed-blob", - "sp-runtime", "thiserror 1.0.69", "zstd 0.12.4", ] [[package]] name = "polkadot-node-subsystem-types" -version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", - "bitvec", "derive_more 0.99.20", "fatality", "futures", @@ -8856,21 +8675,19 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", "futures-timer", "orchestra", - "parking_lot 0.12.4", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-types", "polkadot-primitives", "sc-client-api", - "sp-api", "sp-core", "tikv-jemalloc-ctl", "tracing-gum", @@ -8878,8 +8695,8 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "16.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bounded-collections", "derive_more 0.99.20", @@ -8894,8 +8711,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bitvec", "hex-literal", @@ -8916,161 +8733,23 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "thiserror 1.0.69", ] [[package]] -name = "polkadot-rpc" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "jsonrpsee 0.24.9", - "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 = "18.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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-keyring", - "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 = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "bs58", - "frame-benchmarking", - "parity-scale-codec", - "polkadot-primitives", - "sp-tracing 17.0.1", -] - -[[package]] -name = "polkadot-runtime-parachains" -version = "18.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +name = "polkadot-sdk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb819108697967452fa6d8d96ab4c0d48cbaa423b3156499dcb24f1cf95d6775" dependencies = [ - "bitflags 1.3.2", - "bitvec", - "derive_more 0.99.20", - "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 0.8.5", - "rand_chacha 0.3.1", - "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-stable2412-6)", - "staging-xcm", - "staging-xcm-executor", - "static_assertions", + "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "polkadot-sdk-frame" -version = "0.8.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.9.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-benchmarking", @@ -9083,6 +8762,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-arithmetic", "sp-block-builder", @@ -9103,44 +8783,44 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "polkadot-primitives", - "sp-core", "tracing-gum", ] [[package]] name = "polkavm" -version = "0.9.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +checksum = "dd044ab1d3b11567ab6b98ca71259a992b4034220d5972988a0e96518e5d343d" dependencies = [ "libc", "log", "polkavm-assembler", - "polkavm-common 0.9.0", + "polkavm-common 0.18.0", "polkavm-linux-raw", ] [[package]] name = "polkavm-assembler" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +checksum = "eaad38dc420bfed79e6f731471c973ce5ff5e47ab403e63cf40358fef8a6368f" dependencies = [ "log", ] [[package]] name = "polkavm-common" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" dependencies = [ "log", + "polkavm-assembler", ] [[package]] @@ -9151,11 +8831,11 @@ checksum = "49a5794b695626ba70d29e66e3f4f4835767452a6723f3a0bc20884b07088fe8" [[package]] name = "polkavm-derive" -version = "0.9.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" dependencies = [ - "polkavm-derive-impl-macro 0.9.0", + "polkavm-derive-impl-macro 0.18.0", ] [[package]] @@ -9169,11 +8849,11 @@ dependencies = [ [[package]] name = "polkavm-derive-impl" -version = "0.9.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" dependencies = [ - "polkavm-common 0.9.0", + "polkavm-common 0.18.0", "proc-macro2", "quote", "syn 2.0.104", @@ -9193,11 +8873,11 @@ dependencies = [ [[package]] name = "polkavm-derive-impl-macro" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" dependencies = [ - "polkavm-derive-impl 0.9.0", + "polkavm-derive-impl 0.18.1", "syn 2.0.104", ] @@ -9213,38 +8893,38 @@ dependencies = [ [[package]] name = "polkavm-linker" -version = "0.9.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +checksum = "e9bfe793b094d9ea5c99b7c43ba46e277b0f8f48f4bbfdbabf8d3ebf701a4bd3" dependencies = [ - "gimli 0.28.1", + "dirs", + "gimli 0.31.1", "hashbrown 0.14.5", "log", - "object 0.32.2", - "polkavm-common 0.9.0", + "object 0.36.7", + "polkavm-common 0.18.0", "regalloc2 0.9.3", "rustc-demangle", ] [[package]] name = "polkavm-linux-raw" -version = "0.9.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" +checksum = "23eff02c070c70f31878a3d915e88a914ecf3e153741e2fb572dde28cce20fde" [[package]] name = "polling" -version = "3.8.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50" +checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.5.2", "pin-project-lite", "rustix 1.0.8", - "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -9303,7 +8983,7 @@ dependencies = [ [[package]] name = "precompile-utils" version = "0.1.0" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "environmental", "evm", @@ -9327,29 +9007,15 @@ dependencies = [ [[package]] name = "precompile-utils-macro" version = "0.1.0" -source = "git+https://github.com/opentensor/frontier?rev=fe6976888fda696771cd15f78dbbdd71ee6c1216#fe6976888fda696771cd15f78dbbdd71ee6c1216" +source = "git+https://github.com/opentensor/frontier?rev=830e61f370d88f7ace1c5a5659dd58db75a19844#830e61f370d88f7ace1c5a5659dd58db75a19844" dependencies = [ "case", "num_enum", "prettyplease", "proc-macro2", - "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "syn 2.0.104", -] - -[[package]] -name = "predicates" -version = "2.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" -dependencies = [ - "difflib", - "float-cmp", - "itertools 0.10.5", - "normalize-line-endings", - "predicates-core", - "regex", + "quote", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "syn 2.0.104", ] [[package]] @@ -9380,9 +9046,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" dependencies = [ "proc-macro2", "syn 2.0.104", @@ -9398,7 +9064,6 @@ dependencies = [ "impl-codec 0.6.0", "impl-rlp 0.3.0", "impl-serde 0.4.0", - "scale-info", "uint 0.9.5", ] @@ -9477,11 +9142,22 @@ dependencies = [ ] [[package]] -name = "proc-macro-warning" -version = "0.4.2" +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", "syn 2.0.104", @@ -9518,11 +9194,11 @@ dependencies = [ "frame-support-procedural-tools 10.0.0", "itertools 0.10.5", "macro_magic", - "proc-macro-warning 1.84.1", + "proc-macro-warning", "proc-macro2", "quote", "regex", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "syn 2.0.104", ] @@ -9542,9 +9218,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.21.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", @@ -9574,7 +9250,7 @@ dependencies = [ "bitflags 2.9.1", "lazy_static", "num-traits", - "rand 0.9.1", + "rand 0.9.2", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax 0.8.5", @@ -9699,63 +9375,71 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", "thiserror 1.0.69", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", + "cfg_aliases 0.2.1", "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 1.1.0", - "rustls 0.21.12", - "thiserror 1.0.69", + "rustc-hash 2.1.1", + "rustls", + "socket2 0.5.10", + "thiserror 2.0.12", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.10.6" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" dependencies = [ "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash 1.1.0", - "rustls 0.21.12", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.2", + "ring 0.17.14", + "rustc-hash 2.1.1", + "rustls", + "rustls-pki-types", "slab", - "thiserror 1.0.69", + "thiserror 2.0.12", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.4.1" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" dependencies = [ - "bytes", + "cfg_aliases 0.2.1", "libc", + "once_cell", "socket2 0.5.10", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -9792,9 +9476,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", @@ -9903,9 +9587,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ "pem", "ring 0.16.20", @@ -9913,22 +9597,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "reconnecting-jsonrpsee-ws-client" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fa4f17e09edfc3131636082faaec633c7baa269396b4004040bc6c52f49f65" -dependencies = [ - "cfg_aliases 0.2.1", - "finito", - "futures", - "jsonrpsee 0.23.2", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "redox_syscall" version = "0.2.16" @@ -9940,9 +9608,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ "bitflags 2.9.1", ] @@ -10190,9 +9858,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" +checksum = "9ecb38f82477f20c5c3d62ef52d7c4e536e38ea9b73fb570a20c5cae0e14bcf6" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -10207,7 +9875,7 @@ dependencies = [ "primitive-types 0.12.2", "proptest", "rand 0.8.5", - "rand 0.9.1", + "rand 0.9.2", "rlp 0.5.2", "ruint-macro", "serde", @@ -10223,9 +9891,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rustc-demangle" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -10323,35 +9991,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.14", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring 0.17.14", - "rustls-pki-types", - "rustls-webpki 0.102.8", - "subtle 2.6.1", - "zeroize", -] - -[[package]] -name = "rustls" -version = "0.23.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" +checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" dependencies = [ "log", "once_cell", @@ -10362,31 +10004,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework 2.11.1", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.2.0", - "rustls-pki-types", - "schannel", - "security-framework 2.11.1", -] - [[package]] name = "rustls-native-certs" version = "0.8.1" @@ -10399,52 +10016,35 @@ dependencies = [ "security-framework 3.2.0", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ + "web-time", "zeroize", ] [[package]] name = "rustls-platform-verifier" -version = "0.3.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" dependencies = [ - "core-foundation 0.9.4", + "core-foundation 0.10.1", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.29", - "rustls-native-certs 0.7.3", + "rustls", + "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.102.8", - "security-framework 2.11.1", + "rustls-webpki 0.103.4", + "security-framework 3.2.0", "security-framework-sys", - "webpki-roots 0.26.11", - "winapi", + "webpki-root-certs 0.26.11", + "windows-sys 0.59.0", ] [[package]] @@ -10463,17 +10063,6 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring 0.17.14", - "rustls-pki-types", - "untrusted 0.9.0", -] - [[package]] name = "rustls-webpki" version = "0.103.4" @@ -10505,13 +10094,12 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b" dependencies = [ "byteorder", "derive_more 0.99.20", - "twox-hash", ] [[package]] @@ -10537,7 +10125,7 @@ version = "0.1.0" dependencies = [ "num-traits", "sp-arithmetic", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "substrate-fixed", ] @@ -10559,6 +10147,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "same-file" version = "1.0.6" @@ -10570,8 +10167,8 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "sp-core", @@ -10581,17 +10178,15 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", "futures-timer", "ip_network", - "libp2p", "linked_hash_set", "log", - "multihash 0.19.3", "parity-scale-codec", "prost 0.12.6", "prost-build", @@ -10611,11 +10206,10 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "futures", - "futures-timer", "log", "parity-scale-codec", "sc-block-builder", @@ -10633,8 +10227,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.44.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "sp-api", @@ -10648,12 +10242,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "42.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "docify", - "log", "memmap2 0.9.7", "parity-scale-codec", "sc-chain-spec-derive", @@ -10665,18 +10258,18 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-genesis-builder", "sp-io", "sp-runtime", "sp-state-machine", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", ] [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -10686,8 +10279,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.50.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.51.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "chrono", @@ -10728,8 +10321,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "fnv", "futures", @@ -10747,7 +10340,6 @@ dependencies = [ "sp-externalities 0.30.0", "sp-runtime", "sp-state-machine", - "sp-statement-store", "sp-storage 22.0.0", "sp-trie", "substrate-prometheus-endpoint", @@ -10755,8 +10347,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.45.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.46.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "hash-db", "kvdb", @@ -10781,19 +10373,18 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", "log", - "mockall 0.11.4", + "mockall", "parking_lot 0.12.4", "sc-client-api", "sc-network-types", "sc-utils", "serde", - "sp-api", "sp-blockchain", "sp-consensus", "sp-core", @@ -10805,8 +10396,8 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", @@ -10834,8 +10425,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "fork-tree", @@ -10860,7 +10451,7 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-slots", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-inherents", "sp-keystore", "sp-runtime", @@ -10870,11 +10461,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "futures", - "jsonrpsee 0.24.9", + "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", "sc-rpc-api", @@ -10890,66 +10481,10 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "sc-consensus-beefy" -version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "array-bytes", - "async-channel 1.9.0", - "async-trait", - "fnv", - "futures", - "log", - "parity-scale-codec", - "parking_lot 0.12.4", - "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-stable2412-6)", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", - "tokio", - "wasm-timer", -] - -[[package]] -name = "sc-consensus-beefy-rpc" -version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "futures", - "jsonrpsee 0.24.9", - "log", - "parity-scale-codec", - "parking_lot 0.12.4", - "sc-consensus-beefy", - "sc-rpc", - "serde", - "sp-application-crypto", - "sp-consensus-beefy", - "sp-core", - "sp-runtime", - "thiserror 1.0.69", -] - [[package]] name = "sc-consensus-epochs" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10962,7 +10497,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.33.0" -source = "git+https://github.com/opentensor/grandpa.git?rev=b3ba2f67d510559edfb4963523de86ed89439d74#b3ba2f67d510559edfb4963523de86ed89439d74" +source = "git+https://github.com/opentensor/grandpa.git?rev=67ff75e915bd44586b8f8443e457b5b101920da8#67ff75e915bd44586b8f8443e457b5b101920da8" dependencies = [ "ahash 0.8.12", "array-bytes", @@ -10996,7 +10531,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", @@ -11005,12 +10540,12 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "finality-grandpa", "futures", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "sc-client-api", @@ -11025,14 +10560,14 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.50.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "assert_matches", "async-trait", "futures", "futures-timer", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "sc-client-api", @@ -11060,8 +10595,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", @@ -11083,8 +10618,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "parking_lot 0.12.4", @@ -11097,7 +10632,7 @@ dependencies = [ "sp-externalities 0.30.0", "sp-io", "sp-panic-handler", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-trie", "sp-version", "sp-wasm-interface 21.0.1", @@ -11106,8 +10641,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.38.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "polkavm", "sc-allocator", @@ -11119,8 +10654,8 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" -version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "polkavm", @@ -11130,26 +10665,24 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.38.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "anyhow", - "cfg-if", - "libc", "log", "parking_lot 0.12.4", "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-wasm-interface 21.0.1", "wasmtime", ] [[package]] name = "sc-informant" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "console", "futures", @@ -11157,7 +10690,6 @@ dependencies = [ "log", "sc-client-api", "sc-network", - "sc-network-common", "sc-network-sync", "sp-blockchain", "sp-runtime", @@ -11165,8 +10697,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "35.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "parking_lot 0.12.4", @@ -11179,8 +10711,8 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -11190,7 +10722,6 @@ dependencies = [ "futures-timer", "log", "mixnet", - "multiaddr 0.18.2", "parity-scale-codec", "parking_lot 0.12.4", "sc-client-api", @@ -11208,13 +10739,13 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.48.4" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "async-channel 1.9.0", "async-trait", - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "cid 0.9.0", "either", @@ -11226,8 +10757,7 @@ dependencies = [ "linked_hash_set", "litep2p", "log", - "mockall 0.11.4", - "once_cell", + "mockall", "parity-scale-codec", "parking_lot 0.12.4", "partial_sort", @@ -11259,26 +10789,18 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "async-trait", "bitflags 1.3.2", - "futures", - "libp2p-identity", "parity-scale-codec", - "prost-build", - "sc-consensus", - "sc-network-types", - "sp-consensus", - "sp-consensus-grandpa", "sp-runtime", ] [[package]] name = "sc-network-gossip" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "ahash 0.8.12", "futures", @@ -11296,8 +10818,8 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -11317,17 +10839,16 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "async-channel 1.9.0", "async-trait", "fork-tree", "futures", - "futures-timer", "log", - "mockall 0.11.4", + "mockall", "parity-scale-codec", "prost 0.12.6", "prost-build", @@ -11353,8 +10874,8 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "futures", @@ -11372,12 +10893,14 @@ dependencies = [ [[package]] name = "sc-network-types" -version = "0.15.2" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.15.4" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bs58", + "bytes", "ed25519-dalek", "libp2p-identity", + "libp2p-kad", "litep2p", "log", "multiaddr 0.18.2", @@ -11389,28 +10912,25 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "44.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "array-bytes", "bytes", "fnv", "futures", "futures-timer", "http-body-util", "hyper 1.6.0", - "hyper-rustls 0.27.7", + "hyper-rustls", "hyper-util", - "log", "num_cpus", "once_cell", "parity-scale-codec", "parking_lot 0.12.4", "rand 0.8.5", - "rustls 0.23.29", + "rustls", "sc-client-api", "sc-network", - "sc-network-common", "sc-network-types", "sc-transaction-pool-api", "sc-utils", @@ -11426,8 +10946,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.20.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11435,11 +10955,11 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "44.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "futures", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.4", @@ -11467,10 +10987,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.48.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "jsonrpsee 0.24.9", + "jsonrpsee", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -11487,8 +11007,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "21.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -11498,7 +11018,7 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "ip_network", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "sc-rpc-api", "serde", @@ -11511,15 +11031,15 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.49.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "futures", "futures-util", "hex", "itertools 0.11.0", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.4", @@ -11541,17 +11061,32 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "sc-runtime-utilities" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "parity-scale-codec", + "sc-executor", + "sc-executor-common", + "sp-core", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-state-machine", + "sp-wasm-interface 21.0.1", + "thiserror 1.0.69", +] + [[package]] name = "sc-service" -version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.50.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "directories", "exit-future", "futures", "futures-timer", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.4", @@ -11607,8 +11142,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.37.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.38.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "log", "parity-scale-codec", @@ -11616,29 +11151,10 @@ dependencies = [ "sp-core", ] -[[package]] -name = "sc-sync-state-rpc" -version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "jsonrpsee 0.24.9", - "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 1.0.69", -] - [[package]] name = "sc-sysinfo" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "42.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "derive_more 0.99.20", "futures", @@ -11651,15 +11167,14 @@ dependencies = [ "serde", "serde_json", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-io", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", ] [[package]] name = "sc-telemetry" -version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "28.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "chrono", "futures", @@ -11668,7 +11183,6 @@ dependencies = [ "parking_lot 0.12.4", "pin-project", "rand 0.8.5", - "sc-network", "sc-utils", "serde", "serde_json", @@ -11678,8 +11192,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "chrono", "console", @@ -11697,7 +11211,7 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "thiserror 1.0.69", "tracing", "tracing-log", @@ -11706,8 +11220,8 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "11.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -11717,8 +11231,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", @@ -11736,23 +11250,25 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-runtime", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", "tokio-stream", + "tracing", ] [[package]] name = "sc-transaction-pool-api" -version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", + "indexmap 2.10.0", "log", "parity-scale-codec", "serde", @@ -11764,8 +11280,8 @@ dependencies = [ [[package]] name = "sc-utils" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "18.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-channel 1.9.0", "futures", @@ -11796,7 +11312,20 @@ checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ "derive_more 0.99.20", "parity-scale-codec", - "primitive-types 0.12.2", + "scale-bits", + "scale-type-resolver", + "smallvec", +] + +[[package]] +name = "scale-decode" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ae9cc099ae85ff28820210732b00f019546f36f33225f509fe25d5816864a0" +dependencies = [ + "derive_more 1.0.0", + "parity-scale-codec", + "primitive-types 0.13.1", "scale-bits", "scale-decode-derive", "scale-type-resolver", @@ -11805,25 +11334,25 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb22f574168103cdd3133b19281639ca65ad985e24612728f727339dcaf4021" +checksum = "5ed9401effa946b493f9f84dc03714cca98119b230497df6f3df6b84a2b03648" dependencies = [ - "darling 0.14.4", + "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] name = "scale-encode" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528464e6ae6c8f98e2b79633bf79ef939552e795e316579dab09c61670d56602" +checksum = "5f9271284d05d0749c40771c46180ce89905fd95aa72a2a2fddb4b7c0aa424db" dependencies = [ - "derive_more 0.99.20", + "derive_more 1.0.0", "parity-scale-codec", - "primitive-types 0.12.2", + "primitive-types 0.13.1", "scale-bits", "scale-encode-derive", "scale-type-resolver", @@ -11832,11 +11361,11 @@ dependencies = [ [[package]] name = "scale-encode-derive" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef2618f123c88da9cd8853b69d766068f1eddc7692146d7dfe9b89e25ce2efd" +checksum = "102fbc6236de6c53906c0b262f12c7aa69c2bdc604862c12728f5f4d370bc137" dependencies = [ - "darling 0.20.11", + "darling", "proc-macro-crate 3.3.0", "proc-macro2", "quote", @@ -11881,9 +11410,9 @@ dependencies = [ [[package]] name = "scale-typegen" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498d1aecf2ea61325d4511787c115791639c0fd21ef4f8e11e49dd09eff2bbac" +checksum = "0dc4c70c7fea2eef1740f0081d3fe385d8bee1eef11e9272d3bec7dc8e5438e0" dependencies = [ "proc-macro2", "quote", @@ -11894,18 +11423,17 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.16.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6ab090d823e75cfdb258aad5fe92e13f2af7d04b43a55d607d25fcc38c811" +checksum = "f5e0ef2a0ee1e02a69ada37feb87ea1616ce9808aca072befe2d3131bf28576e" dependencies = [ "base58", "blake2 0.10.6", - "derive_more 0.99.20", + "derive_more 1.0.0", "either", - "frame-metadata 15.1.0", "parity-scale-codec", "scale-bits", - "scale-decode", + "scale-decode 0.14.0", "scale-encode", "scale-info", "scale-type-resolver", @@ -11922,6 +11450,30 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + [[package]] name = "schnellru" version = "0.2.4" @@ -11971,13 +11523,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52" [[package]] -name = "sct" -version = "0.7.1" +name = "scrypt" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", + "password-hash", + "pbkdf2", + "salsa20", + "sha2 0.10.9", ] [[package]] @@ -12013,6 +11567,17 @@ dependencies = [ "secp256k1-sys 0.9.2", ] +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.8.5", + "secp256k1-sys 0.10.1", +] + [[package]] name = "secp256k1-sys" version = "0.8.2" @@ -12031,6 +11596,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -12040,6 +11614,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -12050,7 +11633,6 @@ dependencies = [ "core-foundation 0.9.4", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -12128,12 +11710,6 @@ dependencies = [ "pest", ] -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - [[package]] name = "serde" version = "1.0.219" @@ -12184,9 +11760,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ "itoa", "memchr", @@ -12217,15 +11793,19 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.0.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89df7a26519371a3cce44fbb914c2819c84d9b897890987fa3ab096491cc0ea8" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" dependencies = [ - "base64 0.13.1", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -12233,11 +11813,11 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "2.3.3" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" dependencies = [ - "darling 0.20.11", + "darling", "proc-macro2", "quote", "syn 2.0.104", @@ -12253,19 +11833,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.1", -] - [[package]] name = "sha1" version = "0.10.6" @@ -12335,7 +11902,7 @@ name = "share-pool" version = "0.1.0" dependencies = [ "safe-math", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "substrate-fixed", ] @@ -12347,9 +11914,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -12416,17 +11983,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" -[[package]] -name = "slot-range-helper" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "enumn", - "parity-scale-codec", - "paste", - "sp-runtime", -] - [[package]] name = "smallvec" version = "1.15.1" @@ -12452,14 +12008,14 @@ dependencies = [ [[package]] name = "smoldot" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" +checksum = "966e72d77a3b2171bb7461d0cb91f43670c63558c62d7cf42809cae6c8b6b818" dependencies = [ "arrayvec 0.7.6", "async-lock", "atomic-take", - "base64 0.21.7", + "base64 0.22.1", "bip39", "blake2-rfc", "bs58", @@ -12468,18 +12024,17 @@ dependencies = [ "derive_more 0.99.20", "ed25519-zebra", "either", - "event-listener 4.0.3", + "event-listener 5.4.1", "fnv", "futures-lite", "futures-util", "hashbrown 0.14.5", "hex", "hmac 0.12.1", - "itertools 0.12.1", + "itertools 0.13.0", "libm", "libsecp256k1", "merlin", - "no-std-net", "nom", "num-bigint", "num-rational", @@ -12498,7 +12053,7 @@ dependencies = [ "siphasher 1.0.1", "slab", "smallvec", - "soketto 0.7.1", + "soketto", "twox-hash", "wasmi", "x25519-dalek", @@ -12507,27 +12062,27 @@ dependencies = [ [[package]] name = "smoldot-light" -version = "0.14.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" +checksum = "2a33b06891f687909632ce6a4e3fd7677b24df930365af3d0bcb078310129f3f" dependencies = [ "async-channel 2.5.0", "async-lock", - "base64 0.21.7", + "base64 0.22.1", "blake2-rfc", + "bs58", "derive_more 0.99.20", "either", - "event-listener 4.0.3", + "event-listener 5.4.1", "fnv", "futures-channel", "futures-lite", "futures-util", "hashbrown 0.14.5", "hex", - "itertools 0.12.1", + "itertools 0.13.0", "log", "lru 0.12.5", - "no-std-net", "parking_lot 0.12.4", "pin-project", "rand 0.8.5", @@ -12564,16 +12119,6 @@ dependencies = [ "subtle 2.6.1", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.10" @@ -12585,18 +12130,13 @@ dependencies = [ ] [[package]] -name = "soketto" -version = "0.7.1" +name = "socket2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ - "base64 0.13.1", - "bytes", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha-1", + "libc", + "windows-sys 0.59.0", ] [[package]] @@ -12617,8 +12157,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "hash-db", @@ -12630,7 +12170,7 @@ dependencies = [ "sp-externalities 0.30.0", "sp-metadata-ir", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-state-machine", "sp-trie", "sp-version", @@ -12639,8 +12179,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "22.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "Inflector", "blake2 0.10.6", @@ -12653,8 +12193,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -12665,8 +12205,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "26.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "integer-sqrt", @@ -12688,8 +12228,8 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -12700,8 +12240,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "sp-api", "sp-inherents", @@ -12710,8 +12250,8 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "futures", "parity-scale-codec", @@ -12729,13 +12269,12 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "futures", "log", - "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", @@ -12744,8 +12283,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "parity-scale-codec", @@ -12760,8 +12299,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "parity-scale-codec", @@ -12776,30 +12315,10 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-consensus-beefy" -version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -dependencies = [ - "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-stable2412-6)", - "sp-io", - "sp-keystore", - "sp-mmr-primitives", - "sp-runtime", - "sp-weights", - "strum 0.26.3", -] - [[package]] name = "sp-consensus-grandpa" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "23.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "finality-grandpa", "log", @@ -12815,8 +12334,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -12826,9 +12345,10 @@ dependencies = [ [[package]] name = "sp-core" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ + "ark-vrf", "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", @@ -12854,13 +12374,13 @@ dependencies = [ "scale-info", "schnorrkel", "secp256k1 0.28.2", - "secrecy", + "secrecy 0.8.0", "serde", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-externalities 0.30.0", - "sp-runtime-interface 29.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-runtime-interface 29.0.1", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-storage 22.0.0", "ss58-registry", "substrate-bip39", @@ -12873,18 +12393,18 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", - "ark-bls12-381", + "ark-bls12-381 0.4.0", "ark-bls12-381-ext", "ark-bw6-761", "ark-bw6-761-ext", - "ark-ec", + "ark-ec 0.4.2", "ark-ed-on-bls12-377", "ark-ed-on-bls12-377-ext", - "ark-ed-on-bls12-381-bandersnatch", + "ark-ed-on-bls12-381-bandersnatch 0.4.0", "ark-ed-on-bls12-381-bandersnatch-ext", "ark-scale 0.0.12", "sp-runtime-interface 24.0.0", @@ -12893,21 +12413,21 @@ dependencies = [ [[package]] name = "sp-crypto-ec-utils" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", - "ark-bls12-381", + "ark-bls12-381 0.4.0", "ark-bls12-381-ext", "ark-bw6-761", "ark-bw6-761-ext", - "ark-ec", + "ark-ec 0.4.2", "ark-ed-on-bls12-377", "ark-ed-on-bls12-377-ext", - "ark-ed-on-bls12-381-bandersnatch", + "ark-ed-on-bls12-381-bandersnatch 0.4.0", "ark-ed-on-bls12-381-bandersnatch-ext", "ark-scale 0.0.12", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", ] [[package]] @@ -12927,7 +12447,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "blake2b_simd", "byteorder", @@ -12940,17 +12460,17 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "syn 2.0.104", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "kvdb", "parking_lot 0.12.4", @@ -12959,7 +12479,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "proc-macro2", "quote", @@ -12969,7 +12489,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "proc-macro2", "quote", @@ -12979,7 +12499,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "environmental", "parity-scale-codec", @@ -12989,7 +12509,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "environmental", "parity-scale-codec", @@ -12998,8 +12518,8 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -13010,8 +12530,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13023,8 +12543,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "39.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "40.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bytes", "docify", @@ -13032,16 +12552,16 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive 0.9.1", + "polkavm-derive 0.18.0", "rustversion", "secp256k1 0.28.2", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-externalities 0.30.0", "sp-keystore", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "sp-state-machine", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "sp-trie", "tracing", "tracing-core", @@ -13049,8 +12569,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "41.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "sp-core", "sp-runtime", @@ -13059,8 +12579,8 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.42.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "parking_lot 0.12.4", @@ -13071,7 +12591,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -13079,18 +12599,18 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ - "frame-metadata 18.0.0", + "frame-metadata 20.0.0", "parity-scale-codec", "scale-info", ] [[package]] name = "sp-mixnet" -version = "0.13.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.14.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -13098,27 +12618,10 @@ dependencies = [ "sp-application-crypto", ] -[[package]] -name = "sp-mmr-primitives" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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-stable2412-6)", - "sp-runtime", - "thiserror 1.0.69", -] - [[package]] name = "sp-npos-elections" -version = "35.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -13130,8 +12633,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "sp-api", "sp-core", @@ -13140,8 +12643,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "13.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "backtrace", "regex", @@ -13149,8 +12652,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -13159,8 +12662,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "41.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "binary-merkle-tree", "docify", @@ -13179,7 +12682,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-trie", "sp-weights", "tracing", @@ -13189,13 +12692,12 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.26.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)", @@ -13207,19 +12709,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "29.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.9.1", + "polkavm-derive 0.18.0", "primitive-types 0.13.1", "sp-externalities 0.30.0", "sp-runtime-interface-proc-macro 18.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-storage 22.0.0", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "sp-wasm-interface 21.0.1", "static_assertions", ] @@ -13227,7 +12729,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "Inflector", "expander", @@ -13240,7 +12742,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "Inflector", "expander", @@ -13252,8 +12754,8 @@ dependencies = [ [[package]] name = "sp-session" -version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "scale-info", @@ -13266,8 +12768,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13279,8 +12781,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.45.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "hash-db", "log", @@ -13299,8 +12801,8 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "20.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -13313,10 +12815,10 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-externalities 0.30.0", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface 29.0.1", "thiserror 1.0.69", "x25519-dalek", ] @@ -13324,17 +12826,17 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -13346,19 +12848,19 @@ dependencies = [ [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", ] [[package]] name = "sp-timestamp" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "parity-scale-codec", @@ -13370,7 +12872,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "parity-scale-codec", "regex", @@ -13381,8 +12883,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "17.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", "tracing", @@ -13392,8 +12894,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "sp-api", "sp-runtime", @@ -13401,8 +12903,8 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "36.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "async-trait", "parity-scale-codec", @@ -13415,8 +12917,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "ahash 0.8.12", "hash-db", @@ -13437,8 +12939,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -13447,7 +12949,7 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "sp-version-proc-macro", "thiserror 1.0.69", ] @@ -13455,10 +12957,10 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "parity-scale-codec", - "proc-macro-warning 1.84.1", + "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.104", @@ -13467,7 +12969,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#495d5a24c8078a0da1eb5e0fe8742a09f1f1bd5c" +source = "git+https://github.com/paritytech/polkadot-sdk#59fb2e7482d471a7ec4e8d3b30499497efa7b34c" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -13478,7 +12980,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -13489,8 +12991,8 @@ dependencies = [ [[package]] name = "sp-weights" -version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "31.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -13498,7 +13000,7 @@ dependencies = [ "serde", "smallvec", "sp-arithmetic", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", ] [[package]] @@ -13557,7 +13059,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.4.0", + "event-listener 5.4.1", "futures-core", "futures-intrusive", "futures-io", @@ -13663,12 +13165,12 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-xcm" -version = "15.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "16.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "bounded-collections", - "derivative", + "derive-where", "environmental", "frame-support", "hex-literal", @@ -13682,48 +13184,6 @@ dependencies = [ "xcm-procedural", ] -[[package]] -name = "staging-xcm-builder" -version = "18.2.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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 = "18.0.3" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" -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" @@ -13759,10 +13219,14 @@ dependencies = [ ] [[package]] -name = "strsim" -version = "0.10.0" +name = "string-interner" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", +] [[package]] name = "strsim" @@ -13814,7 +13278,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -13823,31 +13287,44 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" [[package]] name = "substrate-fixed" -version = "0.5.9" -source = "git+https://github.com/opentensor/substrate-fixed.git?tag=v0.5.9#a4fb461aae6205ffc55bed51254a40c52be04e5d" +version = "0.6.0" +source = "git+https://github.com/encointer/substrate-fixed.git?tag=v0.6.0#d5f70362f2e05b5f33fb51cd7baa825323e4e6c5" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0", + "substrate-typenum", ] [[package]] name = "substrate-frame-rpc-system" -version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "43.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "docify", "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.24.9", + "jsonrpsee", "log", "parity-scale-codec", "sc-rpc-api", @@ -13861,8 +13338,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.17.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "0.17.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -13874,33 +13351,26 @@ dependencies = [ ] [[package]] -name = "substrate-state-trie-migration-rpc" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +name = "substrate-typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd64d3efe988228b8496698197ee60cfbfcedbf226961300e559870c1a3e8e0" dependencies = [ - "jsonrpsee 0.24.9", "parity-scale-codec", - "sc-client-api", - "sc-rpc-api", - "serde", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-trie", - "trie-db", + "scale-info", ] [[package]] name = "substrate-wasm-builder" -version = "25.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "26.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "array-bytes", "build-helper", "cargo_metadata", "console", "filetime", - "frame-metadata 18.0.0", + "frame-metadata 20.0.0", "jobserver", "merkleized-metadata", "parity-scale-codec", @@ -13911,7 +13381,7 @@ dependencies = [ "sp-core", "sp-io", "sp-maybe-compressed-blob", - "sp-tracing 17.0.1", + "sp-tracing 17.1.0", "sp-version", "strum 0.26.3", "tempfile", @@ -13924,8 +13394,6 @@ dependencies = [ name = "subtensor" version = "0.1.0" dependencies = [ - "node-subtensor", - "node-subtensor-runtime", "proc-macro2", "quote", "rayon", @@ -13938,7 +13406,7 @@ dependencies = [ name = "subtensor-custom-rpc" version = "0.0.2" dependencies = [ - "jsonrpsee 0.24.9", + "jsonrpsee", "pallet-subtensor", "parity-scale-codec", "serde", @@ -13996,6 +13464,7 @@ dependencies = [ "pallet-balances", "pallet-crowdloan", "pallet-evm", + "pallet-evm-precompile-bn128", "pallet-evm-precompile-dispatch", "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", @@ -14008,7 +13477,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "substrate-fixed", "subtensor-runtime-common", "subtensor-swap-interface", @@ -14046,6 +13515,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", + "node-subtensor-runtime", "semver 1.0.26", "toml_edit", ] @@ -14064,50 +13534,47 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subxt" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a160cba1edbf3ec4fbbeaea3f1a185f70448116a6bccc8276bb39adb3b3053bd" +checksum = "1c17d7ec2359d33133b63c97e28c8b7cd3f0a5bc6ce567ae3aef9d9e85be3433" dependencies = [ "async-trait", "derive-where", "either", - "frame-metadata 16.0.0", + "frame-metadata 17.0.0", "futures", "hex", - "impl-serde 0.4.0", - "instant", - "jsonrpsee 0.22.5", + "impl-serde 0.5.0", + "jsonrpsee", "parity-scale-codec", - "primitive-types 0.12.2", - "reconnecting-jsonrpsee-ws-client", + "polkadot-sdk", + "primitive-types 0.13.1", "scale-bits", - "scale-decode", + "scale-decode 0.14.0", "scale-encode", "scale-info", "scale-value", "serde", "serde_json", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-core", "subxt-lightclient", "subxt-macro", "subxt-metadata", "thiserror 1.0.69", + "tokio", "tokio-util", "tracing", "url", + "web-time", ] [[package]] name = "subxt-codegen" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d703dca0905cc5272d7cc27a4ac5f37dcaae7671acc7fef0200057cc8c317786" +checksum = "6550ef451c77db6e3bc7c56fb6fe1dca9398a2c8fc774b127f6a396a769b9c5b" dependencies = [ - "frame-metadata 16.0.0", "heck 0.5.0", - "hex", - "jsonrpsee 0.22.5", "parity-scale-codec", "proc-macro2", "quote", @@ -14116,41 +13583,42 @@ dependencies = [ "subxt-metadata", "syn 2.0.104", "thiserror 1.0.69", - "tokio", ] [[package]] name = "subxt-core" -version = "0.37.1" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af3b36405538a36b424d229dc908d1396ceb0994c90825ce928709eac1a159a" +checksum = "cb7a1bc6c9c1724971636a66e3225a7253cdb35bb6efb81524a6c71c04f08c59" dependencies = [ "base58", "blake2 0.10.6", "derive-where", - "frame-metadata 16.0.0", + "frame-decode", + "frame-metadata 17.0.0", "hashbrown 0.14.5", "hex", - "impl-serde 0.4.0", + "impl-serde 0.5.0", + "keccak-hash", "parity-scale-codec", - "primitive-types 0.12.2", + "polkadot-sdk", + "primitive-types 0.13.1", "scale-bits", - "scale-decode", + "scale-decode 0.14.0", "scale-encode", "scale-info", "scale-value", "serde", "serde_json", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-metadata", "tracing", ] [[package]] name = "subxt-lightclient" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9406fbdb9548c110803cb8afa750f8b911d51eefdf95474b11319591d225d9" +checksum = "89ebc9131da4d0ba1f7814495b8cc79698798ccd52cacd7bcefe451e415bd945" dependencies = [ "futures", "futures-util", @@ -14165,56 +13633,74 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c195f803d70687e409aba9be6c87115b5da8952cd83c4d13f2e043239818fcd" +checksum = "7819c5e09aae0319981ee853869f2fcd1fac4db8babd0d004c17161297aadc05" dependencies = [ - "darling 0.20.11", + "darling", "parity-scale-codec", - "proc-macro-error", + "proc-macro-error2", "quote", "scale-typegen", "subxt-codegen", + "subxt-utils-fetchmetadata", "syn 2.0.104", ] [[package]] name = "subxt-metadata" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738be5890fdeff899bbffff4d9c0f244fe2a952fb861301b937e3aa40ebb55da" +checksum = "aacd4e7484fef58deaa2dcb32d94753a864b208a668c0dd0c28be1d8abeeadb2" dependencies = [ - "frame-metadata 16.0.0", + "frame-decode", + "frame-metadata 17.0.0", "hashbrown 0.14.5", "parity-scale-codec", + "polkadot-sdk", "scale-info", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "subxt-signer" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49888ae6ae90fe01b471193528eea5bd4ed52d8eecd2d13f4a2333b87388850" +checksum = "d680352d04665b1e4eb6f9d2a54b800c4d8e1b20478e69be1b7d975b08d9fc34" dependencies = [ + "base64 0.22.1", "bip32", "bip39", "cfg-if", + "crypto_secretbox", "hex", "hmac 0.12.1", "keccak-hash", "parity-scale-codec", "pbkdf2", + "polkadot-sdk", "regex", "schnorrkel", - "secp256k1 0.28.2", - "secrecy", + "scrypt", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", "sha2 0.10.9", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "subxt-core", "zeroize", ] +[[package]] +name = "subxt-utils-fetchmetadata" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c53bc3eeaacc143a2f29ace4082edd2edaccab37b69ad20befba9fb00fdb3d" +dependencies = [ + "hex", + "parity-scale-codec", + "thiserror 1.0.69", +] + [[package]] name = "syn" version = "1.0.109" @@ -14494,10 +13980,10 @@ source = "git+https://github.com/ideal-lab5/timelock?rev=5416406cfd32799e31e1795 dependencies = [ "aes-gcm", "ark-bls12-377", - "ark-bls12-381", - "ark-ec", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", "ark-ff 0.4.2", - "ark-poly", + "ark-poly 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", "array-bytes", @@ -14517,9 +14003,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.46.1" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", @@ -14530,9 +14016,9 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "slab", - "socket2 0.5.10", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -14546,34 +14032,13 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.4", - "rustls-pki-types", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.29", + "rustls", "tokio", ] @@ -14597,19 +14062,19 @@ checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", - "rustls 0.23.29", - "rustls-native-certs 0.8.1", + "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls", "tungstenite", ] [[package]] name = "tokio-util" -version = "0.7.15" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", @@ -14757,8 +14222,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "coarsetime", "polkadot-primitives", @@ -14769,7 +14234,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -14820,9 +14285,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" dependencies = [ "hash-db", "log", @@ -14839,78 +14304,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand 0.8.5", - "smallvec", - "socket2 0.4.10", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.4", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror 1.0.69", - "tokio", - "tracing", - "trust-dns-proto 0.23.2", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -14934,8 +14327,8 @@ dependencies = [ "http 1.3.1", "httparse", "log", - "rand 0.9.1", - "rustls 0.23.29", + "rand 0.9.2", + "rustls", "rustls-pki-types", "sha1", "thiserror 2.0.12", @@ -14961,15 +14354,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "typenum" -version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=v1.16.0#4c8dddaa8bdd13130149e43b4085ad14e960617f" -dependencies = [ - "parity-scale-codec", - "scale-info", -] - [[package]] name = "typenum" version = "1.18.0" @@ -15012,12 +14396,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" - [[package]] name = "unicode-ident" version = "1.0.18" @@ -15067,7 +14445,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "futures-io", "futures-util", @@ -15102,7 +14480,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", ] @@ -15162,27 +14540,70 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +source = "git+https://github.com/opentensor/bls?branch=fix-no-std#4ac443d11a6c9fdebe329d113702ad7387ba1688" dependencies = [ "ark-bls12-377", - "ark-bls12-381", - "ark-ec", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-serialize 0.4.2", - "ark-serialize-derive", + "ark-serialize-derive 0.4.2", "arrayref", - "constcat", "digest 0.10.7", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sha2 0.10.9", "sha3", - "thiserror 1.0.69", "zeroize", ] +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + [[package]] name = "wait-timeout" version = "0.2.1" @@ -15372,28 +14793,37 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +checksum = "50386c99b9c32bd2ed71a55b6dd4040af2580530fae8bdb9a6576571a80d0cca" dependencies = [ + "arrayvec 0.7.6", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin 0.9.8", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" +dependencies = [ + "ahash 0.8.12", + "hashbrown 0.14.5", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "a23b3a7f6c8c3ceeec6b83531ee61f0013c56e51cbf2b14b0f213548b23a4b41" dependencies = [ "downcast-rs", "libm", @@ -15636,29 +15066,29 @@ dependencies = [ ] [[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "webpki-roots" +name = "webpki-root-certs" version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" dependencies = [ - "webpki-roots 1.0.1", + "webpki-root-certs 1.0.2", ] [[package]] -name = "webpki-roots" -version = "1.0.1" +name = "webpki-root-certs" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" +checksum = "4e4ffd8df1c57e87c325000a3d6ef93db75279dc3a231125aac571650f22b12a" dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "wide" version = "0.7.33" @@ -15879,7 +15309,7 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.2", + "windows-targets 0.53.3", ] [[package]] @@ -15930,10 +15360,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.2" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ + "windows-link", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -16190,16 +15621,16 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs 0.6.2", "data-encoding", - "der-parser 8.2.0", + "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry 0.7.1", "rusticata-macros", "thiserror 1.0.69", "time", @@ -16224,8 +15655,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "11.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2412-6#bbc435c7667d3283ba280a8fec44676357392753" +version = "11.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" dependencies = [ "Inflector", "proc-macro2", @@ -16265,16 +15696,16 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da1acad1c2dc53f0dde419115a38bd8221d8c3e47ae9aeceaf453266d29307e" +checksum = "2b2dd50a6d6115feb3e5d7d0efd45e8ca364b6c83722c1e9c602f5764e0e9597" dependencies = [ "futures", "log", "nohash-hasher", "parking_lot 0.12.4", "pin-project", - "rand 0.9.1", + "rand 0.9.2", "static_assertions", "web-time", ] @@ -16392,9 +15823,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +checksum = "bdbb9122ea75b11bf96e7492afb723e8a7fbe12c67417aa95e7e3d18144d37cd" dependencies = [ "yoke", "zerofrom", diff --git a/Cargo.toml b/Cargo.toml index 859dd2c010..4da960ad30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,15 +9,17 @@ license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" -[dependencies] -node-subtensor = { path = "node", version = "4.0.0-dev" } -node-subtensor-runtime = { path = "runtime", version = "4.0.0-dev" } - [build-dependencies] subtensor-linting = { path = "support/linting", version = "0.1.0" } -syn.workspace = true +syn = { workspace = true, features = [ + "full", + "visit-mut", + "visit", + "extra-traits", + "parsing", +] } quote.workspace = true -proc-macro2.workspace = true +proc-macro2 = { workspace = true, features = ["span-locations"] } walkdir.workspace = true rayon = "1.10" @@ -46,32 +48,31 @@ unwrap-used = "deny" useless_conversion = "allow" # until polkadot is patched [workspace.dependencies] -node-subtensor-runtime = { default-features = false, path = "runtime" } -pallet-admin-utils = { default-features = false, path = "pallets/admin-utils" } -pallet-collective = { default-features = false, path = "pallets/collective" } -pallet-commitments = { default-features = false, path = "pallets/commitments" } -pallet-registry = { default-features = false, path = "pallets/registry" } -pallet-crowdloan = { default-features = false, path = "pallets/crowdloan" } -pallet-subtensor = { default-features = false, path = "pallets/subtensor" } -pallet-subtensor-swap = { default-features = false, path = "pallets/swap" } -pallet-subtensor-swap-runtime-api = { default-features = false, path = "pallets/swap/runtime-api" } -pallet-subtensor-swap-rpc = { default-features = false, path = "pallets/swap/rpc" } -safe-math = { default-features = false, path = "primitives/safe-math" } -subtensor-custom-rpc = { default-features = false, path = "pallets/subtensor/rpc" } -subtensor-custom-rpc-runtime-api = { default-features = false, path = "pallets/subtensor/runtime-api" } -subtensor-precompiles = { default-features = false, path = "precompiles" } -subtensor-runtime-common = { default-features = false, path = "common" } -subtensor-swap-interface = { default-features = false, path = "pallets/swap-interface" } +node-subtensor-runtime = { path = "runtime", default-features = false } +pallet-admin-utils = { path = "pallets/admin-utils", default-features = false } +pallet-collective = { path = "pallets/collective", default-features = false } +pallet-commitments = { path = "pallets/commitments", default-features = false } +pallet-registry = { path = "pallets/registry", default-features = false } +pallet-crowdloan = { path = "pallets/crowdloan", default-features = false } +pallet-subtensor = { path = "pallets/subtensor", default-features = false } +pallet-subtensor-swap = { path = "pallets/swap", default-features = false } +pallet-subtensor-swap-runtime-api = { path = "pallets/swap/runtime-api", default-features = false } +pallet-subtensor-swap-rpc = { path = "pallets/swap/rpc", default-features = false } +safe-math = { path = "primitives/safe-math", default-features = false } +share-pool = { path = "primitives/share-pool", default-features = false } +subtensor-macros = { path = "support/macros", default-features = false } +subtensor-custom-rpc = { path = "pallets/subtensor/rpc", default-features = false } +subtensor-custom-rpc-runtime-api = { path = "pallets/subtensor/runtime-api", default-features = false } +subtensor-precompiles = { path = "precompiles", default-features = false } +subtensor-runtime-common = { path = "common", default-features = false } +subtensor-swap-interface = { path = "pallets/swap-interface", default-features = false } +procedural-fork = { path = "support/procedural-fork", default-features = false } +ed25519-dalek = { version = "2.1.0", default-features = false } async-trait = "0.1" cargo-husky = { version = "1", default-features = false } clap = "4.5.4" -codec = { package = "parity-scale-codec", version = "3.7.5", default-features = false, features = [ - "derive", -] } -ed25519-dalek = { version = "2.1.0", default-features = false, features = [ - "alloc", -] } +codec = { package = "parity-scale-codec", version = "3.7.5", default-features = false } enumflags2 = "0.7.9" futures = "0.3.30" hex = { version = "0.4", default-features = false } @@ -81,216 +82,198 @@ libsecp256k1 = { version = "0.7.2", default-features = false } log = { version = "0.4.21", default-features = false } memmap2 = "0.9.4" ndarray = { version = "0.15.6", default-features = false } -array-bytes = { version = "6.2.2", default-features = false } parity-util-mem = "0.12.0" rand = "0.8.5" -scale-codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ - "derive", -] } scale-info = { version = "2.11.2", default-features = false } serde = { version = "1.0.214", default-features = false } serde-tuple-vec-map = { version = "1.0.1", default-features = false } serde_bytes = { version = "0.11.14", default-features = false } -serde_json = { version = "1.0.121", default-features = false } -serde_with = { version = "=2.0.0", default-features = false } +serde_json = { version = "1.0.141", default-features = false } +serde_with = { version = "3.14.0", default-features = false } smallvec = "1.13.2" -litep2p = { git = "https://github.com/paritytech/litep2p", tag = "v0.7.0" } -syn = { version = "2.0.87", features = [ - "full", - "visit-mut", - "visit", - "extra-traits", - "parsing", -] } -quote = "1" -proc-macro2 = { version = "1", features = ["span-locations"] } -thiserror = "1.0" +litep2p = { git = "https://github.com/paritytech/litep2p", tag = "v0.7.0", default-features = false } +syn = { version = "2.0.87", default-features = false } +quote = { version = "1", default-features = false } +proc-macro2 = { version = "1", default-features = false } walkdir = "2" approx = "0.5" alloy-primitives = { version = "0.8.23", default-features = false } +num-traits = { version = "0.2.19", default-features = false } +semver = "1.0" +toml_edit = "0.22" +derive-syn-parse = "0.2" +Inflector = "0.11" +cfg-expr = "0.15" +itertools = "0.10" +macro_magic = { version = "0.5", default-features = false } +frame-support-procedural-tools = { version = "10.0.0", default-features = false } +proc-macro-warning = { version = "1", default-features = false } +expander = "2" +ahash = { version = "0.8", default-features = false } +regex = { version = "1.11.1", default-features = false } -subtensor-macros = { path = "support/macros" } - -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -frame-metadata = "18.0.0" -frame-election-provider-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +frame-metadata = { version = "20.0.0", default-features = false } -pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } pallet-proxy = { path = "pallets/proxy", default-features = false } -pallet-safe-mode = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } pallet-utility = { path = "pallets/utility", default-features = false } -pallet-root-testing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-safe-mode = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-root-testing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } # NPoS -pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-bags-list = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-fast-unstake = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-nomination-pools = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-staking-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +frame-election-provider-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-bags-list = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-fast-unstake = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-nomination-pools = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-staking-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } -sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sc-consensus-babe-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-epochs = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sc-chain-spec-derive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-network = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-service = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-chain-spec-derive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-storage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-transaction-storage-proof = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-version = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -sp-weights = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-storage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +sp-crypto-hashing = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } -substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } -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-stable2412-6" } -substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +substrate-fixed = { git = "https://github.com/encointer/substrate-fixed.git", tag = "v0.6.0", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } -runtime-common = { package = "polkadot-runtime-common", git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -polkadot-rpc = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } -polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", tag="polkadot-stable2412-6", default-features = false } +cumulus-primitives-proof-size-hostfunction = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } # Frontier -fp-evm = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fp-rpc = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fp-self-contained = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false, features = [ - "serde", -] } -fp-account = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-storage = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-db = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-consensus = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fp-consensus = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fp-dynamic-fee = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-api = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-rpc = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false, features = [ - "rpc-binary-search-estimate", -] } -fc-rpc-core = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-aura = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-babe = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -fc-mapping-sync = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -precompile-utils = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } +fp-evm = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fp-rpc = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fp-self-contained = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fp-account = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-storage = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-db = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-consensus = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fp-consensus = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fp-dynamic-fee = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-api = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-rpc = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-rpc-core = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-aura = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-babe = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +fc-mapping-sync = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +precompile-utils = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } # Frontier FRAME -pallet-base-fee = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-dynamic-fee = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-ethereum = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm-precompile-dispatch = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm-chain-id = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm-precompile-modexp = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm-precompile-sha3fips = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-evm-precompile-simple = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } -pallet-hotfix-sufficients = { git = "https://github.com/opentensor/frontier", rev = "fe6976888fda696771cd15f78dbbdd71ee6c1216", default-features = false } +pallet-base-fee = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-dynamic-fee = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-ethereum = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-chain-id = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } +pallet-hotfix-sufficients = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } #DRAND pallet-drand = { path = "pallets/drand", default-features = false } -sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", features = [ - "bls12-381", -] } -getrandom = { version = "0.2.15", features = [ +sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +getrandom = { version = "0.2.15", default-features = false, features = [ "custom", -], default-features = false } -sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false } -w3f-bls = { version = "=0.1.3", default-features = false } -ark-crypto-primitives = { version = "0.4.0", default-features = false, features = [ - "r1cs", - "snark", -] } -ark-scale = { version = "0.0.11", default-features = false, features = [ - "hazmat", ] } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +w3f-bls = { git = "https://github.com/opentensor/bls", branch = "fix-no-std", default-features = false } +ark-crypto-primitives = { version = "0.4.0", default-features = false } +ark-scale = { version = "0.0.11", default-features = false } sp-ark-bls12-381 = { git = "https://github.com/paritytech/substrate-curves", default-features = false } -ark-bls12-381 = { version = "0.4.0", features = [ - "curve", -], default-features = false } -ark-serialize = { version = "0.4.0", features = [ - "derive", -], default-features = false } +ark-bls12-381 = { version = "0.4.0", default-features = false } +ark-serialize = { version = "0.4.0", default-features = false } ark-ff = { version = "0.4.0", default-features = false } ark-ec = { version = "0.4.0", default-features = false } ark-std = { version = "0.4.0", default-features = false } -anyhow = "1.0.81" +anyhow = { version = "1.0.81", default-features = false } sha2 = { version = "0.10.8", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } tle = { git = "https://github.com/ideal-lab5/timelock", rev = "5416406cfd32799e31e1795393d4916894de4468", default-features = false } -cumulus-primitives-proof-size-hostfunction = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", package = "cumulus-primitives-proof-size-hostfunction", default-features = false } +# Primitives [profile.release] panic = "unwind" @@ -305,16 +288,10 @@ codegen-units = 1 [features] default = [] -try-runtime = [ - "node-subtensor/try-runtime", - "node-subtensor-runtime/try-runtime", -] -runtime-benchmarks = [ - "node-subtensor/runtime-benchmarks", - "node-subtensor-runtime/runtime-benchmarks", -] -metadata-hash = ["node-subtensor-runtime/metadata-hash"] pow-faucet = [] [patch."https://github.com/paritytech/polkadot-sdk.git"] -sc-consensus-grandpa = { git = "https://github.com/opentensor/grandpa.git", rev = "b3ba2f67d510559edfb4963523de86ed89439d74" } +sc-consensus-grandpa = { git = "https://github.com/opentensor/grandpa.git", rev = "67ff75e915bd44586b8f8443e457b5b101920da8" } + +[patch.crates-io] +w3f-bls = { git = "https://github.com/opentensor/bls", branch = "fix-no-std" } diff --git a/common/Cargo.toml b/common/Cargo.toml index c0de294180..b1b0f1bbf2 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-runtime-common" version = "0.1.0" -edition = "2024" +edition.workspace = true authors = ["Opentensor Foundation "] homepage = "https://opentensor.ai/" publish = false @@ -11,16 +11,15 @@ repository = "https://github.com/opentensor/subtensor/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { workspace = true } -frame-support = { workspace = true } -scale-info = { workspace = true } -serde = { workspace = true } -sp-core = { workspace = true } -sp-runtime = { workspace = true } -substrate-fixed = { workspace = true } -subtensor-macros = { workspace = true } - -approx = {workspace = true, optional = true} +codec = { workspace = true, features = ["derive"] } +frame-support.workspace = true +scale-info.workspace = true +serde.workspace = true +sp-core.workspace = true +sp-runtime.workspace = true +substrate-fixed.workspace = true +subtensor-macros.workspace = true +approx = { workspace = true, optional = true } [lints] workspace = true diff --git a/common/src/currency.rs b/common/src/currency.rs index f50e2bc9a1..75a774bbce 100644 --- a/common/src/currency.rs +++ b/common/src/currency.rs @@ -3,14 +3,16 @@ use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}; #[cfg(feature = "approx")] use approx::AbsDiffEq; -use codec::{Compact, CompactAs, Decode, Encode, Error as CodecError, MaxEncodedLen}; +use codec::{ + Compact, CompactAs, Decode, DecodeWithMemTracking, Encode, Error as CodecError, MaxEncodedLen, +}; use frame_support::pallet_prelude::*; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use substrate_fixed::traits::{Fixed, ToFixed}; use subtensor_macros::freeze_struct; -#[freeze_struct("b21dcd0434b67c67")] +#[freeze_struct("40205476b6d995b2")] #[repr(transparent)] #[derive( Deserialize, @@ -18,6 +20,7 @@ use subtensor_macros::freeze_struct; Clone, Copy, Decode, + DecodeWithMemTracking, Default, Encode, Eq, diff --git a/common/src/lib.rs b/common/src/lib.rs index 44b7fb879a..8a0093f01e 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,7 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] use core::fmt::{self, Display, Formatter}; -use codec::{Compact, CompactAs, Decode, Encode, Error as CodecError, MaxEncodedLen}; +use codec::{ + Compact, CompactAs, Decode, DecodeWithMemTracking, Encode, Error as CodecError, MaxEncodedLen, +}; use frame_support::pallet_prelude::*; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; @@ -39,7 +41,7 @@ pub type Nonce = u32; /// Transfers below SMALL_TRANSFER_LIMIT are considered small transfers pub const SMALL_TRANSFER_LIMIT: Balance = 500_000_000; // 0.5 TAO -#[freeze_struct("9b6be98fb98e9b17")] +#[freeze_struct("c972489bff40ae48")] #[repr(transparent)] #[derive( Deserialize, @@ -47,6 +49,7 @@ pub const SMALL_TRANSFER_LIMIT: Balance = 500_000_000; // 0.5 TAO Clone, Copy, Decode, + DecodeWithMemTracking, Default, Encode, Eq, @@ -124,7 +127,18 @@ impl TypeInfo for NetUid { } #[derive( - Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, MaxEncodedLen, TypeInfo, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + DecodeWithMemTracking, + Debug, + MaxEncodedLen, + TypeInfo, )] pub enum ProxyType { Any, diff --git a/node/Cargo.toml b/node/Cargo.toml index 9200ab0ac7..762d000d0f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "A fresh FRAME-based Substrate node, ready for hacking." authors = ["Substrate DevHub "] homepage = "https://substrate.io/" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" @@ -24,100 +24,93 @@ log = { workspace = true } async-trait = { workspace = true } clap = { workspace = true, features = ["derive"] } futures = { workspace = true, features = ["thread-pool"] } -scale-codec = { workspace = true } serde = { workspace = true, features = ["derive"] } -hex = { workspace = true } +hex.workspace = true # Storage import -memmap2 = { workspace = true } -serde_json = { workspace = true } - -sc-cli = { workspace = true } -sp-core = { workspace = true } -sc-executor = { workspace = true } -sc-service = { workspace = true } -sc-telemetry = { workspace = true } -sc-keystore = { workspace = true } -sc-transaction-pool = { workspace = true } -sc-transaction-pool-api = { workspace = true } -sc-offchain = { workspace = true } -sc-network = { workspace = true } -sc-consensus-babe = { workspace = true } -sc-consensus-aura = { workspace = true } -sp-consensus-babe = { workspace = true } -sp-consensus = { workspace = true } -sp-consensus-slots = { workspace = true } -sp-consensus-aura = { workspace = true } -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 } -sp-application-crypto = { workspace = true } -sc-chain-spec-derive = { workspace = true } -sc-chain-spec = { workspace = true } -sc-consensus-slots = { workspace = true } -sc-consensus-epochs = { workspace = true } -sc-consensus-babe-rpc = { workspace = true, default-features = 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 } +memmap2.workspace = true +serde_json.workspace = true + +sc-cli.workspace = true +sp-core.workspace = true +sc-executor.workspace = true +sc-service.workspace = true +sc-telemetry.workspace = true +sc-keystore.workspace = true +sc-transaction-pool.workspace = true +sc-transaction-pool-api.workspace = true +sc-offchain.workspace = true +sc-network.workspace = true +sc-consensus-aura.workspace = true +sp-consensus-aura.workspace = true +sc-consensus-babe.workspace = true +sp-consensus-babe.workspace = true +sc-consensus-babe-rpc.workspace = true +sp-consensus.workspace = true +sc-consensus.workspace = true +sc-consensus-grandpa.workspace = true +sc-consensus-grandpa-rpc.workspace = true +sp-consensus-grandpa.workspace = true +sp-consensus-slots.workspace = true +sc-chain-spec-derive.workspace = true +sc-chain-spec.workspace = true +sc-consensus-slots.workspace = true +sc-client-api.workspace = true +sp-runtime.workspace = true +sp-io.workspace = true +sp-timestamp.workspace = true sp-transaction-pool = { workspace = true, features = ["default"] } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true } -sp-offchain = { workspace = true } -sp-session = { workspace = true } -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 } -cumulus-primitives-proof-size-hostfunction = { workspace = true, default-features = false } +sp-inherents.workspace = true +sp-keyring.workspace = true +sp-offchain.workspace = true +sp-session.workspace = true +frame-metadata-hash-extension.workspace = true +frame-system.workspace = true +pallet-transaction-payment.workspace = true +pallet-commitments.workspace = true +pallet-drand.workspace = true +sp-crypto-ec-utils = { workspace = true, default-features = true, features = [ + "bls12-381", +] } +sp-keystore.workspace = true +cumulus-primitives-proof-size-hostfunction.workspace = true # These dependencies are used for the subtensor's RPCs jsonrpsee = { workspace = true, features = ["server"] } -sc-rpc = { workspace = true } -sp-api = { workspace = true } -sc-rpc-api = { workspace = true } -sp-blockchain = { workspace = true } -sp-block-builder = { workspace = true } -sc-basic-authorship = { workspace = true } -substrate-frame-rpc-system = { workspace = true } -pallet-transaction-payment-rpc = { workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } +sc-rpc.workspace = true +sp-api.workspace = true +sc-rpc-api.workspace = true +sp-blockchain.workspace = true +sp-block-builder.workspace = true +sc-basic-authorship.workspace = true +substrate-frame-rpc-system.workspace = true +pallet-transaction-payment-rpc.workspace = true +frame-system-rpc-runtime-api.workspace = true +pallet-transaction-payment-rpc-runtime-api.workspace = true # These dependencies are used for runtime benchmarking -frame-benchmarking = { workspace = true } -frame-benchmarking-cli = { workspace = true } +frame-benchmarking.workspace = true +frame-benchmarking-cli.workspace = true # Needed for Frontier -sc-consensus-manual-seal = { workspace = true } -sc-network-sync = { workspace = true } -substrate-prometheus-endpoint = { workspace = true } +sc-consensus-manual-seal.workspace = true +sc-network-sync.workspace = true +substrate-prometheus-endpoint.workspace = true # Frontier -fc-storage = { workspace = true } -fc-db = { workspace = true } -fc-consensus = { workspace = true } -fc-api = { workspace = true } -fc-rpc = { workspace = true } -fc-rpc-core = { workspace = true } -fp-rpc = { workspace = true } -fc-babe = { workspace = true } -fc-aura = { workspace = true } -fc-mapping-sync = { workspace = true } -fp-consensus = { workspace = true } -thiserror = { workspace = true } -num-traits = { version = "0.2", features = ["std"] } +fc-storage.workspace = true +fc-db.workspace = true +fc-consensus.workspace = true +fc-api.workspace = true +fc-rpc = { workspace = true, features = ["rpc-binary-search-estimate"] } +fc-rpc-core.workspace = true +fp-rpc.workspace = true +fc-aura.workspace = true +fc-babe.workspace = true +fc-mapping-sync.workspace = true +fp-consensus.workspace = true +num-traits = { workspace = true, features = ["std"] } # Local Dependencies node-subtensor-runtime = { workspace = true, features = ["std"] } @@ -128,22 +121,20 @@ pallet-subtensor-swap-rpc = { workspace = true, features = ["std"] } pallet-subtensor-swap-runtime-api = { workspace = true, features = ["std"] } [build-dependencies] -substrate-build-script-utils = { workspace = true } +substrate-build-script-utils.workspace = true [features] -default = ["rocksdb", "sql", "txpool"] -fast-blocks = [ - "node-subtensor-runtime/fast-blocks", - "subtensor-runtime-common/fast-blocks" -] -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" + "frame-benchmarking-cli/rocksdb", + "sc-cli/rocksdb", ] +default = ["rocksdb", "sql", "txpool"] +fast-blocks = ["node-subtensor-runtime/fast-blocks"] +sql = ["fc-db/sql", "fc-mapping-sync/sql"] txpool = ["fc-rpc/txpool", "fc-rpc-core/txpool"] # Dependencies that are only required if runtime benchmarking should be build. @@ -154,10 +145,8 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "sc-service/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "sp-staking/runtime-benchmarks", "pallet-commitments/runtime-benchmarks", "pallet-drand/runtime-benchmarks", - "pallet-staking/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", ] pow-faucet = [] @@ -171,7 +160,6 @@ try-runtime = [ "sp-runtime/try-runtime", "pallet-commitments/try-runtime", "pallet-drand/try-runtime", - "pallet-staking/try-runtime", ] metadata-hash = ["node-subtensor-runtime/metadata-hash"] diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index 1590422c08..df21d5bef4 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -174,6 +174,6 @@ pub fn inherent_benchmark_data() -> Result { let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) - .map_err(|e| format!("creating inherent data: {:?}", e))?; + .map_err(|e| format!("creating inherent data: {e:?}"))?; Ok(inherent_data) } diff --git a/node/src/chain_spec/finney.rs b/node/src/chain_spec/finney.rs index be35c4e901..4b47c29473 100644 --- a/node/src/chain_spec/finney.rs +++ b/node/src/chain_spec/finney.rs @@ -21,7 +21,7 @@ pub fn finney_mainnet_config() -> Result { }; let old_state: ColdkeyHotkeys = - json::from_slice(&bytes).map_err(|e| format!("Error parsing genesis file: {}", e))?; + json::from_slice(&bytes).map_err(|e| format!("Error parsing genesis file: {e}"))?; let mut processed_stakes: Vec<( sp_runtime::AccountId32, diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index e8efbb1647..733f416e69 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -38,7 +38,7 @@ pub type ChainSpec = sc_service::GenericChainSpec; /// Generate a crypto pair from seed. pub fn get_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) + TPublic::Pair::from_string(&format!("//{seed}"), None) .expect("static values are valid; qed") .public() } diff --git a/node/src/command.rs b/node/src/command.rs index 8c32aeb0ad..eb261bedfa 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -137,8 +137,7 @@ pub fn run() -> sc_cli::Result<()> { } Err(err) => { return Err(format!( - "Cannot purge `{:?}` database: {:?}", - db_path, err, + "Cannot purge `{db_path:?}` database: {err:?}", ) .into()); } diff --git a/node/src/service.rs b/node/src/service.rs index 543059b948..9bf3056b54 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -163,7 +163,7 @@ pub fn new_partial( std::num::NonZeroU32::new(eth_config.frontier_sql_backend_num_ops_timeout), storage_override.clone(), )) - .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); + .unwrap_or_else(|err| panic!("failed creating sql backend: {err:?}")); FrontierBackend::Sql(Arc::new(backend)) } }; @@ -326,7 +326,7 @@ where Some(WarpSyncConfig::WithProvider(warp_sync)) }; - let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = + let (network, system_rpc_tx, tx_handler_controller, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, net_config, @@ -355,7 +355,7 @@ where log::debug!("Offchain worker key generated"); } Err(e) => { - log::error!("Failed to create SR25519 key for offchain worker: {:?}", e); + log::error!("Failed to create SR25519 key for offchain worker: {e:?}"); } } } else { @@ -530,7 +530,6 @@ where commands_stream, )?; - network_starter.start_network(); log::info!("Manual Seal Ready"); return Ok(task_manager); } @@ -616,7 +615,6 @@ where .spawn_blocking("grandpa-voter", None, grandpa_voter); } - network_starter.start_network(); Ok(task_manager) } @@ -627,7 +625,7 @@ pub async fn build_full( custom_service_signal: Option>, ) -> Result { match config.network.network_backend { - Some(sc_network::config::NetworkBackendType::Libp2p) => { + sc_network::config::NetworkBackendType::Libp2p => { new_full::, CM>( config, eth_config, @@ -636,7 +634,7 @@ pub async fn build_full( ) .await } - Some(sc_network::config::NetworkBackendType::Litep2p) => { + sc_network::config::NetworkBackendType::Litep2p => { new_full::( config, eth_config, @@ -645,16 +643,6 @@ pub async fn build_full( ) .await } - _ => { - log::debug!("no network backend selected, falling back to libp2p"); - new_full::, CM>( - config, - eth_config, - sealing, - custom_service_signal, - ) - .await - } } } diff --git a/pallets/admin-utils/Cargo.toml b/pallets/admin-utils/Cargo.toml index c0abc67ad2..61cdba4cbf 100644 --- a/pallets/admin-utils/Cargo.toml +++ b/pallets/admin-utils/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "FRAME pallet for extending admin utilities." authors = ["Bittensor Nucleus Team"] homepage = "https://bittensor.com" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" @@ -16,37 +16,35 @@ workspace = true targets = ["x86_64-unknown-linux-gnu"] [dependencies] -subtensor-macros = { workspace = true } -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", -] } +subtensor-macros.workspace = true +codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-runtime = { workspace = true } -log = { workspace = true } -pallet-subtensor = { version = "4.0.0-dev", default-features = false, path = "../subtensor" } -sp-weights = { workspace = true } -substrate-fixed = { workspace = true } -pallet-evm-chain-id = { workspace = true } -pallet-drand = { workspace = true, default-features = false } -sp-consensus-grandpa = { workspace = true } -subtensor-swap-interface = { workspace = true } -subtensor-runtime-common = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +sp-runtime.workspace = true +log.workspace = true +pallet-subtensor.workspace = true +sp-weights.workspace = true +substrate-fixed.workspace = true +pallet-evm-chain-id.workspace = true +pallet-drand.workspace = true +sp-consensus-grandpa.workspace = true +subtensor-swap-interface.workspace = true +subtensor-runtime-common.workspace = true [dev-dependencies] -sp-core = { workspace = true } -sp-io = { workspace = true } -sp-tracing = { workspace = true } -sp-consensus-aura = { workspace = true } +sp-core.workspace = true +sp-io.workspace = true +sp-tracing.workspace = true +sp-consensus-aura.workspace = true pallet-balances = { workspace = true, features = ["std"] } -pallet-scheduler = { workspace = true } -pallet-grandpa = { workspace = true } -sp-std = { workspace = true } -pallet-subtensor-swap = { workspace = true } -pallet-crowdloan = { workspace = true, default-features = false } -pallet-preimage = { workspace = true, default-features = false } +pallet-scheduler.workspace = true +pallet-grandpa.workspace = true +sp-std.workspace = true +pallet-subtensor-swap.workspace = true +pallet-crowdloan.workspace = true +pallet-preimage.workspace = true [features] default = ["std"] @@ -76,7 +74,7 @@ std = [ "sp-weights/std", "substrate-fixed/std", "subtensor-swap-interface/std", - "subtensor-runtime-common/std" + "subtensor-runtime-common/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/pallets/admin-utils/src/lib.rs b/pallets/admin-utils/src/lib.rs index 1be45caaee..ba5e155b7c 100644 --- a/pallets/admin-utils/src/lib.rs +++ b/pallets/admin-utils/src/lib.rs @@ -111,7 +111,9 @@ pub mod pallet { RevealPeriodOutOfBounds, } /// Enum for specifying the type of precompile operation. - #[derive(Encode, Decode, TypeInfo, Clone, PartialEq, Eq, Debug, Copy)] + #[derive( + Encode, Decode, DecodeWithMemTracking, TypeInfo, Clone, PartialEq, Eq, Debug, Copy, + )] pub enum PrecompileEnum { /// Enum for balance transfer precompile BalanceTransfer, @@ -170,7 +172,7 @@ pub mod pallet { T::Aura::change_authorities(new_authorities.clone()); - log::debug!("Aura authorities changed: {:?}", new_authorities); + log::debug!("Aura authorities changed: {new_authorities:?}"); // Return a successful DispatchResultWithPostInfo Ok(()) @@ -186,7 +188,7 @@ pub mod pallet { pub fn sudo_set_default_take(origin: OriginFor, default_take: u16) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_max_delegate_take(default_take); - log::debug!("DefaultTakeSet( default_take: {:?} ) ", default_take); + log::debug!("DefaultTakeSet( default_take: {default_take:?} ) "); Ok(()) } @@ -198,7 +200,7 @@ pub mod pallet { pub fn sudo_set_tx_rate_limit(origin: OriginFor, tx_rate_limit: u64) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_tx_rate_limit(tx_rate_limit); - log::debug!("TxRateLimitSet( tx_rate_limit: {:?} ) ", tx_rate_limit); + log::debug!("TxRateLimitSet( tx_rate_limit: {tx_rate_limit:?} ) "); Ok(()) } @@ -217,10 +219,7 @@ pub mod pallet { pallet_subtensor::Pallet::::ensure_subnet_owner_or_root(origin, netuid)?; pallet_subtensor::Pallet::::set_serving_rate_limit(netuid, serving_rate_limit); - log::debug!( - "ServingRateLimitSet( serving_rate_limit: {:?} ) ", - serving_rate_limit - ); + log::debug!("ServingRateLimitSet( serving_rate_limit: {serving_rate_limit:?} ) "); Ok(()) } @@ -228,7 +227,7 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the minimum difficulty. #[pallet::call_index(4)] - #[pallet::weight(Weight::from_parts(19_780_000, 0) + #[pallet::weight(Weight::from_parts(15_470_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_difficulty( @@ -244,9 +243,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_min_difficulty(netuid, min_difficulty); log::debug!( - "MinDifficultySet( netuid: {:?} min_difficulty: {:?} ) ", - netuid, - min_difficulty + "MinDifficultySet( netuid: {netuid:?} min_difficulty: {min_difficulty:?} ) " ); Ok(()) } @@ -271,9 +268,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_max_difficulty(netuid, max_difficulty); log::debug!( - "MaxDifficultySet( netuid: {:?} max_difficulty: {:?} ) ", - netuid, - max_difficulty + "MaxDifficultySet( netuid: {netuid:?} max_difficulty: {max_difficulty:?} ) " ); Ok(()) } @@ -321,9 +316,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_weights_version_key(netuid, weights_version_key); log::debug!( - "WeightsVersionKeySet( netuid: {:?} weights_version_key: {:?} ) ", - netuid, - weights_version_key + "WeightsVersionKeySet( netuid: {netuid:?} weights_version_key: {weights_version_key:?} ) " ); Ok(()) } @@ -351,9 +344,7 @@ pub mod pallet { weights_set_rate_limit, ); log::debug!( - "WeightsSetRateLimitSet( netuid: {:?} weights_set_rate_limit: {:?} ) ", - netuid, - weights_set_rate_limit + "WeightsSetRateLimitSet( netuid: {netuid:?} weights_set_rate_limit: {weights_set_rate_limit:?} ) " ); Ok(()) } @@ -378,9 +369,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_adjustment_interval(netuid, adjustment_interval); log::debug!( - "AdjustmentIntervalSet( netuid: {:?} adjustment_interval: {:?} ) ", - netuid, - adjustment_interval + "AdjustmentIntervalSet( netuid: {netuid:?} adjustment_interval: {adjustment_interval:?} ) " ); Ok(()) } @@ -408,10 +397,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_adjustment_alpha(netuid, adjustment_alpha); - log::debug!( - "AdjustmentAlphaSet( adjustment_alpha: {:?} ) ", - adjustment_alpha - ); + log::debug!("AdjustmentAlphaSet( adjustment_alpha: {adjustment_alpha:?} ) "); Ok(()) } @@ -435,9 +421,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_max_weight_limit(netuid, max_weight_limit); log::debug!( - "MaxWeightLimitSet( netuid: {:?} max_weight_limit: {:?} ) ", - netuid, - max_weight_limit + "MaxWeightLimitSet( netuid: {netuid:?} max_weight_limit: {max_weight_limit:?} ) " ); Ok(()) } @@ -446,7 +430,7 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the immunity period. #[pallet::call_index(13)] - #[pallet::weight(Weight::from_parts(19_380_000, 0) + #[pallet::weight(Weight::from_parts(15_240_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_immunity_period( @@ -462,9 +446,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_immunity_period(netuid, immunity_period); log::debug!( - "ImmunityPeriodSet( netuid: {:?} immunity_period: {:?} ) ", - netuid, - immunity_period + "ImmunityPeriodSet( netuid: {netuid:?} immunity_period: {immunity_period:?} ) " ); Ok(()) } @@ -473,7 +455,7 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the minimum allowed weights. #[pallet::call_index(14)] - #[pallet::weight(Weight::from_parts(19_770_000, 0) + #[pallet::weight(Weight::from_parts(15_110_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_allowed_weights( @@ -489,9 +471,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_min_allowed_weights(netuid, min_allowed_weights); log::debug!( - "MinAllowedWeightSet( netuid: {:?} min_allowed_weights: {:?} ) ", - netuid, - min_allowed_weights + "MinAllowedWeightSet( netuid: {netuid:?} min_allowed_weights: {min_allowed_weights:?} ) " ); Ok(()) } @@ -519,9 +499,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_max_allowed_uids(netuid, max_allowed_uids); log::debug!( - "MaxAllowedUidsSet( netuid: {:?} max_allowed_uids: {:?} ) ", - netuid, - max_allowed_uids + "MaxAllowedUidsSet( netuid: {netuid:?} max_allowed_uids: {max_allowed_uids:?} ) " ); Ok(()) } @@ -541,7 +519,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_kappa(netuid, kappa); - log::debug!("KappaSet( netuid: {:?} kappa: {:?} ) ", netuid, kappa); + log::debug!("KappaSet( netuid: {netuid:?} kappa: {kappa:?} ) "); Ok(()) } @@ -560,7 +538,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_rho(netuid, rho); - log::debug!("RhoSet( netuid: {:?} rho: {:?} ) ", netuid, rho); + log::debug!("RhoSet( netuid: {netuid:?} rho: {rho:?} ) "); Ok(()) } @@ -568,7 +546,7 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the activity cutoff. #[pallet::call_index(18)] - #[pallet::weight(Weight::from_parts(22_600_000, 0) + #[pallet::weight(Weight::from_parts(17_720_000, 0) .saturating_add(::DbWeight::get().reads(2_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_activity_cutoff( @@ -590,9 +568,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_activity_cutoff(netuid, activity_cutoff); log::debug!( - "ActivityCutoffSet( netuid: {:?} activity_cutoff: {:?} ) ", - netuid, - activity_cutoff + "ActivityCutoffSet( netuid: {netuid:?} activity_cutoff: {activity_cutoff:?} ) " ); Ok(()) } @@ -619,8 +595,7 @@ pub mod pallet { registration_allowed, ); log::debug!( - "NetworkRegistrationAllowed( registration_allowed: {:?} ) ", - registration_allowed + "NetworkRegistrationAllowed( registration_allowed: {registration_allowed:?} ) " ); Ok(()) } @@ -647,8 +622,7 @@ pub mod pallet { registration_allowed, ); log::debug!( - "NetworkPowRegistrationAllowed( registration_allowed: {:?} ) ", - registration_allowed + "NetworkPowRegistrationAllowed( registration_allowed: {registration_allowed:?} ) " ); Ok(()) } @@ -676,9 +650,7 @@ pub mod pallet { target_registrations_per_interval, ); log::debug!( - "RegistrationPerIntervalSet( netuid: {:?} target_registrations_per_interval: {:?} ) ", - netuid, - target_registrations_per_interval + "RegistrationPerIntervalSet( netuid: {netuid:?} target_registrations_per_interval: {target_registrations_per_interval:?} ) " ); Ok(()) } @@ -687,7 +659,7 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the minimum burn. #[pallet::call_index(22)] - #[pallet::weight(Weight::from_parts(19_840_000, 0) + #[pallet::weight(Weight::from_parts(15_330_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_min_burn( @@ -702,11 +674,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_min_burn(netuid, min_burn); - log::debug!( - "MinBurnSet( netuid: {:?} min_burn: {:?} ) ", - netuid, - min_burn - ); + log::debug!("MinBurnSet( netuid: {netuid:?} min_burn: {min_burn:?} ) "); Ok(()) } @@ -729,11 +697,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_max_burn(netuid, max_burn); - log::debug!( - "MaxBurnSet( netuid: {:?} max_burn: {:?} ) ", - netuid, - max_burn - ); + log::debug!("MaxBurnSet( netuid: {netuid:?} max_burn: {max_burn:?} ) "); Ok(()) } @@ -755,11 +719,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_difficulty(netuid, difficulty); - log::debug!( - "DifficultySet( netuid: {:?} difficulty: {:?} ) ", - netuid, - difficulty - ); + log::debug!("DifficultySet( netuid: {netuid:?} difficulty: {difficulty:?} ) "); Ok(()) } @@ -767,7 +727,7 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the maximum allowed validators. #[pallet::call_index(25)] - #[pallet::weight(Weight::from_parts(25_210_000, 0) + #[pallet::weight(Weight::from_parts(19_710_000, 0) .saturating_add(::DbWeight::get().reads(2_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_allowed_validators( @@ -791,9 +751,7 @@ pub mod pallet { max_allowed_validators, ); log::debug!( - "MaxAllowedValidatorsSet( netuid: {:?} max_allowed_validators: {:?} ) ", - netuid, - max_allowed_validators + "MaxAllowedValidatorsSet( netuid: {netuid:?} max_allowed_validators: {max_allowed_validators:?} ) " ); Ok(()) } @@ -825,9 +783,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_bonds_moving_average(netuid, bonds_moving_average); log::debug!( - "BondsMovingAverageSet( netuid: {:?} bonds_moving_average: {:?} ) ", - netuid, - bonds_moving_average + "BondsMovingAverageSet( netuid: {netuid:?} bonds_moving_average: {bonds_moving_average:?} ) " ); Ok(()) } @@ -836,7 +792,7 @@ pub mod pallet { /// It is only callable by the root account or subnet owner. /// The extrinsic will call the Subtensor pallet to set the bonds penalty. #[pallet::call_index(60)] - #[pallet::weight(Weight::from_parts(20_030_000, 0) + #[pallet::weight(Weight::from_parts(15_490_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_bonds_penalty( @@ -851,11 +807,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_bonds_penalty(netuid, bonds_penalty); - log::debug!( - "BondsPenalty( netuid: {:?} bonds_penalty: {:?} ) ", - netuid, - bonds_penalty - ); + log::debug!("BondsPenalty( netuid: {netuid:?} bonds_penalty: {bonds_penalty:?} ) "); Ok(()) } @@ -863,7 +815,7 @@ pub mod pallet { /// It is only callable by the root account. /// The extrinsic will call the Subtensor pallet to set the maximum registrations per block. #[pallet::call_index(27)] - #[pallet::weight(Weight::from_parts(19_680_000, 0) + #[pallet::weight(Weight::from_parts(15_520_000, 0) .saturating_add(::DbWeight::get().reads(1_u64)) .saturating_add(::DbWeight::get().writes(1_u64)))] pub fn sudo_set_max_registrations_per_block( @@ -882,9 +834,7 @@ pub mod pallet { max_registrations_per_block, ); log::debug!( - "MaxRegistrationsPerBlock( netuid: {:?} max_registrations_per_block: {:?} ) ", - netuid, - max_registrations_per_block + "MaxRegistrationsPerBlock( netuid: {netuid:?} max_registrations_per_block: {max_registrations_per_block:?} ) " ); Ok(()) } @@ -905,10 +855,7 @@ pub mod pallet { ) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_subnet_owner_cut(subnet_owner_cut); - log::debug!( - "SubnetOwnerCut( subnet_owner_cut: {:?} ) ", - subnet_owner_cut - ); + log::debug!("SubnetOwnerCut( subnet_owner_cut: {subnet_owner_cut:?} ) "); Ok(()) } @@ -928,7 +875,7 @@ pub mod pallet { ) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_network_rate_limit(rate_limit); - log::debug!("NetworkRateLimit( rate_limit: {:?} ) ", rate_limit); + log::debug!("NetworkRateLimit( rate_limit: {rate_limit:?} ) "); Ok(()) } @@ -946,7 +893,7 @@ pub mod pallet { Error::::SubnetDoesNotExist ); pallet_subtensor::Pallet::::set_tempo(netuid, tempo); - log::debug!("TempoSet( netuid: {:?} tempo: {:?} ) ", netuid, tempo); + log::debug!("TempoSet( netuid: {netuid:?} tempo: {tempo:?} ) "); Ok(()) } @@ -984,7 +931,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_network_immunity_period(immunity_period); - log::debug!("NetworkImmunityPeriod( period: {:?} ) ", immunity_period); + log::debug!("NetworkImmunityPeriod( period: {immunity_period:?} ) "); Ok(()) } @@ -1007,7 +954,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_network_min_lock(lock_cost); - log::debug!("NetworkMinLockCost( lock_cost: {:?} ) ", lock_cost); + log::debug!("NetworkMinLockCost( lock_cost: {lock_cost:?} ) "); Ok(()) } @@ -1045,7 +992,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_lock_reduction_interval(interval); - log::debug!("NetworkLockReductionInterval( interval: {:?} ) ", interval); + log::debug!("NetworkLockReductionInterval( interval: {interval:?} ) "); Ok(()) } @@ -1092,7 +1039,7 @@ pub mod pallet { ) -> DispatchResult { ensure_root(origin)?; let prev_min_stake = pallet_subtensor::Pallet::::get_nominator_min_required_stake(); - log::trace!("Setting minimum stake to: {}", min_stake); + log::trace!("Setting minimum stake to: {min_stake}"); pallet_subtensor::Pallet::::set_nominator_min_required_stake(min_stake); if min_stake > prev_min_stake { log::trace!("Clearing small nominations if possible"); @@ -1114,8 +1061,7 @@ pub mod pallet { ensure_root(origin)?; pallet_subtensor::Pallet::::set_tx_delegate_take_rate_limit(tx_rate_limit); log::debug!( - "TxRateLimitDelegateTakeSet( tx_delegate_take_rate_limit: {:?} ) ", - tx_rate_limit + "TxRateLimitDelegateTakeSet( tx_delegate_take_rate_limit: {tx_rate_limit:?} ) " ); Ok(()) } @@ -1128,7 +1074,7 @@ pub mod pallet { pub fn sudo_set_min_delegate_take(origin: OriginFor, take: u16) -> DispatchResult { ensure_root(origin)?; pallet_subtensor::Pallet::::set_min_delegate_take(take); - log::debug!("TxMinDelegateTakeSet( tx_min_delegate_take: {:?} ) ", take); + log::debug!("TxMinDelegateTakeSet( tx_min_delegate_take: {take:?} ) "); Ok(()) } @@ -1172,7 +1118,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_commit_reveal_weights_enabled(netuid, enabled); - log::debug!("ToggleSetWeightsCommitReveal( netuid: {:?} ) ", netuid); + log::debug!("ToggleSetWeightsCommitReveal( netuid: {netuid:?} ) "); Ok(()) } @@ -1194,11 +1140,7 @@ pub mod pallet { ) -> DispatchResult { pallet_subtensor::Pallet::::ensure_subnet_owner_or_root(origin, netuid)?; pallet_subtensor::Pallet::::set_liquid_alpha_enabled(netuid, enabled); - log::debug!( - "LiquidAlphaEnableToggled( netuid: {:?}, Enabled: {:?} ) ", - netuid, - enabled - ); + log::debug!("LiquidAlphaEnableToggled( netuid: {netuid:?}, Enabled: {enabled:?} ) "); Ok(()) } @@ -1300,7 +1242,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_coldkey_swap_schedule_duration(duration); // Log the change - log::trace!("ColdkeySwapScheduleDurationSet( duration: {:?} )", duration); + log::trace!("ColdkeySwapScheduleDurationSet( duration: {duration:?} )"); Ok(()) } @@ -1332,10 +1274,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_dissolve_network_schedule_duration(duration); // Log the change - log::trace!( - "DissolveNetworkScheduleDurationSet( duration: {:?} )", - duration - ); + log::trace!("DissolveNetworkScheduleDurationSet( duration: {duration:?} )"); Ok(()) } @@ -1379,11 +1318,7 @@ pub mod pallet { ); pallet_subtensor::Pallet::::set_reveal_period(netuid, interval); - log::debug!( - "SetWeightCommitInterval( netuid: {:?}, interval: {:?} ) ", - netuid, - interval - ); + log::debug!("SetWeightCommitInterval( netuid: {netuid:?}, interval: {interval:?} ) "); Ok(()) } @@ -1507,7 +1442,7 @@ pub mod pallet { ensure_root(origin)?; pallet_subtensor::SubnetMovingAlpha::::set(alpha); - log::debug!("SubnetMovingAlphaSet( alpha: {:?} )", alpha); + log::debug!("SubnetMovingAlphaSet( alpha: {alpha:?} )"); Ok(()) } @@ -1533,11 +1468,7 @@ pub mod pallet { pallet_subtensor::Pallet::::ensure_subnet_owner(origin.clone(), netuid)?; pallet_subtensor::Pallet::::set_subnet_owner_hotkey(netuid, &hotkey); - log::debug!( - "SubnetOwnerHotkeySet( netuid: {:?}, hotkey: {:?} )", - netuid, - hotkey - ); + log::debug!("SubnetOwnerHotkeySet( netuid: {netuid:?}, hotkey: {hotkey:?} )"); Ok(()) } @@ -1563,9 +1494,7 @@ pub mod pallet { pallet_subtensor::EMAPriceHalvingBlocks::::set(netuid, ema_halving); log::debug!( - "EMAPriceHalvingBlocks( netuid: {:?}, ema_halving: {:?} )", - netuid, - ema_halving + "EMAPriceHalvingBlocks( netuid: {netuid:?}, ema_halving: {ema_halving:?} )" ); Ok(()) } @@ -1607,11 +1536,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_alpha_sigmoid_steepness(netuid, steepness); - log::debug!( - "AlphaSigmoidSteepnessSet( netuid: {:?}, steepness: {:?} )", - netuid, - steepness - ); + log::debug!("AlphaSigmoidSteepnessSet( netuid: {netuid:?}, steepness: {steepness:?} )"); Ok(()) } @@ -1635,11 +1560,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_yuma3_enabled(netuid, enabled); Self::deposit_event(Event::Yuma3EnableToggled { netuid, enabled }); - log::debug!( - "Yuma3EnableToggled( netuid: {:?}, Enabled: {:?} ) ", - netuid, - enabled - ); + log::debug!("Yuma3EnableToggled( netuid: {netuid:?}, Enabled: {enabled:?} ) "); Ok(()) } @@ -1663,11 +1584,7 @@ pub mod pallet { pallet_subtensor::Pallet::::set_bonds_reset(netuid, enabled); Self::deposit_event(Event::BondsResetToggled { netuid, enabled }); - log::debug!( - "BondsResetToggled( netuid: {:?} bonds_reset: {:?} ) ", - netuid, - enabled - ); + log::debug!("BondsResetToggled( netuid: {netuid:?} bonds_reset: {enabled:?} ) "); Ok(()) } @@ -1734,9 +1651,7 @@ pub mod pallet { pallet_subtensor::SubtokenEnabled::::set(netuid, subtoken_enabled); log::debug!( - "SubtokenEnabled( netuid: {:?}, subtoken_enabled: {:?} )", - netuid, - subtoken_enabled + "SubtokenEnabled( netuid: {netuid:?}, subtoken_enabled: {subtoken_enabled:?} )" ); Ok(()) } diff --git a/pallets/admin-utils/src/tests/mock.rs b/pallets/admin-utils/src/tests/mock.rs index 8ab39e50cf..35934bc846 100644 --- a/pallets/admin-utils/src/tests/mock.rs +++ b/pallets/admin-utils/src/tests/mock.rs @@ -387,6 +387,7 @@ impl pallet_scheduler::Config for Test { type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type OriginPrivilegeCmp = OriginPrivilegeCmp; type Preimages = (); + type BlockNumberProvider = System; } impl pallet_evm_chain_id::Config for Test {} @@ -516,10 +517,7 @@ pub fn register_ok_neuron( ); assert_ok!(result); log::info!( - "Register ok neuron: netuid: {:?}, coldkey: {:?}, hotkey: {:?}", - netuid, - hotkey_account_id, - coldkey_account_id + "Register ok neuron: netuid: {netuid:?}, coldkey: {hotkey_account_id:?}, hotkey: {coldkey_account_id:?}" ); } diff --git a/pallets/admin-utils/src/tests/mod.rs b/pallets/admin-utils/src/tests/mod.rs index 51f2f7364c..f6495524ee 100644 --- a/pallets/admin-utils/src/tests/mod.rs +++ b/pallets/admin-utils/src/tests/mod.rs @@ -1268,11 +1268,7 @@ fn test_sudo_get_set_alpha() { let (grabbed_alpha_low, grabbed_alpha_high): (u16, u16) = SubtensorModule::get_alpha_values(netuid); - log::info!( - "alpha_low: {:?} alpha_high: {:?}", - grabbed_alpha_low, - grabbed_alpha_high - ); + log::info!("alpha_low: {grabbed_alpha_low:?} alpha_high: {grabbed_alpha_high:?}"); assert_eq!(grabbed_alpha_low, alpha_low); assert_eq!(grabbed_alpha_high, alpha_high); diff --git a/pallets/collective/Cargo.toml b/pallets/collective/Cargo.toml index 11ab2a9cb3..015d6ab709 100644 --- a/pallets/collective/Cargo.toml +++ b/pallets/collective/Cargo.toml @@ -2,7 +2,7 @@ name = "pallet-collective" version = "4.0.0-dev" authors = ["Parity Technologies , Opentensor Technologies"] -edition = "2024" +edition.workspace = true license = "Apache-2.0" homepage = "https://bittensor.com" repository = "https://github.com/opentensor/subtensor" @@ -17,18 +17,16 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] subtensor-macros.workspace = true -codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [ - "derive", -] } -log = { workspace = true } +codec = { workspace = true, features = ["derive"] } +log.workspace = true scale-info = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-core = { workspace = true } -sp-io = { workspace = true } -sp-runtime = { workspace = true } -sp-std = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +sp-core.workspace = true +sp-io.workspace = true +sp-runtime.workspace = true +sp-std.workspace = true [features] default = ["std"] @@ -53,5 +51,5 @@ runtime-benchmarks = [ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", - "sp-runtime/try-runtime" + "sp-runtime/try-runtime", ] diff --git a/pallets/collective/src/lib.rs b/pallets/collective/src/lib.rs index baea090307..fe0925b8ff 100644 --- a/pallets/collective/src/lib.rs +++ b/pallets/collective/src/lib.rs @@ -51,6 +51,7 @@ use frame_support::{ }, weights::Weight, }; +use codec::DecodeWithMemTracking; use scale_info::TypeInfo; use sp_io::storage; use sp_runtime::traits::Dispatchable; @@ -126,7 +127,17 @@ impl DefaultVote for MoreThanMajorityThenPrimeDefaultVote { } /// Origin for the collective module. -#[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] +#[derive( + PartialEq, + Eq, + Clone, + RuntimeDebug, + Encode, + Decode, + DecodeWithMemTracking, + TypeInfo, + MaxEncodedLen, +)] #[scale_info(skip_type_params(I))] #[codec(mel_bound(AccountId: MaxEncodedLen))] pub enum RawOrigin { diff --git a/pallets/commitments/Cargo.toml b/pallets/commitments/Cargo.toml index efc1a216db..bedc0d945c 100644 --- a/pallets/commitments/Cargo.toml +++ b/pallets/commitments/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "Add the ability to commit generic hashed data for network participants." authors = ["Bittensor Nucleus Team"] homepage = "https://bittensor.com" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" @@ -17,35 +17,32 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] subtensor-macros.workspace = true -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", - "max-encoded-len", -] } +codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-runtime = { workspace = true } -sp-std = { workspace = true } -enumflags2 = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +sp-runtime.workspace = true +sp-std.workspace = true +enumflags2.workspace = true -pallet-drand = { path = "../drand", default-features = false } -tle = { workspace = true, default-features = false } -ark-serialize = { workspace = true, default-features = false } -w3f-bls = { workspace = true, default-features = false } -rand_chacha = { workspace = true } -hex = { workspace = true } -sha2 = { workspace = true } +pallet-drand.workspace = true +tle.workspace = true +ark-serialize = { workspace = true, features = ["derive"] } +w3f-bls.workspace = true +rand_chacha.workspace = true +hex.workspace = true +sha2.workspace = true -log = { workspace = true } +log.workspace = true -pallet-subtensor = { path = "../subtensor", default-features = false } -subtensor-runtime-common = { workspace = true } +pallet-subtensor.workspace = true +subtensor-runtime-common.workspace = true [dev-dependencies] -sp-core = { workspace = true } -sp-io = { workspace = true } -pallet-balances = { workspace = true } +sp-core.workspace = true +sp-io.workspace = true +pallet-balances.workspace = true [features] default = ["std"] @@ -79,7 +76,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-drand/runtime-benchmarks", - "pallet-subtensor/runtime-benchmarks" + "pallet-subtensor/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", @@ -87,5 +84,5 @@ try-runtime = [ "pallet-balances/try-runtime", "sp-runtime/try-runtime", "pallet-drand/try-runtime", - "pallet-subtensor/try-runtime" + "pallet-subtensor/try-runtime", ] diff --git a/pallets/commitments/src/lib.rs b/pallets/commitments/src/lib.rs index c42d7a3413..7050662a02 100644 --- a/pallets/commitments/src/lib.rs +++ b/pallets/commitments/src/lib.rs @@ -360,11 +360,7 @@ pub mod pallet { impl Hooks> for Pallet { fn on_initialize(n: BlockNumberFor) -> Weight { if let Err(e) = Self::reveal_timelocked_commitments() { - log::debug!( - "Failed to unveil matured commitments on block {:?}: {:?}", - n, - e - ); + log::debug!("Failed to unveil matured commitments on block {n:?}: {e:?}"); } Weight::from_parts(0, 0) } @@ -445,9 +441,7 @@ impl Pallet { ) .map_err(|e| { log::warn!( - "Failed to deserialize drand signature for {:?}: {:?}", - who, - e + "Failed to deserialize drand signature for {who:?}: {e:?}" ) }) .ok(); @@ -460,11 +454,7 @@ impl Pallet { let reader = &mut &encrypted[..]; let commit = TLECiphertext::::deserialize_compressed(reader) .map_err(|e| { - log::warn!( - "Failed to deserialize TLECiphertext for {:?}: {:?}", - who, - e - ) + log::warn!("Failed to deserialize TLECiphertext for {who:?}: {e:?}") }) .ok(); @@ -476,13 +466,13 @@ impl Pallet { let decrypted_bytes: Vec = tld::(commit, sig) .map_err(|e| { - log::warn!("Failed to decrypt timelock for {:?}: {:?}", who, e) + log::warn!("Failed to decrypt timelock for {who:?}: {e:?}") }) .ok() .unwrap_or_default(); if decrypted_bytes.is_empty() { - log::warn!("Bytes were decrypted for {:?} but they are empty", who); + log::warn!("Bytes were decrypted for {who:?} but they are empty"); continue; } diff --git a/pallets/commitments/src/tests.rs b/pallets/commitments/src/tests.rs index 431d5e521b..6866ebdeec 100644 --- a/pallets/commitments/src/tests.rs +++ b/pallets/commitments/src/tests.rs @@ -43,7 +43,7 @@ fn manual_data_type_info() { .variants .iter() .find(|v| v.name == variant_name) - .unwrap_or_else(|| panic!("Expected to find variant {}", variant_name)); + .unwrap_or_else(|| panic!("Expected to find variant {variant_name}")); let encoded = data.encode(); assert_eq!(encoded[0], variant.index); @@ -72,15 +72,13 @@ fn manual_data_type_info() { assert_eq!( encoded.len() as u32 - 1, // Subtract variant byte expected_len, - "Encoded length mismatch for variant {}", - variant_name + "Encoded length mismatch for variant {variant_name}" ); } else { assert_eq!( encoded.len() as u32 - 1, 0, - "Expected no fields for {}", - variant_name + "Expected no fields for {variant_name}" ); } } else { @@ -1551,7 +1549,7 @@ fn revealed_commitments_keeps_only_10_items() { let mut fields = Vec::with_capacity(TOTAL_TLES); for i in 0..TOTAL_TLES { - let plaintext = format!("TLE #{}", i).into_bytes(); + let plaintext = format!("TLE #{i}").into_bytes(); let ciphertext = produce_ciphertext(&plaintext, reveal_round); let timelock = Data::TimelockEncrypted { encrypted: ciphertext, @@ -1594,7 +1592,7 @@ fn revealed_commitments_keeps_only_10_items() { // We expect them to be TLE #2..TLE #11 let expected_index = idx + 2; // since we dropped #0 and #1 - let expected_str = format!("TLE #{}", expected_index); + let expected_str = format!("TLE #{expected_index}"); assert_eq!(revealed_str, expected_str, "Check which TLE is kept"); // Also check it was revealed at block 2 @@ -1619,7 +1617,7 @@ fn revealed_commitments_keeps_only_10_newest_with_individual_single_field_commit for i in 0..12 { System::::set_block_number(i as u64 + 1); - let plaintext = format!("TLE #{}", i).into_bytes(); + let plaintext = format!("TLE #{i}").into_bytes(); let ciphertext = produce_ciphertext(&plaintext, reveal_round); let new_timelock = Data::TimelockEncrypted { @@ -1644,8 +1642,7 @@ fn revealed_commitments_keeps_only_10_newest_with_individual_single_field_commit assert_eq!( revealed.len(), expected_count, - "At iteration {}, we keep at most 10 reveals", - i + "At iteration {i}, we keep at most 10 reveals" ); } @@ -1662,19 +1659,17 @@ fn revealed_commitments_keeps_only_10_newest_with_individual_single_field_commit let revealed_str = sp_std::str::from_utf8(revealed_bytes).expect("Should be valid UTF-8"); let expected_i = idx + 2; // i=0 => "TLE #2", i=1 => "TLE #3", etc. - let expected_str = format!("TLE #{}", expected_i); + let expected_str = format!("TLE #{expected_i}"); assert_eq!( revealed_str, expected_str, - "Revealed data #{} should match the truncated TLE #{}", - idx, expected_i + "Revealed data #{idx} should match the truncated TLE #{expected_i}" ); let expected_reveal_block = expected_i as u64 + 1; assert_eq!( *reveal_block, expected_reveal_block, - "Check which block TLE #{} was revealed in", - expected_i + "Check which block TLE #{expected_i} was revealed in" ); } }); diff --git a/pallets/commitments/src/types.rs b/pallets/commitments/src/types.rs index 543eb08cd1..0467fee8f3 100644 --- a/pallets/commitments/src/types.rs +++ b/pallets/commitments/src/types.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use codec::{Codec, Decode, Encode, MaxEncodedLen}; +use codec::{Codec, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::{ BoundedVec, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, traits::{ConstU32, Get}, @@ -38,7 +38,7 @@ use subtensor_macros::freeze_struct; /// - A timelock-encrypted blob with a reveal round /// - A reset flag (`ResetBondsFlag`) /// Can also be `None`. -#[derive(Clone, Eq, PartialEq, RuntimeDebug, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, RuntimeDebug, DecodeWithMemTracking, MaxEncodedLen)] pub enum Data { /// No data here. None, @@ -362,9 +362,17 @@ impl Default for Data { } } -#[freeze_struct("25c84048dcc90813")] +#[freeze_struct("5ca4adbb4d2a2b20")] #[derive( - CloneNoBound, Encode, Decode, Eq, MaxEncodedLen, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, + CloneNoBound, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + MaxEncodedLen, + PartialEqNoBound, + RuntimeDebugNoBound, + TypeInfo, )] #[codec(mel_bound())] #[derive(frame_support::DefaultNoBound)] diff --git a/pallets/crowdloan/Cargo.toml b/pallets/crowdloan/Cargo.toml index e8d582fa44..dcde4504f4 100644 --- a/pallets/crowdloan/Cargo.toml +++ b/pallets/crowdloan/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pallet-crowdloan" version = "0.1.0" -edition = "2024" +edition.workspace = true authors = ["Bittensor Nucleus Team"] license = "Apache-2.0" homepage = "https://bittensor.com" @@ -21,13 +21,13 @@ frame-support.workspace = true frame-system.workspace = true sp-runtime.workspace = true sp-std.workspace = true -log = { workspace = true } +log.workspace = true [dev-dependencies] -pallet-balances = { default-features = true, workspace = true } -pallet-preimage = { default-features = true, workspace = true } -sp-core = { default-features = true, workspace = true } -sp-io = { default-features = true, workspace = true } +pallet-balances = { workspace = true, default-features = true } +pallet-preimage = { workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } +sp-io = { workspace = true, default-features = true } [features] default = ["std"] diff --git a/pallets/crowdloan/README.md b/pallets/crowdloan/README.md index 3d67fee33a..9977c782c3 100644 --- a/pallets/crowdloan/README.md +++ b/pallets/crowdloan/README.md @@ -1,5 +1,7 @@ # Crowdloan Pallet +## Overview + A pallet that enables the creation and management of generic crowdloans for transferring funds and executing an arbitrary call. Users of this pallet can create a crowdloan by providing a deposit, a cap, an end block, an optional target address and an optional call. @@ -10,10 +12,38 @@ Once the crowdloan is finalized, the funds will be transferred to the target add If the crowdloan fails to reach the cap, the creator can decide to refund all contributors and dissolve the crowdloan. The initial deposit will be refunded. -## Overview +*The call or target address provided when creating the crowdloan is guaranteed to never change. Only the minimum contribution, end block and cap can be updated from the crowdloan creator.* ## Interface -## Dispatchable Functions +- `create`: Create a crowdloan that will raise funds up to a maximum cap and if successful, will transfer funds to the target address if provided and/or dispatch the call (using creator origin). The initial deposit will be transfered to the crowdloan account and will be refunded in case the crowdloan fails to raise the cap. Additionally, the creator will pay for the execution of the call. + +- `contribute`: Contribute to an active crowdloan. The contribution will be transfered to the crowdloan account and will be refunded if the crowdloan fails to raise the cap. If the contribution would raise the amount above the cap, the contribution will be set to the amount that is left to be raised. + +- `withdraw`: Withdraw a contribution from an active (not yet finalized or dissolved) crowdloan. Only contributions over the deposit can be withdrawn by the creator. + +- `refund`: Try to refund all contributors (excluding the creator) up to the limit defined by a runtime parameter *RefundContributorsLimit* (currently set to 5). If the limit is reached, the call will stop and the crowdloan will be marked as partially refunded. It may be needed to dispatch this call multiple times to refund all contributors. + +The following functions are only callable by the creator of the crowdloan: + +- `finalize`: Finalize a successful crowdloan. The call will transfer the raised amount to the target address if it was provided when the crowdloan was created and dispatch the call that was provided using the creator origin. + +- `dissolve`: Dissolve a crowdloan. The crowdloan will be removed from the storage. All contributions must have been refunded before the crowdloan can be dissolved (except the creator's one). + +- `update_min_contribution`: Update the minimum contribution of a non-finalized crowdloan. + +- `update_end`: Update the end block of a non-finalized crowdloan. + +- `update_cap`: Update the cap of a non-finalized crowdloan. + +## Integration with subnet leasing (from the subtensor pallet) + +The `crowdloan` pallet can be used to create a crowdloan that will be used to register a new leased network through a crowdloan using the `register_leased_network` extrinsic from the `subtensor` pallet as a call parameter to the crowdloan pallet `create` extrinsic. A new subnet will be registered paying the lock cost using the crowdloan funds and a proxy will be created for the beneficiary to operate the subnet. + +When active, the lease will distribute dividends to the contributors according to their contribution to the crowdloan and the lease can be operated by the beneficiary using the proxy created `SubnetLeaseBeneficiary`. + +If the lease is perpetual, the lease will never be terminated and emissions will continue to be distributed to the contributors. + +If the lease has an end block, the lease can be terminated when end block has passed and the subnet ownership will be transferred to the beneficiary. License: Apache-2.0 diff --git a/pallets/crowdloan/src/mock.rs b/pallets/crowdloan/src/mock.rs index 78cf15717c..7f4281b538 100644 --- a/pallets/crowdloan/src/mock.rs +++ b/pallets/crowdloan/src/mock.rs @@ -38,6 +38,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { (U256::from(4), 10), (U256::from(5), 3), ], + dev_accounts: None, } .assimilate_storage(&mut t) .expect("Expected to not panic"); @@ -242,6 +243,7 @@ impl TestState { .iter() .map(|(who, balance)| (*who, *balance)) .collect::>(), + dev_accounts: None, } .assimilate_storage(&mut t) .unwrap(); diff --git a/pallets/drand/Cargo.toml b/pallets/drand/Cargo.toml index 3f4b5e4c33..c6a0705627 100644 --- a/pallets/drand/Cargo.toml +++ b/pallets/drand/Cargo.toml @@ -4,7 +4,7 @@ description = "FRAME pallet for briding to drand." authors = ["Tony Riemer "] version = "0.0.1" license = "MIT-0" -edition = "2024" +edition.workspace = true homepage = "https://www.idealabs.network" publish = false @@ -12,44 +12,40 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { workspace = true, default-features = false, features = [ - "derive", -] } -scale-info = { workspace = true, default-features = false, features = [ - "derive", -] } -serde = { workspace = true, features = ["derive"], default-features = false } -serde_json = { workspace = true, default-features = false } -log = { workspace = true, default-features = false } -hex = { workspace = true, features = ["serde"], default-features = false } -sha2 = { workspace = true } -anyhow = { workspace = true } +codec = { workspace = true, features = ["derive"] } +scale-info = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = ["derive"] } +serde_json.workspace = true +log.workspace = true +hex = { workspace = true, features = ["serde"] } +sha2.workspace = true +anyhow.workspace = true # frame deps -frame-benchmarking = { workspace = true, default-features = false, optional = true } -frame-support = { workspace = true, default-features = false } -frame-system = { workspace = true, default-features = false } -sp-core = { workspace = true, default-features = false } -sp-io = { workspace = true, default-features = false} -sp-runtime = { workspace = true, default-features = false} +frame-benchmarking = { workspace = true, optional = true } +frame-support.workspace = true +frame-system.workspace = true +sp-core.workspace = true +sp-io.workspace = true +sp-runtime.workspace = true # arkworks dependencies -sp-ark-bls12-381 = { workspace = true, default-features = false } -ark-bls12-381 = { workspace = true, features = ["curve"], default-features = false } -ark-serialize = { workspace = true, features = [ "derive" ], default-features = false } -ark-ff = { workspace = true, default-features = false } -ark-ec = { workspace = true, default-features = false } -ark-std = { workspace = true, default-features = false } -ark-crypto-primitives = { workspace = true, default-features = false, features = [ "r1cs", "snark" ] } -ark-scale = { workspace = true, default-features = false, features = ["hazmat"] } -w3f-bls = { workspace = true, default-features = false } -sp-keyring = { workspace = true, default-features = false } +sp-ark-bls12-381.workspace = true +ark-bls12-381 = { workspace = true, features = ["curve"] } +ark-serialize = { workspace = true, features = ["derive"] } +ark-ff.workspace = true +ark-ec.workspace = true +ark-std.workspace = true +ark-crypto-primitives = { workspace = true, features = ["r1cs", "snark"] } +ark-scale = { workspace = true, features = ["hazmat"] } +w3f-bls.workspace = true +sp-keyring.workspace = true subtensor-macros.workspace = true -tle = { workspace = true, default-features = false } +tle.workspace = true [dev-dependencies] -sp-keystore = { workspace = true, default-features = false } +sp-keystore.workspace = true [features] -default = ["std"] +default = [] std = [ "codec/std", "log/std", @@ -76,6 +72,7 @@ std = [ "ark-scale/std", "w3f-bls/std", "tle/std", + "anyhow/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", diff --git a/pallets/drand/src/lib.rs b/pallets/drand/src/lib.rs index d82f39581a..a9a2a9c3f6 100644 --- a/pallets/drand/src/lib.rs +++ b/pallets/drand/src/lib.rs @@ -256,9 +256,9 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn offchain_worker(block_number: BlockNumberFor) { - log::debug!("Drand OCW working on block: {:?}", block_number); + log::debug!("Drand OCW working on block: {block_number:?}"); if let Err(e) = Self::fetch_drand_pulse_and_send_unsigned(block_number) { - log::debug!("Drand: Failed to fetch pulse from drand. {:?}", e); + log::debug!("Drand: Failed to fetch pulse from drand. {e:?}"); } } } @@ -462,12 +462,12 @@ impl Pallet { } fn fetch_drand_by_round(round: RoundNumber) -> Result { - let relative_path = format!("/{}/public/{}", CHAIN_HASH, round); + let relative_path = format!("/{CHAIN_HASH}/public/{round}"); Self::fetch_and_decode_from_any_endpoint(&relative_path) } fn fetch_drand_latest() -> Result { - let relative_path = format!("/{}/public/latest", CHAIN_HASH); + let relative_path = format!("/{CHAIN_HASH}/public/latest"); Self::fetch_and_decode_from_any_endpoint(&relative_path) } @@ -477,7 +477,7 @@ impl Pallet { ) -> Result { let uris: Vec = ENDPOINTS .iter() - .map(|e| format!("{}{}", e, relative_path)) + .map(|e| format!("{e}{relative_path}")) .collect(); let deadline = sp_io::offchain::timestamp().add( sp_runtime::offchain::Duration::from_millis(T::HttpFetchTimeout::get()), @@ -494,7 +494,7 @@ impl Pallet { pending_requests.push((uri.clone(), pending_req)); } Err(_) => { - log::warn!("Drand: HTTP IO Error on endpoint {}", uri); + log::warn!("Drand: HTTP IO Error on endpoint {uri}"); } } } @@ -543,7 +543,7 @@ impl Pallet { } } Ok(Err(e)) => { - log::warn!("Drand: HTTP error from {}: {:?}", uri, e); + log::warn!("Drand: HTTP error from {uri}: {e:?}"); } Err(pending_req) => { still_pending = true; diff --git a/pallets/drand/src/tests.rs b/pallets/drand/src/tests.rs index 3f6470f04c..5cfdcb5485 100644 --- a/pallets/drand/src/tests.rs +++ b/pallets/drand/src/tests.rs @@ -358,7 +358,7 @@ fn can_execute_and_handle_valid_http_responses() { for endpoint in ENDPOINTS.iter() { state.expect_request(PendingRequest { method: "GET".into(), - uri: format!("{}/{}/public/1000", endpoint, QUICKNET_CHAIN_HASH), + uri: format!("{endpoint}/{QUICKNET_CHAIN_HASH}/public/1000"), response: Some(DRAND_PULSE.as_bytes().to_vec()), sent: true, ..Default::default() @@ -368,7 +368,7 @@ fn can_execute_and_handle_valid_http_responses() { for endpoint in ENDPOINTS.iter() { state.expect_request(PendingRequest { method: "GET".into(), - uri: format!("{}/{}/public/latest", endpoint, QUICKNET_CHAIN_HASH), + uri: format!("{endpoint}/{QUICKNET_CHAIN_HASH}/public/latest"), response: Some(DRAND_PULSE.as_bytes().to_vec()), sent: true, ..Default::default() @@ -424,7 +424,7 @@ fn test_all_endpoints_fail() { for endpoint in endpoints.iter() { state.expect_request(PendingRequest { method: "GET".into(), - uri: format!("{}/{}/public/1000", endpoint, QUICKNET_CHAIN_HASH), + uri: format!("{endpoint}/{QUICKNET_CHAIN_HASH}/public/1000"), response: Some(INVALID_JSON.as_bytes().to_vec()), sent: true, ..Default::default() diff --git a/pallets/drand/src/types.rs b/pallets/drand/src/types.rs index 49a0a593f5..6763787935 100644 --- a/pallets/drand/src/types.rs +++ b/pallets/drand/src/types.rs @@ -15,7 +15,7 @@ */ use alloc::{string::String, vec::Vec}; -use codec::{Decode, Encode}; +use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::pallet_prelude::*; use serde::{Deserialize, Serialize}; use subtensor_macros::freeze_struct; @@ -116,11 +116,12 @@ impl DrandResponseBody { } } /// A drand chain configuration -#[freeze_struct("1e01e739e2a5c940")] +#[freeze_struct("e839cb287e55b4f5")] #[derive( Clone, Debug, Decode, + DecodeWithMemTracking, Default, PartialEq, Encode, @@ -141,8 +142,8 @@ pub struct BeaconConfiguration { /// Payload used by to hold the beacon /// config required to submit a transaction. -#[freeze_struct("2b7ebe4cb969cbd3")] -#[derive(Encode, Decode, Debug, Clone, PartialEq, scale_info::TypeInfo)] +#[freeze_struct("aa582bfb5fcb7d4f")] +#[derive(Encode, Decode, DecodeWithMemTracking, Debug, Clone, PartialEq, scale_info::TypeInfo)] pub struct BeaconConfigurationPayload { pub block_number: BlockNumber, pub config: BeaconConfiguration, @@ -150,11 +151,12 @@ pub struct BeaconConfigurationPayload { } /// metadata for the drand beacon configuration -#[freeze_struct("d87f51d2ad39c10e")] +#[freeze_struct("e4cfd191c043f56f")] #[derive( Clone, Debug, Decode, + DecodeWithMemTracking, Default, PartialEq, Encode, @@ -168,11 +170,12 @@ pub struct Metadata { } /// A pulse from the drand beacon -#[freeze_struct("de1a209f66f482b4")] +#[freeze_struct("3836b1f8846739fc")] #[derive( Clone, Debug, Decode, + DecodeWithMemTracking, Default, PartialEq, Encode, @@ -196,8 +199,8 @@ pub struct Pulse { /// Payload used by to hold the pulse /// data required to submit a transaction. -#[freeze_struct("4a9f01b1d8fbbe89")] -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[freeze_struct("d56228e0330b6598")] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] pub struct PulsesPayload { pub block_number: BlockNumber, pub pulses: Vec, diff --git a/pallets/drand/src/verifier.rs b/pallets/drand/src/verifier.rs index bdaafcec57..e24b82003a 100644 --- a/pallets/drand/src/verifier.rs +++ b/pallets/drand/src/verifier.rs @@ -68,12 +68,12 @@ impl Verifier for QuicknetVerifier { // decode public key (pk) let pk = ArkScale::::decode(&mut beacon_config.public_key.into_inner().as_slice()) - .map_err(|e| format!("Failed to decode public key: {}", e))?; + .map_err(|e| format!("Failed to decode public key: {e}"))?; // decode signature (sigma) let signature = ArkScale::::decode(&mut pulse.signature.into_inner().as_slice()) - .map_err(|e| format!("Failed to decode signature: {}", e))?; + .map_err(|e| format!("Failed to decode signature: {e}"))?; // m = sha256({} || {round}) let message = message(pulse.round, &[]); @@ -81,15 +81,15 @@ impl Verifier for QuicknetVerifier { // H(m) \in G1 let message_hash = hasher .hash(&message) - .map_err(|e| format!("Failed to hash message: {}", e))?; + .map_err(|e| format!("Failed to hash message: {e}"))?; let mut bytes = Vec::new(); message_hash .serialize_compressed(&mut bytes) - .map_err(|e| format!("Failed to serialize message hash: {}", e))?; + .map_err(|e| format!("Failed to serialize message hash: {e}"))?; let message_on_curve = ArkScale::::decode(&mut &bytes[..]) - .map_err(|e| format!("Failed to decode message on curve: {}", e))?; + .map_err(|e| format!("Failed to decode message on curve: {e}"))?; let g2 = G2AffineOpt::generator(); diff --git a/pallets/proxy/Cargo.toml b/pallets/proxy/Cargo.toml index f3a97dfedf..4f5dddfed1 100644 --- a/pallets/proxy/Cargo.toml +++ b/pallets/proxy/Cargo.toml @@ -2,7 +2,7 @@ name = "pallet-proxy" version = "38.0.0" authors = ["Bittensor Nucleus Team"] -edition = "2021" +edition.workspace = true license = "Apache-2.0" homepage = "https://bittensor.com" description = "FRAME proxying pallet" @@ -15,9 +15,9 @@ workspace = true targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { features = ["max-encoded-len"], workspace = true } -scale-info = { features = ["derive"], workspace = true } -frame-benchmarking = { optional = true, workspace = true } +codec = { workspace = true, features = ["derive", "max-encoded-len"] } +scale-info = { workspace = true, features = ["derive"] } +frame-benchmarking = { workspace = true, optional = true } frame-support.workspace = true frame-system.workspace = true sp-io.workspace = true @@ -25,9 +25,9 @@ sp-runtime.workspace = true subtensor-macros.workspace = true [dev-dependencies] -pallet-balances = { default-features = true, workspace = true } -pallet-utility = { default-features = true, workspace = true } -sp-core = { default-features = true, workspace = true } +pallet-balances = { workspace = true, default-features = true } +pallet-utility = { workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } [features] default = ["std"] @@ -46,12 +46,12 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "pallet-utility/runtime-benchmarks" + "pallet-utility/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", "pallet-balances/try-runtime", - "pallet-utility/try-runtime" + "pallet-utility/try-runtime", ] diff --git a/pallets/proxy/src/benchmarking.rs b/pallets/proxy/src/benchmarking.rs index f519c0f0c3..0e0d89f03e 100644 --- a/pallets/proxy/src/benchmarking.rs +++ b/pallets/proxy/src/benchmarking.rs @@ -23,7 +23,7 @@ use super::*; use crate::Pallet as Proxy; use alloc::{boxed::Box, vec}; use frame_benchmarking::v1::{account, benchmarks, whitelisted_caller}; -use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; +use frame_system::{RawOrigin, pallet_prelude::BlockNumberFor}; use sp_runtime::traits::{Bounded, CheckedDiv}; const SEED: u32 = 0; diff --git a/pallets/proxy/src/lib.rs b/pallets/proxy/src/lib.rs index 25bf82462c..9a7aab857a 100644 --- a/pallets/proxy/src/lib.rs +++ b/pallets/proxy/src/lib.rs @@ -39,18 +39,18 @@ use alloc::{boxed::Box, vec}; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::pallet_prelude::{Pays, Weight}; use frame_support::{ + BoundedVec, dispatch::GetDispatchInfo, ensure, traits::{Currency, Get, InstanceFilter, IsSubType, IsType, OriginTrait, ReservableCurrency}, - BoundedVec, }; use frame_system::{self as system, ensure_signed, pallet_prelude::BlockNumberFor}; pub use pallet::*; -use scale_info::{prelude::cmp::Ordering, TypeInfo}; +use scale_info::{TypeInfo, prelude::cmp::Ordering}; use sp_io::hashing::blake2_256; use sp_runtime::{ - traits::{Dispatchable, Hash, Saturating, StaticLookup, TrailingZeroInput, Zero}, DispatchError, DispatchResult, RuntimeDebug, + traits::{Dispatchable, Hash, Saturating, StaticLookup, TrailingZeroInput, Zero}, }; use subtensor_macros::freeze_struct; pub use weights::WeightInfo; @@ -412,7 +412,7 @@ pub mod pallet { height: system::Pallet::::block_number(), }; - Announcements::::try_mutate(&who, |(ref mut pending, ref mut deposit)| { + Announcements::::try_mutate(&who, |(pending, deposit)| { pending .try_push(announcement) .map_err(|_| Error::::TooMany)?; @@ -709,7 +709,7 @@ impl Pallet { delay: BlockNumberFor, ) -> DispatchResult { ensure!(delegator != &delegatee, Error::::NoSelfProxy); - Proxies::::try_mutate(delegator, |(ref mut proxies, ref mut deposit)| { + Proxies::::try_mutate(delegator, |(proxies, deposit)| { let proxy_def = ProxyDefinition { delegate: delegatee.clone(), proxy_type: proxy_type.clone(), @@ -876,8 +876,8 @@ impl Pallet { match c.is_sub_type() { // Proxy call cannot add or remove a proxy with more permissions than it already // has. - Some(Call::add_proxy { ref proxy_type, .. }) - | Some(Call::remove_proxy { ref proxy_type, .. }) + Some(Call::add_proxy { proxy_type, .. }) + | Some(Call::remove_proxy { proxy_type, .. }) if !def.proxy_type.is_superset(proxy_type) => { false diff --git a/pallets/proxy/src/tests.rs b/pallets/proxy/src/tests.rs index d3200d2e76..e350386164 100644 --- a/pallets/proxy/src/tests.rs +++ b/pallets/proxy/src/tests.rs @@ -23,13 +23,13 @@ use super::*; use crate as proxy; use alloc::{vec, vec::Vec}; -use codec::{Decode, Encode}; +use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::{ assert_noop, assert_ok, derive_impl, traits::{ConstU32, ConstU64, Contains}, }; use sp_core::H256; -use sp_runtime::{traits::BlakeTwo256, BuildStorage, DispatchError, RuntimeDebug}; +use sp_runtime::{BuildStorage, DispatchError, RuntimeDebug, traits::BlakeTwo256}; type Block = frame_system::mocking::MockBlock; @@ -72,6 +72,7 @@ impl pallet_utility::Config for Test { PartialOrd, Encode, Decode, + DecodeWithMemTracking, RuntimeDebug, MaxEncodedLen, scale_info::TypeInfo, @@ -142,6 +143,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .expect("Expected to not panic"); pallet_balances::GenesisConfig:: { balances: vec![(1, 10), (2, 10), (3, 10), (4, 10), (5, 3)], + dev_accounts: None, } .assimilate_storage(&mut t) .expect("Expected to not panic"); diff --git a/pallets/registry/Cargo.toml b/pallets/registry/Cargo.toml index 006c5a753b..63224aa8c1 100644 --- a/pallets/registry/Cargo.toml +++ b/pallets/registry/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "Simplified identity system for network participants." authors = ["Bittensor Nucleus Team"] homepage = "https://bittensor.com" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" @@ -17,21 +17,18 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] subtensor-macros.workspace = true -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", - "max-encoded-len", -] } +codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-runtime = { workspace = true } -sp-std = { workspace = true } -enumflags2 = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +sp-runtime.workspace = true +sp-std.workspace = true +enumflags2.workspace = true [dev-dependencies] -sp-core = { workspace = true } -sp-io = { workspace = true } +sp-core.workspace = true +sp-io.workspace = true [features] default = ["std"] @@ -45,7 +42,7 @@ std = [ "sp-runtime/std", "enumflags2/std", "sp-core/std", - "sp-io/std" + "sp-io/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -56,5 +53,5 @@ runtime-benchmarks = [ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", - "sp-runtime/try-runtime" + "sp-runtime/try-runtime", ] diff --git a/pallets/registry/src/types.rs b/pallets/registry/src/types.rs index 5e1b52c0d0..eb19e145d6 100644 --- a/pallets/registry/src/types.rs +++ b/pallets/registry/src/types.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use enumflags2::{BitFlags, bitflags}; use frame_support::{ BoundedVec, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, @@ -37,7 +37,7 @@ use subtensor_macros::freeze_struct; /// than 32-bytes then it will be truncated when encoding. /// /// Can also be `None`. -#[derive(Clone, Eq, PartialEq, RuntimeDebug, MaxEncodedLen)] +#[derive(Clone, Eq, PartialEq, RuntimeDebug, DecodeWithMemTracking, MaxEncodedLen)] pub enum Data { /// No data here. None, @@ -280,9 +280,17 @@ impl TypeInfo for IdentityFields { /// /// NOTE: This should be stored at the end of the storage item to facilitate the addition of extra /// fields in a backwards compatible way through a specialized `Decode` impl. -#[freeze_struct("98e2d7fc7536226b")] +#[freeze_struct("4015f12f49280ee")] #[derive( - CloneNoBound, Encode, Decode, Eq, MaxEncodedLen, PartialEqNoBound, RuntimeDebugNoBound, TypeInfo, + CloneNoBound, + Encode, + Decode, + DecodeWithMemTracking, + Eq, + MaxEncodedLen, + PartialEqNoBound, + RuntimeDebugNoBound, + TypeInfo, )] #[codec(mel_bound())] #[derive(frame_support::DefaultNoBound)] @@ -432,7 +440,7 @@ mod tests { .variants .iter() .find(|v| v.name == variant_name) - .unwrap_or_else(|| panic!("Expected to find variant {}", variant_name)); + .unwrap_or_else(|| panic!("Expected to find variant {variant_name}")); let field_arr_len = variant .fields diff --git a/pallets/subtensor/Cargo.toml b/pallets/subtensor/Cargo.toml index 7e256177a5..d4055346cd 100644 --- a/pallets/subtensor/Cargo.toml +++ b/pallets/subtensor/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "FRAME pallet for runtime logic of Subtensor Blockchain." authors = ["Bittensor Nucleus Team"] homepage = "https://bittensor.com" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor" @@ -17,64 +17,60 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] subtensor-macros.workspace = true -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", -] } -sp-core = { workspace = true } -pallet-balances = { workspace = true } +codec = { workspace = true, features = ["derive"] } +sp-core.workspace = true +pallet-balances.workspace = true scale-info = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -sp-io = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +sp-io.workspace = true serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -serde-tuple-vec-map = { workspace = true } +serde_json.workspace = true +serde-tuple-vec-map.workspace = true serde_bytes = { workspace = true, features = ["alloc"] } serde_with = { workspace = true, features = ["macros"] } -sp-runtime = { workspace = true } -sp-std = { workspace = true } -libsecp256k1 = { workspace = true } -log = { workspace = true } -substrate-fixed = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-utility = { workspace = true } -ndarray = { workspace = true } -hex = { workspace = true } -share-pool = { default-features = false, path = "../../primitives/share-pool" } -safe-math = { default-features = false, path = "../../primitives/safe-math" } -approx = { workspace = true } -subtensor-swap-interface = { workspace = true } +sp-runtime.workspace = true +sp-std.workspace = true +libsecp256k1.workspace = true +log.workspace = true +substrate-fixed.workspace = true +pallet-transaction-payment.workspace = true +pallet-utility.workspace = true +ndarray.workspace = true +hex.workspace = true +share-pool.workspace = true +safe-math.workspace = true +approx.workspace = true +subtensor-swap-interface.workspace = true subtensor-runtime-common = { workspace = true, features = ["approx"] } -pallet-collective = { version = "4.0.0-dev", default-features = false, path = "../collective" } -pallet-drand = { path = "../drand", default-features = false } -pallet-membership = { workspace = true } -hex-literal = { workspace = true } -num-traits = { version = "0.2.19", default-features = false, features = [ - "libm", -] } -tle = { workspace = true, default-features = false } -ark-bls12-381 = { workspace = true, default-features = false } -ark-serialize = { workspace = true, default-features = false } -w3f-bls = { workspace = true, default-features = false } -sha2 = { workspace = true } -rand_chacha = { workspace = true } -pallet-crowdloan = { workspace = true, default-features = false } -pallet-proxy = { workspace = true, default-features = false } +pallet-drand.workspace = true +pallet-collective.workspace = true +pallet-membership.workspace = true +hex-literal.workspace = true +num-traits = { workspace = true, features = ["libm"] } +tle.workspace = true +ark-bls12-381 = { workspace = true, features = ["curve"] } +ark-serialize = { workspace = true, features = ["derive"] } +w3f-bls.workspace = true +sha2.workspace = true +rand_chacha.workspace = true +pallet-crowdloan.workspace = true +pallet-proxy.workspace = true [dev-dependencies] pallet-balances = { workspace = true, features = ["std"] } -pallet-scheduler = { workspace = true } -pallet-subtensor-swap = { workspace = true } -sp-version = { workspace = true } +pallet-scheduler.workspace = true +pallet-subtensor-swap.workspace = true +sp-version.workspace = true # Substrate -sp-tracing = { workspace = true } +sp-tracing.workspace = true parity-util-mem = { workspace = true, features = ["primitive-types"] } -rand = { workspace = true } -sp-core = { workspace = true } -sp-std = { workspace = true } -pallet-preimage = { workspace = true } +rand.workspace = true +sp-core.workspace = true +sp-std.workspace = true +pallet-preimage.workspace = true [features] std = [ diff --git a/pallets/subtensor/rpc/Cargo.toml b/pallets/subtensor/rpc/Cargo.toml index 47b63b9067..e3512b82d1 100644 --- a/pallets/subtensor/rpc/Cargo.toml +++ b/pallets/subtensor/rpc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-custom-rpc" version = "0.0.2" -edition = "2024" +edition.workspace = true authors = ['Cameron Fairchild '] repository = 'https://github.com/opentensor/subtensor' description = "A pallet that adds custom RPC calls to subtensor" @@ -12,20 +12,20 @@ publish = false workspace = true [dependencies] -codec = { workspace = true } +codec = { workspace = true, features = ["derive"] } jsonrpsee = { workspace = true, features = ["client-core", "server", "macros"] } serde = { workspace = true, features = ["derive"] } # Substrate packages -sp-api = { workspace = true } -sp-blockchain = { workspace = true } -sp-rpc = { workspace = true } -sp-runtime = { workspace = true } +sp-api.workspace = true +sp-blockchain.workspace = true +sp-rpc.workspace = true +sp-runtime.workspace = true # local packages -subtensor-runtime-common = { workspace = true } -subtensor-custom-rpc-runtime-api = { path = "../runtime-api", default-features = false } -pallet-subtensor = { path = "../../subtensor", default-features = false } +subtensor-runtime-common.workspace = true +subtensor-custom-rpc-runtime-api.workspace = true +pallet-subtensor.workspace = true [features] default = ["std"] diff --git a/pallets/subtensor/rpc/src/lib.rs b/pallets/subtensor/rpc/src/lib.rs index d0d2b84d50..6489199092 100644 --- a/pallets/subtensor/rpc/src/lib.rs +++ b/pallets/subtensor/rpc/src/lib.rs @@ -139,7 +139,7 @@ where match api.get_delegates(at) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get delegates info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get delegates info: {e:?}")).into()) } } } @@ -156,14 +156,14 @@ where Ok(delegate_account) => delegate_account, Err(e) => { return Err( - Error::RuntimeError(format!("Unable to get delegates info: {:?}", e)).into(), + Error::RuntimeError(format!("Unable to get delegates info: {e:?}")).into(), ); } }; match api.get_delegate(at, delegate_account) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get delegates info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get delegates info: {e:?}")).into()) } } } @@ -180,14 +180,14 @@ where Ok(delegatee_account) => delegatee_account, Err(e) => { return Err( - Error::RuntimeError(format!("Unable to get delegates info: {:?}", e)).into(), + Error::RuntimeError(format!("Unable to get delegates info: {e:?}")).into(), ); } }; match api.get_delegated(at, delegatee_account) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get delegates info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get delegates info: {e:?}")).into()) } } } @@ -203,7 +203,7 @@ where match api.get_neurons_lite(at, netuid) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get neurons lite info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get neurons lite info: {e:?}")).into()) } } } @@ -220,7 +220,7 @@ where match api.get_neuron_lite(at, netuid, uid) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get neurons lite info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get neurons lite info: {e:?}")).into()) } } } @@ -235,9 +235,7 @@ where match api.get_neurons(at, netuid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get neurons info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get neurons info: {e:?}")).into()), } } @@ -252,9 +250,7 @@ where match api.get_neuron(at, netuid, uid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get neuron info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get neuron info: {e:?}")).into()), } } @@ -268,9 +264,7 @@ where match api.get_subnet_info(at, netuid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnet info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnet info: {e:?}")).into()), } } @@ -284,9 +278,7 @@ where match api.get_subnet_hyperparams(at, netuid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnet info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnet info: {e:?}")).into()), } } @@ -300,9 +292,7 @@ where match api.get_subnet_hyperparams_v2(at, netuid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnet info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnet info: {e:?}")).into()), } } @@ -313,8 +303,7 @@ where match api.get_all_dynamic_info(at) { Ok(result) => Ok(result.encode()), Err(e) => Err(Error::RuntimeError(format!( - "Unable to get dynamic subnets info: {:?}", - e + "Unable to get dynamic subnets info: {e:?}" )) .into()), } @@ -326,7 +315,7 @@ where match api.get_all_metagraphs(at) { Ok(result) => Ok(result.encode()), - Err(e) => Err(Error::RuntimeError(format!("Unable to get metagraps: {:?}", e)).into()), + Err(e) => Err(Error::RuntimeError(format!("Unable to get metagraps: {e:?}")).into()), } } @@ -341,8 +330,7 @@ where match api.get_dynamic_info(at, netuid) { Ok(result) => Ok(result.encode()), Err(e) => Err(Error::RuntimeError(format!( - "Unable to get dynamic subnets info: {:?}", - e + "Unable to get dynamic subnets info: {e:?}" )) .into()), } @@ -358,8 +346,7 @@ where match api.get_metagraph(at, netuid) { Ok(result) => Ok(result.encode()), Err(e) => Err(Error::RuntimeError(format!( - "Unable to get dynamic subnets info: {:?}", - e + "Unable to get dynamic subnets info: {e:?}" )) .into()), } @@ -376,7 +363,7 @@ where match api.get_subnet_state(at, netuid) { Ok(result) => Ok(result.encode()), Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnet state info: {:?}", e)).into()) + Err(Error::RuntimeError(format!("Unable to get subnet state info: {e:?}")).into()) } } } @@ -387,9 +374,7 @@ where match api.get_subnets_info(at) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnets info: {e:?}")).into()), } } @@ -403,9 +388,7 @@ where match api.get_subnet_info_v2(at, netuid) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnet info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnet info: {e:?}")).into()), } } @@ -415,9 +398,7 @@ where match api.get_subnets_info_v2(at) { Ok(result) => Ok(result.encode()), - Err(e) => { - Err(Error::RuntimeError(format!("Unable to get subnets info: {:?}", e)).into()) - } + Err(e) => Err(Error::RuntimeError(format!("Unable to get subnets info: {e:?}")).into()), } } @@ -426,7 +407,7 @@ where let at = at.unwrap_or_else(|| self.client.info().best_hash); api.get_network_registration_cost(at).map_err(|e| { - Error::RuntimeError(format!("Unable to get subnet lock cost: {:?}", e)).into() + Error::RuntimeError(format!("Unable to get subnet lock cost: {e:?}")).into() }) } @@ -441,11 +422,9 @@ where match api.get_selective_metagraph(at, netuid, metagraph_index) { Ok(result) => Ok(result.encode()), - Err(e) => Err(Error::RuntimeError(format!( - "Unable to get selective metagraph: {:?}", - e - )) - .into()), + Err(e) => { + Err(Error::RuntimeError(format!("Unable to get selective metagraph: {e:?}")).into()) + } } } } diff --git a/pallets/subtensor/runtime-api/Cargo.toml b/pallets/subtensor/runtime-api/Cargo.toml index 1a95b75d16..1951f77fd3 100644 --- a/pallets/subtensor/runtime-api/Cargo.toml +++ b/pallets/subtensor/runtime-api/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-custom-rpc-runtime-api" version = "0.0.2" -edition = "2024" +edition.workspace = true authors = ['Cameron Fairchild '] repository = 'https://github.com/opentensor/subtensor' description = "A pallet that adds a custom runtime API to Subtensor" @@ -12,14 +12,14 @@ publish = false workspace = true [dependencies] -sp-api = { workspace = true } -sp-runtime = { workspace = true } -frame-support = { workspace = true } +sp-api.workspace = true +sp-runtime.workspace = true +frame-support.workspace = true serde = { workspace = true, features = ["derive"] } -codec = { workspace = true } -subtensor-runtime-common = { workspace = true } +codec = { workspace = true, features = ["derive"] } +subtensor-runtime-common.workspace = true # local -pallet-subtensor = { version = "4.0.0-dev", path = "../../subtensor", default-features = false } +pallet-subtensor.workspace = true [features] default = ["std"] diff --git a/pallets/subtensor/src/coinbase/block_emission.rs b/pallets/subtensor/src/coinbase/block_emission.rs index 4f6fb9d95f..50e5f96558 100644 --- a/pallets/subtensor/src/coinbase/block_emission.rs +++ b/pallets/subtensor/src/coinbase/block_emission.rs @@ -41,7 +41,7 @@ impl Pallet { // Get alpha price for subnet. let alpha_price = T::SwapInterface::current_alpha_price(netuid.into()); - log::debug!("{:?} - alpha_price: {:?}", netuid, alpha_price); + log::debug!("{netuid:?} - alpha_price: {alpha_price:?}"); // Get initial alpha_in let mut alpha_in_emission: U96F32 = U96F32::saturating_from_num(tao_emission) @@ -51,10 +51,7 @@ impl Pallet { // Check if we are emitting too much alpha_in if alpha_in_emission >= float_alpha_block_emission { log::debug!( - "{:?} - alpha_in_emission: {:?} > alpha_block_emission: {:?}", - netuid, - alpha_in_emission, - float_alpha_block_emission + "{netuid:?} - alpha_in_emission: {alpha_in_emission:?} > alpha_block_emission: {float_alpha_block_emission:?}" ); // Scale down tao_in @@ -76,13 +73,9 @@ impl Pallet { let alpha_out_emission = float_alpha_block_emission; // Log results. - log::debug!("{:?} - tao_in_emission: {:?}", netuid, tao_in_emission); - log::debug!("{:?} - alpha_in_emission: {:?}", netuid, alpha_in_emission); - log::debug!( - "{:?} - alpha_out_emission: {:?}", - netuid, - alpha_out_emission - ); + log::debug!("{netuid:?} - tao_in_emission: {tao_in_emission:?}"); + log::debug!("{netuid:?} - alpha_in_emission: {alpha_in_emission:?}"); + log::debug!("{netuid:?} - alpha_out_emission: {alpha_out_emission:?}"); // Return result. ( diff --git a/pallets/subtensor/src/coinbase/block_step.rs b/pallets/subtensor/src/coinbase/block_step.rs index d003a698e3..d359bd5034 100644 --- a/pallets/subtensor/src/coinbase/block_step.rs +++ b/pallets/subtensor/src/coinbase/block_step.rs @@ -7,13 +7,13 @@ impl Pallet { /// Executes the necessary operations for each block. pub fn block_step() -> Result<(), &'static str> { let block_number: u64 = Self::get_current_block_as_u64(); - log::debug!("block_step for block: {:?} ", block_number); + log::debug!("block_step for block: {block_number:?} "); // --- 1. Adjust difficulties. Self::adjust_registration_terms_for_networks(); // --- 2. Get the current coinbase emission. let block_emission: U96F32 = U96F32::saturating_from_num(Self::get_block_emission().unwrap_or(0)); - log::debug!("Block emission: {:?}", block_emission); + log::debug!("Block emission: {block_emission:?}"); // --- 3. Run emission through network. Self::run_coinbase(block_emission); // --- 4. Set pending children on the epoch; but only after the coinbase has been run. @@ -43,11 +43,7 @@ impl Pallet { let adjustment_interval: u16 = Self::get_adjustment_interval(netuid); let current_block: u64 = Self::get_current_block_as_u64(); log::debug!( - "netuid: {:?} last_adjustment_block: {:?} adjustment_interval: {:?} current_block: {:?}", - netuid, - last_adjustment_block, - adjustment_interval, - current_block + "netuid: {netuid:?} last_adjustment_block: {last_adjustment_block:?} adjustment_interval: {adjustment_interval:?} current_block: {current_block:?}" ); // --- 3. Check if we are at the adjustment interval for this network. diff --git a/pallets/subtensor/src/coinbase/reveal_commits.rs b/pallets/subtensor/src/coinbase/reveal_commits.rs index 9318321633..8e8929b993 100644 --- a/pallets/subtensor/src/coinbase/reveal_commits.rs +++ b/pallets/subtensor/src/coinbase/reveal_commits.rs @@ -42,7 +42,7 @@ impl Pallet { // No commits to reveal until at least epoch 2. if cur_epoch < 2 { - log::warn!("Failed to reveal commit for subnet {} Too early", netuid); + log::warn!("Failed to reveal commit for subnet {netuid} Too early"); return Ok(()); } @@ -57,10 +57,7 @@ impl Pallet { Ok(c) => c, Err(e) => { log::warn!( - "Failed to reveal commit for subnet {} submitted by {:?} due to error deserializing the commit: {:?}", - netuid, - who, - e + "Failed to reveal commit for subnet {netuid} submitted by {who:?} due to error deserializing the commit: {e:?}" ); continue; } @@ -72,10 +69,7 @@ impl Pallet { None => { // Round number used was not found on the chain. Skip this commit. log::warn!( - "Failed to reveal commit for subnet {} submitted by {:?} due to missing round number {} at time of reveal.", - netuid, - who, - round_number + "Failed to reveal commit for subnet {netuid} submitted by {who:?} due to missing round number {round_number} at time of reveal." ); continue; } @@ -93,10 +87,7 @@ impl Pallet { Ok(s) => s, Err(e) => { log::error!( - "Failed to reveal commit for subnet {} submitted by {:?} due to error deserializing signature from drand pallet: {:?}", - netuid, - who, - e + "Failed to reveal commit for subnet {netuid} submitted by {who:?} due to error deserializing signature from drand pallet: {e:?}" ); continue; } @@ -108,10 +99,7 @@ impl Pallet { Ok(d) => d, Err(e) => { log::warn!( - "Failed to reveal commit for subnet {} submitted by {:?} due to error decrypting the commit: {:?}", - netuid, - who, - e + "Failed to reveal commit for subnet {netuid} submitted by {who:?} due to error decrypting the commit: {e:?}" ); continue; } @@ -123,10 +111,7 @@ impl Pallet { Ok(w) => w, Err(e) => { log::warn!( - "Failed to reveal commit for subnet {} submitted by {:?} due to error deserializing WeightsPayload: {:?}", - netuid, - who, - e + "Failed to reveal commit for subnet {netuid} submitted by {who:?} due to error deserializing WeightsPayload: {e:?}" ); continue; } @@ -140,10 +125,7 @@ impl Pallet { payload.version_key, ) { log::warn!( - "Failed to `do_set_weights` for subnet {} submitted by {:?}: {:?}", - netuid, - who, - e + "Failed to `do_set_weights` for subnet {netuid} submitted by {who:?}: {e:?}" ); continue; } else { diff --git a/pallets/subtensor/src/coinbase/root.rs b/pallets/subtensor/src/coinbase/root.rs index 279132e938..837fea2767 100644 --- a/pallets/subtensor/src/coinbase/root.rs +++ b/pallets/subtensor/src/coinbase/root.rs @@ -60,10 +60,7 @@ impl Pallet { pub fn contains_invalid_root_uids(netuids: &[NetUid]) -> bool { for netuid in netuids { if !Self::if_subnet_exist(*netuid) { - log::debug!( - "contains_invalid_root_uids: netuid {:?} does not exist", - netuid - ); + log::debug!("contains_invalid_root_uids: netuid {netuid:?} does not exist"); return true; } } @@ -92,11 +89,7 @@ impl Pallet { // --- 1. Ensure that the call originates from a signed source and retrieve the caller's account ID (coldkey). let coldkey = ensure_signed(origin)?; - log::debug!( - "do_root_register( coldkey: {:?}, hotkey: {:?} )", - coldkey, - hotkey - ); + log::debug!("do_root_register( coldkey: {coldkey:?}, hotkey: {hotkey:?} )"); // --- 2. Ensure that the number of registrations in this block doesn't exceed the allowed limit. ensure!( @@ -135,7 +128,7 @@ impl Pallet { // --- 12.1.2 Add the new account and make them a member of the Senate. Self::append_neuron(NetUid::ROOT, &hotkey, current_block_number); - log::debug!("add new neuron: {:?} on uid {:?}", hotkey, subnetwork_uid); + log::debug!("add new neuron: {hotkey:?} on uid {subnetwork_uid:?}"); } else { // --- 13.1.1 The network is full. Perform replacement. // Find the neuron with the lowest stake value to replace. @@ -165,10 +158,7 @@ impl Pallet { Self::replace_neuron(NetUid::ROOT, lowest_uid, &hotkey, current_block_number); log::debug!( - "replace neuron: {:?} with {:?} on uid {:?}", - replaced_hotkey, - hotkey, - subnetwork_uid + "replace neuron: {replaced_hotkey:?} with {hotkey:?} on uid {subnetwork_uid:?}" ); } @@ -226,11 +216,7 @@ impl Pallet { // --- 1. Ensure that the call originates from a signed source and retrieve the caller's account ID (coldkey). let coldkey = ensure_signed(origin)?; - log::debug!( - "do_root_register( coldkey: {:?}, hotkey: {:?} )", - coldkey, - hotkey - ); + log::debug!("do_root_register( coldkey: {coldkey:?}, hotkey: {hotkey:?} )"); // --- 2. Check if the hotkey is already registered to the root network. If not, error out. ensure!( @@ -256,11 +242,7 @@ impl Pallet { } // --- 5. Log and announce the successful Senate adjustment. - log::debug!( - "SenateAdjusted(old_hotkey:{:?} hotkey:{:?})", - replaced, - hotkey - ); + log::debug!("SenateAdjusted(old_hotkey:{replaced:?} hotkey:{hotkey:?})"); Self::deposit_event(Event::SenateAdjusted { old_member: replaced.cloned(), new_member: hotkey, @@ -405,7 +387,7 @@ impl Pallet { Self::remove_network(netuid); // --- 6. Emit the NetworkRemoved event. - log::debug!("NetworkRemoved( netuid:{:?} )", netuid); + log::debug!("NetworkRemoved( netuid:{netuid:?} )"); Self::deposit_event(Event::NetworkRemoved(netuid)); // --- 7. Return success. @@ -551,14 +533,7 @@ impl Pallet { } log::debug!( - "last_lock: {:?}, min_lock: {:?}, last_lock_block: {:?}, lock_reduction_interval: {:?}, current_block: {:?}, mult: {:?} lock_cost: {:?}", - last_lock, - min_lock, - last_lock_block, - lock_reduction_interval, - current_block, - mult, - lock_cost + "last_lock: {last_lock:?}, min_lock: {min_lock:?}, last_lock_block: {last_lock_block:?}, lock_reduction_interval: {lock_reduction_interval:?}, current_block: {current_block:?}, mult: {mult:?} lock_cost: {lock_cost:?}" ); lock_cost diff --git a/pallets/subtensor/src/coinbase/run_coinbase.rs b/pallets/subtensor/src/coinbase/run_coinbase.rs index 2ef8aa0f6c..d19cb88e9f 100644 --- a/pallets/subtensor/src/coinbase/run_coinbase.rs +++ b/pallets/subtensor/src/coinbase/run_coinbase.rs @@ -22,21 +22,21 @@ impl Pallet { pub fn run_coinbase(block_emission: U96F32) { // --- 0. Get current block. let current_block: u64 = Self::get_current_block_as_u64(); - log::debug!("Current block: {:?}", current_block); + log::debug!("Current block: {current_block:?}"); // --- 1. Get all netuids (filter out root) let subnets: Vec = Self::get_all_subnet_netuids() .into_iter() .filter(|netuid| *netuid != NetUid::ROOT) .collect(); - log::debug!("All subnet netuids: {:?}", subnets); + log::debug!("All subnet netuids: {subnets:?}"); // Filter out subnets with no first emission block number. let subnets_to_emit_to: Vec = subnets .clone() .into_iter() .filter(|netuid| FirstEmissionBlockNumber::::get(*netuid).is_some()) .collect(); - log::debug!("Subnets to emit to: {:?}", subnets_to_emit_to); + log::debug!("Subnets to emit to: {subnets_to_emit_to:?}"); // --- 2. Get sum of tao reserves ( in a later version we will switch to prices. ) let mut total_moving_prices = U96F32::saturating_from_num(0.0); @@ -46,7 +46,7 @@ impl Pallet { total_moving_prices = total_moving_prices.saturating_add(Self::get_moving_alpha_price(*netuid_i)); } - log::debug!("total_moving_prices: {:?}", total_moving_prices); + log::debug!("total_moving_prices: {total_moving_prices:?}"); // --- 3. Get subnet terms (tao_in, alpha_in, and alpha_out) // Computation is described in detail in the dtao whitepaper. @@ -58,22 +58,22 @@ impl Pallet { for netuid_i in subnets_to_emit_to.iter() { // Get subnet price. let price_i = T::SwapInterface::current_alpha_price((*netuid_i).into()); - log::debug!("price_i: {:?}", price_i); + log::debug!("price_i: {price_i:?}"); // Get subnet TAO. let moving_price_i: U96F32 = Self::get_moving_alpha_price(*netuid_i); - log::debug!("moving_price_i: {:?}", moving_price_i); + log::debug!("moving_price_i: {moving_price_i:?}"); // Emission is price over total. let default_tao_in_i: U96F32 = block_emission .saturating_mul(moving_price_i) .checked_div(total_moving_prices) .unwrap_or(asfloat!(0.0)); - log::debug!("default_tao_in_i: {:?}", default_tao_in_i); + log::debug!("default_tao_in_i: {default_tao_in_i:?}"); // Get alpha_emission total let alpha_emission_i: U96F32 = asfloat!( Self::get_block_emission_for_issuance(Self::get_alpha_issuance(*netuid_i).into()) .unwrap_or(0) ); - log::debug!("alpha_emission_i: {:?}", alpha_emission_i); + log::debug!("alpha_emission_i: {alpha_emission_i:?}"); // Get initial alpha_in let mut alpha_in_i: U96F32; @@ -105,7 +105,7 @@ impl Pallet { alpha_in_i = tao_in_i.safe_div_or(price_i, alpha_emission_i); is_subsidized.insert(*netuid_i, false); } - log::debug!("alpha_in_i: {:?}", alpha_in_i); + log::debug!("alpha_in_i: {alpha_in_i:?}"); // Get alpha_out. let mut alpha_out_i = alpha_emission_i; @@ -122,9 +122,9 @@ impl Pallet { alpha_in.insert(*netuid_i, alpha_in_i); alpha_out.insert(*netuid_i, alpha_out_i); } - log::debug!("tao_in: {:?}", tao_in); - log::debug!("alpha_in: {:?}", alpha_in); - log::debug!("alpha_out: {:?}", alpha_out); + log::debug!("tao_in: {tao_in:?}"); + log::debug!("alpha_in: {alpha_in:?}"); + log::debug!("alpha_out: {alpha_out:?}"); // --- 4. Injection. // Actually perform the injection of alpha_in, alpha_out and tao_in into the subnet pool. @@ -168,10 +168,10 @@ impl Pallet { for netuid_i in subnets_to_emit_to.iter() { // Get alpha out. let alpha_out_i: U96F32 = *alpha_out.get(netuid_i).unwrap_or(&asfloat!(0)); - log::debug!("alpha_out_i: {:?}", alpha_out_i); + log::debug!("alpha_out_i: {alpha_out_i:?}"); // Calculate the owner cut. let owner_cut_i: U96F32 = alpha_out_i.saturating_mul(cut_percent); - log::debug!("owner_cut_i: {:?}", owner_cut_i); + log::debug!("owner_cut_i: {owner_cut_i:?}"); // Save owner cut. *owner_cuts.entry(*netuid_i).or_insert(asfloat!(0)) = owner_cut_i; // Save new alpha_out. @@ -187,30 +187,30 @@ impl Pallet { for netuid_i in subnets_to_emit_to.iter() { // Get remaining alpha out. let alpha_out_i: U96F32 = *alpha_out.get(netuid_i).unwrap_or(&asfloat!(0.0)); - log::debug!("alpha_out_i: {:?}", alpha_out_i); + log::debug!("alpha_out_i: {alpha_out_i:?}"); // Get total TAO on root. let root_tao: U96F32 = asfloat!(SubnetTAO::::get(NetUid::ROOT)); - log::debug!("root_tao: {:?}", root_tao); + log::debug!("root_tao: {root_tao:?}"); // Get total ALPHA on subnet. let alpha_issuance: U96F32 = asfloat!(Self::get_alpha_issuance(*netuid_i)); - log::debug!("alpha_issuance: {:?}", alpha_issuance); + log::debug!("alpha_issuance: {alpha_issuance:?}"); // Get tao_weight let tao_weight: U96F32 = root_tao.saturating_mul(Self::get_tao_weight()); - log::debug!("tao_weight: {:?}", tao_weight); + log::debug!("tao_weight: {tao_weight:?}"); // Get root proportional dividends. let root_proportion: U96F32 = tao_weight .checked_div(tao_weight.saturating_add(alpha_issuance)) .unwrap_or(asfloat!(0.0)); - log::debug!("root_proportion: {:?}", root_proportion); + log::debug!("root_proportion: {root_proportion:?}"); // Get root proportion of alpha_out dividends. let root_alpha: U96F32 = root_proportion .saturating_mul(alpha_out_i) // Total alpha emission per block remaining. .saturating_mul(asfloat!(0.5)); // 50% to validators. // Remove root alpha from alpha_out. - log::debug!("root_alpha: {:?}", root_alpha); + log::debug!("root_alpha: {root_alpha:?}"); // Get pending alpha as original alpha_out - root_alpha. let pending_alpha: U96F32 = alpha_out_i.saturating_sub(root_alpha); - log::debug!("pending_alpha: {:?}", pending_alpha); + log::debug!("pending_alpha: {pending_alpha:?}"); // Sell root emission through the pool (do not pay fees) let subsidized: bool = *is_subsidized.get(netuid_i).unwrap_or(&false); if !subsidized { @@ -251,11 +251,7 @@ impl Pallet { // Pass on subnets that have not reached their tempo. if Self::should_run_epoch(netuid, current_block) { if let Err(e) = Self::reveal_crv3_commits(netuid) { - log::warn!( - "Failed to reveal commits for subnet {} due to error: {:?}", - netuid, - e - ); + log::warn!("Failed to reveal commits for subnet {netuid} due to error: {e:?}"); }; // Restart counters. @@ -320,8 +316,8 @@ impl Pallet { .or_insert(asfloat!(parent_div)); } } - log::debug!("incentives: {:?}", incentives); - log::debug!("dividends: {:?}", dividends); + log::debug!("incentives: {incentives:?}"); + log::debug!("dividends: {dividends:?}"); (incentives, dividends) } @@ -336,11 +332,11 @@ impl Pallet { BTreeMap, BTreeMap, ) { - log::debug!("dividends: {:?}", dividends); - log::debug!("stake_map: {:?}", stake_map); - log::debug!("pending_alpha: {:?}", pending_alpha); - log::debug!("pending_tao: {:?}", pending_tao); - log::debug!("tao_weight: {:?}", tao_weight); + log::debug!("dividends: {dividends:?}"); + log::debug!("stake_map: {stake_map:?}"); + log::debug!("pending_alpha: {pending_alpha:?}"); + log::debug!("pending_tao: {pending_tao:?}"); + log::debug!("tao_weight: {tao_weight:?}"); // Setup. let zero: U96F32 = asfloat!(0.0); @@ -386,45 +382,45 @@ impl Pallet { total_root_divs = total_root_divs.saturating_add(root_divs); } } - log::debug!("alpha_dividends: {:?}", alpha_dividends); - log::debug!("root_dividends: {:?}", root_dividends); - log::debug!("total_root_divs: {:?}", total_root_divs); - log::debug!("total_alpha_divs: {:?}", total_alpha_divs); + log::debug!("alpha_dividends: {alpha_dividends:?}"); + log::debug!("root_dividends: {root_dividends:?}"); + log::debug!("total_root_divs: {total_root_divs:?}"); + log::debug!("total_alpha_divs: {total_alpha_divs:?}"); // Compute root divs as TAO. Here we take let mut tao_dividends: BTreeMap = BTreeMap::new(); for (hotkey, root_divs) in root_dividends { // Root proportion. let root_share: U96F32 = root_divs.checked_div(total_root_divs).unwrap_or(zero); - log::debug!("hotkey: {:?}, root_share: {:?}", hotkey, root_share); + log::debug!("hotkey: {hotkey:?}, root_share: {root_share:?}"); // Root proportion in TAO let root_tao: U96F32 = asfloat!(pending_tao).saturating_mul(root_share); - log::debug!("hotkey: {:?}, root_tao: {:?}", hotkey, root_tao); + log::debug!("hotkey: {hotkey:?}, root_tao: {root_tao:?}"); // Record root dividends as TAO. tao_dividends .entry(hotkey) .and_modify(|e| *e = root_tao) .or_insert(root_tao); } - log::debug!("tao_dividends: {:?}", tao_dividends); + log::debug!("tao_dividends: {tao_dividends:?}"); // Compute proportional alpha divs using the pending alpha and total alpha divs from the epoch. let mut prop_alpha_dividends: BTreeMap = BTreeMap::new(); for (hotkey, alpha_divs) in alpha_dividends { // Alpha proportion. let alpha_share: U96F32 = alpha_divs.checked_div(total_alpha_divs).unwrap_or(zero); - log::debug!("hotkey: {:?}, alpha_share: {:?}", hotkey, alpha_share); + log::debug!("hotkey: {hotkey:?}, alpha_share: {alpha_share:?}"); // Compute the proportional pending_alpha to this hotkey. let prop_alpha = asfloat!(pending_alpha).saturating_mul(alpha_share); - log::debug!("hotkey: {:?}, prop_alpha: {:?}", hotkey, prop_alpha); + log::debug!("hotkey: {hotkey:?}, prop_alpha: {prop_alpha:?}"); // Record the proportional alpha dividends. prop_alpha_dividends .entry(hotkey.clone()) .and_modify(|e| *e = prop_alpha) .or_insert(prop_alpha); } - log::debug!("prop_alpha_dividends: {:?}", prop_alpha_dividends); + log::debug!("prop_alpha_dividends: {prop_alpha_dividends:?}"); (prop_alpha_dividends, tao_dividends) } @@ -441,10 +437,7 @@ impl Pallet { if let Ok(owner_hotkey) = SubnetOwnerHotkey::::try_get(netuid) { // Increase stake for owner hotkey and coldkey. log::debug!( - "owner_hotkey: {:?} owner_coldkey: {:?}, owner_cut: {:?}", - owner_hotkey, - owner_coldkey, - owner_cut + "owner_hotkey: {owner_hotkey:?} owner_coldkey: {owner_coldkey:?}, owner_cut: {owner_cut:?}" ); let real_owner_cut = Self::increase_stake_for_hotkey_and_coldkey_on_subnet( &owner_hotkey, @@ -461,14 +454,12 @@ impl Pallet { // Distribute mining incentives. for (hotkey, incentive) in incentives { - log::debug!("incentives: hotkey: {:?}", incentive); + log::debug!("incentives: hotkey: {incentive:?}"); if let Ok(owner_hotkey) = SubnetOwnerHotkey::::try_get(netuid) { if hotkey == owner_hotkey { log::debug!( - "incentives: hotkey: {:?} is SN owner hotkey, skipping {:?}", - hotkey, - incentive + "incentives: hotkey: {hotkey:?} is SN owner hotkey, skipping {incentive:?}" ); continue; // Skip/burn miner-emission for SN owner hotkey. } @@ -491,7 +482,7 @@ impl Pallet { // Remove take prop from alpha_divs alpha_divs = alpha_divs.saturating_sub(alpha_take); // Give the validator their take. - log::debug!("hotkey: {:?} alpha_take: {:?}", hotkey, alpha_take); + log::debug!("hotkey: {hotkey:?} alpha_take: {alpha_take:?}"); Self::increase_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &Owner::::get(&hotkey), @@ -499,7 +490,7 @@ impl Pallet { tou64!(alpha_take).into(), ); // Give all other nominators. - log::debug!("hotkey: {:?} alpha_divs: {:?}", hotkey, alpha_divs); + log::debug!("hotkey: {hotkey:?} alpha_divs: {alpha_divs:?}"); Self::increase_stake_for_hotkey_on_subnet(&hotkey, netuid, tou64!(alpha_divs).into()); // Record dividends for this hotkey. AlphaDividendsPerSubnet::::mutate(netuid, &hotkey, |divs| { @@ -519,7 +510,7 @@ impl Pallet { // Remove take prop from root_tao root_tao = root_tao.saturating_sub(tao_take); // Give the validator their take. - log::debug!("hotkey: {:?} tao_take: {:?}", hotkey, tao_take); + log::debug!("hotkey: {hotkey:?} tao_take: {tao_take:?}"); let validator_stake = Self::increase_stake_for_hotkey_and_coldkey_on_subnet( &hotkey, &Owner::::get(hotkey.clone()), @@ -527,7 +518,7 @@ impl Pallet { tou64!(tao_take).into(), ); // Give rest to nominators. - log::debug!("hotkey: {:?} root_tao: {:?}", hotkey, root_tao); + log::debug!("hotkey: {hotkey:?} root_tao: {root_tao:?}"); Self::increase_stake_for_hotkey_on_subnet( &hotkey, NetUid::ROOT, @@ -598,12 +589,7 @@ impl Pallet { owner_cut: AlphaCurrency, ) { log::debug!( - "Draining pending alpha emission for netuid {:?}, pending_alpha: {:?}, pending_tao: {:?}, pending_swapped: {:?}, owner_cut: {:?}", - netuid, - pending_alpha, - pending_tao, - pending_swapped, - owner_cut + "Draining pending alpha emission for netuid {netuid:?}, pending_alpha: {pending_alpha:?}, pending_tao: {pending_tao:?}, pending_swapped: {pending_swapped:?}, owner_cut: {owner_cut:?}" ); let tao_weight = Self::get_tao_weight(); @@ -611,7 +597,7 @@ impl Pallet { // Run the epoch. let hotkey_emission: Vec<(T::AccountId, AlphaCurrency, AlphaCurrency)> = Self::epoch(netuid, pending_alpha.saturating_add(pending_swapped)); - log::debug!("hotkey_emission: {:?}", hotkey_emission); + log::debug!("hotkey_emission: {hotkey_emission:?}"); // Compute the pending validator alpha. // This is the total alpha being injected, @@ -623,7 +609,7 @@ impl Pallet { .fold(AlphaCurrency::default(), |acc, (_, incentive, _)| { acc.saturating_add(*incentive) }); - log::debug!("incentive_sum: {:?}", incentive_sum); + log::debug!("incentive_sum: {incentive_sum:?}"); let pending_validator_alpha = if !incentive_sum.is_zero() { pending_alpha @@ -713,11 +699,7 @@ impl Pallet { let childkey_take_proportion: U96F32 = U96F32::saturating_from_num(Self::get_childkey_take(hotkey, netuid)) .safe_div(U96F32::saturating_from_num(u16::MAX)); - log::debug!( - "Childkey take proportion: {:?} for hotkey {:?}", - childkey_take_proportion, - hotkey - ); + log::debug!("Childkey take proportion: {childkey_take_proportion:?} for hotkey {hotkey:?}"); // NOTE: Only the validation emission should be split amongst parents. // Grab the owner of the childkey. @@ -737,10 +719,7 @@ impl Pallet { // Get self contribution, removing any childkey proportions. let self_contribution = Self::get_self_contribution(hotkey, netuid); log::debug!( - "Self contribution for hotkey {:?} on netuid {:?}: {:?}", - hotkey, - netuid, - self_contribution + "Self contribution for hotkey {hotkey:?} on netuid {netuid:?}: {self_contribution:?}" ); // Add self contribution to total contribution but not to the parent contributions. total_contribution = @@ -772,10 +751,7 @@ impl Pallet { // Store the parent's contributions for later use parent_contributions.push((parent.clone(), combined_contribution)); log::debug!( - "Parent contribution for hotkey {:?} from parent {:?}: {:?}", - hotkey, - parent, - combined_contribution + "Parent contribution for hotkey {hotkey:?} from parent {parent:?}: {combined_contribution:?}" ); } @@ -810,17 +786,9 @@ impl Pallet { total_child_emission_take = total_child_emission_take.saturating_add(child_emission_take); - log::debug!( - "Child emission take: {:?} for hotkey {:?}", - child_emission_take, - hotkey - ); - log::debug!( - "Parent emission: {:?} for hotkey {:?}", - parent_emission, - hotkey - ); - log::debug!("remaining emission: {:?}", remaining_emission); + log::debug!("Child emission take: {child_emission_take:?} for hotkey {hotkey:?}"); + log::debug!("Parent emission: {parent_emission:?} for hotkey {hotkey:?}"); + log::debug!("remaining emission: {remaining_emission:?}"); // Add the parent's emission to the distribution list dividend_tuples.push(( @@ -831,13 +799,7 @@ impl Pallet { // Keep track of total emission distributed to parents to_parents = to_parents.saturating_add(parent_emission.saturating_to_num::()); log::debug!( - "Parent contribution for parent {:?} with contribution: {:?}, of total: {:?} ({:?}), of emission: {:?} gets: {:?}", - parent, - contribution, - total_contribution, - emission_factor, - validating_emission, - parent_emission, + "Parent contribution for parent {parent:?} with contribution: {contribution:?}, of total: {total_contribution:?} ({emission_factor:?}), of emission: {validating_emission:?} gets: {parent_emission:?}", ); } // Calculate the final emission for the hotkey itself. diff --git a/pallets/subtensor/src/epoch/run_epoch.rs b/pallets/subtensor/src/epoch/run_epoch.rs index c536ffff82..ce3d3fd208 100644 --- a/pallets/subtensor/src/epoch/run_epoch.rs +++ b/pallets/subtensor/src/epoch/run_epoch.rs @@ -16,7 +16,7 @@ impl Pallet { ) -> Vec<(T::AccountId, AlphaCurrency, AlphaCurrency)> { // Get subnetwork size. let n: u16 = Self::get_subnetwork_n(netuid); - log::trace!("n: {:?}", n); + log::trace!("n: {n:?}"); // ====================== // == Active & updated == @@ -24,15 +24,15 @@ impl Pallet { // Get current block. let current_block: u64 = Self::get_current_block_as_u64(); - log::trace!("current_block: {:?}", current_block); + log::trace!("current_block: {current_block:?}"); // Get tempo. let tempo: u64 = Self::get_tempo(netuid).into(); - log::trace!("tempo: {:?}", tempo); + log::trace!("tempo: {tempo:?}"); // Get activity cutoff. let activity_cutoff: u64 = Self::get_activity_cutoff(netuid) as u64; - log::trace!("activity_cutoff: {:?}", activity_cutoff); + log::trace!("activity_cutoff: {activity_cutoff:?}"); // Last update vector. let last_update: Vec = Self::get_last_update(netuid); @@ -112,19 +112,19 @@ impl Pallet { // Get validator permits. let validator_permits: Vec = Self::get_validator_permit(netuid); - log::trace!("validator_permits: {:?}", validator_permits); + log::trace!("validator_permits: {validator_permits:?}"); // Logical negation of validator_permits. let validator_forbids: Vec = validator_permits.iter().map(|&b| !b).collect(); // Get max allowed validators. let max_allowed_validators: u16 = Self::get_max_allowed_validators(netuid); - log::trace!("max_allowed_validators: {:?}", max_allowed_validators); + log::trace!("max_allowed_validators: {max_allowed_validators:?}"); // Get new validator permits. let new_validator_permits: Vec = is_topk_nonzero(&stake, max_allowed_validators as usize); - log::trace!("new_validator_permits: {:?}", new_validator_permits); + log::trace!("new_validator_permits: {new_validator_permits:?}"); // ================== // == Active Stake == @@ -448,7 +448,7 @@ impl Pallet { ) -> Vec<(T::AccountId, AlphaCurrency, AlphaCurrency)> { // Get subnetwork size. let n = Self::get_subnetwork_n(netuid); - log::trace!("Number of Neurons in Network: {:?}", n); + log::trace!("Number of Neurons in Network: {n:?}"); // ====================== // == Active & updated == @@ -456,15 +456,15 @@ impl Pallet { // Get current block. let current_block: u64 = Self::get_current_block_as_u64(); - log::trace!("current_block: {:?}", current_block); + log::trace!("current_block: {current_block:?}"); // Get tempo. let tempo: u64 = Self::get_tempo(netuid).into(); - log::trace!("tempo:\n{:?}\n", tempo); + log::trace!("tempo:\n{tempo:?}\n"); // Get activity cutoff. let activity_cutoff: u64 = Self::get_activity_cutoff(netuid) as u64; - log::trace!("activity_cutoff: {:?}", activity_cutoff); + log::trace!("activity_cutoff: {activity_cutoff:?}"); // Last update vector. let last_update: Vec = Self::get_last_update(netuid); @@ -522,19 +522,19 @@ impl Pallet { // Get current validator permits. let validator_permits: Vec = Self::get_validator_permit(netuid); - log::trace!("validator_permits: {:?}", validator_permits); + log::trace!("validator_permits: {validator_permits:?}"); // Logical negation of validator_permits. let validator_forbids: Vec = validator_permits.iter().map(|&b| !b).collect(); // Get max allowed validators. let max_allowed_validators: u16 = Self::get_max_allowed_validators(netuid); - log::trace!("max_allowed_validators: {:?}", max_allowed_validators); + log::trace!("max_allowed_validators: {max_allowed_validators:?}"); // Get new validator permits. let new_validator_permits: Vec = is_topk_nonzero(&stake, max_allowed_validators as usize); - log::trace!("new_validator_permits: {:?}", new_validator_permits); + log::trace!("new_validator_permits: {new_validator_permits:?}"); // ================== // == Active Stake == @@ -1094,7 +1094,7 @@ impl Pallet { let ema_bonds = mat_ema_sparse(bonds_delta, bonds, alpha); // Log the computed EMA bonds for debugging purposes. - log::trace!("Exponential Moving Average Bonds Normal: {:?}", ema_bonds); + log::trace!("Exponential Moving Average Bonds Normal: {ema_bonds:?}"); // Return the computed EMA bonds. ema_bonds @@ -1128,7 +1128,7 @@ impl Pallet { let ema_bonds = mat_ema(bonds_delta, bonds, alpha); // Log the computed EMA bonds for debugging purposes. - log::trace!("Exponential Moving Average Bonds Normal: {:?}", ema_bonds); + log::trace!("Exponential Moving Average Bonds Normal: {ema_bonds:?}"); // Return the computed EMA bonds. ema_bonds @@ -1408,10 +1408,7 @@ impl Pallet { AlphaValues::::insert(netuid, (alpha_low, alpha_high)); log::debug!( - "AlphaValuesSet( netuid: {:?}, AlphaLow: {:?}, AlphaHigh: {:?} ) ", - netuid, - alpha_low, - alpha_high, + "AlphaValuesSet( netuid: {netuid:?}, AlphaLow: {alpha_low:?}, AlphaHigh: {alpha_high:?} ) ", ); Ok(()) } @@ -1435,12 +1432,10 @@ impl Pallet { .collect::>(), ); } - log::debug!("Reset bonds for {:?}, netuid {:?}", account_id, netuid); + log::debug!("Reset bonds for {account_id:?}, netuid {netuid:?}"); } else { log::warn!( - "Uid not found for {:?}, netuid {:?} - skipping bonds reset", - account_id, - netuid + "Uid not found for {account_id:?}, netuid {netuid:?} - skipping bonds reset" ); } diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index e61aae04e5..f8474bff0a 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -281,8 +281,10 @@ pub mod pallet { /// Struct for SubnetIdentitiesV3. pub type SubnetIdentityOfV3 = SubnetIdentityV3; /// Data structure for Subnet Identities - #[crate::freeze_struct("3618af6beb882a23")] - #[derive(Encode, Decode, Default, TypeInfo, Clone, PartialEq, Eq, Debug)] + #[crate::freeze_struct("6a441335f985a0b")] + #[derive( + Encode, Decode, DecodeWithMemTracking, Default, TypeInfo, Clone, PartialEq, Eq, Debug, + )] pub struct SubnetIdentityV3 { /// The name of the subnet pub subnet_name: Vec, diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 01ba58ef3b..6f90f02340 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -77,7 +77,7 @@ mod dispatches { /// * 'MaxWeightExceeded': /// - Attempting to set weights with max value exceeding limit. #[pallet::call_index(0)] - #[pallet::weight((Weight::from_parts(20_730_000_000, 0) + #[pallet::weight((Weight::from_parts(15_540_000_000, 0) .saturating_add(T::DbWeight::get().reads(4111)) .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] pub fn set_weights( @@ -965,7 +965,7 @@ mod dispatches { /// /// Weight is calculated based on the number of database reads and writes. #[pallet::call_index(71)] - #[pallet::weight((Weight::from_parts(208600000, 0) + #[pallet::weight((Weight::from_parts(161_700_000, 0) .saturating_add(T::DbWeight::get().reads(14)) .saturating_add(T::DbWeight::get().writes(9)), DispatchClass::Operational, Pays::No))] pub fn swap_coldkey( diff --git a/pallets/subtensor/src/migrations/migrate_chain_identity.rs b/pallets/subtensor/src/migrations/migrate_chain_identity.rs index 142eb099de..735e63168c 100644 --- a/pallets/subtensor/src/migrations/migrate_chain_identity.rs +++ b/pallets/subtensor/src/migrations/migrate_chain_identity.rs @@ -73,11 +73,11 @@ pub fn migrate_set_hotkey_identities() -> Weight { let decoded_hotkey: T::AccountId = match T::AccountId::decode(&mut hotkey.as_ref()) { Ok(decoded) => decoded, Err(e) => { - log::warn!("Failed to decode hotkey: {:?}. Skipping this delegate.", e); + log::warn!("Failed to decode hotkey: {e:?}. Skipping this delegate."); continue; } }; - log::info!("Hotkey unwrapped: {:?}", decoded_hotkey); + log::info!("Hotkey unwrapped: {decoded_hotkey:?}"); // If we should continue with real values. let mut name: BoundedVec> = BoundedVec::default(); @@ -109,7 +109,7 @@ pub fn migrate_set_hotkey_identities() -> Weight { }; // Log the identity details - log::info!("Setting identity for hotkey: {:?}", hotkey); + log::info!("Setting identity for hotkey: {hotkey:?}"); log::info!("Name: {:?}", String::from_utf8_lossy(&identity.name)); log::info!("URL: {:?}", String::from_utf8_lossy(&identity.url)); log::info!("Image: {:?}", String::from_utf8_lossy(&identity.image)); @@ -146,7 +146,7 @@ pub fn migrate_set_hotkey_identities() -> Weight { // Get the owning coldkey. let coldkey = Owner::::get(decoded_hotkey.clone()); - log::info!("ColdKey: {:?}", decoded_hotkey); + log::info!("ColdKey: {decoded_hotkey:?}"); weight = weight.saturating_add(T::DbWeight::get().reads(1)); diff --git a/pallets/subtensor/src/migrations/migrate_commit_reveal_v2.rs b/pallets/subtensor/src/migrations/migrate_commit_reveal_v2.rs index 344d72cb46..bedc43d724 100644 --- a/pallets/subtensor/src/migrations/migrate_commit_reveal_v2.rs +++ b/pallets/subtensor/src/migrations/migrate_commit_reveal_v2.rs @@ -42,10 +42,7 @@ pub fn migrate_commit_reveal_2() -> Weight { weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count)); - log::info!( - "Removed {:?} entries from WeightCommitRevealInterval.", - removed_entries_count - ); + log::info!("Removed {removed_entries_count:?} entries from WeightCommitRevealInterval."); // ------------------------------ // Step 2: Remove WeightCommits entries @@ -67,10 +64,7 @@ pub fn migrate_commit_reveal_2() -> Weight { weight = weight.saturating_add(T::DbWeight::get().writes(removed_commits_entries)); - log::info!( - "Removed {} entries from WeightCommits.", - removed_commits_entries - ); + log::info!("Removed {removed_commits_entries} entries from WeightCommits."); // ------------------------------ // Step 3: Mark Migration as Completed diff --git a/pallets/subtensor/src/migrations/migrate_delete_subnet_21.rs b/pallets/subtensor/src/migrations/migrate_delete_subnet_21.rs index eae5eedc87..e6a8c72eae 100644 --- a/pallets/subtensor/src/migrations/migrate_delete_subnet_21.rs +++ b/pallets/subtensor/src/migrations/migrate_delete_subnet_21.rs @@ -51,7 +51,7 @@ pub fn migrate_delete_subnet_21() -> Weight { // Only runs if we haven't already updated version past above new_storage_version and subnet 21 exists. if onchain_version < new_storage_version && Pallet::::if_subnet_exist(NetUid::from(21)) { - info!(target: LOG_TARGET, ">>> Removing subnet 21 {:?}", onchain_version); + info!(target: LOG_TARGET, ">>> Removing subnet 21 {onchain_version:?}"); let netuid = NetUid::from(21); diff --git a/pallets/subtensor/src/migrations/migrate_delete_subnet_3.rs b/pallets/subtensor/src/migrations/migrate_delete_subnet_3.rs index a30f0a84ea..c479bd613a 100644 --- a/pallets/subtensor/src/migrations/migrate_delete_subnet_3.rs +++ b/pallets/subtensor/src/migrations/migrate_delete_subnet_3.rs @@ -53,8 +53,7 @@ pub fn migrate_delete_subnet_3() -> Weight { if onchain_version < new_storage_version && Pallet::::if_subnet_exist(3.into()) { info!( target: LOG_TARGET, - "Removing subnet 3. Current version: {:?}", - onchain_version + "Removing subnet 3. Current version: {onchain_version:?}" ); let netuid = NetUid::from(3); diff --git a/pallets/subtensor/src/migrations/migrate_fix_root_subnet_tao.rs b/pallets/subtensor/src/migrations/migrate_fix_root_subnet_tao.rs index 96593b9e5c..19d9b49406 100644 --- a/pallets/subtensor/src/migrations/migrate_fix_root_subnet_tao.rs +++ b/pallets/subtensor/src/migrations/migrate_fix_root_subnet_tao.rs @@ -28,11 +28,7 @@ pub fn migrate_fix_root_subnet_tao() -> Weight { hotkey_count = hotkey_count.saturating_add(1); } - log::info!( - "Total stake: {}, hotkey count: {}", - total_stake, - hotkey_count - ); + log::info!("Total stake: {total_stake}, hotkey count: {hotkey_count}"); weight = weight.saturating_add(T::DbWeight::get().reads(hotkey_count).saturating_mul(2)); diff --git a/pallets/subtensor/src/migrations/migrate_init_total_issuance.rs b/pallets/subtensor/src/migrations/migrate_init_total_issuance.rs index 5bccfff9a0..a485d12bd2 100644 --- a/pallets/subtensor/src/migrations/migrate_init_total_issuance.rs +++ b/pallets/subtensor/src/migrations/migrate_init_total_issuance.rs @@ -33,9 +33,7 @@ pub(crate) fn migrate_init_total_issuance() -> Weight { // Update the total stake in storage crate::TotalStake::::put(total_stake); log::info!( - "Subtensor Pallet Total Stake Updated: previous: {:?}, new: {:?}", - prev_total_stake, - total_stake + "Subtensor Pallet Total Stake Updated: previous: {prev_total_stake:?}, new: {total_stake:?}" ); // Retrieve the previous total issuance for logging purposes let prev_total_issuance = crate::TotalIssuance::::get(); @@ -48,9 +46,7 @@ pub(crate) fn migrate_init_total_issuance() -> Weight { // Log the change in total issuance log::info!( - "Subtensor Pallet Total Issuance Updated: previous: {:?}, new: {:?}", - prev_total_issuance, - new_total_issuance + "Subtensor Pallet Total Issuance Updated: previous: {prev_total_issuance:?}, new: {new_total_issuance:?}" ); // Return the weight of the operation diff --git a/pallets/subtensor/src/migrations/migrate_populate_owned_hotkeys.rs b/pallets/subtensor/src/migrations/migrate_populate_owned_hotkeys.rs index e8fd212ec3..26d35dbd09 100644 --- a/pallets/subtensor/src/migrations/migrate_populate_owned_hotkeys.rs +++ b/pallets/subtensor/src/migrations/migrate_populate_owned_hotkeys.rs @@ -30,7 +30,7 @@ pub fn migrate_populate_owned() -> Weight { // Only runs if the migration is needed if migrate { - info!(target: LOG_TARGET_1, ">>> Starting Migration: {}", migration_name); + info!(target: LOG_TARGET_1, ">>> Starting Migration: {migration_name}"); let mut longest_hotkey_vector: usize = 0; let mut longest_coldkey: Option = None; @@ -67,16 +67,15 @@ pub fn migrate_populate_owned() -> Weight { // Log migration results info!( target: LOG_TARGET_1, - "Migration {} finished. Keys touched: {}, Longest hotkey vector: {}, Storage reads: {}, Storage writes: {}", - migration_name, keys_touched, longest_hotkey_vector, storage_reads, storage_writes + "Migration {migration_name} finished. Keys touched: {keys_touched}, Longest hotkey vector: {longest_hotkey_vector}, Storage reads: {storage_reads}, Storage writes: {storage_writes}" ); if let Some(c) = longest_coldkey { - info!(target: LOG_TARGET_1, "Longest hotkey vector is controlled by: {:?}", c); + info!(target: LOG_TARGET_1, "Longest hotkey vector is controlled by: {c:?}"); } weight } else { - info!(target: LOG_TARGET_1, "Migration {} already done!", migration_name); + info!(target: LOG_TARGET_1, "Migration {migration_name} already done!"); Weight::zero() } } diff --git a/pallets/subtensor/src/migrations/migrate_rao.rs b/pallets/subtensor/src/migrations/migrate_rao.rs index d529e77098..8237385181 100644 --- a/pallets/subtensor/src/migrations/migrate_rao.rs +++ b/pallets/subtensor/src/migrations/migrate_rao.rs @@ -119,7 +119,7 @@ pub fn migrate_rao() -> Weight { if !IdentitiesV2::::contains_key(owner_coldkey.clone()) { // Set the identitiy for the Owner coldkey if non existent. let identity = ChainIdentityOfV2 { - name: format!("Owner{}", netuid).as_bytes().to_vec(), + name: format!("Owner{netuid}").as_bytes().to_vec(), url: Vec::new(), image: Vec::new(), github_repo: Vec::new(), diff --git a/pallets/subtensor/src/migrations/migrate_remove_commitments_rate_limit.rs b/pallets/subtensor/src/migrations/migrate_remove_commitments_rate_limit.rs index 5544467a13..06fcad0a10 100644 --- a/pallets/subtensor/src/migrations/migrate_remove_commitments_rate_limit.rs +++ b/pallets/subtensor/src/migrations/migrate_remove_commitments_rate_limit.rs @@ -37,7 +37,7 @@ pub fn migrate_remove_commitments_rate_limit() -> Weight { }; weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries)); - log::info!("Removed {} entries from `RateLimit`.", removed_entries); + log::info!("Removed {removed_entries} entries from `RateLimit`."); // ------------------------------------------------------------- // Step 2: Mark this migration as completed diff --git a/pallets/subtensor/src/migrations/migrate_remove_stake_map.rs b/pallets/subtensor/src/migrations/migrate_remove_stake_map.rs index cef2dad873..bffe7f8fe5 100644 --- a/pallets/subtensor/src/migrations/migrate_remove_stake_map.rs +++ b/pallets/subtensor/src/migrations/migrate_remove_stake_map.rs @@ -34,17 +34,14 @@ pub fn migrate_remove_stake_map() -> Weight { let removed_entries_count = match removal_results { KillStorageResult::AllRemoved(removed) => removed as u64, KillStorageResult::SomeRemaining(removed) => { - log::info!("Failed To Remove Some Items During {:?}", migration_name); + log::info!("Failed To Remove Some Items During {migration_name:?}"); removed as u64 } }; weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count)); - log::info!( - "Removed {:?} entries from Stake map.", - removed_entries_count - ); + log::info!("Removed {removed_entries_count:?} entries from Stake map."); // ------------------------------ // Step 2: Mark Migration as Completed diff --git a/pallets/subtensor/src/migrations/migrate_remove_total_hotkey_coldkey_stakes_this_interval.rs b/pallets/subtensor/src/migrations/migrate_remove_total_hotkey_coldkey_stakes_this_interval.rs index 16782a5d8c..9d6b2d681f 100644 --- a/pallets/subtensor/src/migrations/migrate_remove_total_hotkey_coldkey_stakes_this_interval.rs +++ b/pallets/subtensor/src/migrations/migrate_remove_total_hotkey_coldkey_stakes_this_interval.rs @@ -9,14 +9,11 @@ pub fn migrate_remove_total_hotkey_coldkey_stakes_this_interval() -> let mut weight = T::DbWeight::get().reads(1); if HasMigrationRun::::get(&migration_name_bytes) { - log::info!( - "Migration '{:?}' has already run. Skipping.", - migration_name - ); + log::info!("Migration '{migration_name:?}' has already run. Skipping."); return weight; } - log::info!("Running migration '{}'", migration_name); + log::info!("Running migration '{migration_name}'"); let pallet_name = twox_128(b"SubtensorModule"); let storage_name = twox_128(b"TotalHotkeyColdkeyStakesThisInterval"); @@ -25,7 +22,7 @@ pub fn migrate_remove_total_hotkey_coldkey_stakes_this_interval() -> // Remove all entries. let removed_entries_count = match clear_prefix(&prefix, Some(u32::MAX)) { KillStorageResult::AllRemoved(removed) => { - log::info!("Removed all entries from {:?}.", storage_name); + log::info!("Removed all entries from {storage_name:?}."); // Mark migration as completed HasMigrationRun::::insert(&migration_name_bytes, true); @@ -34,7 +31,7 @@ pub fn migrate_remove_total_hotkey_coldkey_stakes_this_interval() -> removed as u64 } KillStorageResult::SomeRemaining(removed) => { - log::info!("Failed to remove all entries from {:?}", storage_name); + log::info!("Failed to remove all entries from {storage_name:?}"); removed as u64 } }; @@ -42,9 +39,7 @@ pub fn migrate_remove_total_hotkey_coldkey_stakes_this_interval() -> weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count as u64)); log::info!( - "Migration '{:?}' completed successfully. {:?} entries removed.", - migration_name, - removed_entries_count + "Migration '{migration_name:?}' completed successfully. {removed_entries_count:?} entries removed." ); weight diff --git a/pallets/subtensor/src/migrations/migrate_remove_unused_maps_and_values.rs b/pallets/subtensor/src/migrations/migrate_remove_unused_maps_and_values.rs index 6ad34baf24..701ab14893 100644 --- a/pallets/subtensor/src/migrations/migrate_remove_unused_maps_and_values.rs +++ b/pallets/subtensor/src/migrations/migrate_remove_unused_maps_and_values.rs @@ -23,11 +23,7 @@ fn remove_prefix(old_map: &str, weight: &mut Weight) { } }; - log::info!( - "Removed {:?} entries from {:?} map.", - removed_entries_count, - old_map - ); + log::info!("Removed {removed_entries_count:?} entries from {old_map:?} map."); *weight = (*weight).saturating_add(T::DbWeight::get().writes(removed_entries_count)); } diff --git a/pallets/subtensor/src/migrations/migrate_remove_zero_total_hotkey_alpha.rs b/pallets/subtensor/src/migrations/migrate_remove_zero_total_hotkey_alpha.rs index b85ee78af6..94458a88b3 100644 --- a/pallets/subtensor/src/migrations/migrate_remove_zero_total_hotkey_alpha.rs +++ b/pallets/subtensor/src/migrations/migrate_remove_zero_total_hotkey_alpha.rs @@ -40,10 +40,7 @@ pub fn migrate_remove_zero_total_hotkey_alpha() -> Weight { weight = weight.saturating_add(T::DbWeight::get().reads(removed_entries_count)); weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count)); - log::info!( - "Removed {} zero entries from TotalHotkeyAlpha.", - removed_entries_count - ); + log::info!("Removed {removed_entries_count} zero entries from TotalHotkeyAlpha."); // ------------------------------ // Step 2: Mark Migration as Completed diff --git a/pallets/subtensor/src/migrations/migrate_reset_bonds_moving_average.rs b/pallets/subtensor/src/migrations/migrate_reset_bonds_moving_average.rs index 5505e49e84..9825aed391 100644 --- a/pallets/subtensor/src/migrations/migrate_reset_bonds_moving_average.rs +++ b/pallets/subtensor/src/migrations/migrate_reset_bonds_moving_average.rs @@ -39,10 +39,7 @@ pub fn migrate_reset_bonds_moving_average() -> Weight { weight = weight .saturating_add(T::DbWeight::get().reads_writes(reset_entries_count, reset_entries_count)); - log::info!( - "Reset {} subnets from BondsMovingAverage.", - reset_entries_count - ); + log::info!("Reset {reset_entries_count} subnets from BondsMovingAverage."); // ------------------------------ // Step 2: Mark Migration as Completed diff --git a/pallets/subtensor/src/migrations/migrate_reset_max_burn.rs b/pallets/subtensor/src/migrations/migrate_reset_max_burn.rs index 4de473b2fb..c5f1dcc2bf 100644 --- a/pallets/subtensor/src/migrations/migrate_reset_max_burn.rs +++ b/pallets/subtensor/src/migrations/migrate_reset_max_burn.rs @@ -39,7 +39,7 @@ pub fn migrate_reset_max_burn() -> Weight { weight = weight .saturating_add(T::DbWeight::get().reads_writes(reset_entries_count, reset_entries_count)); - log::info!("Reset {} subnets from MaxBurn.", reset_entries_count); + log::info!("Reset {reset_entries_count} subnets from MaxBurn."); // ------------------------------ // Step 2: Mark Migration as Completed diff --git a/pallets/subtensor/src/migrations/migrate_subnet_volume.rs b/pallets/subtensor/src/migrations/migrate_subnet_volume.rs index 5d9a8583d4..eb763e68e0 100644 --- a/pallets/subtensor/src/migrations/migrate_subnet_volume.rs +++ b/pallets/subtensor/src/migrations/migrate_subnet_volume.rs @@ -28,7 +28,7 @@ pub fn migrate_subnet_volume() -> Weight { Some(old_value as u128) // Convert and store as u128 }); - log::info!("Migrated {} entries in SubnetVolume", migrated); + log::info!("Migrated {migrated} entries in SubnetVolume"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(migrated, migrated)); // Mark the migration as completed diff --git a/pallets/subtensor/src/migrations/migrate_to_v1_separate_emission.rs b/pallets/subtensor/src/migrations/migrate_to_v1_separate_emission.rs index 84d8a681da..f6816b291d 100644 --- a/pallets/subtensor/src/migrations/migrate_to_v1_separate_emission.rs +++ b/pallets/subtensor/src/migrations/migrate_to_v1_separate_emission.rs @@ -51,7 +51,7 @@ pub fn migrate_to_v1_separate_emission() -> Weight { if onchain_version < 1 { info!( target: LOG_TARGET, - ">>> Updating the LoadedEmission to a new format {:?}", onchain_version + ">>> Updating the LoadedEmission to a new format {onchain_version:?}" ); // Collect all network IDs (netuids) from old LoadedEmission storage @@ -63,10 +63,7 @@ pub fn migrate_to_v1_separate_emission() -> Weight { if old::LoadedEmission::::try_get(netuid).is_err() { weight.saturating_accrue(T::DbWeight::get().writes(1)); old::LoadedEmission::::remove(netuid); - warn!( - "Was unable to decode old loaded_emission for netuid {}", - netuid - ); + warn!("Was unable to decode old loaded_emission for netuid {netuid}"); } } @@ -75,7 +72,7 @@ pub fn migrate_to_v1_separate_emission() -> Weight { |netuid: NetUid, netuid_emissions: Vec<(AccountIdOf, u64)>| -> Option, u64, u64)>> { - info!(target: LOG_TARGET, " Do migration of netuid: {:?}...", netuid); + info!(target: LOG_TARGET, " Do migration of netuid: {netuid:?}..."); // Convert old format (server, validator_emission) to new format (server, server_emission, validator_emission) // Assume all loaded emission is validator emissions diff --git a/pallets/subtensor/src/migrations/migrate_to_v2_fixed_total_stake.rs b/pallets/subtensor/src/migrations/migrate_to_v2_fixed_total_stake.rs index 6410f79321..c8ea6a33af 100644 --- a/pallets/subtensor/src/migrations/migrate_to_v2_fixed_total_stake.rs +++ b/pallets/subtensor/src/migrations/migrate_to_v2_fixed_total_stake.rs @@ -52,8 +52,7 @@ pub fn migrate_to_v2_fixed_total_stake() -> Weight { if onchain_version < new_storage_version { info!( target: LOG_TARGET, - "Fixing the TotalStake and TotalColdkeyStake storage. Current version: {:?}", - onchain_version + "Fixing the TotalStake and TotalColdkeyStake storage. Current version: {onchain_version:?}" ); // TODO: Fix or remove migration diff --git a/pallets/subtensor/src/migrations/migrate_transfer_ownership_to_foundation.rs b/pallets/subtensor/src/migrations/migrate_transfer_ownership_to_foundation.rs index 25a11958f0..cf9b1fdf07 100644 --- a/pallets/subtensor/src/migrations/migrate_transfer_ownership_to_foundation.rs +++ b/pallets/subtensor/src/migrations/migrate_transfer_ownership_to_foundation.rs @@ -51,15 +51,14 @@ pub fn migrate_transfer_ownership_to_foundation(coldkey: [u8; 32]) -> if onchain_version < new_storage_version { info!( target: LOG_TARGET, - "Migrating subnet 1 and 11 to foundation control. Current version: {:?}", - onchain_version + "Migrating subnet 1 and 11 to foundation control. Current version: {onchain_version:?}" ); // Decode the foundation's coldkey into an AccountId // TODO: Consider error handling for decoding failure let coldkey_account: T::AccountId = T::AccountId::decode(&mut &coldkey[..]) .expect("coldkey should be a valid 32-byte array"); - info!(target: LOG_TARGET, "Foundation coldkey: {:?}", coldkey_account); + info!(target: LOG_TARGET, "Foundation coldkey: {coldkey_account:?}"); // Get the current block number let current_block = Pallet::::get_current_block_as_u64(); diff --git a/pallets/subtensor/src/migrations/migrate_upgrade_revealed_commitments.rs b/pallets/subtensor/src/migrations/migrate_upgrade_revealed_commitments.rs index eb15bfe0af..6c10bf24e3 100644 --- a/pallets/subtensor/src/migrations/migrate_upgrade_revealed_commitments.rs +++ b/pallets/subtensor/src/migrations/migrate_upgrade_revealed_commitments.rs @@ -38,10 +38,7 @@ pub fn migrate_upgrade_revealed_commitments() -> Weight { }; weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count)); - log::info!( - "Removed {} entries from `RevealedCommitments`.", - removed_entries_count - ); + log::info!("Removed {removed_entries_count} entries from `RevealedCommitments`."); // ------------------------------------------------------------- // 2) Mark this migration as completed diff --git a/pallets/subtensor/src/migrations/mod.rs b/pallets/subtensor/src/migrations/mod.rs index 3acf7fafc9..0c56f222c0 100644 --- a/pallets/subtensor/src/migrations/mod.rs +++ b/pallets/subtensor/src/migrations/mod.rs @@ -57,7 +57,7 @@ pub(crate) fn migrate_storage( return weight; } - log::info!("Running migration '{}'", migration_name); + log::info!("Running migration '{migration_name}'"); let pallet_name = twox_128(pallet_name.as_bytes()); let storage_name = twox_128(storage_name.as_bytes()); @@ -66,7 +66,7 @@ pub(crate) fn migrate_storage( // Remove all entries. let removed_entries_count = match clear_prefix(&prefix, Some(u32::MAX)) { KillStorageResult::AllRemoved(removed) => { - log::info!("Removed all entries from {:?}.", storage_name); + log::info!("Removed all entries from {storage_name:?}."); // Mark migration as completed HasMigrationRun::::insert(&migration_name_bytes, true); @@ -75,7 +75,7 @@ pub(crate) fn migrate_storage( removed as u64 } KillStorageResult::SomeRemaining(removed) => { - log::info!("Failed to remove all entries from {:?}", storage_name); + log::info!("Failed to remove all entries from {storage_name:?}"); removed as u64 } }; @@ -83,9 +83,7 @@ pub(crate) fn migrate_storage( weight = weight.saturating_add(T::DbWeight::get().writes(removed_entries_count as u64)); log::info!( - "Migration '{:?}' completed successfully. {:?} entries removed.", - migration_name, - removed_entries_count + "Migration '{migration_name:?}' completed successfully. {removed_entries_count:?} entries removed." ); weight diff --git a/pallets/subtensor/src/staking/add_stake.rs b/pallets/subtensor/src/staking/add_stake.rs index 7388c9484a..f1b06e9843 100644 --- a/pallets/subtensor/src/staking/add_stake.rs +++ b/pallets/subtensor/src/staking/add_stake.rs @@ -46,11 +46,7 @@ impl Pallet { // 1. We check that the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; log::debug!( - "do_add_stake( origin:{:?} hotkey:{:?}, netuid:{:?}, stake_to_be_added:{:?} )", - coldkey, - hotkey, - netuid, - stake_to_be_added + "do_add_stake( origin:{coldkey:?} hotkey:{hotkey:?}, netuid:{netuid:?}, stake_to_be_added:{stake_to_be_added:?} )" ); Self::ensure_subtoken_enabled(netuid)?; @@ -135,11 +131,7 @@ impl Pallet { // 1. We check that the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; log::debug!( - "do_add_stake( origin:{:?} hotkey:{:?}, netuid:{:?}, stake_to_be_added:{:?} )", - coldkey, - hotkey, - netuid, - stake_to_be_added + "do_add_stake( origin:{coldkey:?} hotkey:{hotkey:?}, netuid:{netuid:?}, stake_to_be_added:{stake_to_be_added:?} )" ); // 2. Calculate the maximum amount that can be executed with price limit diff --git a/pallets/subtensor/src/staking/decrease_take.rs b/pallets/subtensor/src/staking/decrease_take.rs index c227aad8a3..43bc633431 100644 --- a/pallets/subtensor/src/staking/decrease_take.rs +++ b/pallets/subtensor/src/staking/decrease_take.rs @@ -34,12 +34,7 @@ impl Pallet { ) -> dispatch::DispatchResult { // --- 1. We check the coldkey signature. let coldkey = ensure_signed(origin)?; - log::debug!( - "do_decrease_take( origin:{:?} hotkey:{:?}, take:{:?} )", - coldkey, - hotkey, - take - ); + log::debug!("do_decrease_take( origin:{coldkey:?} hotkey:{hotkey:?}, take:{take:?} )"); // --- 2. Ensure we are delegating a known key. // Ensure that the coldkey is the owner. @@ -62,12 +57,7 @@ impl Pallet { Self::set_last_tx_block_delegate_take(&hotkey, block); // --- 6. Emit the take value. - log::debug!( - "TakeDecreased( coldkey:{:?}, hotkey:{:?}, take:{:?} )", - coldkey, - hotkey, - take - ); + log::debug!("TakeDecreased( coldkey:{coldkey:?}, hotkey:{hotkey:?}, take:{take:?} )"); Self::deposit_event(Event::TakeDecreased(coldkey, hotkey, take)); // --- 6. Ok and return. diff --git a/pallets/subtensor/src/staking/increase_take.rs b/pallets/subtensor/src/staking/increase_take.rs index 349f86e7cf..3a101c7e0f 100644 --- a/pallets/subtensor/src/staking/increase_take.rs +++ b/pallets/subtensor/src/staking/increase_take.rs @@ -37,12 +37,7 @@ impl Pallet { ) -> dispatch::DispatchResult { // --- 1. We check the coldkey signature. let coldkey = ensure_signed(origin)?; - log::debug!( - "do_increase_take( origin:{:?} hotkey:{:?}, take:{:?} )", - coldkey, - hotkey, - take - ); + log::debug!("do_increase_take( origin:{coldkey:?} hotkey:{hotkey:?}, take:{take:?} )"); // --- 2. Ensure we are delegating a known key. // Ensure that the coldkey is the owner. @@ -74,12 +69,7 @@ impl Pallet { Delegates::::insert(hotkey.clone(), take); // --- 7. Emit the take value. - log::debug!( - "TakeIncreased( coldkey:{:?}, hotkey:{:?}, take:{:?} )", - coldkey, - hotkey, - take - ); + log::debug!("TakeIncreased( coldkey:{coldkey:?}, hotkey:{hotkey:?}, take:{take:?} )"); Self::deposit_event(Event::TakeIncreased(coldkey, hotkey, take)); // --- 8. Ok and return. diff --git a/pallets/subtensor/src/staking/move_stake.rs b/pallets/subtensor/src/staking/move_stake.rs index 15f2dd511a..84a749817c 100644 --- a/pallets/subtensor/src/staking/move_stake.rs +++ b/pallets/subtensor/src/staking/move_stake.rs @@ -88,11 +88,7 @@ impl Pallet { /// Emits a `TransferToggle` event upon successful completion. pub fn toggle_transfer(netuid: NetUid, toggle: bool) -> dispatch::DispatchResult { TransferToggle::::insert(netuid, toggle); - log::debug!( - "TransferToggle( netuid: {:?}, toggle: {:?} ) ", - netuid, - toggle - ); + log::debug!("TransferToggle( netuid: {netuid:?}, toggle: {toggle:?} ) "); Self::deposit_event(Event::TransferToggle(netuid, toggle)); Ok(()) } @@ -150,13 +146,7 @@ impl Pallet { // 9. Emit an event for logging/monitoring. log::debug!( - "StakeTransferred(origin_coldkey: {:?}, destination_coldkey: {:?}, hotkey: {:?}, origin_netuid: {:?}, destination_netuid: {:?}, amount: {:?})", - coldkey, - destination_coldkey, - hotkey, - origin_netuid, - destination_netuid, - tao_moved + "StakeTransferred(origin_coldkey: {coldkey:?}, destination_coldkey: {destination_coldkey:?}, hotkey: {hotkey:?}, origin_netuid: {origin_netuid:?}, destination_netuid: {destination_netuid:?}, amount: {tao_moved:?})" ); Self::deposit_event(Event::StakeTransferred( coldkey, @@ -221,12 +211,7 @@ impl Pallet { // Emit an event for logging. log::debug!( - "StakeSwapped(coldkey: {:?}, hotkey: {:?}, origin_netuid: {:?}, destination_netuid: {:?}, amount: {:?})", - coldkey, - hotkey, - origin_netuid, - destination_netuid, - tao_moved + "StakeSwapped(coldkey: {coldkey:?}, hotkey: {hotkey:?}, origin_netuid: {origin_netuid:?}, destination_netuid: {destination_netuid:?}, amount: {tao_moved:?})" ); Self::deposit_event(Event::StakeSwapped( coldkey, @@ -294,12 +279,7 @@ impl Pallet { // Emit an event for logging. log::debug!( - "StakeSwapped(coldkey: {:?}, hotkey: {:?}, origin_netuid: {:?}, destination_netuid: {:?}, amount: {:?})", - coldkey, - hotkey, - origin_netuid, - destination_netuid, - tao_moved + "StakeSwapped(coldkey: {coldkey:?}, hotkey: {hotkey:?}, origin_netuid: {origin_netuid:?}, destination_netuid: {destination_netuid:?}, amount: {tao_moved:?})" ); Self::deposit_event(Event::StakeSwapped( coldkey, diff --git a/pallets/subtensor/src/staking/remove_stake.rs b/pallets/subtensor/src/staking/remove_stake.rs index afe9d19308..7b9b50959d 100644 --- a/pallets/subtensor/src/staking/remove_stake.rs +++ b/pallets/subtensor/src/staking/remove_stake.rs @@ -45,11 +45,7 @@ impl Pallet { // 1. We check the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; log::debug!( - "do_remove_stake( origin:{:?} hotkey:{:?}, netuid: {:?}, alpha_unstaked:{:?} )", - coldkey, - hotkey, - netuid, - alpha_unstaked + "do_remove_stake( origin:{coldkey:?} hotkey:{hotkey:?}, netuid: {netuid:?}, alpha_unstaked:{alpha_unstaked:?} )" ); Self::ensure_subtoken_enabled(netuid)?; @@ -123,7 +119,7 @@ impl Pallet { ) -> dispatch::DispatchResult { // 1. We check the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; - log::debug!("do_unstake_all( origin:{:?} hotkey:{:?} )", coldkey, hotkey); + log::debug!("do_unstake_all( origin:{coldkey:?} hotkey:{hotkey:?} )"); // 2. Ensure that the hotkey account exists this is only possible through registration. ensure!( @@ -133,7 +129,7 @@ impl Pallet { // 3. Get all netuids. let netuids = Self::get_all_subnet_netuids(); - log::debug!("All subnet netuids: {:?}", netuids); + log::debug!("All subnet netuids: {netuids:?}"); // 4. Iterate through all subnets and remove stake. for netuid in netuids.into_iter() { @@ -213,7 +209,7 @@ impl Pallet { ) -> dispatch::DispatchResult { // 1. We check the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; - log::debug!("do_unstake_all( origin:{:?} hotkey:{:?} )", coldkey, hotkey); + log::debug!("do_unstake_all( origin:{coldkey:?} hotkey:{hotkey:?} )"); // 2. Ensure that the hotkey account exists this is only possible through registration. ensure!( @@ -223,7 +219,7 @@ impl Pallet { // 3. Get all netuids. let netuids = Self::get_all_subnet_netuids(); - log::debug!("All subnet netuids: {:?}", netuids); + log::debug!("All subnet netuids: {netuids:?}"); // 4. Iterate through all subnets and remove stake. let mut total_tao_unstaked: u64 = 0; @@ -337,11 +333,7 @@ impl Pallet { // 1. We check the transaction is signed by the caller and retrieve the T::AccountId coldkey information. let coldkey = ensure_signed(origin)?; log::debug!( - "do_remove_stake( origin:{:?} hotkey:{:?}, netuid: {:?}, alpha_unstaked:{:?} )", - coldkey, - hotkey, - netuid, - alpha_unstaked + "do_remove_stake( origin:{coldkey:?} hotkey:{hotkey:?}, netuid: {netuid:?}, alpha_unstaked:{alpha_unstaked:?} )" ); // 2. Calculate the maximum amount that can be executed with price limit diff --git a/pallets/subtensor/src/staking/set_children.rs b/pallets/subtensor/src/staking/set_children.rs index 35867f82ca..9acea97113 100644 --- a/pallets/subtensor/src/staking/set_children.rs +++ b/pallets/subtensor/src/staking/set_children.rs @@ -43,11 +43,7 @@ impl Pallet { // Check that the caller has signed the transaction. (the coldkey of the pairing) let coldkey = ensure_signed(origin)?; log::trace!( - "do_set_children( coldkey:{:?} hotkey:{:?} netuid:{:?} children:{:?} )", - coldkey, - netuid, - hotkey, - children + "do_set_children( coldkey:{coldkey:?} hotkey:{netuid:?} netuid:{hotkey:?} children:{children:?} )" ); // Ensure the hotkey passes the rate limit. @@ -354,11 +350,7 @@ impl Pallet { // Emit the event Self::deposit_event(Event::ChildKeyTakeSet(hotkey.clone(), take)); - log::debug!( - "Childkey take set for hotkey: {:?} and take: {:?}", - hotkey, - take - ); + log::debug!("Childkey take set for hotkey: {hotkey:?} and take: {take:?}"); Ok(()) } diff --git a/pallets/subtensor/src/staking/stake_utils.rs b/pallets/subtensor/src/staking/stake_utils.rs index a244f9f5a7..ff39d1f3f5 100644 --- a/pallets/subtensor/src/staking/stake_utils.rs +++ b/pallets/subtensor/src/staking/stake_utils.rs @@ -126,22 +126,22 @@ impl Pallet { ) -> (I64F64, I64F64, I64F64) { // Retrieve the global tao weight. let tao_weight = I64F64::saturating_from_num(Self::get_tao_weight()); - log::debug!("tao_weight: {:?}", tao_weight); + log::debug!("tao_weight: {tao_weight:?}"); // Step 1: Get stake of hotkey (neuron) let alpha_stake = I64F64::saturating_from_num(Self::get_inherited_for_hotkey_on_subnet(hotkey, netuid)); - log::debug!("alpha_stake: {:?}", alpha_stake); + log::debug!("alpha_stake: {alpha_stake:?}"); // Step 2: Get the global tao stake for the hotkey let tao_stake = I64F64::saturating_from_num(Self::get_tao_inherited_for_hotkey_on_subnet( hotkey, netuid, )); - log::debug!("tao_stake: {:?}", tao_stake); + log::debug!("tao_stake: {tao_stake:?}"); // Step 3: Combine alpha and tao stakes let total_stake = alpha_stake.saturating_add(tao_stake.saturating_mul(tao_weight)); - log::debug!("total_stake: {:?}", total_stake); + log::debug!("total_stake: {total_stake:?}"); (total_stake, alpha_stake, tao_stake) } @@ -153,7 +153,7 @@ impl Pallet { ) -> (Vec, Vec, Vec) { // Retrieve the global tao weight. let tao_weight: I64F64 = I64F64::saturating_from_num(Self::get_tao_weight()); - log::debug!("tao_weight: {:?}", tao_weight); + log::debug!("tao_weight: {tao_weight:?}"); // Step 1: Get subnetwork size let n: u16 = Self::get_subnetwork_n(netuid); @@ -171,7 +171,7 @@ impl Pallet { } }) .collect(); - log::debug!("alpha_stake: {:?}", alpha_stake); + log::debug!("alpha_stake: {alpha_stake:?}"); // Step 3: Calculate the global tao stake vector. // Initialize a vector to store global tao stakes for each neuron. @@ -187,7 +187,7 @@ impl Pallet { } }) .collect(); - log::trace!("tao_stake: {:?}", tao_stake); + log::trace!("tao_stake: {tao_stake:?}"); // Step 4: Combine alpha and root tao stakes. // Calculate the weighted average of alpha and global tao stakes for each neuron. @@ -196,7 +196,7 @@ impl Pallet { .zip(tao_stake.iter()) .map(|(alpha_i, tao_i)| alpha_i.saturating_add(tao_i.saturating_mul(tao_weight))) .collect(); - log::trace!("total_stake: {:?}", total_stake); + log::trace!("total_stake: {total_stake:?}"); (total_stake, alpha_stake, tao_stake) } @@ -239,38 +239,25 @@ impl Pallet { // Step 2: Retrieve the lists of parents and children for the hotkey on the subnet. let parents: Vec<(u64, T::AccountId)> = Self::get_parents(hotkey, netuid); let children: Vec<(u64, T::AccountId)> = Self::get_children(hotkey, netuid); - log::trace!( - "Parents for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - parents - ); - log::trace!( - "Children for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - children - ); + log::trace!("Parents for hotkey {hotkey:?} on subnet {netuid}: {parents:?}"); + log::trace!("Children for hotkey {hotkey:?} on subnet {netuid}: {children:?}"); // Step 3: Calculate the total tao allocated to children. for (proportion, _) in children { // Convert the proportion to a normalized value between 0 and 1. let normalized_proportion: U96F32 = U96F32::saturating_from_num(proportion) .safe_div(U96F32::saturating_from_num(u64::MAX)); - log::trace!( - "Normalized proportion for child: {:?}", - normalized_proportion - ); + log::trace!("Normalized proportion for child: {normalized_proportion:?}"); // Calculate the amount of tao to be allocated to this child. let tao_proportion_to_child: U96F32 = U96F32::saturating_from_num(initial_tao).saturating_mul(normalized_proportion); - log::trace!("Tao proportion to child: {:?}", tao_proportion_to_child); + log::trace!("Tao proportion to child: {tao_proportion_to_child:?}"); // Add this child's allocation to the total tao allocated to children. tao_to_children = tao_to_children.saturating_add(tao_proportion_to_child); } - log::trace!("Total tao allocated to children: {:?}", tao_to_children); + log::trace!("Total tao allocated to children: {tao_to_children:?}"); // Step 4: Calculate the total tao inherited from parents. for (proportion, parent) in parents { @@ -279,44 +266,28 @@ impl Pallet { &parent, NetUid::ROOT, )); - log::trace!( - "Parent tao for parent {:?} on subnet {}: {:?}", - parent, - netuid, - parent_tao - ); + log::trace!("Parent tao for parent {parent:?} on subnet {netuid}: {parent_tao:?}"); // Convert the proportion to a normalized value between 0 and 1. let normalized_proportion = U96F32::saturating_from_num(proportion) .safe_div(U96F32::saturating_from_num(u64::MAX)); - log::trace!( - "Normalized proportion from parent: {:?}", - normalized_proportion - ); + log::trace!("Normalized proportion from parent: {normalized_proportion:?}"); // Calculate the amount of tao to be inherited from this parent. let tao_proportion_from_parent: U96F32 = U96F32::saturating_from_num(parent_tao).saturating_mul(normalized_proportion); - log::trace!( - "Tao proportion from parent: {:?}", - tao_proportion_from_parent - ); + log::trace!("Tao proportion from parent: {tao_proportion_from_parent:?}"); // Add this parent's contribution to the total tao inherited from parents. tao_from_parents = tao_from_parents.saturating_add(tao_proportion_from_parent); } - log::trace!("Total tao inherited from parents: {:?}", tao_from_parents); + log::trace!("Total tao inherited from parents: {tao_from_parents:?}"); // Step 5: Calculate the final inherited tao for the hotkey. let finalized_tao: U96F32 = initial_tao .saturating_sub(tao_to_children) // Subtract tao allocated to children .saturating_add(tao_from_parents); // Add tao inherited from parents - log::trace!( - "Finalized tao for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - finalized_tao - ); + log::trace!("Finalized tao for hotkey {hotkey:?} on subnet {netuid}: {finalized_tao:?}"); // Step 6: Return the final inherited tao value. finalized_tao.saturating_to_num::() @@ -329,12 +300,7 @@ impl Pallet { // Step 1: Retrieve the initial total stake (alpha) for the hotkey on the specified subnet. let initial_alpha: U96F32 = U96F32::saturating_from_num(Self::get_stake_for_hotkey_on_subnet(hotkey, netuid)); - log::debug!( - "Initial alpha for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - initial_alpha - ); + log::debug!("Initial alpha for hotkey {hotkey:?} on subnet {netuid}: {initial_alpha:?}"); if netuid.is_root() { return initial_alpha.saturating_to_num::().into(); } @@ -346,84 +312,54 @@ impl Pallet { // Step 2: Retrieve the lists of parents and children for the hotkey on the subnet. let parents: Vec<(u64, T::AccountId)> = Self::get_parents(hotkey, netuid); let children: Vec<(u64, T::AccountId)> = Self::get_children(hotkey, netuid); - log::debug!( - "Parents for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - parents - ); - log::debug!( - "Children for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - children - ); + log::debug!("Parents for hotkey {hotkey:?} on subnet {netuid}: {parents:?}"); + log::debug!("Children for hotkey {hotkey:?} on subnet {netuid}: {children:?}"); // Step 3: Calculate the total alpha allocated to children. for (proportion, _) in children { // Convert the proportion to a normalized value between 0 and 1. let normalized_proportion: U96F32 = U96F32::saturating_from_num(proportion) .safe_div(U96F32::saturating_from_num(u64::MAX)); - log::trace!( - "Normalized proportion for child: {:?}", - normalized_proportion - ); + log::trace!("Normalized proportion for child: {normalized_proportion:?}"); // Calculate the amount of alpha to be allocated to this child. let alpha_proportion_to_child: U96F32 = U96F32::saturating_from_num(initial_alpha).saturating_mul(normalized_proportion); - log::trace!("Alpha proportion to child: {:?}", alpha_proportion_to_child); + log::trace!("Alpha proportion to child: {alpha_proportion_to_child:?}"); // Add this child's allocation to the total alpha allocated to children. alpha_to_children = alpha_to_children.saturating_add(alpha_proportion_to_child); } - log::debug!("Total alpha allocated to children: {:?}", alpha_to_children); + log::debug!("Total alpha allocated to children: {alpha_to_children:?}"); // Step 4: Calculate the total alpha inherited from parents. for (proportion, parent) in parents { // Retrieve the parent's total stake on this subnet. let parent_alpha: U96F32 = U96F32::saturating_from_num(Self::get_stake_for_hotkey_on_subnet(&parent, netuid)); - log::trace!( - "Parent alpha for parent {:?} on subnet {}: {:?}", - parent, - netuid, - parent_alpha - ); + log::trace!("Parent alpha for parent {parent:?} on subnet {netuid}: {parent_alpha:?}"); // Convert the proportion to a normalized value between 0 and 1. let normalized_proportion: U96F32 = U96F32::saturating_from_num(proportion) .safe_div(U96F32::saturating_from_num(u64::MAX)); - log::trace!( - "Normalized proportion from parent: {:?}", - normalized_proportion - ); + log::trace!("Normalized proportion from parent: {normalized_proportion:?}"); // Calculate the amount of alpha to be inherited from this parent. let alpha_proportion_from_parent: U96F32 = U96F32::saturating_from_num(parent_alpha).saturating_mul(normalized_proportion); - log::trace!( - "Alpha proportion from parent: {:?}", - alpha_proportion_from_parent - ); + log::trace!("Alpha proportion from parent: {alpha_proportion_from_parent:?}"); // Add this parent's contribution to the total alpha inherited from parents. alpha_from_parents = alpha_from_parents.saturating_add(alpha_proportion_from_parent); } - log::debug!( - "Total alpha inherited from parents: {:?}", - alpha_from_parents - ); + log::debug!("Total alpha inherited from parents: {alpha_from_parents:?}"); // Step 5: Calculate the final inherited alpha for the hotkey. let finalized_alpha: U96F32 = initial_alpha .saturating_sub(alpha_to_children) // Subtract alpha allocated to children .saturating_add(alpha_from_parents); // Add alpha inherited from parents log::trace!( - "Finalized alpha for hotkey {:?} on subnet {}: {:?}", - hotkey, - netuid, - finalized_alpha + "Finalized alpha for hotkey {hotkey:?} on subnet {netuid}: {finalized_alpha:?}" ); // Step 6: Return the final inherited alpha value. diff --git a/pallets/subtensor/src/subnets/leasing.rs b/pallets/subtensor/src/subnets/leasing.rs index de4cbf3e5b..de2b5fa689 100644 --- a/pallets/subtensor/src/subnets/leasing.rs +++ b/pallets/subtensor/src/subnets/leasing.rs @@ -1,3 +1,20 @@ +//! This file defines abstraction for subnet leasing. +//! +//! It is used to register a new leased network through a crowdloan using the `register_leased_network` extrinsic +//! as a call parameter to the crowdloan pallet `create` extrinsic. A new subnet will be registered +//! paying the lock cost using the crowdloan funds and a proxy will be created for the beneficiary +//! to operate the subnet. +//! +//! The crowdloan's contributions are used to compute the share of the emissions that the contributors +//! will receive as dividends. The leftover cap is refunded to the contributors and the beneficiary. +//! +//! The lease can have a defined end block, after which the lease will be terminated and the subnet +//! will be transferred to the beneficiary. In case the lease is perpetual, the lease will never be +//! terminated and emissions will continue to be distributed to the contributors. +//! +//! The lease can be terminated by the beneficiary after the end block has passed (if any) and the subnet +//! ownership will be transferred to the beneficiary. + use super::*; use frame_support::{ dispatch::RawOrigin, diff --git a/pallets/subtensor/src/subnets/registration.rs b/pallets/subtensor/src/subnets/registration.rs index 67631d3fc1..ab2d015dda 100644 --- a/pallets/subtensor/src/subnets/registration.rs +++ b/pallets/subtensor/src/subnets/registration.rs @@ -71,12 +71,7 @@ impl Pallet { ) -> DispatchResult { // --- 1. Check that the caller has signed the transaction. (the coldkey of the pairing) let coldkey = ensure_signed(origin)?; - log::debug!( - "do_registration( coldkey:{:?} netuid:{:?} hotkey:{:?} )", - coldkey, - netuid, - hotkey - ); + log::debug!("do_registration( coldkey:{coldkey:?} netuid:{netuid:?} hotkey:{hotkey:?} )"); // --- 2. Ensure the passed network is valid. ensure!( @@ -162,12 +157,7 @@ impl Pallet { Self::increase_rao_recycled(netuid, Self::get_burn_as_u64(netuid)); // --- 15. Deposit successful event. - log::debug!( - "NeuronRegistered( netuid:{:?} uid:{:?} hotkey:{:?} ) ", - netuid, - neuron_uid, - hotkey - ); + log::debug!("NeuronRegistered( netuid:{netuid:?} uid:{neuron_uid:?} hotkey:{hotkey:?} ) "); Self::deposit_event(Event::NeuronRegistered(netuid, neuron_uid, hotkey)); // --- 16. Ok and done. @@ -233,11 +223,7 @@ impl Pallet { // --- 1. Check that the caller has signed the transaction. let signing_origin = ensure_signed(origin)?; log::debug!( - "do_registration( origin:{:?} netuid:{:?} hotkey:{:?}, coldkey:{:?} )", - signing_origin, - netuid, - hotkey, - coldkey + "do_registration( origin:{signing_origin:?} netuid:{netuid:?} hotkey:{hotkey:?}, coldkey:{coldkey:?} )" ); ensure!( @@ -336,12 +322,7 @@ impl Pallet { RegistrationsThisBlock::::mutate(netuid, |val| val.saturating_inc()); // --- 13. Deposit successful event. - log::debug!( - "NeuronRegistered( netuid:{:?} uid:{:?} hotkey:{:?} ) ", - netuid, - neuron_uid, - hotkey - ); + log::debug!("NeuronRegistered( netuid:{netuid:?} uid:{neuron_uid:?} hotkey:{hotkey:?} ) "); Self::deposit_event(Event::NeuronRegistered(netuid, neuron_uid, hotkey)); // --- 14. Ok and done. @@ -359,7 +340,7 @@ impl Pallet { // --- 1. Check that the caller has signed the transaction. let coldkey = ensure_signed(origin)?; - log::debug!("do_faucet( coldkey:{:?} )", coldkey); + log::debug!("do_faucet( coldkey:{coldkey:?} )"); // --- 2. Ensure the passed block number is valid, not in the future or too old. // Work must have been done within 3 blocks (stops long range attacks). @@ -393,11 +374,7 @@ impl Pallet { Self::add_balance_to_coldkey_account(&coldkey, balance_to_add); // --- 6. Deposit successful event. - log::debug!( - "Faucet( coldkey:{:?} amount:{:?} ) ", - coldkey, - balance_to_add - ); + log::debug!("Faucet( coldkey:{coldkey:?} amount:{balance_to_add:?} ) "); Self::deposit_event(Event::Faucet(coldkey, balance_to_add)); // --- 7. Ok and done. @@ -496,13 +473,7 @@ impl Pallet { log::trace!( target: LOG_TARGET, - "Difficulty: hash: {:?}, hash_bytes: {:?}, hash_as_num: {:?}, difficulty: {:?}, value: {:?} overflowed: {:?}", - hash, - bytes, - num_hash, - difficulty, - value, - overflowed + "Difficulty: hash: {hash:?}, hash_bytes: {bytes:?}, hash_as_num: {num_hash:?}, difficulty: {difficulty:?}, value: {value:?} overflowed: {overflowed:?}" ); !overflowed } @@ -519,10 +490,7 @@ impl Pallet { log::trace!( target: LOG_TARGET, - "block_number: {:?}, vec_hash: {:?}, real_hash: {:?}", - block_number, - vec_hash, - real_hash + "block_number: {block_number:?}, vec_hash: {vec_hash:?}, real_hash: {real_hash:?}" ); real_hash @@ -578,15 +546,7 @@ impl Pallet { let seal_hash: H256 = H256::from_slice(&keccak_256_seal_hash_vec); log::trace!( - "\n hotkey:{:?} \nblock_number: {:?}, \nnonce_u64: {:?}, \nblock_hash: {:?}, \nfull_bytes: {:?}, \nsha256_seal_hash_vec: {:?}, \nkeccak_256_seal_hash_vec: {:?}, \nseal_hash: {:?}", - hotkey, - block_number_u64, - nonce_u64, - block_hash_at_number, - full_bytes, - sha256_seal_hash_vec, - keccak_256_seal_hash_vec, - seal_hash + "\n hotkey:{hotkey:?} \nblock_number: {block_number_u64:?}, \nnonce_u64: {nonce_u64:?}, \nblock_hash: {block_hash_at_number:?}, \nfull_bytes: {full_bytes:?}, \nsha256_seal_hash_vec: {sha256_seal_hash_vec:?}, \nkeccak_256_seal_hash_vec: {keccak_256_seal_hash_vec:?}, \nseal_hash: {seal_hash:?}" ); seal_hash diff --git a/pallets/subtensor/src/subnets/subnet.rs b/pallets/subtensor/src/subnets/subnet.rs index 1e9aaca229..13c1bc4b33 100644 --- a/pallets/subtensor/src/subnets/subnet.rs +++ b/pallets/subtensor/src/subnets/subnet.rs @@ -142,7 +142,7 @@ impl Pallet { // --- 5. Calculate and lock the required tokens. let lock_amount: u64 = Self::get_network_lock_cost(); - log::debug!("network lock_amount: {:?}", lock_amount); + log::debug!("network lock_amount: {lock_amount:?}"); ensure!( Self::can_remove_balance_from_coldkey_account(&coldkey, lock_amount), Error::::NotEnoughBalanceToStake @@ -154,7 +154,7 @@ impl Pallet { // --- 7. Perform the lock operation. let actual_tao_lock_amount: u64 = Self::remove_balance_from_coldkey_account(&coldkey, lock_amount)?; - log::debug!("actual_tao_lock_amount: {:?}", actual_tao_lock_amount); + log::debug!("actual_tao_lock_amount: {actual_tao_lock_amount:?}"); // --- 8. Set the lock amount for use to determine pricing. Self::set_network_last_lock(actual_tao_lock_amount); @@ -162,24 +162,16 @@ impl Pallet { // --- 9. Set initial and custom parameters for the network. let default_tempo = DefaultTempo::::get(); Self::init_new_network(netuid_to_register, default_tempo); - log::debug!("init_new_network: {:?}", netuid_to_register); + log::debug!("init_new_network: {netuid_to_register:?}"); // --- 10. Add the caller to the neuron set. Self::create_account_if_non_existent(&coldkey, hotkey); Self::append_neuron(netuid_to_register, hotkey, current_block); - log::debug!( - "Appended neuron for netuid {:?}, hotkey: {:?}", - netuid_to_register, - hotkey - ); + log::debug!("Appended neuron for netuid {netuid_to_register:?}, hotkey: {hotkey:?}"); // --- 11. Set the mechanism. SubnetMechanism::::insert(netuid_to_register, mechid); - log::debug!( - "SubnetMechanism for netuid {:?} set to: {:?}", - netuid_to_register, - mechid - ); + log::debug!("SubnetMechanism for netuid {netuid_to_register:?} set to: {mechid:?}"); // --- 12. Set the creation terms. NetworkLastRegistered::::set(current_block); @@ -226,11 +218,7 @@ impl Pallet { NetworkPowRegistrationAllowed::::set(netuid_to_register, true); // --- 17. Emit the NetworkAdded event. - log::info!( - "NetworkAdded( netuid:{:?}, mechanism:{:?} )", - netuid_to_register, - mechid - ); + log::info!("NetworkAdded( netuid:{netuid_to_register:?}, mechanism:{mechid:?} )"); Self::deposit_event(Event::NetworkAdded(netuid_to_register, mechid)); // --- 18. Return success. diff --git a/pallets/subtensor/src/subnets/symbols.rs b/pallets/subtensor/src/subnets/symbols.rs index a601865010..4b37e9b6b0 100644 --- a/pallets/subtensor/src/subnets/symbols.rs +++ b/pallets/subtensor/src/subnets/symbols.rs @@ -949,8 +949,7 @@ impl Pallet { if available_symbol.is_none() { log::warn!( - "All available symbols have been exhausted for netuid: {:?}. Using default symbol.", - netuid + "All available symbols have been exhausted for netuid: {netuid:?}. Using default symbol." ); } diff --git a/pallets/subtensor/src/subnets/uids.rs b/pallets/subtensor/src/subnets/uids.rs index 67c0a24c29..f5a14c490b 100644 --- a/pallets/subtensor/src/subnets/uids.rs +++ b/pallets/subtensor/src/subnets/uids.rs @@ -35,10 +35,7 @@ impl Pallet { block_number: u64, ) { log::debug!( - "replace_neuron( netuid: {:?} | uid_to_replace: {:?} | new_hotkey: {:?} ) ", - netuid, - uid_to_replace, - new_hotkey + "replace_neuron( netuid: {netuid:?} | uid_to_replace: {uid_to_replace:?} | new_hotkey: {new_hotkey:?} ) " ); // 1. Get the old hotkey under this position. @@ -49,11 +46,7 @@ impl Pallet { if sn_owner_hotkey == old_hotkey.clone() { log::warn!( "replace_neuron: Skipped replacement because neuron is the subnet owner hotkey. \ - netuid: {:?}, uid_to_replace: {:?}, new_hotkey: {:?}, owner_hotkey: {:?}", - netuid, - uid_to_replace, - new_hotkey, - sn_owner_hotkey + netuid: {netuid:?}, uid_to_replace: {uid_to_replace:?}, new_hotkey: {new_hotkey:?}, owner_hotkey: {sn_owner_hotkey:?}" ); return; } @@ -88,10 +81,7 @@ impl Pallet { // 1. Get the next uid. This is always equal to subnetwork_n. let next_uid: u16 = Self::get_subnetwork_n(netuid); log::debug!( - "append_neuron( netuid: {:?} | next_uid: {:?} | new_hotkey: {:?} ) ", - netuid, - new_hotkey, - next_uid + "append_neuron( netuid: {netuid:?} | next_uid: {new_hotkey:?} | new_hotkey: {next_uid:?} ) " ); // 2. Get and increase the uid count. diff --git a/pallets/subtensor/src/subnets/weights.rs b/pallets/subtensor/src/subnets/weights.rs index e234d62be4..c009d70304 100644 --- a/pallets/subtensor/src/subnets/weights.rs +++ b/pallets/subtensor/src/subnets/weights.rs @@ -47,7 +47,7 @@ impl Pallet { // 1. Verify the caller's signature (hotkey). let who = ensure_signed(origin)?; - log::debug!("do_commit_weights(hotkey: {:?}, netuid: {:?})", who, netuid); + log::debug!("do_commit_weights(hotkey: {who:?}, netuid: {netuid:?})"); // 2. Ensure commit-reveal is enabled. ensure!( @@ -145,10 +145,7 @@ impl Pallet { // --- 1. Check the caller's signature. This is the hotkey of a registered account. let hotkey = ensure_signed(origin.clone())?; log::debug!( - "do_batch_commit_weights( origin:{:?}, netuids:{:?}, hashes:{:?} )", - hotkey, - netuids, - commit_hashes + "do_batch_commit_weights( origin:{hotkey:?}, netuids:{netuids:?}, hashes:{commit_hashes:?} )" ); ensure!( @@ -178,11 +175,7 @@ impl Pallet { } // --- 19. Emit the tracking event. - log::debug!( - "BatchWeightsCompleted( netuids:{:?}, hotkey:{:?} )", - netuids, - hotkey - ); + log::debug!("BatchWeightsCompleted( netuids:{netuids:?}, hotkey:{hotkey:?} )"); Self::deposit_event(Event::BatchWeightsCompleted(netuids, hotkey)); // --- 20. Return ok. @@ -236,11 +229,7 @@ impl Pallet { // 1. Verify the caller's signature (hotkey). let who = ensure_signed(origin)?; - log::debug!( - "do_commit_v3_weights(hotkey: {:?}, netuid: {:?})", - who, - netuid - ); + log::debug!("do_commit_v3_weights(hotkey: {who:?}, netuid: {netuid:?})"); // 2. Ensure commit-reveal is enabled. ensure!( @@ -348,7 +337,7 @@ impl Pallet { // --- 1. Check the caller's signature (hotkey). let who = ensure_signed(origin.clone())?; - log::debug!("do_reveal_weights( hotkey:{:?} netuid:{:?})", who, netuid); + log::debug!("do_reveal_weights( hotkey:{who:?} netuid:{netuid:?})"); // --- 2. Ensure commit-reveal is enabled for the network. ensure!( @@ -498,11 +487,7 @@ impl Pallet { // --- 2. Check the caller's signature (hotkey). let who = ensure_signed(origin.clone())?; - log::debug!( - "do_batch_reveal_weights( hotkey:{:?} netuid:{:?})", - who, - netuid - ); + log::debug!("do_batch_reveal_weights( hotkey:{who:?} netuid:{netuid:?})"); // --- 3. Ensure commit-reveal is enabled for the network. ensure!( @@ -684,11 +669,7 @@ impl Pallet { // --- 1. Check the caller's signature. This is the hotkey of a registered account. let hotkey = ensure_signed(origin)?; log::debug!( - "do_set_weights( origin:{:?} netuid:{:?}, uids:{:?}, values:{:?})", - hotkey, - netuid, - uids, - values + "do_set_weights( origin:{hotkey:?} netuid:{netuid:?}, uids:{uids:?}, values:{values:?})" ); // --- Check that the netuid is not the root network. @@ -784,11 +765,7 @@ impl Pallet { } // --- 19. Emit the tracking event. - log::debug!( - "WeightsSet( netuid:{:?}, neuron_uid:{:?} )", - netuid, - neuron_uid - ); + log::debug!("WeightsSet( netuid:{netuid:?}, neuron_uid:{neuron_uid:?} )"); Self::deposit_event(Event::WeightsSet(netuid, neuron_uid)); // --- 20. Return ok. @@ -834,10 +811,7 @@ impl Pallet { // --- 1. Check the caller's signature. This is the hotkey of a registered account. let hotkey = ensure_signed(origin.clone())?; log::debug!( - "do_batch_set_weights( origin:{:?} netuids:{:?}, weights:{:?}", - hotkey, - netuids, - weights + "do_batch_set_weights( origin:{hotkey:?} netuids:{netuids:?}, weights:{weights:?}" ); ensure!( @@ -882,11 +856,7 @@ impl Pallet { } // --- 19. Emit the tracking event. - log::debug!( - "BatchWeightsSet( netuids:{:?}, hotkey:{:?} )", - netuids, - hotkey - ); + log::debug!("BatchWeightsSet( netuids:{netuids:?}, hotkey:{hotkey:?} )"); Self::deposit_event(Event::BatchWeightsCompleted(netuids, hotkey)); // --- 20. Return ok. @@ -902,9 +872,7 @@ impl Pallet { pub fn check_version_key(netuid: NetUid, version_key: u64) -> bool { let network_version_key: u64 = WeightsVersionKey::::get(netuid); log::debug!( - "check_version_key( network_version_key:{:?}, version_key:{:?} )", - network_version_key, - version_key + "check_version_key( network_version_key:{network_version_key:?}, version_key:{version_key:?} )" ); network_version_key == 0 || version_key >= network_version_key } @@ -930,9 +898,7 @@ impl Pallet { for uid in uids { if !Self::is_uid_exist_on_network(netuid, *uid) { log::debug!( - "contains_invalid_uids( netuid:{:?}, uid:{:?} does not exist on network. )", - netuid, - uids + "contains_invalid_uids( netuid:{netuid:?}, uid:{uids:?} does not exist on network. )" ); return true; } diff --git a/pallets/subtensor/src/swap/swap_hotkey.rs b/pallets/subtensor/src/swap/swap_hotkey.rs index 1b6274db54..29a49c2834 100644 --- a/pallets/subtensor/src/swap/swap_hotkey.rs +++ b/pallets/subtensor/src/swap/swap_hotkey.rs @@ -89,7 +89,7 @@ impl Pallet { // Start to do everything for swap hotkey on all subnets case // 12. Get the cost for swapping the key let swap_cost = Self::get_key_swap_cost(); - log::debug!("Swap cost: {:?}", swap_cost); + log::debug!("Swap cost: {swap_cost:?}"); // 13. Ensure the coldkey has enough balance to pay for the swap ensure!( @@ -288,7 +288,7 @@ impl Pallet { // 3. Get the cost for swapping the key on the subnet let swap_cost = T::KeySwapOnSubnetCost::get(); - log::debug!("Swap cost in subnet {:?}: {:?}", netuid, swap_cost); + log::debug!("Swap cost in subnet {netuid:?}: {swap_cost:?}"); weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 0)); // 4. Ensure the coldkey has enough balance to pay for the swap diff --git a/pallets/subtensor/src/tests/children.rs b/pallets/subtensor/src/tests/children.rs index 24b858628a..50a6e506a6 100644 --- a/pallets/subtensor/src/tests/children.rs +++ b/pallets/subtensor/src/tests/children.rs @@ -15,11 +15,7 @@ use sp_core::U256; fn close(value: u64, target: u64, eps: u64, msg: &str) { assert!( (value as i64 - target as i64).abs() <= eps as i64, - "{}: value = {}, target = {}, eps = {}", - msg, - value, - target, - eps + "{msg}: value = {value}, target = {target}, eps = {eps}" ) } @@ -874,7 +870,7 @@ fn test_childkey_take_functionality() { // Test default and max childkey take let default_take = SubtensorModule::get_default_childkey_take(); let min_take = SubtensorModule::get_min_childkey_take(); - log::info!("Default take: {}, Max take: {}", default_take, min_take); + log::info!("Default take: {default_take}, Max take: {min_take}"); // Check if default take and max take are the same assert_eq!( @@ -899,7 +895,7 @@ fn test_childkey_take_functionality() { // Verify childkey take was set correctly let stored_take = SubtensorModule::get_childkey_take(&hotkey, netuid); - log::info!("Stored take: {}", stored_take); + log::info!("Stored take: {stored_take}"); assert_eq!(stored_take, new_take); // Test setting childkey take outside of allowed range @@ -1065,12 +1061,11 @@ fn test_multiple_networks_childkey_take() { let stored_take = SubtensorModule::get_childkey_take(&hotkey, netuid); assert_eq!( stored_take, take_value, - "Childkey take not set correctly for network {}", - netuid + "Childkey take not set correctly for network {netuid}" ); // Log the set value - log::info!("Network {}: Childkey take set to {}", netuid, take_value); + log::info!("Network {netuid}: Childkey take set to {take_value}"); } // Verify all networks have different childkey take values @@ -1080,8 +1075,7 @@ fn test_multiple_networks_childkey_take() { let take_j = SubtensorModule::get_childkey_take(&hotkey, j.into()); assert_ne!( take_i, take_j, - "Childkey take values should be different for networks {} and {}", - i, j + "Childkey take values should be different for networks {i} and {j}" ); } } @@ -1533,31 +1527,24 @@ fn test_get_parents_chain() { let proportion = u64::MAX / 2; // 50% stake allocation log::info!( - "Test setup: netuid={}, coldkey={}, num_keys={}, proportion={}", - netuid, - coldkey, - num_keys, - proportion + "Test setup: netuid={netuid}, coldkey={coldkey}, num_keys={num_keys}, proportion={proportion}" ); // Create a vector of hotkeys let hotkeys: Vec = (0..num_keys).map(|i| U256::from(i as u64 + 2)).collect(); - log::info!("Created hotkeys: {:?}", hotkeys); + log::info!("Created hotkeys: {hotkeys:?}"); // Add network add_network(netuid, 13, 0); SubtensorModule::set_max_registrations_per_block(netuid, 1000); SubtensorModule::set_target_registrations_per_interval(netuid, 1000); - log::info!("Network added and parameters set: netuid={}", netuid); + log::info!("Network added and parameters set: netuid={netuid}"); // Register all neurons for hotkey in &hotkeys { register_ok_neuron(netuid, *hotkey, coldkey, 0); log::info!( - "Registered neuron: hotkey={}, coldkey={}, netuid={}", - hotkey, - coldkey, - netuid + "Registered neuron: hotkey={hotkey}, coldkey={coldkey}, netuid={netuid}" ); } @@ -1590,14 +1577,12 @@ fn test_get_parents_chain() { assert_eq!( parents.len(), 1, - "Hotkey {} should have exactly one parent", - i + "Hotkey {i} should have exactly one parent" ); assert_eq!( parents[0], (proportion, hotkeys[i - 1]), - "Incorrect parent for hotkey {}", - i + "Incorrect parent for hotkey {i}" ); } @@ -1620,10 +1605,7 @@ fn test_get_parents_chain() { SubtensorModule::set_difficulty(netuid, 1); register_ok_neuron(netuid, new_parent, coldkey, 99 * 2); log::info!( - "Registered new parent neuron: new_parent={}, coldkey={}, netuid={}", - new_parent, - coldkey, - netuid + "Registered new parent neuron: new_parent={new_parent}, coldkey={coldkey}, netuid={netuid}" ); mock_set_children( @@ -1642,9 +1624,7 @@ fn test_get_parents_chain() { let last_hotkey_parents = SubtensorModule::get_parents(&last_hotkey, netuid); log::info!( - "Testing get_parents for last hotkey {} with multiple parents: {:?}", - last_hotkey, - last_hotkey_parents + "Testing get_parents for last hotkey {last_hotkey} with multiple parents: {last_hotkey_parents:?}" ); assert_eq!( last_hotkey_parents.len(), @@ -1886,9 +1866,9 @@ fn test_get_stake_for_hotkey_on_subnet_single_parent_multiple_children() { close(child2_stake.into(), 1000, 10, "Child2 stake incorrect"); // Log the actual stake values - log::info!("Parent stake: {}", parent_stake); - log::info!("Child1 stake: {}", child1_stake); - log::info!("Child2 stake: {}", child2_stake); + log::info!("Parent stake: {parent_stake}"); + log::info!("Child1 stake: {child1_stake}"); + log::info!("Child2 stake: {child2_stake}"); }); } @@ -1934,9 +1914,9 @@ fn test_get_stake_for_hotkey_on_subnet_edge_cases() { let child1_stake = SubtensorModule::get_inherited_for_hotkey_on_subnet(&child1, netuid); let child2_stake = SubtensorModule::get_inherited_for_hotkey_on_subnet(&child2, netuid); - log::info!("Parent stake: {}", parent_stake); - log::info!("Child1 stake: {}", child1_stake); - log::info!("Child2 stake: {}", child2_stake); + log::info!("Parent stake: {parent_stake}"); + log::info!("Child1 stake: {child1_stake}"); + log::info!("Child2 stake: {child2_stake}"); assert_eq!(parent_stake, 0.into(), "Parent should have 0 stake"); assert_eq!(child1_stake, 0.into(), "Child1 should have 0 stake"); @@ -2038,9 +2018,9 @@ fn test_get_stake_for_hotkey_on_subnet_complex_hierarchy() { let child1_stake_1 = SubtensorModule::get_inherited_for_hotkey_on_subnet(&child1, netuid); let child2_stake_1 = SubtensorModule::get_inherited_for_hotkey_on_subnet(&child2, netuid); - log::info!("Parent stake: {}", parent_stake_1); - log::info!("Child1 stake: {}", child1_stake_1); - log::info!("Child2 stake: {}", child2_stake_1); + log::info!("Parent stake: {parent_stake_1}"); + log::info!("Child1 stake: {child1_stake_1}"); + log::info!("Child2 stake: {child2_stake_1}"); assert_eq!( parent_stake_1, @@ -2079,10 +2059,10 @@ fn test_get_stake_for_hotkey_on_subnet_complex_hierarchy() { let grandchild_stake = SubtensorModule::get_inherited_for_hotkey_on_subnet(&grandchild, netuid); - log::info!("Parent stake: {}", parent_stake_2); - log::info!("Child1 stake: {}", child1_stake_2); - log::info!("Child2 stake: {}", child2_stake_2); - log::info!("Grandchild stake: {}", grandchild_stake); + log::info!("Parent stake: {parent_stake_2}"); + log::info!("Child1 stake: {child1_stake_2}"); + log::info!("Child2 stake: {child2_stake_2}"); + log::info!("Grandchild stake: {grandchild_stake}"); close(parent_stake_2.into(), 0, 10, "Parent stake should remain 2"); close( @@ -2277,7 +2257,7 @@ fn test_do_remove_stake_clears_pending_childkeys() { "StakeThreshold::::get() = {:?}", StakeThreshold::::get() ); - println!("alpha = {:?}", alpha); + println!("alpha = {alpha:?}"); // Attempt to set child assert_ok!(SubtensorModule::do_schedule_children( @@ -2813,9 +2793,7 @@ fn test_set_weights_no_parent() { let curr_stake_threshold = SubtensorModule::get_stake_threshold(); assert!( curr_stake_weight < curr_stake_threshold, - "{:?} is not less than {:?} ", - curr_stake_weight, - curr_stake_threshold + "{curr_stake_weight:?} is not less than {curr_stake_threshold:?} " ); // Check the hotkey cannot set weights @@ -2843,9 +2821,7 @@ fn test_set_weights_no_parent() { let new_stake_threshold = SubtensorModule::get_stake_threshold(); assert!( new_stake_weight >= new_stake_threshold, - "{:?} is not greater than or equal to {:?} ", - new_stake_weight, - new_stake_threshold + "{new_stake_weight:?} is not greater than or equal to {new_stake_threshold:?} " ); // Check the hotkey can set weights @@ -3076,9 +3052,9 @@ fn test_parent_child_chain_emission() { let rel_stake_b = I96F32::from_num(stake_b) / total_tao; let rel_stake_c = I96F32::from_num(stake_c) / total_tao; - log::info!("rel_stake_a: {:?}", rel_stake_a); // 0.6666 -> 2/3 - log::info!("rel_stake_b: {:?}", rel_stake_b); // 0.2222 -> 2/9 - log::info!("rel_stake_c: {:?}", rel_stake_c); // 0.1111 -> 1/9 + log::info!("rel_stake_a: {rel_stake_a:?}"); // 0.6666 -> 2/3 + log::info!("rel_stake_b: {rel_stake_b:?}"); // 0.2222 -> 2/9 + log::info!("rel_stake_c: {rel_stake_c:?}"); // 0.1111 -> 1/9 assert!((rel_stake_a - I96F32::from_num(stake_a) / total_tao).abs() < 0.001); assert!((rel_stake_b - I96F32::from_num(stake_b) / total_tao).abs() < 0.001); assert!((rel_stake_c - I96F32::from_num(stake_c) / total_tao).abs() < 0.001); @@ -3096,10 +3072,10 @@ fn test_parent_child_chain_emission() { let stake_c_old: u64 = SubtensorModule::get_total_stake_for_hotkey(&hotkey_c); let total_stake_old: I96F32 = I96F32::from_num(stake_a_old + stake_b_old + stake_c_old); - log::info!("Old stake for hotkey A: {:?}", stake_a_old); - log::info!("Old stake for hotkey B: {:?}", stake_b_old); - log::info!("Old stake for hotkey C: {:?}", stake_c_old); - log::info!("Total old stake: {:?}", total_stake_old); + log::info!("Old stake for hotkey A: {stake_a_old:?}"); + log::info!("Old stake for hotkey B: {stake_b_old:?}"); + log::info!("Old stake for hotkey C: {stake_c_old:?}"); + log::info!("Total old stake: {total_stake_old:?}"); // Set CHK take rate to 1/9 let chk_take: I96F32 = I96F32::from_num(1_f64 / 9_f64); @@ -3123,24 +3099,24 @@ fn test_parent_child_chain_emission() { let stake_b_new: u64 = SubtensorModule::get_total_stake_for_hotkey(&hotkey_b); let stake_c_new: u64 = SubtensorModule::get_total_stake_for_hotkey(&hotkey_c); let total_stake_new: I96F32 = I96F32::from_num(stake_a_new + stake_b_new + stake_c_new); - log::info!("Stake for hotkey A: {:?}", stake_a_new); - log::info!("Stake for hotkey B: {:?}", stake_b_new); - log::info!("Stake for hotkey C: {:?}", stake_c_new); + log::info!("Stake for hotkey A: {stake_a_new:?}"); + log::info!("Stake for hotkey B: {stake_b_new:?}"); + log::info!("Stake for hotkey C: {stake_c_new:?}"); let stake_inc_a: u64 = stake_a_new - stake_a_old; let stake_inc_b: u64 = stake_b_new - stake_b_old; let stake_inc_c: u64 = stake_c_new - stake_c_old; let total_stake_inc: I96F32 = total_stake_new - total_stake_old; - log::info!("Stake increase for hotkey A: {:?}", stake_inc_a); - log::info!("Stake increase for hotkey B: {:?}", stake_inc_b); - log::info!("Stake increase for hotkey C: {:?}", stake_inc_c); - log::info!("Total stake increase: {:?}", total_stake_inc); + log::info!("Stake increase for hotkey A: {stake_inc_a:?}"); + log::info!("Stake increase for hotkey B: {stake_inc_b:?}"); + log::info!("Stake increase for hotkey C: {stake_inc_c:?}"); + log::info!("Total stake increase: {total_stake_inc:?}"); let rel_stake_inc_a = I96F32::from_num(stake_inc_a) / total_stake_inc; let rel_stake_inc_b = I96F32::from_num(stake_inc_b) / total_stake_inc; let rel_stake_inc_c = I96F32::from_num(stake_inc_c) / total_stake_inc; - log::info!("rel_stake_inc_a: {:?}", rel_stake_inc_a); - log::info!("rel_stake_inc_b: {:?}", rel_stake_inc_b); - log::info!("rel_stake_inc_c: {:?}", rel_stake_inc_c); + log::info!("rel_stake_inc_a: {rel_stake_inc_a:?}"); + log::info!("rel_stake_inc_b: {rel_stake_inc_b:?}"); + log::info!("rel_stake_inc_c: {rel_stake_inc_c:?}"); // Verify the final stake distribution let stake_inc_eps: I96F32 = I96F32::from_num(1e-4); // 4 decimal places @@ -3151,9 +3127,7 @@ fn test_parent_child_chain_emission() { assert!( (rel_stake_inc_a - expected_a).abs() // B's take on 50% CHK <= stake_inc_eps, - "A should have {:?} of total stake increase; {:?}", - expected_a, - rel_stake_inc_a + "A should have {expected_a:?} of total stake increase; {rel_stake_inc_a:?}" ); let expected_b = I96F32::from_num(2_f64 / 9_f64) * (I96F32::from_num(1_f64) - (I96F32::from_num(1_f64 / 2_f64) * chk_take)) @@ -3161,18 +3135,14 @@ fn test_parent_child_chain_emission() { assert!( (rel_stake_inc_b - expected_b).abs() // C's take on 50% CHK + take from A <= stake_inc_eps, - "B should have {:?} of total stake increase; {:?}", - expected_b, - rel_stake_inc_b + "B should have {expected_b:?} of total stake increase; {rel_stake_inc_b:?}" ); let expected_c = I96F32::from_num(1_f64 / 9_f64) + (I96F32::from_num(2_f64 / 9_f64) * I96F32::from_num(1_f64 / 2_f64) * chk_take); assert!( (rel_stake_inc_c - expected_c).abs() // B's take on 50% CHK <= stake_inc_eps, - "C should have {:?} of total stake increase; {:?}", - expected_c, - rel_stake_inc_c + "C should have {expected_c:?} of total stake increase; {rel_stake_inc_c:?}" ); let hotkeys = [hotkey_a, hotkey_b, hotkey_c]; @@ -3181,19 +3151,10 @@ fn test_parent_child_chain_emission() { if hotkeys.contains(&hotkey) { total_stake_now += stake; } else { - log::info!( - "hotkey: {:?}, netuid: {:?}, stake: {:?}", - hotkey, - netuid, - stake - ); + log::info!("hotkey: {hotkey:?}, netuid: {netuid:?}, stake: {stake:?}"); } } - log::info!( - "total_stake_now: {:?}, total_stake_new: {:?}", - total_stake_now, - total_stake_new - ); + log::info!("total_stake_now: {total_stake_now:?}, total_stake_new: {total_stake_new:?}"); assert_abs_diff_eq!( total_stake_inc.to_num::(), @@ -3281,9 +3242,9 @@ fn test_parent_child_chain_epoch() { let rel_stake_b = I96F32::from_num(stake_b) / total_alpha; let rel_stake_c = I96F32::from_num(stake_c) / total_alpha; - log::info!("rel_stake_a: {:?}", rel_stake_a); // 0.6666 -> 2/3 - log::info!("rel_stake_b: {:?}", rel_stake_b); // 0.2222 -> 2/9 - log::info!("rel_stake_c: {:?}", rel_stake_c); // 0.1111 -> 1/9 + log::info!("rel_stake_a: {rel_stake_a:?}"); // 0.6666 -> 2/3 + log::info!("rel_stake_b: {rel_stake_b:?}"); // 0.2222 -> 2/9 + log::info!("rel_stake_c: {rel_stake_c:?}"); // 0.1111 -> 1/9 assert!(rel_stake_a > I96F32::from_num(0)); assert!(rel_stake_b > I96F32::from_num(0)); @@ -3315,7 +3276,7 @@ fn test_parent_child_chain_epoch() { let hotkey_emission = SubtensorModule::epoch(netuid, hardcoded_emission.saturating_to_num::().into()); - log::info!("hotkey_emission: {:?}", hotkey_emission); + log::info!("hotkey_emission: {hotkey_emission:?}"); let total_emission: I96F32 = hotkey_emission .iter() .map(|(_, _, emission)| I96F32::from_num(*emission)) @@ -3424,9 +3385,9 @@ fn test_dividend_distribution_with_children() { let rel_stake_b = I96F32::from_num(stake_b) / total_alpha; let rel_stake_c = I96F32::from_num(stake_c) / total_alpha; - log::info!("rel_stake_a: {:?}", rel_stake_a); // 0.6666 -> 2/3 - log::info!("rel_stake_b: {:?}", rel_stake_b); // 0.2222 -> 2/9 - log::info!("rel_stake_c: {:?}", rel_stake_c); // 0.1111 -> 1/9 + log::info!("rel_stake_a: {rel_stake_a:?}"); // 0.6666 -> 2/3 + log::info!("rel_stake_b: {rel_stake_b:?}"); // 0.2222 -> 2/9 + log::info!("rel_stake_c: {rel_stake_c:?}"); // 0.1111 -> 1/9 let epsilon = I96F32::from_num(0.00001); assert!((rel_stake_a - I96F32::from_num(300_000) / total_tao).abs() <= epsilon); assert!((rel_stake_b - I96F32::from_num(100_000) / total_tao).abs() <= epsilon); @@ -3452,7 +3413,7 @@ fn test_dividend_distribution_with_children() { let hotkey_emission = SubtensorModule::epoch(netuid, hardcoded_emission.saturating_to_num::().into()); - log::info!("hotkey_emission: {:?}", hotkey_emission); + log::info!("hotkey_emission: {hotkey_emission:?}"); let total_emission: I96F32 = hotkey_emission .iter() .map(|(_, _, emission)| I96F32::from_num(*emission)) @@ -3497,9 +3458,9 @@ fn test_dividend_distribution_with_children() { netuid, hardcoded_emission.saturating_to_num::().into(), ); - log::info!("dividends_a: {:?}", dividends_a); - log::info!("dividends_b: {:?}", dividends_b); - log::info!("dividends_c: {:?}", dividends_c); + log::info!("dividends_a: {dividends_a:?}"); + log::info!("dividends_b: {dividends_b:?}"); + log::info!("dividends_c: {dividends_c:?}"); // We expect A to get all of its own emission, as it has no parents. assert_eq!(dividends_a.len(), 1); @@ -3607,8 +3568,8 @@ fn test_dynamic_parent_child_relationships() { let chk_take_1 = SubtensorModule::get_childkey_take(&child1, netuid); let chk_take_2 = SubtensorModule::get_childkey_take(&child2, netuid); - log::info!("child take 1: {:?}", chk_take_1); - log::info!("child take 2: {:?}", chk_take_2); + log::info!("child take 1: {chk_take_1:?}"); + log::info!("child take 2: {chk_take_2:?}"); // Add initial stakes SubtensorModule::add_balance_to_coldkey_account(&coldkey_parent, 500_000 + 1_000); @@ -3622,7 +3583,7 @@ fn test_dynamic_parent_child_relationships() { let total_tao = I96F32::from_num(500_000 + 50_000 + 30_000); let (total_alpha, _) = mock::swap_tao_to_alpha(netuid, total_tao.to_num()); let total_alpha = I96F32::from_num(total_alpha); - log::info!("total_alpha: {:?}", total_alpha); + log::info!("total_alpha: {total_alpha:?}"); // Set the stakes directly // This avoids needing to swap tao to alpha, impacting the initial stake distribution. @@ -3655,9 +3616,9 @@ fn test_dynamic_parent_child_relationships() { let stake_parent_0 = SubtensorModule::get_stake_for_hotkey_on_subnet(&parent, netuid); let stake_child1_0 = SubtensorModule::get_stake_for_hotkey_on_subnet(&child1, netuid); let stake_child2_0 = SubtensorModule::get_stake_for_hotkey_on_subnet(&child2, netuid); - log::info!("stake_parent_0: {:?}", stake_parent_0); - log::info!("stake_child1_0: {:?}", stake_child1_0); - log::info!("stake_child2_0: {:?}", stake_child2_0); + log::info!("stake_parent_0: {stake_parent_0:?}"); + log::info!("stake_child1_0: {stake_child1_0:?}"); + log::info!("stake_child2_0: {stake_child2_0:?}"); let total_stake_0 = stake_parent_0 + stake_child1_0 + stake_child2_0; @@ -3666,9 +3627,9 @@ fn test_dynamic_parent_child_relationships() { let rel_stake_child1_0 = I96F32::from_num(stake_child1_0) / total_alpha; let rel_stake_child2_0 = I96F32::from_num(stake_child2_0) / total_alpha; - log::info!("rel_stake_parent_0: {:?}", rel_stake_parent_0); - log::info!("rel_stake_child1_0: {:?}", rel_stake_child1_0); - log::info!("rel_stake_child2_0: {:?}", rel_stake_child2_0); + log::info!("rel_stake_parent_0: {rel_stake_parent_0:?}"); + log::info!("rel_stake_child1_0: {rel_stake_child1_0:?}"); + log::info!("rel_stake_child2_0: {rel_stake_child2_0:?}"); let epsilon = I96F32::from_num(0.00001); assert!((rel_stake_parent_0 - I96F32::from_num(500_000) / total_tao).abs() <= epsilon); assert!((rel_stake_child1_0 - I96F32::from_num(50_000) / total_tao).abs() <= epsilon); @@ -3703,7 +3664,7 @@ fn test_dynamic_parent_child_relationships() { let total_stake_1 = SubtensorModule::get_stake_for_hotkey_on_subnet(&parent, netuid) + SubtensorModule::get_stake_for_hotkey_on_subnet(&child1, netuid) + SubtensorModule::get_stake_for_hotkey_on_subnet(&child2, netuid); - log::info!("total_stake_1: {:?}", total_stake_1); + log::info!("total_stake_1: {total_stake_1:?}"); // Change parent-child relationships mock_set_children( @@ -3720,7 +3681,7 @@ fn test_dynamic_parent_child_relationships() { let total_stake_2 = SubtensorModule::get_stake_for_hotkey_on_subnet(&parent, netuid) + SubtensorModule::get_stake_for_hotkey_on_subnet(&child1, netuid) + SubtensorModule::get_stake_for_hotkey_on_subnet(&child2, netuid); - log::info!("total_stake_2: {:?}", total_stake_2); + log::info!("total_stake_2: {total_stake_2:?}"); // Check final emission distribution let stake_parent_2 = SubtensorModule::get_inherited_for_hotkey_on_subnet(&parent, netuid); @@ -3731,17 +3692,17 @@ fn test_dynamic_parent_child_relationships() { let _total_child2_stake = SubtensorModule::get_stake_for_hotkey_on_subnet(&child2, netuid); log::info!("Final stakes:"); - log::info!("Parent stake: {}", stake_parent_2); - log::info!("Child1 stake: {}", stake_child1_2); - log::info!("Child2 stake: {}", stake_child2_2); + log::info!("Parent stake: {stake_parent_2}"); + log::info!("Child1 stake: {stake_child1_2}"); + log::info!("Child2 stake: {stake_child2_2}"); // Payout 1 let payout_1 = total_stake_1 - total_stake_0; - log::info!("payout_1: {:?}", payout_1); + log::info!("payout_1: {payout_1:?}"); // Payout 2 let payout_2 = total_stake_2 - total_stake_1; - log::info!("payout_2: {:?}", payout_2); + log::info!("payout_2: {payout_2:?}"); let total_emission = I96F32::from_num(payout_1 + payout_2); @@ -3749,7 +3710,7 @@ fn test_dynamic_parent_child_relationships() { let TOLERANCE = I96F32::from_num(0.001); // Allow for a small discrepancy due to potential rounding // Precise assertions with tolerance - log::info!("total_emission: {:?}", total_emission); + log::info!("total_emission: {total_emission:?}"); let expected_parent_stake = ((I96F32::from_num(u64::from(stake_parent_0)) + total_emission * rel_stake_parent_0) * I96F32::from_num(5)) @@ -3758,9 +3719,7 @@ fn test_dynamic_parent_child_relationships() { (I96F32::from_num(stake_parent_2) - expected_parent_stake).abs() / expected_parent_stake <= TOLERANCE, - "Parent stake should be close to {:?}, but was {}", - expected_parent_stake, - stake_parent_2 + "Parent stake should be close to {expected_parent_stake:?}, but was {stake_parent_2}" ); // Parent stake calculation: // Initial stake: 500,000 @@ -3773,9 +3732,7 @@ fn test_dynamic_parent_child_relationships() { (I96F32::from_num(stake_child1_2) - expected_child1_stake).abs() / expected_child1_stake <= TOLERANCE, - "Child1 stake should be close to {:?}, but was {}", - expected_child1_stake, - stake_child1_2 + "Child1 stake should be close to {expected_child1_stake:?}, but was {stake_child1_2}" ); // Child1 stake calculation: // Initial stake: 50,000 @@ -3788,9 +3745,7 @@ fn test_dynamic_parent_child_relationships() { (I96F32::from_num(stake_child2_2) - expected_child2_stake).abs() / expected_child2_stake <= TOLERANCE, - "Child2 stake should be close to {:?}, but was {}", - expected_child2_stake, - stake_child2_2 + "Child2 stake should be close to {expected_child2_stake:?}, but was {stake_child2_2}" ); // Child2 stake calculation: // Initial stake: 30,000 @@ -3945,8 +3900,8 @@ fn test_dividend_distribution_with_children_same_coldkey_owner() { let rel_stake_a = I96F32::from_num(stake_a) / total_alpha; let rel_stake_b = I96F32::from_num(stake_b) / total_alpha; - log::info!("rel_stake_a: {:?}", rel_stake_a); // 0.75 -> 3/4 - log::info!("rel_stake_b: {:?}", rel_stake_b); // 0.25 -> 1/4 + log::info!("rel_stake_a: {rel_stake_a:?}"); // 0.75 -> 3/4 + log::info!("rel_stake_b: {rel_stake_b:?}"); // 0.25 -> 1/4 let epsilon = I96F32::from_num(0.0001); assert!((rel_stake_a - I96F32::from_num(300_000) / total_tao).abs() <= epsilon); assert!((rel_stake_b - I96F32::from_num(100_000) / total_tao).abs() <= epsilon); @@ -3967,7 +3922,7 @@ fn test_dividend_distribution_with_children_same_coldkey_owner() { let hotkey_emission = SubtensorModule::epoch(netuid, hardcoded_emission.saturating_to_num::().into()); - log::info!("hotkey_emission: {:?}", hotkey_emission); + log::info!("hotkey_emission: {hotkey_emission:?}"); let total_emission: I96F32 = hotkey_emission .iter() .map(|(_, _, emission)| I96F32::from_num(*emission)) @@ -4002,8 +3957,8 @@ fn test_dividend_distribution_with_children_same_coldkey_owner() { netuid, hardcoded_emission.saturating_to_num::().into(), ); - log::info!("dividends_a: {:?}", dividends_a); - log::info!("dividends_b: {:?}", dividends_b); + log::info!("dividends_a: {dividends_a:?}"); + log::info!("dividends_b: {dividends_b:?}"); // We expect A should have no impact from B, as they have the same owner. assert_eq!(dividends_a.len(), 1); diff --git a/pallets/subtensor/src/tests/coinbase.rs b/pallets/subtensor/src/tests/coinbase.rs index 2ed25b4c10..c6cb2e0049 100644 --- a/pallets/subtensor/src/tests/coinbase.rs +++ b/pallets/subtensor/src/tests/coinbase.rs @@ -16,10 +16,7 @@ use subtensor_swap_interface::SwapHandler; fn close(value: u64, target: u64, eps: u64) { assert!( (value as i64 - target as i64).abs() < eps as i64, - "Assertion failed: value = {}, target = {}, eps = {}", - value, - target, - eps + "Assertion failed: value = {value}, target = {target}, eps = {eps}" ) } @@ -2411,7 +2408,7 @@ fn test_run_coinbase_not_started_start_after() { let new_stake = SubtensorModule::get_total_stake_for_hotkey(&hotkey); // We expect the stake to remain unchanged. assert!(new_stake > init_stake); - log::info!("new_stake: {}", new_stake); + log::info!("new_stake: {new_stake}"); }); } diff --git a/pallets/subtensor/src/tests/consensus.rs b/pallets/subtensor/src/tests/consensus.rs index 0afca99445..6a7aa7d467 100644 --- a/pallets/subtensor/src/tests/consensus.rs +++ b/pallets/subtensor/src/tests/consensus.rs @@ -257,10 +257,7 @@ fn init_run_epochs( } } let duration = start.elapsed(); - log::info!( - "Time elapsed in (sparse={sparse}) epoch() is: {:?}", - duration - ); + log::info!("Time elapsed in (sparse={sparse}) epoch() is: {duration:?}"); // let bonds = SubtensorModule::get_bonds( netuid ); // for (uid, node) in [ (validators[0], "validator"), (servers[0], "server") ] { diff --git a/pallets/subtensor/src/tests/delegate_info.rs b/pallets/subtensor/src/tests/delegate_info.rs index 22b2aab2bf..1a002735ec 100644 --- a/pallets/subtensor/src/tests/delegate_info.rs +++ b/pallets/subtensor/src/tests/delegate_info.rs @@ -29,9 +29,7 @@ fn test_return_per_1000_tao() { let eps: f64 = 0.0005e9; // Precision within 0.0005 TAO assert!( diff_from_expected.abs() <= eps, - "Difference from expected: {} is greater than precision: {}", - diff_from_expected, - eps + "Difference from expected: {diff_from_expected} is greater than precision: {eps}" ); } @@ -160,7 +158,7 @@ fn test_get_delegated() { ); }; } else { - panic!("Coldkey {} not found in expected stake map", coldkey); + panic!("Coldkey {coldkey} not found in expected stake map"); } } } diff --git a/pallets/subtensor/src/tests/epoch.rs b/pallets/subtensor/src/tests/epoch.rs index c682417bab..aa29209118 100644 --- a/pallets/subtensor/src/tests/epoch.rs +++ b/pallets/subtensor/src/tests/epoch.rs @@ -251,10 +251,7 @@ fn init_run_epochs( } } let duration = start.elapsed(); - log::info!( - "Time elapsed in (sparse={sparse}) epoch() is: {:?}", - duration - ); + log::info!("Time elapsed in (sparse={sparse}) epoch() is: {duration:?}"); // let bonds = SubtensorModule::get_bonds( netuid ); // for (uid, node) in vec![ (validators[0], "validator"), (servers[0], "server") ] { @@ -2097,9 +2094,7 @@ fn test_deregistered_miner_bonds() { let block_number = System::block_number(); assert!( block_at_registration >= block_number - 2, - "block at registration: {}, block number: {}", - block_at_registration, - block_number + "block at registration: {block_at_registration}, block number: {block_number}" ); // set tempo to 2 blocks @@ -2120,15 +2115,11 @@ fn test_deregistered_miner_bonds() { // For server1, (uid2), the bond should be higher than before. assert!( bond_0_2_new >= bond_0_2, - "bond_0_2_new: {}, bond_0_2: {}", - bond_0_2_new, - bond_0_2 + "bond_0_2_new: {bond_0_2_new}, bond_0_2: {bond_0_2}" ); assert!( bond_0_3_new <= bond_0_3, - "bond_0_3_new: {}, bond_0_3: {}", - bond_0_3_new, - bond_0_3 + "bond_0_3_new: {bond_0_3_new}, bond_0_3: {bond_0_3}" ); }); } @@ -2309,11 +2300,7 @@ fn test_get_set_alpha() { let (grabbed_alpha_low, grabbed_alpha_high): (u16, u16) = SubtensorModule::get_alpha_values(netuid); - log::info!( - "alpha_low: {:?} alpha_high: {:?}", - grabbed_alpha_low, - grabbed_alpha_high - ); + log::info!("alpha_low: {grabbed_alpha_low:?} alpha_high: {grabbed_alpha_high:?}"); assert_eq!(grabbed_alpha_low, alpha_low); assert_eq!(grabbed_alpha_high, alpha_high); @@ -2510,7 +2497,7 @@ fn test_can_set_self_weight_as_subnet_owner() { assert_eq!(hotkey_emission[0].0, subnet_owner_hotkey); assert_eq!(hotkey_emission[1].0, other_hotkey); - log::debug!("hotkey_emission: {:?}", hotkey_emission); + log::debug!("hotkey_emission: {hotkey_emission:?}"); // Both should have received incentive emission assert!(hotkey_emission[0].1 > 0.into()); assert!(hotkey_emission[1].1 > 0.into()); @@ -2673,8 +2660,7 @@ fn test_epoch_outputs_single_staker_registered_no_weights() { pub fn assert_approx_eq(left: I32F32, right: I32F32, epsilon: I32F32) { if (left - right).abs() > epsilon { panic!( - "assertion failed: `(left ≈ right)`\n left: `{:?}`,\n right: `{:?}`,\n epsilon: `{:?}`", - left, right, epsilon + "assertion failed: `(left ≈ right)`\n left: `{left:?}`,\n right: `{right:?}`,\n epsilon: `{epsilon:?}`" ); } } diff --git a/pallets/subtensor/src/tests/math.rs b/pallets/subtensor/src/tests/math.rs index 1db3622373..a200fa8b25 100644 --- a/pallets/subtensor/src/tests/math.rs +++ b/pallets/subtensor/src/tests/math.rs @@ -13,11 +13,11 @@ use substrate_fixed::{ }; fn assert_float_compare(a: I32F32, b: I32F32, epsilon: I32F32) { - assert!(I32F32::abs(a - b) <= epsilon, "a({:?}) != b({:?})", a, b); + assert!(I32F32::abs(a - b) <= epsilon, "a({a:?}) != b({b:?})"); } fn assert_float_compare_64(a: I64F64, b: I64F64, epsilon: I64F64) { - assert!(I64F64::abs(a - b) <= epsilon, "a({:?}) != b({:?})", a, b); + assert!(I64F64::abs(a - b) <= epsilon, "a({a:?}) != b({b:?})"); } fn assert_vec_compare(va: &[I32F32], vb: &[I32F32], epsilon: I32F32) { @@ -87,9 +87,7 @@ fn assert_mat_approx_eq(left: &[Vec], right: &[Vec], epsilon: I3 for (left_val, right_val) in left_row.iter().zip(right_row.iter()) { assert!( (left_val - right_val).abs() <= epsilon, - "left: {:?}, right: {:?}", - left_val, - right_val + "left: {left_val:?}, right: {right_val:?}" ); } } @@ -2505,9 +2503,9 @@ fn test_fixed_proportion_to_u16() { fn test_fixed_proportion_to_u16_saturates() { let expected = u16::MAX; let input = I32F32::from_num(expected); - log::trace!("Testing with input: {:?}", input); // Debug output + log::trace!("Testing with input: {input:?}"); // Debug output let result = fixed_proportion_to_u16(input); - log::trace!("Testing with result: {:?}", result); // Debug output + log::trace!("Testing with result: {result:?}"); // Debug output assert_eq!(result, expected); } diff --git a/pallets/subtensor/src/tests/migration.rs b/pallets/subtensor/src/tests/migration.rs index 895d48b2eb..611012b2b7 100644 --- a/pallets/subtensor/src/tests/migration.rs +++ b/pallets/subtensor/src/tests/migration.rs @@ -27,10 +27,7 @@ use substrate_fixed::types::extra::U2; fn close(value: u64, target: u64, eps: u64) { assert!( (value as i64 - target as i64).abs() < eps as i64, - "Assertion failed: value = {}, target = {}, eps = {}", - value, - target, - eps + "Assertion failed: value = {value}, target = {target}, eps = {eps}" ) } diff --git a/pallets/subtensor/src/tests/mock.rs b/pallets/subtensor/src/tests/mock.rs index 7f0ff7e597..81bf186eea 100644 --- a/pallets/subtensor/src/tests/mock.rs +++ b/pallets/subtensor/src/tests/mock.rs @@ -503,6 +503,7 @@ impl pallet_scheduler::Config for Test { type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type OriginPrivilegeCmp = OriginPrivilegeCmp; type Preimages = Preimage; + type BlockNumberProvider = System; } impl pallet_utility::Config for Test { @@ -682,6 +683,7 @@ pub fn test_ext_with_balances(balances: Vec<(U256, u128)>) -> sp_io::TestExterna .iter() .map(|(a, b)| (*a, *b as u64)) .collect::>(), + dev_accounts: None, } .assimilate_storage(&mut t) .unwrap(); @@ -758,7 +760,7 @@ pub(crate) fn step_epochs(count: u16, netuid: NetUid) { SubtensorModule::get_tempo(netuid), SubtensorModule::get_current_block_as_u64(), ); - log::info!("Blocks to next epoch: {:?}", blocks_to_next_epoch); + log::info!("Blocks to next epoch: {blocks_to_next_epoch:?}"); step_block(blocks_to_next_epoch as u16); assert!(SubtensorModule::should_run_epoch( @@ -808,10 +810,7 @@ pub fn register_ok_neuron( ); assert_ok!(result); log::info!( - "Register ok neuron: netuid: {:?}, coldkey: {:?}, hotkey: {:?}", - netuid, - hotkey_account_id, - coldkey_account_id + "Register ok neuron: netuid: {netuid:?}, coldkey: {hotkey_account_id:?}, hotkey: {coldkey_account_id:?}" ); } diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 08dade7ef3..987a5d20e0 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -1230,13 +1230,13 @@ fn test_remove_stake_from_hotkey_account_registered_in_various_networks() { let neuron_uid = match SubtensorModule::get_uid_for_net_and_hotkey(netuid, &hotkey_id) { Ok(k) => k, - Err(e) => panic!("Error: {:?}", e), + Err(e) => panic!("Error: {e:?}"), }; let neuron_uid_ex = match SubtensorModule::get_uid_for_net_and_hotkey(netuid_ex, &hotkey_id) { Ok(k) => k, - Err(e) => panic!("Error: {:?}", e), + Err(e) => panic!("Error: {e:?}"), }; // Add some stake that can be removed @@ -2151,10 +2151,10 @@ fn test_get_total_delegated_stake_after_unstaking() { let expected_delegated_stake = initial_stake - unstake_amount - existential_deposit - fee; // Debug prints - log::debug!("Initial stake: {}", initial_stake); - log::debug!("Unstake amount: {}", unstake_amount); - log::debug!("Existential deposit: {}", existential_deposit); - log::debug!("Expected delegated stake: {}", expected_delegated_stake); + log::debug!("Initial stake: {initial_stake}"); + log::debug!("Unstake amount: {unstake_amount}"); + log::debug!("Existential deposit: {existential_deposit}"); + log::debug!("Expected delegated stake: {expected_delegated_stake}"); log::debug!( "Actual delegated stake: {}", SubtensorModule::get_total_stake_for_coldkey(&delegate_coldkey) @@ -2216,11 +2216,11 @@ fn test_get_total_delegated_stake_single_delegator() { )); // Debug prints - log::debug!("Delegate coldkey: {:?}", delegate_coldkey); - log::debug!("Delegate hotkey: {:?}", delegate_hotkey); - log::debug!("Delegator: {:?}", delegator); - log::debug!("Stake amount: {}", stake_amount); - log::debug!("Existential deposit: {}", existential_deposit); + log::debug!("Delegate coldkey: {delegate_coldkey:?}"); + log::debug!("Delegate hotkey: {delegate_hotkey:?}"); + log::debug!("Delegator: {delegator:?}"); + log::debug!("Stake amount: {stake_amount}"); + log::debug!("Existential deposit: {existential_deposit}"); log::debug!( "Total stake for hotkey: {}", SubtensorModule::get_total_stake_for_hotkey(&delegate_hotkey) @@ -2616,7 +2616,7 @@ fn test_remove_stake_fee_realistic_values() { // FIXME since fee is calculated by SwapInterface and the values here are after fees, the // actual_fee is 0. but it's left here to discuss in review let actual_fee = expected_tao - (balance_after - balance_before); - log::info!("Actual fee: {:?}", actual_fee); + log::info!("Actual fee: {actual_fee:?}"); assert_abs_diff_eq!(actual_fee, expected_fee, epsilon = expected_fee / 1000); }); diff --git a/pallets/subtensor/src/tests/staking2.rs b/pallets/subtensor/src/tests/staking2.rs index 973ec855bf..9ae58a2fbb 100644 --- a/pallets/subtensor/src/tests/staking2.rs +++ b/pallets/subtensor/src/tests/staking2.rs @@ -231,15 +231,9 @@ fn test_share_based_staking() { + stake_amount.to_u64() as f64 * (secondary_stake.to_u64() as f64 / total_hotkey_stake.to_u64() as f64); + log::info!("Primary final stake: {primary_final_stake} (expected: {primary_expected})"); log::info!( - "Primary final stake: {} (expected: {})", - primary_final_stake, - primary_expected - ); - log::info!( - "Secondary final stake: {} (expected: {})", - secondary_final_stake, - secondary_expected + "Secondary final stake: {secondary_final_stake} (expected: {secondary_expected})" ); assert!( @@ -350,9 +344,7 @@ fn test_share_based_staking() { ); let excessive_amount = available_stake + 1000.into(); log::info!( - "Attempting to remove excessive stake: {} + 1000 = {}", - available_stake, - excessive_amount + "Attempting to remove excessive stake: {available_stake} + 1000 = {excessive_amount}" ); SubtensorModule::decrease_stake_for_hotkey_and_coldkey_on_subnet( &primary_hotkey, @@ -365,10 +357,7 @@ fn test_share_based_staking() { &primary_coldkey, netuid, ); - log::info!( - "Stake after attempting excessive removal: {}", - after_excessive_removal - ); + log::info!("Stake after attempting excessive removal: {after_excessive_removal}"); assert!( after_excessive_removal == available_stake, "Removing more stake performs no action" diff --git a/pallets/subtensor/src/tests/subnet.rs b/pallets/subtensor/src/tests/subnet.rs index d2bab08d39..dffec5b865 100644 --- a/pallets/subtensor/src/tests/subnet.rs +++ b/pallets/subtensor/src/tests/subnet.rs @@ -781,9 +781,7 @@ fn test_no_duplicates_in_symbol_static() { let symbol = SYMBOLS.get(usize::from(netuid)).unwrap(); assert!( seen.insert(symbol.to_vec()), - "Duplicate symbol found for netuid {}: {:?}", - netuid, - symbol + "Duplicate symbol found for netuid {netuid}: {symbol:?}" ); } } diff --git a/pallets/subtensor/src/tests/swap_hotkey.rs b/pallets/subtensor/src/tests/swap_hotkey.rs index 506bd77a9d..8f77fef9fd 100644 --- a/pallets/subtensor/src/tests/swap_hotkey.rs +++ b/pallets/subtensor/src/tests/swap_hotkey.rs @@ -744,7 +744,7 @@ fn test_swap_hotkey_tx_rate_limit_exceeded() { // Get the current transaction rate limit let current_tx_rate_limit = SubtensorModule::get_tx_rate_limit(); - log::info!("current_tx_rate_limit: {:?}", current_tx_rate_limit); + log::info!("current_tx_rate_limit: {current_tx_rate_limit:?}"); // Set the transaction rate limit SubtensorModule::set_tx_rate_limit(tx_rate_limit); diff --git a/pallets/subtensor/src/tests/swap_hotkey_with_subnet.rs b/pallets/subtensor/src/tests/swap_hotkey_with_subnet.rs index de012d4074..89396061be 100644 --- a/pallets/subtensor/src/tests/swap_hotkey_with_subnet.rs +++ b/pallets/subtensor/src/tests/swap_hotkey_with_subnet.rs @@ -784,7 +784,7 @@ fn test_swap_hotkey_tx_rate_limit_exceeded() { // Get the current transaction rate limit let current_tx_rate_limit = SubtensorModule::get_tx_rate_limit(); - log::info!("current_tx_rate_limit: {:?}", current_tx_rate_limit); + log::info!("current_tx_rate_limit: {current_tx_rate_limit:?}"); // Set the transaction rate limit SubtensorModule::set_tx_rate_limit(tx_rate_limit); diff --git a/pallets/subtensor/src/tests/weights.rs b/pallets/subtensor/src/tests/weights.rs index cec33a940c..2ff01bc875 100644 --- a/pallets/subtensor/src/tests/weights.rs +++ b/pallets/subtensor/src/tests/weights.rs @@ -2188,7 +2188,7 @@ fn test_tempo_change_during_commit_reveal_process() { ); let tempo_before_next_reveal: u16 = 200; - log::info!("Changing tempo to {}", tempo_before_next_reveal); + log::info!("Changing tempo to {tempo_before_next_reveal}"); SubtensorModule::set_tempo(netuid, tempo_before_next_reveal); step_epochs(1, netuid); @@ -2221,7 +2221,7 @@ fn test_tempo_change_during_commit_reveal_process() { ); let tempo: u16 = 150; - log::info!("Changing tempo to {}", tempo); + log::info!("Changing tempo to {tempo}"); SubtensorModule::set_tempo(netuid, tempo); step_epochs(1, netuid); @@ -2244,7 +2244,7 @@ fn test_tempo_change_during_commit_reveal_process() { ); let tempo: u16 = 1050; - log::info!("Changing tempo to {}", tempo); + log::info!("Changing tempo to {tempo}"); SubtensorModule::set_tempo(netuid, tempo); assert_ok!(SubtensorModule::commit_weights( @@ -2258,7 +2258,7 @@ fn test_tempo_change_during_commit_reveal_process() { ); let tempo: u16 = 805; - log::info!("Changing tempo to {}", tempo); + log::info!("Changing tempo to {tempo}"); SubtensorModule::set_tempo(netuid, tempo); step_epochs(1, netuid); @@ -3106,9 +3106,7 @@ fn test_tempo_and_reveal_period_change_during_commit_reveal_process() { SubtensorModule::set_tempo(netuid, new_tempo); SubtensorModule::set_reveal_period(netuid, new_reveal_period); log::info!( - "Changed tempo to {} and reveal period to {}", - new_tempo, - new_reveal_period + "Changed tempo to {new_tempo} and reveal period to {new_reveal_period}" ); // Step 3: Advance blocks to reach the reveal epoch according to new tempo and reveal period @@ -3162,9 +3160,7 @@ fn test_tempo_and_reveal_period_change_during_commit_reveal_process() { SubtensorModule::set_tempo(netuid, new_tempo_after_reveal); SubtensorModule::set_reveal_period(netuid, new_reveal_period_after_reveal); log::info!( - "Changed tempo to {} and reveal period to {} after reveal", - new_tempo_after_reveal, - new_reveal_period_after_reveal + "Changed tempo to {new_tempo_after_reveal} and reveal period to {new_reveal_period_after_reveal} after reveal" ); // Step 5: Commit again @@ -4229,11 +4225,10 @@ fn test_highly_concurrent_commits_and_reveals_with_multiple_hotkeys() { || e == Error::::ExpiredWeightCommit.into() || e == Error::::InvalidRevealCommitHashNotMatch.into() { - log::info!("Expected error during reveal after epoch advancement: {:?}", e); + log::info!("Expected error during reveal after epoch advancement: {e:?}"); } else { panic!( - "Unexpected error during reveal: {:?}, expected RevealTooEarly, ExpiredWeightCommit, or InvalidRevealCommitHashNotMatch", - e + "Unexpected error during reveal: {e:?}, expected RevealTooEarly, ExpiredWeightCommit, or InvalidRevealCommitHashNotMatch" ); } } @@ -4275,12 +4270,11 @@ fn test_highly_concurrent_commits_and_reveals_with_multiple_hotkeys() { || e == Error::::ExpiredWeightCommit.into() || e == Error::::InvalidRevealCommitHashNotMatch.into() { - log::info!("Expected error during reveal after epoch advancement: {:?}", e); + log::info!("Expected error during reveal after epoch advancement: {e:?}"); break; } else { panic!( - "Unexpected error during reveal after epoch advancement: {:?}, expected RevealTooEarly, ExpiredWeightCommit, or InvalidRevealCommitHashNotMatch", - e + "Unexpected error during reveal after epoch advancement: {e:?}, expected RevealTooEarly, ExpiredWeightCommit, or InvalidRevealCommitHashNotMatch" ); } } @@ -4311,8 +4305,7 @@ fn test_highly_concurrent_commits_and_reveals_with_multiple_hotkeys() { assert_eq!( reveal_result, Err(Error::::ExpiredWeightCommit.into()), - "Expected ExpiredWeightCommit error, got {:?}", - reveal_result + "Expected ExpiredWeightCommit error, got {reveal_result:?}" ); } } @@ -4815,8 +4808,7 @@ fn test_reveal_crv3_commits_success() { ); log::debug!( - "Commit bytes now contain {:#?}", - commit_bytes + "Commit bytes now contain {commit_bytes:#?}" ); assert_ok!(SubtensorModule::do_commit_crv3_weights( @@ -4871,16 +4863,14 @@ fn test_reveal_crv3_commits_success() { assert!( rounded_actual_weight != 0, - "Actual weight for uid {} is zero", - uid_a + "Actual weight for uid {uid_a} is zero" ); let expected_weight = w_b.to_num::(); assert_eq!( rounded_actual_weight, expected_weight, - "Weight mismatch for uid {}: expected {}, got {}", - uid_a, expected_weight, rounded_actual_weight + "Weight mismatch for uid {uid_a}: expected {expected_weight}, got {rounded_actual_weight}" ); } }); @@ -5928,8 +5918,7 @@ fn test_reveal_crv3_commits_removes_past_epoch_commits() { let commits = CRV3WeightCommitsV2::::get(netuid, *epoch); assert!( !commits.is_empty(), - "Expected commits to be present for past epoch {}", - epoch + "Expected commits to be present for past epoch {epoch}" ); } @@ -5939,16 +5928,14 @@ fn test_reveal_crv3_commits_removes_past_epoch_commits() { let commits = CRV3WeightCommitsV2::::get(netuid, *epoch); assert!( commits.is_empty(), - "Expected commits for past epoch {} to be removed", - epoch + "Expected commits for past epoch {epoch} to be removed" ); } let current_epoch_commits = CRV3WeightCommitsV2::::get(netuid, current_epoch); assert!( current_epoch_commits.is_empty(), - "Expected no commits for current epoch {}", - current_epoch + "Expected no commits for current epoch {current_epoch}" ); }); } @@ -6079,8 +6066,7 @@ fn test_reveal_crv3_commits_multiple_valid_commits_all_processed() { assert!( !weights.is_empty(), - "Weights for neuron_uid {} should be set", - neuron_uid + "Weights for neuron_uid {neuron_uid} should be set" ); // Normalize expected weights @@ -6113,18 +6099,13 @@ fn test_reveal_crv3_commits_multiple_valid_commits_all_processed() { { assert_eq!( uid_expected, uid_actual, - "UID mismatch: expected {}, got {}", - uid_expected, uid_actual + "UID mismatch: expected {uid_expected}, got {uid_actual}" ); let diff = (*weight_expected - *weight_actual).abs(); assert!( diff <= delta, - "Weight mismatch for uid {}: expected {}, got {}, diff {}", - uid_expected, - weight_expected, - weight_actual, - diff + "Weight mismatch for uid {uid_expected}: expected {weight_expected}, got {weight_actual}, diff {diff}" ); } } @@ -6266,8 +6247,7 @@ fn test_reveal_crv3_commits_max_neurons() { assert!( !weights.is_empty(), - "Weights for neuron_uid {} should be set", - neuron_uid + "Weights for neuron_uid {neuron_uid} should be set" ); // Normalize expected weights @@ -6300,18 +6280,13 @@ fn test_reveal_crv3_commits_max_neurons() { { assert_eq!( uid_expected, uid_actual, - "UID mismatch: expected {}, got {}", - uid_expected, uid_actual + "UID mismatch: expected {uid_expected}, got {uid_actual}" ); let diff = (*weight_expected - *weight_actual).abs(); assert!( diff <= delta, - "Weight mismatch for uid {}: expected {}, got {}, diff {}", - uid_expected, - weight_expected, - weight_actual, - diff + "Weight mismatch for uid {uid_expected}: expected {weight_expected}, got {weight_actual}, diff {diff}" ); } } diff --git a/pallets/subtensor/src/utils/identity.rs b/pallets/subtensor/src/utils/identity.rs index 059fe2a7a2..1904d0e682 100644 --- a/pallets/subtensor/src/utils/identity.rs +++ b/pallets/subtensor/src/utils/identity.rs @@ -138,7 +138,7 @@ impl Pallet { SubnetIdentitiesV3::::insert(netuid, identity.clone()); // Log the identity set event - log::debug!("SubnetIdentitySet( netuid:{:?} ) ", netuid); + log::debug!("SubnetIdentitySet( netuid:{netuid:?} ) "); // Emit an event to notify that an identity has been set Self::deposit_event(Event::SubnetIdentitySet(netuid)); diff --git a/pallets/subtensor/src/utils/misc.rs b/pallets/subtensor/src/utils/misc.rs index 2481d56a6c..655d320c2f 100644 --- a/pallets/subtensor/src/utils/misc.rs +++ b/pallets/subtensor/src/utils/misc.rs @@ -137,12 +137,12 @@ impl Pallet { Active::::insert(netuid, updated_active_vec); } pub fn set_pruning_score_for_uid(netuid: NetUid, uid: u16, pruning_score: u16) { - log::debug!("netuid = {:?}", netuid); + log::debug!("netuid = {netuid:?}"); log::debug!( "SubnetworkN::::get( netuid ) = {:?}", SubnetworkN::::get(netuid) ); - log::debug!("uid = {:?}", uid); + log::debug!("uid = {uid:?}"); assert!(uid < SubnetworkN::::get(netuid)); PruningScores::::mutate(netuid, |v| { if let Some(s) = v.get_mut(uid as usize) { diff --git a/pallets/swap-interface/Cargo.toml b/pallets/swap-interface/Cargo.toml index 5af146881c..a5ae9ac75f 100644 --- a/pallets/swap-interface/Cargo.toml +++ b/pallets/swap-interface/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition.workspace = true [dependencies] -codec = { workspace = true } -frame-support = { workspace = true } -scale-info = { workspace = true } -substrate-fixed = { workspace = true } -subtensor-runtime-common = { workspace = true } +codec = { workspace = true, features = ["derive"] } +frame-support.workspace = true +scale-info.workspace = true +substrate-fixed.workspace = true +subtensor-runtime-common.workspace = true [lints] workspace = true diff --git a/pallets/swap/Cargo.toml b/pallets/swap/Cargo.toml index 7cf8e98191..a013b8468e 100644 --- a/pallets/swap/Cargo.toml +++ b/pallets/swap/Cargo.toml @@ -1,33 +1,33 @@ [package] name = "pallet-subtensor-swap" version = "0.1.0" -edition = { workspace = true } +edition.workspace = true [dependencies] -alloy-primitives = { workspace = true } -approx = { workspace = true } -codec = { workspace = true } +alloy-primitives.workspace = true +approx.workspace = true +codec = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -log = { workspace = true } -safe-math = { workspace = true } -scale-info = { workspace = true } +frame-support.workspace = true +frame-system.workspace = true +log.workspace = true +safe-math.workspace = true +scale-info = { workspace = true, features = ["derive"] } serde = { workspace = true, optional = true } -sp-arithmetic = { workspace = true } -sp-core = { workspace = true } -sp-io = { workspace = true } -sp-runtime = { workspace = true } -sp-std = { workspace = true } -substrate-fixed = { workspace = true } +sp-arithmetic.workspace = true +sp-core.workspace = true +sp-io.workspace = true +sp-runtime.workspace = true +sp-std.workspace = true +substrate-fixed.workspace = true -pallet-subtensor-swap-runtime-api = { workspace = true } -subtensor-macros = { workspace = true } -subtensor-runtime-common = {workspace = true} -subtensor-swap-interface = { workspace = true } +pallet-subtensor-swap-runtime-api.workspace = true +subtensor-macros.workspace = true +subtensor-runtime-common.workspace = true +subtensor-swap-interface.workspace = true [dev-dependencies] -sp-tracing = { workspace = true } +sp-tracing.workspace = true [lints] workspace = true diff --git a/pallets/swap/rpc/Cargo.toml b/pallets/swap/rpc/Cargo.toml index cc5fbc9067..8c1b692f60 100644 --- a/pallets/swap/rpc/Cargo.toml +++ b/pallets/swap/rpc/Cargo.toml @@ -2,15 +2,15 @@ name = "pallet-subtensor-swap-rpc" version = "1.0.0" description = "RPC interface for the Swap pallet" -edition = { workspace = true } +edition.workspace = true [dependencies] -codec = { workspace = true } -jsonrpsee = { workspace = true } -sp-api = { workspace = true } -sp-blockchain = { workspace = true } -sp-runtime = { workspace = true } -pallet-subtensor-swap-runtime-api = { workspace = true } +codec = { workspace = true, features = ["derive"] } +jsonrpsee.workspace = true +sp-api.workspace = true +sp-blockchain.workspace = true +sp-runtime.workspace = true +pallet-subtensor-swap-runtime-api.workspace = true [features] default = ["std"] diff --git a/pallets/swap/rpc/src/lib.rs b/pallets/swap/rpc/src/lib.rs index e8fa85493d..a2825062db 100644 --- a/pallets/swap/rpc/src/lib.rs +++ b/pallets/swap/rpc/src/lib.rs @@ -72,7 +72,7 @@ where let at = at.unwrap_or_else(|| self.client.info().best_hash); api.current_alpha_price(at, netuid).map_err(|e| { - Error::RuntimeError(format!("Unable to get current alpha price: {:?}", e)).into() + Error::RuntimeError(format!("Unable to get current alpha price: {e:?}")).into() }) } } diff --git a/pallets/swap/runtime-api/Cargo.toml b/pallets/swap/runtime-api/Cargo.toml index d871adb651..6030f5ab88 100644 --- a/pallets/swap/runtime-api/Cargo.toml +++ b/pallets/swap/runtime-api/Cargo.toml @@ -2,19 +2,14 @@ name = "pallet-subtensor-swap-runtime-api" version = "1.0.0" description = "Runtime API for the Swap pallet" -edition = { workspace = true } +edition.workspace = true [dependencies] -codec = { workspace = true } -scale-info = { workspace = true } -sp-api = { workspace = true } -sp-std = { workspace = true } +codec = { workspace = true, features = ["derive"] } +scale-info.workspace = true +sp-api.workspace = true +sp-std.workspace = true [features] default = ["std"] -std = [ - "codec/std", - "scale-info/std", - "sp-api/std", - "sp-std/std", -] +std = ["codec/std", "scale-info/std", "sp-api/std", "sp-std/std"] diff --git a/pallets/swap/src/pallet/impls.rs b/pallets/swap/src/pallet/impls.rs index 32e0ec563c..9d91f370ea 100644 --- a/pallets/swap/src/pallet/impls.rs +++ b/pallets/swap/src/pallet/impls.rs @@ -232,7 +232,7 @@ impl SwapStep { // Hold the fees Pallet::::add_fees(self.netuid, self.order_type, self.fee); let delta_out = Pallet::::convert_deltas(self.netuid, self.order_type, self.delta_in); - log::trace!("\tDelta Out : {:?}", delta_out); + log::trace!("\tDelta Out : {delta_out:?}"); if self.action == SwapStepAction::Crossing { let mut tick = Ticks::::get(self.netuid, self.edge_tick).unwrap_or_default(); @@ -498,11 +498,11 @@ impl Pallet { let mut fee_acc: u64 = 0; log::trace!("======== Start Swap ========"); - log::trace!("Amount Remaining: {}", amount_remaining); + log::trace!("Amount Remaining: {amount_remaining}"); // Swap one tick at a time until we reach one of the stop conditions while amount_remaining > 0 { - log::trace!("\nIteration: {}", iteration_counter); + log::trace!("\nIteration: {iteration_counter}"); log::trace!( "\tCurrent Liquidity: {}", CurrentLiquidity::::get(netuid) @@ -541,7 +541,7 @@ impl Pallet { ); } - log::trace!("\nAmount Paid Out: {}", amount_paid_out); + log::trace!("\nAmount Paid Out: {amount_paid_out}"); log::trace!("======== End Swap ========"); let (tao_reserve_delta, alpha_reserve_delta) = match order_type { diff --git a/pallets/swap/src/pallet/tests.rs b/pallets/swap/src/pallet/tests.rs index 12bd19813a..9affc5ed98 100644 --- a/pallets/swap/src/pallet/tests.rs +++ b/pallets/swap/src/pallet/tests.rs @@ -1715,7 +1715,7 @@ fn bbox(t: U64F64, a: U64F64, b: U64F64) -> U64F64 { fn print_current_price(netuid: NetUid) { let current_sqrt_price = Pallet::::current_price_sqrt(netuid).to_num::(); let current_price = current_sqrt_price * current_sqrt_price; - log::trace!("Current price: {:.6}", current_price); + log::trace!("Current price: {current_price:.6}"); } /// RUST_LOG=pallet_subtensor_swap=trace cargo test --package pallet-subtensor-swap --lib -- pallet::tests::test_wrapping_fees --exact --show-output --nocapture @@ -1797,7 +1797,7 @@ fn test_wrapping_fees() { let fee_rate = FeeRate::::get(netuid) as f64 / u16::MAX as f64; - log::trace!("fee_rate: {:.6}", fee_rate); + log::trace!("fee_rate: {fee_rate:.6}"); log::trace!("position.liquidity: {}", position.liquidity); log::trace!( "initial_box_price: {:.6}", @@ -1819,7 +1819,7 @@ fn test_wrapping_fees() { let (fee_tao, fee_alpha) = position.collect_fees(); - log::trace!("Collected fees: TAO: {}, ALPHA: {}", fee_tao, fee_alpha); + log::trace!("Collected fees: TAO: {fee_tao}, ALPHA: {fee_alpha}"); assert_abs_diff_eq!(fee_tao, expected_fee_tao, epsilon = 1); assert_abs_diff_eq!(fee_alpha, expected_fee_alpha, epsilon = 1); diff --git a/pallets/swap/src/position.rs b/pallets/swap/src/position.rs index 542aa389ad..5a57928a93 100644 --- a/pallets/swap/src/position.rs +++ b/pallets/swap/src/position.rs @@ -1,6 +1,6 @@ use core::marker::PhantomData; -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::pallet_prelude::*; use safe_math::*; use substrate_fixed::types::{I64F64, U64F64}; @@ -159,9 +159,19 @@ impl Position { } } -#[freeze_struct("1f02550d787d80da")] +#[freeze_struct("8501fa251c9d74c")] #[derive( - Clone, Copy, Decode, Default, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo, + Clone, + Copy, + Decode, + DecodeWithMemTracking, + Default, + Encode, + Eq, + MaxEncodedLen, + PartialEq, + RuntimeDebug, + TypeInfo, )] pub struct PositionId(u128); diff --git a/pallets/swap/src/tick.rs b/pallets/swap/src/tick.rs index 20a19007d7..d3493fde45 100644 --- a/pallets/swap/src/tick.rs +++ b/pallets/swap/src/tick.rs @@ -7,7 +7,7 @@ use core::hash::Hash; use core::ops::{Add, AddAssign, BitOr, Deref, Neg, Shl, Shr, Sub, SubAssign}; use alloy_primitives::{I256, U256}; -use codec::{Decode, Encode, Error as CodecError, Input, MaxEncodedLen}; +use codec::{Decode, DecodeWithMemTracking, Encode, Error as CodecError, Input, MaxEncodedLen}; use frame_support::pallet_prelude::*; use safe_math::*; use sp_std::vec; @@ -95,13 +95,14 @@ impl Tick { } /// Struct representing a tick index -#[freeze_struct("31577b3ad1f55092")] +#[freeze_struct("13c1f887258657f2")] #[derive( Debug, Default, Clone, Copy, Encode, + DecodeWithMemTracking, TypeInfo, MaxEncodedLen, PartialEq, diff --git a/pallets/utility/Cargo.toml b/pallets/utility/Cargo.toml index 6d217ebd4b..01ecd42166 100644 --- a/pallets/utility/Cargo.toml +++ b/pallets/utility/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pallet-utility" version = "38.0.0" -edition = "2021" +edition.workspace = true license = "Apache-2.0" description = "FRAME utilities pallet" readme = "README.md" @@ -13,22 +13,22 @@ workspace = true targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { workspace = true } -scale-info = { features = ["derive"], workspace = true } -frame-benchmarking = { workspace = true, default-features = false, optional = true } -frame-support = { workspace = true, default-features = false } -frame-system = { workspace = true, default-features = false } -sp-core = { workspace = true, default-features = false } -sp-io = { workspace = true, default-features = false} -sp-runtime = { workspace = true, default-features = false} -subtensor-macros = { workspace = true } +frame-benchmarking = { workspace = true, optional = true } +frame-support.workspace = true +frame-system.workspace = true +sp-core.workspace = true +sp-io.workspace = true +sp-runtime.workspace = true +codec = { workspace = true, features = ["derive"] } +scale-info = { workspace = true, features = ["derive"] } +subtensor-macros.workspace = true [dev-dependencies] -pallet-balances = { default-features = true, workspace = true } -pallet-collective = { default-features = false, path = "../collective" } -pallet-timestamp = { default-features = true, workspace = true } -sp-core = { default-features = true, workspace = true } -pallet-root-testing = { workspace = true, default-features = false } +pallet-collective.workspace = true +pallet-root-testing.workspace = true +pallet-balances = { workspace = true, default-features = true } +pallet-timestamp = { workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } [features] default = ["std"] @@ -42,7 +42,7 @@ std = [ "sp-io/std", "sp-runtime/std", "pallet-collective/std", - "pallet-root-testing/std" + "pallet-root-testing/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -51,7 +51,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-collective/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks" + "pallet-timestamp/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", @@ -60,5 +60,5 @@ try-runtime = [ "pallet-balances/try-runtime", "pallet-collective/try-runtime", "pallet-root-testing/try-runtime", - "pallet-timestamp/try-runtime" + "pallet-timestamp/try-runtime", ] diff --git a/pallets/utility/src/lib.rs b/pallets/utility/src/lib.rs index 35f11cbc53..294836677d 100644 --- a/pallets/utility/src/lib.rs +++ b/pallets/utility/src/lib.rs @@ -61,7 +61,7 @@ extern crate alloc; use alloc::{boxed::Box, vec::Vec}; use codec::{Decode, Encode}; use frame_support::{ - dispatch::{extract_actual_weight, GetDispatchInfo, PostDispatchInfo}, + dispatch::{GetDispatchInfo, PostDispatchInfo, extract_actual_weight}, traits::{IsSubType, OriginTrait, UnfilteredDispatchable}, }; use sp_core::TypeId; @@ -157,8 +157,7 @@ pub mod pallet { // If you hit this error, you need to try to `Box` big dispatchable parameters. assert!( core::mem::size_of::<::RuntimeCall>() as u32 <= CALL_ALIGN, - "Call enum size should be smaller than {} bytes.", - CALL_ALIGN, + "Call enum size should be smaller than {CALL_ALIGN} bytes.", ); } } diff --git a/pallets/utility/src/tests.rs b/pallets/utility/src/tests.rs index f0389187a9..a883f1b690 100644 --- a/pallets/utility/src/tests.rs +++ b/pallets/utility/src/tests.rs @@ -32,8 +32,8 @@ use frame_support::{ }; use pallet_collective::{EnsureProportionAtLeast, Instance1}; use sp_runtime::{ - traits::{BadOrigin, BlakeTwo256, Dispatchable, Hash}, BuildStorage, DispatchError, TokenError, + traits::{BadOrigin, BlakeTwo256, Dispatchable, Hash}, }; type BlockNumber = u64; @@ -260,6 +260,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .expect("Failed to build storage for test"); pallet_balances::GenesisConfig:: { balances: vec![(1, 10), (2, 10), (3, 10), (4, 10), (5, 2)], + dev_accounts: None, } .assimilate_storage(&mut t) .expect("Failed to build storage for test"); diff --git a/precompiles/Cargo.toml b/precompiles/Cargo.toml index 4b76997001..4045408268 100644 --- a/precompiles/Cargo.toml +++ b/precompiles/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-precompiles" version = "0.1.0" -edition = "2024" +edition.workspace = true authors = ["Opentensor Foundation "] homepage = "https://opentensor.ai/" publish = false @@ -11,31 +11,32 @@ repository = "https://github.com/opentensor/subtensor/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { workspace = true } -ed25519-dalek = { workspace = true } -fp-evm = { workspace = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -log = { workspace = true } -pallet-balances = { workspace = true } -pallet-evm = { workspace = true } -pallet-evm-precompile-dispatch = { workspace = true } -pallet-evm-precompile-modexp = { workspace = true } -pallet-evm-precompile-sha3fips = { workspace = true } -pallet-evm-precompile-simple = { workspace = true } -pallet-proxy = { workspace = true } -precompile-utils = { workspace = true } -sp-core = { workspace = true } -sp-io = { workspace = true } -sp-runtime = { workspace = true } -sp-std = { workspace = true } -subtensor-runtime-common = { workspace = true } -substrate-fixed = { workspace = true } -pallet-subtensor = { workspace = true } -pallet-subtensor-swap = { workspace = true } -pallet-admin-utils = { workspace = true } -subtensor-swap-interface = { workspace = true } -pallet-crowdloan = { workspace = true } +codec = { workspace = true, features = ["derive"] } +ed25519-dalek = { workspace = true, features = ["alloc"] } +fp-evm.workspace = true +frame-support.workspace = true +frame-system.workspace = true +log.workspace = true +pallet-balances.workspace = true +pallet-evm.workspace = true +pallet-evm-precompile-dispatch.workspace = true +pallet-evm-precompile-modexp.workspace = true +pallet-evm-precompile-sha3fips.workspace = true +pallet-evm-precompile-simple.workspace = true +pallet-evm-precompile-bn128.workspace = true +pallet-proxy.workspace = true +precompile-utils.workspace = true +sp-core.workspace = true +sp-io.workspace = true +sp-runtime.workspace = true +sp-std.workspace = true +subtensor-runtime-common.workspace = true +substrate-fixed.workspace = true +pallet-subtensor.workspace = true +pallet-subtensor-swap.workspace = true +pallet-admin-utils.workspace = true +subtensor-swap-interface.workspace = true +pallet-crowdloan.workspace = true [lints] workspace = true @@ -55,6 +56,7 @@ std = [ "pallet-evm-precompile-modexp/std", "pallet-evm-precompile-sha3fips/std", "pallet-evm-precompile-simple/std", + "pallet-evm-precompile-bn128/std", "pallet-evm/std", "pallet-crowdloan/std", "pallet-proxy/std", diff --git a/precompiles/src/extensions.rs b/precompiles/src/extensions.rs index ffa8da5778..62c2cef6e6 100644 --- a/precompiles/src/extensions.rs +++ b/precompiles/src/extensions.rs @@ -91,12 +91,12 @@ pub(crate) trait PrecompileHandleExt: PrecompileHandle { ); } - log::debug!("Dispatch succeeded. Post info: {:?}", post_info); + log::debug!("Dispatch succeeded. Post info: {post_info:?}"); Ok(()) } Err(e) => { - log::error!("Dispatch failed. Error: {:?}", e); + log::error!("Dispatch failed. Error: {e:?}"); log::warn!("Returning error PrecompileFailure::Error"); Err(PrecompileFailure::Error { exit_status: ExitError::Other( @@ -141,7 +141,7 @@ pub(crate) trait PrecompileExt>: Precompile { } else { Some(Err(PrecompileFailure::Error { exit_status: ExitError::Other( - format!("Precompile {:?} is disabled", precompile_enum).into(), + format!("Precompile {precompile_enum:?} is disabled").into(), ), })) } diff --git a/precompiles/src/lib.rs b/precompiles/src/lib.rs index b2ea00f885..f4de789dbf 100644 --- a/precompiles/src/lib.rs +++ b/precompiles/src/lib.rs @@ -13,6 +13,7 @@ use pallet_evm::{ AddressMapping, IsPrecompileResult, Precompile, PrecompileHandle, PrecompileResult, PrecompileSet, }; +use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; use pallet_evm_precompile_dispatch::Dispatch; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_sha3fips::Sha3FIPS256; @@ -106,7 +107,7 @@ where Self(Default::default()) } - pub fn used_addresses() -> [H160; 21] { + pub fn used_addresses() -> [H160; 24] { [ hash(1), hash(2), @@ -114,6 +115,9 @@ where hash(4), hash(5), hash(6), + hash(7), + hash(8), + hash(9), hash(1024), hash(1025), hash(Ed25519Verify::::INDEX), @@ -166,6 +170,9 @@ where a if a == hash(4) => Some(Identity::execute(handle)), a if a == hash(5) => Some(Modexp::execute(handle)), a if a == hash(6) => Some(Dispatch::::execute(handle)), + a if a == hash(7) => Some(Bn128Mul::execute(handle)), + a if a == hash(8) => Some(Bn128Pairing::execute(handle)), + a if a == hash(9) => Some(Bn128Add::execute(handle)), // Non-Frontier specific nor Ethereum precompiles : a if a == hash(1024) => Some(Sha3FIPS256::execute(handle)), a if a == hash(1025) => Some(ECRecoverPublicKey::execute(handle)), diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 22756c2a9a..a403a8462f 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -580,10 +580,7 @@ where let transfer_result = transfer_call.dispatch(RawOrigin::Signed(Self::account_id()).into()); if let Err(dispatch_error) = transfer_result { - log::error!( - "Transfer back to caller failed. Error: {:?}", - dispatch_error - ); + log::error!("Transfer back to caller failed. Error: {dispatch_error:?}"); return Err(PrecompileFailure::Error { exit_status: ExitError::Other("Transfer back to caller failed".into()), }); diff --git a/primitives/safe-math/Cargo.toml b/primitives/safe-math/Cargo.toml index eb39f35807..eae2551a84 100644 --- a/primitives/safe-math/Cargo.toml +++ b/primitives/safe-math/Cargo.toml @@ -1,15 +1,13 @@ [package] name = "safe-math" version = "0.1.0" -edition = { workspace = true } +edition.workspace = true [dependencies] -substrate-fixed = { workspace = true } -sp-arithmetic = { workspace = true } -sp-std = { workspace = true } -num-traits = { version = "0.2.19", default-features = false, features = [ - "libm", -] } +substrate-fixed.workspace = true +sp-arithmetic.workspace = true +sp-std.workspace = true +num-traits = { workspace = true, features = ["libm"] } [lints] workspace = true diff --git a/primitives/share-pool/Cargo.toml b/primitives/share-pool/Cargo.toml index 79b7a232a4..ba42b0d77d 100644 --- a/primitives/share-pool/Cargo.toml +++ b/primitives/share-pool/Cargo.toml @@ -1,20 +1,16 @@ [package] name = "share-pool" version = "0.1.0" -edition = "2024" +edition.workspace = true [dependencies] -substrate-fixed = { workspace = true } -sp-std = { workspace = true } -safe-math = { default-features = false, path = "../safe-math" } +substrate-fixed.workspace = true +sp-std.workspace = true +safe-math.workspace = true [lints] workspace = true [features] default = ["std"] -std = [ - "substrate-fixed/std", - "sp-std/std", - "safe-math/std", -] +std = ["substrate-fixed/std", "sp-std/std", "safe-math/std"] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 5d33e6d201..d65a798d5b 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -4,7 +4,7 @@ version = "4.0.0-dev" description = "Subtensor network" authors = ["Opentensor Foundation "] homepage = "https://opentensor.ai/" -edition = "2024" +edition.workspace = true license = "Unlicense" publish = false repository = "https://github.com/opentensor/subtensor/" @@ -15,94 +15,84 @@ workspace = true [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[[bin]] -name = "spec_version" -path = "src/spec_version.rs" - [dependencies] subtensor-macros.workspace = true -subtensor-custom-rpc-runtime-api = { workspace = true } -smallvec = { workspace = true } -array-bytes = { workspace = true } -log = { workspace = true } -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ - "derive", -] } +subtensor-custom-rpc-runtime-api.workspace = true +smallvec.workspace = true +log.workspace = true +codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["alloc"] } -pallet-aura = { workspace = true } -pallet-balances = { workspace = true } -pallet-subtensor = { workspace = true } -pallet-subtensor-swap = { workspace = true } -pallet-subtensor-swap-runtime-api = { workspace = true } -substrate-fixed = { workspace = true } -subtensor-swap-interface = { workspace = true } -frame-support = { workspace = true } -pallet-grandpa = { workspace = true } -pallet-insecure-randomness-collective-flip = { workspace = true } -frame-system = { workspace = true } +pallet-aura.workspace = true +pallet-balances.workspace = true +pallet-subtensor.workspace = true +pallet-subtensor-swap.workspace = true +pallet-subtensor-swap-runtime-api.workspace = true +substrate-fixed.workspace = true +subtensor-swap-interface.workspace = true +frame-support.workspace = true +pallet-grandpa.workspace = true +pallet-insecure-randomness-collective-flip.workspace = true +frame-system.workspace = true frame-try-runtime = { workspace = true, optional = true } -pallet-timestamp = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-utility = { workspace = true } -frame-executive = { workspace = true } -frame-metadata-hash-extension = { workspace = true } -sp-api = { workspace = true } -sp-authority-discovery = { workspace = true } -sp-block-builder = { workspace = true } -sp-consensus-babe = { workspace = true } -sp-consensus-aura = { workspace = true } -sp-core = { workspace = true } -sp-storage = { workspace = true } -sp-genesis-builder = { workspace = true } -sp-inherents = { workspace = true } -sp-offchain = { workspace = true } -sp-runtime = { workspace = true } -sp-session = { workspace = true } -sp-std = { workspace = true } -sp-transaction-pool = { workspace = true } -sp-version = { workspace = true } -subtensor-runtime-common = { workspace = true } -subtensor-precompiles = { workspace = true } -runtime-common = { workspace = true } -polkadot-core-primitives = { workspace = true } +pallet-timestamp.workspace = true +pallet-transaction-payment.workspace = true +pallet-utility.workspace = true +frame-executive.workspace = true +frame-metadata-hash-extension.workspace = true +sp-api.workspace = true +sp-block-builder.workspace = true +sp-consensus-aura.workspace = true +sp-consensus-babe.workspace = true +sp-core.workspace = true +sp-storage.workspace = true +sp-genesis-builder.workspace = true +sp-inherents.workspace = true +sp-offchain.workspace = true +sp-runtime.workspace = true +sp-session.workspace = true +sp-std.workspace = true +sp-transaction-pool.workspace = true +sp-version.workspace = true +sp-authority-discovery.workspace = true +subtensor-runtime-common.workspace = true +subtensor-precompiles.workspace = true # Temporary sudo -pallet-sudo = { workspace = true } +pallet-sudo.workspace = true -pallet-admin-utils = { workspace = true } +pallet-admin-utils.workspace = true # Used for sudo decentralization -pallet-collective = { workspace = true } -pallet-membership = { workspace = true } +pallet-collective.workspace = true +pallet-membership.workspace = true # Multisig -pallet-multisig = { workspace = true } +pallet-multisig.workspace = true # Proxy Pallet -pallet-proxy = { workspace = true } +pallet-proxy.workspace = true # Scheduler pallet -pallet-scheduler = { workspace = true } -pallet-preimage = { workspace = true } +pallet-scheduler.workspace = true +pallet-preimage.workspace = true # Safe mode pallet - -pallet-safe-mode = { workspace = true } +pallet-safe-mode.workspace = true # Used for the node subtensor's RPCs -frame-system-rpc-runtime-api = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } +frame-system-rpc-runtime-api.workspace = true +pallet-transaction-payment-rpc-runtime-api.workspace = true # Used for runtime benchmarking frame-benchmarking = { workspace = true, optional = true } frame-system-benchmarking = { workspace = true, optional = true } # Identity registry pallet for registering project info -pallet-registry = { workspace = true } +pallet-registry.workspace = true # Metadata commitment pallet -pallet-commitments = { workspace = true } +pallet-commitments.workspace = true # NPoS frame-election-provider-support = { workspace = true } @@ -126,39 +116,39 @@ sp-consensus-slots = { workspace = true } sp-consensus-grandpa = { workspace = true } # Frontier -fp-evm = { workspace = true } -fp-rpc = { workspace = true } -fp-self-contained = { workspace = true } -precompile-utils = { workspace = true } +fp-evm.workspace = true +fp-rpc.workspace = true +fp-self-contained = { workspace = true, features = ["serde"] } +precompile-utils.workspace = true # Frontier FRAME -pallet-base-fee = { workspace = true } -pallet-ethereum = { workspace = true } -pallet-evm = { workspace = true } -pallet-evm-chain-id = { workspace = true } -pallet-evm-precompile-modexp = { workspace = true } -pallet-evm-precompile-sha3fips = { workspace = true } -pallet-evm-precompile-simple = { workspace = true } -pallet-hotfix-sufficients = { workspace = true } -fp-account = { workspace = true } +pallet-base-fee.workspace = true +pallet-ethereum.workspace = true +pallet-evm.workspace = true +pallet-evm-chain-id.workspace = true +pallet-evm-precompile-modexp.workspace = true +pallet-evm-precompile-sha3fips.workspace = true +pallet-evm-precompile-simple.workspace = true +pallet-hotfix-sufficients.workspace = true +fp-account.workspace = true #drand -pallet-drand = { workspace = true, default-features = false } -getrandom = { workspace = true, default-features = false } -tle = { workspace = true } -hex = { workspace = true } -rand_chacha = { workspace = true } -w3f-bls = { workspace = true } -sha2 = { workspace = true } -ark-serialize = { workspace = true } +pallet-drand.workspace = true +getrandom.workspace = true +tle.workspace = true +hex.workspace = true +rand_chacha.workspace = true +w3f-bls.workspace = true +sha2.workspace = true +ark-serialize = { workspace = true, features = ["derive"] } # Crowdloan -pallet-crowdloan = { workspace = true } +pallet-crowdloan.workspace = true [dev-dependencies] -frame-metadata = { workspace = true } -sp-io = { workspace = true } -sp-tracing = { workspace = true } +frame-metadata.workspace = true +sp-io.workspace = true +sp-tracing.workspace = true [build-dependencies] substrate-wasm-builder = { workspace = true, optional = true } @@ -168,7 +158,7 @@ default = ["std"] pow-faucet = ["pallet-subtensor/pow-faucet"] fast-blocks = [ "pallet-subtensor/fast-blocks", - "subtensor-runtime-common/fast-blocks" + "subtensor-runtime-common/fast-blocks", ] std = [ "frame-try-runtime?/std", @@ -177,6 +167,7 @@ std = [ "codec/std", "scale-info/std", "frame-executive/std", + "frame-metadata/std", "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", @@ -237,12 +228,10 @@ std = [ "pallet-offences/std", "pallet-staking-reward-fn/std", "pallet-staking-runtime-api/std", - "runtime-common/std", "sp-authority-discovery/std", "sp-consensus-babe/std", "sp-npos-elections/std", "sp-staking/std", - "polkadot-core-primitives/std", # Frontier "fp-evm/std", "fp-rpc/std", @@ -272,7 +261,7 @@ std = [ "substrate-fixed/std", "pallet-subtensor-swap/std", "pallet-subtensor-swap-runtime-api/std", - "subtensor-swap-interface/std" + "subtensor-swap-interface/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -305,7 +294,6 @@ 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 @@ -314,7 +302,7 @@ runtime-benchmarks = [ "pallet-hotfix-sufficients/runtime-benchmarks", "pallet-drand/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", - "pallet-subtensor-swap/runtime-benchmarks" + "pallet-subtensor-swap/runtime-benchmarks", ] try-runtime = [ "frame-try-runtime/try-runtime", @@ -353,7 +341,6 @@ 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", @@ -362,6 +349,6 @@ try-runtime = [ "pallet-evm/try-runtime", "pallet-evm-chain-id/try-runtime", "pallet-drand/try-runtime", - "pallet-aura/try-runtime" + "pallet-aura/try-runtime", ] metadata-hash = ["substrate-wasm-builder/metadata-hash"] diff --git a/runtime/src/check_nonce.rs b/runtime/src/check_nonce.rs index 2e05c63867..0d28d33252 100644 --- a/runtime/src/check_nonce.rs +++ b/runtime/src/check_nonce.rs @@ -1,7 +1,7 @@ // Customized from the original implementation in the Polkadot SDK. // https://github.com/paritytech/polkadot-sdk/blob/b600af050d6b6c8da59ae2a2a793ee2d8827ab1e/substrate/frame/system/src/extensions/check_nonce.rs -use codec::{Decode, Encode}; +use codec::{Decode, DecodeWithMemTracking, Encode}; use frame_support::{ RuntimeDebugNoBound, dispatch::{DispatchInfo, Pays}, @@ -34,8 +34,8 @@ use subtensor_macros::freeze_struct; /// step. This means that other extensions ahead of `CheckNonce` in the pipeline must not alter the /// nonce during their own preparation step, or else the transaction may be rejected during dispatch /// or lead to an inconsistent account state.. -#[freeze_struct("feac7c9db94d39ac")] -#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +#[freeze_struct("cc77e8303313108b")] +#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct CheckNonce(#[codec(compact)] pub T::Nonce); diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a5580ec38c..6522c03795 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -671,6 +671,7 @@ impl pallet_multisig::Config for Runtime { type DepositFactor = DepositFactor; type MaxSignatories = MaxSignatories; type WeightInfo = pallet_multisig::weights::SubstrateWeight; + type BlockNumberProvider = System; } // Proxy Pallet config @@ -1005,6 +1006,7 @@ impl pallet_scheduler::Config for Runtime { type WeightInfo = pallet_scheduler::weights::SubstrateWeight; type OriginPrivilegeCmp = OriginPrivilegeCmp; type Preimages = Preimage; + type BlockNumberProvider = System; } parameter_types! { @@ -1408,17 +1410,13 @@ impl BalanceConverter for SubtensorEvmBalanceConverter { } else { // Log value too large log::debug!( - "SubtensorEvmBalanceConverter::into_evm_balance( {:?} ) larger than U256::MAX", - value + "SubtensorEvmBalanceConverter::into_evm_balance( {value:?} ) larger than U256::MAX" ); None } } else { // Log overflow - log::debug!( - "SubtensorEvmBalanceConverter::into_evm_balance( {:?} ) overflow", - value - ); + log::debug!("SubtensorEvmBalanceConverter::into_evm_balance( {value:?} ) overflow"); None } } @@ -1433,16 +1431,14 @@ impl BalanceConverter for SubtensorEvmBalanceConverter { } else { // Log value too large log::debug!( - "SubtensorEvmBalanceConverter::into_substrate_balance( {:?} ) larger than u64::MAX", - value + "SubtensorEvmBalanceConverter::into_substrate_balance( {value:?} ) larger than u64::MAX" ); None } } else { // Log overflow log::debug!( - "SubtensorEvmBalanceConverter::into_substrate_balance( {:?} ) overflow", - value + "SubtensorEvmBalanceConverter::into_substrate_balance( {value:?} ) overflow" ); None } @@ -1473,6 +1469,8 @@ impl pallet_evm::Config for Runtime { type BalanceConverter = SubtensorEvmBalanceConverter; type AccountProvider = pallet_evm::FrameSystemAccountProvider; type GasLimitStorageGrowthRatio = (); + type CreateOriginFilter = (); + type CreateInnerOriginFilter = (); } parameter_types! { @@ -2248,7 +2246,7 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; + use frame_benchmarking::{baseline, BenchmarkList}; use frame_support::traits::StorageInfoTrait; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; @@ -2264,7 +2262,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, alloc::string::String> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_benchmarking::{baseline, BenchmarkBatch}; use sp_storage::TrackedStorageKey; use frame_system_benchmarking::Pallet as SystemBench; diff --git a/runtime/tests/pallet_proxy.rs b/runtime/tests/pallet_proxy.rs index 5c6c9cd821..bfd003ed17 100644 --- a/runtime/tests/pallet_proxy.rs +++ b/runtime/tests/pallet_proxy.rs @@ -24,6 +24,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { (AccountId::from(DELEGATE), amount), (AccountId::from(OTHER_ACCOUNT), amount), ], + dev_accounts: None, }, triumvirate: pallet_collective::GenesisConfig { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8b497b3762..bfb378c468 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.87" +channel = "1.88" # rustc 1.88.0 (6b00bc388 2025-06-23) components = [ "cargo", "clippy", @@ -10,5 +10,5 @@ components = [ "rustc-dev", "rustfmt", ] -targets = ["wasm32-unknown-unknown"] +targets = ["wasm32v1-none"] profile = "minimal" diff --git a/support/linting/Cargo.toml b/support/linting/Cargo.toml index a74f77be2a..1b7528cb17 100644 --- a/support/linting/Cargo.toml +++ b/support/linting/Cargo.toml @@ -1,13 +1,19 @@ [package] name = "subtensor-linting" version = "0.1.0" -edition = "2024" +edition.workspace = true [dependencies] -syn.workspace = true +syn = { workspace = true, features = [ + "full", + "visit-mut", + "visit", + "extra-traits", + "parsing", +] } quote.workspace = true proc-macro2.workspace = true -procedural-fork = { version = "1.10.0-rc3", path = "../procedural-fork" } +procedural-fork.workspace = true [lints] workspace = true diff --git a/support/macros/Cargo.toml b/support/macros/Cargo.toml index e9acb21ab7..3f9a9c2c33 100644 --- a/support/macros/Cargo.toml +++ b/support/macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-macros" version = "0.1.0" -edition = "2024" +edition.workspace = true license = "MIT" description = "support macros for Subtensor" @@ -12,10 +12,16 @@ homepage = "https://bittensor.com/" proc-macro = true [dependencies] -syn.workspace = true +syn = { workspace = true, features = [ + "full", + "visit-mut", + "visit", + "extra-traits", + "parsing", +] } proc-macro2.workspace = true quote.workspace = true -ahash = "0.8" +ahash.workspace = true [lints] workspace = true diff --git a/support/macros/src/lib.rs b/support/macros/src/lib.rs index 91b5ed2a78..ccd3274148 100644 --- a/support/macros/src/lib.rs +++ b/support/macros/src/lib.rs @@ -41,7 +41,7 @@ fn freeze_struct_impl( visit_item_struct_mut(&mut visitor, &mut item_clone); let calculated_hash = generate_hash(&item_clone); - let calculated_hash_hex = format!("{:x}", calculated_hash); + let calculated_hash_hex = format!("{calculated_hash:x}"); if attr.is_empty() { return Err(Error::new_spanned( @@ -60,11 +60,10 @@ fn freeze_struct_impl( return Err(Error::new_spanned( item, format!( - "You have made a non-trivial change to this struct and the provided hashcode no longer matches:\n{} != {}\n\n\ + "You have made a non-trivial change to this struct and the provided hashcode no longer matches:\n{provided_hash_hex} != {calculated_hash_hex}\n\n\ If this was intentional, please update the hashcode in the `freeze_struct` attribute to:\n\ - {}\n\nNote that if you are changing a storage struct in any way, including simply re-ordering fields, \ - you will need a migration to prevent data corruption.", - provided_hash_hex, calculated_hash_hex, calculated_hash_hex + {calculated_hash_hex}\n\nNote that if you are changing a storage struct in any way, including simply re-ordering fields, \ + you will need a migration to prevent data corruption." ), )); } diff --git a/support/procedural-fork/Cargo.toml b/support/procedural-fork/Cargo.toml index 503c81f1fd..fdc280ec14 100644 --- a/support/procedural-fork/Cargo.toml +++ b/support/procedural-fork/Cargo.toml @@ -1,31 +1,37 @@ [package] name = "procedural-fork" version = "1.10.0-rc3" -edition = "2021" +edition.workspace = true [lints.clippy] all = "allow" [dependencies] -derive-syn-parse = "0.2" -Inflector = "0.11" -cfg-expr = "0.15" -itertools = "0.10" +derive-syn-parse.workspace = true +Inflector.workspace = true +cfg-expr.workspace = true +itertools.workspace = true proc-macro2.workspace = true quote.workspace = true -syn.workspace = true -macro_magic = { version = "0.5", features = ["proc_support"] } -frame-support-procedural-tools = { version = "10.0.0" } -proc-macro-warning = { version = "1", default-features = false } -expander = "2" -sp-crypto-hashing = { default-features = false, version = "0.1.0" } +syn = { workspace = true, features = [ + "full", + "visit-mut", + "visit", + "extra-traits", + "parsing", +] } +macro_magic = { workspace = true, features = ["proc_support"] } +frame-support-procedural-tools.workspace = true +proc-macro-warning.workspace = true +expander.workspace = true +sp-crypto-hashing.workspace = true [dev-dependencies] -regex = "1" +regex.workspace = true [features] default = ["std"] -std = ["sp-crypto-hashing/std"] +std = ["sp-crypto-hashing/std", "regex/std"] no-metadata-docs = [] experimental = [] # Generate impl-trait for tuples with the given number of tuples. Will be needed as the number of diff --git a/support/procedural-fork/src/benchmark.rs b/support/procedural-fork/src/benchmark.rs index 0eb3c330a1..61cda35c66 100644 --- a/support/procedural-fork/src/benchmark.rs +++ b/support/procedural-fork/src/benchmark.rs @@ -21,16 +21,16 @@ use derive_syn_parse::Parse; use frame_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro::TokenStream; use proc_macro2::{Ident, Span, TokenStream as TokenStream2}; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{ + Attribute, Error, Expr, ExprBlock, ExprCall, ExprPath, FnArg, Item, ItemFn, ItemMod, Pat, Path, + PathArguments, PathSegment, Result, ReturnType, Signature, Stmt, Token, Type, TypePath, + Visibility, WhereClause, parse::{Nothing, ParseStream}, parse_quote, punctuated::Punctuated, spanned::Spanned, token::{Comma, Gt, Lt, PathSep}, - Attribute, Error, Expr, ExprBlock, ExprCall, ExprPath, FnArg, Item, ItemFn, ItemMod, Pat, Path, - PathArguments, PathSegment, Result, ReturnType, Signature, Stmt, Token, Type, TypePath, - Visibility, WhereClause, }; mod keywords { @@ -297,9 +297,9 @@ fn ensure_valid_return_type(item_fn: &ItemFn) -> Result<()> { let non_unit = |span| return Err(Error::new(span, "expected `()`")); let Type::Path(TypePath { path, qself: _ }) = &**typ else { return Err(Error::new( - typ.span(), - "Only `Result<(), BenchmarkError>` or a blank return type is allowed on benchmark function definitions", - )); + typ.span(), + "Only `Result<(), BenchmarkError>` or a blank return type is allowed on benchmark function definitions", + )); }; let seg = path .segments @@ -363,9 +363,9 @@ fn parse_params(item_fn: &ItemFn) -> Result> { let var_span = ident.span(); let invalid_param_name = || { return Err(Error::new( - var_span, - "Benchmark parameter names must consist of a single lowercase letter (a-z) and no other characters.", - )); + var_span, + "Benchmark parameter names must consist of a single lowercase letter (a-z) and no other characters.", + )); }; let name = ident.ident.to_token_stream().to_string(); if name.len() > 1 { @@ -404,9 +404,9 @@ fn parse_params(item_fn: &ItemFn) -> Result> { /// Used in several places where the `#[extrinsic_call]` or `#[body]` annotation is missing fn missing_call(item_fn: &ItemFn) -> Result { return Err(Error::new( - item_fn.block.brace_token.span.join(), - "No valid #[extrinsic_call] or #[block] annotation could be found in benchmark function body." - )); + item_fn.block.brace_token.span.join(), + "No valid #[extrinsic_call] or #[block] annotation could be found in benchmark function body.", + )); } /// Finds the `BenchmarkCallDef` and its index (within the list of stmts for the fn) and @@ -455,7 +455,7 @@ fn parse_call_def(item_fn: &ItemFn) -> Result<(usize, BenchmarkCallDef)> { return Err(Error::new( call_defs[1].1.attr_span(), "Only one #[extrinsic_call] or #[block] attribute is allowed per benchmark.", - )) + )); } }) } diff --git a/support/procedural-fork/src/construct_runtime/expand/config.rs b/support/procedural-fork/src/construct_runtime/expand/config.rs index ff715e5846..1fbcd107f6 100644 --- a/support/procedural-fork/src/construct_runtime/expand/config.rs +++ b/support/procedural-fork/src/construct_runtime/expand/config.rs @@ -18,7 +18,7 @@ use crate::construct_runtime::Pallet; use inflector::Inflector; use proc_macro2::TokenStream; -use quote::{format_ident, quote, ToTokens}; +use quote::{ToTokens, format_ident, quote}; use std::str::FromStr; use syn::Ident; diff --git a/support/procedural-fork/src/construct_runtime/expand/metadata.rs b/support/procedural-fork/src/construct_runtime/expand/metadata.rs index 9f3d9cd4a3..4d338d7977 100644 --- a/support/procedural-fork/src/construct_runtime/expand/metadata.rs +++ b/support/procedural-fork/src/construct_runtime/expand/metadata.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License -use crate::construct_runtime::{parse::PalletPath, Pallet}; +use crate::construct_runtime::{Pallet, parse::PalletPath}; use proc_macro2::TokenStream; use quote::quote; use std::str::FromStr; diff --git a/support/procedural-fork/src/construct_runtime/expand/mod.rs b/support/procedural-fork/src/construct_runtime/expand/mod.rs index 88f9a3c6e3..2d3538fcff 100644 --- a/support/procedural-fork/src/construct_runtime/expand/mod.rs +++ b/support/procedural-fork/src/construct_runtime/expand/mod.rs @@ -37,7 +37,7 @@ pub use inherent::expand_outer_inherent; pub use lock_id::expand_outer_lock_id; pub use metadata::expand_runtime_metadata; pub use origin::expand_outer_origin; -pub use outer_enums::{expand_outer_enum, OuterEnumType}; +pub use outer_enums::{OuterEnumType, expand_outer_enum}; pub use slash_reason::expand_outer_slash_reason; pub use task::expand_outer_task; pub use unsigned::expand_outer_validate_unsigned; diff --git a/support/procedural-fork/src/construct_runtime/expand/outer_enums.rs b/support/procedural-fork/src/construct_runtime/expand/outer_enums.rs index 28e39c7a21..3747cedea2 100644 --- a/support/procedural-fork/src/construct_runtime/expand/outer_enums.rs +++ b/support/procedural-fork/src/construct_runtime/expand/outer_enums.rs @@ -17,7 +17,7 @@ use crate::construct_runtime::Pallet; use proc_macro2::{Span, TokenStream}; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use std::str::FromStr; use syn::{Generics, Ident}; diff --git a/support/procedural-fork/src/construct_runtime/mod.rs b/support/procedural-fork/src/construct_runtime/mod.rs index 9bc271fdc8..cf39972461 100644 --- a/support/procedural-fork/src/construct_runtime/mod.rs +++ b/support/procedural-fork/src/construct_runtime/mod.rs @@ -222,7 +222,7 @@ use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::quote; use std::{collections::HashSet, str::FromStr}; -use syn::{spanned::Spanned, Ident, Result}; +use syn::{Ident, Result, spanned::Spanned}; /// The fixed name of the system pallet. const SYSTEM_PALLET_NAME: &str = "System"; diff --git a/support/procedural-fork/src/construct_runtime/parse.rs b/support/procedural-fork/src/construct_runtime/parse.rs index e5e60b3ff9..d2b2a4e4f6 100644 --- a/support/procedural-fork/src/construct_runtime/parse.rs +++ b/support/procedural-fork/src/construct_runtime/parse.rs @@ -20,11 +20,12 @@ use proc_macro2::{Span, TokenStream}; use quote::ToTokens; use std::collections::{HashMap, HashSet}; use syn::{ + Attribute, Error, Ident, Path, Result, Token, ext::IdentExt, parse::{Parse, ParseStream}, punctuated::Punctuated, spanned::Spanned, - token, Attribute, Error, Ident, Path, Result, Token, + token, }; mod keyword { @@ -149,9 +150,7 @@ impl Parse for WhereSection { remove_kind(input, WhereKind::NodeBlock, &mut definitions)?; remove_kind(input, WhereKind::UncheckedExtrinsic, &mut definitions)?; if let Some(WhereDefinition { - ref kind_span, - ref kind, - .. + kind_span, kind, .. }) = definitions.first() { let msg = format!( diff --git a/support/procedural-fork/src/derive_impl.rs b/support/procedural-fork/src/derive_impl.rs index e91f9c534a..4320a8bf86 100644 --- a/support/procedural-fork/src/derive_impl.rs +++ b/support/procedural-fork/src/derive_impl.rs @@ -20,10 +20,10 @@ use derive_syn_parse::Parse; use macro_magic::mm_core::ForeignPath; use proc_macro2::TokenStream as TokenStream2; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use std::collections::HashSet; use syn::{ - parse2, parse_quote, spanned::Spanned, token, Ident, ImplItem, ItemImpl, Path, Result, Token, + Ident, ImplItem, ItemImpl, Path, Result, Token, parse_quote, parse2, spanned::Spanned, token, }; mod keyword { diff --git a/support/procedural-fork/src/dynamic_params.rs b/support/procedural-fork/src/dynamic_params.rs index e1f9f626ce..eeb7720798 100644 --- a/support/procedural-fork/src/dynamic_params.rs +++ b/support/procedural-fork/src/dynamic_params.rs @@ -21,8 +21,8 @@ use frame_support_procedural_tools::generate_access_from_frame_or_crate; use inflector::Inflector; use proc_macro2::{Span, TokenStream}; -use quote::{format_ident, quote, ToTokens}; -use syn::{parse2, spanned::Spanned, visit_mut, visit_mut::VisitMut, Result, Token}; +use quote::{ToTokens, format_ident, quote}; +use syn::{Result, Token, parse2, spanned::Spanned, visit_mut, visit_mut::VisitMut}; /// Parse and expand a `#[dynamic_params(..)]` module. pub fn dynamic_params(attr: TokenStream, item: TokenStream) -> Result { diff --git a/support/procedural-fork/src/key_prefix.rs b/support/procedural-fork/src/key_prefix.rs index aea60ce3ba..6202d227a9 100644 --- a/support/procedural-fork/src/key_prefix.rs +++ b/support/procedural-fork/src/key_prefix.rs @@ -17,7 +17,7 @@ use frame_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro2::{Span, TokenStream}; -use quote::{format_ident, quote, ToTokens}; +use quote::{ToTokens, format_ident, quote}; use syn::{Ident, Result}; const MAX_IDENTS: usize = 18; diff --git a/support/procedural-fork/src/no_bound/default.rs b/support/procedural-fork/src/no_bound/default.rs index 3f896da352..615268d7bd 100644 --- a/support/procedural-fork/src/no_bound/default.rs +++ b/support/procedural-fork/src/no_bound/default.rs @@ -17,7 +17,7 @@ use proc_macro2::Span; use quote::{quote, quote_spanned}; -use syn::{spanned::Spanned, Data, DeriveInput, Fields}; +use syn::{Data, DeriveInput, Fields, spanned::Spanned}; /// Derive Default but do not bound any generic. pub fn derive_default_no_bound(input: proc_macro::TokenStream) -> proc_macro::TokenStream { @@ -152,7 +152,7 @@ pub fn derive_default_no_bound(input: proc_macro::TokenStream) -> proc_macro::To "Union type not supported by `derive(DefaultNoBound)`", ) .to_compile_error() - .into() + .into(); } }; diff --git a/support/procedural-fork/src/pallet/expand/call.rs b/support/procedural-fork/src/pallet/expand/call.rs index a39e81fd1f..189eabe4cd 100644 --- a/support/procedural-fork/src/pallet/expand/call.rs +++ b/support/procedural-fork/src/pallet/expand/call.rs @@ -16,16 +16,16 @@ // limitations under the License. use crate::{ + COUNTER, pallet::{ + Def, expand::warnings::{weight_constant_warning, weight_witness_warning}, parse::call::CallWeightDef, - Def, }, - COUNTER, }; -use proc_macro2::TokenStream as TokenStream2; use proc_macro_warning::Warning; -use quote::{quote, ToTokens}; +use proc_macro2::TokenStream as TokenStream2; +use quote::{ToTokens, quote}; use syn::spanned::Spanned; /// diff --git a/support/procedural-fork/src/pallet/expand/config.rs b/support/procedural-fork/src/pallet/expand/config.rs index 836c74ae7c..dbaf709e88 100644 --- a/support/procedural-fork/src/pallet/expand/config.rs +++ b/support/procedural-fork/src/pallet/expand/config.rs @@ -18,7 +18,7 @@ use crate::pallet::Def; use proc_macro2::TokenStream; use quote::quote; -use syn::{parse_quote, Item}; +use syn::{Item, parse_quote}; /// /// * Generate default rust doc diff --git a/support/procedural-fork/src/pallet/expand/documentation.rs b/support/procedural-fork/src/pallet/expand/documentation.rs index 62b2e8b8b3..f1b91c5f2a 100644 --- a/support/procedural-fork/src/pallet/expand/documentation.rs +++ b/support/procedural-fork/src/pallet/expand/documentation.rs @@ -18,7 +18,7 @@ use crate::pallet::Def; use proc_macro2::TokenStream; use quote::ToTokens; -use syn::{spanned::Spanned, Attribute, Lit, LitStr}; +use syn::{Attribute, Lit, LitStr, spanned::Spanned}; const DOC: &'static str = "doc"; const PALLET_DOC: &'static str = "pallet_doc"; diff --git a/support/procedural-fork/src/pallet/expand/error.rs b/support/procedural-fork/src/pallet/expand/error.rs index 1b76034efa..e68b8663f6 100644 --- a/support/procedural-fork/src/pallet/expand/error.rs +++ b/support/procedural-fork/src/pallet/expand/error.rs @@ -16,11 +16,11 @@ // limitations under the License. use crate::{ + COUNTER, pallet::{ - parse::error::{VariantDef, VariantField}, Def, + parse::error::{VariantDef, VariantField}, }, - COUNTER, }; use frame_support_procedural_tools::get_doc_literals; use quote::ToTokens; diff --git a/support/procedural-fork/src/pallet/expand/event.rs b/support/procedural-fork/src/pallet/expand/event.rs index 931dcd95a6..8b75f2d45a 100644 --- a/support/procedural-fork/src/pallet/expand/event.rs +++ b/support/procedural-fork/src/pallet/expand/event.rs @@ -16,11 +16,11 @@ // limitations under the License. use crate::{ - pallet::{parse::event::PalletEventDepositAttr, Def}, COUNTER, + pallet::{Def, parse::event::PalletEventDepositAttr}, }; use frame_support_procedural_tools::get_doc_literals; -use syn::{spanned::Spanned, Ident}; +use syn::{Ident, spanned::Spanned}; /// /// * Add __Ignore variant on Event diff --git a/support/procedural-fork/src/pallet/expand/genesis_config.rs b/support/procedural-fork/src/pallet/expand/genesis_config.rs index e171e2468d..e98b410d02 100644 --- a/support/procedural-fork/src/pallet/expand/genesis_config.rs +++ b/support/procedural-fork/src/pallet/expand/genesis_config.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{pallet::Def, COUNTER}; +use crate::{COUNTER, pallet::Def}; use frame_support_procedural_tools::get_doc_literals; use quote::ToTokens; -use syn::{spanned::Spanned, Ident}; +use syn::{Ident, spanned::Spanned}; /// /// * add various derive trait on GenesisConfig struct. diff --git a/support/procedural-fork/src/pallet/expand/inherent.rs b/support/procedural-fork/src/pallet/expand/inherent.rs index 0a80d672ab..832a755145 100644 --- a/support/procedural-fork/src/pallet/expand/inherent.rs +++ b/support/procedural-fork/src/pallet/expand/inherent.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{pallet::Def, COUNTER}; +use crate::{COUNTER, pallet::Def}; use proc_macro2::TokenStream; use quote::quote; -use syn::{spanned::Spanned, Ident}; +use syn::{Ident, spanned::Spanned}; pub fn expand_inherents(def: &mut Def) -> TokenStream { let count = COUNTER.with(|counter| counter.borrow_mut().inc()); diff --git a/support/procedural-fork/src/pallet/expand/instances.rs b/support/procedural-fork/src/pallet/expand/instances.rs index 12423409cf..d6d80854ae 100644 --- a/support/procedural-fork/src/pallet/expand/instances.rs +++ b/support/procedural-fork/src/pallet/expand/instances.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{pallet::Def, NUMBER_OF_INSTANCE}; +use crate::{NUMBER_OF_INSTANCE, pallet::Def}; use proc_macro2::Span; /// diff --git a/support/procedural-fork/src/pallet/expand/origin.rs b/support/procedural-fork/src/pallet/expand/origin.rs index 167445ad64..3399143f04 100644 --- a/support/procedural-fork/src/pallet/expand/origin.rs +++ b/support/procedural-fork/src/pallet/expand/origin.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{pallet::Def, COUNTER}; +use crate::{COUNTER, pallet::Def}; use proc_macro2::TokenStream; use quote::quote; -use syn::{spanned::Spanned, Ident}; +use syn::{Ident, spanned::Spanned}; pub fn expand_origins(def: &mut Def) -> TokenStream { let count = COUNTER.with(|counter| counter.borrow_mut().inc()); diff --git a/support/procedural-fork/src/pallet/expand/pallet_struct.rs b/support/procedural-fork/src/pallet/expand/pallet_struct.rs index 64e5d533cd..8d2e198bc5 100644 --- a/support/procedural-fork/src/pallet/expand/pallet_struct.rs +++ b/support/procedural-fork/src/pallet/expand/pallet_struct.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::pallet::{expand::merge_where_clauses, Def}; +use crate::pallet::{Def, expand::merge_where_clauses}; use frame_support_procedural_tools::get_doc_literals; /// diff --git a/support/procedural-fork/src/pallet/expand/storage.rs b/support/procedural-fork/src/pallet/expand/storage.rs index 95b0466707..51c9e8eb12 100644 --- a/support/procedural-fork/src/pallet/expand/storage.rs +++ b/support/procedural-fork/src/pallet/expand/storage.rs @@ -18,11 +18,11 @@ use crate::{ counter_prefix, pallet::{ + Def, parse::{ helper::two128_str, storage::{Metadata, QueryKind, StorageDef, StorageGenerics}, }, - Def, }, }; use quote::ToTokens; @@ -445,8 +445,8 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { let docs = if cfg!(feature = "no-metadata-docs") { &no_docs } else { &storage.docs }; let ident = &storage.ident; - let gen = &def.type_use_generics(storage.attr_span); - let full_ident = quote::quote_spanned!(storage.attr_span => #ident<#gen> ); + let generics = &def.type_use_generics(storage.attr_span); + let full_ident = quote::quote_spanned!(storage.attr_span => #ident<#generics> ); let cfg_attrs = &storage.cfg_attrs; @@ -469,10 +469,10 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { super::merge_where_clauses(&[&storage.where_clause, &def.config.where_clause]); let ident = &storage.ident; - let gen = &def.type_use_generics(storage.attr_span); + let generics = &def.type_use_generics(storage.attr_span); let type_impl_gen = &def.type_impl_generics(storage.attr_span); let type_use_gen = &def.type_use_generics(storage.attr_span); - let full_ident = quote::quote_spanned!(storage.attr_span => #ident<#gen> ); + let full_ident = quote::quote_spanned!(storage.attr_span => #ident<#generics> ); let cfg_attrs = &storage.cfg_attrs; @@ -876,8 +876,8 @@ pub fn expand_storages(def: &mut Def) -> proc_macro2::TokenStream { // crate. if storage.try_decode && storage.cfg_attrs.is_empty() { let ident = &storage.ident; - let gen = &def.type_use_generics(storage.attr_span); - Some(quote::quote_spanned!(storage.attr_span => #ident<#gen> )) + let generics = &def.type_use_generics(storage.attr_span); + Some(quote::quote_spanned!(storage.attr_span => #ident<#generics> )) } else { None } diff --git a/support/procedural-fork/src/pallet/expand/tasks.rs b/support/procedural-fork/src/pallet/expand/tasks.rs index 8a0bd22528..98496009b3 100644 --- a/support/procedural-fork/src/pallet/expand/tasks.rs +++ b/support/procedural-fork/src/pallet/expand/tasks.rs @@ -19,12 +19,12 @@ //! Home of the expansion code for the Tasks API -use crate::pallet::{parse::tasks::*, Def}; +use crate::pallet::{Def, parse::tasks::*}; use derive_syn_parse::Parse; use inflector::Inflector; use proc_macro2::TokenStream as TokenStream2; -use quote::{format_ident, quote, ToTokens}; -use syn::{parse_quote, spanned::Spanned, ItemEnum, ItemImpl}; +use quote::{ToTokens, format_ident, quote}; +use syn::{ItemEnum, ItemImpl, parse_quote, spanned::Spanned}; impl TaskEnumDef { /// Since we optionally allow users to manually specify a `#[pallet::task_enum]`, in the diff --git a/support/procedural-fork/src/pallet/expand/tt_default_parts.rs b/support/procedural-fork/src/pallet/expand/tt_default_parts.rs index 8e7dc39d86..abd48aa21d 100644 --- a/support/procedural-fork/src/pallet/expand/tt_default_parts.rs +++ b/support/procedural-fork/src/pallet/expand/tt_default_parts.rs @@ -16,8 +16,8 @@ // limitations under the License. use crate::{ - pallet::{CompositeKeyword, Def}, COUNTER, + pallet::{CompositeKeyword, Def}, }; use syn::spanned::Spanned; @@ -38,23 +38,23 @@ pub fn expand_tt_default_parts(def: &mut Def) -> proc_macro2::TokenStream { let storage_part = (!def.storages.is_empty()).then(|| quote::quote!(Storage,)); let event_part = def.event.as_ref().map(|event| { - let gen = event.gen_kind.is_generic().then(|| quote::quote!( )); - quote::quote!( Event #gen , ) + let generics = event.gen_kind.is_generic().then(|| quote::quote!( )); + quote::quote!( Event #generics , ) }); let error_part = def.error.as_ref().map(|_| quote::quote!(Error,)); let origin_part = def.origin.as_ref().map(|origin| { - let gen = origin.is_generic.then(|| quote::quote!( )); - quote::quote!( Origin #gen , ) + let generics = origin.is_generic.then(|| quote::quote!( )); + quote::quote!( Origin #generics , ) }); let config_part = def.genesis_config.as_ref().map(|genesis_config| { - let gen = genesis_config + let generic = genesis_config .gen_kind .is_generic() .then(|| quote::quote!( )); - quote::quote!( Config #gen , ) + quote::quote!( Config #generic , ) }); let inherent_part = def.inherent.as_ref().map(|_| quote::quote!(Inherent,)); @@ -95,23 +95,23 @@ pub fn expand_tt_default_parts(def: &mut Def) -> proc_macro2::TokenStream { let storage_part_v2 = (!def.storages.is_empty()).then(|| quote::quote!(+ Storage)); let event_part_v2 = def.event.as_ref().map(|event| { - let gen = event.gen_kind.is_generic().then(|| quote::quote!()); - quote::quote!(+ Event #gen) + let generic = event.gen_kind.is_generic().then(|| quote::quote!()); + quote::quote!(+ Event #generic) }); let error_part_v2 = def.error.as_ref().map(|_| quote::quote!(+ Error)); let origin_part_v2 = def.origin.as_ref().map(|origin| { - let gen = origin.is_generic.then(|| quote::quote!()); - quote::quote!(+ Origin #gen) + let generic = origin.is_generic.then(|| quote::quote!()); + quote::quote!(+ Origin #generic) }); let config_part_v2 = def.genesis_config.as_ref().map(|genesis_config| { - let gen = genesis_config + let generic = genesis_config .gen_kind .is_generic() .then(|| quote::quote!()); - quote::quote!(+ Config #gen) + quote::quote!(+ Config #generic) }); let inherent_part_v2 = def.inherent.as_ref().map(|_| quote::quote!(+ Inherent)); diff --git a/support/procedural-fork/src/pallet/expand/validate_unsigned.rs b/support/procedural-fork/src/pallet/expand/validate_unsigned.rs index 28c78a1c66..a3a849704d 100644 --- a/support/procedural-fork/src/pallet/expand/validate_unsigned.rs +++ b/support/procedural-fork/src/pallet/expand/validate_unsigned.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{pallet::Def, COUNTER}; +use crate::{COUNTER, pallet::Def}; use proc_macro2::TokenStream; use quote::quote; -use syn::{spanned::Spanned, Ident}; +use syn::{Ident, spanned::Spanned}; pub fn expand_validate_unsigned(def: &mut Def) -> TokenStream { let count = COUNTER.with(|counter| counter.borrow_mut().inc()); diff --git a/support/procedural-fork/src/pallet/mod.rs b/support/procedural-fork/src/pallet/mod.rs index d3796662f1..3636cc611b 100644 --- a/support/procedural-fork/src/pallet/mod.rs +++ b/support/procedural-fork/src/pallet/mod.rs @@ -28,7 +28,7 @@ mod expand; pub(crate) mod parse; -pub use parse::{composite::keyword::CompositeKeyword, Def}; +pub use parse::{Def, composite::keyword::CompositeKeyword}; use syn::spanned::Spanned; mod keyword { diff --git a/support/procedural-fork/src/pallet/parse/call.rs b/support/procedural-fork/src/pallet/parse/call.rs index 865c634732..5555bfdc16 100644 --- a/support/procedural-fork/src/pallet/parse/call.rs +++ b/support/procedural-fork/src/pallet/parse/call.rs @@ -15,12 +15,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{helper, InheritedCallWeightAttr}; +use super::{InheritedCallWeightAttr, helper}; use frame_support_procedural_tools::get_doc_literals; use proc_macro2::Span; use quote::ToTokens; use std::collections::HashMap; -use syn::{spanned::Spanned, ExprClosure}; +use syn::{ExprClosure, spanned::Spanned}; /// List of additional token to be used for parsing. mod keyword { @@ -422,8 +422,7 @@ impl CallDef { }; if feeless_arg_type != arg.2 { - let msg = - "Invalid pallet::call, feeless_if closure argument must have \ + let msg = "Invalid pallet::call, feeless_if closure argument must have \ a reference to the same type as the dispatchable function argument"; return Err(syn::Error::new(feeless_arg.span(), msg)); } diff --git a/support/procedural-fork/src/pallet/parse/composite.rs b/support/procedural-fork/src/pallet/parse/composite.rs index 239b4fd4bc..f679710b9a 100644 --- a/support/procedural-fork/src/pallet/parse/composite.rs +++ b/support/procedural-fork/src/pallet/parse/composite.rs @@ -115,7 +115,7 @@ impl CompositeDef { return Err(syn::Error::new( variant.ident.span(), "The composite enum does not support variants with fields!", - )) + )); } syn::Fields::Unit => (), } diff --git a/support/procedural-fork/src/pallet/parse/config.rs b/support/procedural-fork/src/pallet/parse/config.rs index 95b4143b65..a7b1f043b6 100644 --- a/support/procedural-fork/src/pallet/parse/config.rs +++ b/support/procedural-fork/src/pallet/parse/config.rs @@ -18,7 +18,7 @@ use super::helper; use frame_support_procedural_tools::{get_doc_literals, is_using_frame_crate}; use quote::ToTokens; -use syn::{spanned::Spanned, token, Token}; +use syn::{Token, spanned::Spanned, token}; /// List of additional token to be used for parsing. mod keyword { @@ -239,8 +239,7 @@ fn check_event_type( // Check event has no generics if !type_.generics.params.is_empty() || type_.generics.where_clause.is_some() { - let msg = - "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must have\ + let msg = "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must have\ no generics nor where_clause"; return Err(syn::Error::new(trait_item.span(), msg)); } @@ -265,15 +264,13 @@ fn check_event_type( .find_map(|s| syn::parse2::(s.to_token_stream()).ok()); let Some(from_event_bound) = from_event_bound else { - let msg = - "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must \ + let msg = "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` is reserved and must \ bound: `From` or `From>` or `From>`"; return Err(syn::Error::new(type_.span(), msg)); }; if from_event_bound.is_generic && (from_event_bound.has_instance != trait_has_instance) { - let msg = - "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` bounds inconsistent \ + let msg = "Invalid `type RuntimeEvent`, associated type `RuntimeEvent` bounds inconsistent \ `From`. Config and generic Event must be both with instance or \ without instance"; return Err(syn::Error::new(type_.span(), msg)); @@ -299,7 +296,7 @@ fn has_expected_system_config(path: syn::Path, frame_system: &syn::Path) -> bool // We can't use the path to `frame_system` from `frame` if `frame_system` is not being // in scope through `frame`. { - return false + return false; } (false, true) => // We know that the only valid frame_system path is one that is `frame_system`, as @@ -417,7 +414,7 @@ impl ConfigDef { helper::take_first_item_pallet_attr::(trait_item) { match (pallet_attr.typ, &trait_item) { - (PalletAttrType::Constant(_), syn::TraitItem::Type(ref typ)) => { + (PalletAttrType::Constant(_), syn::TraitItem::Type(typ)) => { if already_constant { return Err(syn::Error::new( pallet_attr._bracket.span.join(), @@ -431,15 +428,15 @@ impl ConfigDef { return Err(syn::Error::new( trait_item.span(), "Invalid #[pallet::constant] in #[pallet::config], expected type item", - )) + )); } (PalletAttrType::NoDefault(_), _) => { if !enable_default { return Err(syn::Error::new( - pallet_attr._bracket.span.join(), - "`#[pallet:no_default]` can only be used if `#[pallet::config(with_default)]` \ - has been specified" - )); + pallet_attr._bracket.span.join(), + "`#[pallet:no_default]` can only be used if `#[pallet::config(with_default)]` \ + has been specified", + )); } if already_no_default { return Err(syn::Error::new( @@ -453,10 +450,10 @@ impl ConfigDef { (PalletAttrType::NoBounds(_), _) => { if !enable_default { return Err(syn::Error::new( - pallet_attr._bracket.span.join(), - "`#[pallet:no_default_bounds]` can only be used if `#[pallet::config(with_default)]` \ - has been specified" - )); + pallet_attr._bracket.span.join(), + "`#[pallet:no_default_bounds]` can only be used if `#[pallet::config(with_default)]` \ + has been specified", + )); } if already_no_default_bounds { return Err(syn::Error::new( diff --git a/support/procedural-fork/src/pallet/parse/error.rs b/support/procedural-fork/src/pallet/parse/error.rs index 7aab5732b7..8bd2f438bd 100644 --- a/support/procedural-fork/src/pallet/parse/error.rs +++ b/support/procedural-fork/src/pallet/parse/error.rs @@ -17,7 +17,7 @@ use super::helper; use quote::ToTokens; -use syn::{spanned::Spanned, Fields}; +use syn::{Fields, spanned::Spanned}; /// List of additional token to be used for parsing. mod keyword { diff --git a/support/procedural-fork/src/pallet/parse/helper.rs b/support/procedural-fork/src/pallet/parse/helper.rs index 1105046c2b..e243dcbbfb 100644 --- a/support/procedural-fork/src/pallet/parse/helper.rs +++ b/support/procedural-fork/src/pallet/parse/helper.rs @@ -16,7 +16,7 @@ // limitations under the License. use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::spanned::Spanned; /// List of additional token to be used for parsing. @@ -196,7 +196,7 @@ impl syn::parse::Parse for StaticLifetime { /// `span` is used in case generics is empty (empty generics has span == call_site). /// /// return the instance if found. -pub fn check_config_def_gen(gen: &syn::Generics, span: proc_macro2::Span) -> syn::Result<()> { +pub fn check_config_def_gen(r#gen: &syn::Generics, span: proc_macro2::Span) -> syn::Result<()> { let expected = "expected `I: 'static = ()`"; pub struct CheckTraitDefGenerics; impl syn::parse::Parse for CheckTraitDefGenerics { @@ -211,7 +211,7 @@ pub fn check_config_def_gen(gen: &syn::Generics, span: proc_macro2::Span) -> syn } } - syn::parse2::(gen.params.to_token_stream()).map_err(|e| { + syn::parse2::(r#gen.params.to_token_stream()).map_err(|e| { let msg = format!("Invalid generics: {}", expected); let mut err = syn::Error::new(span, msg); err.combine(e); @@ -229,7 +229,7 @@ pub fn check_config_def_gen(gen: &syn::Generics, span: proc_macro2::Span) -> syn /// /// return the instance if found. pub fn check_type_def_gen_no_bounds( - gen: &syn::Generics, + r#gen: &syn::Generics, span: proc_macro2::Span, ) -> syn::Result { let expected = "expected `T` or `T, I = ()`"; @@ -254,7 +254,7 @@ pub fn check_type_def_gen_no_bounds( } } - let i = syn::parse2::(gen.params.to_token_stream()) + let i = syn::parse2::(r#gen.params.to_token_stream()) .map_err(|e| { let msg = format!("Invalid type def generics: {}", expected); let mut err = syn::Error::new(span, msg); @@ -277,7 +277,7 @@ pub fn check_type_def_gen_no_bounds( /// /// return some instance usage if there is some generic, or none otherwise. pub fn check_type_def_optional_gen( - gen: &syn::Generics, + r#gen: &syn::Generics, span: proc_macro2::Span, ) -> syn::Result> { let expected = "expected `` or `T` or `T: Config` or `T, I = ()` or \ @@ -335,7 +335,7 @@ pub fn check_type_def_optional_gen( } } - let i = syn::parse2::(gen.params.to_token_stream()) + let i = syn::parse2::(r#gen.params.to_token_stream()) .map_err(|e| { let msg = format!("Invalid type def generics: {}", expected); let mut err = syn::Error::new(span, msg); @@ -400,7 +400,10 @@ pub fn check_pallet_struct_usage(type_: &Box) -> syn::Result syn::Result { +pub fn check_impl_gen( + r#gen: &syn::Generics, + span: proc_macro2::Span, +) -> syn::Result { let expected = "expected `impl` or `impl, I: 'static>`"; pub struct Checker(InstanceUsage); impl syn::parse::Parse for Checker { @@ -428,7 +431,7 @@ pub fn check_impl_gen(gen: &syn::Generics, span: proc_macro2::Span) -> syn::Resu } } - let i = syn::parse2::(gen.params.to_token_stream()) + let i = syn::parse2::(r#gen.params.to_token_stream()) .map_err(|e| { let mut err = syn::Error::new(span, format!("Invalid generics: {}", expected)); err.combine(e); @@ -449,7 +452,7 @@ pub fn check_impl_gen(gen: &syn::Generics, span: proc_macro2::Span) -> syn::Resu /// /// return the instance if found. pub fn check_type_def_gen( - gen: &syn::Generics, + r#gen: &syn::Generics, span: proc_macro2::Span, ) -> syn::Result { let expected = "expected `T` or `T: Config` or `T, I = ()` or \ @@ -503,7 +506,7 @@ pub fn check_type_def_gen( } } - let mut i = syn::parse2::(gen.params.to_token_stream()) + let mut i = syn::parse2::(r#gen.params.to_token_stream()) .map_err(|e| { let msg = format!("Invalid type def generics: {}", expected); let mut err = syn::Error::new(span, msg); @@ -574,7 +577,7 @@ pub fn check_genesis_builder_usage(type_: &syn::Path) -> syn::Result syn::Result> { let expected = "expected `` or `T: Config` or `T: Config, I: 'static`"; @@ -611,7 +614,7 @@ pub fn check_type_value_gen( } } - let i = syn::parse2::(gen.params.to_token_stream()) + let i = syn::parse2::(r#gen.params.to_token_stream()) .map_err(|e| { let msg = format!("Invalid type def generics: {}", expected); let mut err = syn::Error::new(span, msg); diff --git a/support/procedural-fork/src/pallet/parse/mod.rs b/support/procedural-fork/src/pallet/parse/mod.rs index 69f9217333..05eacd1449 100644 --- a/support/procedural-fork/src/pallet/parse/mod.rs +++ b/support/procedural-fork/src/pallet/parse/mod.rs @@ -40,7 +40,7 @@ pub mod validate_unsigned; #[cfg(test)] pub mod tests; -use composite::{keyword::CompositeKeyword, CompositeDef}; +use composite::{CompositeDef, keyword::CompositeKeyword}; use frame_support_procedural_tools::generate_access_from_frame_or_crate; use quote::ToTokens; use syn::spanned::Spanned; @@ -109,108 +109,122 @@ impl Def { let pallet_attr: Option = helper::take_first_item_pallet_attr(item)?; match pallet_attr { - Some(PalletAttr::Config(_, with_default)) if config.is_none() => - config = Some(config::ConfigDef::try_from( - &frame_system, - index, - item, - with_default, - )?), - Some(PalletAttr::Pallet(span)) if pallet_struct.is_none() => { - let p = pallet_struct::PalletStructDef::try_from(span, index, item)?; - pallet_struct = Some(p); - }, - Some(PalletAttr::Hooks(span)) if hooks.is_none() => { - let m = hooks::HooksDef::try_from(span, item)?; - hooks = Some(m); - }, - Some(PalletAttr::RuntimeCall(cw, span)) if call.is_none() => - call = Some(call::CallDef::try_from(span, index, item, dev_mode, cw)?), - Some(PalletAttr::Tasks(_)) if tasks.is_none() => { - let item_tokens = item.to_token_stream(); - // `TasksDef::parse` needs to know if attr was provided so we artificially - // re-insert it here - tasks = Some(syn::parse2::(quote::quote! { - #[pallet::tasks_experimental] - #item_tokens - })?); - - // replace item with a no-op because it will be handled by the expansion of tasks - *item = syn::Item::Verbatim(quote::quote!()); - } - Some(PalletAttr::TaskCondition(span)) => return Err(syn::Error::new( - span, - "`#[pallet::task_condition]` can only be used on items within an `impl` statement." - )), - Some(PalletAttr::TaskIndex(span)) => return Err(syn::Error::new( - span, - "`#[pallet::task_index]` can only be used on items within an `impl` statement." - )), - Some(PalletAttr::TaskList(span)) => return Err(syn::Error::new( - span, - "`#[pallet::task_list]` can only be used on items within an `impl` statement." - )), - Some(PalletAttr::RuntimeTask(_)) if task_enum.is_none() => - task_enum = Some(syn::parse2::(item.to_token_stream())?), - Some(PalletAttr::Error(span)) if error.is_none() => - error = Some(error::ErrorDef::try_from(span, index, item)?), - Some(PalletAttr::RuntimeEvent(span)) if event.is_none() => - event = Some(event::EventDef::try_from(span, index, item)?), - Some(PalletAttr::GenesisConfig(_)) if genesis_config.is_none() => { - let g = genesis_config::GenesisConfigDef::try_from(index, item)?; - genesis_config = Some(g); - }, - Some(PalletAttr::GenesisBuild(span)) if genesis_build.is_none() => { - let g = genesis_build::GenesisBuildDef::try_from(span, item)?; - genesis_build = Some(g); - }, - Some(PalletAttr::RuntimeOrigin(_)) if origin.is_none() => - origin = Some(origin::OriginDef::try_from(item)?), - Some(PalletAttr::Inherent(_)) if inherent.is_none() => - inherent = Some(inherent::InherentDef::try_from(item)?), - Some(PalletAttr::Storage(span)) => - storages.push(storage::StorageDef::try_from(span, index, item, dev_mode)?), - Some(PalletAttr::ValidateUnsigned(_)) if validate_unsigned.is_none() => { - let v = validate_unsigned::ValidateUnsignedDef::try_from(item)?; - validate_unsigned = Some(v); - }, - Some(PalletAttr::TypeValue(span)) => - type_values.push(type_value::TypeValueDef::try_from(span, index, item)?), - Some(PalletAttr::ExtraConstants(_)) => - extra_constants = - Some(extra_constants::ExtraConstantsDef::try_from(item)?), - Some(PalletAttr::Composite(span)) => { - let composite = - composite::CompositeDef::try_from(span, &frame_support, item)?; - if composites.iter().any(|def| { - match (&def.composite_keyword, &composite.composite_keyword) { - ( - CompositeKeyword::FreezeReason(_), - CompositeKeyword::FreezeReason(_), - ) | - (CompositeKeyword::HoldReason(_), CompositeKeyword::HoldReason(_)) | - (CompositeKeyword::LockId(_), CompositeKeyword::LockId(_)) | - ( - CompositeKeyword::SlashReason(_), - CompositeKeyword::SlashReason(_), - ) => true, - _ => false, - } - }) { - let msg = format!( - "Invalid duplicated `{}` definition", - composite.composite_keyword - ); - return Err(syn::Error::new(composite.composite_keyword.span(), &msg)) - } - composites.push(composite); - }, - Some(attr) => { - let msg = "Invalid duplicated attribute"; - return Err(syn::Error::new(attr.span(), msg)) - }, - None => (), - } + Some(PalletAttr::Config(_, with_default)) if config.is_none() => { + config = Some(config::ConfigDef::try_from( + &frame_system, + index, + item, + with_default, + )?) + } + Some(PalletAttr::Pallet(span)) if pallet_struct.is_none() => { + let p = pallet_struct::PalletStructDef::try_from(span, index, item)?; + pallet_struct = Some(p); + } + Some(PalletAttr::Hooks(span)) if hooks.is_none() => { + let m = hooks::HooksDef::try_from(span, item)?; + hooks = Some(m); + } + Some(PalletAttr::RuntimeCall(cw, span)) if call.is_none() => { + call = Some(call::CallDef::try_from(span, index, item, dev_mode, cw)?) + } + Some(PalletAttr::Tasks(_)) if tasks.is_none() => { + let item_tokens = item.to_token_stream(); + // `TasksDef::parse` needs to know if attr was provided so we artificially + // re-insert it here + tasks = Some(syn::parse2::(quote::quote! { + #[pallet::tasks_experimental] + #item_tokens + })?); + + // replace item with a no-op because it will be handled by the expansion of tasks + *item = syn::Item::Verbatim(quote::quote!()); + } + Some(PalletAttr::TaskCondition(span)) => { + return Err(syn::Error::new( + span, + "`#[pallet::task_condition]` can only be used on items within an `impl` statement.", + )); + } + Some(PalletAttr::TaskIndex(span)) => { + return Err(syn::Error::new( + span, + "`#[pallet::task_index]` can only be used on items within an `impl` statement.", + )); + } + Some(PalletAttr::TaskList(span)) => { + return Err(syn::Error::new( + span, + "`#[pallet::task_list]` can only be used on items within an `impl` statement.", + )); + } + Some(PalletAttr::RuntimeTask(_)) if task_enum.is_none() => { + task_enum = Some(syn::parse2::(item.to_token_stream())?) + } + Some(PalletAttr::Error(span)) if error.is_none() => { + error = Some(error::ErrorDef::try_from(span, index, item)?) + } + Some(PalletAttr::RuntimeEvent(span)) if event.is_none() => { + event = Some(event::EventDef::try_from(span, index, item)?) + } + Some(PalletAttr::GenesisConfig(_)) if genesis_config.is_none() => { + let g = genesis_config::GenesisConfigDef::try_from(index, item)?; + genesis_config = Some(g); + } + Some(PalletAttr::GenesisBuild(span)) if genesis_build.is_none() => { + let g = genesis_build::GenesisBuildDef::try_from(span, item)?; + genesis_build = Some(g); + } + Some(PalletAttr::RuntimeOrigin(_)) if origin.is_none() => { + origin = Some(origin::OriginDef::try_from(item)?) + } + Some(PalletAttr::Inherent(_)) if inherent.is_none() => { + inherent = Some(inherent::InherentDef::try_from(item)?) + } + Some(PalletAttr::Storage(span)) => { + storages.push(storage::StorageDef::try_from(span, index, item, dev_mode)?) + } + Some(PalletAttr::ValidateUnsigned(_)) if validate_unsigned.is_none() => { + let v = validate_unsigned::ValidateUnsignedDef::try_from(item)?; + validate_unsigned = Some(v); + } + Some(PalletAttr::TypeValue(span)) => { + type_values.push(type_value::TypeValueDef::try_from(span, index, item)?) + } + Some(PalletAttr::ExtraConstants(_)) => { + extra_constants = Some(extra_constants::ExtraConstantsDef::try_from(item)?) + } + Some(PalletAttr::Composite(span)) => { + let composite = composite::CompositeDef::try_from(span, &frame_support, item)?; + if composites.iter().any(|def| { + match (&def.composite_keyword, &composite.composite_keyword) { + ( + CompositeKeyword::FreezeReason(_), + CompositeKeyword::FreezeReason(_), + ) + | (CompositeKeyword::HoldReason(_), CompositeKeyword::HoldReason(_)) + | (CompositeKeyword::LockId(_), CompositeKeyword::LockId(_)) + | ( + CompositeKeyword::SlashReason(_), + CompositeKeyword::SlashReason(_), + ) => true, + _ => false, + } + }) { + let msg = format!( + "Invalid duplicated `{}` definition", + composite.composite_keyword + ); + return Err(syn::Error::new(composite.composite_keyword.span(), &msg)); + } + composites.push(composite); + } + Some(attr) => { + let msg = "Invalid duplicated attribute"; + return Err(syn::Error::new(attr.span(), msg)); + } + None => (), + } } if genesis_config.is_some() != genesis_build.is_some() { @@ -277,15 +291,15 @@ impl Def { return Err(syn::Error::new( *item_span, "Missing `#[pallet::tasks_experimental]` impl", - )) + )); } (None, Some(tasks)) => { if tasks.tasks_attr.is_none() { return Err(syn::Error::new( - tasks.item_impl.impl_token.span(), - "A `#[pallet::tasks_experimental]` attribute must be attached to your `Task` impl if the \ + tasks.item_impl.impl_token.span(), + "A `#[pallet::tasks_experimental]` attribute must be attached to your `Task` impl if the \ task enum has been omitted", - )); + )); } else { } } diff --git a/support/procedural-fork/src/pallet/parse/storage.rs b/support/procedural-fork/src/pallet/parse/storage.rs index 64a5e685bd..00f0f6e141 100644 --- a/support/procedural-fork/src/pallet/parse/storage.rs +++ b/support/procedural-fork/src/pallet/parse/storage.rs @@ -139,7 +139,7 @@ impl PalletStorageAttrInfo { return Err(syn::Error::new( attr.attr_span(), "Invalid attribute: Duplicate attribute", - )) + )); } } } @@ -741,13 +741,13 @@ fn process_generics( if args .args .iter() - .all(|gen| matches!(gen, syn::GenericArgument::Type(_))) + .all(|r#gen| matches!(r#gen, syn::GenericArgument::Type(_))) { let args = args .args .iter() - .map(|gen| match gen { - syn::GenericArgument::Type(gen) => gen.clone(), + .map(|r#gen| match r#gen { + syn::GenericArgument::Type(r#gen) => r#gen.clone(), _ => unreachable!("It is asserted above that all generics are types"), }) .collect::>(); @@ -755,13 +755,13 @@ fn process_generics( } else if args .args .iter() - .all(|gen| matches!(gen, syn::GenericArgument::AssocType(_))) + .all(|r#gen| matches!(r#gen, syn::GenericArgument::AssocType(_))) { let args = args .args .iter() - .map(|gen| match gen { - syn::GenericArgument::AssocType(gen) => gen.clone(), + .map(|r#gen| match r#gen { + syn::GenericArgument::AssocType(r#gen) => r#gen.clone(), _ => unreachable!("It is asserted above that all generics are bindings"), }) .collect::>(); @@ -915,7 +915,7 @@ impl StorageDef { .last() .map_or(false, |s| s.ident == "OptionQuery") => { - return Ok(Some(QueryKind::OptionQuery)) + return Ok(Some(QueryKind::OptionQuery)); } Type::Path(TypePath { path: Path { segments, .. }, @@ -931,7 +931,7 @@ impl StorageDef { .last() .map_or(false, |s| s.ident == "ValueQuery") => { - return Ok(Some(QueryKind::ValueQuery)) + return Ok(Some(QueryKind::ValueQuery)); } _ => return Ok(None), }; @@ -1003,10 +1003,10 @@ impl StorageDef { } gen_arg => { let msg = format!( - "Invalid pallet::storage, unexpected generic argument kind, expected a \ + "Invalid pallet::storage, unexpected generic argument kind, expected a \ type path to a `PalletError` enum variant, found `{}`", - gen_arg.to_token_stream().to_string(), - ); + gen_arg.to_token_stream().to_string(), + ); Err(syn::Error::new(gen_arg.span(), msg)) } } diff --git a/support/procedural-fork/src/pallet/parse/tasks.rs b/support/procedural-fork/src/pallet/parse/tasks.rs index 2a8d148267..8da1fa8823 100644 --- a/support/procedural-fork/src/pallet/parse/tasks.rs +++ b/support/procedural-fork/src/pallet/parse/tasks.rs @@ -28,14 +28,14 @@ use crate::pallet::parse::tests::simulate_manifest_dir; use derive_syn_parse::Parse; use frame_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro2::TokenStream as TokenStream2; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{ + Error, Expr, Ident, ImplItem, ImplItemFn, ItemEnum, ItemImpl, LitInt, Path, PathArguments, + Result, TypePath, parse::ParseStream, parse2, spanned::Spanned, token::{Bracket, Paren, PathSep, Pound}, - Error, Expr, Ident, ImplItem, ImplItemFn, ItemEnum, ItemImpl, LitInt, Path, PathArguments, - Result, TypePath, }; pub mod keywords { @@ -299,7 +299,7 @@ impl syn::parse::Parse for TaskDef { return Err(Error::new( input.span(), "unexpected function argument type", - )) + )); } } } @@ -460,7 +460,7 @@ impl TryFrom> for TaskIndexAttr { "`{:?}` cannot be converted to a `TaskIndexAttr`", value.meta ), - )) + )); } } } @@ -482,7 +482,7 @@ impl TryFrom> for TaskConditionAttr { "`{:?}` cannot be converted to a `TaskConditionAttr`", value.meta ), - )) + )); } } } @@ -504,7 +504,7 @@ impl TryFrom> for TaskWeightAttr { "`{:?}` cannot be converted to a `TaskWeightAttr`", value.meta ), - )) + )); } } } @@ -523,7 +523,7 @@ impl TryFrom> for TaskListAttr { return Err(Error::new( value.span(), format!("`{:?}` cannot be converted to a `TaskListAttr`", value.meta), - )) + )); } } } diff --git a/support/procedural-fork/src/runtime/expand/mod.rs b/support/procedural-fork/src/runtime/expand/mod.rs index a1a6d4d071..b51012541b 100644 --- a/support/procedural-fork/src/runtime/expand/mod.rs +++ b/support/procedural-fork/src/runtime/expand/mod.rs @@ -22,10 +22,10 @@ use crate::{ decl_static_assertions, expand, }, runtime::{ + Def, parse::{ AllPalletsDeclaration, ExplicitAllPalletsDeclaration, ImplicitAllPalletsDeclaration, }, - Def, }, }; use cfg_expr::Predicate; diff --git a/support/procedural-fork/src/runtime/parse/mod.rs b/support/procedural-fork/src/runtime/parse/mod.rs index 494ab2c53e..67fc03c59f 100644 --- a/support/procedural-fork/src/runtime/parse/mod.rs +++ b/support/procedural-fork/src/runtime/parse/mod.rs @@ -26,7 +26,7 @@ use pallet_decl::PalletDeclaration; use proc_macro2::TokenStream as TokenStream2; use quote::ToTokens; use std::collections::HashMap; -use syn::{spanned::Spanned, Ident, Token}; +use syn::{Ident, Token, spanned::Spanned}; use frame_support_procedural_tools::syn_ext as ext; use runtime_types::RuntimeType; @@ -223,9 +223,9 @@ impl Def { if let Some(used_pallet) = indices.insert(pallet.index, pallet.name.clone()) { let msg = format!( - "Pallet indices are conflicting: Both pallets {} and {} are at index {}", - used_pallet, pallet.name, pallet.index, - ); + "Pallet indices are conflicting: Both pallets {} and {} are at index {}", + used_pallet, pallet.name, pallet.index, + ); let mut err = syn::Error::new(used_pallet.span(), &msg); err.combine(syn::Error::new(pallet.name.span(), msg)); return Err(err); diff --git a/support/procedural-fork/src/runtime/parse/pallet.rs b/support/procedural-fork/src/runtime/parse/pallet.rs index 591c059307..460818e4d5 100644 --- a/support/procedural-fork/src/runtime/parse/pallet.rs +++ b/support/procedural-fork/src/runtime/parse/pallet.rs @@ -21,7 +21,7 @@ use crate::{ }; use frame_support_procedural_tools::get_doc_literals; use quote::ToTokens; -use syn::{punctuated::Punctuated, token, Error}; +use syn::{Error, punctuated::Punctuated, token}; impl Pallet { pub fn try_from( @@ -102,7 +102,7 @@ impl Pallet { #[test] fn pallet_parsing_works() { - use syn::{parse_quote, ItemType}; + use syn::{ItemType, parse_quote}; let item: ItemType = parse_quote! { pub type System = frame_system + Call; @@ -131,7 +131,7 @@ fn pallet_parsing_works() { #[test] fn pallet_parsing_works_with_instance() { - use syn::{parse_quote, ItemType}; + use syn::{ItemType, parse_quote}; let item: ItemType = parse_quote! { pub type System = frame_system + Call; @@ -160,7 +160,7 @@ fn pallet_parsing_works_with_instance() { #[test] fn pallet_parsing_works_with_pallet() { - use syn::{parse_quote, ItemType}; + use syn::{ItemType, parse_quote}; let item: ItemType = parse_quote! { pub type System = frame_system::Pallet + Call; @@ -189,7 +189,7 @@ fn pallet_parsing_works_with_pallet() { #[test] fn pallet_parsing_works_with_instance_and_pallet() { - use syn::{parse_quote, ItemType}; + use syn::{ItemType, parse_quote}; let item: ItemType = parse_quote! { pub type System = frame_system::Pallet + Call; diff --git a/support/procedural-fork/src/runtime/parse/runtime_types.rs b/support/procedural-fork/src/runtime/parse/runtime_types.rs index 4d8c8358c6..56c765d04e 100644 --- a/support/procedural-fork/src/runtime/parse/runtime_types.rs +++ b/support/procedural-fork/src/runtime/parse/runtime_types.rs @@ -16,8 +16,8 @@ // limitations under the License. use syn::{ - parse::{Parse, ParseStream}, Result, + parse::{Parse, ParseStream}, }; mod keyword { diff --git a/support/procedural-fork/src/storage_alias.rs b/support/procedural-fork/src/storage_alias.rs index 7099239f9d..018105053e 100644 --- a/support/procedural-fork/src/storage_alias.rs +++ b/support/procedural-fork/src/storage_alias.rs @@ -20,15 +20,15 @@ use crate::{counter_prefix, pallet::parse::helper}; use frame_support_procedural_tools::generate_access_from_frame_or_crate; use proc_macro2::{Span, TokenStream}; -use quote::{quote, ToTokens}; +use quote::{ToTokens, quote}; use syn::{ + Attribute, Error, Ident, Result, Token, Type, TypeParam, Visibility, WhereClause, parenthesized, parse::{Parse, ParseStream}, punctuated::Punctuated, spanned::Spanned, token, visit::Visit, - Attribute, Error, Ident, Result, Token, Type, TypeParam, Visibility, WhereClause, }; /// Extension trait for [`Type`]. @@ -607,7 +607,7 @@ fn generate_storage_instance( return Err(Error::new_spanned( prefix, "Prefix type `verbatim` requires that the prefix is an ident.", - )) + )); } }; diff --git a/support/tools/Cargo.toml b/support/tools/Cargo.toml index ab8506ffa0..065b3532d1 100644 --- a/support/tools/Cargo.toml +++ b/support/tools/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subtensor-tools" version = "0.1.0" -edition = "2024" +edition.workspace = true license = "MIT" description = "support tools for Subtensor" @@ -12,8 +12,13 @@ homepage = "https://bittensor.com" name = "bump-version" path = "src/bump_version.rs" +[[bin]] +name = "spec-version" +path = "src/spec_version.rs" + [dependencies] -anyhow = { workspace = true } -clap = { version = "4.5", features = ["derive"] } -semver = "1.0" -toml_edit = "0.22" +anyhow.workspace = true +clap = { workspace = true, features = ["derive"] } +semver.workspace = true +toml_edit.workspace = true +node-subtensor-runtime = { workspace = true, default-features = true } diff --git a/runtime/src/spec_version.rs b/support/tools/src/spec_version.rs similarity index 100% rename from runtime/src/spec_version.rs rename to support/tools/src/spec_version.rs From f88f162b31f5f9d7a8919bf7f9e112604834346a Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 5 Aug 2025 16:38:51 +1200 Subject: [PATCH 17/24] cleanup --- node/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/node/Cargo.toml b/node/Cargo.toml index c87a83fead..98e8c225ad 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -31,7 +31,6 @@ hex.workspace = true memmap2.workspace = true serde_json.workspace = true - sc-chain-spec-derive.workspace = true sc-cli.workspace = true sc-consensus-babe.workspace = true From 7a006044ac06627b2fc775c022d5122fdad20d8e Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 6 Aug 2025 11:59:26 +1200 Subject: [PATCH 18/24] run zepter --- node/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/Cargo.toml b/node/Cargo.toml index 98e8c225ad..24bc79d0b9 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -133,7 +133,10 @@ rocksdb = [ "sc-cli/rocksdb", ] default = ["rocksdb", "sql", "txpool"] -fast-blocks = ["node-subtensor-runtime/fast-blocks"] +fast-blocks = [ + "node-subtensor-runtime/fast-blocks", + "subtensor-runtime-common/fast-blocks" +] sql = ["fc-db/sql", "fc-mapping-sync/sql"] txpool = ["fc-rpc/txpool", "fc-rpc-core/txpool"] From 43dea1379200e4b674f619648f8345401d5ebd9d Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 6 Aug 2025 12:00:03 +1200 Subject: [PATCH 19/24] cargo +nightly fmt --- node/src/service.rs | 16 ++++++++++++++-- pallets/collective/src/lib.rs | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/node/src/service.rs b/node/src/service.rs index 5cc09754c3..9bf3056b54 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -626,10 +626,22 @@ pub async fn build_full( ) -> Result { match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => { - new_full::, CM>(config, eth_config, sealing, custom_service_signal).await + new_full::, CM>( + config, + eth_config, + sealing, + custom_service_signal, + ) + .await } sc_network::config::NetworkBackendType::Litep2p => { - new_full::(config, eth_config, sealing, custom_service_signal).await + new_full::( + config, + eth_config, + sealing, + custom_service_signal, + ) + .await } } } diff --git a/pallets/collective/src/lib.rs b/pallets/collective/src/lib.rs index fe0925b8ff..f4f531e206 100644 --- a/pallets/collective/src/lib.rs +++ b/pallets/collective/src/lib.rs @@ -42,6 +42,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "128"] +use codec::DecodeWithMemTracking; use frame_support::{ dispatch::{DispatchResultWithPostInfo, GetDispatchInfo, Pays, PostDispatchInfo}, ensure, @@ -51,7 +52,6 @@ use frame_support::{ }, weights::Weight, }; -use codec::DecodeWithMemTracking; use scale_info::TypeInfo; use sp_io::storage; use sp_runtime::traits::Dispatchable; From 171b9837ebcfd9136160e6a56e0502ff503867b2 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 7 Aug 2025 16:53:21 +1200 Subject: [PATCH 20/24] use prod_or_fast! --- .../check-bittensor-e2e-tests.yml.yml | 2 +- Cargo.lock | 333 ++++++++++++++++++ Cargo.toml | 2 + Dockerfile-localnet | 16 +- common/Cargo.toml | 4 +- common/src/lib.rs | 8 +- evm-tests/src/config.ts | 4 +- node/Cargo.toml | 6 +- pallets/subtensor/Cargo.toml | 8 +- pallets/subtensor/src/lib.rs | 14 +- pallets/subtensor/src/tests/children.rs | 6 +- runtime/Cargo.toml | 12 +- runtime/src/lib.rs | 35 +- scripts/localnet.sh | 6 +- scripts/localnet_patch.sh | 16 +- zepter.yaml | 2 +- 16 files changed, 396 insertions(+), 78 deletions(-) diff --git a/.github/workflows/check-bittensor-e2e-tests.yml.yml b/.github/workflows/check-bittensor-e2e-tests.yml.yml index fcaaf9ff0f..aaec7df656 100644 --- a/.github/workflows/check-bittensor-e2e-tests.yml.yml +++ b/.github/workflows/check-bittensor-e2e-tests.yml.yml @@ -109,7 +109,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - - name: Patch non-fast-block node + - name: Patch non-fast-runtime node run: | chmod +x ./scripts/localnet_patch.sh ./scripts/localnet_patch.sh diff --git a/Cargo.lock b/Cargo.lock index f15da9dce1..0564ad0a68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2923,6 +2923,17 @@ dependencies = [ "syn 2.0.104", ] +[[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.104", +] + [[package]] name = "env_logger" version = "0.10.2" @@ -6942,6 +6953,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-utility 38.0.0", "parity-scale-codec", + "polkadot-runtime-common", "precompile-utils", "rand_chacha 0.3.1", "scale-info", @@ -7346,6 +7358,38 @@ dependencies = [ "subtensor-swap-interface", ] +[[package]] +name = "pallet-asset-conversion" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +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 = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-aura" version = "39.0.0" @@ -7464,6 +7508,24 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-broker" +version = "0.19.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +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" @@ -7759,6 +7821,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-identity" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-insecure-randomness-collective-flip" version = "28.0.0" @@ -7786,6 +7864,37 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-message-queue" +version = "43.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +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 = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", + "sp-mmr-primitives", +] + [[package]] name = "pallet-multisig" version = "40.1.0" @@ -8051,6 +8160,7 @@ dependencies = [ "pallet-utility 38.0.0", "parity-scale-codec", "parity-util-mem", + "polkadot-runtime-common", "rand 0.8.5", "rand_chacha 0.3.1", "safe-math", @@ -8203,6 +8313,25 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "pallet-treasury" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-utility" version = "38.0.0" @@ -8237,6 +8366,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-vesting" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "parity-bip39" version = "2.0.1" @@ -8568,6 +8711,16 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221c71b432b38e494a0fdedb5f720e4cb974edf03a0af09e5b2238dbac7e6947" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + [[package]] name = "polkadot-core-primitives" version = "17.1.0" @@ -8737,6 +8890,113 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "polkadot-runtime-common" +version = "19.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate", + "pallet-authorship", + "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", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keyring", + "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 = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "bs58", + "frame-benchmarking", + "parity-scale-codec", + "polkadot-primitives", + "sp-tracing 17.1.0", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "19.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "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", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand 0.8.5", + "rand_chacha 0.3.1", + "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-stable2503-6)", + "staging-xcm", + "staging-xcm-executor", +] + [[package]] name = "polkadot-sdk" version = "0.7.0" @@ -11983,6 +12243,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" +[[package]] +name = "slot-range-helper" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", +] + [[package]] name = "smallvec" version = "1.15.1" @@ -12618,6 +12889,23 @@ dependencies = [ "sp-application-crypto", ] +[[package]] +name = "sp-mmr-primitives" +version = "36.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +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-stable2503-6)", + "sp-runtime", + "thiserror 1.0.69", +] + [[package]] name = "sp-npos-elections" version = "36.2.0" @@ -13184,6 +13472,50 @@ dependencies = [ "xcm-procedural", ] +[[package]] +name = "staging-xcm-builder" +version = "20.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +dependencies = [ + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", + "tracing", +] + +[[package]] +name = "staging-xcm-executor" +version = "19.1.2" +source = "git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6#598feddb893f5ad3923a62e41a2f179b6e10c30c" +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" @@ -13490,6 +13822,7 @@ dependencies = [ "approx", "frame-support", "parity-scale-codec", + "polkadot-runtime-common", "scale-info", "serde", "sp-core", diff --git a/Cargo.toml b/Cargo.toml index 4da960ad30..461c810fe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -221,6 +221,8 @@ substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot- cumulus-primitives-proof-size-hostfunction = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } +runtime-common = { package = "polkadot-runtime-common", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2503-6", default-features = false } + # Frontier fp-evm = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } fp-rpc = { git = "https://github.com/opentensor/frontier", rev = "830e61f370d88f7ace1c5a5659dd58db75a19844", default-features = false } diff --git a/Dockerfile-localnet b/Dockerfile-localnet index d95a2f1a2c..82cf5759aa 100644 --- a/Dockerfile-localnet +++ b/Dockerfile-localnet @@ -29,23 +29,23 @@ ENV PATH="/root/.cargo/bin:${PATH}" RUN rustup toolchain install RUN rustup target add wasm32-unknown-unknown -## Build fast-blocks node +## Build fast-runtime node RUN ./scripts/localnet.sh --build-only -# Build non-fast-blocks +# Build non-fast-runtime RUN ./scripts/localnet.sh False --build-only # Verify the binaries was produced -RUN test -e /build/target/fast-blocks/release/node-subtensor -RUN test -e /build/target/non-fast-blocks/release/node-subtensor +RUN test -e /build/target/fast-runtime/release/node-subtensor +RUN test -e /build/target/non-fast-runtime/release/node-subtensor FROM $BASE_IMAGE AS subtensor-localnet # Copy binaries -COPY --from=builder /build/target/fast-blocks/release/node-subtensor target/fast-blocks/release/node-subtensor -RUN chmod +x target/fast-blocks/release/node-subtensor +COPY --from=builder /build/target/fast-runtime/release/node-subtensor target/fast-runtime/release/node-subtensor +RUN chmod +x target/fast-runtime/release/node-subtensor -COPY --from=builder /build/target/non-fast-blocks/release/node-subtensor target/non-fast-blocks/release/node-subtensor -RUN chmod +x target/non-fast-blocks/release/node-subtensor +COPY --from=builder /build/target/non-fast-runtime/release/node-subtensor target/non-fast-runtime/release/node-subtensor +RUN chmod +x target/non-fast-runtime/release/node-subtensor COPY --from=builder /build/snapshot.json /snapshot.json diff --git a/common/Cargo.toml b/common/Cargo.toml index b1b0f1bbf2..b4be88f01b 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -20,6 +20,7 @@ sp-runtime.workspace = true substrate-fixed.workspace = true subtensor-macros.workspace = true approx = { workspace = true, optional = true } +runtime-common = { workspace = true } [lints] workspace = true @@ -27,7 +28,7 @@ workspace = true [features] default = ["std"] approx = ["dep:approx"] -fast-blocks = [] +fast-runtime = [] std = [ "codec/std", "frame-support/std", @@ -36,4 +37,5 @@ std = [ "sp-core/std", "sp-runtime/std", "substrate-fixed/std", + "runtime-common/std" ] diff --git a/common/src/lib.rs b/common/src/lib.rs index 8a0093f01e..f8199b8a6e 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -5,6 +5,7 @@ use codec::{ Compact, CompactAs, Decode, DecodeWithMemTracking, Encode, Error as CodecError, MaxEncodedLen, }; use frame_support::pallet_prelude::*; +use runtime_common::prod_or_fast; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_runtime::{ @@ -207,12 +208,7 @@ pub mod time { /// 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!(12000, 250); // NOTE: Currently it is not possible to change the slot duration after the chain has started. // Attempting to do so will brick block production. diff --git a/evm-tests/src/config.ts b/evm-tests/src/config.ts index 1d12e3d584..4cc3b27608 100644 --- a/evm-tests/src/config.ts +++ b/evm-tests/src/config.ts @@ -1,7 +1,7 @@ export const ETH_LOCAL_URL = 'http://localhost:9944' export const SUB_LOCAL_URL = 'ws://localhost:9944' export const SS58_PREFIX = 42; -// set the tx timeout as 2 second when eable the fast-blocks feature. +// set the tx timeout as 2 second when eable the fast-runtime feature. export const TX_TIMEOUT = 3000; export const IED25519VERIFY_ADDRESS = "0x0000000000000000000000000000000000000402"; @@ -55,4 +55,4 @@ export const IBalanceTransferABI = [ export const IDISPATCH_ADDRESS = "0x0000000000000000000000000000000000000006"; -export const ISTORAGE_QUERY_ADDRESS = "0x0000000000000000000000000000000000000807"; \ No newline at end of file +export const ISTORAGE_QUERY_ADDRESS = "0x0000000000000000000000000000000000000807"; diff --git a/node/Cargo.toml b/node/Cargo.toml index 24bc79d0b9..09458410ff 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -133,9 +133,9 @@ rocksdb = [ "sc-cli/rocksdb", ] default = ["rocksdb", "sql", "txpool"] -fast-blocks = [ - "node-subtensor-runtime/fast-blocks", - "subtensor-runtime-common/fast-blocks" +fast-runtime = [ + "node-subtensor-runtime/fast-runtime", + "subtensor-runtime-common/fast-runtime", ] sql = ["fc-db/sql", "fc-mapping-sync/sql"] txpool = ["fc-rpc/txpool", "fc-rpc-core/txpool"] diff --git a/pallets/subtensor/Cargo.toml b/pallets/subtensor/Cargo.toml index d4055346cd..44d873c8a6 100644 --- a/pallets/subtensor/Cargo.toml +++ b/pallets/subtensor/Cargo.toml @@ -43,6 +43,7 @@ share-pool.workspace = true safe-math.workspace = true approx.workspace = true subtensor-swap-interface.workspace = true +runtime-common.workspace = true subtensor-runtime-common = { workspace = true, features = ["approx"] } pallet-drand.workspace = true @@ -122,6 +123,7 @@ std = [ "subtensor-runtime-common/std", "pallet-proxy/std", "pallet-crowdloan/std", + "runtime-common/std" ] default = ["std"] runtime-benchmarks = [ @@ -140,6 +142,7 @@ runtime-benchmarks = [ "pallet-crowdloan/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "runtime-common/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime", @@ -155,8 +158,7 @@ try-runtime = [ "pallet-drand/try-runtime", "pallet-proxy/try-runtime", "pallet-crowdloan/try-runtime", + "runtime-common/try-runtime" ] pow-faucet = [] -fast-blocks = [ - "subtensor-runtime-common/fast-blocks" -] +fast-runtime = ["subtensor-runtime-common/fast-runtime"] diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index f8474bff0a..5145405a36 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -8,6 +8,9 @@ use frame_system::{self as system, ensure_signed}; pub use pallet::*; +use codec::{Decode, DecodeWithMemTracking, Encode}; +use frame_support::sp_runtime::transaction_validity::InvalidTransaction; +use frame_support::sp_runtime::transaction_validity::ValidTransaction; use frame_support::{ dispatch::{self, DispatchInfo, DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, ensure, @@ -15,10 +18,6 @@ use frame_support::{ pallet_prelude::*, traits::{IsSubType, tokens::fungible}, }; - -use codec::{Decode, DecodeWithMemTracking, Encode}; -use frame_support::sp_runtime::transaction_validity::InvalidTransaction; -use frame_support::sp_runtime::transaction_validity::ValidTransaction; use pallet_balances::Call as BalancesCall; // use pallet_scheduler as Scheduler; use scale_info::TypeInfo; @@ -85,6 +84,7 @@ pub mod pallet { }; use frame_system::pallet_prelude::*; use pallet_drand::types::RoundNumber; + use runtime_common::prod_or_fast; use sp_core::{ConstU32, H160, H256}; use sp_runtime::traits::{Dispatchable, TrailingZeroInput}; use sp_std::collections::vec_deque::VecDeque; @@ -800,11 +800,7 @@ pub mod pallet { #[pallet::type_value] /// Default value for applying pending items (e.g. childkeys). pub fn DefaultPendingCooldown() -> u64 { - if cfg!(feature = "fast-blocks") { - return 15; - } - - 7_200 + prod_or_fast!(7_200, 15) } #[pallet::type_value] diff --git a/pallets/subtensor/src/tests/children.rs b/pallets/subtensor/src/tests/children.rs index 50a6e506a6..2b24438a52 100644 --- a/pallets/subtensor/src/tests/children.rs +++ b/pallets/subtensor/src/tests/children.rs @@ -4018,11 +4018,7 @@ fn test_dividend_distribution_with_children_same_coldkey_owner() { fn test_pending_cooldown_as_expected() { let curr_block = 1; // TODO: Fix when CHK splitting patched - // let expected_cooldown = if cfg!(feature = "fast-blocks") { - // 15 - // } else { - // 7200 - // }; + // let expected_cooldown = prod_or_fast!(7200, 15); new_test_ext(curr_block).execute_with(|| { let coldkey = U256::from(1); diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d65a798d5b..e63f08f242 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -94,6 +94,9 @@ pallet-registry.workspace = true # Metadata commitment pallet pallet-commitments.workspace = true +# For prod_or_fast macro +runtime-common.workspace = true + # NPoS frame-election-provider-support = { workspace = true } pallet-authority-discovery = { workspace = true } @@ -156,9 +159,9 @@ substrate-wasm-builder = { workspace = true, optional = true } [features] default = ["std"] pow-faucet = ["pallet-subtensor/pow-faucet"] -fast-blocks = [ - "pallet-subtensor/fast-blocks", - "subtensor-runtime-common/fast-blocks", +fast-runtime = [ + "pallet-subtensor/fast-runtime", + "subtensor-runtime-common/fast-runtime", ] std = [ "frame-try-runtime?/std", @@ -262,6 +265,7 @@ std = [ "pallet-subtensor-swap/std", "pallet-subtensor-swap-runtime-api/std", "subtensor-swap-interface/std", + "runtime-common/std" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -303,6 +307,7 @@ runtime-benchmarks = [ "pallet-drand/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", "pallet-subtensor-swap/runtime-benchmarks", + "runtime-common/runtime-benchmarks" ] try-runtime = [ "frame-try-runtime/try-runtime", @@ -350,5 +355,6 @@ try-runtime = [ "pallet-evm-chain-id/try-runtime", "pallet-drand/try-runtime", "pallet-aura/try-runtime", + "runtime-common/try-runtime" ] metadata-hash = ["substrate-wasm-builder/metadata-hash"] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 6522c03795..1adba5d3a6 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -43,6 +43,7 @@ use pallet_subtensor::rpc_info::{ stake_info::StakeInfo, subnet_info::{SubnetHyperparams, SubnetHyperparamsV2, SubnetInfo, SubnetInfov2}, }; +use runtime_common::prod_or_fast; use smallvec::smallvec; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; @@ -1135,17 +1136,10 @@ impl pallet_commitments::GetTempoInterface for Runtime { } } -#[cfg(not(feature = "fast-blocks"))] -pub const INITIAL_SUBNET_TEMPO: u16 = 360; +pub const INITIAL_SUBNET_TEMPO: u16 = prod_or_fast!(360, 10); -#[cfg(feature = "fast-blocks")] -pub const INITIAL_SUBNET_TEMPO: u16 = 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; +// 30 days at 12 seconds per block = 216000 +pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = prod_or_fast!(216000, 5); // Configure the pallet subtensor. parameter_types! { @@ -1207,11 +1201,8 @@ parameter_types! { pub const InitialDissolveNetworkScheduleDuration: BlockNumber = 5 * 24 * 60 * 60 / 12; // 5 days pub const SubtensorInitialTaoWeight: u64 = 971_718_665_099_567_868; // 0.05267697438728329% tao weight. pub const InitialEmaPriceHalvingPeriod: u64 = 201_600_u64; // 4 weeks - pub const DurationOfStartCall: u64 = if cfg!(feature = "fast-blocks") { - 10 // Only 10 blocks for fast blocks - } else { - 7 * 24 * 60 * 60 / 12 // 7 days - }; + // 7 * 24 * 60 * 60 / 12 = 7 days + pub const DurationOfStartCall: u64 = prod_or_fast!(7 * 24 * 60 * 60 / 12, 10); pub const SubtensorInitialKeySwapOnSubnetCost: u64 = 1_000_000; // 0.001 TAO pub const HotkeySwapOnSubnetInterval : BlockNumber = 5 * 24 * 60 * 60 / 12; // 5 days pub const LeaseDividendsDistributionInterval: BlockNumber = 100; // 100 blocks @@ -1604,16 +1595,10 @@ parameter_types! { pub const CrowdloanPalletId: PalletId = PalletId(*b"bt/cloan"); pub const MinimumDeposit: Balance = 10_000_000_000; // 10 TAO pub const AbsoluteMinimumContribution: Balance = 100_000_000; // 0.1 TAO - pub const MinimumBlockDuration: BlockNumber = if cfg!(feature = "fast-blocks") { - 50 - } else { - 50400 // 7 days minimum (7 * 24 * 60 * 60 / 12) - }; - pub const MaximumBlockDuration: BlockNumber = if cfg!(feature = "fast-blocks") { - 20000 - } else { - 432000 // 60 days maximum (60 * 24 * 60 * 60 / 12) - }; + // 7 days minimum (7 * 24 * 60 * 60 / 12) + pub const MinimumBlockDuration: BlockNumber = prod_or_fast!(50400, 50); + // 60 days maximum (60 * 24 * 60 * 60 / 12) + pub const MaximumBlockDuration: BlockNumber = prod_or_fast!(432000, 20000); pub const RefundContributorsLimit: u32 = 50; pub const MaxContributors: u32 = 500; } diff --git a/scripts/localnet.sh b/scripts/localnet.sh index 4de17f1521..ade616b00e 100755 --- a/scripts/localnet.sh +++ b/scripts/localnet.sh @@ -30,14 +30,14 @@ if [ "$fast_blocks" == "False" ]; then : "${CHAIN:=local}" : "${BUILD_BINARY:=1}" : "${FEATURES:="pow-faucet"}" - BUILD_DIR="$BASE_DIR/target/non-fast-blocks" + BUILD_DIR="$BASE_DIR/target/non-fast-runtime" else # Block of code to execute if fast_blocks is not False echo "fast_blocks is On" : "${CHAIN:=local}" : "${BUILD_BINARY:=1}" - : "${FEATURES:="pow-faucet fast-blocks"}" - BUILD_DIR="$BASE_DIR/target/fast-blocks" + : "${FEATURES:="pow-faucet fast-runtime"}" + BUILD_DIR="$BASE_DIR/target/fast-runtime" fi # Ensure the build directory exists diff --git a/scripts/localnet_patch.sh b/scripts/localnet_patch.sh index ef9d1959bf..9db43ec1a7 100755 --- a/scripts/localnet_patch.sh +++ b/scripts/localnet_patch.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file patches the code in the repository to create a docker image with the ability to run tests in non-fast-blocks +# This file patches the code in the repository to create a docker image with the ability to run tests in non-fast-runtime # mode. set -e @@ -10,23 +10,23 @@ SetChildren="pallets/subtensor/src/utils/rate_limiting.rs" # Checkers if ! grep -q '7 \* 24 \* 60 \* 60 / 12 // 7 days' "$DurationOfStartCall"; then - echo "Error: Target string not found in $DurationOfStartCall" - exit 1 + echo "Error: Target string not found in $DurationOfStartCall" + exit 1 fi if ! grep -q 'pub fn DefaultPendingCooldown() -> u64 {' "$DefaultPendingCooldown"; then - echo "Error: Target function not found in $DefaultPendingCooldown" - exit 1 + echo "Error: Target function not found in $DefaultPendingCooldown" + exit 1 fi if ! grep -q 'TransactionType::SetChildren => 150, // 30 minutes' "$SetChildren"; then - echo "Error: Target string not found in $SetChildren" - exit 1 + echo "Error: Target string not found in $SetChildren" + exit 1 fi # replace perl -0777 -i -pe 's|7 \* 24 \* 60 \* 60 / 12 // 7 days|5 // Only 5 blocks for tests|' "$DurationOfStartCall" -perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*if cfg!\(feature = "fast-blocks"\) \{\s*return 15;\s*\}\s*7_200\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n 15\n }|g' "$DefaultPendingCooldown" +perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*if cfg!\(feature = "fast-runtime"\) \{\s*return 15;\s*\}\s*7_200\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n 15\n }|g' "$DefaultPendingCooldown" perl -0777 -i -pe 's|TransactionType::SetChildren => 150, // 30 minutes|TransactionType::SetChildren => 15, // 3 min|' "$SetChildren" echo "Patch applied successfully." diff --git a/zepter.yaml b/zepter.yaml index 681f802066..02a2cc9799 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,fast-blocks", + "--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. From 2df1bf1f9ff3c5dc42c380c7ec2e34576e2aa1c7 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 7 Aug 2025 17:14:02 +1200 Subject: [PATCH 21/24] cargo +nightly fmt --- pallets/subtensor/src/tests/children.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/subtensor/src/tests/children.rs b/pallets/subtensor/src/tests/children.rs index 2b24438a52..a4b9a70968 100644 --- a/pallets/subtensor/src/tests/children.rs +++ b/pallets/subtensor/src/tests/children.rs @@ -4018,7 +4018,7 @@ fn test_dividend_distribution_with_children_same_coldkey_owner() { fn test_pending_cooldown_as_expected() { let curr_block = 1; // TODO: Fix when CHK splitting patched - // let expected_cooldown = prod_or_fast!(7200, 15); + // let expected_cooldown = prod_or_fast!(7200, 15); new_test_ext(curr_block).execute_with(|| { let coldkey = U256::from(1); From b51e44589c6f4b73daf5f750f51c31ebe8f575cf Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 7 Aug 2025 17:14:44 +1200 Subject: [PATCH 22/24] update Cargo.lock --- Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 0564ad0a68..e523ea8b50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8905,6 +8905,7 @@ dependencies = [ "log", "pallet-asset-rate", "pallet-authorship", + "pallet-babe", "pallet-balances", "pallet-broker", "pallet-election-provider-multi-phase", @@ -8995,6 +8996,7 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-stable2503-6)", "staging-xcm", "staging-xcm-executor", + "static_assertions", ] [[package]] From f20670eb423f6a59391c884a6e5833c1cb4b74f7 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 6 Aug 2025 22:32:34 -0700 Subject: [PATCH 23/24] fix localnet_patch.sh --- scripts/localnet_patch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/localnet_patch.sh b/scripts/localnet_patch.sh index 9db43ec1a7..cc47d172b0 100755 --- a/scripts/localnet_patch.sh +++ b/scripts/localnet_patch.sh @@ -9,7 +9,7 @@ DefaultPendingCooldown="pallets/subtensor/src/lib.rs" SetChildren="pallets/subtensor/src/utils/rate_limiting.rs" # Checkers -if ! grep -q '7 \* 24 \* 60 \* 60 / 12 // 7 days' "$DurationOfStartCall"; then +if ! grep -q 'pub const DurationOfStartCall: u64' "$DurationOfStartCall"; then echo "Error: Target string not found in $DurationOfStartCall" exit 1 fi @@ -25,8 +25,8 @@ if ! grep -q 'TransactionType::SetChildren => 150, // 30 minutes' "$SetChildren" fi # replace -perl -0777 -i -pe 's|7 \* 24 \* 60 \* 60 / 12 // 7 days|5 // Only 5 blocks for tests|' "$DurationOfStartCall" -perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*if cfg!\(feature = "fast-runtime"\) \{\s*return 15;\s*\}\s*7_200\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n 15\n }|g' "$DefaultPendingCooldown" +perl -0777 -i -pe 's|pub const DurationOfStartCall: u64 = prod_or_fast!\(7 \* 24 \* 60 \* 60 / 12, 10\);|pub const DurationOfStartCall: u64 = prod_or_fast!(5, 10);|' "$DurationOfStartCall" +perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*prod_or_fast!\(7_200, 15\)\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n 15\n }|g' "$DefaultPendingCooldown" perl -0777 -i -pe 's|TransactionType::SetChildren => 150, // 30 minutes|TransactionType::SetChildren => 15, // 3 min|' "$SetChildren" echo "Patch applied successfully." From b348771c293d1fa1633e1a5b2b6e72587ca00c8e Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 6 Aug 2025 22:48:24 -0700 Subject: [PATCH 24/24] avoid warning during compilation --- scripts/localnet_patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/localnet_patch.sh b/scripts/localnet_patch.sh index cc47d172b0..f5a84e8348 100755 --- a/scripts/localnet_patch.sh +++ b/scripts/localnet_patch.sh @@ -26,7 +26,7 @@ fi # replace perl -0777 -i -pe 's|pub const DurationOfStartCall: u64 = prod_or_fast!\(7 \* 24 \* 60 \* 60 / 12, 10\);|pub const DurationOfStartCall: u64 = prod_or_fast!(5, 10);|' "$DurationOfStartCall" -perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*prod_or_fast!\(7_200, 15\)\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n 15\n }|g' "$DefaultPendingCooldown" +perl -0777 -i -pe 's|pub fn DefaultPendingCooldown\(\) -> u64 \{\s*prod_or_fast!\(7_200, 15\)\s*\}|pub fn DefaultPendingCooldown() -> u64 {\n prod_or_fast!(15, 15)\n }|g' "$DefaultPendingCooldown" perl -0777 -i -pe 's|TransactionType::SetChildren => 150, // 30 minutes|TransactionType::SetChildren => 15, // 3 min|' "$SetChildren" echo "Patch applied successfully."