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

vmConfig.EWASMInterpreter is not passed to NewEVM #1

Closed
cdetrio opened this issue Oct 28, 2018 · 5 comments
Closed

vmConfig.EWASMInterpreter is not passed to NewEVM #1

cdetrio opened this issue Oct 28, 2018 · 5 comments
Assignees

Comments

@cdetrio
Copy link

cdetrio commented Oct 28, 2018

To run geth + EVMC/Hera, geth accepts the path to the Hera .so file in a --vm.ewasm flag. This path to Hera is then passed in vmConfig when calling newBlockchain here:

go-ethereum/eth/backend.go

Lines 155 to 160 in 52dce7d

EWASMInterpreter: config.EWASMInterpreter,
EVMInterpreter: config.EVMInterpreter,
}
cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieNodeLimit: config.TrieCache, TrieTimeLimit: config.TrieTimeout}
)
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, eth.chainConfig, eth.engine, vmConfig, eth.shouldPreserve)

The problem is that another place where vmConfig is passed is from the rpc method eth_estimateGas, originating here: https://github.com/ewasm/go-ethereum/blob/tantalus-evmc6/internal/ethapi/api.go#L714. Here the vmConfig is empty, and it makes its way to NewEVM() here: https://github.com/ewasm/go-ethereum/blob/tantalus-evmc6/core/vm/evm.go#L135

As a temporary fix, in NewEVM() we're reading the Hera.so path from the env var EVMC_PATH, with this patch: bb778d6. But we'd like to read it from the --vm.ewasm flag instead.

@gballet
Copy link
Member

gballet commented Oct 28, 2018

have you tried accessing s.v.chainConfig().EWASMInterpreter?

@chfast
Copy link
Collaborator

chfast commented Nov 8, 2018

@gballet The ChainConfig object does not contains information about VM config.

The commit ethereum@0e9dad2 of ethereum#17955 should fix the problem. But it is still a workaround rather for a complete solution.

@gballet
Copy link
Member

gballet commented Nov 8, 2018

@chfast ChainConfig does contain the info about the VM config, since the PR that you refer to does exactly that: it extracts the vmConfig from the chain config.

Once again, we agreed with @axic @karalabe and @holiman that fork rules were the way to go and your fix would activate WASM on pre-fork blocks, which must be prevented. Just setting EWASMBlock to 0 does the trick and it works fine with wagon.

@gballet gballet self-assigned this Dec 5, 2018
@gballet
Copy link
Member

gballet commented Dec 6, 2018

Merged ethereum#17955 @cdetrio please check if you still see this issue.

@cdetrio
Copy link
Author

cdetrio commented Dec 6, 2018

it was fixed, thanks!

@cdetrio cdetrio closed this as completed Dec 6, 2018
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

3 participants