-
Notifications
You must be signed in to change notification settings - Fork 925
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(share/byzantine): fix proof collection #2957
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2957 +/- ##
==========================================
+ Coverage 50.88% 51.01% +0.12%
==========================================
Files 168 168
Lines 11021 11035 +14
==========================================
+ Hits 5608 5629 +21
+ Misses 4915 4903 -12
- Partials 498 503 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here make sense. I would also add the test for the issue:
This PR fixes an issue in the proof collection method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for n
(number of non-empty shares received from rsmt2d library) to be less then len(dah.RowRoots)/2? I guess in this case proof collection won't be able to collect enough samples. So we should short circuit with error.
No, it's not possible to have n < len(dah.RowRoots)/2. Rsmt2d guarantees to return at least half of the row/col. iirc, "failed to solve data square" will be returned for the case that you mentioned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good with me, nice find.
This PR fixes an issue in the proof collection method. Previously, we were sending `len(dah.RowRoots)/2` requests in order to get proofs but there is a use case when the process can get stuck for a particular share(out-of-order case). The new approach sends n requests, where n is the number of non-empty shares received from rsmt2d library, and then waits until `len(dah.RowRoots)/2` will be received. I've also improved error handling as previously we were panicking in case any error appeared. The new approach will rely only on `context.DeadlineExceeded ` which basically means that for some reason we can't get proofs, so the data is not available. --------- Co-authored-by: ramin <raminkeene@gmail.com>
This PR fixes an issue in the proof collection method. Previously, we were sending
len(dah.RowRoots)/2
requests in order to get proofs but there is a use case when the process can get stuck for a particular share(out-of-order case). The new approach sends n requests, where n is the number of non-empty shares received from rsmt2d library, and then waits untillen(dah.RowRoots)/2
will be received.I've also improved error handling as previously we were panicking in case any error appeared. The new approach will rely only on
context.DeadlineExceeded
which basically means that for some reason we can't get proofs, so the data is not available.