aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2018-09-20 15:44:35 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-20 15:44:35 +0800
commitda29332c5f4c368ff03ec4e7132eefac48fed1ae (patch)
treefc9a9d2bd594ef22f7b9d9fca8bd410c28304f99 /cmd
parent3fec73500b60c82a827b36bb03f8ae011b861e72 (diff)
downloaddexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar.gz
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar.bz2
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar.lz
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar.xz
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.tar.zst
dexon-da29332c5f4c368ff03ec4e7132eefac48fed1ae.zip
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.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go2
-rw-r--r--cmd/geth/usage.go2
-rw-r--r--cmd/utils/flags.go19
3 files changed, 23 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 134d5a4c0..fae4b5718 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -130,6 +130,8 @@ var (
utils.NoCompactionFlag,
utils.GpoBlocksFlag,
utils.GpoPercentileFlag,
+ utils.EWASMInterpreterFlag,
+ utils.EVMInterpreterFlag,
configFileFlag,
}
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index a674eca4f..8b0491ce3 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -207,6 +207,8 @@ var AppHelpFlagGroups = []flagGroup{
Name: "VIRTUAL MACHINE",
Flags: []cli.Flag{
utils.VMEnableDebugFlag,
+ utils.EVMInterpreterFlag,
+ utils.EWASMInterpreterFlag,
},
},
{
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 0fecae9aa..78fb629aa 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -610,6 +610,17 @@ var (
Usage: "InfluxDB `host` tag attached to all measurements",
Value: "localhost",
}
+
+ EWASMInterpreterFlag = cli.StringFlag{
+ Name: "vm.ewasm",
+ Usage: "External ewasm configuration (default = built-in interpreter)",
+ Value: "",
+ }
+ EVMInterpreterFlag = cli.StringFlag{
+ Name: "vm.evm",
+ Usage: "External EVM configuration (default = built-in interpreter)",
+ Value: "",
+ }
)
// MakeDataDir retrieves the currently requested data directory, terminating
@@ -1184,6 +1195,14 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
cfg.EnablePreimageRecording = ctx.GlobalBool(VMEnableDebugFlag.Name)
}
+ if ctx.GlobalIsSet(EWASMInterpreterFlag.Name) {
+ cfg.EWASMInterpreter = ctx.GlobalString(EWASMInterpreterFlag.Name)
+ }
+
+ if ctx.GlobalIsSet(EVMInterpreterFlag.Name) {
+ cfg.EVMInterpreter = ctx.GlobalString(EVMInterpreterFlag.Name)
+ }
+
// Override any default configs for hard coded networks.
switch {
case ctx.GlobalBool(TestnetFlag.Name):