Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
002bc32
feat(drive)!: separate retained document history from primary storage
shumkov Sep 10, 2026
3eb0156
feat(drive)!: prove composite document history and lifecycle counts
shumkov Sep 10, 2026
e901558
feat(drive-abci)!: migrate retained histories at protocol activation
shumkov Sep 10, 2026
26d5f78
feat(sdk)!: expose authenticated document history v1
shumkov Sep 10, 2026
108a501
fix(drive): charge provable counts when propagating history roots
shumkov Sep 10, 2026
145f653
fix(drive): dispatch history versions and authenticate revision offsets
shumkov Sep 10, 2026
bded9a6
fix(drive): validate the complete history migration inventory
shumkov Sep 10, 2026
9a2e8e1
test(drive): cover migrated indexes and signed history updates
shumkov Sep 10, 2026
4288249
docs(version): document the keep-history activation boundary
shumkov Sep 10, 2026
7a11092
fix(sdk): retain both proofs in document history proof info
shumkov Sep 10, 2026
e49b7e5
test(drive): pin sum-only primary trees across history activation
shumkov Sep 10, 2026
fb52284
docs(drive-abci): explain activation migration halt semantics
shumkov Sep 10, 2026
40daacc
fix(drive): require GroveDB v1 envelopes for history v1
shumkov Sep 10, 2026
631f28b
fix(drive): account for and verify history migration operations
shumkov Sep 10, 2026
52f4522
test(drive): preserve legacy history replay and cover protocol 14
shumkov Sep 10, 2026
ed8ac42
fix(sdk): classify oversized history limits as input errors
shumkov Sep 10, 2026
8dcb080
fix(drive): expose history verification in server builds
shumkov Sep 10, 2026
66dd94f
test(drive): compare migration revision counts before zipping
shumkov Sep 10, 2026
39b6126
fix(drive): verify history lifecycle metadata with absence proofs
shumkov Sep 12, 2026
44f807b
fix(sdk): reject proof-disabled document history queries before sending
shumkov Sep 12, 2026
53d1fa4
docs(dapi-grpc): say what the history v1 messages describe and why
shumkov Sep 13, 2026
73b66f7
feat(dapi)!: serve document history as one v1 query with one proof
shumkov Sep 13, 2026
083f165
style(macros): order imports the way rustfmt 1.98 expects
shumkov Sep 13, 2026
3a5f53b
feat(dapi)!: replace the v0 document history query in place
shumkov Sep 13, 2026
afef5ee
fix(drive): name the envelope requirement without a wire version
shumkov Sep 13, 2026
be6cb2e
test(js-evo-sdk): stub the history proof result with its single proof…
shumkov Sep 13, 2026
d568257
fix(sdk): pass the platform version to the history tenderdash check
shumkov Sep 13, 2026
09b3e7c
feat(dapi)!: answer document history with the usual result oneof
shumkov Sep 13, 2026
a95600c
fix(drive): report an unexpected index leaf as corruption during migr…
shumkov Sep 13, 2026
a3df992
refactor(drive)!: select the keep-history storage layout through a st…
shumkov Sep 15, 2026
a803159
refactor(dapi)!: call the history query's selection a filter
shumkov Sep 15, 2026
75bc2bd
test(drive): re-pin the history fixture roots after the contract vers…
shumkov Sep 15, 2026
18cb24a
chore(drive): drop the migration benchmark example and its cost counters
shumkov Sep 15, 2026
8b44ca3
refactor(drive)!: keep the history layout out of shipped generations
shumkov Sep 15, 2026
2c25b31
fix(drive-abci): answer refused history reads as invalid arguments
shumkov Sep 15, 2026
20fceab
refactor(drive): split the history module by concern
shumkov Sep 16, 2026
b00d2e5
docs(drive): say what the protocol 14 storage generations change
shumkov Sep 16, 2026
db16d2c
refactor(drive)!: verify proved cursors through a protocol 14 generation
shumkov Sep 16, 2026
43f0069
fix(wasm-sdk): return the common proof response for document history
shumkov Sep 16, 2026
40a28bb
feat(drive): keep the legacy history readers beside the history query
shumkov Sep 16, 2026
b46ba7b
refactor(drive): version the document history readers like the writers
shumkov Sep 16, 2026
252d6ab
refactor(drive): organize the document history query like the other q…
shumkov Sep 16, 2026
bbade06
fix(drive-abci): guard history migration activation
shumkov Sep 16, 2026
1a3cdd6
fix(drive): keep history query builder available
shumkov Sep 16, 2026
f4b84eb
refactor(drive): route history layout by method version
shumkov Sep 16, 2026
f7ad6b8
refactor(drive): version primary key history queries
shumkov Sep 16, 2026
f5f36d1
style(drive): group document path imports
shumkov Sep 16, 2026
cca128a
test(drive): cover writes across history migration
shumkov Sep 16, 2026
fdc902d
refactor(wasm-sdk): type document history results
shumkov Sep 16, 2026
2a8bdd2
fix(history): address review compatibility gaps
shumkov Sep 16, 2026
b51c712
fix(history): retain revisionless legacy documents
shumkov Sep 16, 2026
ad35d69
fix(drive): account for summable index references
shumkov Sep 17, 2026
d7d682b
feat(platform)!: activate keep-history storage at protocol version 15
shumkov Sep 18, 2026
7615290
fix(drive): keep the history time bound inclusive on the legacy layout
shumkov Sep 18, 2026
7c5c485
chore(dapi-grpc): regenerate the checked-in clients
shumkov Sep 18, 2026
b1442a7
refactor(drive): derive the reference bucket tree type in one place
shumkov Sep 19, 2026
f24b021
chore(drive): merge v5.1-dev into composite history
shumkov Oct 21, 2026
cb08ff9
fix(sdk): seed unpinned devnets at protocol 14
shumkov Oct 21, 2026
5c91ebf
fix(drive): reject unknown document history writer layouts
shumkov Oct 21, 2026
bd181a3
docs(grpc): describe document history requests without release narration
shumkov Oct 21, 2026
cd4b47a
test(drive): cover upstream index kinds in history migration
shumkov Oct 21, 2026
f1b8726
fix(drive): size history pointer read estimates like writes
shumkov Oct 21, 2026
4a3b50e
fix(drive): assert the history proof envelope floor
shumkov Oct 21, 2026
87c1fb6
test(drive): exercise contract writers at protocol 14 and 15
shumkov Oct 21, 2026
ea00051
style(history): keep protocol assertions and comments precise
shumkov Oct 21, 2026
fd4825c
fix(wasm-sdk): expose retained document history layout types
shumkov Oct 21, 2026
18aadd9
refactor(drive): version the document history layout independently
shumkov Oct 21, 2026
37e16c3
fix(sdk): send history filters before protocol discovery
shumkov Oct 21, 2026
90594f0
fix(drive): accept revision 65536 in history revision filters
shumkov Oct 22, 2026
d3a1182
fix(wasm-sdk): accept returned history entries as cursors
shumkov Oct 22, 2026
8ee4167
fix(dapi): preserve document history wire version zero
shumkov Oct 22, 2026
452dd1c
fix: gate versioned document history queries at activation
shumkov Oct 22, 2026
6beb493
fix(sdk): use version one for retained document history
shumkov Oct 22, 2026
93e90fd
style(drive-abci): drop a same-type conversion in the history offset …
shumkov Oct 22, 2026
342eced
chore: merge v5.1-dev into retained document history
shumkov Oct 27, 2026
b40e744
build: pin GroveDB branch-local count offsets
shumkov Oct 27, 2026
3effb5f
feat(version): select GroveDB V5 for protocol 15
shumkov Oct 27, 2026
5a80fbe
fix(proofs): select document layouts from the signed producer version
shumkov Oct 27, 2026
b6757c4
feat(history): serve revision pages in one GroveDB proof
shumkov Oct 27, 2026
38a4041
test(version): preserve query and activation behavior with GroveDB V5
shumkov Oct 27, 2026
01ff656
fix(sdk): verify history using the signed producer version
shumkov Oct 27, 2026
a251681
test(drive): preserve released execution-proof query layouts
shumkov Oct 28, 2026
20dd12c
test(drive): bound keep-history contract update fees
shumkov Oct 28, 2026
2c859b0
fix(wasm-sdk): return errors for missing history proof metadata
shumkov Oct 28, 2026
3c73a98
chore(history): merge current v5.1-dev and merged GroveDB history sup…
shumkov Nov 9, 2026
3b7053e
docs(history): clarify PV15 estimates and producer proof layout
shumkov Nov 9, 2026
d124bcc
test(history): verify legacy proofs with current Grove rules
shumkov Nov 9, 2026
64963c0
style(history): format Grove activation assertions
shumkov Nov 9, 2026
aa01294
fix(dapi-client): declare that document history v1 needs protocol 15
shumkov Nov 9, 2026
d9ea5f8
test(drive-abci): account for retained-history trees in genesis roots
shumkov Nov 9, 2026
4ce0707
chore(history): merge current v5.1-dev and storing-epoch refund pricing
shumkov Nov 9, 2026
604d9cc
test(drive): record storing epochs in the history index fixture
shumkov Nov 9, 2026
5ecec6d
test(drive-abci): refresh activation root for upstream private stores
shumkov Nov 9, 2026
4ba004d
refactor(drive)!: name timestamp history APIs after their exclusive b…
shumkov Nov 9, 2026
41bca10
refactor(drive): require composite method versions for history queries
shumkov Nov 9, 2026
e2b30e1
test(drive): bound storage and processing estimates independently
shumkov Nov 9, 2026
c067914
refactor(drive): finish history query boundary cleanup
shumkov Nov 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ members = [
[workspace.dependencies]
secp256k1 = { version = "=0.33.1", features = ["rand", "serde", "recovery"] }
bincode = { package = "grovedb-bincode", version = "=2.1.0" }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c", default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-merk = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c", default-features = false }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "12adbd357522a03efad4ae609499c93fe8cc3e2c" }
grovedb = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df", default-features = false }
grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-merk = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df", default-features = false }
grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "0ea327d7260692bda575fd208b30be5fc2f511df" }
dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "c9aeac0d0dcbd4b91d780a70d61b9bb693199ca4" }
dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "c9aeac0d0dcbd4b91d780a70d61b9bb693199ca4" }
dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "c9aeac0d0dcbd4b91d780a70d61b9bb693199ca4" }
Expand Down
19 changes: 17 additions & 2 deletions book/src/contract-keywords/history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# History

Platform can keep two kinds of history for a document type. `documentsKeepHistory` keeps every version of each document in Drive, under the document itself, so an application can read what a document said at any earlier time. The three `keeps*History` flags record events instead: each transfer, purchase or price update of a document becomes a record in the document history system contract, where it can be queried by document, by contract, by identity and by time.
Platform can keep two kinds of history for a document type. `documentsKeepHistory` keeps every version of each document in Drive, so an application can read what a document said at any earlier time. The three `keeps*History` flags record events instead: each transfer, purchase or price update of a document becomes a record in the document history system contract, where it can be queried by document, by contract, by identity and by time.

## `documentsKeepHistory`

Expand Down Expand Up @@ -35,13 +35,28 @@ Every edit of a profile adds a version, and every earlier version stays readable

### How it works

- Each document is stored as a small tree of its own: every version the document has had, keyed by the block time it was written at, and a pointer to the current one. A query by id or through an index sees the current version.
- Through protocol version 14, each document is stored as a small tree of its own, with versions keyed by block time and a pointer to the current one. From protocol version 15, versions live in a separate history tree for the document type and retain both time and revision, including edits sharing a block time. A query by id or through an index sees the current version.
- Every write that changes the document adds a version: a replace, and also a transfer, a price update or a purchase.
- Nothing is ever removed. Drive refuses to delete a document whose type keeps history, so its owner's delete is refused (10404 from protocol version 14; before it, the delete failed inside Drive as an internal error), and the type can have neither moderator deletion nor a `ttl`.
- The `getDocumentHistory` query returns a document's versions from a given time on, each with the block time it was written at, at most 10 per request, and with a proof when asked.
- Every version stays stored, paid for by the write that added it.
- A doctype-level sum or average (`documentsSummable`, `documentsAverageable`) counts only each document's current version. See [Counts, Sums and Averages](aggregates.md).

`getDocumentHistory` uses request and response version 0 through protocol version
14. Its `start_at_ms` is exclusive, `offset` skips entries, and response entries
contain `date` and document `value` bytes. Proved requests require an absent or
zero offset.

From protocol version 15, the query accepts version 1 only. It requires exactly
one filter: inclusive `start_at_ms`, exclusive `start_after` with both time and
revision, inclusive `start_at_revision`, or exact `revision`. Unproved responses
carry entries with time, revision and document bytes, plus lifecycle metadata;
proved responses carry one signed proof object containing one GroveDB proof of
the page and lifecycle.
The Rust SDK and its WASM/JavaScript bindings send version 1 and require proofs.
On an updated node running protocol version 14 this returns the standard
unsupported-query-version error; the SDK does not fall back to version 0.

### Rules at registration

All refusals below are `InvalidContractStructure` (10231).
Expand Down
6 changes: 4 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,13 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// - Bumping the matching `FeatureVersionBounds.max_version`
// to 1 in `rs-platform-version`.
// - Implementing the v1 dispatch arm in `drive-abci`.
const VERSIONED_AT_V1_REQUESTS: [&str; 2] = [
const VERSIONED_AT_V1_REQUESTS: [&str; 3] = [
"GetDocumentsRequest",
"GetDocumentHistoryRequest",
"GetIdentityByNonUniquePublicKeyHashRequest",
];
const VERSIONED_AT_V1_RESPONSES: [&str; 1] = ["GetDocumentsResponse"];
const VERSIONED_AT_V1_RESPONSES: [&str; 2] =
["GetDocumentsResponse", "GetDocumentHistoryResponse"];

// Derive VersionedGrpcMessage on requests
for msg in VERSIONED_REQUESTS {
Expand Down
Loading
Loading