Why is only the first call frame aliased? #414
-
Did you check the documentation?
Did you read the specs?
Did you check for duplicate questions?
Issue DescriptionBecause addresses can be impersonated cross-chain, rollups have to alias addresses when L1 to L2 transactions are performed. From the docs:
Why is the address aliased only within first call frames and not internal txs, too? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hello! The document explains the behavior of the OP Stack's opcode. Internal txs occur entirely within L2, so aliasing is not necessary in these cases. |
Beta Was this translation helpful? Give feedback.
-
I believe this security measure was meant to protect from spoofing the
|
Beta Was this translation helpful? Give feedback.
-
It's easier to say that And on the first call frame, But on subsequent call (internal transactions), You can think of that aliased address as an EOA calling the contract on L2, it will behave exactly same like this. |
Beta Was this translation helpful? Give feedback.
It's easier to say that
tx.origin
get aliased, notmsg.sender
And on the first call frame,
msg.sender
==tx.origin
But on subsequent call (internal transactions),
msg.sender
is equal to the contract that call another contract which may not equal to the aliasestx.origin
You can think of that aliased address as an EOA calling the contract on L2, it will behave exactly same like this.