feat(dpp): add documents_countable to DocumentTypeV2 for O(1) total document counts#3457
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new fields to
DocumentTypeV2for O(1) document counting:documents_countable: bool— primary key tree usesCountTree, enabling O(1) total document count queriesblast_syncable: bool— primary key tree usesProvableCountTreefor BLAST sync support. Impliesdocuments_countable = true.Changes
V2variant with full match arm coverageDocumentTypeV2Getters/DocumentTypeV2Setterstry_from_schemav2 parses both"documentsCountable"and"blastSyncable"(protocol version 12+ required)CountTreefor countable,ProvableCountTreefor blast_syncableCONTRACT_VERSIONS_V4withtry_from_schema: 2, used in v12Schema example
{ "person": { "type": "object", "documentsCountable": true, "properties": { ... } } }Or with BLAST sync:
{ "person": { "type": "object", "blastSyncable": true, "properties": { ... } } }NOT in this PR
Count query extensions — follow-up to PR #3435.
Test plan
cargo check -p dpp -p drivepassescargo fmt --allclean🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores