Closed
Labels
effort: MMedium effort — a few daysMedium effort — a few daysenhancementNew feature or requestNew feature or requestrs-sdk
Milestone
Description
Problem
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; FromProof::check_requestper result type (fix(sdk): check document query shapes before sending them #5558), which checks the shape the result view can verify;- the protocol gate
needs_protocol_version(fix(sdk)!: refuse requests the network cannot serve yet instead of banning nodes #5561,packages/rs-dapi-client/src/transport/grpc.rs), which checks the network-proven version against a hard-coded 14.
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::fetchturns "expected 1 element" into a retryableError::Proof; it should be non-retryable. -
delegate_from_proof_variant!does not forwardcheck_request. - A composite or chained query using
contains/containsAnyon an SDK seeded at protocol 13 is refused by the encoder's grammar check before the gate can probe the network. -
Documents::check_requestdoes not rejectgroup_by/having;check_count/sum/average_requestignore 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 theversion_for_requestsratchet belong here.
A design spec is being written first; the implementation follows once it is agreed.
Metadata
Metadata
Assignees
Labels
effort: MMedium effort — a few daysMedium effort — a few daysenhancementNew feature or requestNew feature or requestrs-sdk
Activity
fix(sdk)!: refuse document requests no node can answer instead of ban…