From f6bf82bf36882104dadade97f6e1489a63f90a93 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 10 Oct 2024 15:21:52 -0700 Subject: [PATCH] fix(f3): handle a case where we might receive no manifest In _theory_ a lotus node can return no manifest from `F3Manifest`. I don't think that happens in practice but we should handle the case and start over at the top (try to get another lease). If we really have no manifest, lotus will tell us that F3 isn't ready yet and we'll backoff for a bit. --- node/modules/storageminer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 06395d3d180..d29e5dc42da 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -491,7 +491,11 @@ func (p *f3Participator) awaitLeaseExpiry(ctx context.Context, lease api.F3Parti } log.Errorw("Failed to check F3 progress while awaiting lease expiry. Retrying after backoff.", "attempts", p.backoff.Attempt(), "backoff", p.backoff.Duration(), "err", err) p.backOff(ctx) - case manifest.NetworkName != lease.Network: + case manifest == nil || manifest.NetworkName != lease.Network: + // If we got an unexpected manifest, or no manifest, go back to the + // beginning and try to get another ticket. Switching from having a manifest + // to having no manifest can theoretically happen if the lotus node reboots + // and has no static manifest. return nil } switch progress, err := p.node.F3GetProgress(ctx); {