From c8f28002c4c5a9470725bece9fc9019da1cb3eb8 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 4 Jun 2024 16:31:35 +0400 Subject: [PATCH 1/3] remove layers flag from market seal --- cmd/curio/market.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmd/curio/market.go b/cmd/curio/market.go index 30673ad22..59d89469d 100644 --- a/cmd/curio/market.go +++ b/cmd/curio/market.go @@ -2,21 +2,22 @@ package main import ( "fmt" - "github.com/filecoin-project/curio/deps" - "github.com/filecoin-project/curio/market/lmrpc" "sort" "strconv" + "github.com/filecoin-project/curio/deps" + "github.com/filecoin-project/curio/market/lmrpc" + "github.com/urfave/cli/v2" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/curio/harmony/harmonydb" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/curio/harmony/harmonydb" ) var marketCmd = &cli.Command{ @@ -89,10 +90,6 @@ var marketSealCmd = &cli.Command{ Usage: "Specify actor address to start sealing sectors for", Required: true, }, - &cli.StringSliceFlag{ - Name: "layers", - Usage: "list of layers to be interpreted (atop defaults). Default: base", - }, &cli.BoolFlag{ Name: "synthetic", Usage: "Use synthetic PoRep", From 560b04adcfb73eb9c74b5df0a236e2098a34551f Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 4 Jun 2024 16:47:46 +0400 Subject: [PATCH 2/3] fix db error --- cmd/curio/market.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/curio/market.go b/cmd/curio/market.go index 59d89469d..65d0da297 100644 --- a/cmd/curio/market.go +++ b/cmd/curio/market.go @@ -159,7 +159,7 @@ var marketSealCmd = &cli.Command{ ORDER BY piece_index DESC;`, mid, sector) if err != nil { - return false, xerrors.Errorf("getting open sectors from DB") + return false, xerrors.Errorf("getting open sectors from DB: %w", err) } if len(pieces) < 1 { From 887d22502abbc7fab400deb82b38dda2547e5d91 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 4 Jun 2024 17:56:52 +0400 Subject: [PATCH 3/3] update sealing states --- market/fakelm/lmimpl.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/market/fakelm/lmimpl.go b/market/fakelm/lmimpl.go index 35e6ca3e3..330923eb1 100644 --- a/market/fakelm/lmimpl.go +++ b/market/fakelm/lmimpl.go @@ -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" @@ -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, ` @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: