Skip to content

VIP: EVM Ruleset Switch #1230

@fubuloubu

Description

@fubuloubu

Simple Summary

People need to produce code for different versions of the EVM

Abstract

Provide an interface to switch the VM rulesets used to compile, validate, and produce bytecode for a given source program.

Motivation

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 py-evm, but that is out of scope for now.

Specification

Solidity has --evm-version VM_NAME flag:

$ 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:

  1. The source program is compiled and/or statically analyzed for features at the AST or IR (LLL) layer
  2. Features that are not possible in the chosen ruleset raise an exception
  3. Features that have alternative implementations in the chosen ruleset generate that alternative, and note the modification (vs. the default)

Backwards Compatibility

Fully backwards compatible

Dependencies

No dependancies on other VIPs

Copyright

Copyright and related rights waived via CC0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions