[TASK] Make use of `TimeLag` Middleware for safety against reorgs on EVM Chains
shekohex opened this issue · comments
shekohex commented
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 wrappedTimeLag
middleware. - Update tests
- Update docs.
Salman Pathan commented
Adding TimeLag
middleware for the following features.
- Event Watchers ✅
- Event Handlers ✅
- Tx-queue ✅
- Tx-relay ❌