-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: guarantee that max prefix length is < min prefix length + child size #369
fix: guarantee that max prefix length is < min prefix length + child size #369
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #369 +/- ##
==========================================
+ Coverage 67.51% 67.76% +0.24%
==========================================
Files 7 7
Lines 3014 3037 +23
==========================================
+ Hits 2035 2058 +23
Misses 979 979
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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.
Nice work! Ideally we would also have a test that malleates the prefix in order to fool the proof system that now fails. You should be able to pull out the test case from the audit report so don't have to create yourself
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.
Agree that we should have the malleate test case (also a unit test for go code?). The audit recommended updating the proto documentation to indicate this restriction as well
(also looks like rust formatting needs to be fixed)
requesting review from @romac to verify the rust changes |
gonna mark as draft until:
|
LGTM, just needs a |
@@ -166,6 +166,10 @@ func (op *InnerOp) CheckAgainstSpec(spec *ProofSpec, b int) error { | |||
return errors.New("spec.InnerSpec.ChildSize must be >= 1") | |||
} | |||
|
|||
if spec.InnerSpec.MaxPrefixLength >= spec.InnerSpec.MinPrefixLength+spec.InnerSpec.ChildSize { |
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.
for what it is worth. Spec fields being validated against themselves are better off in a spec.Validate() function, but for the sake of minimizing changes, this approach makes sense to me
…xlength-less-minprefixlength-plus+childsize
No description provided.