diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index a94f34484d..c0d541ce80 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" @@ -623,6 +624,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 01aa987ddc..a05e8d104a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -974,6 +974,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.report(chain, i) }