Skip to content

Instantly share code, notes, and snippets.

View jwasinger's full-sized avatar
💭
👍

jwasinger

💭
👍
View GitHub Profile
@jwasinger
jwasinger / notes.md
Created December 19, 2017 19:48
EWASM Weekly Meeting - December 19th 2017
  • 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.
@jwasinger
jwasinger / design.md
Last active December 21, 2017 20:31
EWASM-kernel design

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
@jwasinger
jwasinger / invalid.txt
Created January 9, 2018 16:28
Invalid EWASM tests
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
@jwasinger
jwasinger / ewasm-testnet-cpp-config.json
Last active January 22, 2018 14:51
genesis-sentinel-contract
{
"sealEngine": "Ethash",
"params": {
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"homesteadForkBlock": "0x00",
"EIP150ForkBlock": "0x00",
"EIP158ForkBlock": "0x00",
"byzantiumForkBlock": "0x00",
"minGasLimit": "0x5208",
@jwasinger
jwasinger / doc.md
Last active January 24, 2018 14:33

EWASM Test Cases:

{interface method}

  • {test name} - {test description

getAddress

  • getAddress - Transaction to account with code which calls getAddress and stores the result to storage

getBlockHash (should this be a Blockchain test?)

  • getBlockHash - Transaction to account with code which calls getBlockHash with a value of 0 and stores the result to storage
@jwasinger
jwasinger / ewasm-test-cases.md
Created January 25, 2018 09:46
EWASM Test Cases

EWASM Test Cases:

{interface method}

  • {test name} - {test description}

getAddress

  • getAddress - Transaction to account with code which calls getAddress and stores the result to storage

getBlockHash (should this be a Blockchain test?)

  • getBlockHash - Transaction to account with code which calls getBlockHash with a value of 0 and stores the result to storage
(module
(import "ethereum" "storageStore" (func $storageStore (param i32 i32) ))
(import "ethereum" "useGas" (func $useGas (param i64)))
(global $cb_dest (mut i32) (i32.const 0))
(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
@jwasinger
jwasinger / Cpp VM trace
Created April 25, 2018 20:47
VM Trace for RevertInCreateInInit
[
{
"depth": "0",
"gas": "42949617472",
"gasCost": "2",
"memory": [],
"op": "ADDRESS",
"pc": "0",
"stack": [],
"storage": {}
@jwasinger
jwasinger / gist:6694b210551e12916847227edde7483b
Created May 9, 2018 00:45
callcall_00 evm2wasm test output
# 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