Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVM opcode: designated invalid instruction #141

Closed
axic opened this issue Aug 29, 2016 · 8 comments
Closed

EVM opcode: designated invalid instruction #141

axic opened this issue Aug 29, 2016 · 8 comments

Comments

@axic
Copy link
Member

axic commented Aug 29, 2016

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.

@gcolvin
Copy link
Contributor

gcolvin commented Sep 8, 2016

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
Copy link
Member Author

axic commented Sep 8, 2016

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
Copy link
Member Author

axic commented Sep 8, 2016

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.

@gcolvin
Copy link
Contributor

gcolvin commented Sep 8, 2016

I am fine with picking one instruction to stay unimplemented.

@axic
Copy link
Member Author

axic commented Jan 25, 2017

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

@chriseth
Copy link
Contributor

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

@axic
Copy link
Member Author

axic commented Jan 26, 2017

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

benjaminion added a commit to benjaminion/solidity that referenced this issue Jun 7, 2017
EIP-141 ethereum/EIPs#141 has preserved 0xfe as an invalid opcode for aborting EVM execution. The EVM assembler supports this via the INVALID opcode. 

The LLL "panic" expression used to generate a jump to an invalid location in order to abort EVM execution.  This change brings "panic" into line with EIP-141 by generating the INVALID opcode instead.
benjaminion added a commit to benjaminion/solidity that referenced this issue Jun 9, 2017
    EIP-141 ethereum/EIPs#141 has preserved 0xfe as an invalid opcode for aborting EVM execution. The EVM assembler supports this via the INVALID opcode.

    The LLL "panic" expression used to generate a jump to an invalid location in order to abort EVM execution.  This change brings "panic" into line with EIP-141 by generating the INVALID opcode instead.
benjaminion added a commit to benjaminion/solidity that referenced this issue Jun 13, 2017
EIP-141 ethereum/EIPs#141 has preserved 0xfe as an invalid opcode for aborting EVM execution. The EVM assembler supports this via the INVALID opcode.

The LLL "panic" expression used to generate a jump to an invalid location in order to abort EVM execution.  This change brings "panic" into line with EIP-141 by generating the INVALID opcode instead.
benjaminion added a commit to benjaminion/solidity that referenced this issue Jun 13, 2017
EIP-141 ethereum/EIPs#141 has preserved 0xfe as an invalid opcode for aborting EVM execution. The EVM assembler supports this via the INVALID opcode.

The LLL "panic" expression used to generate a jump to an invalid location in order to abort EVM execution.  This change brings "panic" into line with EIP-141 by generating the INVALID opcode instead.
@axic
Copy link
Member Author

axic commented Jul 29, 2017

This was merged in via #216.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants