Commit ea1a00d
feat(dapi): composite document queries on the getDocuments V1 wire
`GetDocumentsRequestV1.sub_queries` (field 14): each entry is a typed
sub-query (contract, document type, fixed where/order clauses, limit,
DOCUMENTS or COUNT) with an optional binding `<field> IN <values>` whose
values the node derives from the page's, or an earlier sub-query's,
proven documents. Presence selects composite mode: the request's own
clauses describe the page; `chained` and `sub_queries` are mutually
exclusive. `ResultData.composite` (variant 7) carries the page and one
result per sub-query (documents, or count entries keyed by the bound
value) for the no-proof path; the proof path is the single merged proof
in the standard envelope, verified client-side by re-deriving the whole
composition from the proven page.
drive-abci intercepts composite requests before select routing
(`dispatch/composite.rs`): the page limit is required (1..=max), every
SQL-shaped knob, cursor and time-range clause is refused, each distinct
sub-query contract is fetched once, and drive's shape validation
surfaces as client-attributable query errors. Old nodes ignore the
field and serve a page-only proof, which the verifier refuses.
Existing V1 request literals gain the new field; the serde default
keeps mock vectors captured before it wire-compatible.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent 1c1ceaa commit ea1a00d
10 files changed
Lines changed: 963 additions & 1 deletion
File tree
- packages
- dapi-grpc
- protos/platform/v0
- dash-platform-queries/src/documents
- rs-drive-abci/src/query/document_query/v1
- dispatch
- rs-drive-proof-verifier/src/proof
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1256 | 1331 | | |
1257 | 1332 | | |
1258 | 1333 | | |
| |||
1605 | 1680 | | |
1606 | 1681 | | |
1607 | 1682 | | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1608 | 1687 | | |
1609 | 1688 | | |
1610 | 1689 | | |
| |||
1615 | 1694 | | |
1616 | 1695 | | |
1617 | 1696 | | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1618 | 1716 | | |
1619 | 1717 | | |
1620 | 1718 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
875 | 876 | | |
876 | 877 | | |
877 | 878 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
0 commit comments