Commit a2ed9ec5 authored by Maurelian's avatar Maurelian

fix(specs): Corrections to messenger workflow and iface

parent 34e13a5b
...@@ -27,20 +27,35 @@ upgrade. ...@@ -27,20 +27,35 @@ upgrade.
The `L2CrossDomainMessenger` is a predeploy contract located at The `L2CrossDomainMessenger` is a predeploy contract located at
`0x4200000000000000000000000000000000000007`. `0x4200000000000000000000000000000000000007`.
The base `CrossDomainMessenger` interface is:
```solidity ```solidity
interface CrossDomainMessenger { interface CrossDomainMessenger {
event FailedRelayedMessage(bytes32 indexed msgHash); event FailedRelayedMessage(bytes32 indexed msgHash);
event RelayedMessage(bytes32 indexed msgHash); event RelayedMessage(bytes32 indexed msgHash);
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit); event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit);
event SentMessageExtension1(address indexed sender, uint256 value);
function MESSAGE_VERSION() view external returns (uint16);
function messageNonce() view external returns (uint256); function MESSAGE_VERSION() external view returns (uint16);
function otherMessenger() view external returns (address); function MIN_GAS_CALLDATA_OVERHEAD() external view returns (uint64);
function failedMessages(bytes32) view external returns (bool); function MIN_GAS_CONSTANT_OVERHEAD() external view returns (uint64);
function relayMessage(uint256 _nonce, address _sender, address _target, uint256 _value, uint256 _minGasLimit, bytes memory _message) payable external; function MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() external view returns (uint64);
function sendMessage(address _target, bytes memory _message, uint32 _minGasLimit) payable external; function MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() external view returns (uint64);
function successfulMessages(bytes32) view external returns (bool); function OTHER_MESSENGER() external view returns (address);
function xDomainMessageSender() view external returns (address); function baseGas(bytes memory _message, uint32 _minGasLimit) external pure returns (uint64);
function failedMessages(bytes32) external view returns (bool);
function messageNonce() external view returns (uint256);
function relayMessage(
uint256 _nonce,
address _sender,
address _target,
uint256 _value,
uint256 _minGasLimit,
bytes memory _message
) external payable;
function sendMessage(address _target, bytes memory _message, uint32 _minGasLimit) external payable;
function successfulMessages(bytes32) external view returns (bool);
function xDomainMessageSender() external view returns (address);
} }
``` ```
...@@ -56,9 +71,10 @@ The user experience when sending from L1 to L2 is a bit different than when ...@@ -56,9 +71,10 @@ The user experience when sending from L1 to L2 is a bit different than when
sending a transaction from L2 to L1. When going into L2 from L1, the user does sending a transaction from L2 to L1. When going into L2 from L1, the user does
not need to call `relayMessage` on L2 themselves. The user pays for L2 gas on L1 not need to call `relayMessage` on L2 themselves. The user pays for L2 gas on L1
and the transaction is automatically pulled into L2 where it is executed on L2. and the transaction is automatically pulled into L2 where it is executed on L2.
When going from L2 into L1, the user must call `relayMessage` on the When going from L2 into L1, the user proves their withdrawal on OptimismPortal,
`L1CrossDomainMessenger` to finalize the withdrawal. This function can only then waits for the finalization window to pass, and then finalizes the withdrawal
be called after the finalization window has passed. on the OptimismPortal, which calls `relayMessage` on the
`L1CrossDomainMessenger` to finalize the withdrawal.
## Upgradability ## Upgradability
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment