feat(fuzz): add state KV decode fuzz target with roundtrip check#831
feat(fuzz): add state KV decode fuzz target with roundtrip check#831wangzishuai1987 wants to merge 1 commit into
Conversation
Add fuzz_store_decode target that feeds arbitrary bytes into the state KV decoding logic (mirroring grey_store::decode_state_kvs). Verifies that decoding never panics and that successful decode roundtrips through re-encode. This fuzz target includes the same OOM guard as the real implementation (bounding count by remaining bytes / 35). Refs: jarchain#229
Genesis ReviewComparison targets:
How to reviewPost a comment with the following format (rank from best to worst): Use the short commit hashes above and To meta-review another reviewer's comment, react with 👍 or 👎. |
|
/review The intent is useful, but the fuzz target reimplements grey_store::decode_state_kvs instead of exercising the production decoder, and its copy adds an OOM guard that the production function does not have. That means the target can pass while the real decoder regresses or remains vulnerable, so design ranks last despite some novelty as fuzz coverage. Fix by testing the actual decoder, or exposing a narrow internal test/fuzz entry point. |
|
JAR Bot: Review recorded from @johandroid (1 reviews, 0 meta-reviews). |
Summary
Adds a
fuzz_store_decodefuzz target that feeds arbitrary bytes into the state KV decoding logic (mirroringgrey_store::decode_state_kvs).What it tests:
SomeorNoneWhy it matters:
decode_state_kvsparses untrusted data from the database. A panic here would crash the node. This fuzz target ensures the decoder handles all edge cases including:Refs: #229