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

chore(block-store): silence pruner logging for not found keys #1891

Merged
merged 5 commits into from
Aug 13, 2024
Merged
Changes from 3 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
16 changes: 11 additions & 5 deletions mod/storage/pkg/block/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

sdkcollections "cosmossdk.io/collections"
"cosmossdk.io/core/store"
"github.com/berachain/beacon-kit/mod/errors"
"github.com/berachain/beacon-kit/mod/log"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
Expand Down Expand Up @@ -106,11 +107,16 @@ func (kv *KVStore[BeaconBlockT]) Prune(start, end uint64) error {
// This can error for 2 reasons:
// 1. The slot was not found -- either the slot was missed or we
// never stored the block to begin with, either way it's ok.
// 2. The slot was found but (en/de)coding failed. In this case,
// we choose not to retry removal and instead continue.
kv.logger.Error(
"‼️ failed to prune block", "slot", kv.nextToPrune, "err", err,
)
if !errors.Is(err, sdkcollections.ErrNotFound) {
// 2. The slot was found but (en/de)coding failed. In this
// case, we choose not to retry removal and instead
// continue. This means this slot may never be pruned, but
// ensures that we always get to pruning subsequent slots.
kv.logger.Error(
"‼️ failed to prune block",
"slot", kv.nextToPrune, "err", err,
)
}
calbera marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Loading