From 2985592bd07b53cb456bbd7cb524c02e30cc7045 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 16 Mar 2023 17:51:28 +0200 Subject: [PATCH] add sanity check in SearchForIndexedMsg call site Check that receipt is non nil, and the message was indeed found. --- chain/stmgr/searchwait.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chain/stmgr/searchwait.go b/chain/stmgr/searchwait.go index 89d0b252f..6b9adff71 100644 --- a/chain/stmgr/searchwait.go +++ b/chain/stmgr/searchwait.go @@ -151,7 +151,17 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, head *types.TipSet switch { case err == nil: - return fts, r, foundMsg, nil + if r != nil && foundMsg.Defined() { + return fts, r, foundMsg, nil + } + + // debug log this, it's noteworthy + if r == nil { + log.Debugf("missing receipt for message in index for %s", mcid) + } + if !foundMsg.Defined() { + log.Debugf("message %s not found", mcid) + } case errors.Is(err, index.ErrNotFound): // ok for the index to have incomplete data