Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion with Harmony #28

Open
42 tasks
lastmjs opened this issue Oct 20, 2018 · 0 comments
Open
42 tasks

Discussion with Harmony #28

lastmjs opened this issue Oct 20, 2018 · 0 comments

Comments

@lastmjs
Copy link
Owner

lastmjs commented Oct 20, 2018

  • What is WebAssembly
  • It's an ISA and a bytecode
  • What is a bytecode
  • Portability of WebAssembly
  • size and load-time-efficient binary format
  • VM sandbox
    • Certain exploits are not possible
    • By default WebAssembly has access to nothing (look into what it actually has access to)
  • Maps well to underlying ISAs
  • MVP release in all browsers, with at least 6 other implementations as of March, probably more now
    • Good support for C, C++, Rust (systems languages)
  • Other features coming, like garbage collection and threads
  • Go 1.11 has experimental support for WebAssembly
  • Blockchain projects using WebAssembly
    • Ethereum
    • DFINITY
    • EOS
    • Polkadot
    • Hyperledger
    • Truebit
  • Why WebAssembly for blockchain?
    • Consolidation around a common ISA, network effects for tooling, standardization, etc
    • Easy to make deterministic (get rid of a few op codes as far as I understand)
    • Efficient (more efficient than the EVM because of EVM only supported 256 bit number types)
    • Secure (VM sandbox)
    • Easy to support a variety of languages
  • Problems with the EVM
    • Cost of certain common operations that smart contracts might want to do are too expensive on the EVM, get around that with precompiles, which creates a fixed cost that is less than the true cost for certain operations/contracts)
    • Small number of languages target the EVM
    • Not modeled after any actual machine??? I'm not sure why that's important
    • There are high level instructions in the EVM instruction set...you don't really want high level instructions in your ISA (why?)
    • Only supports 256 bit stack items (WASM 64 or 32 bit), doesn't map well to underlying microarchitectures, and so metering is difficult to determine. The actual cost of the computation is difficult to determine
    • Runtime metering is slow
  • eWASM
    • WebAssembly is the same
      • Apparently no instructions are removed, but contracts must be approved before they are executed
    • Does not allow non-determinism
      • Static/compile time analysis will determine non-deterministic features like floating points, and that contract will not be allowed to run
    • Define an interface for interacting with Ethereum (EEI, Ethereum Environment Interface)
      • Interactions with the Ethereum environment are performed by calls to imported functions
    • Metering is calculated before runtime
    • Contract bytecode is transformed to include gas usage calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant