From 35e519179a958545a74a11ab229b9e8fcc1f8dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8B=87?= Date: Thu, 6 Aug 2020 14:01:58 +0800 Subject: [PATCH] submit wdpost proof without waitting for recovery and fault messages appear on chain --- storage/wdpost_run.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index 3ebcbf273..77cd60ce6 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "errors" - "sync" "time" "github.com/filecoin-project/go-bitfield" @@ -283,31 +282,25 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di miner.DeadlineInfo ctx, span := trace.StartSpan(ctx, "storage.runPost") defer span.End() - var declWait sync.WaitGroup - defer declWait.Wait() - declWait.Add(1) - go func() { // TODO: extract from runPost, run on fault cutoff boundaries - defer declWait.Done() - // check faults / recoveries for the *next* deadline. It's already too // late to declare them for this deadline declDeadline := (di.Index + 2) % miner.WPoStPeriodDeadlines - partitions, err := s.api.StateMinerPartitions(ctx, s.actor, declDeadline, ts.Key()) + partitions, err := s.api.StateMinerPartitions(context.TODO(), s.actor, declDeadline, ts.Key()) if err != nil { log.Errorf("getting partitions: %v", err) return } - if err := s.checkNextRecoveries(ctx, declDeadline, partitions); err != nil { + if err := s.checkNextRecoveries(context.TODO(), declDeadline, partitions); err != nil { // TODO: This is potentially quite bad, but not even trying to post when this fails is objectively worse log.Errorf("checking sector recoveries: %v", err) } - if err := s.checkNextFaults(ctx, declDeadline, partitions); err != nil { + if err := s.checkNextFaults(context.TODO(), declDeadline, partitions); err != nil { // TODO: This is also potentially really bad, but we try to post anyways log.Errorf("checking sector faults: %v", err) }