You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(sdk): validate document requests in one versioned step before sending #5618
A document request (GetDocuments and the count, sum and average document queries) is checked by three separate layers before it is sent:
the versioned encoder TryFromPlatformVersioned<DocumentQuery> for GetDocumentsRequest (packages/dash-platform-queries/src/documents/document_query.rs), which gates grammar (contains/containsAny, timeRange/integerRange, composite shapes) by the SDK's stored protocol version;
They use different version bases, literals instead of the platform version tables, and leave gaps.
Goal
One versioned "build the request for this result type" step that takes the network-proven version, checks the shape and the version-dependent features from the version tables (not literals), and is the only source of truth. needs_protocol_version stays only for non-document requests (new RPCs, the shielded token_id).
Fold in
Covering-index resolution (resolve_{ranked,having}_query_for_mode) runs only after the answer; check it before sending.
A single Document::fetch turns "expected 1 element" into a retryable Error::Proof; it should be non-retryable.
delegate_from_proof_variant! does not forward check_request.
A composite or chained query using contains/containsAny on an SDK seeded at protocol 13 is refused by the encoder's grammar check before the gate can probe the network.
Documents::check_request does not reject group_by/having; check_count/sum/average_request ignore pending time and integer range windows (raised in review of chore: merge v5.0-dev into v5.1-dev (5.0.1) #5608).
Decide whether Sdk::fetch_moderation_charters_contract's own "is 14 usable" check and the version_for_requests ratchet belong here.
A design spec is being written first; the implementation follows once it is agreed.
Activity