ethereum/EIPs

EVM opcode: designated invalid instruction

Closed this issue · 8 comments

axic commented

Overview

Designate 0xef 0xfe as an invalid instruction.

Rationale

An invalid instruction can be used to abort the execution (i.e. duplicates as an ABORT instruction). It is very similar to how an invalid jump behaves.

We have discussed this as part of EVM2.0 (ewasm/design#39), where it was suggested that we prepend any non-EVM code (such as WASM code) so that executing it as EVM1 will not cause undefined behaviour.

Do you want the VM to halt in an invalid instruction state or an invalid jump state? (The only other current choice is out of gass.) Or do want a new behavior entirely? I'd like a designated invalid instruction for other reasons, but it would behave like any other invalid instruction. I would also like an instruction I've been calling BREAKOUT which tells the EVM that what follows is code for some other VM. This seems more like what you need, but we would need a mechanism for finding that other VM.

axic commented

This issue didn't intend to introduce any new behaviour, just codify that 0xef will stay as a not implemented instruction and therefore will always trigger an invalid instruction error.

axic commented

I would also like an instruction I've been calling BREAKOUT which tells the EVM that what follows is code for some other VM.

I don't think we actually need that, but probably this belongs more to the evm2.0 discussions.

I am fine with picking one instruction to stay unimplemented.

axic commented

Because Serpent (rather recklessly) already used 0xfe let's change this EIP to use that too.

Is there a process to move this to "accepted"?

axic commented

In any case I'll write up a document in the new format.

axic commented

This was merged in via #216.