Skip to content

Commit 4b45cd3

Browse files
authored
Merge pull request #944 from opentensor/feat/lower-facuet-diff
lower faucet diff to 100 on fast-blocks
2 parents db3bd8a + 0ece437 commit 4b45cd3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pallets/subtensor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,4 @@ try-runtime = [
116116
"pallet-collective/try-runtime"
117117
]
118118
pow-faucet = []
119+
fast-blocks = []

pallets/subtensor/src/subnets/registration.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,12 @@ impl<T: Config> Pallet<T> {
381381
);
382382

383383
// --- 3. Ensure the supplied work passes the difficulty.
384-
let difficulty: U256 = U256::from(1_000_000); // Base faucet difficulty.
384+
let difficulty: U256 = if !cfg!(feature = "fast-blocks") {
385+
U256::from(1_000_000) // Base faucet difficulty.
386+
} else {
387+
U256::from(100) // Lowered for fast blocks
388+
};
389+
385390
let work_hash: H256 = Self::vec_to_hash(work.clone());
386391
ensure!(
387392
Self::hash_meets_difficulty(&work_hash, difficulty),

runtime/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ substrate-wasm-builder = { workspace = true, optional = true }
122122
[features]
123123
default = ["std"]
124124
pow-faucet = ["pallet-subtensor/pow-faucet"]
125-
fast-blocks = []
125+
fast-blocks = [
126+
"pallet-subtensor/fast-blocks"
127+
]
126128
std = [
127129
"frame-try-runtime?/std",
128130
"frame-system-benchmarking?/std",

0 commit comments

Comments
 (0)