Skip to content

Validate Max Aggregatable Exponent Consensus - #822

Open
silaslenihan wants to merge 7 commits into
mainfrom
validate-max-aggregatable-exponent-consesnus
Open

silaslenihan wants to merge 7 commits into
mainfrom
validate-max-aggregatable-exponent-consesnus

Conversation

@silaslenihan

Copy link
Copy Markdown
Contributor

No description provided.

@silaslenihan
silaslenihan marked this pull request as ready for review October 15, 2026 15:21
@silaslenihan
silaslenihan requested review from a team as code owners October 15, 2026 15:21
Unheilbar
Unheilbar previously approved these changes Oct 15, 2026
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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Comment thread consensus/oracle/consensus_execution.go Outdated
func(val *valuespb.Value) (decimal.Decimal, error) {
var d decimal.Decimal
if exp := val.GetDecimalValue().GetExponent(); exp > maxDecimalExponent || exp < -maxDecimalExponent {
if exp := val.GetDecimalValue().GetExponent(); exp > MaxAggregatableExponent || exp < -MaxAggregatableExponent {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this ever happen if we ValidateObservation ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't normally, but this was mainly preserving existing logic in case something unexpected happens in the OCR flow / protecting against future changes with this simple guard.

@silaslenihan
silaslenihan force-pushed the validate-max-aggregatable-exponent-consesnus branch from 462f6d0 to 1d118a6 Compare October 19, 2026 14:10
@cl-sonarqube-production

Copy link
Copy Markdown

Unheilbar
Unheilbar previously approved these changes Oct 20, 2026
Comment thread consensus/oracle/consensus_execution.go
Comment thread consensus/action/capability.go
Comment thread consensus/action/capability.go Outdated
dhaidashenko
dhaidashenko previously approved these changes Oct 27, 2026
@silaslenihan
silaslenihan disabled auto-merge October 27, 2026 14:52
Comment thread consensus/oracle/plugin/plugin_outcome.go Outdated
Comment thread consensus/oracle/consensus_execution.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants