aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-04-04 17:15:23 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-04-04 17:15:23 +0800
commit52dc7cb452b5d717f825c259cd1b2dae9d5d70d8 (patch)
treee869320e4e37e7e06855970e4cc37721920865f6 /cmd
parentf6f7e7a8705294dae03d44dd4b1ea183b8d314b3 (diff)
parentbbeaab7e64f50fb303008b065894f58d7563c7ad (diff)
downloadgo-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar.gz
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar.bz2
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar.lz
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar.xz
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.tar.zst
go-tangerine-52dc7cb452b5d717f825c259cd1b2dae9d5d70d8.zip
Merge pull request #2378 from obscuren/enable-jit-a-b
cmd/utils, miner: A/B testing JIT VM. Disabled for miners
Diffstat (limited to 'cmd')
-rw-r--r--cmd/utils/flags.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 5c0c3c614..2f10938e3 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -22,11 +22,13 @@ import (
"io/ioutil"
"math"
"math/big"
+ "math/rand"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
+ "time"
"github.com/codegangsta/cli"
"github.com/ethereum/ethash"
@@ -659,6 +661,16 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
// Configure the Ethereum service
accman := MakeAccountManager(ctx)
+ // initialise new random number generator
+ rand := rand.New(rand.NewSource(time.Now().UnixNano()))
+ // get enabled jit flag
+ jitEnabled := ctx.GlobalBool(VMEnableJitFlag.Name)
+ // if the jit is not enabled enable it for 10 pct of the people
+ if !jitEnabled && rand.Float64() < 0.1 {
+ jitEnabled = true
+ glog.V(logger.Info).Infoln("You're one of the lucky few that will try out the JIT VM (random). If you get a consensus failure please be so kind to report this incident with the block hash that failed. You can switch to the regular VM by setting --jitvm=false")
+ }
+
ethConf := &eth.Config{
ChainConfig: MustMakeChainConfig(ctx),
Genesis: MakeGenesisBlock(ctx),
@@ -673,7 +685,7 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
ExtraData: MakeMinerExtra(extra, ctx),
NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name),
DocRoot: ctx.GlobalString(DocRootFlag.Name),
- EnableJit: ctx.GlobalBool(VMEnableJitFlag.Name),
+ EnableJit: jitEnabled,
ForceJit: ctx.GlobalBool(VMForceJitFlag.Name),
GasPrice: common.String2Big(ctx.GlobalString(GasPriceFlag.Name)),
GpoMinGasPrice: common.String2Big(ctx.GlobalString(GpoMinGasPriceFlag.Name)),