aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-03 12:02:00 +0800
committerobscuren <geffobscura@gmail.com>2015-02-03 12:02:00 +0800
commit30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4 (patch)
tree7e573f4c0fdb592f5ccd6ff8059136f1ffc3c6c8
parentfaa54e59c1c276d153299c73afdea246941ec952 (diff)
downloaddexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar.gz
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar.bz2
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar.lz
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar.xz
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.tar.zst
dexon-30fa30bd4a5f12e86480bec0a7dd2fe290c9abc4.zip
Docs & old code removed
-rw-r--r--core/block_processor.go2
-rw-r--r--core/genesis.go1
-rw-r--r--core/state_transition.go46
-rw-r--r--eth/block_pool.go4
4 files changed, 28 insertions, 25 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 2dcaa37c2..4d5cd94c9 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -219,7 +219,7 @@ func (sm *BlockProcessor) ProcessWithParent(block, parent *types.Block) (td *big
// Calculate the td for this block
td = CalculateTD(block, parent)
- // Sync the current block's state to the database and cancelling out the deferred Undo
+ // Sync the current block's state to the database
state.Sync()
// Set the block hashes for the current messages
state.Manifest().SetHash(block.Hash())
diff --git a/core/genesis.go b/core/genesis.go
index 6d4eeba72..c870ce61e 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -32,7 +32,6 @@ func GenesisBlock(db ethutil.Database) *types.Block {
genesis.SetReceipts(types.Receipts{})
statedb := state.New(genesis.Root(), db)
- //statedb := state.New(genesis.Trie())
for _, addr := range []string{
"dbdbdb2cbd23b783741e8d7fcf51e459b497e4a6",
"e4157b34ea9615cfbde6b4fda419828124b70c78",
diff --git a/core/state_transition.go b/core/state_transition.go
index 00d9d486a..33dd45f02 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -186,7 +186,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
return
}
- stateCopy := self.env.State().Copy()
+ //stateCopy := self.env.State().Copy()
vmenv := self.env
var ref vm.ContextRef
if MessageCreatesContract(msg) {
@@ -200,29 +200,33 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
}
}
- 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)
- }
+ /*
+ 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 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 {
diff --git a/eth/block_pool.go b/eth/block_pool.go
index 97ae683c1..13016c694 100644
--- a/eth/block_pool.go
+++ b/eth/block_pool.go
@@ -636,12 +636,12 @@ func (self *BlockPool) AddBlock(block *types.Block, peerId string) {
// validate block for PoW
if !self.verifyPoW(block) {
- poolLogger.Warnf("invalid pow on block [%s] by peer %s", name(hash), peerId)
+ poolLogger.Warnf("invalid pow on block [%s %v] by peer %s", name(hash), block.Number(), peerId)
self.peerError(peerId, ErrInvalidPoW, "%x", hash)
return
}
}
- poolLogger.Debugf("added block [%s] sent by peer %s", name(hash), peerId)
+ poolLogger.DebugDetailf("added block [%s] sent by peer %s", name(hash), peerId)
node.block = block
node.blockBy = peerId