Log Info and duplication fix (#735)

This commit is contained in:
ledgerwatch 2020-07-10 11:40:13 +01:00 committed by GitHub
parent 8335700331
commit 16695eb100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 10 deletions

View File

@ -50,7 +50,7 @@ func (l *progressLogger) Start(numberRef *uint64) {
speed := float64(now-prev) / float64(l.interval)
var m runtime.MemStats
runtime.ReadMemStats(&m)
log.Debug("Executed blocks:",
log.Info("Executed blocks:",
"currentBlock", now,
"speed (blk/second)", speed,
"state batch", common.StorageSize(l.batch.BatchSize()),

View File

@ -215,7 +215,7 @@ type OldestAppearedLoad struct {
lastKey bytes.Buffer
}
func (l OldestAppearedLoad) LoadFunc(k []byte, value []byte, state etl.State, next etl.LoadNextFunc) error {
func (l *OldestAppearedLoad) LoadFunc(k []byte, value []byte, state etl.State, next etl.LoadNextFunc) error {
if bytes.Equal(k, l.lastKey.Bytes()) {
return nil
}

View File

@ -217,9 +217,6 @@ func (r *Receiver) accountLoad(k []byte, value []byte, _ etl.State, _ etl.LoadNe
return err
}
newKStr := string(newK)
if _, ok := r.accountMap[newKStr]; ok {
return nil
}
if len(value) > 0 {
var a accounts.Account
if err = a.DecodeForStorage(value); err != nil {
@ -239,9 +236,6 @@ func (r *Receiver) storageLoad(k []byte, value []byte, _ etl.State, _ etl.LoadNe
return err
}
newKStr := string(newK)
if _, ok := r.storageMap[newKStr]; ok {
return nil
}
if len(value) > 0 {
r.storageMap[newKStr] = common.CopyBytes(value)
} else {
@ -451,7 +445,7 @@ func incrementIntermediateHashes(s *StageState, db ethdb.Database, from, to uint
if subTries.Hashes[0] != expectedRootHash {
return fmt.Errorf("wrong trie root: %x, expected (from header): %x", subTries.Hashes[0], expectedRootHash)
}
log.Debug("Collection finished",
log.Info("Collection finished",
"root hash", subTries.Hashes[0].Hex(),
"gen IH", generationIHTook,
)
@ -524,7 +518,7 @@ func unwindIntermediateHashesStageImpl(u *UnwindState, s *StageState, db ethdb.D
if subTries.Hashes[0] != expectedRootHash {
return fmt.Errorf("wrong trie root: %x, expected (from header): %x", subTries.Hashes[0], expectedRootHash)
}
log.Debug("Collection finished",
log.Info("Collection finished",
"root hash", subTries.Hashes[0].Hex(),
"gen IH", generationIHTook,
)