-
Notifications
You must be signed in to change notification settings - Fork 22
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
Share length validation #478
Share length validation #478
Conversation
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.
Approving this but with an *.
- @GalRogozinski @MatheusFranco99
I think if this check is required maybe its time to think of separating the base for committee and other runners. Since other runners will never recv more than one share, it looks weird that their func signature can recv a map of shares.
@y0sher I agree. |
ks := testingutils.KeySetMapForValidators(10) | ||
shares := testingutils.ShareMapFromKeySetMap(ks) | ||
|
||
// No errors since one share must be valid for all runners |
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 this comment right for this 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.
Indeed not. Updating. Thanks for the catch!
|
||
shares := map[phase0.ValidatorIndex]*types.Share{} | ||
|
||
// No errors since one share must be valid for all runners |
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.
and 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.
Updating, thanks!
* Add share length validation in runner construction * Align to error handling in runners constructions * Add validation to committee runner * Add runner construction tests * Refactor runner construction in testingutil to deal with creation errors * Generate JSON tests * Fix lint issue * Fix comments
Overview
This PR adds a validation to the runners' construction function (except by
CommitteeRunner
) to assert that theshare
argument has only one entry (only one share).