tari
tari copied to clipboard
Merkle proofs include `usize` fields
The codebase uses three different Merkle proof structures: Merkle mountain range (MMR) proofs, and merged and unmerged balanced binary Merkle tree (BBMT) proofs. In each case, the proof includes one or more usize
fields. This could lead to issues between 32-bit and 64-bit targets.
For MMR proofs:
- the tree size is encoded as
usize
viaserde
derived traits
For BBMT unmerged proofs:
- the witness node index is
usize
, but no encoding is yet specified
For BBMT merged proofs:
- the witness node indexes are
Vec<usize>
, but no encoding is yet specified - the path heights are
Vec<usize>
, but no encoding is yet specified
In each of these cases, usize
should be replaced by either u32
or u64
as appropriate for the required use cases.