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

fix: M-01 relayTokens Calls Made by Forwarders May Fail #664

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bmzig
Copy link
Contributor

@bmzig bmzig commented Oct 15, 2024

The Router_Adapter contract sends assets from L1 to L3 in two steps: first it bridges the tokens to the forwarder contract and then it sends a message instructing the forwarder to bridge the tokens to L3. The problem with this approach is that although the transaction bridging the tokens is scheduled first, there is no guarantee that it will be executed first as the tokens are bridged using different channels than the messages are being sent. In particular, in case of Arbitrum, the USDC token will be bridged through the CCTP protocol, but the messages will be passed through the Arbitrum Inbox contract, which is completely independent of CCTP. So, it may happen that the forwarder may attempt to bridge tokens to L3 before it receives them.
Although failed messages on L2s can be retried, we believe that it would be better to cache such failed messages inside forwarders, so that they could be reexectued by anyone in the future (possibly in a batch).

This PR applies the suggestion to the ForwarderBase contract. The router adapter on L1 will follow up a token relay with a call to relayTokens. Now, relayTokens will save the information about this message in the tokenRelays array so that it may be executed later via a call to executeRelayTokens.

@bmzig bmzig changed the title fix: make token relays a two-step process fix: M-01 relayTokens Calls Made by Forwarders May Fail Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants