From 5c99f076db6c94477baad2b7deaee62ed64d73a9 Mon Sep 17 00:00:00 2001 From: Egor Lysenko Date: Thu, 23 Dec 2021 03:08:34 +0700 Subject: [PATCH 1/2] add snapshot.Tree.Generating method --- core/state/snapshot/snapshot.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index 0f00af47e18ff..230fa640d3b6d 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -826,6 +826,10 @@ func (t *Tree) generating() (bool, error) { return layer.genMarker != nil, nil } +func (t *Tree) Generating() (bool, error) { + return t.generating() +} + // diskRoot is a external helper function to return the disk layer root. func (t *Tree) DiskRoot() common.Hash { t.lock.Lock() From 889c41a520a77cc54236ae38f5f57214af3154d8 Mon Sep 17 00:00:00 2001 From: Egor Lysenko Date: Thu, 23 Dec 2021 17:57:32 +0700 Subject: [PATCH 2/2] demote verbosity for outdated snapshot journal --- core/state/snapshot/journal.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/state/snapshot/journal.go b/core/state/snapshot/journal.go index 98a93b4968e00..067de689e71d1 100644 --- a/core/state/snapshot/journal.go +++ b/core/state/snapshot/journal.go @@ -25,6 +25,7 @@ import ( "time" "github.com/VictoriaMetrics/fastcache" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/ethdb" @@ -113,7 +114,7 @@ func loadAndParseJournal(db ethdb.KeyValueStore, base *diskLayer) (snapshot, jou // It can happen that Geth crashes without persisting the latest // diff journal. if !bytes.Equal(root.Bytes(), base.root.Bytes()) { - log.Warn("Loaded snapshot journal", "diskroot", base.root, "diffs", "unmatched") + log.Debug("Loaded snapshot journal", "diskroot", base.root, "diffs", "unmatched") return base, generator, nil } // Load all the snapshot diffs from the journal