From da29332c5f4c368ff03ec4e7132eefac48fed1ae Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Thu, 20 Sep 2018 09:44:35 +0200 Subject: core/vm: add switches to select evm+ewasm interpreters (#17687) Interpreter initialization is left to the PRs implementing them. Options for external interpreters are passed after a colon in the `--vm.ewasm` and `--vm.evm` switches. --- eth/backend.go | 6 +++++- eth/config.go | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'eth') diff --git a/eth/backend.go b/eth/backend.go index 9926225f2..7d8060d77 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -149,7 +149,11 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { rawdb.WriteDatabaseVersion(chainDb, core.BlockChainVersion) } var ( - vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording} + vmConfig = vm.Config{ + EnablePreimageRecording: config.EnablePreimageRecording, + 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) diff --git a/eth/config.go b/eth/config.go index f1a402e37..efbaafb6a 100644 --- a/eth/config.go +++ b/eth/config.go @@ -121,6 +121,11 @@ type Config struct { // Miscellaneous options DocRoot string `toml:"-"` + + // Type of the EWASM interpreter ("" for detault) + EWASMInterpreter string + // Type of the EVM interpreter ("" for default) + EVMInterpreter string } type configMarshaling struct { -- cgit v1.2.3