Skip to content

Commit 867e4dc

Browse files
committed
chore(base): remove value parameter from relayMessage
1 parent ff58a2e commit 867e4dc

3 files changed

Lines changed: 20 additions & 27 deletions

File tree

base/src/Messenger.sol

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,20 @@ contract Messenger {
124124
/// @dev Gas estimation: If the transaction origin is ESTIMATION_ADDRESS, failures will cause reverts to help
125125
/// compute accurate gas limits during estimation.
126126
///
127-
/// @param nonce Unique nonce of the message being relayed.
128-
/// @param sender Address of the user who sent the message on the remote chain.
129-
/// @param target Address that the message is targeted at on this chain.
130-
/// @param value ETH value to send with the message execution.
127+
/// @param nonce Unique nonce of the message being relayed.
128+
/// @param sender Address of the user who sent the message on the remote chain.
129+
/// @param target Address that the message is targeted at on this chain.
131130
/// @param minGasLimit Minimum amount of gas that the message must be executed with.
132-
/// @param message Encoded message data to send to the target address.
133-
function relayMessage(
134-
uint256 nonce,
135-
bytes32 sender,
136-
address target,
137-
uint256 value,
138-
uint256 minGasLimit,
139-
bytes calldata message
140-
) external payable {
131+
/// @param message Encoded message data to send to the target address.
132+
function relayMessage(uint256 nonce, bytes32 sender, address target, uint256 minGasLimit, bytes calldata message)
133+
external
134+
{
141135
bytes32 messageHash =
142-
keccak256(abi.encodeCall(this.relayMessage, (nonce, sender, target, value, minGasLimit, message)));
136+
keccak256(abi.encodeCall(this.relayMessage, (nonce, sender, target, minGasLimit, message)));
143137

144138
if (_isRemoteMessenger()) {
145-
require(msg.value == value, IncorrectMsgValue());
146139
require(!failedMessages[messageHash], MessageAlreadyFailed());
147140
} else {
148-
require(msg.value == 0, IncorrectMsgValue());
149141
require(failedMessages[messageHash], MessageNotAlreadyFailed());
150142
}
151143

@@ -178,7 +170,7 @@ contract Messenger {
178170
}
179171

180172
_xChainMsgSender = sender;
181-
bool success = SafeCall.call(target, gasleft() - RELAY_RESERVED_GAS, value, message);
173+
bool success = SafeCall.call(target, gasleft() - RELAY_RESERVED_GAS, 0, message);
182174
_xChainMsgSender = DEFAULT_L2_SENDER;
183175

184176
if (success) {

solana/programs/portal/src/solidity.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ use alloy_sol_types::sol;
33
sol! {
44
#[derive(Debug, PartialEq, Eq)]
55
contract CrossChainMessenger {
6-
/// @notice Relays a message that was sent by the remote CrossChainMessenger contract. Can only be executed via
7-
/// cross-chain call from the remote messenger OR if the message was already received once and is currently
8-
/// being replayed.
6+
/// @notice Relays a message that was sent by the remote Messenger contract. Can only be executed via
7+
/// cross-chain call from the remote messenger OR if the message previously failed and is being replayed.
98
///
10-
/// @param nonce Nonce of the message being relayed.
11-
/// @param sender Address of the user who sent the message.
12-
/// @param target Address that the message is targeted at.
13-
/// @param minGasLimit Minimum amount of gas that the message can be executed with.
14-
/// @param message Message to send to the target.
9+
/// @dev Gas estimation: If the transaction origin is ESTIMATION_ADDRESS, failures will cause reverts to help
10+
/// compute accurate gas limits during estimation.
11+
///
12+
/// @param nonce Unique nonce of the message being relayed.
13+
/// @param sender Address of the user who sent the message on the remote chain.
14+
/// @param target Address that the message is targeted at on this chain.
15+
/// @param minGasLimit Minimum amount of gas that the message must be executed with.
16+
/// @param message Encoded message data to send to the target address.
1517
function relayMessage(
1618
uint256 nonce,
1719
bytes32 sender,
1820
address target,
1921
uint256 minGasLimit,
2022
bytes calldata message
21-
) external payable;
23+
) external;
2224
}
2325
}

solana/programs/portal/src/test_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#[cfg(test)]
21
use anchor_lang::{prelude::*, solana_program::native_token::LAMPORTS_PER_SOL};
32
use litesvm::LiteSVM;
43
use solana_account::Account;

0 commit comments

Comments
 (0)