EIP-3670: EOF - Code Validation

This is the discussion topic for

Since EIP-3670 was added to the CFI (Considered for Inclusion) list for Shanghai today, Iā€™d like to raise a question regarding this in the rationale:

The deprecated CALLCODE (0xf2) opcode may be dropped from the valid_opcodes list to prevent use of this instruction in future. Likewise SELFDESTRUCT (0xff) could also be rejected. Yet we decided not to mix such changes in.

It would be nice to disallow these two instructions, which means EOF contracts containing those instructions cannot be deployed. (Legacy contracts are unaffected.)

I think CALLCODE is a no brainer.

SELFDESTRUCT is a more complicated topic, depending on the fate of it, it may become a feature for sending value without triggering execution. I personally think that is not a good idea, so would propose to reject that in EOF.


Furthermore, depending on other proposals it would be possible to restrict further instructions:

  • PC if EIP-4200 is adopted
  • JUMPDEST if either EIP-3690 or EIP-4200+EIP-4750 is adopted

If an instruction is deprecated then I think that almost by definition a contract that uses them is invalid, and therefore should not pass code validation.

EVM Object Format (EIP-3540 & EIP-3670) with @gumb0 @axic @chfast

1 Like