- catch 22: in order to verify that evm2wasm works correctly, need working vm implementation (hera/ewasm-kernel). working vm implementation needs to be tested, which requires transcompilation of state tests. Correct transcompilation of state tests to ewasm depends on correct implementation of evm2ewasm transcompiler...
- EthereumJS: new development approach: Instead of integrating EWASM within EthereumJS VM, pull necessary parts of EthereumJS VM (state management) into ewasm kernel.
In EthereumJS-VM, execution of a transaction goes something like this:
runTx():
-> create a global execution context (stateManager) for things like accumulating touched accounts, facillitating access to the state trie, etc..
runCall():
-> create a runState (the execution context for the current contract)
run some ops:
PUSH
PUSH
ADD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
returndatacopy_following_failing_call | |
returndatacopy_after_failing_delegatecall | |
returndatasize_after_failing_delegatecall | |
returndatasize_after_failing_callcode | |
returndatacopy_after_failing_callcode | |
returndatasize_after_failing_staticcall | |
CREATE_AcreateB_BSuicide_BStore-0 | |
RevertRemoteSubCallStorageOOG2-0 | |
RevertRemoteSubCallStorageOOG-0 | |
RevertSubCallStorageOOG-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sealEngine": "Ethash", | |
"params": { | |
"accountStartNonce": "0x00", | |
"maximumExtraDataSize": "0x20", | |
"homesteadForkBlock": "0x00", | |
"EIP150ForkBlock": "0x00", | |
"EIP158ForkBlock": "0x00", | |
"byzantiumForkBlock": "0x00", | |
"minGasLimit": "0x5208", |
- {test name} - {test description
- getAddress - Transaction to account with code which calls
getAddress
and stores the result to storage
- getBlockHash - Transaction to account with code which calls
getBlockHash
with a value of 0 and stores the result to storage
- {test name} - {test description}
- getAddress - Transaction to account with code which calls
getAddress
and stores the result to storage
- getBlockHash - Transaction to account with code which calls
getBlockHash
with a value of 0 and stores the result to storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(import "ethereum" "storageStore" (func $storageStore (param i32 i32) )) | |
(import "ethereum" "useGas" (func $useGas (param i64))) | |
(global $cb_dest (mut i32) (i32.const 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module | |
(type (;0;) (func (param i32 i32))) | |
(type (;1;) (func)) | |
(import "ethereum" "return" (func (;0;) (type 0))) | |
(import "debug" "printMemHex" (func (;1;) (type 0))) | |
(func (;2;) (type 1) | |
i32.const 0 | |
i32.const 64228 | |
call 1 | |
i32.const 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"depth": "0", | |
"gas": "42949617472", | |
"gasCost": "2", | |
"memory": [], | |
"op": "ADDRESS", | |
"pc": "0", | |
"stack": [], | |
"storage": {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ETHEREUM_TEST_PATH=../../tests test/testeth -t GeneralStateTests -- --singlenet Byzantium --vm hera --evmc evm2wasm.js=true --evmc evm2wasm.js-trace=true --evmc fallback=false --singletest /home/jwasinger/projects/tests/GeneralStateTests/stCallCodes/callcall_00.json callcall_00 | |
Test Case "customTestSuite": | |
Calling evm2wasm.js (input 39 bytes)... | |
(Calling evm2wasm.js with command: evm2wasm.js -e /tmp/hera.evm2wasm.evm.n13pah -o /tmp/hera.evm2wasm.wasm.3NJWEo --charge-per-op --trace) | |
evm2wasm.js done (output 1460 bytes) | |
Executing... | |
importGlobals | |
useGas 3 | |
evmTrace |