diff --git a/src/libp2p-utils.ts b/src/libp2p-utils.ts index 4ed15f8..e33759d 100644 --- a/src/libp2p-utils.ts +++ b/src/libp2p-utils.ts @@ -89,6 +89,12 @@ export async function sendMessageToL2 ( }, data: any ): Promise { + // Send tx to L2 only if we are the leader + if (!consensus.isLeader()) { + log('Not a leader, skipped sending L2 tx'); + return; + } + const { kind, message } = data; const contract = new ethers.Contract(contractAddress, PhisherRegistryABI, signer);