Virtual Machines on the Æternity blockchain
A smart contract is associated with a virtual machine for the execution of that contract. The Æternity blockchain supports the virtual machine AEVM - A version of the Ethereum VM. The AEVM can also use different ABIs, and it is versioned to ensure that runs on earlier version can still be run to validate the chain in the presence of consensus breaking VM changes.
A Create Contract transaction and the contract state tree contains a 'vm_version' field and an 'abi_version' field. These fields describes the type and version of the virtual machine to use for the contract and the type and version of the application binary interface (ABI) of the contract. (Note that the serialization packs the version into one integer.)
The current meaning of the VM field is:
|00||none||NO_VM ("Used" in oracles)|
|01||AEVM_01||For Sophia contracts on the AEVM|
|02||AEVM_01||For Solidity contracts on the AEVM|
|03||AEVM_02||Containing improvments of the AEVM for Sophia|
The current meaning of the ABI field is:
|00||raw string||No interpretation - used in oracles|
|01||Sophia_01||For Sophia contracts on the AEVM|
|02||Solidity_01||For Solidity contracts on the AEVM|
Which VM versions are accepted are different based on consensus protocol versions.
|Protocol version||Operation||Accepted VM values||Accepted ABI values|
The number after the machine name designates the version of the machine. In the future new versions of the machine can be implemented with new instructions, contracts using these machines must use a new vm_version number corresponding to the new machine version.
The ABI name correspond to the supported languages. All Ethereum VM languages uses the same ABI (Solidity_1). The languages can in the future be extended with new functionality and new ABIs reflected by the ABI version number.
The Æternity Ethereum Virtual Machine AEVM
See The AEVM.
Consensus breaking changes between AEVM versions
AEVM_01 -> AEVM_02
- Oracle query fee of unknown oracle
- AEVM_01: Succeeded with bogus value
- AEVM_02: Fails with exception