Skip to content

Commit afa349a

Browse files
committed
Fix execution errors with outer recursive proof
1 parent 5c72ded commit afa349a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

how-to/recursive-proofs/circuits/recurseNode/src/main.nr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use dep::std;
22

33
fn main(
44
verification_key: [Field; 114],
5-
public_inputs: pub [Field; 2],
5+
public_inputs: pub [Field; 5],
66
key_hash: Field,
7-
proof: [Field; 109]
7+
proof: [Field; 93] //109
88
) -> pub u64 {
99
// verify sum was computed correctly
1010
std::verify_proof(
@@ -13,5 +13,5 @@ fn main(
1313
public_inputs.as_slice(),
1414
key_hash
1515
);
16-
public_inputs[1] as u64
16+
public_inputs[4] as u64
1717
}

how-to/recursive-proofs/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ async function start() {
7777
innerProof2,
7878
numPubInputs + 1 + 16 // +1 for public return +16 for hidden aggregation object
7979
);
80+
console.log("artifacts2.proof length = ", artifacts2.proofAsFields.length);
81+
82+
pub_inputs.push(returnValue.toString()); // leaf returns sum
83+
pub_inputs.push(returnValue.toString()); // node also coded to return same value
8084

8185
// Generate and verify outer proof
8286
const outerParams = {
8387
verification_key: artifacts2.vkAsFields,
84-
public_inputs: [pub_inputs.map.toString(), returnValue.toString()], // returns proven sum
88+
public_inputs: pub_inputs,
8589
key_hash: artifacts2.vkHash,
8690
proof: artifacts2.proofAsFields
8791
};

0 commit comments

Comments
 (0)