Skip to content

chore: bump rusqlite to 0.41 and refinery to 0.10 - #5833

Closed
PastaPastaPasta wants to merge 98 commits into
v5.1-devfrom
deps/rusqlite-0.41
Closed

PastaPastaPasta wants to merge 98 commits into
v5.1-devfrom
deps/rusqlite-0.41

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Stacked on #4652 (adopts dashpay/grovedb#1025); review only the top commit.

Issue being fixed or feature implemented

The wallet storage and the shielded store build rusqlite 0.38, which bundles a SQLite older than 3.54.0 through libsqlite3-sys 0.36. That SQLite is affected by RUSTSEC-2026-0459, so an advisory check flags every build of these crates. Because libsqlite3-sys declares links = "sqlite3", a build can hold only one version of it. Platform's rusqlite users and grovedb-commitment-tree therefore have to move together, and that grovedb change has now landed in dashpay/grovedb#1034.

What was done?

This branch sits on #4652 and will be rebased when #4652 changes.

How Has This Been Tested?

  • cargo check, cargo clippy -D warnings (all features, all targets) and cargo fmt --check for platform-wallet-storage and platform-wallet.
  • platform-wallet-storage tests (unit, bin, integration, doc): 1009 passed. platform-wallet shielded tests: 245 passed.
  • drive and drive-abci: cargo check --all-targets, with and without --all-features, and drive's util::grove_operations tests (136 passed).
  • Migrations, with each comparison made against a build of feat(drive)!: preserve composite document history across protocol activation #4652's head:
    • A database written by that build opens in this one with no migrations applied, and the dump is identical.
    • The v4.2-dev fixture upgrades through the same 13 migrations in both builds, and all 19 history rows match in version, name and checksum.
  • cargo deny check advisories: RUSTSEC-2026-0459 is gone. The other advisories reported are the same as on feat(drive)!: preserve composite document history across protocol activation #4652's head.

Breaking Changes

None in Platform's public API. Code that links rusqlite into the same build as these crates must use rusqlite 0.41, since only one libsqlite3-sys can be linked.

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 · 88c5925

  • Bots — thepastaclaw ✓
  • Self-review — posted; again after any push
  • Reviewer requests paused — your 5 review slots are occupied; this PR is excluded from reviewers' queues. Required approvals still count without a slot.
  • Build green
  • Approvals
    • files with no dedicated owner (Cargo.lock, Cargo.toml, book/src/contract-keywords/history.md and 31 more) — QuantumExplorer or shumkov
    • js-wasm-sdk (packages/js-evo-sdk/src/documents/facade.ts, packages/js-evo-sdk/tests/unit/facades/documents.spec.ts, packages/wasm-sdk/src/document_type_layout.rs and 2 more) — shumkov
    • rs-drive-abci (packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs, packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v3/mod.rs, packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/keep_history.rs and 16 more) — QuantumExplorer or shumkov
    • rs-drive (packages/rs-drive/grovedb-structure.json, packages/rs-drive/src/cache/system_contracts.rs, packages/rs-drive/src/drive/constants.rs and 67 more) — QuantumExplorer or shumkov
    • wallet-storage (packages/rs-platform-wallet-storage/Cargo.toml, packages/rs-platform-wallet-storage/tests/integration/sqlite_buffer_semantics.rs, packages/rs-platform-wallet-storage/tests/integration/sqlite_load_reconstruction.rs) — lklimek
    • rs-platform-wallet (packages/rs-platform-wallet/Cargo.toml) — HashEngineering or ZocoLini or llbartekll or romchornyi
    • rust-sdk (packages/rs-sdk/src/mock/requests.rs, packages/rs-sdk/src/platform/fetch.rs, packages/rs-sdk/src/platform/query.rs and 8 more) — lklimek or shumkov

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.

shumkov and others added 30 commits September 17, 2026 13:16
Store immutable revisions in per-document provable count trees with composite time and revision keys, and keep the current pointer in primary storage. Select the new write, estimate, reference, and ordinary-read layout at protocol 14; preserve older replay behavior.

Test would have caught this in CI: ✖ before fix, should_retain_both_replacements_in_the_same_block retained [1, 3]; ✔ after fix it retains [1, 2, 3]. cargo test -p drive --lib: 3579 passed, 5 existing ignored tests. cargo test -p drive --lib history: 84 passed.
Authenticate history pages and raw count-tree metadata separately, preserve complete cursors, and verify revision offsets and subtree absence at protocol 14. Keep released protocol selectors unchanged.

Test would have caught the pointer-size underestimate: RED before fix (57 estimated bytes versus 59 serialized, then 316 versus 317 at a flags encoding threshold), GREEN after including reference hops and the flags-length allowance. Selector, absence, deep-history fee, and migration checks pass; workspace all-features clippy passes.
Move legacy revision Items into per-document provable count trees with deterministic staged batches, preserve flags and sums, rewrite index references, and retain the existing cache refresh. Add a rollback-only offline-copy inventory benchmark and an actual 13-to-14 signed-operation upgrade/restart strategy.

Migration matrix and rollback/retry checks pass, including overwritten-revision gaps, empty types and deep summable histories. Upgrade strategy passes; activation dispatch, signed lifecycle writes and legacy repair tests pass. The parallel-suite repair test failed before its queries explicitly selected protocols 13 and 14 and passed after the fixture correction. Synthetic 256-revision migration: 686.34 ms in a loaded debug build; authentic testnet inventory and validator budget remain the release gate.
Add time/cursor and revision selectors to the versioned wire API and expose ordered entries with authenticated lifecycle counts across the Rust, WASM and JavaScript SDKs. Verify both GroveDB proofs and quorum signatures, including absent documents and empty pages, while preserving the legacy wire format for released protocols.

Validation: signed quorum/API round trip and tampering tests pass; proof verifier 267, DPP 4114 and Rust SDK 189 tests pass; version activation/replay tests pass. WASM Rust history tests pass (2), WASM unit suites pass (424 each in Node and Chrome), and Evo SDK unit suites pass (222 each in Node and Chrome); TypeScript lint/build and workspace all-features clippy pass.
Declare each history-root child as AllProvableCountTrees so propagation includes its authenticated count. Pin the four rewritten ancestors to an extra eight bytes each in should_charge_count_tree_overhead_when_propagating_history_roots.

Test would have caught this in CI: red before fix (568 replaced bytes versus 600 required), green after fix (1 passed).
Route history v1 through the four existing versioned entry points with known versions [0, 1], retaining explicit legacy adapters for replay. A legacy proof at protocol 14 now reports an unsupported query shape instead of UnknownVersionMismatch.

Authenticate the latest sequence from the resolved primary document before accepting ordinal revision offsets. Both Revision(3) and StartAtRevision(3) reject retained [1,3], including a valid proof of the otherwise-empty positional page. Pin positive selector results and the sixteen-byte decoder gate.

Test would have caught this in CI: should_report_legacy_history_as_unsupported_after_activation failed before dispatch routing and passed after; should_migrate_revisions_and_indexes_without_recovering_overwritten_revisions failed when fetch/prove/verify all accepted the empty gap page and passed after. All nine history tests and the migration gap regression passed in the Drive library suite.

BREAKING CHANGE: SDKs older than this release cannot read keep-history documents after protocol 14 activates. History v0 and block_time_ms point-in-time reads for keep-history types are rejected at that boundary.
Enumerate contracts through ascending fetch_contract_ids pagination. Allow only the reserved document-type keys 0, 1, and 2 with their permitted shapes, or declared index roots, and reject any other child before migrating that type. Assert that each document rewrites every collected index reference.

Expose the largest per-type index inventory and a conservative owned-buffer bound in the benchmark output. Structural-flag assertions now distinguish contract flags from writer flags for document trees and both populated and empty history roots.

Test would have caught this in CI: should_reject_unrecognised_type_children_during_migration_inventory failed before the explicit inventory validation and passed after. All four migration tests passed, including rollback/retry, overwritten revisions, depth measurements, and distinct structural flags.
Exercise fresh and migrated two-document histories through unique, non-unique, and summable indexes, with proved and unproved reads after reopen. Pin reference paths, hops, flags, current bodies, index sums, and primary counts and sums. Execute signed replace and transfer after activation on migrated documents and verify every resulting history page and proof.

Retain protocol 13 fee fixtures and add protocol 14 twins for direct, indexed, and estimated replacements with and without transactions. Remove the unused primary-path version argument and the redundant version argument in the legacy-only path-size helper.

Validation: cargo test -p drive --lib passed 3596 tests with 5 existing ignored tests; should_read_and_prove_fresh_and_migrated_history_through_every_index_kind and all three should_pin_protocol14_history tests passed. cargo test -p drive-abci --lib keep_history passed all 4 tests, including should_replace_and_transfer_migrated_history_through_signed_transitions. These are coverage additions and behavior-preserving helper cleanup, so no production-fix red-to-green claim is made.
Describe structure B, the composite time/sequence key, transactional migration, and history v1 in the protocol 14 documentation. Correct the Drive, ABCI methods, query, and verification annotations.

Documentation only; the existing protocol 12/13 selections and protocol 14 activation slots are unchanged, so no behavioral red-to-green test applies.

BREAKING CHANGE: SDKs older than this release cannot read keep-history documents after protocol 14 activates. History v0 and block_time_ms point-in-time reads for keep-history types are rejected after activation.
Add DocumentHistoryProofInfo with the verified page, original v1 response, and an independent verification method. Rust Fetch and mock serialization preserve the complete response; WASM and Evo SDK return a history-specific result with separate entriesProof and metadataProof fields.

Execute the actual ABCI history handler with prove: true against signed committed-block metadata, and verify its response unchanged for populated pages, empty selections, and authenticated absence. Re-verify the exported proof-info response without obtaining any missing proof from the original request flow.

Test would have caught this in CI: should_round_trip_history_api_through_quorum_and_grove_proof_verification failed before the fix because the exported generic proof omitted the entries proof, then passed with DocumentHistoryProofInfo. All three history_wasm_tests passed, including should_export_both_history_proofs_without_combining_them.

BREAKING CHANGE: getDocumentHistoryWithProofInfo now returns a history-specific result containing entriesProof and metadataProof instead of the generic single proof field. SDKs older than this release cannot read keep-history documents after protocol 14 activates.
Run the fresh/migrated index and signed-action matrices for SumTree as well as CountSumTree primary storage. Assert exact sums after create, replace, transfer, price update, and purchase, and exact counts where the primary tree is countable.

Validation: should_read_and_prove_fresh_and_migrated_history_through_every_index_kind passed all four fresh/migrated and countable/non-countable variants; cargo test -p drive-abci --lib keep_history passed all 4 tests with the expanded signed-action variants. These are protocol 14 coverage twins for the retained protocol 13 fixtures, with no production behavior change and therefore no production-fix red-to-green claim.
Document that migration errors deliberately halt the activation block for
all validators and that its transaction cannot commit partial migration.
Valid pre-14 state cannot reach the migration corruption checks.

No behavior changes; regression tests are not applicable to source comments.
The untracked PR draft carries the authentic-state release blocker checklist.
Require the GroveDB v1 envelope for both entries and metadata proofs in
Drive and the SDK verifier. Legacy envelopes return an unsupported proof
version error because they do not hash-bind the terminal count-tree
metadata. Keep legacy history v0 verification unchanged.

Regression tests were written and run before the version check:
RED -> GREEN: should_migrate_revisions_and_indexes_without_recovering_overwritten_revisions
rejects legacy metadata envelopes for both revision selectors on retained
[1,3], including a terminal count that still yields the committed root.
RED -> GREEN: should_reject_legacy_proof_envelopes_in_history_v1_through_sdk
rejects the same legacy format through signed response verification.
RED -> GREEN: should_round_trip_history_api_through_quorum_and_grove_proof_verification
rejects legacy entries envelopes while valid history v1 responses verify.

BREAKING CHANGE: SDKs older than this release cannot read keep-history
documents after protocol 14 activates.
Expose contract-enumeration operation costs through the existing versioned
helper and accumulate every page, including the terminal empty page.
Preserve the compatibility adapter and the older migration caller.

Replace the self-derived rewrite-length comparison with stored-reference
readback against each document's inventory. Compare targets, hop limits,
flags and sums, and halt activation if the match count differs. Include
readback costs in statistics and document transactional halt semantics.

RED -> GREEN: should_account_for_contract_enumeration_even_when_no_contracts_exist
previously reported zero work for a nonzero-cost terminal page.
RED -> GREEN: should_halt_migration_when_an_inventoried_index_reference_was_not_rewritten
failed against a behavior-preserving extraction of the old length check;
readback now rejects the unchanged reference and accepts the migrated one.

Pin incremental loaded bytes for 256 versus 16 revisions independently of
fixed inventory overhead, and retain migration/index/retry regressions.
The latest-version integration test freezes roots for the legacy storage
layout and expects a blockTime read to succeed. Preserve every assertion
under protocol 13, and add a protocol-14 twin covering its composite root,
all ten current documents, primary references, four retained timestamps,
history proofs and the explicit point-in-time rejection.

RED -> GREEN: cargo test -p drive --test query_tests_history previously
failed at the legacy root assertion (2 passed, 1 failed). The protocol-13
replay and protocol-14 twin now pass with the original first-version test
and setup test (4 passed). No production behavior was changed.
Return Error::Generic when a caller's history limit cannot fit in u16,
so the WASM SDK does not describe invalid input as a malformed proved
response. Keep the existing message and selector validation.

RED -> GREEN: should_report_oversized_history_limits_as_request_errors
was written first and failed for the old InvalidProvedResponse mapping.
It now passes for 65536 and u32::MAX; all three history_query_tests pass.
Match the enclosing verification module's server-or-verify feature gate
for the v1 implementation, its envelope validator and public wrapper.
Default drive-abci builds must not rely on test dependency feature
unification to make the dispatcher target available.

RED -> GREEN: cargo build --package drive-abci --locked reproduced E0599
for the missing verify_document_history_v1_impl before the change and
now succeeds. Independent no-default-feature checks for server and verify
also pass. This changes compile-time availability, not protocol behavior.
Assert that the retained source revision count equals the destination
history length before comparing revision bytes and beneficiary flags.
This prevents zip from silently accepting a shortened destination.

This strengthens existing migration coverage without changing production
behavior; no red-to-green claim applies. The full Drive suite exercises
this assertion through the summable-history migration fixtures.
The lifecycle of a keep-history document is derived from which metadata
keys are missing, so the verifier now asks GroveDB for explicit absence
proofs on the three exact-key lookups and gives the merged query the
finite limit that mode requires. A metadata proof must therefore account
for every queried key as a proven element or a proven absence.

The accompanying test proves a narrower metadata query, one that leaves
the current pointer or the history tree out, and checks that the full
query rejects it with an empty page. That proof was already rejected
before this change (the V1 verifier refuses a proof missing a queried
branch), so the test pins the guarantee rather than a red-to-green fix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both history fetch paths verify the two GroveDB proofs and no unproved
decoder exists, so a request built with proofs disabled could only fail
after the round trip. Refuse it in the encoder, with a unit test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The history v1 request, its cursor, the response lifecycle and its two
proofs carry comments now: they all describe a historical document (a
type with documentsKeepHistory), the cursor needs the revision because
revisions can share a block time, and the proofs are two because they
answer two GroveDB queries that cannot be merged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The timestamp-keyed v0 history query is gone from the wire and the
stack: no released network stores such history, and the protocol 14
migration leaves nothing for it to read. The proto reserves its field,
the DAPI build script and the versioned-message derive learn a
version range so the two history messages carry version 1 only, and
Drive, drive-abci and the proof verifier keep just the composite
readers behind their method-version dispatch, which now refuses the
query below protocol 14 with an explicit error. The protocol 14 query
bound starts at version 1.

The v1 response carries one proof object. GroveDB cannot merge the
two queries a history page needs, because the by-revision selectors
are served through a count-bound offset and PathQuery::merge refuses
offsets, so both GroveDB proofs travel inside the single proof's
payload in a small versioned envelope: a version byte, the metadata
proof behind a big-endian length, then a presence byte and, when
present, the entries proof behind its length, decoded with full
consumption. Callers see one proof, one signature and one metadata
block; only the drive verifier splits the payload. The wasm SDK's
proof-info result exposes that one proof.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
No behavior change: rustfmt on the Rust 1.98.1 toolchain that v4.2-dev
now pins sorts the syn import list differently, and CI checks formatting.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The structure B history query now lives in the v0 slot of
GetDocumentHistoryRequest and GetDocumentHistoryResponse (field 1)
instead of a v1 slot next to a reserved field. The timestamp-keyed
shape that earlier releases served under v0 is replaced rather than
versioned: no released network stores keep-history documents, and the
protocol 14 migration leaves nothing for it to read, so keeping the
old shape on the wire bought nothing.

The drive-abci query handler moves from v1 to v0 and the protocol 14
query bounds go back to version 0; a node below protocol 14 still
answers with an explicit unsupported error because Drive's history
reader refuses to run before activation. The proof verifier and the
Rust SDK follow the renamed variants. The gRPC derive macro no longer
needs version ranges, so that change is dropped.

No behavior change beyond the wire message names: the request fields,
the single proof envelope and the lifecycle block are unchanged, and
the existing history query tests cover the renamed path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The proof-version error and two test expectations said "history v1",
which now reads as the wire version the query no longer has. The
requirement is about the GroveDB envelope, so say that instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… field

The facade stub still answered with the entriesProof and metadataProof
pair that the WASM result no longer has; the public shape carries one
proof. The identity assertion passed regardless, so the fixture drifted
unnoticed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
verify_tenderdash_proof gained a platform version parameter upstream so
the envelope floor can be enforced per protocol version; the history
verifier now hands it through like every other proved query.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The history response now carries either the history page or the proof,
like every other proved query: `oneof result { History history; Proof
proof }` plus the response metadata. A proved response no longer repeats
the entries and lifecycle next to the proof, so the verifier stops
comparing claimed fields against the proof and simply returns what the
proof authenticates.

With the conventional shape the response goes back into the versioned
responses list and the hand-written proof and metadata accessors in
dapi-grpc are gone; the derive covers it.

The envelope floor that clients enforce per protocol version is applied
to each of the two GroveDB proofs inside the history proof payload, and
the quorum signature is checked with the nested-proof variant, since the
payload itself is not a GroveDB envelope.

Tests: the drive-abci round trip now also runs the unproved query and
checks the returned page against Drive, and the envelope-downgrade cases
expect the shared floor error; the claimed-field tampering cases no
longer apply because there are no claimed fields.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ation

The index-rewrite closure of the activation migration panicked on a
non-reference element. The inventory collector already refuses such a
leaf with the corruption error, so the arm cannot be reached, but the
block-execution path should never carry a panic where a deterministic
error is available. The closure now returns the same corruption error
and the migration propagates it.

No regression test: the collector rejects the only input that could
reach this arm, so there is no state that exercises it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ructure version

The places that had to know whether a keep-history type stores its
revisions in the document's own subtree or in the per-type history tree
compared the writer's method version against a literal, at fourteen
sites. A future version 2 of that writer would have fallen into the
legacy branch everywhere without a compile or runtime error.

The layout is now a named structure version, the way the rest of the
platform names stored shapes: `DriveStructureVersion` gains
`keep_history_storage`, `DRIVE_STRUCTURE_V1` keeps 0 and the new
`DRIVE_STRUCTURE_V2` that protocol 14's `DRIVE_VERSION_V9` points at sets
1. One helper, `KeepHistoryStorage::for_drive_version`, matches that
field into the two layouts and refuses anything else with
`UnknownVersionMismatch`; every path, reference, query and contract
hook reads the enum through it. The three reference helpers became
fallible for that and their callers propagate the error.

The platform-version test pins that the structure version and the
writer's method version flip together at protocol 14.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
shumkov and others added 11 commits November 9, 2026 16:28
Apply the exact wrapping requested by the final cargo fmt check. Formatting only, with no behavior change; the 34 platform-version tests passed before wrapping and are rerun afterwards.
A 5.0 node does not know GetDocumentHistoryRequest v1, and every node
before protocol 15 refuses it because the history layout it reads exists
only from protocol 15. The request inventory now lists the field with a
protocol 15 gate, and the transport declares it, so the SDK asks the
network for its version before sending a v1 history request, as it does
for the other 5.1 requests. Version 0 requests still declare nothing.

Test would have caught this in CI: ✖ before the fix
(should_declare_every_request_feature_older_nodes_do_not_know failed in
CI on 64963c0; with only the inventory entry,
should_need_the_declared_protocol_version_for_each_addition failed: v1
declared no version), ✔ after (rs-dapi-client 151 passed, dash-sdk
signed_version_tests 52 and history 28 passed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PV15 insert_contract v3 creates the empty [2] history tree for
DecisionProposals.proposal during latest-version genesis. This changes the
global transfer root and the nine root-containing settled hashes without
changing shielded validation hashes, complete execution results, fees or
nonces. Switching only the PV15 contract-insert slot back to v2 restores
every original value; the GroveDB pin control preserves the same delta.

Update only those ten approved expected values, retaining all test logic.
The existing tests caught the mismatch: 2 failed before, 2 passed after.
Merge abefc99, including storing-epoch refund pricing, the larger private
document store target and private contact request support. Use upstream's
PV15 tables as the base and retain the history layout, writer, query and
activation selections; released protocol tables remain unchanged.

Route history-owned contract insert/update v3 through the same instance
fee dispatcher as upstream's writers and remove obsolete fee-history-map
arguments from history callers. Cargo remains upstream plus GroveDB
0ea327d7, the merged retained-history support.

Keep upstream's independent private-store root delta and recompute only
the ten history-root expectations: latest genesis adds the empty [2]
DecisionProposals.proposal history tree through insert_contract v3.
The single-slot v2 control restores every upstream golden, and root-only
substitution preserves all nine validation/results/fees/nonces exactly.
Existing golden tests fail before the root update and pass 2/2 afterward.

All 28 persisted history query/proof/root captures are identical, all 30
current-upstream non-history observations match, and activation differs
only at the proposal history tree and marker. PV14 history goldens and
the five history integration tests remain unchanged and passing.
The history index matrix stores contract and writer flags in epochs 2 and
3 without recording their protocol versions. Storing-epoch refund pricing
now reads those records when an index update removes flagged bytes, so the
fixture fails with PathKeyNotFound for epoch 3's protocol-version key.

Record the selected producer protocol for both storing epochs using the
same batch setup as the fee tests. Preserve every document, storage flag,
index expectation and query/proof assertion; no production code or pinned
expected value changes.

Test would have caught this in CI: fails before the fixture records are
written (0 passed / 1 failed), passes after (1 passed), with the same
workspace all-features build and exact history index-matrix test.
Upstream #5809 increases private_document_store_target_chunk_bytes from
512 KiB to 1 MiB, changing the activation root when the current system
contracts are rebuilt. A single-setting 512 KiB control restores the
original root under GroveDB V4 and V5, including after commit.

Re-pin only the coordinator-approved activation root; test logic stays
unchanged. Bounded comparisons preserve retained profile/contactInfo
subtrees and isolate our proposal history marker and empty history tree
against current upstream.

The original test fails before this expectation update and passes after.
…ound

Rename the timestamp-keyed history fetch, proof and verifier entry points to
*_after_time and name their exclusive bound start_after_ms. Preserve method
version zero, call ordering, offset semantics and the released wire fields.

Pin protocol-14 response bytes for proved and unproved history, including a
positive unproved offset. All three captures pass unchanged before and after
the rename; the proved response pins the embedded GroveDB proof as well.

In-place changes to shipped generations: v0 fetch/prove/verify and history
query lowering only rename local bound identifiers; the ABCI v0 handler binds
the same wire field under the clearer name and calls the renamed entry points.
No storage, query or proof operations change.

BREAKING CHANGE: use fetch_document_history_after_time,
prove_document_history_after_time and verify_document_history_after_time in
place of their _legacy names.
Remove the timestamp-reader conversion from DocumentHistoryDriveQuery fetch,
prove, verify and path construction. These entry points now report only
known method version one; explicit after-time entry points keep version zero.
Remove the unused conversions and exercise timestamp history directly.

Node request-version bounds refuse wire v1 below protocol 15; wire v0 calls
only the timestamp methods. Client verification selects the producer version
from signed metadata. Binding and wallet call-site audits found no other
runtime use of the composite query API with protocol-14 tables.

Tests caught the unwanted conversion before removal: the path query and fetch
refusal tests failed on version zero, then passed after removing the adapter.
Test would have caught this in CI: ✖ before fix, ✔ after.
Drive history group: 149 passed; wasm32 SDK check passed. Released v0 reader
bodies and all protocol-version tables remain unchanged in this commit.
Assert storage_fee and processing_fee estimate >= applied separately for
existing and newly added history types through both direct update and
ApplyContract. Retain the total-fee bound and read-back checks proving that
estimation leaves storage untouched and applying persists the new contract.

All four combinations pass. This strengthens a regression test without
changing fee calculation or any runtime behavior; no failing-before behavior
fix is involved.
Fold timestamp query lowering back into its sole v0 caller now that composite
queries cannot use it. The implementation matches v5.1-dev except for the
exclusive-bound identifier; query construction and proof bytes are unchanged.

Document the low-level query builder's exclusive v0 and inclusive v1 bounds,
and clarify that composite history queries read the per-type tree and return
lifecycle metadata. Keep both builder generations and public result shapes.

Pin the exact mapped verifier-version mismatch for forged protocol-14 SDK
history responses, complementing Drive's typed known-version assertions.
rusqlite 0.41 bundles SQLite 3.54 through libsqlite3-sys 0.39, which clears
RUSTSEC-2026-0459 (SQLite page-cache disclosure on a mismatched -wal page
size) for the wallet storage and the shielded store.

- rusqlite 0.38 -> 0.41 in platform-wallet-storage and platform-wallet
  (optional dependency and dev-dependency), features unchanged.
- refinery 0.9.2 -> 0.10.0 and refinery-core 0.9.2 -> 0.10.1.
  refinery-core 0.10.1 is the first release that accepts rusqlite 0.41;
  refinery 0.10.0 accepts it through its ^0.10.0 requirement on the core.
  The sync Transaction/Query/Migrate traits, the rusqlite driver, the runner
  and the schema-history table are unchanged between the two versions.
- Connection::commit_hook and Connection::trace_v2 now take &mut self and
  trace_v2 takes a closure and returns a Result, so the two tests that
  install them hold a mutable connection guard and check the result.
- The grovedb dependencies move to dashpay/grovedb 9274f1112fa2, the merge
  of the change that moves grovedb-commitment-tree to rusqlite 0.41 (#1034).
  On top of the previous pin that revision also carries grovedb #1033,
  which adds BatchApplyOptions::allow_replacement_accounting. Drive's three
  BatchApplyOptions initializers set it to false, so batch costs, estimates,
  stored elements and hashes stay as before.

Cargo.lock moves rusqlite, libsqlite3-sys, hashlink, refinery, refinery-core
and refinery-macros, and the grovedb source revision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v5.1.0 milestone Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 139 files, which is 39 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9b36712 and 88c5925.

Files ignored due to path filters: 4

  • Cargo.lock is excluded by !**/*.lock
  • packages/rs-drive-abci/src/query/document_history/fixtures/wire-v0-offset.bin is excluded by !**/*.bin
  • packages/rs-drive-abci/src/query/document_history/fixtures/wire-v0-proof.bin is excluded by !**/*.bin
  • packages/rs-drive-abci/src/query/document_history/fixtures/wire-v0-unproved.bin is excluded by !**/*.bin
Files selected for processing: 139

  • Cargo.toml
  • book/src/contract-keywords/history.md
  • packages/dapi-grpc/build.rs
  • packages/dapi-grpc/clients/drive/v0/nodejs/drive_pbjs.js
  • packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js
  • packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js
  • packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h
  • packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m
  • packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py
  • packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts
  • packages/dapi-grpc/clients/platform/v0/web/platform_pb.js
  • packages/dapi-grpc/protos/platform/v0/platform.proto
  • packages/dapi-grpc/test/unit/documentHistoryWire.spec.js
  • packages/dapi-grpc/tests/document_history_wire.rs
  • packages/dash-platform-queries/src/documents/document_history_query.rs
  • packages/js-evo-sdk/src/documents/facade.ts
  • packages/js-evo-sdk/tests/unit/facades/documents.spec.ts
  • packages/rs-dapi-client/src/transport/grpc.rs
  • packages/rs-dapi-client/tests/request_inventory.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v3/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/keep_history.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/nullifier_batch_guard.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/yes_no_tests/decision_proposal_tests.rs
  • packages/rs-drive-abci/src/query/document_history/mod.rs
  • packages/rs-drive-abci/src/query/document_history/v0/mod.rs
  • packages/rs-drive-abci/src/query/document_history/v1/mod.rs
  • packages/rs-drive-abci/src/query/document_history/v1/tests.rs
  • packages/rs-drive-abci/src/query/document_history/wire_tests.rs
  • packages/rs-drive-abci/src/query/shielded/encrypted_notes/v0/mod.rs
  • packages/rs-drive-abci/tests/document_outcome.rs
  • packages/rs-drive-abci/tests/query_request_errors/offset_controls.rs
  • packages/rs-drive-abci/tests/query_request_errors/offsets.rs
  • packages/rs-drive-abci/tests/strategy_tests/test_cases/upgrade_fork_tests.rs
  • packages/rs-drive-abci/tests/supporting_files/contract/note/note-contract-keep-history.json
  • packages/rs-drive-proof-verifier/src/proof.rs
  • packages/rs-drive-proof-verifier/src/types.rs
  • packages/rs-drive/grovedb-structure.json
  • packages/rs-drive/src/cache/system_contracts.rs
  • packages/rs-drive/src/drive/constants.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/mod.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/chained_query_e2e_tests.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v1/mod.rs
  • packages/rs-drive/src/drive/contract/insert/insert_contract/v3/mod.rs
  • packages/rs-drive/src/drive/contract/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/v1/mod.rs
  • packages/rs-drive/src/drive/contract/update/update_contract/v3/mod.rs
  • packages/rs-drive/src/drive/document/cost/mod.rs
  • packages/rs-drive/src/drive/document/cost/tests.rs
  • packages/rs-drive/src/drive/document/cost/writes.rs
  • packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/mod.rs
  • packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v2/mod.rs
  • packages/rs-drive/src/drive/document/derived_index_values.rs
  • packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/mod.rs
  • packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v1/mod.rs
  • packages/rs-drive/src/drive/document/get_fetch/fetch_document_history/mod.rs
  • packages/rs-drive/src/drive/document/get_fetch/fetch_document_history/v0/mod.rs
  • packages/rs-drive/src/drive/document/get_fetch/fetch_document_history/v1/mod.rs
  • packages/rs-drive/src/drive/document/index_level_tree_types.rs
  • packages/rs-drive/src/drive/document/insert/add_document_to_primary_storage/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document_to_primary_storage/v0/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_document_to_primary_storage/v1/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/mod.rs
  • packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v1/mod.rs
  • packages/rs-drive/src/drive/document/layout.rs
  • packages/rs-drive/src/drive/document/migration/index_tests.rs
  • packages/rs-drive/src/drive/document/migration/mod.rs
  • packages/rs-drive/src/drive/document/migration/tests.rs
  • packages/rs-drive/src/drive/document/mod.rs
  • packages/rs-drive/src/drive/document/paths.rs
  • packages/rs-drive/src/drive/document/private_document_store/mod.rs
  • packages/rs-drive/src/drive/document/prove/prove_document_history/mod.rs
  • packages/rs-drive/src/drive/document/prove/prove_document_history/v0/mod.rs
  • packages/rs-drive/src/drive/document/prove/prove_document_history/v1/mod.rs
  • packages/rs-drive/src/drive/document/query/fetch_document_history_query/mod.rs
  • packages/rs-drive/src/drive/document/query/fetch_document_history_query/v0/mod.rs
  • packages/rs-drive/src/drive/document/query/fetch_document_history_query/v1/mod.rs
  • packages/rs-drive/src/drive/document/structure.rs
  • packages/rs-drive/src/drive/document/update/internal/update_document_for_contract_operations/mod.rs
  • packages/rs-drive/src/drive/document/update/internal/update_document_for_contract_operations/v2/mod.rs
  • packages/rs-drive/src/drive/document/update/mod.rs
  • packages/rs-drive/src/query/document_history_drive_query.rs
  • packages/rs-drive/src/query/document_history_drive_query_tests.rs
  • packages/rs-drive/src/query/grove_version_compatibility_tests.rs
  • packages/rs-drive/src/query/mod.rs
  • packages/rs-drive/src/query/primary_key_path_query/mod.rs
  • packages/rs-drive/src/query/primary_key_path_query/v0/mod.rs
  • packages/rs-drive/src/query/primary_key_path_query/v1/mod.rs
  • packages/rs-drive/src/query/single_document_drive_query.rs
  • packages/rs-drive/src/structure/tests.rs
  • packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs
  • packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs
  • packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs
  • packages/rs-drive/src/util/test_helpers/history_proof.rs
  • packages/rs-drive/src/util/test_helpers/mod.rs
  • packages/rs-drive/src/verify/document/verify_document_history/mod.rs
  • packages/rs-drive/src/verify/document/verify_document_history/tests.rs
  • packages/rs-drive/src/verify/document/verify_document_history/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_document_history/v1/mod.rs
  • packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/mod.rs
  • packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs
  • packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v1/mod.rs
  • packages/rs-drive/src/verify/shielded/verify_shielded_encrypted_notes/v0/mod.rs
  • packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/mod.rs
  • packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs
  • packages/rs-drive/tests/query_tests_history.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_method_versions/v11.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/mod.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_query_versions/v3.rs
  • packages/rs-platform-version/src/version/drive_versions/drive_contract_method_versions/v5.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/rs-platform-version/tests/document_history_storage_versions.rs
  • packages/rs-platform-wallet-storage/Cargo.toml
  • packages/rs-platform-wallet-storage/tests/integration/sqlite_buffer_semantics.rs
  • packages/rs-platform-wallet-storage/tests/integration/sqlite_load_reconstruction.rs
  • packages/rs-platform-wallet/Cargo.toml
  • packages/rs-sdk/src/mock/requests.rs
  • packages/rs-sdk/src/platform/fetch.rs
  • packages/rs-sdk/src/platform/query.rs
  • packages/rs-sdk/src/sdk.rs
  • packages/rs-sdk/src/sdk/signed_version_tests.rs
  • packages/rs-sdk/src/sdk/signed_version_tests/document_history.rs
  • packages/rs-sdk/tests/proof_options.rs
  • packages/rs-sdk/tests/vectors/document_history/README.md
  • packages/rs-sdk/tests/vectors/document_history/pv14_time.json
  • packages/rs-sdk/tests/vectors/document_history/pv15_cursor.json
  • packages/rs-sdk/tests/vectors/document_history/pv15_revision.json
  • packages/wasm-sdk/src/document_type_layout.rs
  • packages/wasm-sdk/src/queries/document.rs
  • packages/wasm-sdk/tests/unit/document-type-layout.spec.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 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

@github-actions

Copy link
Copy Markdown
Contributor

🌳 GroveDB structure

This pull request changes the described GroveDB structure. Open it in the structure viewer: new nodes glow, removed ones stay as ghosts, and the tour walks through each change.

Added (3 nodes)

  • contracts.contract.documents.document_type.history

Changed (3 nodes)

  • contracts.contract.documents.document_type.primary_key.document
  • contracts.contract.documents.document_type.primary_key.document.latest
  • contracts.contract.documents.document_type.primary_key.document.revision

Compared abefc99cae with 88c59257fc. Updated at 2026-11-10T03:16:52.238Z

@github-actions

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-11-10T03:17:06.488Z

@github-actions

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
@PastaPastaPasta PastaPastaPasta changed the title chore(deps): bump rusqlite to 0.41 and refinery to 0.10 chore: bump rusqlite to 0.41 and refinery to 0.10 Nov 10, 2026
@thepastaclaw

thepastaclaw commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 88c5925) · triage: critical

@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 1 + Phase 2

Static review of the complete assigned range found no actionable in-scope defects. The rusqlite/refinery updates align with the pinned GroveDB dependency, and all three Drive batch paths explicitly preserve the prior replacement-accounting behavior. No code checks have failed; Rust workspace tests and several integration suites remain in progress or queued.

Review provenance

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

  • Triage: critical by gpt-6.1-sol (effort low) — The large diff changes critical protocol and persisted-state surfaces, including document-history version dispatch and proof verification in rs-drive, protocol-upgrade handling in rs-drive-abci, and wallet storage migration compatibility.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort xhigh); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort xhigh); agent phase2-reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
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
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

/self-reviewed 88c5925

@github-actions

Copy link
Copy Markdown
Contributor

Missing human approval. Automatic reviewer requests are paused and this PR is excluded from reviewers' queues. Merge, close, or draft another active PR by this author to free a review slot. Required human review can be satisfied without a slot; once all merge requirements are met, PR Hygiene passes.
Full checklist in the description.

@github-actions github-actions Bot added too-many-open-prs Beyond the author's 5 open PRs; waits for one to merge before a human is asked. and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 10, 2026
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Superseded by #5829, which landed the same rusqlite 0.41 / refinery 0.10 move together with the grovedb pin. Closing this one. Thanks!


🤖 Posted autonomously by Claude on behalf of pasta.

@PastaPastaPasta
PastaPastaPasta deleted the deps/rusqlite-0.41 branch November 10, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

too-many-open-prs Beyond the author's 5 open PRs; waits for one to merge before a human is asked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants