From 682942d3b0330eaa1d4bfa8485781fa06a0084d9 Mon Sep 17 00:00:00 2001 From: Tamir Hemo Date: Mon, 30 Sep 2024 16:22:59 -0700 Subject: [PATCH] fix: execution shard initialization (#1576) --- crates/recursion/circuit-v2/src/machine/compress.rs | 7 ++++++- crates/recursion/circuit-v2/src/machine/core.rs | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/recursion/circuit-v2/src/machine/compress.rs b/crates/recursion/circuit-v2/src/machine/compress.rs index 6e5abdd0ef..561e0f5722 100644 --- a/crates/recursion/circuit-v2/src/machine/compress.rs +++ b/crates/recursion/circuit-v2/src/machine/compress.rs @@ -316,12 +316,17 @@ where * (SymbolicFelt::one() - contains_execution_shard), ); - // If this is the first execution shard, then we update the start execution shard. + // If this is the first execution shard, then we update the start execution shard + // and the `execution_shard` values. compress_public_values.start_execution_shard = builder.eval( current_public_values.start_execution_shard * is_first_execution_shard_seen + compress_public_values.start_execution_shard * (SymbolicFelt::one() - is_first_execution_shard_seen), ); + execution_shard = builder.eval( + current_public_values.start_execution_shard * is_first_execution_shard_seen + + execution_shard * (SymbolicFelt::one() - is_first_execution_shard_seen), + ); // If this is an execution shard, make the assertion that the value is consistent. builder.assert_felt_eq( diff --git a/crates/recursion/circuit-v2/src/machine/core.rs b/crates/recursion/circuit-v2/src/machine/core.rs index 4dd813f2b8..fb4b38fcd8 100644 --- a/crates/recursion/circuit-v2/src/machine/core.rs +++ b/crates/recursion/circuit-v2/src/machine/core.rs @@ -187,8 +187,6 @@ where let public_values: &PublicValues>, Felt<_>> = shard_proof.public_values.as_slice().borrow(); - let _shard = public_values.shard; - // If this is the first proof in the batch, initialize the variables. if i == 0 { // Shard.