Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize checkpoint logs. #13643

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beacon-chain/sync/checkpoint/BUILD.bazel
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package checkpoint

import "github.com/sirupsen/logrus"

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