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.
Today each deposit is stored in a Deposit struct
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.