Skip to content

Commit

Permalink
update sealing states
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Jun 4, 2024
1 parent 560b04a commit 887d225
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions market/fakelm/lmimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package fakelm
import (
"context"
"encoding/base64"
"github.com/filecoin-project/curio/market"
"net/http"
"net/url"

"github.com/filecoin-project/curio/market"

"github.com/gbrlsnchs/jwt/v3"
"github.com/google/uuid"
"golang.org/x/xerrors"
Expand Down Expand Up @@ -71,6 +72,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
Failed bool `db:"failed"`
SDR bool `db:"after_sdr"`
PoRep bool `db:"after_porep"`
Tree bool `db:"after_tree_r"`
}

err := l.db.Select(ctx, &ssip, `
Expand All @@ -82,6 +84,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
failed,
after_sdr,
after_porep,
after_tree_r,
after_commit_msg_success
FROM
sectors_sdr_pipeline
Expand All @@ -95,6 +98,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
cc.after_commit_msg_success,
cc.failed,
cc.after_sdr,
cc.after_tree_r,
cc.after_porep
FROM
sectors_meta_pieces mp
Expand All @@ -110,6 +114,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
cc.after_commit_msg_success,
cc.failed,
cc.after_sdr,
cc.after_tree_r,
cc.after_porep
FROM
sectors_sdr_initial_pieces ip
Expand All @@ -125,6 +130,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
FALSE as after_commit_msg_success,
FALSE as failed,
FALSE as after_sdr,
FALSE as after_tree_r,
FALSE as after_porep
FROM
open_sector_pieces op
Expand Down Expand Up @@ -193,11 +199,13 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber,
case currentSSIP.Failed:
ret.State = api.SectorState(sealing.FailedUnrecoverable)
case !currentSSIP.SDR:
ret.State = api.SectorState(sealing.WaitDeals)
case currentSSIP.SDR && !currentSSIP.PoRep:
ret.State = api.SectorState(sealing.PreCommit1)
case currentSSIP.SDR && currentSSIP.PoRep && !currentSSIP.Complete:
case currentSSIP.SDR && !currentSSIP.Tree:
ret.State = api.SectorState(sealing.PreCommit2)
case currentSSIP.SDR && currentSSIP.Tree && !currentSSIP.PoRep:
ret.State = api.SectorState(sealing.Committing)
case currentSSIP.SDR && currentSSIP.Tree && currentSSIP.PoRep && !currentSSIP.Complete:
ret.State = api.SectorState(sealing.FinalizeSector)
case currentSSIP.Complete:
ret.State = api.SectorState(sealing.Proving)
default:
Expand Down

0 comments on commit 887d225

Please sign in to comment.