Skip to content

CSHLD-1208: Add retention flags when appending commitments in Merkle tree logic#319

Open
Ranjna-G wants to merge 1 commit into
masterfrom
CSHLD-1208-add-retention-flags
Open

CSHLD-1208: Add retention flags when appending commitments in Merkle tree logic#319
Ranjna-G wants to merge 1 commit into
masterfrom
CSHLD-1208-add-retention-flags

Conversation

@Ranjna-G

Copy link
Copy Markdown
Contributor

Summary

Threads per-commitment ownership booleans from the proto wire format through the Rust shardtree append path, assigning Retention::Marked to owned leaves so the shardtree preserves their witness paths for future inclusion-proof generation.

Linear: CSHLD-1208

Changes

  • proto/privacy_coin.proto: add repeated bool owned = 4 to AppendCommitmentsRequest
  • src/zcash/tree.rs: accept owned: Vec<bool>; assign Marking::Marked for owned leaves, Marking::None otherwise
  • src/lib.rs: extract req.owned and pass to tree.append_commitments
  • ShieldedMerkleTree.java: add List<Boolean> owned parameter to appendCommitments; removed backward-compatible overloads
  • ShieldedMerkleTreeTest.java: add f-flag assertions verifying MARKED (f=2) and CHECKPOINT|MARKED (f=3) on owned leaves
  • pom.xml: add jackson-databind test-scoped dependency for JSON tree state parsing in tests

Test Plan

  • make jar rebuilds the WASM binary with the Rust changes
  • make test-java runs ShieldedMerkleTreeTest including the two new retention-flag tests
  • Existing 33 tests must continue to pass

CLOSES TICKET: CSHLD-1208

Per-commitment ownership booleans are now threaded from the proto wire
format into the Rust shardtree append path. Owned leaves are assigned
Retention::Marked so the shardtree preserves their witness paths;
non-owned leaves remain Retention::Ephemeral (or Checkpoint for the
last commitment in a block).

Ticket: CSHLD-1208
@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown

CSHLD-1208

@Ranjna-G Ranjna-G marked this pull request as ready for review July 16, 2026 12:37
@Ranjna-G Ranjna-G requested a review from a team as a code owner July 16, 2026 12:37
Comment on lines +5 to +6
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does json come from here? I though we were using protobuf for WASM communication?

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.

2 participants