diff options
-rw-r--r-- | cmd/geth/main.go | 1 | ||||
-rw-r--r-- | cmd/geth/usage.go | 2 | ||||
-rw-r--r-- | cmd/utils/flags.go | 14 | ||||
-rw-r--r-- | miner/worker.go | 10 | ||||
-rw-r--r-- | p2p/rlpx.go | 10 |
5 files changed, 25 insertions, 12 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 3a6366f4d..645743c13 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -312,6 +312,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.MiningEnabledFlag, utils.MiningGPUFlag, utils.AutoDAGFlag, + utils.TargetGasLimitFlag, utils.NATFlag, utils.NatspecEnabledFlag, utils.NoDiscoverFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index a31532bea..e2adf7305 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -121,10 +121,10 @@ var AppHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ utils.MiningEnabledFlag, utils.MinerThreadsFlag, - utils.TargetGasLimitFlag, utils.MiningGPUFlag, utils.AutoDAGFlag, utils.EtherbaseFlag, + utils.TargetGasLimitFlag, utils.GasPriceFlag, utils.ExtraDataFlag, }, 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 := ð.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)), diff --git a/miner/worker.go b/miner/worker.go index c45945b87..a5e2516fe 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -662,7 +662,15 @@ func (env *Work) commitTransactions(mux *event.TypeMux, transactions types.Trans func (env *Work) commitTransaction(tx *types.Transaction, bc *core.BlockChain, gp *core.GasPool) (error, vm.Logs) { snap := env.state.Copy() - receipt, logs, _, err := core.ApplyTransaction(env.config, bc, gp, env.state, env.header, tx, env.header.GasUsed, env.config.VmConfig) + + // this is a bit of a hack to force jit for the miners + config := env.config.VmConfig + if !(config.EnableJit && config.ForceJit) { + config.EnableJit = false + } + config.ForceJit = false // disable forcing jit + + receipt, logs, _, err := core.ApplyTransaction(env.config, bc, gp, env.state, env.header, tx, env.header.GasUsed, config) if err != nil { env.state.Set(snap) return err, nil diff --git a/p2p/rlpx.go b/p2p/rlpx.go index ddfafe9a4..2a9bdc121 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -31,7 +31,6 @@ import ( "io" mrand "math/rand" "net" - "os" "sync" "time" @@ -262,8 +261,6 @@ func (h *encHandshake) staticSharedSecret(prv *ecdsa.PrivateKey) ([]byte, error) return ecies.ImportECDSA(prv).GenerateShared(h.remotePub, sskLen, sskLen) } -var configSendEIP = os.Getenv("RLPX_EIP8") != "" - // initiatorEncHandshake negotiates a session token on conn. // it should be called on the dialing side of the connection. // @@ -274,12 +271,7 @@ func initiatorEncHandshake(conn io.ReadWriter, prv *ecdsa.PrivateKey, remoteID d if err != nil { return s, err } - var authPacket []byte - if configSendEIP { - authPacket, err = sealEIP8(authMsg, h) - } else { - authPacket, err = authMsg.sealPlain(h) - } + authPacket, err := sealEIP8(authMsg, h) if err != nil { return s, err } |