Skip to content

Commit 55783b7

Browse files
committed
Log duplicate deposits in spoke pool client
1 parent b0a7a23 commit 55783b7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/clients/SpokePoolClient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,21 @@ export class SpokePoolClient extends BaseAbstractClient {
656656
}
657657

658658
if (this.depositHashes[getRelayEventKey(deposit)] !== undefined) {
659+
// Sanity check that this event is not a duplicate, even though the relay data hash is a duplicate.
660+
const allDeposits = this._getDuplicateDeposits(deposit).concat(this.depositHashes[getRelayEventKey(deposit)]);
661+
if (
662+
allDeposits.some((e) => {
663+
return e.transactionHash === deposit.transactionHash && e.logIndex === deposit.logIndex;
664+
})
665+
) {
666+
this.logger.warn({
667+
at: "SpokePoolClient#update",
668+
chainId: this.chainId,
669+
message: "Duplicate deposit found with same transaction hash and log index",
670+
deposit,
671+
});
672+
continue;
673+
}
659674
assign(this.duplicateDepositHashes, [getRelayEventKey(deposit)], [deposit]);
660675
continue;
661676
}

0 commit comments

Comments
 (0)