Skip to content

feat(rpc-v2): include merkle root atomically in proof response#71

Merged
nol4lej merged 1 commit intomainfrom
feat/rpc-v2-merkle-proof-atomic-root
Apr 8, 2026
Merged

feat(rpc-v2): include merkle root atomically in proof response#71
nol4lej merged 1 commit intomainfrom
feat/rpc-v2-merkle-proof-atomic-root

Conversation

@nol4lej
Copy link
Copy Markdown
Contributor

@nol4lej nol4lej commented Apr 8, 2026

Add root field to MerkleProofResponse and introduce generate_proof_with_root / generate_proof_by_commitment_with_root service methods that read both the Merkle root and the sibling path under the same best_block reference.

This eliminates the previous race condition where the root and path could be fetched from different chain heads, causing proof verification failures due to mismatched state.

The privacy_getMerkleProofByCommitment RPC endpoint now returns { root, path, leaf_index, tree_depth } in a single atomic call.

Add `root` field to `MerkleProofResponse` and introduce
`generate_proof_with_root` / `generate_proof_by_commitment_with_root`
service methods that read both the Merkle root and the sibling path
under the same `best_block` reference.

This eliminates the previous race condition where the root and path
could be fetched from different chain heads, causing proof verification
failures due to mismatched state.

The `privacy_getMerkleProofByCommitment` RPC endpoint now returns
`{ root, path, leaf_index, tree_depth }` in a single atomic call.
@nol4lej nol4lej merged commit ddc42a7 into main Apr 8, 2026
6 checks passed
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