diff --git a/api/api_storage.go b/api/api_storage.go index 62bf5f5a4..3e029bc9f 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -12,9 +12,9 @@ import ( "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/specs-actors/actors/abi" ) diff --git a/api/api_worker.go b/api/api_worker.go index 64445becd..5b7cdc7e4 100644 --- a/api/api_worker.go +++ b/api/api_worker.go @@ -6,9 +6,9 @@ import ( "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index ec8d7c784..eabf4fa26 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -15,11 +15,11 @@ import ( "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-multistore" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" marketevents "github.com/filecoin-project/lotus/markets/loggers" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/miner" diff --git a/api/test/deals.go b/api/test/deals.go index f3c53933b..d29c6473a 100644 --- a/api/test/deals.go +++ b/api/test/deals.go @@ -22,8 +22,8 @@ import ( "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/lotus/miner" - "github.com/filecoin-project/lotus/storage/sealing" dag "github.com/ipfs/go-merkledag" dstest "github.com/ipfs/go-merkledag/test" unixfile "github.com/ipfs/go-unixfs/file" diff --git a/api/test/window_post.go b/api/test/window_post.go index 8ced2b00f..a22f78904 100644 --- a/api/test/window_post.go +++ b/api/test/window_post.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sealing" - "github.com/filecoin-project/lotus/storage/sector/mock" + "github.com/filecoin-project/lotus/extern/sector-storage/mock" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/specs-actors/actors/abi" miner2 "github.com/filecoin-project/specs-actors/actors/builtin/miner" diff --git a/chain/gen/gen.go b/chain/gen/gen.go index a7c1bfda4..bcf9c4f10 100644 --- a/chain/gen/gen.go +++ b/chain/gen/gen.go @@ -34,11 +34,11 @@ import ( "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/chain/wallet" "github.com/filecoin-project/lotus/cmd/lotus-seed/seed" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/lib/blockstore" "github.com/filecoin-project/lotus/lib/sigs" "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" ) var log = logging.Logger("gen") diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 44a1544ce..0491371d3 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -14,7 +14,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin" diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index 720b528f3..c8ae9ce53 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/builtin/account" diff --git a/chain/sync.go b/chain/sync.go index 0753d79a3..b0ae185b0 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -24,7 +24,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/builtin/power" diff --git a/chain/vm/syscalls.go b/chain/vm/syscalls.go index 1530b8bcd..41ed9c762 100644 --- a/chain/vm/syscalls.go +++ b/chain/vm/syscalls.go @@ -23,7 +23,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/runtime" "github.com/filecoin-project/specs-actors/actors/util/adt" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" ) func init() { diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index cb3cae628..9944adc0b 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -25,7 +25,7 @@ import ( _ "github.com/filecoin-project/lotus/lib/sigs/bls" _ "github.com/filecoin-project/lotus/lib/sigs/secp" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-datastore" diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 0b163eb79..694987f27 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -21,9 +21,9 @@ import ( "github.com/filecoin-project/go-address" paramfetch "github.com/filecoin-project/go-paramfetch" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-storage/storage" diff --git a/cmd/lotus-fountain/main.go b/cmd/lotus-fountain/main.go index e0c929498..8e3461595 100644 --- a/cmd/lotus-fountain/main.go +++ b/cmd/lotus-fountain/main.go @@ -21,7 +21,7 @@ import ( "github.com/urfave/cli/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin" diff --git a/cmd/lotus-seal-worker/main.go b/cmd/lotus-seal-worker/main.go index 9ac16799f..8113067ca 100644 --- a/cmd/lotus-seal-worker/main.go +++ b/cmd/lotus-seal-worker/main.go @@ -22,18 +22,18 @@ import ( "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-jsonrpc/auth" paramfetch "github.com/filecoin-project/go-paramfetch" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/apistruct" "github.com/filecoin-project/lotus/build" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/lib/lotuslog" "github.com/filecoin-project/lotus/lib/rpcenc" "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" ) var log = logging.Logger("main") @@ -336,7 +336,7 @@ var runCmd = &cli.Command{ // Create / expose the worker workerApi := &worker{ - LocalWorker: sector.NewLocalWorker(sector.WorkerConfig{ + LocalWorker: sectorstorage.NewLocalWorker(sectorstorage.WorkerConfig{ SealProof: spt, TaskTypes: taskTypes, }, remote, localStore, nodeApi), diff --git a/cmd/lotus-seal-worker/rpc.go b/cmd/lotus-seal-worker/rpc.go index 7a1632284..ec3bccad5 100644 --- a/cmd/lotus-seal-worker/rpc.go +++ b/cmd/lotus-seal-worker/rpc.go @@ -5,13 +5,13 @@ import ( "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector" + "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/build" ) type worker struct { - *sector.LocalWorker + *sectorstorage.LocalWorker } func (w *worker) Version(context.Context) (build.Version, error) { diff --git a/cmd/lotus-seed/main.go b/cmd/lotus-seed/main.go index 9a2b498e6..508d1d222 100644 --- a/cmd/lotus-seed/main.go +++ b/cmd/lotus-seed/main.go @@ -8,7 +8,7 @@ import ( "os" "github.com/docker/go-units" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" logging "github.com/ipfs/go-log/v2" "github.com/mitchellh/go-homedir" diff --git a/cmd/lotus-seed/seed/seed.go b/cmd/lotus-seed/seed/seed.go index 33dc360e5..5b4a1fbac 100644 --- a/cmd/lotus-seed/seed/seed.go +++ b/cmd/lotus-seed/seed/seed.go @@ -19,7 +19,7 @@ import ( ffi "github.com/filecoin-project/filecoin-ffi" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector/zerocomm" + "github.com/filecoin-project/lotus/extern/sector-storage/zerocomm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" @@ -27,10 +27,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/genesis" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/storage/sector/stores" ) var log = logging.Logger("preseal") diff --git a/cmd/lotus-storage-miner/info.go b/cmd/lotus-storage-miner/info.go index 9755ff698..f8a5c0476 100644 --- a/cmd/lotus-storage-miner/info.go +++ b/cmd/lotus-storage-miner/info.go @@ -11,7 +11,7 @@ import ( "github.com/urfave/cli/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-actors/actors/builtin/power" diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 3802e6925..f5810d6d9 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -25,9 +25,9 @@ import ( "github.com/filecoin-project/go-address" cborutil "github.com/filecoin-project/go-cbor-util" paramfetch "github.com/filecoin-project/go-paramfetch" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/builtin/market" @@ -41,13 +41,13 @@ import ( "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/modules" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/lotus/storage" - "github.com/filecoin-project/lotus/storage/sealing" ) var initCmd = &cli.Command{ @@ -436,9 +436,9 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode, return err } - smgr, err := sector.New(ctx, lr, stores.NewIndex(), &ffiwrapper.Config{ + smgr, err := sectorstorage.New(ctx, lr, stores.NewIndex(), &ffiwrapper.Config{ SealProofType: spt, - }, sector.SealerConfig{ + }, sectorstorage.SealerConfig{ ParallelFetchLimit: 10, AllowPreCommit1: true, AllowPreCommit2: true, diff --git a/cmd/lotus-storage-miner/sealing.go b/cmd/lotus-storage-miner/sealing.go index e948c8bf0..c9ed224b3 100644 --- a/cmd/lotus-storage-miner/sealing.go +++ b/cmd/lotus-storage-miner/sealing.go @@ -13,7 +13,7 @@ import ( "github.com/fatih/color" "github.com/urfave/cli/v2" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" diff --git a/cmd/lotus-storage-miner/storage.go b/cmd/lotus-storage-miner/storage.go index 4a7b8e0a5..7fadcf83f 100644 --- a/cmd/lotus-storage-miner/storage.go +++ b/cmd/lotus-storage-miner/storage.go @@ -18,8 +18,8 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/lotus/chain/types" diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index 0e0e841a8..848596944 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -30,6 +30,7 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/vm" lcli "github.com/filecoin-project/lotus/cli" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/lib/blockstore" "github.com/filecoin-project/lotus/lib/peermgr" "github.com/filecoin-project/lotus/lib/ulimit" @@ -39,7 +40,6 @@ import ( "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/testing" "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" ) const ( diff --git a/storage/sector/README.md b/extern/sector-storage/README.md similarity index 100% rename from storage/sector/README.md rename to extern/sector-storage/README.md diff --git a/storage/sector/docs/sector-storage.svg b/extern/sector-storage/docs/sector-storage.svg similarity index 100% rename from storage/sector/docs/sector-storage.svg rename to extern/sector-storage/docs/sector-storage.svg diff --git a/storage/sector/faults.go b/extern/sector-storage/faults.go similarity index 97% rename from storage/sector/faults.go rename to extern/sector-storage/faults.go index 1b69e4f68..06c823bb8 100644 --- a/storage/sector/faults.go +++ b/extern/sector-storage/faults.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -8,7 +8,7 @@ import ( "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/specs-actors/actors/abi" ) diff --git a/storage/sector/ffiwrapper/basicfs/fs.go b/extern/sector-storage/ffiwrapper/basicfs/fs.go similarity index 93% rename from storage/sector/ffiwrapper/basicfs/fs.go rename to extern/sector-storage/ffiwrapper/basicfs/fs.go index 9e36bf797..ae17273e9 100644 --- a/storage/sector/ffiwrapper/basicfs/fs.go +++ b/extern/sector-storage/ffiwrapper/basicfs/fs.go @@ -8,8 +8,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) type sectorFile struct { diff --git a/storage/sector/ffiwrapper/config.go b/extern/sector-storage/ffiwrapper/config.go similarity index 100% rename from storage/sector/ffiwrapper/config.go rename to extern/sector-storage/ffiwrapper/config.go diff --git a/storage/sector/ffiwrapper/files.go b/extern/sector-storage/ffiwrapper/files.go similarity index 100% rename from storage/sector/ffiwrapper/files.go rename to extern/sector-storage/ffiwrapper/files.go diff --git a/storage/sector/ffiwrapper/partialfile.go b/extern/sector-storage/ffiwrapper/partialfile.go similarity index 98% rename from storage/sector/ffiwrapper/partialfile.go rename to extern/sector-storage/ffiwrapper/partialfile.go index 5599d1fde..74992f7ba 100644 --- a/storage/sector/ffiwrapper/partialfile.go +++ b/extern/sector-storage/ffiwrapper/partialfile.go @@ -12,8 +12,8 @@ import ( rlepluslazy "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) const veryLargeRle = 1 << 20 diff --git a/storage/sector/ffiwrapper/sealer.go b/extern/sector-storage/ffiwrapper/sealer.go similarity index 100% rename from storage/sector/ffiwrapper/sealer.go rename to extern/sector-storage/ffiwrapper/sealer.go diff --git a/storage/sector/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go similarity index 98% rename from storage/sector/ffiwrapper/sealer_cgo.go rename to extern/sector-storage/ffiwrapper/sealer_cgo.go index 5e7930546..a72f5a66f 100644 --- a/storage/sector/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -20,10 +20,10 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/fr32" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" - "github.com/filecoin-project/lotus/storage/sector/zerocomm" + "github.com/filecoin-project/lotus/extern/sector-storage/fr32" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/zerocomm" ) var _ Storage = &Sealer{} diff --git a/storage/sector/ffiwrapper/sealer_test.go b/extern/sector-storage/ffiwrapper/sealer_test.go similarity index 98% rename from storage/sector/ffiwrapper/sealer_test.go rename to extern/sector-storage/ffiwrapper/sealer_test.go index eb1f94485..b484b391f 100644 --- a/storage/sector/ffiwrapper/sealer_test.go +++ b/extern/sector-storage/ffiwrapper/sealer_test.go @@ -27,8 +27,8 @@ import ( ffi "github.com/filecoin-project/filecoin-ffi" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) func init() { diff --git a/storage/sector/ffiwrapper/types.go b/extern/sector-storage/ffiwrapper/types.go similarity index 88% rename from storage/sector/ffiwrapper/types.go rename to extern/sector-storage/ffiwrapper/types.go index 60c362776..a634134ee 100644 --- a/storage/sector/ffiwrapper/types.go +++ b/extern/sector-storage/ffiwrapper/types.go @@ -9,9 +9,9 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) type Validator interface { diff --git a/storage/sector/ffiwrapper/unseal_ranges.go b/extern/sector-storage/ffiwrapper/unseal_ranges.go similarity index 92% rename from storage/sector/ffiwrapper/unseal_ranges.go rename to extern/sector-storage/ffiwrapper/unseal_ranges.go index 8d0d4936a..2e5119994 100644 --- a/storage/sector/ffiwrapper/unseal_ranges.go +++ b/extern/sector-storage/ffiwrapper/unseal_ranges.go @@ -7,7 +7,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) // merge gaps between ranges which are close to each other diff --git a/storage/sector/ffiwrapper/verifier_cgo.go b/extern/sector-storage/ffiwrapper/verifier_cgo.go similarity index 98% rename from storage/sector/ffiwrapper/verifier_cgo.go rename to extern/sector-storage/ffiwrapper/verifier_cgo.go index ccc2ec7a2..de6fc0849 100644 --- a/storage/sector/ffiwrapper/verifier_cgo.go +++ b/extern/sector-storage/ffiwrapper/verifier_cgo.go @@ -11,7 +11,7 @@ import ( ffi "github.com/filecoin-project/filecoin-ffi" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "go.opencensus.io/trace" ) diff --git a/storage/sector/fr32/fr32.go b/extern/sector-storage/fr32/fr32.go similarity index 100% rename from storage/sector/fr32/fr32.go rename to extern/sector-storage/fr32/fr32.go diff --git a/storage/sector/fr32/fr32_ffi_cmp_test.go b/extern/sector-storage/fr32/fr32_ffi_cmp_test.go similarity index 90% rename from storage/sector/fr32/fr32_ffi_cmp_test.go rename to extern/sector-storage/fr32/fr32_ffi_cmp_test.go index 29f7a58c7..2a602424a 100644 --- a/storage/sector/fr32/fr32_ffi_cmp_test.go +++ b/extern/sector-storage/fr32/fr32_ffi_cmp_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/fr32" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/fr32" ffi "github.com/filecoin-project/filecoin-ffi" diff --git a/storage/sector/fr32/fr32_test.go b/extern/sector-storage/fr32/fr32_test.go similarity index 97% rename from storage/sector/fr32/fr32_test.go rename to extern/sector-storage/fr32/fr32_test.go index be3ec3e3d..e27e7b1e3 100644 --- a/storage/sector/fr32/fr32_test.go +++ b/extern/sector-storage/fr32/fr32_test.go @@ -12,8 +12,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/stretchr/testify/require" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/fr32" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/fr32" ) func padFFI(buf []byte) []byte { diff --git a/storage/sector/fr32/readers.go b/extern/sector-storage/fr32/readers.go similarity index 100% rename from storage/sector/fr32/readers.go rename to extern/sector-storage/fr32/readers.go diff --git a/storage/sector/fr32/readers_test.go b/extern/sector-storage/fr32/readers_test.go similarity index 89% rename from storage/sector/fr32/readers_test.go rename to extern/sector-storage/fr32/readers_test.go index 2c6f01f8c..e87a776ef 100644 --- a/storage/sector/fr32/readers_test.go +++ b/extern/sector-storage/fr32/readers_test.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/fr32" + "github.com/filecoin-project/lotus/extern/sector-storage/fr32" ) func TestUnpadReader(t *testing.T) { diff --git a/storage/sector/fr32/utils.go b/extern/sector-storage/fr32/utils.go similarity index 100% rename from storage/sector/fr32/utils.go rename to extern/sector-storage/fr32/utils.go diff --git a/storage/sector/fsutil/dealloc_linux.go b/extern/sector-storage/fsutil/dealloc_linux.go similarity index 100% rename from storage/sector/fsutil/dealloc_linux.go rename to extern/sector-storage/fsutil/dealloc_linux.go diff --git a/storage/sector/fsutil/dealloc_other.go b/extern/sector-storage/fsutil/dealloc_other.go similarity index 100% rename from storage/sector/fsutil/dealloc_other.go rename to extern/sector-storage/fsutil/dealloc_other.go diff --git a/storage/sector/fsutil/filesize_unix.go b/extern/sector-storage/fsutil/filesize_unix.go similarity index 100% rename from storage/sector/fsutil/filesize_unix.go rename to extern/sector-storage/fsutil/filesize_unix.go diff --git a/storage/sector/fsutil/statfs.go b/extern/sector-storage/fsutil/statfs.go similarity index 100% rename from storage/sector/fsutil/statfs.go rename to extern/sector-storage/fsutil/statfs.go diff --git a/storage/sector/fsutil/statfs_unix.go b/extern/sector-storage/fsutil/statfs_unix.go similarity index 100% rename from storage/sector/fsutil/statfs_unix.go rename to extern/sector-storage/fsutil/statfs_unix.go diff --git a/storage/sector/fsutil/statfs_windows.go b/extern/sector-storage/fsutil/statfs_windows.go similarity index 100% rename from storage/sector/fsutil/statfs_windows.go rename to extern/sector-storage/fsutil/statfs_windows.go diff --git a/storage/sector/localworker.go b/extern/sector-storage/localworker.go similarity index 96% rename from storage/sector/localworker.go rename to extern/sector-storage/localworker.go index 6b4b163f3..f96cc8472 100644 --- a/storage/sector/localworker.go +++ b/extern/sector-storage/localworker.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -15,10 +15,10 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" storage2 "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) var pathTypes = []stores.SectorFileType{stores.FTUnsealed, stores.FTSealed, stores.FTCache} diff --git a/storage/sector/manager.go b/extern/sector-storage/manager.go similarity index 97% rename from storage/sector/manager.go rename to extern/sector-storage/manager.go index a6fffdb22..fb8636970 100644 --- a/storage/sector/manager.go +++ b/extern/sector-storage/manager.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -6,7 +6,7 @@ import ( "io" "net/http" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" @@ -16,10 +16,10 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) var log = logging.Logger("advmgr") diff --git a/storage/sector/manager_test.go b/extern/sector-storage/manager_test.go similarity index 91% rename from storage/sector/manager_test.go rename to extern/sector-storage/manager_test.go index 04291c1bd..13ad9f8bf 100644 --- a/storage/sector/manager_test.go +++ b/extern/sector-storage/manager_test.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "bytes" @@ -11,10 +11,10 @@ import ( "strings" "testing" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/specs-actors/actors/abi" diff --git a/storage/sector/mock/mock.go b/extern/sector-storage/mock/mock.go similarity index 98% rename from storage/sector/mock/mock.go rename to extern/sector-storage/mock/mock.go index afe82f290..783d2e19c 100644 --- a/storage/sector/mock/mock.go +++ b/extern/sector-storage/mock/mock.go @@ -16,8 +16,8 @@ import ( logging "github.com/ipfs/go-log" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) var log = logging.Logger("sbmock") diff --git a/storage/sector/mock/mock_test.go b/extern/sector-storage/mock/mock_test.go similarity index 100% rename from storage/sector/mock/mock_test.go rename to extern/sector-storage/mock/mock_test.go diff --git a/storage/sector/mock/util.go b/extern/sector-storage/mock/util.go similarity index 100% rename from storage/sector/mock/util.go rename to extern/sector-storage/mock/util.go diff --git a/storage/sector/request_queue.go b/extern/sector-storage/request_queue.go similarity index 97% rename from storage/sector/request_queue.go rename to extern/sector-storage/request_queue.go index 66f2da754..85d3abf46 100644 --- a/storage/sector/request_queue.go +++ b/extern/sector-storage/request_queue.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import "sort" diff --git a/storage/sector/request_queue_test.go b/extern/sector-storage/request_queue_test.go similarity index 92% rename from storage/sector/request_queue_test.go rename to extern/sector-storage/request_queue_test.go index e00fb3e4e..ed802f30a 100644 --- a/storage/sector/request_queue_test.go +++ b/extern/sector-storage/request_queue_test.go @@ -1,10 +1,10 @@ -package sector +package sectorstorage import ( "fmt" "testing" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" ) func TestRequestQueue(t *testing.T) { diff --git a/storage/sector/resources.go b/extern/sector-storage/resources.go similarity index 98% rename from storage/sector/resources.go rename to extern/sector-storage/resources.go index 4c4323d3f..d2c5646fa 100644 --- a/storage/sector/resources.go +++ b/extern/sector-storage/resources.go @@ -1,9 +1,9 @@ -package sector +package sectorstorage import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" ) type Resources struct { diff --git a/storage/sector/roprov.go b/extern/sector-storage/roprov.go similarity index 92% rename from storage/sector/roprov.go rename to extern/sector-storage/roprov.go index 612e1d474..fe58a8445 100644 --- a/storage/sector/roprov.go +++ b/extern/sector-storage/roprov.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -7,7 +7,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) type readonlyProvider struct { diff --git a/storage/sector/sched.go b/extern/sector-storage/sched.go similarity index 98% rename from storage/sector/sched.go rename to extern/sector-storage/sched.go index 2dcf94e91..328110c64 100644 --- a/storage/sector/sched.go +++ b/extern/sector-storage/sched.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -12,8 +12,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) type schedPrioCtxKey int diff --git a/storage/sector/sched_resources.go b/extern/sector-storage/sched_resources.go similarity index 96% rename from storage/sector/sched_resources.go rename to extern/sector-storage/sched_resources.go index d76456a0f..f468d5fe9 100644 --- a/storage/sector/sched_resources.go +++ b/extern/sector-storage/sched_resources.go @@ -1,9 +1,9 @@ -package sector +package sectorstorage import ( "sync" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) func (a *activeResources) withResources(id WorkerID, wr storiface.WorkerResources, r Resources, locker sync.Locker, cb func() error) error { diff --git a/storage/sector/sched_test.go b/extern/sector-storage/sched_test.go similarity index 97% rename from storage/sector/sched_test.go rename to extern/sector-storage/sched_test.go index e8c68501d..5c9bc44ee 100644 --- a/storage/sector/sched_test.go +++ b/extern/sector-storage/sched_test.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -14,10 +14,10 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/specs-storage/storage" ) diff --git a/storage/sector/sched_watch.go b/extern/sector-storage/sched_watch.go similarity index 98% rename from storage/sector/sched_watch.go rename to extern/sector-storage/sched_watch.go index aa65d5c8b..2dd9875d7 100644 --- a/storage/sector/sched_watch.go +++ b/extern/sector-storage/sched_watch.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" diff --git a/storage/sector/sealtasks/task.go b/extern/sector-storage/sealtasks/task.go similarity index 100% rename from storage/sector/sealtasks/task.go rename to extern/sector-storage/sealtasks/task.go diff --git a/storage/sector/selector_alloc.go b/extern/sector-storage/selector_alloc.go similarity index 90% rename from storage/sector/selector_alloc.go rename to extern/sector-storage/selector_alloc.go index e9eb6a740..57ac6c124 100644 --- a/storage/sector/selector_alloc.go +++ b/extern/sector-storage/selector_alloc.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) type allocSelector struct { diff --git a/storage/sector/selector_existing.go b/extern/sector-storage/selector_existing.go similarity index 91% rename from storage/sector/selector_existing.go rename to extern/sector-storage/selector_existing.go index 3a653ec42..fda084672 100644 --- a/storage/sector/selector_existing.go +++ b/extern/sector-storage/selector_existing.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) type existingSelector struct { diff --git a/storage/sector/selector_task.go b/extern/sector-storage/selector_task.go similarity index 88% rename from storage/sector/selector_task.go rename to extern/sector-storage/selector_task.go index ca122aa6f..4586ce4db 100644 --- a/storage/sector/selector_task.go +++ b/extern/sector-storage/selector_task.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) type taskSelector struct { diff --git a/storage/sector/stats.go b/extern/sector-storage/stats.go similarity index 88% rename from storage/sector/stats.go rename to extern/sector-storage/stats.go index e8de2c1b0..9abbdb83a 100644 --- a/storage/sector/stats.go +++ b/extern/sector-storage/stats.go @@ -1,6 +1,6 @@ -package sector +package sectorstorage -import "github.com/filecoin-project/lotus/storage/sector/storiface" +import "github.com/filecoin-project/lotus/extern/sector-storage/storiface" func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats { m.sched.workersLk.RLock() diff --git a/storage/sector/stores/filetype.go b/extern/sector-storage/stores/filetype.go similarity index 100% rename from storage/sector/stores/filetype.go rename to extern/sector-storage/stores/filetype.go diff --git a/storage/sector/stores/http_handler.go b/extern/sector-storage/stores/http_handler.go similarity index 97% rename from storage/sector/stores/http_handler.go rename to extern/sector-storage/stores/http_handler.go index 3bf664fd5..97af6e769 100644 --- a/storage/sector/stores/http_handler.go +++ b/extern/sector-storage/stores/http_handler.go @@ -10,7 +10,7 @@ import ( logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/tarutil" + "github.com/filecoin-project/lotus/extern/sector-storage/tarutil" ) var log = logging.Logger("stores") diff --git a/storage/sector/stores/index.go b/extern/sector-storage/stores/index.go similarity index 99% rename from storage/sector/stores/index.go rename to extern/sector-storage/stores/index.go index b51ea0f52..256dc9651 100644 --- a/storage/sector/stores/index.go +++ b/extern/sector-storage/stores/index.go @@ -10,7 +10,7 @@ import ( "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" diff --git a/storage/sector/stores/index_locks.go b/extern/sector-storage/stores/index_locks.go similarity index 100% rename from storage/sector/stores/index_locks.go rename to extern/sector-storage/stores/index_locks.go diff --git a/storage/sector/stores/index_locks_test.go b/extern/sector-storage/stores/index_locks_test.go similarity index 100% rename from storage/sector/stores/index_locks_test.go rename to extern/sector-storage/stores/index_locks_test.go diff --git a/storage/sector/stores/index_locks_util.go b/extern/sector-storage/stores/index_locks_util.go similarity index 100% rename from storage/sector/stores/index_locks_util.go rename to extern/sector-storage/stores/index_locks_util.go diff --git a/storage/sector/stores/interface.go b/extern/sector-storage/stores/interface.go similarity index 93% rename from storage/sector/stores/interface.go rename to extern/sector-storage/stores/interface.go index 46a07ee0d..d94f28e83 100644 --- a/storage/sector/stores/interface.go +++ b/extern/sector-storage/stores/interface.go @@ -3,7 +3,7 @@ package stores import ( "context" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/specs-actors/actors/abi" ) diff --git a/storage/sector/stores/local.go b/extern/sector-storage/stores/local.go similarity index 99% rename from storage/sector/stores/local.go rename to extern/sector-storage/stores/local.go index cf301b902..b308f5d86 100644 --- a/storage/sector/stores/local.go +++ b/extern/sector-storage/stores/local.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" ) type StoragePath struct { diff --git a/storage/sector/stores/local_test.go b/extern/sector-storage/stores/local_test.go similarity index 96% rename from storage/sector/stores/local_test.go rename to extern/sector-storage/stores/local_test.go index a4e39894e..1c31e8c09 100644 --- a/storage/sector/stores/local_test.go +++ b/extern/sector-storage/stores/local_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/google/uuid" "github.com/stretchr/testify/require" diff --git a/storage/sector/stores/remote.go b/extern/sector-storage/stores/remote.go similarity index 98% rename from storage/sector/stores/remote.go rename to extern/sector-storage/stores/remote.go index 6e069e0a4..a88e3b947 100644 --- a/storage/sector/stores/remote.go +++ b/extern/sector-storage/stores/remote.go @@ -14,9 +14,9 @@ import ( "sort" "sync" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/storiface" - "github.com/filecoin-project/lotus/storage/sector/tarutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/tarutil" "github.com/filecoin-project/specs-actors/actors/abi" diff --git a/storage/sector/stores/util_unix.go b/extern/sector-storage/stores/util_unix.go similarity index 100% rename from storage/sector/stores/util_unix.go rename to extern/sector-storage/stores/util_unix.go diff --git a/storage/sector/storiface/ffi.go b/extern/sector-storage/storiface/ffi.go similarity index 100% rename from storage/sector/storiface/ffi.go rename to extern/sector-storage/storiface/ffi.go diff --git a/storage/sector/storiface/worker.go b/extern/sector-storage/storiface/worker.go similarity index 89% rename from storage/sector/storiface/worker.go rename to extern/sector-storage/storiface/worker.go index 78051b20e..37c447031 100644 --- a/storage/sector/storiface/worker.go +++ b/extern/sector-storage/storiface/worker.go @@ -3,7 +3,7 @@ package storiface import ( "time" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/specs-actors/actors/abi" ) diff --git a/storage/sector/tarutil/systar.go b/extern/sector-storage/tarutil/systar.go similarity index 100% rename from storage/sector/tarutil/systar.go rename to extern/sector-storage/tarutil/systar.go diff --git a/storage/sector/testworker_test.go b/extern/sector-storage/testworker_test.go similarity index 92% rename from storage/sector/testworker_test.go rename to extern/sector-storage/testworker_test.go index c1c2852b5..f9b541f0a 100644 --- a/storage/sector/testworker_test.go +++ b/extern/sector-storage/testworker_test.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -9,10 +9,10 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/mock" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/mock" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) type testWorker struct { diff --git a/storage/sector/work_tracker.go b/extern/sector-storage/work_tracker.go similarity index 94% rename from storage/sector/work_tracker.go rename to extern/sector-storage/work_tracker.go index 78c3926ec..fe176a7f7 100644 --- a/storage/sector/work_tracker.go +++ b/extern/sector-storage/work_tracker.go @@ -1,4 +1,4 @@ -package sector +package sectorstorage import ( "context" @@ -11,9 +11,9 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/storage/sector/sealtasks" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" + "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" ) type workTracker struct { diff --git a/storage/sector/zerocomm/zerocomm.go b/extern/sector-storage/zerocomm/zerocomm.go similarity index 100% rename from storage/sector/zerocomm/zerocomm.go rename to extern/sector-storage/zerocomm/zerocomm.go diff --git a/storage/sector/zerocomm/zerocomm_test.go b/extern/sector-storage/zerocomm/zerocomm_test.go similarity index 95% rename from storage/sector/zerocomm/zerocomm_test.go rename to extern/sector-storage/zerocomm/zerocomm_test.go index a187db49e..f5f508796 100644 --- a/storage/sector/zerocomm/zerocomm_test.go +++ b/extern/sector-storage/zerocomm/zerocomm_test.go @@ -10,8 +10,8 @@ import ( abi "github.com/filecoin-project/specs-actors/actors/abi" "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/zerocomm" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/zerocomm" ) func TestComms(t *testing.T) { diff --git a/storage/sealing/cbor_gen.go b/extern/storage-sealing/cbor_gen.go similarity index 100% rename from storage/sealing/cbor_gen.go rename to extern/storage-sealing/cbor_gen.go diff --git a/storage/sealing/checks.go b/extern/storage-sealing/checks.go similarity index 97% rename from storage/sealing/checks.go rename to extern/storage-sealing/checks.go index 38ed31022..a86953d08 100644 --- a/storage/sealing/checks.go +++ b/extern/storage-sealing/checks.go @@ -7,8 +7,8 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/zerocomm" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/zerocomm" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-actors/actors/crypto" diff --git a/storage/sealing/constants.go b/extern/storage-sealing/constants.go similarity index 100% rename from storage/sealing/constants.go rename to extern/storage-sealing/constants.go diff --git a/storage/sealing/events.go b/extern/storage-sealing/events.go similarity index 100% rename from storage/sealing/events.go rename to extern/storage-sealing/events.go diff --git a/storage/sealing/fsm.go b/extern/storage-sealing/fsm.go similarity index 100% rename from storage/sealing/fsm.go rename to extern/storage-sealing/fsm.go diff --git a/storage/sealing/fsm_events.go b/extern/storage-sealing/fsm_events.go similarity index 100% rename from storage/sealing/fsm_events.go rename to extern/storage-sealing/fsm_events.go diff --git a/storage/sealing/fsm_test.go b/extern/storage-sealing/fsm_test.go similarity index 100% rename from storage/sealing/fsm_test.go rename to extern/storage-sealing/fsm_test.go diff --git a/storage/sealing/garbage.go b/extern/storage-sealing/garbage.go similarity index 100% rename from storage/sealing/garbage.go rename to extern/storage-sealing/garbage.go diff --git a/storage/sealing/gen/main.go b/extern/storage-sealing/gen/main.go similarity index 84% rename from storage/sealing/gen/main.go rename to extern/storage-sealing/gen/main.go index 4d8f28a1b..295199fc2 100644 --- a/storage/sealing/gen/main.go +++ b/extern/storage-sealing/gen/main.go @@ -6,7 +6,7 @@ import ( gen "github.com/whyrusleeping/cbor-gen" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) func main() { diff --git a/storage/sealing/lib/nullreader/nullreader.go b/extern/storage-sealing/lib/nullreader/nullreader.go similarity index 100% rename from storage/sealing/lib/nullreader/nullreader.go rename to extern/storage-sealing/lib/nullreader/nullreader.go diff --git a/storage/sealing/nullreader.go b/extern/storage-sealing/nullreader.go similarity index 100% rename from storage/sealing/nullreader.go rename to extern/storage-sealing/nullreader.go diff --git a/storage/sealing/precommit_policy.go b/extern/storage-sealing/precommit_policy.go similarity index 100% rename from storage/sealing/precommit_policy.go rename to extern/storage-sealing/precommit_policy.go diff --git a/storage/sealing/precommit_policy_test.go b/extern/storage-sealing/precommit_policy_test.go similarity index 98% rename from storage/sealing/precommit_policy_test.go rename to extern/storage-sealing/precommit_policy_test.go index fb93c909b..9fd56b77e 100644 --- a/storage/sealing/precommit_policy_test.go +++ b/extern/storage-sealing/precommit_policy_test.go @@ -11,7 +11,7 @@ import ( commcid "github.com/filecoin-project/go-fil-commcid" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) type fakeChain struct { diff --git a/storage/sealing/sealing.go b/extern/storage-sealing/sealing.go similarity index 94% rename from storage/sealing/sealing.go rename to extern/storage-sealing/sealing.go index 04c7830f4..0d243453e 100644 --- a/storage/sealing/sealing.go +++ b/extern/storage-sealing/sealing.go @@ -15,8 +15,8 @@ import ( "github.com/filecoin-project/go-address" padreader "github.com/filecoin-project/go-padreader" statemachine "github.com/filecoin-project/go-statemachine" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" @@ -59,7 +59,7 @@ type Sealing struct { maddr address.Address - sealer sector.SectorManager + sealer sectorstorage.SectorManager sectors *statemachine.StateGroup sc SectorIDCounter verif ffiwrapper.Verifier @@ -90,7 +90,7 @@ type UnsealedSectorInfo struct { pieceSizes []abi.UnpaddedPieceSize } -func New(api SealingAPI, fc FeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sector.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, pcp PreCommitPolicy, gsd GetSealingDelayFunc) *Sealing { +func New(api SealingAPI, fc FeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sectorstorage.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, pcp PreCommitPolicy, gsd GetSealingDelayFunc) *Sealing { s := &Sealing{ api: api, feeCfg: fc, @@ -174,7 +174,7 @@ func (m *Sealing) AddPieceToAnySector(ctx context.Context, size abi.UnpaddedPiec // Caller should hold m.unsealedInfoMap.mux func (m *Sealing) addPiece(ctx context.Context, sectorID abi.SectorNumber, size abi.UnpaddedPieceSize, r io.Reader, di *DealInfo) error { log.Infof("Adding piece to sector %d", sectorID) - ppi, err := m.sealer.AddPiece(sector.WithPriority(ctx, DealSectorPriority), m.minerSector(sectorID), m.unsealedInfoMap.infos[sectorID].pieceSizes, size, r) + ppi, err := m.sealer.AddPiece(sectorstorage.WithPriority(ctx, DealSectorPriority), m.minerSector(sectorID), m.unsealedInfoMap.infos[sectorID].pieceSizes, size, r) if err != nil { return xerrors.Errorf("writing piece: %w", err) } diff --git a/storage/sealing/sector_state.go b/extern/storage-sealing/sector_state.go similarity index 100% rename from storage/sealing/sector_state.go rename to extern/storage-sealing/sector_state.go diff --git a/storage/sealing/states_failed.go b/extern/storage-sealing/states_failed.go similarity index 100% rename from storage/sealing/states_failed.go rename to extern/storage-sealing/states_failed.go diff --git a/storage/sealing/states_proving.go b/extern/storage-sealing/states_proving.go similarity index 100% rename from storage/sealing/states_proving.go rename to extern/storage-sealing/states_proving.go diff --git a/storage/sealing/states_sealing.go b/extern/storage-sealing/states_sealing.go similarity index 100% rename from storage/sealing/states_sealing.go rename to extern/storage-sealing/states_sealing.go diff --git a/storage/sealing/types.go b/extern/storage-sealing/types.go similarity index 97% rename from storage/sealing/types.go rename to extern/storage-sealing/types.go index ad2f5d459..a76414f0a 100644 --- a/storage/sealing/types.go +++ b/extern/storage-sealing/types.go @@ -7,12 +7,13 @@ import ( "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/storage/sector" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-actors/actors/runtime/exitcode" "github.com/filecoin-project/specs-storage/storage" + + "github.com/filecoin-project/lotus/extern/sector-storage" ) // Piece is a tuple of piece and deal info @@ -137,7 +138,7 @@ func (t *SectorInfo) sealingCtx(ctx context.Context) context.Context { // we need sealed sooner if t.hasDeals() { - return sector.WithPriority(ctx, DealSectorPriority) + return sectorstorage.WithPriority(ctx, DealSectorPriority) } return ctx diff --git a/storage/sealing/types_test.go b/extern/storage-sealing/types_test.go similarity index 100% rename from storage/sealing/types_test.go rename to extern/storage-sealing/types_test.go diff --git a/storage/sealing/upgrade_queue.go b/extern/storage-sealing/upgrade_queue.go similarity index 100% rename from storage/sealing/upgrade_queue.go rename to extern/storage-sealing/upgrade_queue.go diff --git a/storage/sealing/utils.go b/extern/storage-sealing/utils.go similarity index 100% rename from storage/sealing/utils.go rename to extern/storage-sealing/utils.go diff --git a/storage/sealing/utils_test.go b/extern/storage-sealing/utils_test.go similarity index 100% rename from storage/sealing/utils_test.go rename to extern/storage-sealing/utils_test.go diff --git a/lib/rpcenc/reader.go b/lib/rpcenc/reader.go index 439f9c318..9f59fe7c8 100644 --- a/lib/rpcenc/reader.go +++ b/lib/rpcenc/reader.go @@ -19,7 +19,7 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-jsonrpc" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/specs-actors/actors/abi" ) diff --git a/lib/rpcenc/reader_test.go b/lib/rpcenc/reader_test.go index a30d81b10..a9c9a9389 100644 --- a/lib/rpcenc/reader_test.go +++ b/lib/rpcenc/reader_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/filecoin-project/go-jsonrpc" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) type ReaderHandler struct { diff --git a/markets/retrievaladapter/provider.go b/markets/retrievaladapter/provider.go index f21b50d55..d130e8009 100644 --- a/markets/retrievaladapter/provider.go +++ b/markets/retrievaladapter/provider.go @@ -6,9 +6,9 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/storage" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/storiface" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-fil-markets/retrievalmarket" @@ -21,13 +21,13 @@ import ( type retrievalProviderNode struct { miner *storage.Miner - sealer sector.SectorManager + sealer sectorstorage.SectorManager full api.FullNode } // NewRetrievalProviderNode returns a new node adapter for a retrieval provider that talks to the // Lotus Node -func NewRetrievalProviderNode(miner *storage.Miner, sealer sector.SectorManager, full api.FullNode) retrievalmarket.RetrievalProviderNode { +func NewRetrievalProviderNode(miner *storage.Miner, sealer sectorstorage.SectorManager, full api.FullNode) retrievalmarket.RetrievalProviderNode { return &retrievalProviderNode{miner, sealer, full} } diff --git a/markets/storageadapter/provider.go b/markets/storageadapter/provider.go index e14a419dd..9bbf6e826 100644 --- a/markets/storageadapter/provider.go +++ b/markets/storageadapter/provider.go @@ -28,10 +28,10 @@ import ( "github.com/filecoin-project/lotus/chain/events" "github.com/filecoin-project/lotus/chain/events/state" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/lotus/lib/sigs" "github.com/filecoin-project/lotus/markets/utils" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/storage/sealing" "github.com/filecoin-project/lotus/storage/sectorblocks" ) diff --git a/node/builder.go b/node/builder.go index 5d9af760b..01800a844 100644 --- a/node/builder.go +++ b/node/builder.go @@ -40,6 +40,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/chain/wallet" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/lotus/lib/blockstore" "github.com/filecoin-project/lotus/lib/peermgr" _ "github.com/filecoin-project/lotus/lib/sigs/bls" @@ -60,10 +64,6 @@ import ( "github.com/filecoin-project/lotus/paychmgr" "github.com/filecoin-project/lotus/paychmgr/settler" "github.com/filecoin-project/lotus/storage" - "github.com/filecoin-project/lotus/storage/sealing" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/stores" "github.com/filecoin-project/lotus/storage/sectorblocks" ) @@ -281,7 +281,7 @@ func Online() Option { // miner ApplyIf(func(s *Settings) bool { return s.nodeType == repo.StorageMiner }, Override(new(api.Common), From(new(common.CommonAPI))), - Override(new(sector.StorageAuth), modules.StorageAuth), + Override(new(sectorstorage.StorageAuth), modules.StorageAuth), Override(new(*stores.Index), stores.NewIndex), Override(new(stores.SectorIndex), From(new(*stores.Index))), @@ -290,11 +290,11 @@ func Online() Option { Override(new(*ffiwrapper.Config), modules.ProofsConfig), Override(new(stores.LocalStorage), From(new(repo.LockedRepo))), Override(new(sealing.SectorIDCounter), modules.SectorIDCounter), - Override(new(*sector.Manager), modules.SectorStorage), + Override(new(*sectorstorage.Manager), modules.SectorStorage), Override(new(ffiwrapper.Verifier), ffiwrapper.ProofVerifier), - Override(new(sector.SectorManager), From(new(*sector.Manager))), - Override(new(storage2.Prover), From(new(sector.SectorManager))), + Override(new(sectorstorage.SectorManager), From(new(*sectorstorage.Manager))), + Override(new(storage2.Prover), From(new(sectorstorage.SectorManager))), Override(new(*sectorblocks.SectorBlocks), sectorblocks.NewSectorBlocks), Override(new(*storage.Miner), modules.StorageMiner(config.DefaultStorageMiner().Fees)), @@ -369,10 +369,10 @@ func ConfigCommon(cfg *config.Common) Option { Override(SetApiEndpointKey, func(lr repo.LockedRepo, e dtypes.APIEndpoint) error { return lr.SetAPIEndpoint(e) }), - Override(new(sector.URLs), func(e dtypes.APIEndpoint) (sector.URLs, error) { + Override(new(sectorstorage.URLs), func(e dtypes.APIEndpoint) (sectorstorage.URLs, error) { ip := cfg.API.RemoteListenAddress - var urls sector.URLs + var urls sectorstorage.URLs urls = append(urls, "http://"+ip+"/remote") // TODO: This makes no assumptions, and probably could... return urls, nil }), @@ -430,7 +430,7 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(dtypes.DealFilter), modules.BasicDealFilter(dealfilter.CliDealFilter(cfg.Dealmaking.Filter))), ), - Override(new(sector.SealerConfig), cfg.Storage), + Override(new(sectorstorage.SealerConfig), cfg.Storage), Override(new(*storage.Miner), modules.StorageMiner(cfg.Fees)), ) } diff --git a/node/config/def.go b/node/config/def.go index cd5da8d26..bfa4c64f1 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -7,7 +7,7 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/storage/sector" + "github.com/filecoin-project/lotus/extern/sector-storage" ) // Common is common config between full node and miner @@ -31,7 +31,7 @@ type StorageMiner struct { Common Dealmaking DealmakingConfig - Storage sector.SealerConfig + Storage sectorstorage.SealerConfig Fees MinerFeeConfig SealingDelay Duration @@ -131,7 +131,7 @@ func DefaultStorageMiner() *StorageMiner { cfg := &StorageMiner{ Common: defCommon(), - Storage: sector.SealerConfig{ + Storage: sectorstorage.SealerConfig{ AllowPreCommit1: true, AllowPreCommit2: true, AllowCommit: true, diff --git a/node/config/storage.go b/node/config/storage.go index 239806a57..68170ee2f 100644 --- a/node/config/storage.go +++ b/node/config/storage.go @@ -8,7 +8,7 @@ import ( "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" ) func StorageFromFile(path string, def *stores.StorageConfig) (*stores.StorageConfig, error) { diff --git a/node/impl/client/client.go b/node/impl/client/client.go index b8ab59375..c80955bca 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -38,8 +38,8 @@ import ( "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/miner" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" marketevents "github.com/filecoin-project/lotus/markets/loggers" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 498e67c5d..ceea2e813 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin" diff --git a/node/impl/remoteworker.go b/node/impl/remoteworker.go index 278474e6b..4b0f2e099 100644 --- a/node/impl/remoteworker.go +++ b/node/impl/remoteworker.go @@ -12,7 +12,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/client" - "github.com/filecoin-project/lotus/storage/sector" + "github.com/filecoin-project/lotus/extern/sector-storage" ) type remoteWorker struct { @@ -46,4 +46,4 @@ func (r *remoteWorker) Close() error { return nil } -var _ sector.Worker = &remoteWorker{} +var _ sectorstorage.Worker = &remoteWorker{} diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 6add843c2..9df12d379 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -8,7 +8,6 @@ import ( "strconv" "time" - "github.com/filecoin-project/lotus/storage/sector/fsutil" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/ipfs/go-cid" "golang.org/x/xerrors" @@ -18,13 +17,15 @@ import ( retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-jsonrpc/auth" - "github.com/filecoin-project/lotus/storage/sealing" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/stores" - "github.com/filecoin-project/lotus/storage/sector/storiface" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/extern/storage-sealing" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/apistruct" "github.com/filecoin-project/lotus/chain/types" @@ -47,8 +48,8 @@ type StorageMinerAPI struct { Miner *storage.Miner BlockMiner *miner.Miner Full api.FullNode - StorageMgr *sector.Manager `optional:"true"` - IStorageMgr sector.SectorManager + StorageMgr *sectorstorage.Manager `optional:"true"` + IStorageMgr sectorstorage.SectorManager *stores.Index ConsiderOnlineStorageDealsConfigFunc dtypes.ConsiderOnlineStorageDealsConfigFunc diff --git a/node/modules/chain.go b/node/modules/chain.go index 941eed1b0..e121e4772 100644 --- a/node/modules/chain.go +++ b/node/modules/chain.go @@ -16,7 +16,7 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/beacon" diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 073b6c42a..ed7b21c60 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -42,12 +42,13 @@ import ( "github.com/filecoin-project/go-multistore" paramfetch "github.com/filecoin-project/go-paramfetch" "github.com/filecoin-project/go-storedcounter" - "github.com/filecoin-project/lotus/storage/sealing" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/stores" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/extern/storage-sealing" + lapi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/gen" @@ -140,8 +141,8 @@ func SectorIDCounter(ds dtypes.MetadataDS) sealing.SectorIDCounter { return &sidsc{sc} } -func StorageMiner(fc config.MinerFeeConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, api lapi.FullNode, h host.Host, ds dtypes.MetadataDS, sealer sector.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc) (*storage.Miner, error) { - return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, api lapi.FullNode, h host.Host, ds dtypes.MetadataDS, sealer sector.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc) (*storage.Miner, error) { +func StorageMiner(fc config.MinerFeeConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, api lapi.FullNode, h host.Host, ds dtypes.MetadataDS, sealer sectorstorage.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc) (*storage.Miner, error) { + return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, api lapi.FullNode, h host.Host, ds dtypes.MetadataDS, sealer sectorstorage.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc) (*storage.Miner, error) { maddr, err := minerAddrFromDS(ds) if err != nil { return nil, err @@ -440,7 +441,7 @@ func StorageProvider(minerAddress dtypes.MinerAddress, } // RetrievalProvider creates a new retrieval provider attached to the provider blockstore -func RetrievalProvider(h host.Host, miner *storage.Miner, sealer sector.SectorManager, full lapi.FullNode, ds dtypes.MetadataDS, pieceStore dtypes.ProviderPieceStore, mds dtypes.StagingMultiDstore, dt dtypes.ProviderDataTransfer, onlineOk dtypes.ConsiderOnlineRetrievalDealsConfigFunc, offlineOk dtypes.ConsiderOfflineRetrievalDealsConfigFunc) (retrievalmarket.RetrievalProvider, error) { +func RetrievalProvider(h host.Host, miner *storage.Miner, sealer sectorstorage.SectorManager, full lapi.FullNode, ds dtypes.MetadataDS, pieceStore dtypes.ProviderPieceStore, mds dtypes.StagingMultiDstore, dt dtypes.ProviderDataTransfer, onlineOk dtypes.ConsiderOnlineRetrievalDealsConfigFunc, offlineOk dtypes.ConsiderOfflineRetrievalDealsConfigFunc) (retrievalmarket.RetrievalProvider, error) { adapter := retrievaladapter.NewRetrievalProviderNode(miner, sealer, full) maddr, err := minerAddrFromDS(ds) @@ -476,10 +477,10 @@ func RetrievalProvider(h host.Host, miner *storage.Miner, sealer sector.SectorMa return retrievalimpl.NewProvider(maddr, adapter, netwk, pieceStore, mds, dt, namespace.Wrap(ds, datastore.NewKey("/retrievals/provider")), opt) } -func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStorage, si stores.SectorIndex, cfg *ffiwrapper.Config, sc sector.SealerConfig, urls sector.URLs, sa sector.StorageAuth) (*sector.Manager, error) { +func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStorage, si stores.SectorIndex, cfg *ffiwrapper.Config, sc sectorstorage.SealerConfig, urls sectorstorage.URLs, sa sectorstorage.StorageAuth) (*sectorstorage.Manager, error) { ctx := helpers.LifecycleCtx(mctx, lc) - sst, err := sector.New(ctx, ls, si, cfg, sc, urls, sa) + sst, err := sectorstorage.New(ctx, ls, si, cfg, sc, urls, sa) if err != nil { return nil, err } @@ -491,7 +492,7 @@ func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStor return sst, nil } -func StorageAuth(ctx helpers.MetricsCtx, ca lapi.Common) (sector.StorageAuth, error) { +func StorageAuth(ctx helpers.MetricsCtx, ca lapi.Common) (sectorstorage.StorageAuth, error) { token, err := ca.AuthNew(ctx, []auth.Permission{"admin"}) if err != nil { return nil, xerrors.Errorf("creating storage auth header: %w", err) @@ -499,7 +500,7 @@ func StorageAuth(ctx helpers.MetricsCtx, ca lapi.Common) (sector.StorageAuth, er headers := http.Header{} headers.Add("Authorization", "Bearer "+string(token)) - return sector.StorageAuth(headers), nil + return sectorstorage.StorageAuth(headers), nil } func NewConsiderOnlineStorageDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderOnlineStorageDealsConfigFunc, error) { diff --git a/node/node_test.go b/node/node_test.go index 20eb6504f..38a068135 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -13,7 +13,6 @@ import ( "github.com/filecoin-project/lotus/lib/lotuslog" "github.com/filecoin-project/lotus/storage/mockstorage" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" "github.com/filecoin-project/go-storedcounter" "github.com/ipfs/go-datastore" @@ -42,14 +41,15 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" "github.com/filecoin-project/lotus/cmd/lotus-seed/seed" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/mock" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/modules" modtest "github.com/filecoin-project/lotus/node/modules/testing" "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/mock" ) func init() { @@ -422,11 +422,11 @@ func mockSbBuilder(t *testing.T, nFull int, storage []test.StorageMiner) ([]test } storers[i] = testStorageNode(ctx, t, genms[i].Worker, maddrs[i], pidKeys[i], f, mn, node.Options( - node.Override(new(sector.SectorManager), func() (sector.SectorManager, error) { + node.Override(new(sectorstorage.SectorManager), func() (sectorstorage.SectorManager, error) { return mock.NewMockSectorMgr(build.DefaultSectorSize(), sectors), nil }), node.Override(new(ffiwrapper.Verifier), mock.MockVerifier), - node.Unset(new(*sector.Manager)), + node.Unset(new(*sectorstorage.Manager)), )) } diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index c55a04c58..14085d4ac 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -20,8 +20,8 @@ import ( "github.com/multiformats/go-multiaddr" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/node/config" diff --git a/node/repo/interface.go b/node/repo/interface.go index 331f83028..c25bcb534 100644 --- a/node/repo/interface.go +++ b/node/repo/interface.go @@ -6,8 +6,8 @@ import ( "github.com/ipfs/go-datastore" "github.com/multiformats/go-multiaddr" - "github.com/filecoin-project/lotus/storage/sector/fsutil" - "github.com/filecoin-project/lotus/storage/sector/stores" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/chain/types" ) diff --git a/node/repo/memrepo.go b/node/repo/memrepo.go index 082970dc6..34e3637eb 100644 --- a/node/repo/memrepo.go +++ b/node/repo/memrepo.go @@ -14,11 +14,11 @@ import ( "github.com/multiformats/go-multiaddr" "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/storage/sector/fsutil" + "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/storage/sector/stores" ) type MemRepo struct { diff --git a/storage/adapter_events.go b/storage/adapter_events.go index f89deea3a..ee320c361 100644 --- a/storage/adapter_events.go +++ b/storage/adapter_events.go @@ -7,7 +7,7 @@ import ( "github.com/filecoin-project/lotus/chain/events" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) var _ sealing.Events = new(EventsAdapter) diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index a692b4b62..ebba0fcbd 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -23,7 +23,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) var _ sealing.SealingAPI = new(SealingAPIAdapter) diff --git a/storage/miner.go b/storage/miner.go index 2b1ab4f36..91a36617f 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -12,8 +12,8 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-actors/actors/crypto" @@ -24,9 +24,9 @@ import ( "github.com/filecoin-project/lotus/chain/events" "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/storage/sealing" ) var log = logging.Logger("storageminer") @@ -35,7 +35,7 @@ type Miner struct { api storageMinerApi feeCfg config.MinerFeeConfig h host.Host - sealer sector.SectorManager + sealer sectorstorage.SectorManager ds datastore.Batching sc sealing.SectorIDCounter verif ffiwrapper.Verifier @@ -84,7 +84,7 @@ type storageMinerApi interface { WalletHas(context.Context, address.Address) (bool, error) } -func NewMiner(api storageMinerApi, maddr, worker address.Address, h host.Host, ds datastore.Batching, sealer sector.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc, feeCfg config.MinerFeeConfig) (*Miner, error) { +func NewMiner(api storageMinerApi, maddr, worker address.Address, h host.Host, ds datastore.Batching, sealer sectorstorage.SectorManager, sc sealing.SectorIDCounter, verif ffiwrapper.Verifier, gsd dtypes.GetSealingDelayFunc, feeCfg config.MinerFeeConfig) (*Miner, error) { m := &Miner{ api: api, feeCfg: feeCfg, diff --git a/storage/mockstorage/preseal.go b/storage/mockstorage/preseal.go index 22672c602..50810a4b2 100644 --- a/storage/mockstorage/preseal.go +++ b/storage/mockstorage/preseal.go @@ -5,7 +5,7 @@ import ( "github.com/filecoin-project/go-address" commcid "github.com/filecoin-project/go-fil-commcid" - "github.com/filecoin-project/lotus/storage/sector/mock" + "github.com/filecoin-project/lotus/extern/sector-storage/mock" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" "github.com/filecoin-project/specs-actors/actors/builtin/market" @@ -13,9 +13,9 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet" + "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/sector-storage/zerocomm" "github.com/filecoin-project/lotus/genesis" - "github.com/filecoin-project/lotus/storage/sector/ffiwrapper" - "github.com/filecoin-project/lotus/storage/sector/zerocomm" ) func PreSeal(ssize abi.SectorSize, maddr address.Address, sectors int) (*genesis.Miner, *types.KeyInfo, error) { diff --git a/storage/sealing.go b/storage/sealing.go index 964e3d266..2fb02fa8e 100644 --- a/storage/sealing.go +++ b/storage/sealing.go @@ -7,7 +7,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" ) // TODO: refactor this to be direct somehow diff --git a/storage/sector/Makefile b/storage/sector/Makefile deleted file mode 100644 index 7b8d49683..000000000 --- a/storage/sector/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -all: build -.PHONY: all - -SUBMODULES= - -FFI_PATH:=./extern/filecoin-ffi/ -FFI_DEPS:=.install-filcrypto -FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS)) - -$(FFI_DEPS): .filecoin-build ; - -.filecoin-build: $(FFI_PATH) - $(MAKE) -C $(FFI_PATH) $(FFI_DEPS:$(FFI_PATH)%=%) - @touch $@ - -.update-modules: - git submodule update --init --recursive - @touch $@ - -test: .update-modules .filecoin-build - go test -v ./... -.PHONY: test -SUBMODULES+=test - -build: $(SUBMODULES) - -clean: - rm -f .filecoin-build - rm -f .update-modules diff --git a/storage/sectorblocks/blocks.go b/storage/sectorblocks/blocks.go index 49031b6f1..f2e5fc42f 100644 --- a/storage/sectorblocks/blocks.go +++ b/storage/sectorblocks/blocks.go @@ -15,7 +15,7 @@ import ( "golang.org/x/xerrors" cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/lotus/storage/sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/lotus/api" diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index dff0fc9fe..8d61f5c9f 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "errors" - "github.com/filecoin-project/lotus/api" "time" "github.com/filecoin-project/go-bitfield" @@ -17,6 +16,7 @@ import ( "go.opencensus.io/trace" "golang.org/x/xerrors" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" diff --git a/storage/wdpost_sched.go b/storage/wdpost_sched.go index 6ecdd5f29..97eb8caa6 100644 --- a/storage/wdpost_sched.go +++ b/storage/wdpost_sched.go @@ -2,14 +2,11 @@ package storage import ( "context" - "github.com/filecoin-project/lotus/node/config" "time" - "go.opencensus.io/trace" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/lotus/storage/sector" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-storage/storage" @@ -18,6 +15,10 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/node/config" + + "go.opencensus.io/trace" ) const StartConfidence = 4 // TODO: config @@ -26,7 +27,7 @@ type WindowPoStScheduler struct { api storageMinerApi feeCfg config.MinerFeeConfig prover storage.Prover - faultTracker sector.FaultTracker + faultTracker sectorstorage.FaultTracker proofType abi.RegisteredPoStProof partitionSectors uint64 @@ -43,7 +44,7 @@ type WindowPoStScheduler struct { //failLk sync.Mutex } -func NewWindowedPoStScheduler(api storageMinerApi, fc config.MinerFeeConfig, sb storage.Prover, ft sector.FaultTracker, actor address.Address, worker address.Address) (*WindowPoStScheduler, error) { +func NewWindowedPoStScheduler(api storageMinerApi, fc config.MinerFeeConfig, sb storage.Prover, ft sectorstorage.FaultTracker, actor address.Address, worker address.Address) (*WindowPoStScheduler, error) { mi, err := api.StateMinerInfo(context.TODO(), actor, types.EmptyTSK) if err != nil { return nil, xerrors.Errorf("getting sector size: %w", err)