Normalize checkpoint logs. (#13643)

This commit is contained in:
Manu NALEPA 2024-02-21 16:20:44 +01:00 committed by GitHub
parent cb80d5ad32
commit e09ae75c9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 4 deletions

View File

@ -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"],

View File

@ -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
@ -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) {

View File

@ -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)
@ -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) {

View File

@ -0,0 +1,5 @@
package checkpoint
import "github.com/sirupsen/logrus"
var log = logrus.WithField("prefix", "checkpoint-sync")