From 056f82dbc9d875ff4030f7796a65fb4a38ed0475 Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Mon, 15 Apr 2024 14:37:27 +0530 Subject: [PATCH] add debug statements --- internal/cli/snapshot.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cli/snapshot.go b/internal/cli/snapshot.go index 648df1fe31..85c084729b 100644 --- a/internal/cli/snapshot.go +++ b/internal/cli/snapshot.go @@ -388,6 +388,10 @@ func (c *PruneBlockCommand) accessDb(stack *node.Node, dbHandles int) error { // In theory there are n difflayers + 1 disk layer present, // so n diff layers are expected to be returned. layers := snaptree.Snapshots(headHeader.Root, c.triesInMemory, true) + log.Info("Checking snapshot layers", "triesInMemory", c.triesInMemory, "layers", len(layers), "head", headHeader.Number.Uint64(), "root", headHeader.Root, "hash", headHeader.Hash()) + if len(layers) > 0 { + log.Info("Found snapshot layers", "first", layers[0].Root(), "last", layers[len(layers)-1].Root()) + } if len(layers) != c.triesInMemory { // Reject if the accumulated diff layers are less than n. It // means in most of normal cases, there is no associated state