tmp slow block

This commit is contained in:
Jeffrey Wilcke 2016-10-09 13:57:08 +02:00 committed by Jeffrey Wilcke
parent edb151ab71
commit e65d1766a3
2 changed files with 9 additions and 0 deletions

View file

@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
@ -624,6 +625,8 @@ func MakeNode(ctx *cli.Context, name, gitCommit string) *node.Node {
WSOrigins: ctx.GlobalString(WSAllowedOriginsFlag.Name), WSOrigins: ctx.GlobalString(WSAllowedOriginsFlag.Name),
WSModules: MakeRPCModules(ctx.GlobalString(WSApiFlag.Name)), WSModules: MakeRPCModules(ctx.GlobalString(WSApiFlag.Name)),
} }
vm.SetJITCacheSize(ctx.GlobalInt(VMCacheFlag.Name))
if ctx.GlobalBool(DevModeFlag.Name) { if ctx.GlobalBool(DevModeFlag.Name) {
if !ctx.GlobalIsSet(DataDirFlag.Name) { if !ctx.GlobalIsSet(DataDirFlag.Name) {
config.DataDir = filepath.Join(os.TempDir(), "/ethereum_dev_mode") config.DataDir = filepath.Join(os.TempDir(), "/ethereum_dev_mode")

View file

@ -981,6 +981,12 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) {
} }
stats.processed++ stats.processed++
if time.Since(bstart) > 1200*time.Millisecond {
glog.Infof("#### inserted slow block ####")
glog.Infof("[%v] inserted block #%d (%d TXs %v G %d UNCs) (%x...). Took %v\n", time.Now().UnixNano(), block.Number(), len(block.Transactions()), block.GasUsed(), len(block.Uncles()), block.Hash().Bytes()[0:4], time.Since(bstart))
glog.Infof("#############################")
}
if glog.V(logger.Info) { if glog.V(logger.Info) {
stats.usedGas += usedGas.Uint64() stats.usedGas += usedGas.Uint64()
stats.report(chain, i) stats.report(chain, i)