Skip to content

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 added 2 commits October 15, 2024 10:29
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
@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
Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig marked this pull request as ready for review November 14, 2024 14:34
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig merged commit 1ada952 into master Nov 18, 2024
9 checks passed
@bmzig bmzig deleted the bz/multistepForwarder branch November 18, 2024 17:03
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.

3 participants