Skip to content

Commit

Permalink
feat(L2toL2CDM): improve gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
tremarkley committed Oct 18, 2024
1 parent f99424d commit 64e261a
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { IL2ToL2CrossDomainMessenger } from "src/L2/interfaces/IL2ToL2CrossDomai
import { ISemver } from "src/universal/interfaces/ISemver.sol";
import { SafeCall } from "src/libraries/SafeCall.sol";
import { TransientReentrancyAware } from "src/libraries/TransientContext.sol";
import { Constants } from "src/libraries/Constants.sol";

/// @notice Thrown when a non-written slot in transient storage is attempted to be read from.
error NotEntered();
Expand Down Expand Up @@ -92,12 +93,6 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra
/// @param messageHash Hash of the message that was relayed.
event RelayedMessage(uint256 indexed source, uint256 indexed messageNonce, bytes32 indexed messageHash);

/// @notice Emitted whenever a message fails to be relayed on this chain.
/// @param source Chain ID of the source chain.
/// @param messageNonce Nonce associated with the messsage sent
/// @param messageHash Hash of the message that failed to be relayed.
event FailedRelayedMessage(uint256 indexed source, uint256 indexed messageNonce, bytes32 indexed messageHash);

/// @notice Retrieves the sender of the current cross domain message. If not entered, reverts.
/// @return sender_ Address of the sender of the current cross domain message.
function crossDomainMessageSender() external view onlyEntered returns (address sender_) {
Expand Down Expand Up @@ -204,7 +199,7 @@ contract L2ToL2CrossDomainMessenger is IL2ToL2CrossDomainMessenger, ISemver, Tra
successfulMessages[messageHash] = true;
emit RelayedMessage(source, nonce, messageHash);
} else {
emit FailedRelayedMessage(source, nonce, messageHash);
revert("L2ToL2CrossDomainMessenger: failed to relay message");
}

_storeMessageMetadata(0, address(0));
Expand Down

0 comments on commit 64e261a

Please sign in to comment.