Document caching shard store + test drop/flush different behavior.#185
Draft
dannywillems wants to merge 4 commits into
Draft
Document caching shard store + test drop/flush different behavior.#185dannywillems wants to merge 4 commits into
dannywillems wants to merge 4 commits into
Conversation
Adds the ability to mark a checkpoint for retention so that it is exempt from automatic pruning of excess checkpoints. A retained checkpoint's root, and witnesses for marked leaves at or before it, remain computable even after it has aged more than `max_checkpoints` behind the tip of the tree. Retention is an explicit operation, decoupled from leaf marking: `ShardTree::ensure_retained` records a checkpoint id in a new retention set on the `ShardStore` (`add_retained_checkpoint` / `remove_retained_checkpoint` / `retained_checkpoints`), and `ShardTree::remove_retained_checkpoint` releases it. `prune_excess_checkpoints` excludes retained checkpoints from the `max_checkpoints` budget and never removes them. The witness-supporting nodes survive because the retained checkpoint's own `CHECKPOINT` retention keeps the subtree straddling its position from collapsing; no `Reference` retention is required. See zcash#183. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
dannywillems
marked this pull request as draft
July 2, 2026 09:18
Explain the deferred-action mechanism in `CachingShardStore`. The store serves reads and additive writes from its in-memory cache and, on `flush`, reconstructs the backend by re-writing the full cached state. That re-write reproduces additions but cannot express removals, so destructive operations are recorded as `Action`s and replayed against the backend before the additive state is written back. Document each `Action` variant with the `ShardStore` removal method it replays, and describe the two-phase flush and the drop-without-flush behavior on the `flush` method. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dannywillems
force-pushed
the
dw/document-caching-deferred-actions
branch
from
July 2, 2026 09:18
e2a30f7 to
dde8a17
Compare
Add two tests covering how `CachingShardStore` propagates cached mutations to the backend. The backend is passed to the store as `&mut` (via the blanket `ShardStore for &mut S` impl), so it stays owned by the test and can be inspected once the store, and its borrow, are gone. `flush_persists_to_backend` asserts the backend is populated only after `flush` is called. `drop_without_flush_does_not_persist` lets the store go out of scope without flushing and asserts the backend is never written. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dannywillems
force-pushed
the
dw/document-caching-deferred-actions
branch
from
July 2, 2026 09:21
dde8a17 to
7e05038
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.