@@ -50,16 +50,10 @@ pub(crate) mod tests;
5050///
5151/// Shared across [crate::qmdb::any] and [crate::qmdb::current] sync because both
5252/// build on the same operations-MMR layout and share the same merkle partition.
53- ///
54- /// # Caller contract
55- ///
56- /// `target.range.start()` **must** equal the committed inactivity floor of the
57- /// target state (i.e. the floor carried by the last `CommitFloor` op). Only the
58- /// persisted tree size and root are checked; the merkle pruning boundary is not.
59- /// Callers that set `target.range.start()` below the committed floor (or that
60- /// prune their own database past the committed floor) can cause a later
61- /// [`qmdb::sync::Database::from_sync_result`] rebuild to fail with `MissingNode`
62- /// even though this function returned `true`.
53+ /// Verifies only that the persisted tree size and root match; the merkle pruning
54+ /// boundary is not re-checked. Callers must keep their local pruning point at or
55+ /// below `target.range.start()` or a later
56+ /// [`qmdb::sync::Database::from_sync_result`] rebuild may fail.
6357pub async fn has_local_target_state < F , E , H > (
6458 context : E ,
6559 merkle_config : journaled:: Config ,
7872 )
7973 . await ;
8074 // Size + root match implies the last CommitFloor op (and therefore the
81- // committed inactivity floor) matches, per the caller contract above.
75+ // size + root identify a unique state, so if they match the target's we can reuse
76+ // the persisted DB without fetching boundary pins.
8277 matches ! (
8378 peek,
8479 Ok ( Some ( ( _, journal_leaves, root) ) )
0 commit comments