You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related, I don't see where it is documented that msg.destination passed to call must be replaced by a different value in the host before it passes the (copied) message on to execute, when doing DELEGATECALL or CALLCODE. (In call, the host needs to know the code address from the VM, but in execute the child VM needs to know the account address for get_storage etc.)
It would be helpful if the comment for evmc_message::destination in evmc.h mentioned this dual role. As it is, I had to read some implementions to confirm this is what the host is expected to do.
Because the host has to keep track of the current account address for DELEGATECALL anyway, this makes the address parameter in get_storage, set_storage, selfdestruct and access_storage redundant. At least it's cheap to pass, being a pointer.
Knowing the only permitted value supports an optimisation in the host: It can ignore the address parameter and keep an account object handy instead of looking it up on each call.
In the DELEGATECALL (and legacy CALLCODE) there are 3 addresses involved:
msg.destination
),msg.sender
).The current address is not provided in the
msg
so the Host has to store it on its own.The text was updated successfully, but these errors were encountered: