aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorNick Johnson <arachnid@notdot.net>2017-01-17 19:19:50 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-01-17 19:19:50 +0800
commit17d92233d9e64b642fed9a992556f7ff7d6fda18 (patch)
treee655a85d9d31c3377aef21b441c8b2c44df0aeff /cmd
parent26d385c18b5eb003d9a69ff618c78acbe594db44 (diff)
downloaddexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.gz
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.tar.zst
dexon-17d92233d9e64b642fed9a992556f7ff7d6fda18.zip
cmd/geth, core: add support for recording SHA3 preimages (#3543)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go1
-rw-r--r--cmd/geth/usage.go1
-rw-r--r--cmd/utils/flags.go8
3 files changed, 9 insertions, 1 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index a6b6331df..ac34d3035 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -132,6 +132,7 @@ func init() {
utils.VMForceJitFlag,
utils.VMJitCacheFlag,
utils.VMEnableJitFlag,
+ utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.RPCCORSDomainFlag,
utils.EthStatsURLFlag,
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index 853307604..5ebfc8919 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -155,6 +155,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.VMEnableJitFlag,
utils.VMForceJitFlag,
utils.VMJitCacheFlag,
+ utils.VMEnableDebugFlag,
},
},
{
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 01114a957..08b4db578 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
+ "github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
@@ -230,6 +231,10 @@ var (
Name: "jitvm",
Usage: "Enable the JIT VM",
}
+ VMEnableDebugFlag = cli.BoolFlag{
+ Name: "vmdebug",
+ Usage: "Record information useful for VM and contract debugging",
+ }
// Logging and debug settings
EthStatsURLFlag = cli.StringFlag{
Name: "ethstats",
@@ -741,6 +746,7 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) {
GpobaseCorrectionFactor: ctx.GlobalInt(GpobaseCorrectionFactorFlag.Name),
SolcPath: ctx.GlobalString(SolcPathFlag.Name),
AutoDAG: ctx.GlobalBool(AutoDAGFlag.Name) || ctx.GlobalBool(MiningEnabledFlag.Name),
+ EnablePreimageRecording: ctx.GlobalBool(VMEnableDebugFlag.Name),
}
// Override any default configs in dev mode or the test net
@@ -912,7 +918,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
if !ctx.GlobalBool(FakePoWFlag.Name) {
pow = ethash.New()
}
- chain, err = core.NewBlockChain(chainDb, chainConfig, pow, new(event.TypeMux))
+ chain, err = core.NewBlockChain(chainDb, chainConfig, pow, new(event.TypeMux), vm.Config{EnablePreimageRecording: ctx.GlobalBool(VMEnableDebugFlag.Name)})
if err != nil {
Fatalf("Could not start chainmanager: %v", err)
}