From f556c4a46dc97fd72254b2228e534e1860a87815 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 4 Apr 2023 09:20:08 +1000 Subject: [PATCH] Remove an outdated assertion in a comment, replace with a test TODO (#6450) --- zebra-state/src/service/check/anchors.rs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/zebra-state/src/service/check/anchors.rs b/zebra-state/src/service/check/anchors.rs index a7b2de0f2..a2467693a 100644 --- a/zebra-state/src/service/check/anchors.rs +++ b/zebra-state/src/service/check/anchors.rs @@ -155,24 +155,15 @@ fn fetch_sprout_final_treestates( .or_else(|| finalized_state.sprout_note_commitment_tree_by_anchor(&joinsplit.anchor)); if let Some(input_tree) = input_tree { - /* TODO: - - fix tests that generate incorrect root data - - assert that roots match the fetched tree during tests - - move this CPU-intensive check to sprout_anchors_refer_to_treestates() - - assert_eq!( - input_tree.root(), - joinsplit.anchor, - "anchor and fetched input tree root did not match:\n\ - anchor: {anchor:?},\n\ - input tree root: {input_tree_root:?},\n\ - input_tree: {input_tree:?}", - anchor = joinsplit.anchor - ); - */ - sprout_final_treestates.insert(joinsplit.anchor, input_tree); + /* TODO: + - fix tests that generate incorrect root data + - assert that joinsplit.anchor matches input_tree.root() during tests, + but don't assert in production, because the check is CPU-intensive, + and sprout_anchors_refer_to_treestates() constructs the map correctly + */ + tracing::debug!( sprout_final_treestate_count = ?sprout_final_treestates.len(), ?joinsplit.anchor,