Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merkle proofs include usize fields #5226

Open
AaronFeickert opened this issue Mar 7, 2023 · 1 comment
Open

Merkle proofs include usize fields #5226

AaronFeickert opened this issue Mar 7, 2023 · 1 comment
Labels
A-base_node Area - The Tari base node executable and libraries C-bug Category - fixes a bug, typically associated with an issue.

Comments

@AaronFeickert
Copy link
Collaborator

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 via serde 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.

@SWvheerden SWvheerden added A-base_node Area - The Tari base node executable and libraries C-enhancement Category - New feature or request labels Mar 13, 2023
@SWvheerden SWvheerden added C-bug Category - fixes a bug, typically associated with an issue. and removed C-enhancement Category - New feature or request labels Mar 27, 2023
@AaronFeickert
Copy link
Collaborator Author

Addressed for BBMT unmerged and merged proofs in PR 5232.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-base_node Area - The Tari base node executable and libraries C-bug Category - fixes a bug, typically associated with an issue.
Projects
Status: Must Do
Development

No branches or pull requests

2 participants