Skip to content

AggLayer: implement verify_leaf_bridge #2276

@mmagician

Description

@mmagician

Following the V2 of _verifyLeafBridge:

Currently, the AggLayerFaucet makes an FPI call to the AggLayerBridge contract's check_claim_proof.
We should align the naming and call this procedure verify_leaf_bridge.
It currently has almost the correct signature, but leafType is missing.

#!   Operand stack: [PROOF_DATA_KEY, LEAF_DATA_KEY, pad(8)]
pub proc verify_leaf_bridge
    # get the leaf value. We have all the necessary leaf data in the advice map
    swapw
    # => [LEAF_DATA_KEY, PROOF_DATA_KEY]
    exec.crypto_utils::get_leaf_value
    # => [LEAF_VALUE[8], PROOF_DATA_KEY]

    # to mimic the AggLayerBridge Solidity contracts, delegate the rest of the computation to `verify_leaf`
    # since all the proof data is in the advice map, pass this to verify_leaf which can load it into memory
    # swapw
    # => [PROOF_DATA_KEY, LEAF_VALUE[8]]
    exec.verify_leaf
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    agglayerPRs or issues related to AggLayer bridging integration

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions