Skip to content

Commit

Permalink
refactor: add return data change on relay message (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDiscotech authored Dec 13, 2024
1 parent 8450d33 commit 5d2a9c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions specs/interop/predeploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ A message is relayed by providing the [identifier](./messaging.md#message-identi
event and its corresponding [message payload](./messaging.md#message-payload).

```solidity
function relayMessage(ICrossL2Inbox.Identifier calldata _id, bytes calldata _sentMessage) external payable {
function relayMessage(ICrossL2Inbox.Identifier calldata _id, bytes calldata _sentMessage) external payable returns (bytes memory returnData_) {
require(_id.origin == Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
CrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_id, keccak256(_sentMessage));
Expand All @@ -394,7 +394,8 @@ function relayMessage(ICrossL2Inbox.Identifier calldata _id, bytes calldata _sen
// log data
(address _sender, bytes memory _message) = abi.decode(_sentMessage[128:], (address,bytes));
bool success = SafeCall.call(_target, msg.value, _message);
bool success;
(success, returnData_) = _target.call(_target, msg.value, _message);
require(success);
successfulMessages[messageHash] = true;
emit RelayedMessage(_source, _nonce, messageHash);
Expand Down
2 changes: 1 addition & 1 deletion specs/protocol/messengers.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface CrossDomainMessenger {
uint256 _value,
uint256 _minGasLimit,
bytes memory _message
) external payable;
) external payable returns (bytes memory returnData_);
function sendMessage(address _target, bytes memory _message, uint32 _minGasLimit) external payable;
function successfulMessages(bytes32) external view returns (bool);
function xDomainMessageSender() external view returns (address);
Expand Down

0 comments on commit 5d2a9c1

Please sign in to comment.