Skip to content

Commit

Permalink
add more info to header decode error (#13292)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Jan 2, 2025
1 parent acc36b3 commit 85489c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eth/stagedsync/stage_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.R

diagnostics.Send(diagnostics.CurrentSyncSubStage{SubStage: "Fill DB"})
if err := FillDBFromSnapshots(s.LogPrefix(), ctx, tx, cfg.dirs, cfg.blockReader, agg, logger); err != nil {
return err
return fmt.Errorf("FillDBFromSnapshots: %w", err)
}

if temporal, ok := tx.(*temporal.Tx); ok {
Expand Down
4 changes: 2 additions & 2 deletions turbo/snapshotsync/freezeblocks/block_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,12 +901,12 @@ func ForEachHeader(ctx context.Context, s *RoSnapshots, walker func(header *type
for _, sn := range view.Headers() {
if err := sn.Src().WithReadAhead(func() error {
g := sn.Src().MakeGetter()
for g.HasNext() {
for i := 0; g.HasNext(); i++ {
word, _ = g.Next(word[:0])
var header types.Header
r.Reset(word[1:])
if err := rlp.Decode(r, &header); err != nil {
return err
return fmt.Errorf("%w, file=%s, record=%d", err, sn.Src().FileName(), i)
}
if err := walker(&header); err != nil {
return err
Expand Down

0 comments on commit 85489c5

Please sign in to comment.