@@ -536,11 +536,38 @@ func (s *SubmitTask) updateLanded(ctx context.Context, spId, sectorNum int64) er
536
536
if err != nil {
537
537
return err
538
538
}
539
-
540
- if exitcode .ExitCode (execResult [0 ].ExecutedRcptExitCode ) != exitcode .Ok {
541
- //return s.pollCommitMsgFail(ctx, task, execResult[0])
542
- log .Errorw ("todo handle failed snap prove" , "sp" , spId , "sector" , sectorNum , "exec_epoch" , execResult [0 ].ExecutedTskEpoch , "exec_tskcid" , execResult [0 ].ExecutedTskCID , "msg_cid" , execResult [0 ].ExecutedMsgCID )
539
+ switch exitcode .ExitCode (execResult [0 ].ExecutedRcptExitCode ) {
540
+ case exitcode .Ok :
541
+ // good, noop
542
+ case exitcode .SysErrInsufficientFunds , exitcode .ErrInsufficientFunds :
543
+ fallthrough
544
+ case exitcode .SysErrOutOfGas :
545
+ // just retry
546
+ n , err := s .db .Exec (ctx , `UPDATE sectors_snap_pipeline SET
547
+ after_prove_msg_success = FALSE, after_submit = FALSE
548
+ WHERE sp_id = $2 AND sector_number = $3 AND after_prove_msg_success = FALSE AND after_submit = TRUE` ,
549
+ execResult [0 ].ExecutedTskCID , spId , sectorNum )
550
+ if err != nil {
551
+ return xerrors .Errorf ("update sectors_snap_pipeline to retry prove send: %w" , err )
552
+ }
553
+ if n == 0 {
554
+ return xerrors .Errorf ("update sectors_snap_pipeline to retry prove send: no rows updated" )
555
+ }
543
556
return nil
557
+ case exitcode .ErrNotFound :
558
+ // message not found, but maybe it's fine?
559
+
560
+ si , err := s .api .StateSectorGetInfo (ctx , maddr , abi .SectorNumber (sectorNum ), types .EmptyTSK )
561
+ if err != nil {
562
+ return xerrors .Errorf ("get sector info: %w" , err )
563
+ }
564
+ if si != nil && si .SealedCID .String () == execResult [0 ].UpdateSealedCID {
565
+ return nil
566
+ }
567
+
568
+ return xerrors .Errorf ("sector info after prove message not found not as expected" )
569
+ default :
570
+ return xerrors .Errorf ("commit message failed with exit code %s" , exitcode .ExitCode (execResult [0 ].ExecutedRcptExitCode ))
544
571
}
545
572
546
573
si , err := s .api .StateSectorGetInfo (ctx , maddr , abi .SectorNumber (sectorNum ), types .EmptyTSK )
0 commit comments