From 5b0cc124a547b4a797330d11b6329c93db353ac6 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Mon, 25 Sep 2023 19:06:22 +0800 Subject: [PATCH] misc --- pkg/snapshot/service.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/snapshot/service.go b/pkg/snapshot/service.go index acd1c20..2ceaf5c 100644 --- a/pkg/snapshot/service.go +++ b/pkg/snapshot/service.go @@ -85,13 +85,12 @@ type SnapshotParams struct { func (s *Service) CreateSnapshot(params SnapshotParams) error { // extract header from lvldb and publish to PG-IPFS // hold onto the headerID so that we can link the state nodes to this header - log.Infof("Creating snapshot at height %d", params.Height) hash := rawdb.ReadCanonicalHash(s.ethDB, params.Height) header := rawdb.ReadHeader(s.ethDB, hash, params.Height) if header == nil { return fmt.Errorf("unable to read canonical header at height %d", params.Height) } - log.Infof("head hash: %s head height: %d", hash.Hex(), params.Height) + log.Info("Creating snapshot", "height", params.Height, "hash", hash) // Context for snapshot work ctx, cancelCtx := context.WithCancel(context.Background()) @@ -157,7 +156,7 @@ func (s *Service) CreateLatestSnapshot(workers uint, watchedAddresses []common.A hash := rawdb.ReadHeadHeaderHash(s.ethDB) height := rawdb.ReadHeaderNumber(s.ethDB, hash) if height == nil { - return fmt.Errorf("unable to read header height for header hash %s", hash.String()) + return fmt.Errorf("unable to read header height for header hash %s", hash) } return s.CreateSnapshot(SnapshotParams{Height: *height, Workers: workers, WatchedAddresses: watchedAddresses}) }