ewasm / testnet

Testnet planning & documentation
64 stars 19 forks source link

Geth support #15

Closed axic closed 5 years ago

axic commented 6 years ago

Apparently native ewasm support in geth could be implemented by using wagon (a wasm interpreter written in Go).

@gballet volunteered to look into this

The tasks are:

For an inspiration see https://github.com/ewasm/hera which does the same thing using binaryen.

gballet commented 6 years ago

Having a look at wagon, it seems to do the job but it panics if it encounters a fault. This is a problem if we are going to use it to run contracts, because we can't have geth panic if some contract code is broken.

I have submitted this PR https://github.com/go-interpreter/wagon/pull/53

gballet commented 6 years ago

This gist shows a unit test that demonstrates how to create a module that offers native functions. So far, that requires making some changes to the wagon code. I will clean up the code and create a PR this week, to get some feedback from the wagon team.

gballet commented 6 years ago

Regarding the panic, the wagon team requested a different approach that is tracked in https://github.com/go-interpreter/wagon/pull/57

axic commented 6 years ago

Great news!

gballet commented 6 years ago

https://github.com/go-interpreter/wagon/pull/58 is the cleaned-up PR asking the wagon people for their comments. I still need to make sure that functions with parameters can be properly called, and then I can start implementing the EEI methods.

gballet commented 6 years ago

both PRs are now integrated, I can now proceed with the EEI

lrettig commented 6 years ago

@gballet update from today: Working on EEI, done with the easy part. Looking into contracts calling other contracts.

gballet commented 6 years ago

Looks like this was missing a reference to the PR that integrates wagon into geth: https://github.com/ethereum/go-ethereum/pull/16957

axic commented 5 years ago

Closing this now.