Skip to content

docs(zebra-rpc): clarify z_gettreestate fields hold raw bytes, hex only in JSON - #11231

Open
natalieesk wants to merge 1 commit into
mainfrom
docs_commitments_representation_9847
Open

docs(zebra-rpc): clarify z_gettreestate fields hold raw bytes, hex only in JSON#11231
natalieesk wants to merge 1 commit into
mainfrom
docs_commitments_representation_9847

Conversation

@natalieesk

Copy link
Copy Markdown
Contributor

Closes #9847.

Commitments::final_root and final_state are Option<Vec<u8>> holding raw bytes; they are hex-encoded only when the struct is serialized to JSON (via serde_as / serde_with::hex). The doc comments described the Rust fields themselves as "hex-encoded", which misled downstream consumers reading the fields/getters directly (e.g. zingolabs/zaino#495).

What changed

Doc comments only in zebra-rpc/src/methods/trees.rs. Reworded the misleading "hex-encoded" descriptions to state that the Rust fields hold raw bytes and are hex-encoded only on JSON serialization. Applied across the same-file structs that share the pattern (the issue asked to examine them): Commitments (+ finalRoot/finalState), Treestate::commitments, and GetTreestateResponse (hash, sprout, sapling, orchard, ironwood). No code/behavior change.

Testing

cargo doc -p zebra-rpc --no-deps --document-private-items builds clean (no new warnings; the pre-existing long_poll.rs private-item link note is unrelated and present on main). cargo fmt clean.

AI Disclosure

Claude (Claude Code) made these documentation changes.

@v12-auditor

v12-auditor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Note

Complete: Audit complete. No review-worthy issues remain after automatic triage. Five findings were auto-invalidated.

Open the full results here.

Analyzed one file, diff 05d129b...14f2457.

@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟠 1 of 1 protections blocking · waiting on 🕒 schedule

Protection Waiting on
🟠 ❄️ 6.3.0 release [Scheduled Freeze] 🕒 schedule

🟠 ❄️ 6.3.0 release [Scheduled Freeze]

Waiting for

  • current-datetime < 2026-08-10T14:25:11[America/Sao_Paulo]
This freeze has no end date and must be removed manually.

A freeze on the repository is scheduled for the following reason: 6.3.0 release

  • current-datetime < 2026-08-10T14:25:11[America/Sao_Paulo]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation A-rpc Area: Remote Procedure Call interfaces C-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix documentation of Commitments fields

1 participant