Skip to content

test(grey-erasure): add multi-corruption and bit-flip proptests#821

Open
wangzishuai1987 wants to merge 2 commits into
jarchain:masterfrom
wangzishuai1987:feat/erasure-corrupt-chunk-proptest
Open

test(grey-erasure): add multi-corruption and bit-flip proptests#821
wangzishuai1987 wants to merge 2 commits into
jarchain:masterfrom
wangzishuai1987:feat/erasure-corrupt-chunk-proptest

Conversation

@wangzishuai1987
Copy link
Copy Markdown

Summary

  • Add recovery_after_multi_corruption proptest: corrupt up to recovery_shards - 1 chunks and verify recovery still works from the remaining data_shards chunks
  • Add corrupted_chunk_produces_wrong_recovery proptest: flip bits in a data shard and verify the recovered data differs from the original, proving corrupted data shards are not silently accepted

Context

Addresses two items from #229 (Property-based testing and fuzzing infrastructure):

  • Corrupting any chunk still allows recovery from remaining k chunks

The existing recovery_after_single_corruption test only drops one chunk. These new tests cover the multi-chunk corruption case and verify that the RS decoder doesn't silently accept corrupted input.

Test plan

  • cargo test -p grey-erasure — all existing + new tests pass
  • CI green

Add two new proptest cases for erasure coding:

1. recovery_after_multi_corruption: corrupt up to recovery_shards
   chunks and verify recovery still works from the remaining data_shards.
   For TINY (2:6), this means losing up to 3 chunks out of 6.

2. corrupted_chunk_produces_wrong_recovery: flip bits in a data shard
   and verify the recovered data differs from the original, proving
   that corrupted data shards are not silently accepted.

Ref: 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