[go: up one dir, main page]

RISC-V: Remove RootHashable trait

Closes RV-398

What

A follow-up up from !16293 (merged) and !16378 (merged) which removes the RootHashable trait and moves definitions which are no longer used in RootHashable or Merkleisable (!16379 (merged)) but in CommitmentLayout and ProofLayout to the merkle module.

Why

The RootHashable trait is no longer needed as its core functionality is now implemented by CommitmentLayout.

How

The remaining uses of RootHashable in constructing Merkle trees are now implemented by the relevant types:

  • Hash::combine for combining hashes. This is now the only function used to combine hashes across the codebase, eliminating some duplication.
  • MerkleTree::make_merkle_node for combining MerkleTree values into a node, which uses Hash::combine.

Manually Testing

make -C src/riscv all

Benchmarking

No impact on performance.

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Put in reasonable effort to ensure that CI will pass.
    • make -C src/riscv
    • dune build src/lib_riscv
    • dune build src/rust_deps
  • Benchmark performance and populate the table above if needed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages to reflect the changes they're about.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.
Edited by Victor Dumitrescu

Merge request reports

Loading