zebra icon indicating copy to clipboard operation
zebra copied to clipboard

Fix documentation of `Commitments` fields

Open str4d opened this issue 6 months ago • 0 comments

https://github.com/ZcashFoundation/zebra/blob/6032c32124eba4dc2d0b2506a43834dd0c04412f/zebra-rpc/src/methods/trees.rs#L189-L200

These fields are documented as "hex-encoded", which is misleading. When Commitments is serialized as a whole using serde_json, the resulting fields are hex-encoded, but the actual Rust fields store raw bytes and are not hex-encoded. This leads to downstream confusion and misuse of the fields, such as https://github.com/zingolabs/zaino/issues/495.

  • The documentation for Commitments and its fields should be overhauled to correctly inform users of its data representation (including on Commitments::new).
  • Other structs should also be examined for similar bugs.
  • Maintaining a comprehensive changelog for each crate (#9626) would help downstream users to figure out how to correctly migrate across these API changes.

str4d avatar Aug 28 '25 16:08 str4d