evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Should EVMC_DELEGATED propagate through DELEGATECALL / CALLCODE?

Open Haxatron opened this issue 4 months ago • 1 comments

When a delegated EOA performs DELEGATECALL / CALLCODE, the EVMC_DELEGATED flag is lost -

https://github.com/ipsilon/evmone/blob/9ce7bfa91b751c366143808b779f09f729e09195/lib/evmone/instructions_calls.cpp#L120-L123

Should this be the case? Technically the DELEGATECALL / CALLCODE is called within the context of the delegated EOA, so it would make sense that DELEGATECALL / CALLCODE should inherit the EVMC_DELEGATED flag from its parent call frame.

Also another case - If a call frame without EVMC_DELEGATED flag executes a DELEGATECALL to a delegated EOA, should the DELEGATECALL call frame have the EVMC_DELEGATED flag?

Haxatron avatar Sep 01 '25 09:09 Haxatron

There is not much logic to this. This flag is needed because the EIP-7702 has special handling of precompiles. I.e. we use this flag only not to execute a precompile even though it is being called.

chfast avatar Sep 02 '25 12:09 chfast