Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
People need to produce code for different versions of the EVM
Provide an interface to switch the VM rulesets used to compile, validate, and produce bytecode for a given source program.
It is important for developers to be able to produce bytecode for different versions of the EVM. This may include for future hardfork implementations (such as constantinople), or for chains that still use past rules (ETC or permissioned networks like Quorum). It might also be eventually useful to specify more granular or custom rulesets via
$ solc --help ... --evm-version version Select desired EVM version. Either homestead, tangerineWhistle, spuriousDragon, byzantium (default) or constantinople. ...
I suggest we use this.
The technical details should be as such:
Fully backwards compatible
No dependancies on other VIPs
Copyright and related rights waived via CC0
Was taking a browse through. My initial thought was to check against the dict of opcodes for existence (to throw an error), then validate if there was an incorrect number of args for the opcode later down the line.
Definitely a lot of work to get it flawless, but arguable very necessary for supporting new hard forks and the like
That seems quite do-able, but then we'd create a dependency on py-evm for the base vyper install. For reference see: https://github.com/ethereum/py-evm/blob/master/eth/vm/forks/byzantium/opcodes.py
I say let's try to see what
implementation-wise, probably cleanest to make a new LLL pseudo-opcode for every new EVM feature we want to support, and then we only need to deal with the versioning at the LLL to EVM translation step, either emulate for older versions (e.g. for SELFBALANCE) or throw if not supported (e.g. CHAINID).