Skip to content

Commit

Permalink
test: fix pathdb unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
VM committed Sep 14, 2024
1 parent 702e3e7 commit e7454bc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion triedb/pathdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ func New(diskdb ethdb.Database, config *Config) *Database {
}
db.freezer = freezer
}
log.Info("New pathdb", "useBase", db.useBase, "fastRecovery", db.fastRecovery)

// Construct the layer tree by resolving the in-disk singleton state
// and in-memory layer journal.
Expand Down
4 changes: 0 additions & 4 deletions triedb/pathdb/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,8 @@ func (db *Database) loadLayers() layer {
stateID = rawdb.ReadPersistentStateID(db.diskdb)
)

log.Info("before recover", "buffer type", db.config.TrieNodeBufferType, "fastRecovery", db.fastRecovery,
"use base", db.useBase, "err", err)
if (errors.Is(err, errMissJournal) || errors.Is(err, errUnmatchedJournal)) && db.fastRecovery &&
db.config.TrieNodeBufferType == NodeBufferList && !db.useBase {
log.Info("in recover")
start := time.Now()
if db.freezer == nil {
log.Crit("Use unopened freezer db to recover node buffer list")
Expand All @@ -290,7 +287,6 @@ func (db *Database) loadLayers() layer {
}
}
if nb == nil || err != nil {
log.Info("Maybe failed to recover", "err", err)
// Return single layer with persistent state.
nb, err = NewTrieNodeBuffer(db.diskdb, db.config.TrieNodeBufferType, db.bufferSize, nil, 0,
db.config.ProposeBlockInterval, db.config.NotifyKeep, nil, false, db.useBase)
Expand Down
3 changes: 0 additions & 3 deletions triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,13 @@ func newNodeBufferList(
nf *nodebufferlist
err error
)
log.Info("newNodeBufferList 111111", "useBase", useBase, "fastRecovery", fastRecovery)
if !useBase && fastRecovery {
log.Info("Do recover")
nf, err = recoverNodeBufferList(db, freezer, base, limit, wpBlocks, rsevMdNum, dlInMd)
if err != nil {
log.Error("Failed to recover node buffer list", "error", err)
return nil, err
}
} else {
log.Info("Not recover")
ele := newMultiDifflayer(limit, 0, common.Hash{}, make(map[common.Hash]map[string]*trienode.Node), 0)
nf = &nodebufferlist{
db: db,
Expand Down

0 comments on commit e7454bc

Please sign in to comment.