Repository navigation
Validate Max Aggregatable Exponent Consensus #822
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
Changes from all commits
5abeb8d
de23ecd
e9623df
1d118a6
34c0c56
26828e8
a5ea26e
ff66ed6
99e77da
ce63efd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,13 @@ func (r *reportingPlugin) ValidateObservation(ctx context.Context, outctx ocr3ty | |
| lggr.Warnw("observation missing input", "requestID", requestID) | ||
| return fmt.Errorf("observation from observer %d is missing input for request %s", ao.Observer, requestID) | ||
| } | ||
|
|
||
| if valueInput, ok := reqObs.Input.GetObservation().(*sdk.SimpleConsensusInputs_Value); ok { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @silaslenihan is this valueInput coming from the user ? Asking because if we return error here, one user's bad input can kill the round observation of all nodes ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, it is possible for a user bad input to cause this. To combat that I moved the validation to the capability boundry so that it validates before the request enters the OCR store. |
||
| if err := oracle.ValidateAggregatableValue(valueInput.Value); err != nil { | ||
| lggr.Warnw("observation contains an invalid aggregatable value", "requestID", requestID, "error", err) | ||
| return fmt.Errorf("observation from observer %d has invalid value for request %s: %w", ao.Observer, requestID, err) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
|
|
||
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.
Do we also need to validate the Report 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.
No, the report method just deals with the encoded bytes payload so there is no possibility of a user providing a decimal value that could cause this issue