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

Add ewasm support #923

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add ewasm support #923

wants to merge 1 commit into from

Conversation

lrettig
Copy link
Contributor

@lrettig lrettig commented Jun 18, 2018

Tie together the software packages (py-evm, juno, pywasm) and test
detecting WASM code and passing data and receiving data. One
stEWASMtests test (useGas) is passing so data is flowing in both
directions.

For now the nastiness lives mostly in another package called Juno (which is the Latin name of Hera, which is the EVMC "glue code" in C++). One of the things @poemm and I have been discussing is whether this "glue" code belongs in py-evm or not.

@poemm's pywebassembly lives at https://github.com/poemm/pywebassembly.

Cute Animal Picture

put a cute animal picture link inside the parentheses

Tie together the software packages (py-evm, juno, pywasm) and test
detecting WASM code and passing data and receiving data. One
stEWASMtests test (`useGas`) is passing so data is flowing in both
directions.
@@ -12,6 +12,7 @@
"eth-bloom>=1.0.0,<2.0.0",
"eth-utils>=1.0.1,<2.0.0",
"eth-typing>=1.0.0,<2.0.0",
"juno>=0.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, https://pypi.org/project/juno/ seems to be something different, no? Where is that dependency coming from?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok I see it is here: https://github.com/lrettig/juno But then, how does that fit in with that juno package on pypi that seems to be occupied by something else, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't. Two different things, no connection. The name can be changed :) I'm just running this locally, no pypi.

@pipermerriam
Copy link
Member

This seems like a good place to dump some brief thoughts.

  1. The code quality of the python ewasm interpreter is pretty poor. Acceptable for a POC, will require lots of work for much beyond that.
  2. In this model, the computation object no longer contains accurate information about what happened during computation. This is going to be problematic in many places and is something we will need to explore fixing. Losing this information is not something I'm inclined to accept lightly as it is very valuable information.
  3. Very cool to see how easy this was to glue together, though I expect (as stated in my previous two points) that real integration may be significantly more complex.

@lrettig
Copy link
Contributor Author

lrettig commented Jun 20, 2018

In this model, the computation object no longer contains accurate information about what happened during computation. This is going to be problematic in many places and is something we will need to explore fixing. Losing this information is not something I'm inclined to accept lightly as it is very valuable information.

Completely agree. I wouldn't even call this hacky thing a "model." Agree this is important to maintain if possible.

@poemm
Copy link

poemm commented Jun 22, 2018

Dear @pipermerriam ,

Thank you for your message. My responses follow.

  1. I sincerely apologize for not explaining the motivations behind the way in which PyWebAssembly was written. PyWebAssembly follows the Wasm Spec document closely, referencing where each function was defined. This is useful for the following reasons.
    i) The Spec document can be used as a user's manual.
    ii) PyWebAssembly can be audited alongside the Spec document.
    iii) When Wasm 1.1 is released, PyWebAssembly can be updated alongside the Spec document.
    iv) PyWebAssembly does not introduce invariants or design decisions that are not in the Spec document. There are many subtleties in the 150 page Spec document, and invariants may be difficult to maintain, as I have learned.
    v) Implementing the Spec document has allowed me to find errors and submit fixes to the Spec document, and I have more fixes coming.
    PyWebAssembly is also structured for my personal economy-of-thought as it is being developed and studied for errors. I do not know any better than to follow the Spec document, but I have a lot to learn, and I am eager to improve myself.
    In any case, PyWebAssembly was brought to your attention because it is 100% finished for your purposes, modulo tracing which is to-be-done, and some tests which are not applicable to your application. This is not to speak of aesthetics.

  2. Tracing Wasm execution is possible at the granularity of opcodes. When testing, I step through execution of each opcode, printing the operand stack and other info. I am open to your suggestions on how to implement tracing in a way which meets your parameters and specifications.

  3. Lane is skilled at quickly gluing code together. Full integration may be complex because Wasm has different structure and properties than EVM, and it may be difficult to honor the invariants and designs which you have specified for EVM. Because of this complexity and resulting difficulty, I am willing to offer assistance in your project, although I do not wish to hinder your progress, nor do I wish to create any feelings of obligation.

I wish you only the best success.

Sincerely,
@poemm

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

Successfully merging this pull request may close these issues.

4 participants