Skip to content

Commit cedd98d

Browse files
committed
fix empty mt proof
1 parent 3cf2d0e commit cedd98d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/backends/plonky2/circuits/signedpod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,10 @@ impl SignedPodVerifyTarget {
174174
assert!(curr <= self.params.max_signed_pod_values);
175175

176176
// add the proofs of empty leaves (if needed), till the max_signed_pod_values
177+
let mut mp = MerkleClaimAndProof::empty(self.params.max_depth_mt_gadget);
178+
mp.root = pod.dict.commitment();
177179
for i in curr..self.params.max_signed_pod_values {
178-
self.mt_proofs[i].set_targets(
179-
pw,
180-
&MerkleClaimAndProof::empty(self.params.max_depth_mt_gadget),
181-
)?;
180+
self.mt_proofs[i].set_targets(pw, &mp)?;
182181
}
183182

184183
// get the signer pk

src/backends/plonky2/primitives/merkletree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ impl MerkleClaimAndProof {
280280
Self {
281281
enabled: false,
282282
root: EMPTY_HASH,
283-
key: RawValue::from(1),
283+
key: EMPTY_VALUE,
284284
value: EMPTY_VALUE,
285285
proof: MerkleProof {
286-
existence: false,
286+
existence: true,
287287
siblings: iter::repeat(EMPTY_HASH).take(max_depth).collect(),
288288
other_leaf: None,
289289
},

0 commit comments

Comments
 (0)