You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let base_tree_size = get_base_tree_size::<DefaultBinaryTree>(porep_config.sector_size)?;
.
The current code works, because the code paths the DefaultBinaryTree is used on, it only cares about the arity and the size of the hashes, which is the same for SHA2 and Poseidon. Though for correctness and clarity, the correct hasher for DefaultBinaryTree should be used.
Acceptance criteria
The correct hashers are uses for the corresponding trees.
Risks + pitfalls
Sometimes the Poseidon hasher might be needed. It needs thorough review whether changing the DefaultBinaryTree to SHA2 is enough, or whether some new type needs to be introduced.
Where to begin
Look at all occurrences of DefaultBinaryTree and check if SHA2 or Poseidon hashing should be used.
The text was updated successfully, but these errors were encountered:
Yes, I agree. We indeed have some confusing places in the codebase (where it is not obvious whether Poseidon or Sha256 hasher should be really used) that require clarification
Description
The
DefaultBinaryTree
is defined asBinaryMerkleTree<DefaultTreeHasher>
, whileDefaultTreeHasher = PoseidonHasher
:rust-fil-proofs/filecoin-proofs/src/constants.rs
Line 144 in aecc1ee
Though the
DefaultBinaryTree
is also used at code paths which use SHA2 hashing, e.g.:rust-fil-proofs/filecoin-proofs/src/api/seal.rs
Line 133 in aecc1ee
The current code works, because the code paths the
DefaultBinaryTree
is used on, it only cares about the arity and the size of the hashes, which is the same for SHA2 and Poseidon. Though for correctness and clarity, the correct hasher forDefaultBinaryTree
should be used.Acceptance criteria
The correct hashers are uses for the corresponding trees.
Risks + pitfalls
Sometimes the Poseidon hasher might be needed. It needs thorough review whether changing the
DefaultBinaryTree
to SHA2 is enough, or whether some new type needs to be introduced.Where to begin
Look at all occurrences of
DefaultBinaryTree
and check if SHA2 or Poseidon hashing should be used.The text was updated successfully, but these errors were encountered: