-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[HackerOne-2300725] Limit the number of allowed constraints for deployments #2271
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.
Left a few comments and suggestions.
I will investigate |
Is there a reason more CI tests are failing? Do we need to resample anything? |
…thesis that randomizes vars
LGTM! |
// If in 'CheckDeployment' mode, set the expected constraint limit. | ||
if let CallStack::CheckDeployment(_, _, _, constraint_limit) = ®isters.call_stack() { | ||
A::set_constraint_limit(*constraint_limit); | ||
} | ||
|
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.
I'm not convinced this logic is necessary.
When triggering call
, no logic above this resets the constraint limit AFAIK.
Motivation
Large deployments may take a lot of time to synthesize, so as an initial stopgap we can limit their size, as measurement by the number of constraints.
Note that the current approach panics on failure, but because check_transaction_basic is called from snarkOS in a tokio task, this panic is gracefully handled. Returning a
Result
would cascade to 100 other functions using theCircuit
api.Test Plan
Related PRs
https://github.com/AleoHQ/snarkOS/pull/2961