-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: extends error handling to detect byzantine data and unordered shares in tree construction #242
Conversation
…rdered-shares-mocked-wrapper
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.
No blocking feedback. Question about the copied file nmtwrapper.go
: is it only needed for tests? If yes, is it possible to use the _test.go
suffix?
extendeddatacrossword_test.go
Outdated
values [][]byte | ||
wantErr bool | ||
corruptedAxis Axis | ||
corruptedInd uint |
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.
[nit] it wasn't immediately obvious what Ind
meant but it appears short for index. This suggestion can't be applied directly b/c it implies renaming the variable in this scope
corruptedInd uint | |
corruptedIndex uint |
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.
This suggestion can't be applied directly b/c it implies renaming the variable in this scope
Can you please expand on this second part of your comment? Nevertheless, I applied the first part of your feedback in 2dcfb41
}, | ||
} | ||
|
||
for codecName, codec := range codecs { |
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.
[optional] there's only one codec so we can remove a layer of nesting from this test case
See: #216
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.
Thanks for mentioning that! I totally agree with eliminating that nested loop. But to keep our PRs more focused and organized, I'd suggest saving this change for a separate PR. Especially since we will have an upcoming PR specifically targeting that issue.
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.
LGTM 👍
nmtwrapper.go
Outdated
@@ -0,0 +1,142 @@ | |||
package rsmt2d | |||
|
|||
// The contents of this file have been adapted from the source file available at https://github.com/celestiaorg/celestia-app/blob/main/pkg/wrapper/nmt_wrapper.go, |
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.
the only thing the wrapper imports is the consts, so maybe it makes sense to accept those consts as args, then move the entire wrapper here
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.
Thanks for the suggestion, here is the tracking issue #248.
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.
That also makes sense to me, cannot see any immediate issue for doing so, however, since it requires some refactoring in the code, I'd say it merits a separate PR.
nmtwrapper.go
Outdated
@@ -0,0 +1,142 @@ | |||
package rsmt2d | |||
|
|||
// The contents of this file have been adapted from the source file available at https://github.com/celestiaorg/celestia-app/blob/main/pkg/wrapper/nmt_wrapper.go, |
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.
Why copy and why not have these tests next to the wrapper?
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.
Or why not move the wrapper here completely then?
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.
Or why not move the wrapper here completely then?
That also makes sense to me, cannot see any immediate issue for doing so, however, since it requires some refactoring in the code, I'd say it merits a separate PR. Please see the tracking issue #248.
Indeed, it serves solely for testing purposes, and I have implemented your suggestion by adding the |
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.
Still LGTM
Overview
Closes #191
Checklist