Skip to content

Commit

Permalink
fix: exit code (#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo authored Sep 30, 2024
1 parent 682942d commit 1391a37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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 @@ -528,6 +528,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 @@ -538,9 +540,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 @@ -473,6 +473,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

0 comments on commit 1391a37

Please sign in to comment.