Skip to content

Commit

Permalink
feat: journal nodebufferlist snapshot data for journal file recoering
Browse files Browse the repository at this point in the history
  • Loading branch information
VM committed Nov 23, 2024
1 parent 214d067 commit e651fa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions triedb/pathdb/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ func (db *Database) loadDiskLayer(r *rlp.Stream, journalTypeForReader JournalTyp
return nil, fmt.Errorf("failed to load disk nodes: %v", err)
}
nodes = make(map[common.Hash]map[string]*trienode.Node)
// todo: use flatten function
for _, entry := range encoded {
subset := make(map[string]*trienode.Node)
for _, n := range entry.Nodes {
Expand Down
5 changes: 5 additions & 0 deletions triedb/pathdb/nodebufferlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ func (nf *nodebufferlist) getMultiLayerNodes() []nblJournalData {
return true
}
nf.traverseReverse(merge)

for i, val := range nodesArray {
log.Info("print multi layers node info", "index", i, "root", val.root, "layers", val.layers,
"size", val.size)
}
return nodesArray
}

Expand Down

0 comments on commit e651fa7

Please sign in to comment.