diff --git a/chain/tsresolver/tipset_resolver.go b/chain/tsresolver/tipset_resolver.go index 8fbb85850d..f16b98a577 100644 --- a/chain/tsresolver/tipset_resolver.go +++ b/chain/tsresolver/tipset_resolver.go @@ -128,22 +128,24 @@ func (tsr *tipSetResolver) loadFinalizedTipSet(ctx context.Context, fallbackDela // certificate with a finalized tipset, it returns nil. This method will only return errors that // arise from dealing with the chain store, not from F3. func (tsr *tipSetResolver) maybeF3FinalizedTipSet(ctx context.Context) (*types.TipSet, error) { - if manifest, err := tsr.f3.GetManifest(ctx); err != nil { + // TODO: switch the order of GetManifest and GetLatestCert the former won't panic on + // a fresh F3 instance: https://github.com/filecoin-project/lotus/issues/12772 + cert, err := tsr.f3.GetLatestCert(ctx) + if err != nil { if !errors.Is(err, api.ErrF3Disabled) { - log.Warnf("loading F3 manifest: %s", err) + log.Warnf("loading latest F3 certificate: %s", err) } return nil, nil - } else if !manifest.EC.Finalize { - // F3 is not finalizing tipsets on top of EC, ignore it + } + if cert == nil { return nil, nil } - cert, err := tsr.f3.GetLatestCert(ctx) - if err != nil { - log.Warnf("loading latest F3 certificate: %s", err) + if manifest, err := tsr.f3.GetManifest(ctx); err != nil { + log.Warnf("loading F3 manifest: %s", err) return nil, nil - } - if cert == nil { + } else if !manifest.EC.Finalize { + // F3 is not finalizing tipsets on top of EC, ignore it return nil, nil }