aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-03-24 20:06:10 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2016-04-01 19:44:58 +0800
commitbbeaab7e64f50fb303008b065894f58d7563c7ad (patch)
treee10e1c48f411fa2b63313e4e27a4d3311ab04797 /miner
parentc58079461bafe508bea9233e2b81852df5188f57 (diff)
downloaddexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar.gz
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar.bz2
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar.lz
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar.xz
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.tar.zst
dexon-bbeaab7e64f50fb303008b065894f58d7563c7ad.zip
cmd/utils, miner: A/B testing JIT VM. Disabled for miners
This PR introduces a 10% probability that you'll run the client with the JIT enabled testing the new client and helps us potentially catch errors when reported. This feature is **disabled** for miners (disabling the JIT completely). The JIT can however be force for miners if they enable both --jitvm and --forcejit.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go10
1 files changed, 9 insertions, 1 deletions
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