aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-13 22:05:56 +0800
committerobscuren <geffobscura@gmail.com>2015-02-13 22:05:56 +0800
commita5ea21cd85530eee6eb1bb83c37c20d009f11f74 (patch)
treee5be5bd595139ff7dfbe6261e1e659d8e7dd6f9c /core/state_transition.go
parentdb24fb792cf0dab91bc85e79aecf6758349002a4 (diff)
parent38faf2c51a1e4a86cda5dfa1b4f7fdae4fd7f58d (diff)
downloadgo-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.gz
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.bz2
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.lz
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.xz
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.zst
go-tangerine-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.zip
merge
Diffstat (limited to 'core/state_transition.go')
-rw-r--r--core/state_transition.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index 8b0ca2ac4..33dd45f02 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -10,6 +10,8 @@ import (
"github.com/ethereum/go-ethereum/vm"
)
+const tryJit = false
+
/*
* The State transitioning model
*
@@ -184,6 +186,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
return
}
+ //stateCopy := self.env.State().Copy()
vmenv := self.env
var ref vm.ContextRef
if MessageCreatesContract(msg) {
@@ -196,8 +199,34 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
ref.SetCode(ret)
}
}
+
+ /*
+ if vmenv, ok := vmenv.(*VMEnv); ok && tryJit {
+ statelogger.Infof("CREATE: re-running using JIT (PH=%x)\n", stateCopy.Root()[:4])
+ // re-run using the JIT (validation for the JIT)
+ goodState := vmenv.State().Copy()
+ vmenv.state = stateCopy
+ vmenv.SetVmType(vm.JitVmTy)
+ vmenv.Create(sender, contract.Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
+ statelogger.Infof("DONE PH=%x STD_H=%x JIT_H=%x\n", stateCopy.Root()[:4], goodState.Root()[:4], vmenv.State().Root()[:4])
+ self.state.Set(goodState)
+ }
+ */
} else {
ret, err = vmenv.Call(self.From(), self.To().Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
+
+ /*
+ if vmenv, ok := vmenv.(*VMEnv); ok && tryJit {
+ statelogger.Infof("CALL: re-running using JIT (PH=%x)\n", stateCopy.Root()[:4])
+ // re-run using the JIT (validation for the JIT)
+ goodState := vmenv.State().Copy()
+ vmenv.state = stateCopy
+ vmenv.SetVmType(vm.JitVmTy)
+ vmenv.Call(self.From(), self.To().Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
+ statelogger.Infof("DONE PH=%x STD_H=%x JIT_H=%x\n", stateCopy.Root()[:4], goodState.Root()[:4], vmenv.State().Root()[:4])
+ self.state.Set(goodState)
+ }
+ */
}
if err != nil {