celestiaorg / rsmt2d

Go implementation of two dimensional Reed-Solomon merkle tree data availability scheme.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enforce that chunkSize is a multiple of 64

rootulp opened this issue · comments

Context

https://github.com/rootulp/rsmt2d/blob/5661af1b27d576d5d8cf895b70230e6da4d51fb4/extendeddatasquare_test.go#L40-L43

Problem

I've observed that chunkSize must be a multiple of 64 but it's not clear to me if this invariant is enforced when importing an extended data square or computing an extended data square.

Proposal

Investigate if the invariant is enforced. I expect that rsmt2d is propagating errors from klauspost/reedsolomon if shards aren't of size 64. If that's the case, we could consider introducing a new error and verifying the data input for chunk size.