zebra
zebra copied to clipboard
fix(rpc): Refactor the serialization of note commitment trees
Motivation
Close #8471.
The bug described in #8471 is caused by an incorrect serialization of empty note commitment trees for RPCs. Zebra serializes such trees as the empty string, but zcashd
serializes them as 000
. This bug is related only to the z_get_treestate
RPC. The state contains the right trees and uses a different serialization format.
PR Author Checklist
Check before marking the PR as ready for review:
- [x] Will the PR name make sense to users?
- [x] Does the PR have a priority label?
- [x] Have you added or updated tests?
- [x] Is the documentation up to date?
Solution
- Remove the old RPC serialization code.
- Use the same upstream code as
zcashd
to serialize the trees for RPCs. - Cleanups.
Testing
- Remove old test snapshots and add new ones.
Reviewer Checklist
Check before approving the PR:
- [ ] Does the PR scope match the ticket?
- [ ] Are there enough tests to make sure it works? Do the tests cover the PR motivation?
- [ ] Are all the PR blockers dealt with? PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.
Follow Up Work
- #8536