L1 <-> L2 Communication Verification

L1 <-> L2 Communication and Verification

Hey team. I’m working on a project which involves messages being sent between L1 and L2.

With this, I have a few questions:

  1. How often are messages between L1 <-> L2 dropped when using StarkNet sendMessageToL2 and vice-versa.
  2. Do we have estimates/upper bound on how long it takes for L1 <-> L2 messages to occur, i.e. time it takes for the sequencer to submit (not including the time it takes to be included in an Ethereum Block)

Following up on this, I’d like to understand how I can verify L2 state from L1. For example, let’s say that I execute sendMessageToL2 from an L1 Contract SimpleBridge.sol. Now for whatever reasons, the message is never received on L2.

I’d like to execute an L1 function which is essentially answering the question: “Has my message been received on L2?”

I couldn’t find a Github repo with the Starknet.sol contract, but browsing etherscan, I found the address at Starknet | Address 0x944960b90381d76368aece61f269bd99fffd627e | Etherscan which exposes the function:

l1ToL2Messages(msgHash: bytes32) -> Uint256

If I execute this function with the hash of the payload that I submitted using sendMessageToL2 and it returns the value 1, is this a guarantee that the message has been received on L2? Is a return value of 0 also a guarantee that the message has NOT been received on L2?

Also, is there a better way to do this?

Thank you!

12 Likes