tangle-network / relayer

πŸ•ΈοΈ The Webb Relayer Network
https://webb-tools.github.io/relayer/
Apache License 2.0
22 stars 13 forks source link

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

Closed shekohex closed 1 year ago

shekohex commented 1 year ago

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

salman01zp commented 1 year ago

Adding TimeLagmiddleware for the following features.