Skip to content

Improve submitBridgeTxBatch, proveBridgeTxBatch calldata usage #27

@Janmajayamall

Description

@Janmajayamall

Today each deposit is stored in a Deposit struct

    struct Deposit {
        uint256       value;
        address       recipient;
        DepositStatus status;
        uint256       depositBlock; // block.number at deposit time
    }

submitBridgeTxBatch receives public input (i.e. batchPreImage) and reads deposit note commitment (dNoteComm) via offset per deposit. For each deposit it does a sanity check that the information in public input matches details in the deposit.

proveBridgeTxBatch verifies the proof and marks deposits as consumed (& add withdrawals).

We can avoid including ethaddress, amount, and assetid per deposit in public input and retrieve them from the respective Deposit entry retrieved via dNoteComm. This reduces calldata size in both: submitBridgeTxBatch and proveBridgeTxBatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions