Skip to content

Commit

Permalink
Move storiface into Curio (#183)
Browse files Browse the repository at this point in the history
* temp: replace lotus to local

* move storiface to Curio

* fix build

* don't refer to storiface2

* make gen

* make remote path test happy

* cleanup storiface
  • Loading branch information
magik6k authored Aug 30, 2024
1 parent 5f6156a commit e419bcf
Show file tree
Hide file tree
Showing 72 changed files with 1,887 additions and 258 deletions.
3 changes: 2 additions & 1 deletion api/api_curio.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"

storiface "github.com/filecoin-project/curio/lib/storiface"

"github.com/filecoin-project/lotus/api"
lpiece "github.com/filecoin-project/lotus/storage/pipeline/piece"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

type Curio interface {
Expand Down
3 changes: 2 additions & 1 deletion api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions cmd/curio/guidedsetup/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/curio/guidedsetup/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"github.com/filecoin-project/curio/deps"
"github.com/filecoin-project/curio/deps/config"
"github.com/filecoin-project/curio/harmony/harmonydb"
"github.com/filecoin-project/curio/lib/storiface"
"github.com/filecoin-project/curio/lib/types/sector"

"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/repo"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/curio/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/filecoin-project/curio/lib/metrics"
"github.com/filecoin-project/curio/lib/paths"
"github.com/filecoin-project/curio/lib/repo"
storiface "github.com/filecoin-project/curio/lib/storiface"
"github.com/filecoin-project/curio/web"

lapi "github.com/filecoin-project/lotus/api"
Expand All @@ -42,7 +43,6 @@ import (
"github.com/filecoin-project/lotus/metrics/proxy"
"github.com/filecoin-project/lotus/storage/pipeline/piece"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

const metaFile = "sectorstore.json"
Expand Down
4 changes: 2 additions & 2 deletions cmd/curio/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (

"github.com/filecoin-project/curio/cmd/curio/rpc"
"github.com/filecoin-project/curio/lib/reqcontext"
storiface "github.com/filecoin-project/curio/lib/storiface"

"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

var storageCmd = &cli.Command{
Expand Down Expand Up @@ -438,7 +438,7 @@ var storageFindCmd = &cli.Command{
}

sectorTypes := []storiface.SectorFileType{
storiface.FTUnsealed, storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache,
storiface.FTUnsealed, storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache, storiface.FTPiece,
}

byId := make(map[storiface.ID]*storedSector)
Expand Down
2 changes: 1 addition & 1 deletion cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/filecoin-project/curio/lib/multictladdr"
"github.com/filecoin-project/curio/lib/paths"
"github.com/filecoin-project/curio/lib/slotmgr"
"github.com/filecoin-project/curio/lib/storiface"
"github.com/filecoin-project/curio/tasks/gc"
"github.com/filecoin-project/curio/tasks/message"
"github.com/filecoin-project/curio/tasks/metadata"
Expand All @@ -44,7 +45,6 @@ import (
"github.com/filecoin-project/lotus/lib/lazy"
"github.com/filecoin-project/lotus/lib/result"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

var log = logging.Logger("curio/deps")
Expand Down
2 changes: 1 addition & 1 deletion deps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/filecoin-project/curio/lib/multictladdr"
"github.com/filecoin-project/curio/lib/paths"
"github.com/filecoin-project/curio/lib/repo"
"github.com/filecoin-project/curio/lib/storiface"

lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
Expand All @@ -46,7 +47,6 @@ import (
lrepo "github.com/filecoin-project/lotus/node/repo"
"github.com/filecoin-project/lotus/storage/sealer"
"github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)

var log = logging.Logger("curio/deps")
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ require (
github.com/filecoin-project/go-address v1.1.0
github.com/filecoin-project/go-bitfield v0.2.4
github.com/filecoin-project/go-cbor-util v0.0.1
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837
github.com/filecoin-project/go-commp-utils v0.1.4
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20240802040721-2a04ffc8ffe8
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-jsonrpc v0.6.1-0.20240820160949-2cfe810e5d2f
github.com/filecoin-project/go-padreader v0.0.1
Expand Down Expand Up @@ -66,18 +66,18 @@ require (
github.com/snadrus/must v0.0.0-20240605044437-98cedd57f8eb
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.25.5
github.com/whyrusleeping/cbor-gen v0.1.1
github.com/whyrusleeping/cbor-gen v0.1.2
github.com/yugabyte/pgx/v5 v5.5.3-yb-2
go.opencensus.io v0.24.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
golang.org/x/net v0.26.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.21.0
golang.org/x/sys v0.23.0
golang.org/x/text v0.16.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9
)

require (
Expand Down Expand Up @@ -124,11 +124,11 @@ require (
github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
github.com/filecoin-project/go-amt-ipld/v4 v4.3.0 // indirect
github.com/filecoin-project/go-clock v0.1.0 // indirect
github.com/filecoin-project/go-crypto v0.0.1 // indirect
github.com/filecoin-project/go-f3 v0.0.7 // indirect
github.com/filecoin-project/go-crypto v0.1.0 // indirect
github.com/filecoin-project/go-f3 v0.2.0 // indirect
github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect
github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect
github.com/filecoin-project/go-hamt-ipld/v3 v3.4.0 // indirect
github.com/filecoin-project/go-paramfetch v0.0.4 // indirect
github.com/filecoin-project/go-statemachine v1.0.3 // indirect
github.com/filecoin-project/go-storedcounter v0.1.0 // indirect
Expand Down Expand Up @@ -190,7 +190,6 @@ require (
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/ipni/go-libipni v0.0.8 // indirect
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
Expand All @@ -201,9 +200,9 @@ require (
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kilic/bls12-381 v0.1.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kilic/bls12-381 v0.1.1-0.20220929213557-ca162e8a70f4 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
Expand Down Expand Up @@ -295,6 +294,8 @@ require (
github.com/zondax/ledger-filecoin-go v0.11.1 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
github.com/zyedidia/generic v1.2.1 // indirect
gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/bridge/opencensus v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
Expand All @@ -308,9 +309,9 @@ require (
go.uber.org/fx v1.22.1 // indirect
go.uber.org/mock v0.4.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/time v0.5.0 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
Expand Down
Loading

0 comments on commit e419bcf

Please sign in to comment.