From 85e96c8d47349cdcce26fe106fd15884d75dadc5 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 21 Feb 2025 09:19:29 +1000 Subject: [PATCH 1/2] Fix incorrect panic message --- crates/subspace-node/src/chain_spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/subspace-node/src/chain_spec.rs b/crates/subspace-node/src/chain_spec.rs index 64bb708875..ca4df1fef2 100644 --- a/crates/subspace-node/src/chain_spec.rs +++ b/crates/subspace-node/src/chain_spec.rs @@ -62,7 +62,7 @@ fn get_genesis_allocations(contents: &str) -> Vec<(AccountId, Balance)> { pub fn mainnet_compiled() -> Result { Ok(GenericChainSpec::builder( - WASM_BINARY.ok_or_else(|| "Wasm binary must be built for Taurus".to_string())?, + WASM_BINARY.ok_or_else(|| "Wasm binary must be built for Mainnet".to_string())?, None, ) .with_name("Autonomys Mainnet") From e486c53ca413eb3f8d8e1eec34bac9c6ec8ccea4 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 21 Feb 2025 09:34:17 +1000 Subject: [PATCH 2/2] Fix confusing variable shadowing in ensure_block_and_state_pruning_params --- crates/subspace-node/src/commands/run.rs | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/subspace-node/src/commands/run.rs b/crates/subspace-node/src/commands/run.rs index 6832290e84..5985366e0e 100644 --- a/crates/subspace-node/src/commands/run.rs +++ b/crates/subspace-node/src/commands/run.rs @@ -387,46 +387,46 @@ pub async fn run(run_options: RunOptions) -> Result<(), Error> { } pub fn ensure_block_and_state_pruning_params(config: &mut Configuration) { - let blocks_to_prune = + let domains_pruning_depth = DOMAINS_BLOCK_PRUNING_DEPTH.saturating_mul(DOMAINS_PRUNING_DEPTH_MULTIPLIER); if let BlocksPruning::Some(blocks) = config.blocks_pruning { - config.blocks_pruning = BlocksPruning::Some(if blocks >= blocks_to_prune { + config.blocks_pruning = BlocksPruning::Some(if blocks >= domains_pruning_depth { blocks } else { warn!( "Blocks pruning config needs to be at least {:?}", - blocks_to_prune + domains_pruning_depth ); - blocks_to_prune + domains_pruning_depth }); } match &config.state_pruning { None => { config.state_pruning = Some(PruningMode::Constrained(Constraints { - max_blocks: Some(blocks_to_prune), + max_blocks: Some(domains_pruning_depth), })) } Some(pruning_mode) => { if let PruningMode::Constrained(constraints) = pruning_mode { - let blocks_to_prune = match constraints.max_blocks { - None => blocks_to_prune, - Some(blocks) => { - if blocks >= blocks_to_prune { - blocks + let max_blocks = match constraints.max_blocks { + None => domains_pruning_depth, + Some(max_blocks) => { + if max_blocks >= domains_pruning_depth { + max_blocks } else { warn!( "State pruning config needs to be at least {:?}", - blocks_to_prune + domains_pruning_depth ); - blocks_to_prune + domains_pruning_depth } } }; config.state_pruning = Some(PruningMode::Constrained(Constraints { - max_blocks: Some(blocks_to_prune), + max_blocks: Some(max_blocks), })) } }