Skip to content

fix(drive): look up a single document at a block time (PV15) - #5838

Merged
QuantumExplorer merged 12 commits into
v5.1-devfrom
claude/single-document-block-time
Nov 10, 2026
Merged

QuantumExplorer merged 12 commits into
v5.1-devfrom
claude/single-document-block-time

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: Some document types keep history: every change stores a new version of the document next to the old ones. A client can ask for proof of one document "as it stood at a given time". That lookup never worked. From protocol version 15 it answers with the newest version stored at or before the time, and with nothing for a time before the document existed, and its proof can be verified.

Value: Code that verifies proofs on the client (wasm-drive-verify and the Rust drive verifier) gets a working way to read a past version of a document outside a name contest. Nothing in the SDKs or the node uses it yet, so a public helper is fixed before anyone depends on it.

Risks: Low. No state transition is proved or verified at a block time, so block execution and state transition proofs do not change. Only protocol version 15, which is not released, selects the change: protocol version 14 and earlier build the query they built, pinned by tests. One thing to know: #4652 (open) changes how history is stored at protocol version 15 and refuses these lookups under its new layout, so whichever of the two lands second has to be reworked against the other.

Issue being fixed or feature implemented

SingleDocumentDriveQuery takes block_time_ms. For a document type that keeps history it then looks in the document's history, which holds one key per time a version was stored, plus the key [0], a pointer to the latest version. Two things were wrong:

  1. The range was too wide. It took every key up to the block time. The pointer at [0] sorts below every time, so the range reached it: a time before the document was first stored answered with the latest version.
  2. No proof of it verified. The verifier asks GroveDB to name the absent keys, which a range that is open at one end does not allow.

Found while fixing the "maybe contested" lookup in #5835, which left this out to stay focused and refused the block time in that status. No issue was open for it, and no open PR fixes it.

This PR builds on #5835, now merged as one commit into v5.1-dev: it needs that PR's verifier generation, and it moves and lifts what that PR added for a lookup at a block time.

What was done?

A person document stored at time 1000 and changed at time 2000, in a type that keeps history, looked up outside a contest:

Block time 500 (before the document was first stored)
Before: the stored answer is the version of time 2000 (wrong); the proof fails:
        "terminal keys are not supported with unbounded ranges"
After:  no document, verified

Block time 1500
Before: the stored answer is the version of time 1000; the proof fails the same way
After:  the version of time 1000, verified

Block time 2500
Before: the stored answer is the version of time 2000; the proof fails the same way
After:  the version of time 2000, verified

The same lookups for a document that may be contested are still refused at protocol version 15, as #5835 left them (QuerySyntaxError::Unsupported). A contest's area holds each contender as it was submitted, a plain item with no time to compare, so a contender submitted after the block time would be found there and its proof would verify.

The query for block time 1500, in the document's history:

Before: every key up to 1500, newest first     RangeToInclusive(..=encode_u64(1500))
After:  above [0] and up to 1500, newest first RangeAfterToInclusive([0]..=encode_u64(1500))
  • The query gets generations. SingleDocumentDriveQuery::construct_path_query now dispatches on a new table number, drive.methods.document.query.single_document_path_query.
    • Generation 0 (packages/rs-drive/src/query/single_document_drive_query/v0/mod.rs) is what protocol versions 1 to 14 build. It is the code as it was, moved.
    • Generation 1 (v1/mod.rs) reuses generation 0 and changes two lookups in a type that keeps history. A lookup at a block time stops above the pointer. A lookup of a document that may be contested states its cap itself before the merge, and is refused at a block time, both of which fix(drive): verify a single document that may be contested (PV15) #5835 did behind a check of GroveDB's merge generation. That check is gone: the generation is selected by the table.
  • A block time past i64::MAX is read as i64::MAX. Times are stored with their top bit flipped, so a later time would sort below every real one and find nothing. u64::MAX now answers with the latest version.
  • The verifier. verify_proof_keep_serialized 1 (packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v1/mod.rs, added by fix(drive): verify a single document that may be contested (PV15) #5835, not released) also verifies a lookup at a block time against the query as it is, with GroveDb::verify_query, or verify_subset_query for a subset. It answers with the one version found, or with none. Lookups with no block time, in a type without history, or in a contest go to generation 0 as before.
  • The refusal fix(drive): verify a single document that may be contested (PV15) #5835 added stays, now in generation 1: a document with history that may be contested is refused at a block time, for the reason above.
  • Version tables. single_document_path_query is 0 in document method tables v1 to v4 and 1 in DRIVE_DOCUMENT_METHOD_VERSIONS_V5, protocol version 15's. Note 31 in packages/rs-platform-version/src/version/v15.rs describes it, and note 29 no longer says a block time is refused.
  • packages/wasm-drive-verify/README_SINGLE_DOCUMENT.md gets a "Block Time" section.

Points for review

  • Why "above [0]" and not "from time 0". Both leave the pointer out. "Above [0]" says so directly, depends on nothing but the pointer's key, and no time can turn it into an inverted range.
  • A proof made for one block time does not verify at another when the two times answer differently, as a whole proof or as a subset (tested in both directions, and against "no version").
  • Protocol version 14 is left as it is. The lookup still answers wrongly before the first version there and still does not verify. Changing that means editing a shipped generation.
  • No server path proves a lookup at a block time. prove_state_transition always asks for the latest version. A client needs a proof of the built query, which today only proving that query directly gives.
  • Overlap with #4652. It moves history to a new layout at protocol version 15 and makes construct_path_query refuse a block time for history types there. This PR fixes the lookup on the layout v5.1-dev has today.

Public interface changes

No signature changes. One struct gains a field, and three calls behave differently at protocol version 15.

platform-version

// packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs
pub struct DriveDocumentQueryMethodVersions {
    // ...
    pub start_at_document: FeatureVersion,
    pub single_document_path_query: FeatureVersion, // new
}

Code that builds this struct with a literal must add the field. In this repository only the four document method tables did, and they set it to 0. Default gives 0, generation 0.

drive (SingleDocumentDriveQuery, in a document type that keeps history, at protocol version 15)

Call Before After
construct_path_query, NotContested, a block time range ..=time, reaching the pointer at [0] range above [0] up to the time
construct_path_query, MaybeContested, a block time QuerySyntaxError::Unsupported unchanged, QuerySyntaxError::Unsupported
construct_path_query, an unknown single_document_path_query not possible DriveError::UnknownVersionMismatch
verify_proof and verify_proof_keep_serialized, NotContested, a block time always an error the version stored at or before the time, or None

PathQuery::try_from_platform_versioned(SingleDocumentDriveQuery, ..) follows construct_path_query.

wasm-drive-verify: verifySingleDocumentProofKeepSerialized with a query created with blockTimeMs, called with platform version 15, returns the root hash and the version, where it returned "Verification failed".

What stays the same: every query with no block time, every query in a type without history, and every Contested query build exactly what protocol version 14 builds (tested over all statuses). Stored bytes, state transition proofs and every protocol version up to 14 are untouched.

How Has This Been Tested?

  • verify_proof_keep_serialized/v1/mod.rs, 5 new tests that prove and verify against a real Drive, each as a whole proof and as a subset, with the root hash checked against the stored state. A history document with two versions (times 1000 and 2000) is looked up outside a contest at 0, 999, 1000, 1500, 1999, 2000, 2500 and u64::MAX: nothing before 1000, the first version up to 1999, the second from 2000. A document that was never stored is proved absent at a block time. A proof made for another block time is refused. A "maybe contested" lookup at a block time is refused. Protocol version 14 still refuses a lookup at a block time.
  • single_document_drive_query.rs: protocol version 14 builds the block time query it built, written out by hand, and the "maybe contested" merge it built; protocol version 15 builds the same query as 14 for every status, with and without history, with and without a block time, except the block time lookup in a history; the new range is as described, also for u64::MAX; a "maybe contested" history lookup at a block time is refused, one without history is not; an unknown table number is refused.
  • Mutation checks, each failing tests: the range reaching [0], no clamp of the block time, no cap stated for a "maybe contested" history lookup, the verifier sending a block time lookup to generation 0, the table selecting generation 0 at protocol version 15, no refusal of a "maybe contested" lookup at a block time.
  • cargo test -p drive --lib -- verify:: prove:: query::single (402 passed), cargo test -p platform-version (31 passed).
  • cargo clippy -p drive -p platform-version --all-targets -- -D warnings, cargo fmt --all --check, cargo check -p drive --no-default-features --features verify, cargo check -p wasm-drive-verify.
  • Not covered: a test through the wasm bindings, and cargo check --workspace --all-targets (the new field is set in every struct literal a search of the repository finds). No full suite was run locally.

In-place changes to shipped generations

  • SingleDocumentDriveQuery::construct_path_query had no generations, and every protocol version ran it. It is now a dispatcher. Protocol versions 1 to 14 select generation 0 (their tables set single_document_path_query to 0), which is the function's body before fix(drive): verify a single document that may be contested (PV15) #5835, moved unchanged: its two helpers differ only by pub(super). Tests pin that protocol version 14 builds the queries it built. It is not on a consensus path.
  • DRIVE_DOCUMENT_METHOD_VERSIONS_V1 to V4 gain the new field, set to 0, which selects that unchanged code.
  • verify_proof_keep_serialized 1 is edited in place. Only protocol version 15's table selects it, and it is not released.

Breaking Changes

None. Calls that returned an error or a wrong answer at protocol version 15 now return the right one. Rust code outside this repository that builds DriveDocumentQueryMethodVersions with a struct literal must add the new field.

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · cfc146a

  • Bots — thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed
  • Build running
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • New Features

    • Historical document lookups now return the newest version stored at or before the requested block time, or no document if none existed yet.
    • From protocol version 15, block-time lookups are supported for documents confirmed as not contested. Historical lookups for documents that may be contested are refused.
    • Contested-document lookups ignore the requested block time.
  • Documentation

    • Updated guidance to clarify how block-time lookups behave for different document history and contest statuses.

QuantumExplorer and others added 9 commits November 10, 2026 13:57
A single document query in its "maybe contested" status looks among the
documents of its type and in the contest's area at once. No proof of one
verified at any protocol version: the verifier asked GroveDB to name the
absent keys, which needs an overall limit the merged query does not have.

verify_proof_keep_serialized 1, selected by protocol version 15, verifies
the proof against the merged query and answers with the document from
whichever place holds it. Under GROVE_V5 the query of a document type that
keeps history states its cap itself, since the merge no longer derives one
above a subquery, and builds the query protocol version 14 built. A lookup
at a block time is refused in this status.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Only a document type that keeps history refuses a block time in this
status. A type without history has one version and ignores it, as in
every status. The README, note 29 and the error say so.

Tests: a block time is ignored for a type without history, and protocol
version 14 still refuses a proof that generation 1 accepts, whole and as
a subset.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
In a document type that keeps history, a single document query with a
block time asks for the newest version stored at or before that time.
It never worked: its range also reached the pointer to the latest
version at key [0], so a time before the document was first stored
answered with the latest version, and no proof of it verified, as the
verifier asked GroveDB to name the absent keys of a range.

The query gets generations. single_document_path_query 1, selected only
by protocol version 15's document method table, stops the range above
the pointer, and states the cap of a document that may be contested as
the merge of GROVE_V5 needs it. Generation 0 is what protocol versions 1
to 14 build. verify_proof_keep_serialized 1 verifies such a lookup
against the query as it is, for a document outside a contest and for one
that may be contested, which is no longer refused at a block time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…cument' into claude/single-document-block-time

# Conflicts:
#	packages/rs-drive/src/query/single_document_drive_query.rs
#	packages/rs-platform-version/src/version/v15.rs
#	packages/wasm-drive-verify/README_SINGLE_DOCUMENT.md
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…cument' into claude/single-document-block-time

# Conflicts:
#	packages/rs-drive/src/query/single_document_drive_query.rs
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 14df42a and cfc146a.

Files selected for processing: 14

  • packages/rs-drive/src/query/single_document_drive_query.rs
  • packages/rs-drive/src/query/single_document_drive_query/v0/mod.rs
  • packages/rs-drive/src/query/single_document_drive_query/v1/mod.rs
  • packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v1/mod.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v2.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v3.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v4.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v5.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v4.rs
  • packages/rs-platform-version/src/version/drive_versions/v10.rs
  • packages/rs-platform-version/src/version/v15.rs
  • packages/wasm-drive-verify/README_SINGLE_DOCUMENT.md

No actionable comments were generated in the recent review.

Walkthrough

Single-document query construction is now selected by platform method version. From protocol version 15, history lookups at a block time return the newest version at or before that time, while history documents that may be contested are refused. Proof verification and documentation are updated for these behaviors.

Changes: Single-document queries and proofs

Layer / File(s) Summary
Versioned path-query construction
packages/rs-drive/src/query/single_document_drive_query..., packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/*, packages/rs-platform-version/src/version/drive_versions/v10.rs
construct_path_query dispatches to version 0 or version 1 using the configured method version. Version 1 adds history-aware block-time queries and refuses those lookups when a history document may be contested. Tests cover version selection, query boundaries, refusal conditions, and unknown versions.
Historical proof verification
packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v1/mod.rs, packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v4.rs, packages/rs-platform-version/src/version/v15.rs, packages/wasm-drive-verify/README_SINGLE_DOCUMENT.md
Proof verification now handles historical block-time lookups. Tests cover returned versions, absent documents, verification at a different time, contested-history refusal, and protocol version 14. Protocol notes and the README describe the query and verification behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant SingleDocumentDriveQuery
  participant PlatformVersion
  participant construct_path_query_v1
  SingleDocumentDriveQuery->>PlatformVersion: Read single_document_path_query version
  PlatformVersion-->>SingleDocumentDriveQuery: Return configured version
  SingleDocumentDriveQuery->>construct_path_query_v1: Dispatch when version is 1
  construct_path_query_v1-->>SingleDocumentDriveQuery: Return PathQuery
Loading

Possibly related PRs

  • dashpay/platform#5835: Adds maybe-contested single-document proof verification and refusal behavior for history lookups at a block time.
  • dashpay/platform#5696: Changes how decision-proposal creates are classified as contested, which affects the contested status used by these query paths.

Suggested reviewers: thepastaclaw

Merge Risk: Minimal · previous review 14df4

This change fixes historical single-document lookups at a block time for protocol version 15 and leaves earlier protocol versions unchanged. No actionable merge-blocking risk was identified. The author should still plan rework against PR #4652, which changes the same history layout.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the primary change: single-document block-time lookups for protocol version 15.
Linked Issues check Passed The only directly linked issue is #5835, which is closed. It provides historical context only, so no active linked-issue coding requirements apply.
Out of Scope Changes check Passed The query generations, protocol-version table updates, proof verification, tests, and documentation support the PR’s stated protocol-15 historical lookup. The reported refusal for maybe-contested hist…
Docstring Coverage Passed Docstring coverage is 93.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Full details: Out of Scope Changes check

Explanation

The query generations, protocol-version table updates, proof verification, tests, and documentation support the PR’s stated protocol-15 historical lookup. The reported refusal for maybe-contested history lookups matches the current PR description. No unrelated changes are identified in the supplied change summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 93.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 15 functions across 13 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7d4ca2d and 14df42a.

Files selected for processing: 14

  • packages/rs-drive/src/query/single_document_drive_query.rs
  • packages/rs-drive/src/query/single_document_drive_query/v0/mod.rs
  • packages/rs-drive/src/query/single_document_drive_query/v1/mod.rs
  • packages/rs-drive/src/verify/single_document/verify_proof_keep_serialized/v1/mod.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/mod.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v1.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v2.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v3.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v4.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_document_method_versions/v5.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_verify_method_versions/v4.rs
  • packages/rs-platform-version/src/version/drive_versions/v10.rs
  • packages/rs-platform-version/src/version/v15.rs
  • packages/wasm-drive-verify/README_SINGLE_DOCUMENT.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@thepastaclaw

thepastaclaw commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit cfc146a. Normal review starts when eligible; priority review starts as soon as a slot is available.

Base automatically changed from claude/maybe-contested-single-document to v5.1-dev November 10, 2026 10:08
@github-actions github-actions Bot added this to the v5.1.0 milestone Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 10, 2026
…ument-block-time

v5.1-dev now holds #5835 as one squashed commit. Every conflict is with
that commit's content, which this branch already merged from #5835's
branch, so this branch's side is kept, plus the two verifier tests #5835
added after the head merged here: a document that may be contested
verified as a subset of a larger proof, and a document in both places
refused as a subset too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 2 only (queue backlog)

At head 4c578c4, the versioned query construction preserves earlier protocol behavior, but the newly supported historical MaybeContested lookup can return and authenticate a document submitted after the requested time. The missing contested-history regression coverage is consolidated into that blocking finding. Validation was static only; current CI reports successful Rust workspace, wasm32, Swift, Kotlin, and JavaScript checks, with review and hygiene checks pending.

🔴 1 blocking

Review provenance

Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 9: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 10: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The change adds version-gated historical document query logic and proof-verification handling across multiple Rust modules, but does not itself change consensus rules, cryptographic primitives, funds movement, or storage layout.
  • Phase 1 reviewers: not run (skipped for throughput: 15 PRs queued, above the 10 limit)
  • Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions are optional: fix them forward in a later PR rather than pushing another round just for them.
- Address every current finding in one push: self-review the full diff first, and don't push piecemeal.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `packages/rs-drive/src/query/single_document_drive_query/v1/mod.rs`:
- [BLOCKING] packages/rs-drive/src/query/single_document_drive_query/v1/mod.rs:32-39: Honor the block-time cutoff when the document is in the contest area
  The newly enabled historical `MaybeContested` query applies `block_time_ms` only to the ordinary-storage branch. `construct_contested_path_query` selects the document ID without a temporal condition, and `add_contested_document_to_primary_storage_0` stores a plain document item even when its type keeps history. A contender first stored at time 2000 can therefore be returned by a query at time 1000. The generation-1 verifier authenticates that exact lookup and returns the item without checking its time, so both whole-proof and subset verification can accept the incorrect historical answer. This combination was previously refused at PV15; lifting the refusal introduces the incorrect result. The documented exception for an explicitly `Contested` query does not satisfy the historical guarantee advertised for `MaybeContested`, whose caller does not know the storage location. Retain the unsupported-combination guard until Drive can guarantee the cutoff, or implement temporal handling for the contest branch. Add a history-bearing contested fixture covering times before and after its submission, whole-proof and subset verification, and absence while another contender exists; the new temporal tests currently store their documents only in ordinary history.

@github-actions

Copy link
Copy Markdown
Contributor

Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 10, 2026
… block time

A contest's area holds each contender as it was submitted, a plain item
with no time to compare, so a lookup that may be contested would find a
contender submitted after the block time there, and the proof would
verify. Generation 1 of the query refuses that lookup again, as #5835
did, until the contest's area can answer at a time. A lookup at a block
time outside a contest still works.

Tests: the refusal through the query and through the verifier, as a
whole proof and as a subset. The block time tests now look outside a
contest only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 10, 2026
…ument-block-time

#5825 added protocol version 15 note 30, for the asset lock input cap,
where this branch had its own note 30. Both are kept: the lookup at a
block time is note 31 now, and the drive table comment and
DRIVE_VERSION_V10's doc name it so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@QuantumExplorer
QuantumExplorer merged commit 570525d into v5.1-dev Nov 10, 2026
9 of 11 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/single-document-block-time branch November 10, 2026 11:36
QuantumExplorer added a commit that referenced this pull request Nov 10, 2026
…et-listings

Keeps #5838's v15 note 31 (a single document is looked up at a block time)
and moves the token listings note to 32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shumkov added a commit that referenced this pull request Nov 10, 2026
…-diff-spec

v5.1-dev added protocol v15 notes 29 (#5835, a document that may be
contested), 30 (#5825, the chain asset lock input cap) and 31 (#5838, a
single document at a block time). This branch's operator payout note was
29, so it becomes note 32, after them.

The v15.rs conflict is in the note list and in PLATFORM_V15's drive
comment: v5.1-dev's notes 29 to 31 come first, then this branch's note
renumbered to 32, and the drive comment keeps both sides' entries with
add_new_keys_to_masternode_identity 1 pointing at note 32. The
DRIVE_ABCI_METHOD_VERSIONS_V11 comment and the "(v15 note 32)" comment in
transition_to_version_15 follow the new number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QuantumExplorer added a commit that referenced this pull request Nov 10, 2026
…uests

Brings in #5556 (shared broadcast keeps uncertain submission outcomes),
#5823 (proven state transition outcome, getRecentStateTransitionStatus),
#5815, #5834, #5825, #5835, #5838 and #5839.

One textual conflict, in packages/rs-sdk/src/platform/transition/broadcast.rs
at the end of broadcast_with_retries. This branch (#5837) had the shared
broadcast fail over on a nonce-ahead answer and on a missing DPNS owner
(retry_with_additional_error, from #5562), and made is_address_nonce_ahead
public for the wallet's single-dispatch broadcast. #5556 replaced both
failovers with the plain shared retry, so that a concrete refusal ends
sending, with tests saying so (should_stop_on_nonce_rejection_without_
rebuilding_or_resending, should_stop_on_concrete_rejection_regardless_of_
node_failover_settings), and removed is_address_nonce_ahead and
is_missing_transition_owner. The file is taken as v5.1-dev has it.

The wallet's single-dispatch broadcast (broadcast_outcome::track_delivery)
still goes on to the next dispatch after a nonce-ahead answer, as #5837
meant: the classifier moves into broadcast_outcome.rs, unchanged, and its
doc no longer says the SDK's own broadcast fails over too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants