Expand description
Document-sum verification methods on proofs (the
GetDocumentsSum endpoint’s prove-path verifiers).
Verifies grovedb proofs produced by the GetDocumentsSum endpoint.
Mirror of crate::verify::document_count for the sum surface.
Pure grovedb-level verifiers as methods on
crate::query::DriveDocumentSumQuery that take raw proof: &[u8]
and return (RootHash, T). The tenderdash signature composition
layer that wraps these calls lives in
packages/rs-drive-proof-verifier/src/proof/document_sum.rs.
Carrier-aggregate verifier bodies call
GroveDb::verify_aggregate_sum_query_per_key and
GroveDb::verify_aggregate_count_and_sum_query_per_key (grovedb
PR #670 head e98bab5f).
Modules§
- verify_
aggregate_ count_ and_ sum_ proof - Leaf-PCPS
AggregateCountAndSumOnRangeproof verification — returns(root_hash, u64 count, i64 sum). PCPS-only (the terminator’s value tree must be aProvableCountProvableSumTree). The load-bearing primitive for average-range queries: the client computesavg = sum / countlocally, but the proof commits both metrics from the same in-range set in one root-hash-attested traversal. - verify_
aggregate_ sum_ proof - Single-aggregate-sum proof verification — sum analog of count’s
verify_aggregate_count_proof. Returns(root_hash, i64 sum)from oneAggregateSumOnRangemerk traversal. - verify_
carrier_ aggregate_ count_ and_ sum_ proof - Combined PCPS carrier-aggregate proof verification — returns one
(in_key, u64 count, i64 sum)triple per resolved In branch. PCPS-only (the terminator’s value tree must be aProvableCountProvableSumTree). - verify_
carrier_ aggregate_ sum_ proof - Carrier-aggregate-sum proof verification — sum-side analog of
count’s
verify_carrier_aggregate_count_proof. Returns one(in_key, i64)per resolved In branch. - verify_
distinct_ count_ and_ sum_ proof - Per-distinct-key range-AVG proof verification — AVG analog of
verify_distinct_sum_proof. Walks the verified terminator count-sum-bearing elements and extracts eachcount_sum_value_or_default()as a per-(in_key, key)AverageEntry. Requires the index to declare BOTHrangeCountable: trueANDrangeSummable: true(i.e. arangeAverageable: trueindex). Used by the prove path’sRangeDistinctProofmode on the AVG surface. - verify_
distinct_ sum_ proof - Per-distinct-key range-sum proof verification — sum analog of
count’s
verify_distinct_count_proof. Walks the verified terminator SumTree elements and extracts eachsum_value_or_default()as a per-(in_key, key)entry. Used by the prove path’sRangeDistinctProofmode. - verify_
point_ lookup_ count_ and_ sum_ proof - Point-lookup count+sum proof verification — AVG analog of
verify_point_lookup_sum_proof. Extractscount_sum_value_or_default()from each verified terminator element. Used by the prove path’s AVG point-lookup shape on adocumentsCountable + documentsSummabledoctype. - verify_
point_ lookup_ sum_ proof - Point-lookup sum proof verification — sum analog of count’s
verify_point_lookup_count_proof. Returns oneSumEntryper verified branch (Equal-only fully-covered: one entry with emptykey; In-bearing: one entry per present In value withkey = serialized_in_value). Absent branches are silently omitted because today’s path query does not request absence proofs. - verify_
primary_ key_ count_ sum_ tree_ proof - Direct read of the document type’s primary-key count-sum-bearing
element (CountSumTree / ProvableCountSumTree /
ProvableCountProvableSumTree) — returns
(root_hash, u64 count, i64 sum). Used by thedocumentsCountable + documentsSummablefast path on empty-where AVG queries. - verify_
primary_ key_ sum_ tree_ proof - Direct read of the document type’s primary-key
SumTreeelement — sum analog of count’sverify_primary_key_count_tree_proof. Returns(root_hash, i64 sum). Used by thedocuments_summablefast path on empty-where SUM queries.