From e65d1766a30460a7b9393c2f2ffbd9cd8a56abd4 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Sun, 9 Oct 2016 13:57:08 +0200 Subject: [PATCH] tmp slow block --- cmd/utils/flags.go | 3 +++ core/blockchain.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index eed0a20abf..c33645bc95 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -33,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "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/eth" "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), WSModules: MakeRPCModules(ctx.GlobalString(WSApiFlag.Name)), } + vm.SetJITCacheSize(ctx.GlobalInt(VMCacheFlag.Name)) + if ctx.GlobalBool(DevModeFlag.Name) { if !ctx.GlobalIsSet(DataDirFlag.Name) { config.DataDir = filepath.Join(os.TempDir(), "/ethereum_dev_mode") diff --git a/core/blockchain.go b/core/blockchain.go index d6a9ad021a..bd5b40baa6 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -981,6 +981,12 @@ func (self *BlockChain) InsertChain(chain types.Blocks) (int, error) { } 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) { stats.usedGas += usedGas.Uint64() stats.report(chain, i)