Introduction

The current messaging system doesn’t have a way to inform the source chain that a message failed to be executed on the destination chain. This lack of information availability disallows contracts on the source chain to handle the cases where the message they sent failed or got stuck in the destination chain.

Idea

Incorporate a special function in the L2ToL2CrossDomainMessenger contract to send back unsuccessful message hashes back to the source chain after a given period of time has elapsed as well as a special function that receive and store the sent-back message hashes.

This will provide smart contracts in the different source chains with the flexibility to handle the cases where a message they sent failed, as they can add functions to reconstruct a message, compare it with the stored sent-back hashes in the L2ToL2CrossDomainMessenger and add the logic to handle the failure accordingly.

Untitled

Implementation

New functions:

Code Diff

<aside> 💡 This code should never be used in production. This code serves only to facilitate the communication of the idea.

</aside>

https://github.com/defi-wonderland/optimism/pull/2