Skip to content

CSHLD-783: add support for custom checkpoints#337

Open
Ranjna-G wants to merge 1 commit into
masterfrom
CSHLD-783-configurable-checkpoints
Open

CSHLD-783: add support for custom checkpoints#337
Ranjna-G wants to merge 1 commit into
masterfrom
CSHLD-783-configurable-checkpoints

Conversation

@Ranjna-G

Copy link
Copy Markdown
Contributor

Summary

Makes the shielded tree's checkpoint retention capacity (reorg-depth tolerance) configurable per-tree instead of hardcoded to 100, so indexer-utxo can control it. Default behavior is unchanged when not specified.

Ticket: CSHLD-783

Changes

  • Added an optional max_checkpoints field to the from_frontier protobuf request.
  • Capacity is applied at tree construction time, defaulting to 100 when absent.
  • Since fromState/save use raw persisted bytes (no proto wrapper), capacity is also stored inside the persisted tree state so it survives a save/restore round-trip.
  • Added a Java overload of fromFrontier accepting a nullable maxCheckpoints; existing 2-arg overload unchanged.
  • Added Rust and Java tests covering default fallback, custom capacity + eviction of oldest checkpoints beyond capacity, and persistence round-trip.
  • Updated README to document the new parameter and persistence behavior.

Test Plan

  • cargo test — Rust unit tests pass (7/7)
  • make build — compiles Rust → WASM, regenerates proto bindings
  • make test-java — all JUnit 5 tests pass (44/44)

CLOSES TICKET: CSHLD-783

The shielded tree's checkpoint retention (reorg-depth tolerance) was
hardcoded to 100. indexer-utxo needs per-tree control over this value.

Adds an optional max_checkpoints field to the from_frontier request,
defaulting to 100 when absent. Since fromState/save use raw persisted
bytes with no proto wrapper, capacity is also stored inside the
persisted tree state so it survives a save/restore round-trip.

Ticket: CSHLD-783
@linear-code

linear-code Bot commented Jul 27, 2026

Copy link
Copy Markdown

CSHLD-783

@Ranjna-G
Ranjna-G marked this pull request as ready for review July 27, 2026 09:22
@Ranjna-G
Ranjna-G requested a review from a team as a code owner July 27, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant