Code Monkey home page Code Monkey logo

evm2wasm's People

Contributors

axic avatar cdetrio avatar chfast avatar esteve avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jwasinger avatar kyteague avatar lrettig avatar ltfschoen avatar zixuanzh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evm2wasm's Issues

An in-range update of standard is breaking the build 🚨

Version 10.0.3 of standard just got published.

Branch Build failing 🚨
Dependency standard
Current Version 10.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As standard is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v10.0.3
  • Internal changes (incremented dependency versions)
Commits

The new version differs by 99 commits.

  • 91e80a1 10.0.3
  • 82a0d5c changelog
  • d22676e Merge pull request #963 from daper/patch-1
  • cfb84fe Remove tilde to lock down eslint-config-standard-jsx version
  • 4a6e0d0 Update dependecy of eslint-config-standard-jsx
  • ac9e09e Merge pull request #961 from igorsantos07/patch-1
  • 873bc9b Adding valid example for no-unsafe-negation
  • f00b169 more feross/standard -> standard/standard
  • 9770303 Merge pull request #954 from standard/security
  • 8cc2285 Add a security policy
  • 2fa8b0f change more feross/standard -> standard/standard
  • e79a692 Merge branch 'devjin0617-translation-kr'
  • 34490f7 Merge branch 'translation-kr' of https://github.com/devjin0617/standard into devjin0617-translation-kr
  • 6d59566 Merge pull request #953 from standard/translations
  • 3895bc6 move english readme/rules to docs/ folder

There are 99 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Make deploy + Solidity dispatcher EVM code to transcompile

The standard deploy (copycode) and Solidity's dispatcher is the bare minimum code included in every Solidity compiled code.

Example:

contract WASMTest {
    function() {
        throw;
    }
}

Compiles to: 606060405260188060106000396000f360606040523615600d57600d565b60165b6002565b565b00

This requires the following opcodes:

  • STOP
  • ISZERO
  • CALLDATASIZE
  • CODECOPY
  • MSTORE
  • JUMP
  • JUMPI
  • JUMPDEST
  • PUSH
  • DUP
  • RETURN

It is probably a good idea supporting these first.

Include simple pattern matching based optimisation rules

Goal would be to replace constant arithmetic patterns, such as:

  • PUSH X, PUSH Y, EXP -> PUSH X**Y, PUSH X, PUSH Y, ADD -> PUSH X+Y, etc.
  • PUSH X, POP -> remove
  • PUSH X, PUSH 0, EQ -> PUSH X, ISZERO
  • see the other rules in solidity/libevmasm

It is true that Solidity will do these optimisations, but:

  • The optimiser can be turned off (and certain contracts are deployed without optimisations)
  • The optimiser in Solidity might miss some of these optimisations in certain versions

Memory management

In order to support MSTORE/MLOAD we need to properly manage memory.

A simplistic approach is to allocate the first 32768 bytes of memory for the stack (stack limit is 1024 items, 256 bits each). The memory for MSTORE/MLOAD then starts from offset 32768.

Alternatively the opcodes themselves could have a parameter for memory offset. This should be calculated by the transcompiler.

An in-range update of ethereumjs-vm is breaking the build 🚨

Version 2.2.0 of ethereumjs-vm just got published.

Branch Build failing 🚨
Dependency ethereumjs-vm
Current Version 2.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ethereumjs-vm is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 79 commits.

  • 7041680 2.2.0
  • a25c4ed Merge pull request #154 from holgerd77/master
  • 4760718 Merge pull request #152 from gasolin/fix
  • 46eea0a Merge branch 'master' into fix
  • 6a60906 Merge pull request #157 from cdetrio/fix-cache-del
  • 09e1365 Update cache.js
  • 8a554b5 null address check before deleting account from trie
  • b487c8d Merge remote-tracking branch 'upstream/master'
  • 5e9fa06 fix run-transactions-simple example and update README, fix #149
  • 9fc6e38 fix Block and Account links in README.md (#155)
  • 7f12684 EIP-6: Rename SUICIDE opcode (#153)
  • 51a6a0c Merge pull request #147 from jwasinger/wip/spurious-dragon
  • 853ec10 cleaner empty account conditional
  • 4a8d939 bump common package
  • 29004b6 Draft for release notes for upcoming EIP150/Spurious Dragon release(s)

There are 79 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Unit tests for bin/evm2wasm.js CLI

It would be really nice to have some unit tests for these to improve our test coverage. a basic test case for each option would suffice.

Stack management

Operations should ensure that the stack limit (1024 entries) is not exceeded.

manyFunctions100 vmtest failing

This one test is failing in the current master branch (e050d24):

evm2wasm/ master> npm run vmTests
> [email protected] vmTests /Users/lanerettig/wip/eth/evm2wasm
> node --expose-wasm --harmony ./tests/runVmTests.js
TAP version 13
# VMTESTS
...
# manyFunctions100 manyFunctions100
not ok 1425 Error: Command failed: /Users/lanerettig/wip/eth/evm2wasm/tools/wabt/bin/wat2wasm /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wast -o /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wasm
  ---
    operator: fail
    at: runner.catch.err (/Users/lanerettig/wip/eth/evm2wasm/tests/runVmTests.js:171:9)
    stack: |-
      Error: Error: Command failed: /Users/lanerettig/wip/eth/evm2wasm/tools/wabt/bin/wat2wasm /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wast -o /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wasm

          at Test.assert [as _assert] (/Users/lanerettig/wip/eth/evm2wasm/node_modules/tape/lib/test.js:225:54)
          at Test.bound [as _assert] (/Users/lanerettig/wip/eth/evm2wasm/node_modules/tape/lib/test.js:77:32)
          at Test.fail (/Users/lanerettig/wip/eth/evm2wasm/node_modules/tape/lib/test.js:318:10)
          at Test.bound [as fail] (/Users/lanerettig/wip/eth/evm2wasm/node_modules/tape/lib/test.js:77:32)
          at runner.catch.err (/Users/lanerettig/wip/eth/evm2wasm/tests/runVmTests.js:171:9)
          at <anonymous>
  ...

Attempting to run this command manually produces:

~/wip/eth/evm2wasm master> /Users/lanerettig/wip/eth/evm2wasm/tools/wabt/bin/wat2wasm /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wast -o /Users/lanerettig/wip/eth/evm2wasm/tmp/manyFunctions100.wasm
[1]    48249 segmentation fault  /Users/lanerettig/wip/eth/evm2wasm/tools/wabt/bin/wat2wasm  -o

Replace identity contract with wasm based memory copy

The identity contract is used for a cheap way of memory copy (gas cost 15 + length/32*3). We could detect a call to it during transcompilation and use a wasm based memcpy.

Drawback is it introduces the need for static analysis to find the parameters on the stack first.

An in-range update of ethereumjs-util is breaking the build 🚨

Version 5.1.3 of ethereumjs-util was just published.

Branch Build failing 🚨
Dependency ethereumjs-util
Current Version 5.1.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

ethereumjs-util is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v5.1.3 - Maintenance Release
  • ES6 syntax updates
  • Dropped Node 5 support
  • Moved babel to dev dependencies, switched to env preset
  • Usage of safe-buffer instead of Node Buffer
  • Do not allow capital 0X as valid address in isValidAddress()
  • New methods zeroAddress() and isZeroAddress()
  • Updated dependencies
Commits

The new version differs by 40 commits.

  • 3e72947 Release commit for v5.1.3
  • 279ac78 Updated deprecated babel es2015 to env preset
  • 3d05254 chore(package): update babelify to version 8.0.0
  • aed81b9 Merge pull request #106 from ethereumjs/greenkeeper/karma-2.0.0
  • acc9130 chore(package): update karma to version 2.0.0
  • a65787d Merge pull request #102 from ethereumjs/greenkeeper/karma-detect-browsers-2.2.6
  • deb4019 chore(package): update karma-detect-browsers to version 2.2.6
  • 193a119 Merge pull request #98 from ethereumjs/greenkeeper/mocha-4.0.0
  • f0aafb0 Update travis to build with Node 8 (from Node 7)
  • 5d59ad6 Merge branch 'master' into greenkeeper/mocha-4.0.0
  • 9e6cda9 Merge pull request #96 from ethereumjs/greenkeeper/coveralls-3.0.0
  • 7f31795 Merge branch 'master' into greenkeeper/coveralls-3.0.0
  • 15d4085 Merge pull request #91 from ethereumjs/greenkeeper/documentation-5.2.0
  • 0c0f23f Rebuild docs with new documentation version
  • d75a4b2 Updated build:docs command to reflect syntax changes from updated documentation version

There are 40 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Rewrite in WASM or as a smart contract

Requiring every Ethereum node implementation to rewrite this Javascript project in their language of choice seems unrealistic.

Perhaps making this project available as a WASM piece of code makes sense, given WASM must be supported by nodes.

Ultimately for reducing/removing issues regarding consensus, this project should be deployed as a smart contract and invoked as such.

Supported instructions

  • CREATE
  • CALL
  • CALLCODE
  • DELEGATECALL
  • SELFDESTRUCT
  • SHA3
  • LOG*
  • GAS
  • GASPRICE
  • EXTCODECOPY
  • PC
  • ORIGIN
  • STOP
  • ADD
  • MUL
  • SUB
  • DIV
  • SDIV
  • MOD
  • SMOD
  • ADDMOD
  • MULMOD
  • EXP
  • SIGNEXTEND
  • LT
  • GT
  • SLT
  • SGT
  • EQ
  • ISZERO
  • AND
  • OR
  • XOR
  • NOT
  • BYTE
  • ADDRESS
  • BALANCE
  • CALLER
  • CALLVALUE
  • CALLDATALOAD
  • CALLDATASIZE
  • CALLDATACOPY
  • CODESIZE
  • CODECOPY
  • EXTCODESIZE
  • BLOCKHASH
  • COINBASE
  • TIMESTAMP
  • NUMBER
  • DIFFICULTY
  • GASLIMIT
  • POP
  • MLOAD
  • MSTORE
  • MSTORE8
  • SLOAD
  • SSTORE
  • JUMP
  • JUMPI
  • MSIZE
  • JUMPDEST
  • PUSH*
  • DUP*
  • SWAP*
  • RETURN

Endianness issue in bswap_m256

Logging this to track the conversation yesterday in gitter:

@axic Mar 21 18:38 very likely evm2was has endianess issues
@hugo-dc Mar 21 18:52 i’ve just confirmed storage is the problem, fill the tests expecting "0x" : β€œ0x0200000000000000000000000000000000000000000000000000000000000000” in storage, and the test case pass
@jwasinger Mar 21 19:19 I have the fix. the endianness is being flipped by bswap_m256 : ;; generated by ./wasm/generateInterface.js\n(func $SSTORE (call $storageStore(call $bswap_m256 (get_global $sp))(call $bswap_m256 (i32.add (get_global $sp) (i32.const -32)))))

An in-range update of tape is breaking the build 🚨

Version 4.8.0 of tape just got published.

Branch Build failing 🚨
Dependency tape
Current Version 4.7.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tape is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits.

  • 342c89a v4.8.0
  • c82c593 [Dev Deps] update js-yaml
  • b50084c [Deps] update resolve, object-inspect
  • bd6db7b updates README.md and adds tap-html

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Transcompile MangoRepo

Would be a nice demonstration to use Mango. It requires the following opcodes:

  • ADD
  • AND
  • CALL
  • CALLDATACOPY
  • CALLDATALOAD
  • CALLDATASIZE
  • CALLER
  • CODECOPY
  • CODESIZE
  • DIV
  • DUP*
  • EQ
  • EXP
  • GT
  • ISZERO
  • JUMP
  • JUMPDEST
  • JUMPI
  • LT
  • MLOAD
  • MSTORE
  • MUL
  • NOT
  • OR
  • POP
  • PUSH*
  • RETURN
  • SHA3
  • SLOAD
  • SSTORE
  • STOP
  • SUB
  • SWAP*

Call/Create state tests are broken

Here is a full trace of the test case callcall_00:

jwasinger@certification-hive-test03:~/projects/cpp-ethereum/build$ ETHEREUM_TEST_PATH="../../tests" test/testeth -t GeneralStateTests/stCallCodes -- --vm hera --singlenet "Byzantium" --singletest 'callcall_00' --evmc evm2wasm.js=true --evmc fallback=false
Running 1 test case...
Test Case "stCallCodes":
100%
Executing...
importGlobals
evmTrace
{"depth":0,"gas":2979000,"gasCost":0,"op":96,"pc":0,"stack":[]}
useGas 3
evmTrace
{"depth":0,"gas":2978997,"gasCost":3,"op":96,"pc":2,"stack":["0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978994,"gasCost":6,"op":96,"pc":4,"stack":["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978991,"gasCost":9,"op":96,"pc":6,"stack":["0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978988,"gasCost":12,"op":96,"pc":8,"stack":["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978985,"gasCost":15,"op":115,"pc":10,"stack":["0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978982,"gasCost":18,"op":98,"pc":31,"stack":["0x0000000000000000000000001000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 3
evmTrace
{"depth":0,"gas":2978979,"gasCost":21,"op":241,"pc":35,"stack":["0x0000000000000000000000000000000000000000000000000000000000055730","0x0000000000000000000000001000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000040"]}
useGas 0
useGas 6
InternalError: Value exceeds 64 bits.
testeth: /home/jwasinger/projects/cpp-ethereum/libevm/EVMC.cpp:77: virtual dev::eth::owning_bytes_ref dev::eth::EVMC::exec(dev::u256&, dev::eth::ExtVMFace&, const OnOpFunc&): Assertion `r.status() >= 0' failed.
unknown location(0): fatal error: in "GeneralStateTests/stCallCodes": signal: SIGABRT (application abort requested)

The execution is compatible with Geth until after the CALLCODE op is executed.

An in-range update of async is breaking the build 🚨

Version 2.6.0 of async was just published.

Branch Build failing 🚨
Dependency async
Current Version 2.5.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

async is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Support new call interface

  • return values have been changed
  • return value isn't written to be a paramater but retrieved via returndatacopy

An in-range update of bn.js is breaking the build 🚨

Version 4.11.8 of bn.js just got published.

Branch Build failing 🚨
Dependency bn.js
Current Version 4.11.7
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As bn.js is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

  • c69b4ae 4.11.8
  • f49058f lib: remove obfuscation
  • 7e6f9d2 lib: properly exclude "buffer" from Webpack builds

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.