celestiaorg / go-square

A library for encoding blobs into a 2D square of evenly sized chunks designed for sampling and reconstruction
Apache License 2.0
13 stars 16 forks source link

fix!: use squareSizeUpperBound for worstCaseShareIndexes #48

Closed rootulp closed 5 months ago

rootulp commented 6 months ago

Closes https://github.com/celestiaorg/go-square/issues/47

This restores the behavior from celestia-app v1.x where square size upper bound is used to calculate worstCaseShareIndexes.

Testing

In celestia-app, TestMaxBlockSize flake is no longer observed

 go test -run TestIntegrationTestSuite/TestMaxBlockSize -count 5 -v
rootulp commented 6 months ago

Note to reviewers: we could add a unit test to this PR that includes a bad_block.json from a failing TestMaxBlockSize test case

rootulp commented 6 months ago

We could merge this as-is but I want @cmwaters 's review. I'm also nervous about regressions in this repo because this fix was added without a test that would fail if we ever revert this behavior 😞 I'll work on adding a test now.

rootulp commented 5 months ago

Closing in favor of https://github.com/celestiaorg/go-square/pull/49