Skip to content

feat(fuzz): add Merkle trie and MMR fuzz target#825

Open
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:feat/fuzz-merkle-trie
Open

feat(fuzz): add Merkle trie and MMR fuzz target#825
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:feat/fuzz-merkle-trie

Conversation

@wangzishuai1987
Copy link
Copy Markdown

Summary

Adds a fuzz_merkle_trie fuzz target that feeds random key-value pairs into:

  1. merkle_root() — binary Patricia Merkle trie root computation
  2. MMR append() + root() — Merkle Mountain Range operations

Verifies that arbitrary input never causes a panic. Keys are deduplicated before passing to the trie (as required by the spec).

This expands fuzz coverage beyond codec/PVM types to the Merklization layer, catching potential issues in:

  • Trie branch splitting logic
  • Embedded vs hashed leaf threshold handling
  • MMR peak promotion on overflow

Refs: #229 (fuzzing infrastructure — "random network message bytes → handler doesn't panic")

Add fuzz_merkle_trie target that feeds random KV pairs into
merkle_root() and MMR append/root operations. Verifies that
arbitrary input never causes a panic.

Refs: jarchain#229
@github-actions
Copy link
Copy Markdown
Contributor

Genesis Review

Comparison targets:

How to review

Post a comment with the following format (rank from best to worst):

/review
difficulty: <commit1>, <commit2>, ..., <commitN>, currentPR
novelty: <commit1>, <commit2>, ..., <commitN>, currentPR
design: <commit1>, <commit2>, ..., <commitN>, currentPR
verdict: merge

Use the short commit hashes above and currentPR for this PR.
Each line ranks all comparison targets + this PR from best to worst.

To meta-review another reviewer's comment, react with 👍 or 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant