mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
Add error wrapping to blob initialization errors (#13366)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package filesystem
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
||||
@@ -31,10 +33,10 @@ var (
|
||||
|
||||
func (bs *BlobStorage) Initialize(lastFinalizedSlot primitives.Slot) error {
|
||||
if err := bs.Prune(lastFinalizedSlot); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to prune from finalized slot %d: %w", lastFinalizedSlot, err)
|
||||
}
|
||||
if err := bs.collectTotalBlobMetric(); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to initialize blob metrics: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
||||
|
||||
if beacon.finalizedStateAtStartUp != nil {
|
||||
if err := beacon.BlobStorage.Initialize(beacon.finalizedStateAtStartUp.Slot()); err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to initialize blob storage: %w", err)
|
||||
}
|
||||
} else {
|
||||
log.Warn("No finalized beacon state at startup, cannot prune blobs")
|
||||
|
||||
Reference in New Issue
Block a user