rsmt2d icon indicating copy to clipboard operation
rsmt2d copied to clipboard

Discussion: should codecs explain the type of data they support while decoding

Open rootulp opened this issue 2 years ago • 2 comments

Context

It looks like infectious supports decoding data where some shards have been corrupted. On the other hand, klauspost/reedsolomon leopard does not support decoding shards that have been corrupted ref1, ref2.

Questions:

  1. Should the codecs document this behavior?
  2. How can Celestia use Leopard if shares are corrupted? Is there a mechanism to ignore corrupted shares?

rootulp avatar Mar 09 '23 19:03 rootulp

what does corrupted mean in this scenario?

evan-forbes avatar Mar 09 '23 20:03 evan-forbes

From Infectious README

...
// Let's reconstitute with two pieces missing and one piece corrupted.
shares = shares[2:]     // drop the first two pieces
shares[2].Data[1] = '!' // mutate some data

result, err := f.Decode(nil, shares)
if err != nil {
	panic(err)
}

For example a corrupted share may have one bit flipped from the original share that came from the Encode process.

rootulp avatar Mar 09 '23 22:03 rootulp