Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0d1d5d3
feat!: add time-range indexes for trending/leaderboard queries
QuantumExplorer May 25, 2026
606c0a8
test(drive-abci): verify time-range aggregates through the SDK FromPr…
QuantumExplorer Aug 25, 2026
550eed3
feat!: phase-only time-range grids with grid-qualified index levels
QuantumExplorer Aug 25, 2026
72f70e1
refactor(platform-queries): one shared time-range proof normalization…
QuantumExplorer Aug 25, 2026
8c59f7c
fix(dpp)!: cap timeRange.phase at one year so no valid timestamp prec…
QuantumExplorer Aug 25, 2026
6e99f91
fix(drive)!: refuse time-range selections on the ranked and HAVING su…
QuantumExplorer Aug 25, 2026
a6d6aa0
docs(dapi-grpc): tighten the IN_TIME_RANGE operator comment
QuantumExplorer Aug 25, 2026
a317c86
test: deterministic time-range fixtures; direct WASM grid-parser cove…
QuantumExplorer Aug 26, 2026
b3bb244
fix: address review findings on the time-range query surfaces
QuantumExplorer Aug 26, 2026
c8045af
test(suite): tolerate the protocol v14 $contractVersion stamp in docu…
QuantumExplorer Aug 26, 2026
3c1dfc9
test(sdk): pin the protocol gate's typed error variant
QuantumExplorer Aug 26, 2026
4b1d348
fix(drive)!: apply in-bucket cursors at the document-id terminal, not…
QuantumExplorer Aug 26, 2026
77a31b3
refactor(drive): derive time-range provenance's field from its transform
QuantumExplorer Aug 26, 2026
808c766
refactor(dpp): keep the grammar-admission mapping crate-private
QuantumExplorer Aug 26, 2026
dd061f9
refactor(drive)!: route ranked and having-range proofs through groved…
QuantumExplorer Aug 26, 2026
cf759a3
fix(drive-abci): eta-reduce the savepoint-rollback error mapping
QuantumExplorer Aug 26, 2026
60b786b
style(drive-abci): sort the GroveDBError import where rustfmt puts it
QuantumExplorer Aug 26, 2026
aacc446
test(drive): sibling file for the time-range e2e module; pin cursor i…
QuantumExplorer Aug 26, 2026
36d8f28
docs(drive): drop the last references to the deleted cross-index grid…
QuantumExplorer Aug 26, 2026
1cb58ee
test(drive-abci): re-sign tampered metadata so the negatives pin the …
QuantumExplorer Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20039,6 +20039,7 @@ $root.org = (function() {
* @property {number} BETWEEN_EXCLUDE_RIGHT=8 BETWEEN_EXCLUDE_RIGHT value
* @property {number} IN=9 IN value
* @property {number} STARTS_WITH=10 STARTS_WITH value
* @property {number} IN_TIME_RANGE=11 IN_TIME_RANGE value
*/
GetDocumentsRequest.WhereOperator = (function() {
var valuesById = {}, values = Object.create(valuesById);
Expand All @@ -20053,6 +20054,7 @@ $root.org = (function() {
values[valuesById[8] = "BETWEEN_EXCLUDE_RIGHT"] = 8;
values[valuesById[9] = "IN"] = 9;
values[valuesById[10] = "STARTS_WITH"] = 10;
values[valuesById[11] = "IN_TIME_RANGE"] = 11;
return values;
})();

Expand Down Expand Up @@ -20870,6 +20872,7 @@ $root.org = (function() {
case 8:
case 9:
case 10:
case 11:
break;
}
if (message.value != null && message.hasOwnProperty("value")) {
Expand Down Expand Up @@ -20939,6 +20942,10 @@ $root.org = (function() {
case 10:
message.operator = 10;
break;
case "IN_TIME_RANGE":
case 11:
message.operator = 11;
break;
}
if (object.value != null) {
if (typeof object.value !== "object")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19531,6 +19531,7 @@ $root.org = (function() {
* @property {number} BETWEEN_EXCLUDE_RIGHT=8 BETWEEN_EXCLUDE_RIGHT value
* @property {number} IN=9 IN value
* @property {number} STARTS_WITH=10 STARTS_WITH value
* @property {number} IN_TIME_RANGE=11 IN_TIME_RANGE value
*/
GetDocumentsRequest.WhereOperator = (function() {
var valuesById = {}, values = Object.create(valuesById);
Expand All @@ -19545,6 +19546,7 @@ $root.org = (function() {
values[valuesById[8] = "BETWEEN_EXCLUDE_RIGHT"] = 8;
values[valuesById[9] = "IN"] = 9;
values[valuesById[10] = "STARTS_WITH"] = 10;
values[valuesById[11] = "IN_TIME_RANGE"] = 11;
return values;
})();

Expand Down Expand Up @@ -20362,6 +20364,7 @@ $root.org = (function() {
case 8:
case 9:
case 10:
case 11:
break;
}
if (message.value != null && message.hasOwnProperty("value")) {
Expand Down Expand Up @@ -20431,6 +20434,10 @@ $root.org = (function() {
case 10:
message.operator = 10;
break;
case "IN_TIME_RANGE":
case 11:
message.operator = 11;
break;
}
if (object.value != null) {
if (typeof object.value !== "object")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24389,7 +24389,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator = {
BETWEEN_EXCLUDE_LEFT: 7,
BETWEEN_EXCLUDE_RIGHT: 8,
IN: 9,
STARTS_WITH: 10
STARTS_WITH: 10,
IN_TIME_RANGE: 11
};


Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,291 changes: 648 additions & 643 deletions packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2739,6 +2739,7 @@ export namespace GetDocumentsRequest {
BETWEEN_EXCLUDE_RIGHT: 8;
IN: 9;
STARTS_WITH: 10;
IN_TIME_RANGE: 11;
}

export const WhereOperator: WhereOperatorMap;
Expand Down
3 changes: 2 additions & 1 deletion packages/dapi-grpc/clients/platform/v0/web/platform_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -24389,7 +24389,8 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.WhereOperator = {
BETWEEN_EXCLUDE_LEFT: 7,
BETWEEN_EXCLUDE_RIGHT: 8,
IN: 9,
STARTS_WITH: 10
STARTS_WITH: 10,
IN_TIME_RANGE: 11
};


Expand Down
12 changes: 12 additions & 0 deletions packages/dapi-grpc/protos/platform/v0/platform.proto
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,18 @@ message GetDocumentsRequest {
BETWEEN_EXCLUDE_RIGHT = 8;
IN = 9;
STARTS_WITH = 10;
// Time-range bucket selection (v1 only; the v0 CBOR surface is
// unaffected). `field` names a timestamp covered by a `timeRange`
// index. Operand: `text` selector `"newest"`/`"oldest"` when one grid
// buckets the field, or `list` `[selector, range, step(, phase)]` in
// the contract's declared seconds to name one of several grids (zero
// phase is spelled by omission — one wire spelling per grid). The
// server resolves it to a bucket-start equality from current block
// time; the verifier re-derives the same bucket from the quorum-signed
// metadata time — an ordinary index/count proof. See `timeRange` in
// the document meta-schema and
// `drive::query::resolve_time_range_bucket_clause`.
IN_TIME_RANGE = 11;
}

// Tagged scalar (or list) operand for a `WhereClause`. The
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,33 @@ pub(super) fn assert_select_is_avg(
/// that should be unreachable here (`prove = true`); reject as
/// `RequestError` if they bubble through.
pub(super) fn verify_average_query(
request: DocumentQuery,
mut request: DocumentQuery,
response: GetDocumentsResponse,
platform_version: &PlatformVersion,
provider: &dyn ContextProvider,
) -> Result<(Option<Vec<AverageEntry>>, ResponseMetadata, Proof), drive_proof_verifier::Error> {
let proof = response
.proof()
.or(Err(drive_proof_verifier::Error::NoProofInResult))?;
let mtd = response
.metadata()
.or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?;
let contract_id = request.data_contract.id().to_buffer();
let sum_property = request.select.field.clone();

// Resolve any pending time-range (`IN_TIME_RANGE`) selections into
// concrete bucket-equality clauses using the quorum-signed metadata
// block time — BEFORE mode detection and covering-index selection
// below, which read `request.where_clauses`; the prover routed on
// the resolved shape.
// ...and enforce the same provenance-vs-shape contract the server
// dispatchers do, through the one shared normalization helper.
let resolved_time_ranges =
super::document_query::normalize_time_range_clauses_with_metadata_time(
&mut request,
mtd.time_ms,
)?;

let document_type = request
.data_contract
.document_type_for_name(&request.document_type_name)
Expand All @@ -110,14 +132,6 @@ pub(super) fn verify_average_query(
request.document_type_name, e
),
})?;
let proof = response
.proof()
.or(Err(drive_proof_verifier::Error::NoProofInResult))?;
let mtd = response
.metadata()
.or(Err(drive_proof_verifier::Error::EmptyResponseMetadata))?;
let contract_id = request.data_contract.id().to_buffer();
let sum_property = request.select.field.clone();

// Resolve the SQL-shape `SumMode` the request implies — AVG
// shares the routing table with SUM (see module docstring), so
Expand Down Expand Up @@ -174,6 +188,7 @@ pub(super) fn verify_average_query(
document_type.indexes(),
&request.where_clauses,
&sum_property,
&resolved_time_ranges,
)
.filter(|idx| idx.range_countable)
.ok_or_else(|| drive_proof_verifier::Error::RequestError {
Expand All @@ -189,6 +204,7 @@ pub(super) fn verify_average_query(
document_type.indexes(),
&request.where_clauses,
&sum_property,
&resolved_time_ranges,
)
.filter(|idx| idx.countable.is_countable())
.ok_or_else(|| drive_proof_verifier::Error::RequestError {
Expand Down
Loading
Loading