log tweaks
This commit is contained in:
parent
5c35c86a8b
commit
dd6f9ccabe
@ -253,9 +253,10 @@ func (sds *Service) writeLoopWorker(params workerParams) {
|
|||||||
log.Error("Parent block is nil, skipping this block", "block height", currentBlock.Number())
|
log.Error("Parent block is nil, skipping this block", "block height", currentBlock.Number())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
log.Info("Writing state diff", "block height", currentBlock.Number().Uint64(), "worker", params.id)
|
||||||
err := sds.writeStateDiff(currentBlock, parentBlock.Root(), writeLoopParams)
|
err := sds.writeStateDiff(currentBlock, parentBlock.Root(), writeLoopParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("statediff (DB write) processing error", "block height", currentBlock.Number().Uint64(), "error", err.Error(), "worker", params.id)
|
log.Error("statediff.Service.WriteLoop: processing error", "block height", currentBlock.Number().Uint64(), "error", err.Error(), "worker", params.id)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// TODO: how to handle with concurrent workers
|
// TODO: how to handle with concurrent workers
|
||||||
@ -282,7 +283,7 @@ func (sds *Service) Loop(chainEventCh chan core.ChainEvent) {
|
|||||||
//Notify chain event channel of events
|
//Notify chain event channel of events
|
||||||
case chainEvent := <-chainEventCh:
|
case chainEvent := <-chainEventCh:
|
||||||
statediffMetrics.serviceLoopChannelLen.Update(int64(len(chainEventCh)))
|
statediffMetrics.serviceLoopChannelLen.Update(int64(len(chainEventCh)))
|
||||||
log.Debug("Event received from chainEventCh", "event", chainEvent)
|
log.Debug("Loop(): chain event received", "event", chainEvent)
|
||||||
// if we don't have any subscribers, do not process a statediff
|
// if we don't have any subscribers, do not process a statediff
|
||||||
if atomic.LoadInt32(&sds.subscribers) == 0 {
|
if atomic.LoadInt32(&sds.subscribers) == 0 {
|
||||||
log.Debug("Currently no subscribers to the statediffing service; processing is halted")
|
log.Debug("Currently no subscribers to the statediffing service; processing is halted")
|
||||||
@ -291,7 +292,7 @@ func (sds *Service) Loop(chainEventCh chan core.ChainEvent) {
|
|||||||
currentBlock := chainEvent.Block
|
currentBlock := chainEvent.Block
|
||||||
parentBlock := sds.BlockCache.replace(currentBlock, sds.BlockChain)
|
parentBlock := sds.BlockCache.replace(currentBlock, sds.BlockChain)
|
||||||
if parentBlock == nil {
|
if parentBlock == nil {
|
||||||
log.Error("Parent block is nil, skipping this block", "number", currentBlock.Number())
|
log.Error("Parent block is nil, skipping this block", "block height", currentBlock.Number())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
sds.streamStateDiff(currentBlock, parentBlock.Root())
|
sds.streamStateDiff(currentBlock, parentBlock.Root())
|
||||||
@ -532,7 +533,7 @@ func (sds *Service) StreamCodeAndCodeHash(blockNumber uint64, outChan chan<- Cod
|
|||||||
log.Info("sending code and codehash", "block height", blockNumber)
|
log.Info("sending code and codehash", "block height", blockNumber)
|
||||||
currentTrie, err := sds.BlockChain.StateCache().OpenTrie(current.Root())
|
currentTrie, err := sds.BlockChain.StateCache().OpenTrie(current.Root())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("error creating trie for block", "number", current.Number(), "err", err)
|
log.Error("error creating trie for block", "block height", current.Number(), "err", err)
|
||||||
close(quitChan)
|
close(quitChan)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -580,7 +581,7 @@ func (sds *Service) WriteStateDiffAt(blockNumber uint64, params Params) error {
|
|||||||
|
|
||||||
// Writes a state diff from the current block, parent state root, and provided params
|
// Writes a state diff from the current block, parent state root, and provided params
|
||||||
func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, params Params) error {
|
func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, params Params) error {
|
||||||
log.Info("Writing state diff", "block height", block.Number().Uint64())
|
// log.Info("Writing state diff", "block height", block.Number().Uint64())
|
||||||
var totalDifficulty *big.Int
|
var totalDifficulty *big.Int
|
||||||
var receipts types.Receipts
|
var receipts types.Receipts
|
||||||
if params.IncludeTD {
|
if params.IncludeTD {
|
||||||
|
Loading…
Reference in New Issue
Block a user