[TASK] Wait until an event is finalized/N blocks deep before proposing/relaying it. #193
Labels
difficulty: medium 🚩
feature ➕
Tasks that are functional additions or enhancements
p2 🟡
Issue should be resolved soon
Overview
To prevent against the worst-case issue of dealing with forks in a chain, we should ensure that the relayers wait some # of blocks for each different chain before relaying or proposing new updates, especially for anchor updates.
For example, if we relay an anchor update to Ethereum and then Ethereum forks, our updates will be lost. Even worse, if we relay an Ethereum anchor update to its neighbors and Ethereum forks, its neighbors will have a corrupted state of Ethereum. This would be considered a bug in our bridge.
Spec
In order to prevent against such attacks/issues, we should have a notion of finality for all the chains we are relaying for. If they have finality then we wait explicitly for that (i.e. that an event is in a finalized block) and if it doesn't then we have some length of time we wait before relaying it, such as 10-100 blocks.
We should be able to identify if events have occurred in finalized blocks firstly and we should add this functionality. For L2s connected to Ethereum with no notion of finality, we should identify and implement something that prevents this issue to the best of our ability.
The text was updated successfully, but these errors were encountered: