webb-tools / relayer

🕸️ The Webb Relayer Network

Home Page:https://webb-tools.github.io/relayer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[TASK] Make use of `TimeLag` Middleware for safety against reorgs on EVM Chains

shekohex opened this issue · comments

Overview

We currently have block-confirmations in the configurations, but we recently removed the usage of this intuitively in #501 What we should do instead wrap that into ethers::middleware::timelag::TimeLag instead and use the configured value of block-confirmations here. So that by default, everything is lagged by this number of blocks.

Notice that, even the latest_block_number will be lagged by the block-confirmations here. We shall decide wisely which parts may need this features and which parts isn't.

Task Checklist

  • Change our type EthersClient to be wrapped TimeLag middleware.
  • Update tests
  • Update docs.

Adding TimeLagmiddleware for the following features.

  • Event Watchers ✅
  • Event Handlers ✅
  • Tx-queue ✅
  • Tx-relay ❌