Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:remove layers flag from market seal #36

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions cmd/curio/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -162,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 {
Expand Down
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