tangle-network / relayer

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

[TASK] Implement the batching logic necessary for batching support on DKG #538

Closed drewstone closed 1 year ago

drewstone commented 1 year ago

Overview

We have batching implemented on the pallet side, which means that oftentimes Batch<Proposal> batches are signed containing more than 1 proposal. For this to completely land, we need to update the relayer to listen for batches and process them against the right transaction on the SignatureBridge.sol.

Contract

https://github.com/webb-tools/protocol-solidity/blob/main/packages/contracts/contracts/SignatureBridge.sol#L144-L153

Nuances

The functions in question are:

We need to ensure that SetResourceProposal is only batched together with other SetResourceProposals. It cannot be batched with an AnchorUpdateProposal for example. This is due to the fact that we handle it exclusively on the SignatureBridge.sol in an entirely separate fashion. For example if we batchExecuteProposalsWithSignature or executeProposalWithSignature with a SetResourceProposal nothing will happen because there is no "handler" for this proposal type.

Event handling

The batch signed event is new and should be handled as such by the relayer, ProposalBatchSigned.

Checklist