223223//!
224224//! This combines two (or three) components into a single hash:
225225//!
226- //! - **ops root**: The root of the operations tree computed using the QMDB root spec for
227- //! the Merkle family (the inner [crate::qmdb::any] database's root). Used for state sync,
228- //! where a client downloads operations and verifies each batch against this root using QMDB
229- //! range proofs.
226+ //! - **Ops root**: The root of the raw operations tree (the inner [crate::qmdb::any] database's
227+ //! root). Used for state sync, where a client downloads operations and verifies each batch
228+ //! against this root using standard Merkle range proofs.
230229//!
231230//! - **Grafted root**: The root of the grafted tree (overlaying bitmap chunks
232231//! with ops subtree roots). Used for proofs about operation values and their activity status.
236235//! usually incomplete. Its digest and bit count are folded into the canonical root hash.
237236//!
238237//! The canonical root is returned by [Db](db::Db)`::`[root()](db::Db::root).
239- //! The ops root is returned by the `sync::Database` trait's `root()` method, since the sync
240- //! engine verifies batches against the ops root, not the canonical root.
238+ //! The ops root is returned by the `sync::Database` trait's `root()` method, since the sync engine
239+ //! verifies batches against the ops root, not the canonical root.
241240//!
242241//! For state sync, the sync engine targets the ops root and verifies each batch against it.
243242//! After sync, the bitmap and grafted tree are reconstructed deterministically from the
@@ -259,6 +258,7 @@ use crate::{
259258 operation:: { Operation , Update } ,
260259 Config as AnyConfig ,
261260 } ,
261+ bitmap:: Shared ,
262262 operation:: Committable ,
263263 } ,
264264 translator:: Translator ,
@@ -353,7 +353,7 @@ where
353353 // populates it during snapshot rebuild.
354354 let bitmap = BitMap :: < N > :: new_with_pruned_chunks ( pruned_chunks)
355355 . map_err ( |_| crate :: qmdb:: Error :: < F > :: DataCorrupted ( "pruned chunks overflow" ) ) ?;
356- let bitmap = Arc :: new ( crate :: qmdb :: bitmap :: Shared :: < N > :: new ( bitmap) ) ;
356+ let bitmap = Arc :: new ( Shared :: < N > :: new ( bitmap) ) ;
357357
358358 let any = any:: init_with_bitmap ( context. with_label ( "any" ) , config. into ( ) , Some ( bitmap) ) . await ?;
359359
@@ -3638,11 +3638,11 @@ pub mod tests {
36383638 } ) ;
36393639 }
36403640
3641- /// Regression: a `current::Db` over `mmb::Family` commits its ops root with the QMDB root spec,
3642- /// so [`crate::qmdb::verify_proof`] must use that spec to accept proofs returned by
3643- /// `ops_historical_proof`.
3641+ /// Regression: a `current::Db` over `mmb::Family` bags its ops root with backward-fold, so
3642+ /// [`crate::qmdb::verify_proof`] must use a hasher with that bagging to accept proofs returned
3643+ /// by `ops_historical_proof`.
36443644 #[ test_traced( "INFO" ) ]
3645- fn test_current_mmb_ops_historical_proof_verifies_with_qmdb_spec ( ) {
3645+ fn test_current_mmb_ops_historical_proof_verifies_with_backward_bagging ( ) {
36463646 use crate :: { merkle:: hasher:: Standard , qmdb:: verify_proof} ;
36473647 use commonware_utils:: NZU64 ;
36483648
0 commit comments