Adding RollbackInbox and upgrading Messenger & Bridge#184
Adding RollbackInbox and upgrading Messenger & Bridge#184skeletor-spaceman wants to merge 7 commits intoethereum-optimism:mainfrom
Conversation
| after a given delay, ensuring the message corresponding to the rolled back hash | ||
| is never processed in the current domain. The main purpose of this function | ||
| is to inform the other domain of failed messages so contracts living in | ||
| this other domain can handle the message failure. This allows functionalities |
There was a problem hiding this comment.
Do you see any other use cases besides unlocking stuck ERC20s? Trying to get a sense of what the major use cases built on this would be
There was a problem hiding this comment.
that's a great question, yes.
we think this will be a great primitive for handling the not-so-happy path of cross-chain actions.
another example would be a cross-chain(x) swap, where the origin.amm would forward and save an identifier of the user xAction.
which, if the xMessage fails, will be used to continue and gracefully handle the reverted xAction, returning the funds or an LP position to the swapper.
|
|
||
| - [Overview](#overview) | ||
| - [Token Depositing](#token-depositing) | ||
| - [ERC20 Unlocking](#erc20-unlocking) |
There was a problem hiding this comment.
We use to have this built directly into the standard bridge, see https://github.com/ethereum-optimism/optimism-legacy/blob/8205f678b7b4ac4625c2afe351b9c82ffaa2e795/packages/contracts/contracts/L2/messaging/L2StandardBridge.sol#L163
There was a problem hiding this comment.
this is great! this was our first approach to try to fix the problem.
but we thought that if we were to modify the core contracts, we would rather see a future-proof feature being added than a patch for a specific use-case.
while also keeping at a minimum the required modifications to the current codebase.
|
While $320,000 worth of ether is a good amount of money to be stuck, we should ask the question of whether or not this is the biggest fish to fry. Would love to hear some feedback from users that are asking for this feature right now. I also wonder if there are simpler ways to solve the problem, like reintroducing the check we had in the legacy version of the contracts or changing the semantics around the |
|
@tynes I think this might not be a "big" fish to fry, but it's definitely an interesting one, as it aligns us on a solid standard for cross-chain messaging, which will become the bloodstream of the Superchain. |
cc @clabby who has thought about this problem a bunch |
Description
Adds a way for the
CrossDomainMessengerto "send-back" failed messages.These failed messages are stored on the origin domain in a
RollbackInboxcontract.This enables smart contracts to handle "failed" messages.
e.g. the
StandardBridgecan safely recover stuck funds by validating that a message was indeed NOT successful on the other domain.For this proposal, we've also prepared a detailed Notion document, found here, that goes through the rationale and need of the
RollbackInboxand accompanying functionality on theCrossDomainMessenger&StandardBridge.We also believe this would be an important primitive for Interop.
Would love to hear your thoughts and any feedback you might have on this proposal :)
Tests
N/A
Additional context
https://defi-wonderland.notion.site/RollbackInbox-V1-c5dc38b62cf64b51807427012c991bb3
L2ToL2CrossDomainMessenger alternative: #203
Metadata
N/A
This proposal was developed as an internal research project at @defi-wonderland lead by @0xng.