Skip to content

Commit 54cdb97

Browse files
author
wanderer
authored
Merge pull request #42 from ethereum/backwardsCompatibility
Add backwards compatibility page
2 parents e68c522 + f50d5de commit 54cdb97

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ eWASM:
2525
* specifies an [Ethereum environment interface](./eth_interface.md) to facilitate interaction with the Ethereum environment from an *eWASM contract*
2626
* specifies [metering](./metering.md) for instructions
2727
* and aims to restrict [non-deterministic behavior](https://github.com/WebAssembly/design/blob/master/Nondeterminism.md)
28+
* specifies a backwards compatible upgrade path to EVM1
2829

2930
### Goals of the eWASM project
3031

@@ -50,6 +51,7 @@ eWASM:
5051
* [Rationale](./rationale.md)
5152
* [Ethereum environment interface](./eth_interface.md)
5253
* [eWASM Contract Interface](./contract_interface.md)
54+
* [Backwards compatibility instructions](./backwardsCompatibility.md)
5355
* [Original Proposal](https://github.com/ethereum/EIPs/issues/48) (EIP#48)
5456
* [WebAssembly design documents](https://github.com/WebAssembly/design)
5557

backwardsCompatibility.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Backwards Compatibility
2+
The current approach to achieving backwards compatibility with EVM1 is to
3+
support both of the instruction sets with the option to transcompiling EVM1 to
4+
eWASM. This approach gives clients optionality when dealing with EVM1 code.
5+
A client can either implement only an eWASM VM and transcompile all of the EVM1
6+
code. Or a client can implement a eWASM VM and EVM1 VM and leave the old code as
7+
is.
8+
9+
## Gas Prices
10+
In eWASM we will introduce sub-gas units so that each EVM1 opcode's
11+
transcompiled equivalent eWASM's gas cost is less then the original EM1 opcode's
12+
cost. The fee schedule for eWASM is yet to be specified.
13+
14+
## Identification of code
15+
We assume there is some sort of code handler function that all clients have
16+
implemented. The code handler identifies the instruction set type by whether it
17+
starts with WASM's magic number or not.
18+
19+
The WASM magic number is the following byte sequence: `0x00, 0x61, 0x73, 0x6d`.
20+
21+
## Solidity
22+
Support of compiling to eWASM can be accompilshed by adding a new backend to
23+
the solidity compile. eWASM support for Solidity is part of the MVP.
24+
25+
## Transcompiler
26+
A post-MVP goal is to have the transcompiler it self become a contract by
27+
compiling it to eWASM. Once this is accomplished, EVM1 contracts created by
28+
the CREATE op will be transcompiled to eWASM. This will also allow us to assume
29+
that all EVM1 code is now transcompiled eWASM code, which should be reflected
30+
in the state root since the has of the code is stored in the Merkle trie. Note:
31+
this should still allow clients to fallback to EVM1 VMs if running EVM1 code.

0 commit comments

Comments
 (0)