From 31c3a6072198952e4f3f136ae06c1b0f13ccbc84 Mon Sep 17 00:00:00 2001 From: parthshah1 Date: Wed, 8 Jan 2025 06:47:07 +0530 Subject: [PATCH] fix(indexer): fix potential panic in chain reconciliation logic during backfill (#12813) Co-authored-by: Peter Rabbitson --- chain/index/reconcile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/index/reconcile.go b/chain/index/reconcile.go index 72a1e6ecaa6..1e2940068c0 100644 --- a/chain/index/reconcile.go +++ b/chain/index/reconcile.go @@ -236,10 +236,10 @@ func (si *SqliteIndexer) backfillIndex(ctx context.Context, tx *sql.Tx, head *ty log.Infof("reached stop height %d; backfilled %d tipsets", stopAfter, totalApplied) return nil } - + height := currTs.Height() currTs, err = si.cs.GetTipSetFromKey(ctx, currTs.Parents()) if err != nil { - return xerrors.Errorf("failed to walk chain at height %d: %w", currTs.Height(), err) + return xerrors.Errorf("failed to walk chain beyond height %d: %w", height, err) } }