Skip to content
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

fix: exit code #1577

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions crates/recursion/circuit-v2/src/machine/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ where
compress_public_values.is_complete = is_complete;
// Set the contains an execution shard flag.
compress_public_values.contains_execution_shard = contains_execution_shard;
// Set the exit code.
compress_public_values.exit_code = exit_code;
// Set the digest according to the previous values.
compress_public_values.digest = match kind {
PublicValuesOutputDigest::Reduce => {
Expand All @@ -533,9 +535,6 @@ where
}
};

// Set the exit code.
compress_public_values.exit_code = exit_code;

// If the proof is complete, make completeness assertions.
assert_complete(builder, compress_public_values, is_complete);

Expand Down
3 changes: 3 additions & 0 deletions crates/recursion/circuit-v2/src/machine/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ where
}
}

// Update the exit code.
exit_code = public_values.exit_code;

// If `deferred_proofs_digest` is not zero, then the current value should be equal
// to `public_values.deferred_proofs_digest.

Expand Down
6 changes: 3 additions & 3 deletions crates/recursion/core/src/air/public_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ pub struct RecursionPublicValues<T> {
/// shard, i.e. a shard that contains the `cpu` chip.
pub contains_execution_shard: T,

/// The digest of all the previous public values elements.
pub digest: [T; DIGEST_SIZE],

/// The exit code of the program. Note that this is not part of the public values digest,
/// since it's value will be individually constrained.
pub exit_code: T,

/// The digest of all the previous public values elements.
pub digest: [T; DIGEST_SIZE],
}

/// Converts the public values to an array of elements.
Expand Down
Loading