-
Notifications
You must be signed in to change notification settings - Fork 578
fix: enforce deferred proof verification #2455
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
base: dev
Are you sure you want to change the base?
Conversation
|
UnconstrainedCycleLimitExceeded(u64), | ||
|
||
/// Not all deferred proofs were verified during execution. | ||
#[error("unverified deferred proofs: verified={actual}, expected={expected}")] |
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.
nit: "unverified" is a bit misleading. Maybe "not enough"?
let res = syscall_impl.execute(&mut precompile_rt, syscall, b, c); | ||
let res = if syscall == SyscallCode::VERIFY_SP1_PROOF { | ||
// Catch panics for VERIFY_SP1_PROOF to provide better error messages. | ||
match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { |
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.
it's kind of bad that we need to use this and have syscall-specific branch here, ideally execute fn should just return a Result
Motivation
Proofs fail during recursion when an incorrect amount of deferred proofs are passed or when verification fails.
Solution
Instead of just throwing a warning or panicking, stop execution and throw an error that we can catch in the prover network and display in the explorer.
Example Logs
UnverifiedDeferredProofs
Thrown when the user never calls
verify_sp1_proof
, or when the user only called it for some of the proofs.InsufficientDeferredProofs
Thrown when the user tries to verify more proofs than passed.
DeferredProofVerificationFailed
Thrown when proof verification fails.