Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ipld): fix reconstruction by re-enabling re-importing of rsmt2d.ExtendedDataSquare #804

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

Wondertan
Copy link
Member

An update of rsmt2d happened in #737 during Mamaki launch preparation. This update changed our code not to reimport the square on each reconstruction attempt which silently sneaked in the problem, which is not reproducible with current tests. Reconstruction tests(#702) reproduce it, but they are not yet merged.

I was able to change the code to reproduce it reliably. Mainly I had to fetch only from columns and force the code to download only [2:4) quadrants. Unfortunately, it is hard to extract the reproducible case in a separate test, so we can either rely on reconstruction tests that are soon to be merged, or I can still try to make a test.

The reason for the bug is explained in #787, as well as a cleaner way to fix it.
Closes #787

P.S. Was pretty hard to debug this case. I went on the wrong paths like 3 times. Though collected some minor findings that I am going to submit further.

@Wondertan Wondertan added the kind:fix Attached to bug-fixing PRs label Jun 8, 2022
@Wondertan Wondertan requested a review from liamsi as a code owner June 8, 2022 14:00
@Wondertan Wondertan self-assigned this Jun 8, 2022
@Wondertan Wondertan requested a review from renaynay as a code owner June 8, 2022 14:00
@Wondertan Wondertan changed the title fix(ipld): fix by re-enabling re-importing of the rsmt2d.Squre fix(ipld): fix by re-enabling re-importing of the rsmt2d.Sqaure Jun 8, 2022
@renaynay renaynay added the area:ipld IPLD plugin label Jun 8, 2022
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really, really prefer a testcase for this but I trust your hours of debugging this.

@Wondertan Wondertan force-pushed the hlib/ipld/rsmt2d-reimporting branch from 55adc76 to 4aa8148 Compare June 8, 2022 15:00
@Wondertan Wondertan changed the title fix(ipld): fix by re-enabling re-importing of the rsmt2d.Sqaure fix(ipld): fix reconstruction by re-enabling re-importing of rsmt2d.ExtendedDataSquare Jun 8, 2022
@Wondertan
Copy link
Member Author

Force push with a cleaner commit

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

Codecov Report

Merging #804 (0dc7d7a) into main (a422ce1) will increase coverage by 0.03%.
The diff coverage is 72.72%.

@@            Coverage Diff             @@
##             main     #804      +/-   ##
==========================================
+ Coverage   53.15%   53.19%   +0.03%     
==========================================
  Files         117      117              
  Lines        6750     6760      +10     
==========================================
+ Hits         3588     3596       +8     
- Misses       2798     2801       +3     
+ Partials      364      363       -1     
Impacted Files Coverage Δ
ipld/retriever.go 87.76% <72.72%> (-2.93%) ⬇️
header/core/listener.go 52.83% <0.00%> (-5.67%) ⬇️
header/p2p/server.go 56.52% <0.00%> (+3.26%) ⬆️
fraud/bad_encoding.go 34.44% <0.00%> (+3.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a422ce1...0dc7d7a. Read the comment docs.

@Wondertan
Copy link
Member Author

@liamsi, I added a test anyway. You can try removing the fix commit and reproduce it yourself. Sometimes it fails with other rsmt2d errors besides byzantine. The test ensures that at least 2 more quadrants are fetching besides the initial one, and all of those written into the shared square, and somewhere in between, the reconstruction fails.

@Wondertan
Copy link
Member Author

As always on CI something goes not like locally, aaaaa

@Wondertan Wondertan force-pushed the hlib/ipld/rsmt2d-reimporting branch from bd5daa5 to 10a215a Compare June 8, 2022 17:03
@Wondertan
Copy link
Member Author

Wondertan commented Jun 8, 2022

Force push with an updated test that should not fail on CI, lets see...

@Wondertan Wondertan force-pushed the hlib/ipld/rsmt2d-reimporting branch from 10a215a to 0dc7d7a Compare June 9, 2022 09:42
@Wondertan
Copy link
Member Author

Wondertan commented Jun 9, 2022

Ok, the test is fixed on CI

@Wondertan Wondertan merged commit 87beabf into main Jun 9, 2022
@Wondertan Wondertan deleted the hlib/ipld/rsmt2d-reimporting branch June 9, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ipld IPLD plugin kind:fix Attached to bug-fixing PRs
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

flaky TestSharesAvailable_Full
6 participants