From 0d5ee4a66f2b87211abd80b6f9e2dabe567f0d98 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Fri, 6 Mar 2026 17:45:27 +0700 Subject: [PATCH] fix(drive): correct tree types in shielded pool estimated costs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Nullifiers tree type: NormalTree → ProvableCountTree (matches initialization which uses empty_provable_count_tree()) - Pool children weights: count_trees_weight=1 for nullifiers, non_sum_trees_weight=1 for anchors (was 0+2) Co-Authored-By: Claude Opus 4.6 --- packages/rs-drive/src/drive/shielded/estimated_costs.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/rs-drive/src/drive/shielded/estimated_costs.rs b/packages/rs-drive/src/drive/shielded/estimated_costs.rs index 30998a478e8..2e3107063f3 100644 --- a/packages/rs-drive/src/drive/shielded/estimated_costs.rs +++ b/packages/rs-drive/src/drive/shielded/estimated_costs.rs @@ -88,9 +88,9 @@ impl Drive { SomeSumTrees { sum_trees_weight: 0, big_sum_trees_weight: 0, - count_trees_weight: 0, + count_trees_weight: 1, // nullifiers (ProvableCountTree) count_sum_trees_weight: 0, - non_sum_trees_weight: 2, // nullifiers + anchors + non_sum_trees_weight: 1, // anchors }, None, 3, // 3 subtrees: notes (CommitmentTree), nullifiers, anchors @@ -113,11 +113,11 @@ impl Drive { ); // Nullifiers tree: [AddressBalances, "s", 2] - // NormalTree - stores spent nullifiers (32-byte key -> empty item) + // ProvableCountTree - stores spent nullifiers (32-byte key -> empty item) estimated_costs_only_with_layer_info.insert( KeyInfoPath::from_known_path(shielded_credit_pool_nullifiers_path()), EstimatedLayerInformation { - tree_type: TreeType::NormalTree, + tree_type: TreeType::ProvableCountTree, estimated_layer_count: EstimatedLevel(16, false), estimated_layer_sizes: AllItems(NULLIFIER_KEY_SIZE, 0, None), },