diff --git a/pallets/subtensor/Cargo.toml b/pallets/subtensor/Cargo.toml index 3023d1e0dc..100ce0dde9 100644 --- a/pallets/subtensor/Cargo.toml +++ b/pallets/subtensor/Cargo.toml @@ -116,3 +116,4 @@ try-runtime = [ "pallet-collective/try-runtime" ] pow-faucet = [] +fast-blocks = [] diff --git a/pallets/subtensor/src/subnets/registration.rs b/pallets/subtensor/src/subnets/registration.rs index 9310b7a3ff..516fd8cf37 100644 --- a/pallets/subtensor/src/subnets/registration.rs +++ b/pallets/subtensor/src/subnets/registration.rs @@ -381,7 +381,12 @@ impl Pallet { ); // --- 3. Ensure the supplied work passes the difficulty. - let difficulty: U256 = U256::from(1_000_000); // Base faucet difficulty. + let difficulty: U256 = if !cfg!(feature = "fast-blocks") { + U256::from(1_000_000) // Base faucet difficulty. + } else { + U256::from(100) // Lowered for fast blocks + }; + let work_hash: H256 = Self::vec_to_hash(work.clone()); ensure!( Self::hash_meets_difficulty(&work_hash, difficulty), diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c82a5aa498..1c37e0bb49 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -122,7 +122,9 @@ substrate-wasm-builder = { workspace = true, optional = true } [features] default = ["std"] pow-faucet = ["pallet-subtensor/pow-faucet"] -fast-blocks = [] +fast-blocks = [ + "pallet-subtensor/fast-blocks" +] std = [ "frame-try-runtime?/std", "frame-system-benchmarking?/std",