Repository navigation
build!: bump grovedb to 6.1.0 - #5414
Conversation
Move every grovedb crate from 5cb0962a (dashpay/grovedb#1020) to the 6.1.0 release, fc7028d8, which adds dashpay/grovedb#1021 on GROVE_V4 (protocol version 14): a reference written or refreshed in the same batch as an update of its target item commits to the bytes the target stores, so the index entries of a summable document updated in a later epoch with a size change no longer commit to bytes it never stores; and a replacement whose flags callback leaves the flags unchanged is charged for the bytes it stores instead of failing with a storage cost mismatch. The TokenHistory version-item attribution test pinned that mismatch at the latest protocol version; it now pins it at protocol version 13 (GROVE_V3) and checks that protocol version 14 applies the replacement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
|
🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.
Commit 7fd6f3c. Normal review starts when eligible; priority review starts as soon as a slot is available. |
Basic explanation
This moves Platform from a GroveDB development commit to the GroveDB 6.1.0 release. The only change it brings over the commit Platform already uses is a fix to how GroveDB stores the index entries of summable documents.
Today, when a document of a type with
documentsSummableis updated in a later epoch and its stored size changes, its index entries record a hash of bytes the document never stores. Proofs of reads that go through those index entries then fail to verify on the client. With 6.1.0 the index entries record the bytes that are actually stored, so those proofs verify.Issue being fixed or feature implemented
v5.0-devpins GroveDB at5cb0962a(dashpay/grovedb#1020). GroveDB 6.1.0 (fc7028d8, release notes) adds two commits on top of it:GROVE_V4(protocol version 14).A document of a
documentsSummabletype is stored as anItemWithSumItem. Its index entries are references to it (aReferenceWithSumItemfor a summable index), which document update v1 refreshes (or rewrites) in the same GroveDB batch that rewrites the document. When the batch both updates a target and writes a reference to it, GroveDB predicts the target's final bytes so the reference can commit to their hash. The old prediction assumed a sum item keeps its stored storage flags. Drive's flags merge changes them when an update in a later epoch changes the size (SingleEpochOwnedbecomesMultiEpochOwned), so the reference committed to bytes that are never stored. The fix applies from protocol version 14; protocol version 13 keeps the old behaviour for replay.Before (summable document created in epoch 0, updated in epoch 2 with a longer string; its index value unchanged):
After:
The same release also stops a replacement whose flags callback answers "unchanged" from failing with
storage_cost cost mismatchwhen the new value's flags have another length. Drive has hit that one: replacing the flagged TokenHistory version item with an unflagged one failed this way, which the protocol version 14 upgrade avoids andshould_attribute_unflagged_replacement_cost_mismatch_to_token_history_version_itempins. It also makes the batch refuse a target whose write stores other bytes than the ones predicted for a reference to it.Before / after for that replacement (version item
Item(1, SingleEpochOwned(3, ..))replaced byItem(2, None)):What was done?
grovedb*crate inCargo.tomlfrom5cb0962atofc7028d8(tagv6.1.0).Cargo.lock: the 16 GroveDB packages move to 6.1.0 at the new commit. Nothing else re-resolves.should_attribute_unflagged_replacement_cost_mismatch_to_token_history_version_itemasserted the mismatch at the latest protocol version. It now asserts it at protocol version 13 and checks that protocol version 14 applies the replacement.How Has This Been Tested?
cargo check -p drive -p drive-abci --all-targetscargo test -p drive --libfiltered todrive_document_sum_query,composite_query_e2e,chained_query_e2e,shared_prefix_aggregationandexpiration_tests: 117 passed.cargo test -p drive-abci --libfiltered to the batch documentreplacement,property_constraints,transfer,gas_sponsorshipanddeletiontests andtoken_history_storage_flags: 164 passed after the test change (the attribution test was the one failure before it).cargo test -p drive-abci --lib -- execution::platform_events::protocol_upgrade: 73 passed.Breaking Changes
Consensus at protocol version 14 only, which is not on mainnet. A node on this build computes a different root hash than a node on the previous pin for a block that updates a summable document in a later epoch with a size change (the corrected index reference). It also accepts the flags-length replacement described above where the previous pin failed the batch. Protocol versions 13 and earlier run
GROVE_V1toGROVE_V3and are unchanged. A devnet or testnet already running protocol version 14 on a 5.0 beta should upgrade all of its nodes together.Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
7fd6f3c/skip-botsproceeds without the ones not yet reported/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit