Skip to content

Commit

Permalink
Merge pull request #400 from ethereum-optimism/fix/dont-alias-L2-to-L1
Browse files Browse the repository at this point in the history
contracts: don't unalias on L2->L1
  • Loading branch information
tynes authored May 3, 2022
2 parents 168eed2 + bb58a26 commit 5c61846
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/contracts/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ L2CrossDomainMessenger_Test:test_L2MessengerCannotCallL2MessagePasser() (gas: 44
L2CrossDomainMessenger_Test:test_L2MessengerCannotRelaySameMessageTwice() (gas: 69883)
L2CrossDomainMessenger_Test:test_L2MessengerCorrectL1Messenger() (gas: 9688)
L2CrossDomainMessenger_Test:test_L2MessengerRevertInvalidL1XDomainMessenger() (gas: 13781)
L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 124835)
L2CrossDomainMessenger_Test:test_L2MessengerSendSameMessageTwice() (gas: 162907)
L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 124788)
L2CrossDomainMessenger_Test:test_L2MessengerSendSameMessageTwice() (gas: 162859)
L2CrossDomainMessenger_Test:test_L2MessengerXDomainMessageSenderReset() (gas: 71843)
L2CrossDomainMessenger_Test:test_L2MessengerxDomainMsgSender() (gas: 13320)
L2OutputOracleTest:testCannot_appendCurrentTimestamp() (gas: 20865)
Expand All @@ -56,5 +56,5 @@ WithdrawalsRelay_finalizeWithdrawalTransaction_Test:test_cannotVerifyInvalidProo
WithdrawalsRelay_finalizeWithdrawalTransaction_Test:test_cannotVerifyRecentWithdrawal() (gas: 35297)
WithdrawalsRelay_finalizeWithdrawalTransaction_Test:test_verifyWithdrawal() (gas: 192101)
WithdawerBurnTest:test_burn() (gas: 50276)
WithdrawerTestInitiateWithdrawal:test_initiateWithdrawal_fromContract() (gas: 72023)
WithdrawerTestInitiateWithdrawal:test_initiateWithdrawal_fromEOA() (gas: 72488)
WithdrawerTestInitiateWithdrawal:test_initiateWithdrawal_fromContract() (gas: 71990)
WithdrawerTestInitiateWithdrawal:test_initiateWithdrawal_fromEOA() (gas: 72475)
4 changes: 0 additions & 4 deletions packages/contracts/contracts/L2/Withdrawer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ contract Withdrawer {
bytes calldata _data
) external payable {
address from = msg.sender;
// Transform the from-address to its L1 alias if the caller is a contract.
if (msg.sender != tx.origin) {
from = AddressAliasHelper.undoL1ToL2Alias(msg.sender);
}

bytes32 withdrawalHash = WithdrawalVerifier._deriveWithdrawalHash(
nonce,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract L2CrossDomainMessenger_Test is CommonTest, L2OutputOracle_Initializer {
uint32 gasLimit = 1000;

uint256 nonce = W.nonce();
address sender = AddressAliasHelper.undoL1ToL2Alias(address(L2Messenger));
address sender = address(L2Messenger);

vm.expectEmit(true, true, true, true);
emit SentMessage(target, address(this), message, nonce, gasLimit);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/test/Withdrawer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract WithdrawerTestInitiateWithdrawal is WithdrawerTestCommon {
vm.expectEmit(true, true, true, true);
emit WithdrawalInitiated(
0,
AddressAliasHelper.undoL1ToL2Alias(address(this)),
address(this),
NON_ZERO_ADDRESS,
NON_ZERO_VALUE,
NON_ZERO_GASLIMIT,
Expand Down

0 comments on commit 5c61846

Please sign in to comment.