Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol): enforce an invocation delay for bridged messages #15555

Merged
merged 71 commits into from
Feb 5, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jan 24, 2024

Brecht previously proposed enhancing the Bridge's security by implementing a mandatory delay before message invocation. In this draft implementation, by default, the invocation delay is set to 0, allowing the Bridge to operate as usual. However, when configured with a non-zero delay, each message requires a two-step process (true for both processMessage and recallMessage). The first step verifies the message with a Merkel proof and timestamps it, while the second step is responsible for the actual message invocation. A challange is that the previous message.fee is designed for a one-step process, now with a two-step process, in theory we need two fees, one for each step, but this is not implemented in this PR as it will have data incompatibility issue.

We should deploy a bridge watchdog software which always monitors all MessageReceived events, ensuring that messages scheduled for invocation exist on their source chain. If a discrepancy is detected, the watchdog will use pauseMessages to halt the invocation of these messages and initiate an investigation.

Tests specific to the non-zero invocation delay feature will be added once we decide to adopt this enhancement.

@dantaik dantaik marked this pull request as ready for review January 24, 2024 02:09
@dantaik dantaik changed the title feat(protocol): enforce an invocation delay for bridged messages feat(protocol): enforce an invocation delay for bridged messages [do not merge] Jan 24, 2024
Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
bridge-ui-v2-a6 ✅ Ready (Inspect) Visit Preview Feb 5, 2024 11:46am

@adaki2004
Copy link
Contributor

@KorbinianK @cyberhorsey if you have any questions let me know.
TLDR here so we can refer to later:
This will require some (ui/relayer) changes like:

  • delay enabled or not ? (L2 most probably not, L1 i guess will have it)
  • if delay enabled calling "claim" (aka processMessage) twice and in the right time window, etc.

@dantaik dantaik added this pull request to the merge queue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants