From 1a55bd8a98d570a0e0701bde4307e27146befed0 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Fri, 3 Apr 2026 09:18:24 +0100 Subject: [PATCH] allow `geth --evm.experimental` --- cmd/geth/main.go | 1 + cmd/utils/flags.go | 9 +++++++++ eth/backend.go | 1 + eth/ethconfig/config.go | 3 +++ 4 files changed, 14 insertions(+) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index b72cbb9885..188a5d1612 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -136,6 +136,7 @@ var ( utils.DeveloperGasLimitFlag, utils.DeveloperPeriodFlag, utils.VMEnableDebugFlag, + utils.VMEnableExperimentalInterpFlag, utils.VMTraceFlag, utils.VMTraceJsonConfigFlag, utils.VMWitnessStatsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index c1284044eb..67f1124d66 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -598,6 +598,12 @@ var ( Usage: "Record information useful for VM and contract debugging", Category: flags.VMCategory, } + VMEnableExperimentalInterpFlag = &cli.BoolFlag{ + Name: "evm.experimental", + Usage: "Enable the experimental EVM interpreter. This flag may be removed or changed without notice.", + Category: flags.VMCategory, + Hidden: true, + } VMTraceFlag = &cli.StringFlag{ Name: "vmtrace", Usage: "Name of tracer which should record internal VM operations (costly)", @@ -1892,6 +1898,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if ctx.IsSet(VMEnableDebugFlag.Name) { cfg.EnablePreimageRecording = ctx.Bool(VMEnableDebugFlag.Name) } + if ctx.IsSet(VMEnableExperimentalInterpFlag.Name) { + cfg.EnableExperimentalInterpreter = ctx.Bool(VMEnableExperimentalInterpFlag.Name) + } if ctx.IsSet(VMWitnessStatsFlag.Name) { cfg.EnableWitnessStats = ctx.Bool(VMWitnessStatsFlag.Name) } diff --git a/eth/backend.go b/eth/backend.go index e9bea59734..23b0267f0e 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -242,6 +242,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { TxLookupLimit: int64(min(config.TransactionHistory, math.MaxInt64)), VmConfig: vm.Config{ EnablePreimageRecording: config.EnablePreimageRecording, + EnableExperimentalInterpreter: config.EnableExperimentalInterpreter, }, // Enables file journaling for the trie database. The journal files will be stored // within the data directory. The corresponding paths will be either: diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 01aaaa751b..dc6485bd42 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -168,6 +168,9 @@ type Config struct { // Enables tracking of SHA3 preimages in the VM EnablePreimageRecording bool + // Enables the experimental EVM interpreter + EnableExperimentalInterpreter bool + // Enables collection of witness trie access statistics EnableWitnessStats bool