Skip to content

Commit

Permalink
Normalize checkpoint logs. (#13643)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalepae committed Feb 21, 2024
1 parent cb80d5a commit e09ae75
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions beacon-chain/sync/checkpoint/BUILD.bazel
Expand Up @@ -5,6 +5,7 @@ go_library(
srcs = [
"api.go",
"file.go",
"log.go",
],
importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/checkpoint",
visibility = ["//visibility:public"],
Expand Down
3 changes: 1 addition & 2 deletions beacon-chain/sync/checkpoint/api.go
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/api/client/beacon"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db"
"github.com/prysmaticlabs/prysm/v5/config/params"
log "github.com/sirupsen/logrus"
)

// APIInitializer manages initializing the beacon node using checkpoint sync, retrieving the checkpoint state and root
Expand All @@ -31,7 +30,7 @@ func NewAPIInitializer(beaconNodeHost string) (*APIInitializer, error) {
func (dl *APIInitializer) Initialize(ctx context.Context, d db.Database) error {
origin, err := d.OriginCheckpointBlockRoot(ctx)
if err == nil && origin != params.BeaconConfig().ZeroHash {
log.Warnf("origin checkpoint root %#x found in db, ignoring checkpoint sync flags", origin)
log.Warnf("Origin checkpoint root %#x found in db, ignoring checkpoint sync flags", origin)
return nil
} else {
if !errors.Is(err, db.ErrNotFound) {
Expand Down
3 changes: 1 addition & 2 deletions beacon-chain/sync/checkpoint/file.go
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/io/file"
log "github.com/sirupsen/logrus"
)

// Initializer describes a type that is able to obtain the checkpoint sync data (BeaconState and SignedBeaconBlock)
Expand Down Expand Up @@ -45,7 +44,7 @@ type FileInitializer struct {
func (fi *FileInitializer) Initialize(ctx context.Context, d db.Database) error {
origin, err := d.OriginCheckpointBlockRoot(ctx)
if err == nil && origin != params.BeaconConfig().ZeroHash {
log.Warnf("origin checkpoint root %#x found in db, ignoring checkpoint sync flags", origin)
log.Warnf("Origin checkpoint root %#x found in db, ignoring checkpoint sync flags", origin)
return nil
} else {
if !errors.Is(err, db.ErrNotFound) {
Expand Down
5 changes: 5 additions & 0 deletions beacon-chain/sync/checkpoint/log.go
@@ -0,0 +1,5 @@
package checkpoint

import "github.com/sirupsen/logrus"

var log = logrus.WithField("prefix", "checkpoint-sync")

0 comments on commit e09ae75

Please sign in to comment.