tangle-network / relayer

🕸️ The Webb Relayer Network
https://webb-tools.github.io/relayer/
Apache License 2.0
22 stars 13 forks source link

[ISSUE] Getting InvalidTransaction proof error on vanchor withdraw #503

Closed salman01zp closed 1 year ago

salman01zp commented 1 year ago

Overview

The Vanchor test generates invalid transaction proof when using the tangle node.

const isValidProof = verify_js_proof(
    data.proof,
    data.publicInputs,
    u8aToHex(vk).replace('0x', ''),
    'Bn254'
  );
console.log('Is withdrawal proof valid : ', isValidProof);

All inputs seem okay, following where inputs are pulled from on-chain chainId, leaves, and root.

After cross-checking found out that we were using the wrong default leaf value here due to which invalid root hash in generated causing proof to be invalid.

Task Checklist