mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-22 04:29:42 +00:00
Reject empty merkle proof cache in on-chain generateProof
An empty cache passes the existing mod-32 length check and silently produces a witness with no path elements, yielding a proof no validator will accept. Catch the case explicitly so the failure surfaces at the callsite rather than after a wasted publish round-trip. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
95d0a8bdd8
commit
1b149fed08
@ -492,6 +492,9 @@ method generateProof*(
|
||||
debug "Generating RLN proof"
|
||||
?(await g.ensureFreshMerkleProofPath())
|
||||
|
||||
if g.merkleProofCache.len == 0:
|
||||
return err("merkle proof cache is empty")
|
||||
|
||||
if (g.merkleProofCache.len mod 32) != 0:
|
||||
return err("Invalid merkle proof cache length")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user