@@ -338,7 +338,7 @@ func (s *Sealer) SubmitPersistedEx(
338
338
return true , nil
339
339
}
340
340
341
- func (s * Sealer ) WaitSeed (ctx context.Context , sid abi.SectorID ) (core.WaitSeedResp , error ) {
341
+ func (s * Sealer ) WaitSeed (ctx context.Context , sid abi.SectorID , proofType abi. RegisteredSealProof ) (core.WaitSeedResp , error ) {
342
342
maddr , err := address .NewIDAddress (uint64 (sid .Miner ))
343
343
if err != nil {
344
344
return core.WaitSeedResp {}, err
@@ -348,29 +348,33 @@ func (s *Sealer) WaitSeed(ctx context.Context, sid abi.SectorID) (core.WaitSeedR
348
348
if err != nil {
349
349
return core.WaitSeedResp {}, err
350
350
}
351
-
352
351
tsk := ts .Key ()
353
- pci , err := s .capi .StateSectorPreCommitInfo (ctx , maddr , sid .Number , tsk )
354
- if err != nil {
355
- return core.WaitSeedResp {}, err
356
- }
357
- if pci == nil {
358
- return core.WaitSeedResp {}, fmt .Errorf ("precommit info not found on chain. sid: %s" , util .FormatSectorID (sid ))
359
- }
360
-
361
352
curEpoch := ts .Height ()
362
- // TODO: remove this guard
353
+ var seedEpoch abi.ChainEpoch
354
+ if proofType .IsNonInteractive () {
355
+ seedEpoch = curEpoch - 1
356
+ } else {
363
357
364
- seedEpoch := pci .PreCommitEpoch + policy .GetPreCommitChallengeDelay ()
365
- confEpoch := seedEpoch + policy .InteractivePoRepConfidence
366
- if curEpoch < confEpoch {
367
- return core.WaitSeedResp {
368
- ShouldWait : true ,
369
- Delay : int (confEpoch - curEpoch ) * int (policy .NetParams .BlockDelaySecs ),
370
- Seed : nil ,
371
- }, nil
372
- }
358
+ pci , err := s .capi .StateSectorPreCommitInfo (ctx , maddr , sid .Number , tsk )
359
+ if err != nil {
360
+ return core.WaitSeedResp {}, err
361
+ }
362
+ if pci == nil {
363
+ return core.WaitSeedResp {}, fmt .Errorf ("precommit info not found on chain. sid: %s" , util .FormatSectorID (sid ))
364
+ }
373
365
366
+ // TODO: remove this guard
367
+
368
+ seedEpoch = pci .PreCommitEpoch + policy .GetPreCommitChallengeDelay ()
369
+ confEpoch := seedEpoch + policy .InteractivePoRepConfidence
370
+ if curEpoch < confEpoch {
371
+ return core.WaitSeedResp {
372
+ ShouldWait : true ,
373
+ Delay : int (confEpoch - curEpoch ) * int (policy .NetParams .BlockDelaySecs ),
374
+ Seed : nil ,
375
+ }, nil
376
+ }
377
+ }
374
378
seed , err := s .rand .GetSeed (ctx , tsk , seedEpoch , sid .Miner )
375
379
if err != nil {
376
380
return core.WaitSeedResp {}, err
0 commit comments