From a9600b8a6f59a6a1b43ee7730cb66d204724aba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 14 Jun 2022 20:03:38 +0200 Subject: [PATCH] storage: Move extern/sector-storage to storage/sealer --- .circleci/config.yml | 2 +- .circleci/template.yml | 2 +- api/api_storage.go | 4 +-- api/api_worker.go | 4 +-- api/docgen/docgen.go | 4 +-- api/proxy_gen.go | 6 ++-- chain/consensus/filcns/filecoin.go | 2 +- chain/gen/gen.go | 2 +- chain/stmgr/actors.go | 2 +- chain/vm/syscalls.go | 2 +- cmd/lotus-bench/caching_verifier.go | 2 +- cmd/lotus-bench/import.go | 2 +- cmd/lotus-bench/main.go | 6 ++-- cmd/lotus-bench/simple.go | 4 +-- cmd/lotus-miner/info.go | 2 +- cmd/lotus-miner/init.go | 10 +++---- cmd/lotus-miner/init_restore.go | 2 +- cmd/lotus-miner/init_service.go | 2 +- cmd/lotus-miner/proving.go | 2 +- cmd/lotus-miner/sealing.go | 4 +-- cmd/lotus-miner/storage.go | 6 ++-- cmd/lotus-seed/genesis.go | 2 +- cmd/lotus-seed/seed/seed.go | 8 +++--- cmd/lotus-shed/balances.go | 2 +- cmd/lotus-shed/fr32.go | 2 +- cmd/lotus-shed/migrations.go | 2 +- cmd/lotus-sim/simulation/mock/mock.go | 4 +-- cmd/lotus-worker/info.go | 2 +- cmd/lotus-worker/main.go | 10 +++---- cmd/lotus-worker/resources.go | 2 +- cmd/lotus-worker/sealworker/rpc.go | 8 +++--- cmd/lotus-worker/storage.go | 4 +-- cmd/lotus-worker/tasks.go | 2 +- cmd/lotus/daemon.go | 2 +- conformance/driver.go | 2 +- gen/main.go | 8 +++--- itests/deadlines_test.go | 2 +- itests/deals_pricing_test.go | 2 +- itests/kit/ensemble.go | 28 +++++++++---------- itests/kit/node_miner.go | 4 +-- itests/kit/node_opts.go | 4 +-- itests/wdpost_test.go | 2 +- itests/worker_test.go | 6 ++-- markets/sectoraccessor/sectoraccessor.go | 8 +++--- node/builder.go | 2 +- node/builder_chain.go | 2 +- node/builder_miner.go | 8 +++--- node/config/def.go | 4 +-- node/config/storage.go | 8 +++--- node/config/types.go | 4 +-- node/impl/full/state.go | 2 +- node/impl/remoteworker.go | 4 +-- node/impl/storminer.go | 16 +++++------ node/modules/storageminer.go | 24 ++++++++-------- node/repo/fsrepo.go | 4 +-- node/repo/interface.go | 4 +-- node/repo/memrepo.go | 6 ++-- storage/miner.go | 8 +++--- storage/pipeline/commit_batch.go | 2 +- storage/pipeline/commit_batch_test.go | 2 +- storage/pipeline/input.go | 8 +++--- storage/pipeline/sealing.go | 8 +++--- storage/pipeline/states_failed_test.go | 6 ++-- storage/pipeline/types.go | 4 +-- .../sealer}/README.md | 0 .../sealer}/cbor_gen.go | 4 +-- .../sealer}/cgroups.go | 2 +- .../sealer}/cgroups_linux.go | 2 +- .../sealer}/docs/sector-storage.svg | 0 .../sealer}/faults.go | 4 +-- .../sealer}/ffiwrapper/basicfs/fs.go | 2 +- .../sealer}/ffiwrapper/prover_cgo.go | 0 .../sealer}/ffiwrapper/sealer.go | 0 .../sealer}/ffiwrapper/sealer_cgo.go | 16 +++++------ .../sealer}/ffiwrapper/sealer_test.go | 4 +-- .../sealer}/ffiwrapper/types.go | 4 +-- .../sealer}/ffiwrapper/unseal_ranges.go | 4 +-- .../sealer}/ffiwrapper/verifier_cgo.go | 2 +- .../sealer}/fr32/fr32.go | 0 .../sealer}/fr32/fr32_ffi_cmp_test.go | 2 +- .../sealer}/fr32/fr32_test.go | 2 +- .../sealer}/fr32/readers.go | 0 .../sealer}/fr32/readers_test.go | 6 ++-- .../sealer}/fr32/utils.go | 0 .../sealer}/fsutil/dealloc_linux.go | 0 .../sealer}/fsutil/dealloc_other.go | 0 .../sealer}/fsutil/filesize_unix.go | 0 .../sealer}/fsutil/statfs.go | 0 .../sealer}/fsutil/statfs_unix.go | 0 .../sealer}/fsutil/statfs_windows.go | 0 .../sealer}/manager.go | 12 ++++---- .../sealer}/manager_calltracker.go | 6 ++-- .../sealer}/manager_post.go | 4 +-- .../sealer}/manager_test.go | 14 +++++----- .../sealer}/mock/mock.go | 14 +++++----- .../sealer}/mock/mock_test.go | 0 .../sealer}/mock/util.go | 0 .../sealer}/partialfile/partialfile.go | 4 +-- .../sealer}/piece_provider.go | 8 +++--- .../sealer}/piece_provider_test.go | 8 +++--- .../sealer}/piece_reader.go | 2 +- .../sealer}/request_queue.go | 2 +- .../sealer}/request_queue_test.go | 4 +-- .../sealer}/roprov.go | 6 ++-- .../sealer}/sched.go | 6 ++-- .../sealer}/sched_assigner_common.go | 2 +- .../sealer}/sched_assigner_spread.go | 4 +-- .../sealer}/sched_assigner_utilization.go | 4 +-- .../sealer}/sched_post.go | 8 +++--- .../sealer}/sched_resources.go | 6 ++-- .../sealer}/sched_test.go | 10 +++---- .../sealer}/sched_worker.go | 8 +++--- .../sealer}/sealtasks/task.go | 0 .../sealer}/selector_alloc.go | 8 +++--- .../sealer}/selector_existing.go | 8 +++--- .../sealer}/selector_move.go | 8 +++--- .../sealer}/selector_task.go | 6 ++-- .../sealer}/stats.go | 6 ++-- .../sealer}/stores/http_handler.go | 6 ++-- .../sealer}/stores/http_handler_test.go | 8 +++--- .../sealer}/stores/index.go | 4 +-- .../sealer}/stores/index_locks.go | 2 +- .../sealer}/stores/index_locks_test.go | 2 +- .../sealer}/stores/index_locks_util.go | 0 .../sealer}/stores/index_test.go | 4 +-- .../sealer}/stores/interface.go | 6 ++-- .../sealer}/stores/local.go | 4 +-- .../sealer}/stores/local_test.go | 4 +-- .../sealer}/stores/localstorage_cached.go | 2 +- .../sealer}/stores/mocks/index.go | 6 ++-- .../sealer}/stores/mocks/pf.go | 6 ++-- .../sealer}/stores/mocks/store.go | 6 ++-- .../sealer}/stores/remote.go | 6 ++-- .../sealer}/stores/remote_test.go | 8 +++--- .../sealer}/stores/util_unix.go | 0 .../sealer}/storiface/cbor_gen.go | 0 .../sealer}/storiface/ffi.go | 0 .../sealer}/storiface/filetype.go | 0 .../sealer}/storiface/index.go | 2 +- .../sealer}/storiface/resources.go | 2 +- .../sealer}/storiface/resources_test.go | 2 +- .../sealer}/storiface/storage.go | 0 .../sealer}/storiface/worker.go | 2 +- .../sealer}/tarutil/systar.go | 0 .../sealer}/teststorage_test.go | 6 ++-- .../sealer}/testworker_test.go | 10 +++---- .../sealer}/worker_calltracker.go | 4 +-- .../sealer}/worker_local.go | 10 +++---- .../sealer}/worker_local_test.go | 6 ++-- .../sealer}/worker_tracked.go | 10 ++++--- storage/wdpost/wdpost_run_test.go | 2 +- storage/wdpost/wdpost_sched.go | 8 +++--- testplans/lotus-soup/testkit/role_miner.go | 4 +-- 153 files changed, 340 insertions(+), 338 deletions(-) rename {extern/sector-storage => storage/sealer}/README.md (100%) rename {extern/sector-storage => storage/sealer}/cbor_gen.go (99%) rename {extern/sector-storage => storage/sealer}/cgroups.go (92%) rename {extern/sector-storage => storage/sealer}/cgroups_linux.go (99%) rename {extern/sector-storage => storage/sealer}/docs/sector-storage.svg (100%) rename {extern/sector-storage => storage/sealer}/faults.go (97%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/basicfs/fs.go (97%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/prover_cgo.go (100%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/sealer.go (100%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/sealer_cgo.go (98%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/sealer_test.go (99%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/types.go (93%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/unseal_ranges.go (85%) rename {extern/sector-storage => storage/sealer}/ffiwrapper/verifier_cgo.go (98%) rename {extern/sector-storage => storage/sealer}/fr32/fr32.go (100%) rename {extern/sector-storage => storage/sealer}/fr32/fr32_ffi_cmp_test.go (95%) rename {extern/sector-storage => storage/sealer}/fr32/fr32_test.go (98%) rename {extern/sector-storage => storage/sealer}/fr32/readers.go (100%) rename {extern/sector-storage => storage/sealer}/fr32/readers_test.go (79%) rename {extern/sector-storage => storage/sealer}/fr32/utils.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/dealloc_linux.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/dealloc_other.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/filesize_unix.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/statfs.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/statfs_unix.go (100%) rename {extern/sector-storage => storage/sealer}/fsutil/statfs_windows.go (100%) rename {extern/sector-storage => storage/sealer}/manager.go (99%) rename {extern/sector-storage => storage/sealer}/manager_calltracker.go (98%) rename {extern/sector-storage => storage/sealer}/manager_post.go (98%) rename {extern/sector-storage => storage/sealer}/manager_test.go (98%) rename {extern/sector-storage => storage/sealer}/mock/mock.go (97%) rename {extern/sector-storage => storage/sealer}/mock/mock_test.go (100%) rename {extern/sector-storage => storage/sealer}/mock/util.go (100%) rename {extern/sector-storage => storage/sealer}/partialfile/partialfile.go (98%) rename {extern/sector-storage => storage/sealer}/piece_provider.go (97%) rename {extern/sector-storage => storage/sealer}/piece_provider_test.go (98%) rename {extern/sector-storage => storage/sealer}/piece_reader.go (99%) rename {extern/sector-storage => storage/sealer}/request_queue.go (97%) rename {extern/sector-storage => storage/sealer}/request_queue_test.go (92%) rename {extern/sector-storage => storage/sealer}/roprov.go (86%) rename {extern/sector-storage => storage/sealer}/sched.go (98%) rename {extern/sector-storage => storage/sealer}/sched_assigner_common.go (99%) rename {extern/sector-storage => storage/sealer}/sched_assigner_spread.go (95%) rename {extern/sector-storage => storage/sealer}/sched_assigner_utilization.go (96%) rename {extern/sector-storage => storage/sealer}/sched_post.go (95%) rename {extern/sector-storage => storage/sealer}/sched_resources.go (97%) rename {extern/sector-storage => storage/sealer}/sched_test.go (98%) rename {extern/sector-storage => storage/sealer}/sched_worker.go (98%) rename {extern/sector-storage => storage/sealer}/sealtasks/task.go (100%) rename {extern/sector-storage => storage/sealer}/selector_alloc.go (87%) rename {extern/sector-storage => storage/sealer}/selector_existing.go (88%) rename {extern/sector-storage => storage/sealer}/selector_move.go (91%) rename {extern/sector-storage => storage/sealer}/selector_task.go (88%) rename {extern/sector-storage => storage/sealer}/stats.go (94%) rename {extern/sector-storage => storage/sealer}/stores/http_handler.go (97%) rename {extern/sector-storage => storage/sealer}/stores/http_handler_test.go (97%) rename {extern/sector-storage => storage/sealer}/stores/index.go (98%) rename {extern/sector-storage => storage/sealer}/stores/index_locks.go (98%) rename {extern/sector-storage => storage/sealer}/stores/index_locks_test.go (98%) rename {extern/sector-storage => storage/sealer}/stores/index_locks_util.go (100%) rename {extern/sector-storage => storage/sealer}/stores/index_test.go (96%) rename {extern/sector-storage => storage/sealer}/stores/interface.go (92%) rename {extern/sector-storage => storage/sealer}/stores/local.go (99%) rename {extern/sector-storage => storage/sealer}/stores/local_test.go (92%) rename {extern/sector-storage => storage/sealer}/stores/localstorage_cached.go (97%) rename {extern/sector-storage => storage/sealer}/stores/mocks/index.go (97%) rename {extern/sector-storage => storage/sealer}/stores/mocks/pf.go (92%) rename {extern/sector-storage => storage/sealer}/stores/mocks/store.go (95%) rename {extern/sector-storage => storage/sealer}/stores/remote.go (99%) rename {extern/sector-storage => storage/sealer}/stores/remote_test.go (98%) rename {extern/sector-storage => storage/sealer}/stores/util_unix.go (100%) rename {extern/sector-storage => storage/sealer}/storiface/cbor_gen.go (100%) rename {extern/sector-storage => storage/sealer}/storiface/ffi.go (100%) rename {extern/sector-storage => storage/sealer}/storiface/filetype.go (100%) rename {extern/sector-storage => storage/sealer}/storiface/index.go (94%) rename {extern/sector-storage => storage/sealer}/storiface/resources.go (99%) rename {extern/sector-storage => storage/sealer}/storiface/resources_test.go (96%) rename {extern/sector-storage => storage/sealer}/storiface/storage.go (100%) rename {extern/sector-storage => storage/sealer}/storiface/worker.go (99%) rename {extern/sector-storage => storage/sealer}/tarutil/systar.go (100%) rename {extern/sector-storage => storage/sealer}/teststorage_test.go (96%) rename {extern/sector-storage => storage/sealer}/testworker_test.go (93%) rename {extern/sector-storage => storage/sealer}/worker_calltracker.go (95%) rename {extern/sector-storage => storage/sealer}/worker_local.go (98%) rename {extern/sector-storage => storage/sealer}/worker_local_test.go (89%) rename {extern/sector-storage => storage/sealer}/worker_tracked.go (96%) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2ce75f9c..80e7b83e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -992,7 +992,7 @@ workflows: - test: go-test-flags: "-run=TestMulticoreSDR" suite: multicore-sdr-check - target: "./extern/sector-storage/ffiwrapper" + target: "./extern/sealer/ffiwrapper" proofs-log-test: "1" - test-conformance: suite: conformance diff --git a/.circleci/template.yml b/.circleci/template.yml index 437eec9d3..898cfd2de 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -782,7 +782,7 @@ workflows: - test: go-test-flags: "-run=TestMulticoreSDR" suite: multicore-sdr-check - target: "./extern/sector-storage/ffiwrapper" + target: "./extern/sealer/ffiwrapper" proofs-log-test: "1" - test-conformance: suite: conformance diff --git a/api/api_storage.go b/api/api_storage.go index 11530e5d9..11cf27469 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -22,9 +22,9 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // MODIFYING THE API INTERFACE diff --git a/api/api_worker.go b/api/api_worker.go index 485cd0b01..184424d8e 100644 --- a/api/api_worker.go +++ b/api/api_worker.go @@ -10,8 +10,8 @@ import ( "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // MODIFYING THE API INTERFACE diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index c6be3782c..9f6fc27f9 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -39,11 +39,11 @@ import ( "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/repo/imports" sealing "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var ExampleValues = map[reflect.Type]interface{}{ diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 42ac65068..7f54ca03b 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -36,13 +36,13 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - "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/storiface" "github.com/filecoin-project/lotus/journal/alerting" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/repo/imports" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var ErrNotSupported = xerrors.New("method not supported") diff --git a/chain/consensus/filcns/filecoin.go b/chain/consensus/filcns/filecoin.go index b33dc1ace..bafc029f4 100644 --- a/chain/consensus/filcns/filecoin.go +++ b/chain/consensus/filcns/filecoin.go @@ -39,10 +39,10 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/lib/async" "github.com/filecoin-project/lotus/lib/sigs" "github.com/filecoin-project/lotus/metrics" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var log = logging.Logger("fil-consensus") diff --git a/chain/gen/gen.go b/chain/gen/gen.go index bfaacefc8..42d9b5738 100644 --- a/chain/gen/gen.go +++ b/chain/gen/gen.go @@ -40,10 +40,10 @@ 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/journal" "github.com/filecoin-project/lotus/node/repo" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) const msgsPerBlock = 20 diff --git a/chain/stmgr/actors.go b/chain/stmgr/actors.go index c950f8d02..5995d91ad 100644 --- a/chain/stmgr/actors.go +++ b/chain/stmgr/actors.go @@ -26,7 +26,7 @@ import ( "github.com/filecoin-project/lotus/chain/rand" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) func GetMinerWorkerRaw(ctx context.Context, sm *StateManager, st cid.Cid, maddr address.Address) (address.Address, error) { diff --git a/chain/vm/syscalls.go b/chain/vm/syscalls.go index 8533e29eb..83f4c56fb 100644 --- a/chain/vm/syscalls.go +++ b/chain/vm/syscalls.go @@ -26,8 +26,8 @@ import ( "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/lib/sigs" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) func init() { diff --git a/cmd/lotus-bench/caching_verifier.go b/cmd/lotus-bench/caching_verifier.go index 733b060c7..f300a6577 100644 --- a/cmd/lotus-bench/caching_verifier.go +++ b/cmd/lotus-bench/caching_verifier.go @@ -12,7 +12,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" prooftypes "github.com/filecoin-project/go-state-types/proof" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) type cachingVerifier struct { diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index ef3c8312f..10e8791ff 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -40,10 +40,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" "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/sigs/bls" _ "github.com/filecoin-project/lotus/lib/sigs/secp" "github.com/filecoin-project/lotus/node/repo" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) type TipSetExec struct { diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 10a3c6dc1..f71fc0333 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -29,10 +29,10 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/genesis" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper/basicfs" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("lotus-bench") diff --git a/cmd/lotus-bench/simple.go b/cmd/lotus-bench/simple.go index 7454a3701..ba3890cb4 100644 --- a/cmd/lotus-bench/simple.go +++ b/cmd/lotus-bench/simple.go @@ -24,8 +24,8 @@ import ( "github.com/filecoin-project/lotus/build" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var simpleCmd = &cli.Command{ diff --git a/cmd/lotus-miner/info.go b/cmd/lotus-miner/info.go index 36cc5c31f..2c3e29b29 100644 --- a/cmd/lotus-miner/info.go +++ b/cmd/lotus-miner/info.go @@ -33,9 +33,9 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/reward" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/journal/alerting" sealing "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) var infoCmd = &cli.Command{ diff --git a/cmd/lotus-miner/init.go b/cmd/lotus-miner/init.go index 05f521e75..c9d4a72d2 100644 --- a/cmd/lotus-miner/init.go +++ b/cmd/lotus-miner/init.go @@ -46,10 +46,6 @@ import ( "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - sectorstorage "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/sector-storage/storiface" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/journal/fsjournal" @@ -59,6 +55,10 @@ import ( "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/lotus/storage" sealing2 "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var initCmd = &cli.Command{ @@ -466,7 +466,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode } stor := stores.NewRemote(lstor, si, http.Header(sa), 10, &stores.DefaultPartialFileHandler{}) - smgr, err := sectorstorage.New(ctx, lstor, stor, lr, si, sectorstorage.Config{ + smgr, err := sealer.New(ctx, lstor, stor, lr, si, sealer.Config{ ParallelFetchLimit: 10, AllowAddPiece: true, AllowPreCommit1: true, diff --git a/cmd/lotus-miner/init_restore.go b/cmd/lotus-miner/init_restore.go index fc55f845c..6adff7558 100644 --- a/cmd/lotus-miner/init_restore.go +++ b/cmd/lotus-miner/init_restore.go @@ -24,10 +24,10 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/lib/backupds" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) var restoreCmd = &cli.Command{ diff --git a/cmd/lotus-miner/init_service.go b/cmd/lotus-miner/init_service.go index 0c2d19cfd..99d3ea72f 100644 --- a/cmd/lotus-miner/init_service.go +++ b/cmd/lotus-miner/init_service.go @@ -16,8 +16,8 @@ import ( "github.com/filecoin-project/lotus/api/client" lcli "github.com/filecoin-project/lotus/cli" cliutil "github.com/filecoin-project/lotus/cli/util" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/node/config" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) const ( diff --git a/cmd/lotus-miner/proving.go b/cmd/lotus-miner/proving.go index 76d3edc60..00531462a 100644 --- a/cmd/lotus-miner/proving.go +++ b/cmd/lotus-miner/proving.go @@ -21,7 +21,7 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var provingCmd = &cli.Command{ diff --git a/cmd/lotus-miner/sealing.go b/cmd/lotus-miner/sealing.go index 975bec7d1..d334f657f 100644 --- a/cmd/lotus-miner/sealing.go +++ b/cmd/lotus-miner/sealing.go @@ -24,9 +24,9 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/lib/httpreader" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var sealingCmd = &cli.Command{ diff --git a/cmd/lotus-miner/storage.go b/cmd/lotus-miner/storage.go index 6c056f876..1c1ad47c0 100644 --- a/cmd/lotus-miner/storage.go +++ b/cmd/lotus-miner/storage.go @@ -27,11 +27,11 @@ import ( "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "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/lib/tablewriter" sealing "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) const metaFile = "sectorstore.json" diff --git a/cmd/lotus-seed/genesis.go b/cmd/lotus-seed/genesis.go index a3cc89017..5c3ac5ff1 100644 --- a/cmd/lotus-seed/genesis.go +++ b/cmd/lotus-seed/genesis.go @@ -25,10 +25,10 @@ import ( genesis2 "github.com/filecoin-project/lotus/chain/gen/genesis" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/node/modules/testing" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var genesisCmd = &cli.Command{ diff --git a/cmd/lotus-seed/seed/seed.go b/cmd/lotus-seed/seed/seed.go index 11a4477b4..867e8b553 100644 --- a/cmd/lotus-seed/seed/seed.go +++ b/cmd/lotus-seed/seed/seed.go @@ -27,11 +27,11 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet/key" - "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/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/genesis" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper/basicfs" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("preseal") diff --git a/cmd/lotus-shed/balances.go b/cmd/lotus-shed/balances.go index 1318b8c6a..9ce4faf72 100644 --- a/cmd/lotus-shed/balances.go +++ b/cmd/lotus-shed/balances.go @@ -40,8 +40,8 @@ import ( "github.com/filecoin-project/lotus/chain/types" "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/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) type accountInfo struct { diff --git a/cmd/lotus-shed/fr32.go b/cmd/lotus-shed/fr32.go index f3f6d0669..1bdca198c 100644 --- a/cmd/lotus-shed/fr32.go +++ b/cmd/lotus-shed/fr32.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fr32" + "github.com/filecoin-project/lotus/storage/sealer/fr32" ) var fr32Cmd = &cli.Command{ diff --git a/cmd/lotus-shed/migrations.go b/cmd/lotus-shed/migrations.go index 55625c8eb..7e3daf1f2 100644 --- a/cmd/lotus-shed/migrations.go +++ b/cmd/lotus-shed/migrations.go @@ -16,8 +16,8 @@ import ( "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var migrationsCmd = &cli.Command{ diff --git a/cmd/lotus-sim/simulation/mock/mock.go b/cmd/lotus-sim/simulation/mock/mock.go index c172907b3..a37845daa 100644 --- a/cmd/lotus-sim/simulation/mock/mock.go +++ b/cmd/lotus-sim/simulation/mock/mock.go @@ -15,10 +15,10 @@ import ( miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner" tutils "github.com/filecoin-project/specs-actors/v5/support/testing" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) -// Ideally, we'd use extern/sector-storage/mock. Unfortunately, those mocks are a bit _too_ accurate +// Ideally, we'd use extern/sealer/mock. Unfortunately, those mocks are a bit _too_ accurate // and would force us to load sector info for window post proofs. const ( diff --git a/cmd/lotus-worker/info.go b/cmd/lotus-worker/info.go index 057e1303c..338345c28 100644 --- a/cmd/lotus-worker/info.go +++ b/cmd/lotus-worker/info.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) var infoCmd = &cli.Command{ diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index ba4c4caf8..5c274c651 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -30,15 +30,15 @@ import ( lcli "github.com/filecoin-project/lotus/cli" cliutil "github.com/filecoin-project/lotus/cli/util" "github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "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/lotus/lib/lotuslog" "github.com/filecoin-project/lotus/lib/ulimit" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/node/modules" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("main") @@ -486,7 +486,7 @@ var runCmd = &cli.Command{ wsts := statestore.New(namespace.Wrap(ds, modules.WorkerCallsPrefix)) workerApi := &sealworker.Worker{ - LocalWorker: sectorstorage.NewLocalWorker(sectorstorage.WorkerConfig{ + LocalWorker: sealer.NewLocalWorker(sealer.WorkerConfig{ TaskTypes: taskTypes, NoSwap: cctx.Bool("no-swap"), MaxParallelChallengeReads: cctx.Int("post-parallel-reads"), diff --git a/cmd/lotus-worker/resources.go b/cmd/lotus-worker/resources.go index 539f141b9..45fd01e70 100644 --- a/cmd/lotus-worker/resources.go +++ b/cmd/lotus-worker/resources.go @@ -7,7 +7,7 @@ import ( "github.com/urfave/cli/v2" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var resourcesCmd = &cli.Command{ diff --git a/cmd/lotus-worker/sealworker/rpc.go b/cmd/lotus-worker/sealworker/rpc.go index 91f96d9a8..cc8b9ec3a 100644 --- a/cmd/lotus-worker/sealworker/rpc.go +++ b/cmd/lotus-worker/sealworker/rpc.go @@ -16,11 +16,11 @@ import ( "github.com/filecoin-project/lotus/api" apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/build" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/lib/rpcenc" "github.com/filecoin-project/lotus/metrics/proxy" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func WorkerHandler(authv func(ctx context.Context, token string) ([]auth.Permission, error), remote http.HandlerFunc, a api.Worker, permissioned bool) http.Handler { @@ -53,7 +53,7 @@ func WorkerHandler(authv func(ctx context.Context, token string) ([]auth.Permiss } type Worker struct { - *sectorstorage.LocalWorker + *sealer.LocalWorker LocalStore *stores.Local Storage stores.LocalStorage diff --git a/cmd/lotus-worker/storage.go b/cmd/lotus-worker/storage.go index 0855ddf6a..52f30f587 100644 --- a/cmd/lotus-worker/storage.go +++ b/cmd/lotus-worker/storage.go @@ -13,8 +13,8 @@ import ( "golang.org/x/xerrors" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) const metaFile = "sectorstore.json" diff --git a/cmd/lotus-worker/tasks.go b/cmd/lotus-worker/tasks.go index 880381fd2..7b4462073 100644 --- a/cmd/lotus-worker/tasks.go +++ b/cmd/lotus-worker/tasks.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/lotus/api" lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) var tasksCmd = &cli.Command{ diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index b77cb0bae..b3f4db837 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -38,7 +38,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" "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/journal" "github.com/filecoin-project/lotus/journal/fsjournal" "github.com/filecoin-project/lotus/lib/peermgr" @@ -49,6 +48,7 @@ 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/sealer/ffiwrapper" ) const ( diff --git a/conformance/driver.go b/conformance/driver.go index f63fcaaf1..982ce6dae 100644 --- a/conformance/driver.go +++ b/conformance/driver.go @@ -25,9 +25,9 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/conformance/chaos" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" _ "github.com/filecoin-project/lotus/lib/sigs/bls" // enable bls signatures _ "github.com/filecoin-project/lotus/lib/sigs/secp" // enable secp signatures + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var ( diff --git a/gen/main.go b/gen/main.go index 9cb685740..5fac3adcf 100644 --- a/gen/main.go +++ b/gen/main.go @@ -12,10 +12,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/cmd/lotus-shed/shedgen" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/node/hello" "github.com/filecoin-project/lotus/paychmgr" + sectorstorage "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func main() { @@ -99,7 +99,7 @@ func main() { os.Exit(1) } - err = gen.WriteMapEncodersToFile("./extern/sector-storage/storiface/cbor_gen.go", "storiface", + err = gen.WriteMapEncodersToFile("./extern/sealer/storiface/cbor_gen.go", "storiface", storiface.CallID{}, ) if err != nil { @@ -107,7 +107,7 @@ func main() { os.Exit(1) } - err = gen.WriteMapEncodersToFile("./extern/sector-storage/cbor_gen.go", "sectorstorage", + err = gen.WriteMapEncodersToFile("./extern/sealer/cbor_gen.go", "sealer", sectorstorage.Call{}, sectorstorage.WorkState{}, sectorstorage.WorkID{}, diff --git a/itests/deadlines_test.go b/itests/deadlines_test.go index 1a0f94711..edcabba21 100644 --- a/itests/deadlines_test.go +++ b/itests/deadlines_test.go @@ -28,9 +28,9 @@ import ( "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/mock" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/node/impl" + "github.com/filecoin-project/lotus/storage/sealer/mock" ) // TestDeadlineToggling: diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go index f544a58ef..ad3c15d69 100644 --- a/itests/deals_pricing_test.go +++ b/itests/deals_pricing_test.go @@ -10,8 +10,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/itests/kit" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func TestQuotePriceForUnsealedRetrieval(t *testing.T) { diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 7aa461b90..e2c74180b 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -45,10 +45,6 @@ import ( "github.com/filecoin-project/lotus/chain/wallet/key" "github.com/filecoin-project/lotus/cmd/lotus-seed/seed" "github.com/filecoin-project/lotus/cmd/lotus-worker/sealworker" - sectorstorage "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/extern/sector-storage/stores" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/markets/idxprov" idxprov_test "github.com/filecoin-project/lotus/markets/idxprov/idxprov_test" @@ -59,6 +55,10 @@ import ( "github.com/filecoin-project/lotus/node/modules/dtypes" testing2 "github.com/filecoin-project/lotus/node/modules/testing" "github.com/filecoin-project/lotus/node/repo" + sectorstorage "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + mock2 "github.com/filecoin-project/lotus/storage/sealer/mock" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" ) func init() { @@ -246,7 +246,7 @@ func (n *Ensemble) Miner(minerNode *TestMiner, full *TestFullNode, opts ...NodeO // Create the preseal commitment. if n.options.mockProofs { - genm, k, err = mock.PreSeal(proofType, actorAddr, sectors) + genm, k, err = mock2.PreSeal(proofType, actorAddr, sectors) } else { genm, k, err = seed.PreSeal(actorAddr, proofType, 0, sectors, tdir, []byte("make genesis mem random"), nil, true) } @@ -363,8 +363,8 @@ func (n *Ensemble) Start() *Ensemble { // Are we mocking proofs? if n.options.mockProofs { opts = append(opts, - node.Override(new(ffiwrapper.Verifier), mock.MockVerifier), - node.Override(new(ffiwrapper.Prover), mock.MockProver), + node.Override(new(ffiwrapper.Verifier), mock2.MockVerifier), + node.Override(new(ffiwrapper.Prover), mock2.MockProver), ) } @@ -636,15 +636,15 @@ func (n *Ensemble) Start() *Ensemble { if n.options.mockProofs { opts = append(opts, - node.Override(new(*mock.SectorMgr), func() (*mock.SectorMgr, error) { - return mock.NewMockSectorMgr(presealSectors), nil + node.Override(new(*mock2.SectorMgr), func() (*mock2.SectorMgr, error) { + return mock2.NewMockSectorMgr(presealSectors), nil }), - node.Override(new(sectorstorage.SectorManager), node.From(new(*mock.SectorMgr))), - node.Override(new(sectorstorage.Unsealer), node.From(new(*mock.SectorMgr))), - node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock.SectorMgr))), + node.Override(new(sectorstorage.SectorManager), node.From(new(*mock2.SectorMgr))), + node.Override(new(sectorstorage.Unsealer), node.From(new(*mock2.SectorMgr))), + node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock2.SectorMgr))), - node.Override(new(ffiwrapper.Verifier), mock.MockVerifier), - node.Override(new(ffiwrapper.Prover), mock.MockProver), + node.Override(new(ffiwrapper.Verifier), mock2.MockVerifier), + node.Override(new(ffiwrapper.Prover), mock2.MockProver), node.Unset(new(*sectorstorage.Manager)), ) } diff --git a/itests/kit/node_miner.go b/itests/kit/node_miner.go index 9c6fa5d73..86018c730 100644 --- a/itests/kit/node_miner.go +++ b/itests/kit/node_miner.go @@ -24,10 +24,10 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/miner" sealing "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type MinerSubsystem int diff --git a/itests/kit/node_opts.go b/itests/kit/node_opts.go index 871675ac2..6ca480666 100644 --- a/itests/kit/node_opts.go +++ b/itests/kit/node_opts.go @@ -7,14 +7,14 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/config" "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/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) // DefaultPresealsPerBootstrapMiner is the number of preseals that every diff --git a/itests/wdpost_test.go b/itests/wdpost_test.go index bbeedb8d8..66857401c 100644 --- a/itests/wdpost_test.go +++ b/itests/wdpost_test.go @@ -18,9 +18,9 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/mock" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/node/impl" + "github.com/filecoin-project/lotus/storage/sealer/mock" ) func TestWindowedPost(t *testing.T) { diff --git a/itests/worker_test.go b/itests/worker_test.go index 9c2d9d91c..df70e329a 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -17,13 +17,13 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" - "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/lotus/itests/kit" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/impl" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/wdpost" ) diff --git a/markets/sectoraccessor/sectoraccessor.go b/markets/sectoraccessor/sectoraccessor.go index 4320e3fb1..a01895bb8 100644 --- a/markets/sectoraccessor/sectoraccessor.go +++ b/markets/sectoraccessor/sectoraccessor.go @@ -17,10 +17,10 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/markets/dagstore" "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/sectorblocks" ) @@ -29,13 +29,13 @@ var log = logging.Logger("sectoraccessor") type sectorAccessor struct { maddr address.Address secb sectorblocks.SectorBuilder - pp sectorstorage.PieceProvider + pp sealer.PieceProvider full v1api.FullNode } var _ retrievalmarket.SectorAccessor = (*sectorAccessor)(nil) -func NewSectorAccessor(maddr dtypes.MinerAddress, secb sectorblocks.SectorBuilder, pp sectorstorage.PieceProvider, full v1api.FullNode) dagstore.SectorAccessor { +func NewSectorAccessor(maddr dtypes.MinerAddress, secb sectorblocks.SectorBuilder, pp sealer.PieceProvider, full v1api.FullNode) dagstore.SectorAccessor { return §orAccessor{address.Address(maddr), secb, pp, full} } diff --git a/node/builder.go b/node/builder.go index 4b0b5b745..9e6bd76f4 100644 --- a/node/builder.go +++ b/node/builder.go @@ -25,7 +25,6 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/beacon" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/journal/alerting" "github.com/filecoin-project/lotus/lib/lotuslog" @@ -42,6 +41,7 @@ import ( "github.com/filecoin-project/lotus/node/modules/lp2p" "github.com/filecoin-project/lotus/node/modules/testing" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/stores" "github.com/filecoin-project/lotus/system" ) diff --git a/node/builder_chain.go b/node/builder_chain.go index d2c116b96..bc53a1318 100644 --- a/node/builder_chain.go +++ b/node/builder_chain.go @@ -28,7 +28,6 @@ import ( "github.com/filecoin-project/lotus/chain/wallet" ledgerwallet "github.com/filecoin-project/lotus/chain/wallet/ledger" "github.com/filecoin-project/lotus/chain/wallet/remotewallet" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/lib/peermgr" "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/node/config" @@ -40,6 +39,7 @@ import ( "github.com/filecoin-project/lotus/node/repo" "github.com/filecoin-project/lotus/paychmgr" "github.com/filecoin-project/lotus/paychmgr/settler" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) // Chain node provides access to the Filecoin blockchain, by setting up a full diff --git a/node/builder_miner.go b/node/builder_miner.go index f750c8c65..1e7d94793 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -19,10 +19,6 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/gen/slashfilter" - sectorstorage "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/sector-storage/storiface" "github.com/filecoin-project/lotus/markets/dagstore" "github.com/filecoin-project/lotus/markets/dealfilter" "github.com/filecoin-project/lotus/markets/idxprov" @@ -38,6 +34,10 @@ import ( "github.com/filecoin-project/lotus/storage" "github.com/filecoin-project/lotus/storage/ctladdr" sealing "github.com/filecoin-project/lotus/storage/pipeline" + sectorstorage "github.com/filecoin-project/lotus/storage/sealer" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/sectorblocks" "github.com/filecoin-project/lotus/storage/wdpost" ) diff --git a/node/config/def.go b/node/config/def.go index c6d87788f..452a31b4c 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/storage/sealer" ) const ( @@ -161,7 +161,7 @@ func DefaultStorageMiner() *StorageMiner { Assigner: "utilization", // By default use the hardware resource filtering strategy. - ResourceFiltering: sectorstorage.ResourceFilteringHardware, + ResourceFiltering: sealer.ResourceFilteringHardware, }, Dealmaking: DealmakingConfig{ diff --git a/node/config/storage.go b/node/config/storage.go index de65dc60a..e81e8e06f 100644 --- a/node/config/storage.go +++ b/node/config/storage.go @@ -8,8 +8,8 @@ import ( "golang.org/x/xerrors" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) func StorageFromFile(path string, def *stores.StorageConfig) (*stores.StorageConfig, error) { @@ -51,8 +51,8 @@ func WriteStorageFile(path string, config stores.StorageConfig) error { return nil } -func (c *StorageMiner) StorageManager() sectorstorage.Config { - return sectorstorage.Config{ +func (c *StorageMiner) StorageManager() sealer.Config { + return sealer.Config{ ParallelFetchLimit: c.Storage.ParallelFetchLimit, AllowAddPiece: c.Storage.AllowAddPiece, AllowPreCommit1: c.Storage.AllowPreCommit1, diff --git a/node/config/types.go b/node/config/types.go index 6d1939f94..cd05c8ce5 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -4,7 +4,7 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/storage/sealer" ) // // NOTE: ONLY PUT STRUCT DEFINITIONS IN THIS FILE @@ -352,7 +352,7 @@ type SealerConfig struct { // ResourceFiltering instructs the system which resource filtering strategy // to use when evaluating tasks against this worker. An empty value defaults // to "hardware". - ResourceFiltering sectorstorage.ResourceFilteringStrategy + ResourceFiltering sealer.ResourceFilteringStrategy } type BatchFeeConfig struct { diff --git a/node/impl/full/state.go b/node/impl/full/state.go index e2dfe56a1..678cbcd85 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -40,8 +40,8 @@ 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/ffiwrapper" "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) type StateModuleAPI interface { diff --git a/node/impl/remoteworker.go b/node/impl/remoteworker.go index d27b3baff..b3e68869d 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" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" + "github.com/filecoin-project/lotus/storage/sealer" ) type remoteWorker struct { @@ -56,4 +56,4 @@ func (r *remoteWorker) Close() error { return nil } -var _ sectorstorage.Worker = &remoteWorker{} +var _ sealer.Worker = &remoteWorker{} diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 798f177f4..c15cf1582 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -42,10 +42,6 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "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" mktsdagstore "github.com/filecoin-project/lotus/markets/dagstore" "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/miner" @@ -54,6 +50,10 @@ import ( "github.com/filecoin-project/lotus/storage/ctladdr" sealing "github.com/filecoin-project/lotus/storage/pipeline" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" "github.com/filecoin-project/lotus/storage/sectorblocks" "github.com/filecoin-project/lotus/storage/wdpost" ) @@ -85,10 +85,10 @@ type StorageMinerAPI struct { DAGStoreWrapper *mktsdagstore.Wrapper `optional:"true"` // Miner / storage - Miner *storage.Miner `optional:"true"` - BlockMiner *miner.Miner `optional:"true"` - StorageMgr *sectorstorage.Manager `optional:"true"` - IStorageMgr sectorstorage.SectorManager `optional:"true"` + Miner *storage.Miner `optional:"true"` + BlockMiner *miner.Miner `optional:"true"` + StorageMgr *sealer.Manager `optional:"true"` + IStorageMgr sealer.SectorManager `optional:"true"` stores.SectorIndex storiface.WorkerReturn `optional:"true"` AddrSel *ctladdr.AddressSelector diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index d0273478e..a385495d5 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -53,9 +53,6 @@ import ( "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "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/journal" "github.com/filecoin-project/lotus/markets" "github.com/filecoin-project/lotus/markets/dagstore" @@ -71,6 +68,9 @@ import ( "github.com/filecoin-project/lotus/storage/ctladdr" sealing "github.com/filecoin-project/lotus/storage/pipeline" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" "github.com/filecoin-project/lotus/storage/wdpost" ) @@ -209,7 +209,7 @@ type StorageMinerParams struct { MetricsCtx helpers.MetricsCtx API v1api.FullNode MetadataDS dtypes.MetadataDS - Sealer sectorstorage.SectorManager + Sealer sealer.SectorManager SectorIDCounter sealing.SectorIDCounter Verifier ffiwrapper.Verifier Prover ffiwrapper.Prover @@ -740,17 +740,17 @@ func LocalStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, ls stores.LocalStora return stores.NewLocal(ctx, ls, si, urls) } -func RemoteStorage(lstor *stores.Local, si stores.SectorIndex, sa sectorstorage.StorageAuth, sc sectorstorage.Config) *stores.Remote { +func RemoteStorage(lstor *stores.Local, si stores.SectorIndex, sa sealer.StorageAuth, sc sealer.Config) *stores.Remote { return stores.NewRemote(lstor, si, http.Header(sa), sc.ParallelFetchLimit, &stores.DefaultPartialFileHandler{}) } -func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, lstor *stores.Local, stor stores.Store, ls stores.LocalStorage, si stores.SectorIndex, sc sectorstorage.Config, ds dtypes.MetadataDS) (*sectorstorage.Manager, error) { +func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, lstor *stores.Local, stor stores.Store, ls stores.LocalStorage, si stores.SectorIndex, sc sealer.Config, ds dtypes.MetadataDS) (*sealer.Manager, error) { ctx := helpers.LifecycleCtx(mctx, lc) wsts := statestore.New(namespace.Wrap(ds, WorkerCallsPrefix)) smsts := statestore.New(namespace.Wrap(ds, ManagerWorkPrefix)) - sst, err := sectorstorage.New(ctx, lstor, stor, ls, si, sc, wsts, smsts) + sst, err := sealer.New(ctx, lstor, stor, ls, si, sc, wsts, smsts) if err != nil { return nil, err } @@ -762,7 +762,7 @@ func SectorStorage(mctx helpers.MetricsCtx, lc fx.Lifecycle, lstor *stores.Local return sst, nil } -func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) { +func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sealer.StorageAuth, error) { token, err := ca.AuthNew(ctx, []auth.Permission{"admin"}) if err != nil { return nil, xerrors.Errorf("creating storage auth header: %w", err) @@ -770,18 +770,18 @@ func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.Storage headers := http.Header{} headers.Add("Authorization", "Bearer "+string(token)) - return sectorstorage.StorageAuth(headers), nil + return sealer.StorageAuth(headers), nil } -func StorageAuthWithURL(apiInfo string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) { - return func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) { +func StorageAuthWithURL(apiInfo string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sealer.StorageAuth, error) { + return func(ctx helpers.MetricsCtx, ca v0api.Common) (sealer.StorageAuth, error) { s := strings.Split(apiInfo, ":") if len(s) != 2 { return nil, errors.New("unexpected format of `apiInfo`") } headers := http.Header{} headers.Add("Authorization", "Bearer "+s[0]) - return sectorstorage.StorageAuth(headers), nil + return sealer.StorageAuth(headers), nil } } diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index 1f90a1fea..934ac927e 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -24,9 +24,9 @@ import ( "github.com/filecoin-project/lotus/blockstore" badgerbs "github.com/filecoin-project/lotus/blockstore/badger" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/node/config" + fsutil "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) const ( diff --git a/node/repo/interface.go b/node/repo/interface.go index 88c2f5666..d3c50d700 100644 --- a/node/repo/interface.go +++ b/node/repo/interface.go @@ -9,8 +9,8 @@ import ( "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/stores" ) // BlockstoreDomain represents the domain of a blockstore. diff --git a/node/repo/memrepo.go b/node/repo/memrepo.go index 1b2e59c66..bd2156d00 100644 --- a/node/repo/memrepo.go +++ b/node/repo/memrepo.go @@ -17,10 +17,10 @@ import ( "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/chain/types" - "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/node/config" + fsutil "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type MemRepo struct { diff --git a/storage/miner.go b/storage/miner.go index 0b6070b86..bb02443d5 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -28,13 +28,13 @@ import ( "github.com/filecoin-project/lotus/chain/events" "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/storage/ctladdr" sealing2 "github.com/filecoin-project/lotus/storage/pipeline" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var log = logging.Logger("storageminer") @@ -50,7 +50,7 @@ var log = logging.Logger("storageminer") type Miner struct { api fullNodeFilteredAPI feeCfg config.MinerFeeConfig - sealer sectorstorage.SectorManager + sealer sealer.SectorManager ds datastore.Batching sc sealing2.SectorIDCounter verif ffiwrapper.Verifier @@ -133,7 +133,7 @@ type fullNodeFilteredAPI interface { func NewMiner(api fullNodeFilteredAPI, maddr address.Address, ds datastore.Batching, - sealer sectorstorage.SectorManager, + sealer sealer.SectorManager, sc sealing2.SectorIDCounter, verif ffiwrapper.Verifier, prover ffiwrapper.Prover, diff --git a/storage/pipeline/commit_batch.go b/storage/pipeline/commit_batch.go index 978a87df1..640fdf276 100644 --- a/storage/pipeline/commit_batch.go +++ b/storage/pipeline/commit_batch.go @@ -24,9 +24,9 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/node/config" sealiface2 "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var aggFeeNum = big.NewInt(110) diff --git a/storage/pipeline/commit_batch_test.go b/storage/pipeline/commit_batch_test.go index 433c340a8..65576d671 100644 --- a/storage/pipeline/commit_batch_test.go +++ b/storage/pipeline/commit_batch_test.go @@ -22,10 +22,10 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" sealing2 "github.com/filecoin-project/lotus/storage/pipeline" "github.com/filecoin-project/lotus/storage/pipeline/mocks" sealiface2 "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) func TestCommitBatcher(t *testing.T) { diff --git a/storage/pipeline/input.go b/storage/pipeline/input.go index 160310945..09661ea0e 100644 --- a/storage/pipeline/input.go +++ b/storage/pipeline/input.go @@ -19,10 +19,10 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) func (m *Sealing) handleWaitDeals(ctx statemachine.Context, sector SectorInfo) error { @@ -216,7 +216,7 @@ func (m *Sealing) handleAddPiece(ctx statemachine.Context, sector SectorInfo) er for _, p := range pads { expectCid := zerocomm.ZeroPieceCommitment(p.Unpadded()) - ppi, err := m.sealer.AddPiece(sectorstorage.WithPriority(ctx.Context(), DealSectorPriority), + ppi, err := m.sealer.AddPiece(sealer.WithPriority(ctx.Context(), DealSectorPriority), m.minerSector(sector.SectorType, sector.SectorNumber), pieceSizes, p.Unpadded(), @@ -238,7 +238,7 @@ func (m *Sealing) handleAddPiece(ctx statemachine.Context, sector SectorInfo) er }) } - ppi, err := m.sealer.AddPiece(sectorstorage.WithPriority(ctx.Context(), DealSectorPriority), + ppi, err := m.sealer.AddPiece(sealer.WithPriority(ctx.Context(), DealSectorPriority), m.minerSector(sector.SectorType, sector.SectorNumber), pieceSizes, deal.size, diff --git a/storage/pipeline/sealing.go b/storage/pipeline/sealing.go index 111c5e7a2..10dee5ac9 100644 --- a/storage/pipeline/sealing.go +++ b/storage/pipeline/sealing.go @@ -27,10 +27,10 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/market" lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) const SectorStorePrefix = "/sectors" @@ -95,7 +95,7 @@ type Sealing struct { maddr address.Address - sealer sectorstorage.SectorManager + sealer sealer.SectorManager sectors *statemachine.StateGroup sc SectorIDCounter verif ffiwrapper.Verifier @@ -160,7 +160,7 @@ type pendingPiece struct { accepted func(abi.SectorNumber, abi.UnpaddedPieceSize, error) } -func New(mctx context.Context, api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sectorstorage.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, prov ffiwrapper.Prover, pcp PreCommitPolicy, gc GetSealingConfigFunc, notifee SectorStateNotifee, as AddrSel) *Sealing { +func New(mctx context.Context, api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sealer.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, prov ffiwrapper.Prover, pcp PreCommitPolicy, gc GetSealingConfigFunc, notifee SectorStateNotifee, as AddrSel) *Sealing { s := &Sealing{ Api: api, DealInfo: &CurrentDealInfoManager{api}, diff --git a/storage/pipeline/states_failed_test.go b/storage/pipeline/states_failed_test.go index 55905330e..7c1b3553f 100644 --- a/storage/pipeline/states_failed_test.go +++ b/storage/pipeline/states_failed_test.go @@ -21,7 +21,7 @@ import ( api2 "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors/builtin/market" sealing2 "github.com/filecoin-project/lotus/storage/pipeline" - mocks2 "github.com/filecoin-project/lotus/storage/pipeline/mocks" + mocks "github.com/filecoin-project/lotus/storage/pipeline/mocks" ) func TestStateRecoverDealIDs(t *testing.T) { @@ -31,14 +31,14 @@ func TestStateRecoverDealIDs(t *testing.T) { ctx := context.Background() - api := mocks2.NewMockSealingAPI(mockCtrl) + api := mocks.NewMockSealingAPI(mockCtrl) fakeSealing := &sealing2.Sealing{ Api: api, DealInfo: &sealing2.CurrentDealInfoManager{CDAPI: api}, } - sctx := mocks2.NewMockContext(mockCtrl) + sctx := mocks.NewMockContext(mockCtrl) sctx.EXPECT().Context().AnyTimes().Return(ctx) api.EXPECT().ChainHead(ctx).Times(2).Return(nil, abi.ChainEpoch(10), nil) diff --git a/storage/pipeline/types.go b/storage/pipeline/types.go index c068d54e1..3ca0cc603 100644 --- a/storage/pipeline/types.go +++ b/storage/pipeline/types.go @@ -13,8 +13,8 @@ import ( "github.com/filecoin-project/specs-storage/storage" "github.com/filecoin-project/lotus/api" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" + "github.com/filecoin-project/lotus/storage/sealer" ) //go:generate go run github.com/golang/mock/mockgen -destination=mocks/statemachine.go -package=mocks . Context @@ -157,7 +157,7 @@ func (t *SectorInfo) sealingCtx(ctx context.Context) context.Context { // we need sealed sooner if t.hasDeals() { - return sectorstorage.WithPriority(ctx, DealSectorPriority) + return sealer.WithPriority(ctx, DealSectorPriority) } return ctx diff --git a/extern/sector-storage/README.md b/storage/sealer/README.md similarity index 100% rename from extern/sector-storage/README.md rename to storage/sealer/README.md diff --git a/extern/sector-storage/cbor_gen.go b/storage/sealer/cbor_gen.go similarity index 99% rename from extern/sector-storage/cbor_gen.go rename to storage/sealer/cbor_gen.go index eeea2b4f7..b5fc2a98c 100644 --- a/extern/sector-storage/cbor_gen.go +++ b/storage/sealer/cbor_gen.go @@ -1,6 +1,6 @@ // Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. -package sectorstorage +package sealer import ( "fmt" @@ -12,7 +12,7 @@ import ( cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" - sealtasks "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) var _ = xerrors.Errorf diff --git a/extern/sector-storage/cgroups.go b/storage/sealer/cgroups.go similarity index 92% rename from extern/sector-storage/cgroups.go rename to storage/sealer/cgroups.go index e2ec0564e..5fce8ff6e 100644 --- a/extern/sector-storage/cgroups.go +++ b/storage/sealer/cgroups.go @@ -1,7 +1,7 @@ //go:build !linux // +build !linux -package sectorstorage +package sealer func cgroupV1Mem() (memoryMax, memoryUsed, swapMax, swapUsed uint64, err error) { return 0, 0, 0, 0, nil diff --git a/extern/sector-storage/cgroups_linux.go b/storage/sealer/cgroups_linux.go similarity index 99% rename from extern/sector-storage/cgroups_linux.go rename to storage/sealer/cgroups_linux.go index 38fe88f19..8bee54f78 100644 --- a/extern/sector-storage/cgroups_linux.go +++ b/storage/sealer/cgroups_linux.go @@ -1,7 +1,7 @@ //go:build linux // +build linux -package sectorstorage +package sealer import ( "bufio" diff --git a/extern/sector-storage/docs/sector-storage.svg b/storage/sealer/docs/sector-storage.svg similarity index 100% rename from extern/sector-storage/docs/sector-storage.svg rename to storage/sealer/docs/sector-storage.svg diff --git a/extern/sector-storage/faults.go b/storage/sealer/faults.go similarity index 97% rename from extern/sector-storage/faults.go rename to storage/sealer/faults.go index 04a94e58c..d1b2c748b 100644 --- a/extern/sector-storage/faults.go +++ b/storage/sealer/faults.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var PostCheckTimeout = 160 * time.Second diff --git a/extern/sector-storage/ffiwrapper/basicfs/fs.go b/storage/sealer/ffiwrapper/basicfs/fs.go similarity index 97% rename from extern/sector-storage/ffiwrapper/basicfs/fs.go rename to storage/sealer/ffiwrapper/basicfs/fs.go index 3d19e49ef..a0738280b 100644 --- a/extern/sector-storage/ffiwrapper/basicfs/fs.go +++ b/storage/sealer/ffiwrapper/basicfs/fs.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type sectorFile struct { diff --git a/extern/sector-storage/ffiwrapper/prover_cgo.go b/storage/sealer/ffiwrapper/prover_cgo.go similarity index 100% rename from extern/sector-storage/ffiwrapper/prover_cgo.go rename to storage/sealer/ffiwrapper/prover_cgo.go diff --git a/extern/sector-storage/ffiwrapper/sealer.go b/storage/sealer/ffiwrapper/sealer.go similarity index 100% rename from extern/sector-storage/ffiwrapper/sealer.go rename to storage/sealer/ffiwrapper/sealer.go diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/storage/sealer/ffiwrapper/sealer_cgo.go similarity index 98% rename from extern/sector-storage/ffiwrapper/sealer_cgo.go rename to storage/sealer/ffiwrapper/sealer_cgo.go index 7d3d4fa7d..fdd778afa 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/storage/sealer/ffiwrapper/sealer_cgo.go @@ -28,11 +28,11 @@ import ( "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/fr32" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/lib/nullreader" nr "github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader" + fr322 "github.com/filecoin-project/lotus/storage/sealer/fr32" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var _ Storage = &Sealer{} @@ -237,7 +237,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi return abi.PieceInfo{}, xerrors.Errorf("getting partial file writer: %w", err) } - pw := fr32.NewPadWriter(w) + pw := fr322.NewPadWriter(w) pr := io.TeeReader(io.LimitReader(file, int64(pieceSize)), pw) @@ -537,11 +537,11 @@ func (sb *Sealer) UnsealPiece(ctx context.Context, sector storage.SectorRef, off defer close(outWait) defer opr.Close() // nolint - padwriter := fr32.NewPadWriter(out) + padwriter := fr322.NewPadWriter(out) bsize := uint64(size.Padded()) - if bsize > uint64(runtime.NumCPU())*fr32.MTTresh { - bsize = uint64(runtime.NumCPU()) * fr32.MTTresh + if bsize > uint64(runtime.NumCPU())*fr322.MTTresh { + bsize = uint64(runtime.NumCPU()) * fr322.MTTresh } bw := bufio.NewWriterSize(padwriter, int(abi.PaddedPieceSize(bsize).Unpadded())) @@ -644,7 +644,7 @@ func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector storag return false, xerrors.Errorf("getting partial file reader: %w", err) } - upr, err := fr32.NewUnpadReader(f, size.Padded()) + upr, err := fr322.NewUnpadReader(f, size.Padded()) if err != nil { return false, xerrors.Errorf("creating unpadded reader: %w", err) } diff --git a/extern/sector-storage/ffiwrapper/sealer_test.go b/storage/sealer/ffiwrapper/sealer_test.go similarity index 99% rename from extern/sector-storage/ffiwrapper/sealer_test.go rename to storage/sealer/ffiwrapper/sealer_test.go index c7f6433bc..7c41bd017 100644 --- a/extern/sector-storage/ffiwrapper/sealer_test.go +++ b/storage/sealer/ffiwrapper/sealer_test.go @@ -29,9 +29,9 @@ import ( "github.com/filecoin-project/specs-storage/storage" "github.com/filecoin-project/lotus/chain/actors/policy" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper/basicfs" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func init() { diff --git a/extern/sector-storage/ffiwrapper/types.go b/storage/sealer/ffiwrapper/types.go similarity index 93% rename from extern/sector-storage/ffiwrapper/types.go rename to storage/sealer/ffiwrapper/types.go index bba810454..bdb41278d 100644 --- a/extern/sector-storage/ffiwrapper/types.go +++ b/storage/sealer/ffiwrapper/types.go @@ -10,8 +10,8 @@ import ( "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper/basicfs" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type Validator interface { diff --git a/extern/sector-storage/ffiwrapper/unseal_ranges.go b/storage/sealer/ffiwrapper/unseal_ranges.go similarity index 85% rename from extern/sector-storage/ffiwrapper/unseal_ranges.go rename to storage/sealer/ffiwrapper/unseal_ranges.go index 5e0dd759c..22b41659c 100644 --- a/extern/sector-storage/ffiwrapper/unseal_ranges.go +++ b/storage/sealer/ffiwrapper/unseal_ranges.go @@ -6,8 +6,8 @@ import ( rlepluslazy "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // merge gaps between ranges which are close to each other diff --git a/extern/sector-storage/ffiwrapper/verifier_cgo.go b/storage/sealer/ffiwrapper/verifier_cgo.go similarity index 98% rename from extern/sector-storage/ffiwrapper/verifier_cgo.go rename to storage/sealer/ffiwrapper/verifier_cgo.go index 3f689e62e..7b679a31d 100644 --- a/extern/sector-storage/ffiwrapper/verifier_cgo.go +++ b/storage/sealer/ffiwrapper/verifier_cgo.go @@ -14,7 +14,7 @@ import ( "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) { diff --git a/extern/sector-storage/fr32/fr32.go b/storage/sealer/fr32/fr32.go similarity index 100% rename from extern/sector-storage/fr32/fr32.go rename to storage/sealer/fr32/fr32.go diff --git a/extern/sector-storage/fr32/fr32_ffi_cmp_test.go b/storage/sealer/fr32/fr32_ffi_cmp_test.go similarity index 95% rename from extern/sector-storage/fr32/fr32_ffi_cmp_test.go rename to storage/sealer/fr32/fr32_ffi_cmp_test.go index ff657ee29..7dece4723 100644 --- a/extern/sector-storage/fr32/fr32_ffi_cmp_test.go +++ b/storage/sealer/fr32/fr32_ffi_cmp_test.go @@ -13,7 +13,7 @@ import ( commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fr32" + "github.com/filecoin-project/lotus/storage/sealer/fr32" ) func TestWriteTwoPcs(t *testing.T) { diff --git a/extern/sector-storage/fr32/fr32_test.go b/storage/sealer/fr32/fr32_test.go similarity index 98% rename from extern/sector-storage/fr32/fr32_test.go rename to storage/sealer/fr32/fr32_test.go index 4793de645..f9150e550 100644 --- a/extern/sector-storage/fr32/fr32_test.go +++ b/storage/sealer/fr32/fr32_test.go @@ -14,7 +14,7 @@ import ( commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fr32" + "github.com/filecoin-project/lotus/storage/sealer/fr32" ) func padFFI(buf []byte) []byte { diff --git a/extern/sector-storage/fr32/readers.go b/storage/sealer/fr32/readers.go similarity index 100% rename from extern/sector-storage/fr32/readers.go rename to storage/sealer/fr32/readers.go diff --git a/extern/sector-storage/fr32/readers_test.go b/storage/sealer/fr32/readers_test.go similarity index 79% rename from extern/sector-storage/fr32/readers_test.go rename to storage/sealer/fr32/readers_test.go index 241195552..cbd6b8430 100644 --- a/extern/sector-storage/fr32/readers_test.go +++ b/storage/sealer/fr32/readers_test.go @@ -10,7 +10,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fr32" + fr322 "github.com/filecoin-project/lotus/storage/sealer/fr32" ) func TestUnpadReader(t *testing.T) { @@ -19,9 +19,9 @@ func TestUnpadReader(t *testing.T) { raw := bytes.Repeat([]byte{0x77}, int(ps)) padOut := make([]byte, ps.Padded()) - fr32.Pad(raw, padOut) + fr322.Pad(raw, padOut) - r, err := fr32.NewUnpadReader(bytes.NewReader(padOut), ps.Padded()) + r, err := fr322.NewUnpadReader(bytes.NewReader(padOut), ps.Padded()) if err != nil { t.Fatal(err) } diff --git a/extern/sector-storage/fr32/utils.go b/storage/sealer/fr32/utils.go similarity index 100% rename from extern/sector-storage/fr32/utils.go rename to storage/sealer/fr32/utils.go diff --git a/extern/sector-storage/fsutil/dealloc_linux.go b/storage/sealer/fsutil/dealloc_linux.go similarity index 100% rename from extern/sector-storage/fsutil/dealloc_linux.go rename to storage/sealer/fsutil/dealloc_linux.go diff --git a/extern/sector-storage/fsutil/dealloc_other.go b/storage/sealer/fsutil/dealloc_other.go similarity index 100% rename from extern/sector-storage/fsutil/dealloc_other.go rename to storage/sealer/fsutil/dealloc_other.go diff --git a/extern/sector-storage/fsutil/filesize_unix.go b/storage/sealer/fsutil/filesize_unix.go similarity index 100% rename from extern/sector-storage/fsutil/filesize_unix.go rename to storage/sealer/fsutil/filesize_unix.go diff --git a/extern/sector-storage/fsutil/statfs.go b/storage/sealer/fsutil/statfs.go similarity index 100% rename from extern/sector-storage/fsutil/statfs.go rename to storage/sealer/fsutil/statfs.go diff --git a/extern/sector-storage/fsutil/statfs_unix.go b/storage/sealer/fsutil/statfs_unix.go similarity index 100% rename from extern/sector-storage/fsutil/statfs_unix.go rename to storage/sealer/fsutil/statfs_unix.go diff --git a/extern/sector-storage/fsutil/statfs_windows.go b/storage/sealer/fsutil/statfs_windows.go similarity index 100% rename from extern/sector-storage/fsutil/statfs_windows.go rename to storage/sealer/fsutil/statfs_windows.go diff --git a/extern/sector-storage/manager.go b/storage/sealer/manager.go similarity index 99% rename from extern/sector-storage/manager.go rename to storage/sealer/manager.go index b898d0e89..f78782023 100644 --- a/extern/sector-storage/manager.go +++ b/storage/sealer/manager.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -19,11 +19,11 @@ import ( "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/specs-storage/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/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("advmgr") diff --git a/extern/sector-storage/manager_calltracker.go b/storage/sealer/manager_calltracker.go similarity index 98% rename from extern/sector-storage/manager_calltracker.go rename to storage/sealer/manager_calltracker.go index 7c8703e89..1c6a7cf1b 100644 --- a/extern/sector-storage/manager_calltracker.go +++ b/storage/sealer/manager_calltracker.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -11,8 +11,8 @@ import ( "golang.org/x/xerrors" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type WorkID struct { diff --git a/extern/sector-storage/manager_post.go b/storage/sealer/manager_post.go similarity index 98% rename from extern/sector-storage/manager_post.go rename to storage/sealer/manager_post.go index 70000c20f..e88807a29 100644 --- a/extern/sector-storage/manager_post.go +++ b/storage/sealer/manager_post.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/specs-actors/v6/actors/builtin" "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func (m *Manager) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) { diff --git a/extern/sector-storage/manager_test.go b/storage/sealer/manager_test.go similarity index 98% rename from extern/sector-storage/manager_test.go rename to storage/sealer/manager_test.go index 61c9cbf1d..c63b1b121 100644 --- a/extern/sector-storage/manager_test.go +++ b/storage/sealer/manager_test.go @@ -1,5 +1,5 @@ //stm: #unit -package sectorstorage +package sealer import ( "bytes" @@ -29,11 +29,11 @@ import ( proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/filecoin-project/specs-storage/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/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + fsutil "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func init() { @@ -47,7 +47,7 @@ func (t testStorage) DiskUsage(path string) (int64, error) { } func newTestStorage(t *testing.T) *testStorage { - tp, err := ioutil.TempDir(os.TempDir(), "sector-storage-test-") + tp, err := ioutil.TempDir(os.TempDir(), "sealer-test-") require.NoError(t, err) { diff --git a/extern/sector-storage/mock/mock.go b/storage/sealer/mock/mock.go similarity index 97% rename from extern/sector-storage/mock/mock.go rename to storage/sealer/mock/mock.go index 0f9bbc9af..d7f36f100 100644 --- a/extern/sector-storage/mock/mock.go +++ b/storage/sealer/mock/mock.go @@ -15,14 +15,14 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/dagstore/mount" - ffiwrapper2 "github.com/filecoin-project/go-commp-utils/ffiwrapper" + ffiwrapper "github.com/filecoin-project/go-commp-utils/ffiwrapper" commcid "github.com/filecoin-project/go-fil-commcid" "github.com/filecoin-project/go-state-types/abi" prooftypes "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + ffiwrapper3 "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("sbmock") @@ -90,7 +90,7 @@ func (mgr *SectorMgr) AddPiece(ctx context.Context, sectorID storage.SectorRef, var b bytes.Buffer tr := io.TeeReader(r, &b) - c, err := ffiwrapper2.GeneratePieceCIDFromFile(sectorID.ProofType, tr, size) + c, err := ffiwrapper.GeneratePieceCIDFromFile(sectorID.ProofType, tr, size) if err != nil { return abi.PieceInfo{}, xerrors.Errorf("failed to generate piece cid: %w", err) } @@ -722,7 +722,7 @@ func (m mockVerifProver) VerifyWindowPoSt(ctx context.Context, info prooftypes.W } func (m mockVerifProver) GenerateDataCommitment(pt abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error) { - return ffiwrapper.GenerateUnsealedCID(pt, pieces) + return ffiwrapper3.GenerateUnsealedCID(pt, pieces) } func (m mockVerifProver) GenerateWinningPoStSectorChallenge(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, eligibleSectorCount uint64) ([]uint64, error) { @@ -736,5 +736,5 @@ var MockVerifier = mockVerifProver{ var MockProver = MockVerifier var _ storage.Sealer = &SectorMgr{} -var _ ffiwrapper.Verifier = MockVerifier -var _ ffiwrapper.Prover = MockProver +var _ ffiwrapper3.Verifier = MockVerifier +var _ ffiwrapper3.Prover = MockProver diff --git a/extern/sector-storage/mock/mock_test.go b/storage/sealer/mock/mock_test.go similarity index 100% rename from extern/sector-storage/mock/mock_test.go rename to storage/sealer/mock/mock_test.go diff --git a/extern/sector-storage/mock/util.go b/storage/sealer/mock/util.go similarity index 100% rename from extern/sector-storage/mock/util.go rename to storage/sealer/mock/util.go diff --git a/extern/sector-storage/partialfile/partialfile.go b/storage/sealer/partialfile/partialfile.go similarity index 98% rename from extern/sector-storage/partialfile/partialfile.go rename to storage/sealer/partialfile/partialfile.go index 49f84fe81..6e8c2d843 100644 --- a/extern/sector-storage/partialfile/partialfile.go +++ b/storage/sealer/partialfile/partialfile.go @@ -13,8 +13,8 @@ import ( rlepluslazy "github.com/filecoin-project/go-bitfield/rle" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var log = logging.Logger("partialfile") diff --git a/extern/sector-storage/piece_provider.go b/storage/sealer/piece_provider.go similarity index 97% rename from extern/sector-storage/piece_provider.go rename to storage/sealer/piece_provider.go index 32f0c9028..cd29fc9af 100644 --- a/extern/sector-storage/piece_provider.go +++ b/storage/sealer/piece_provider.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "bufio" @@ -12,9 +12,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "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/storage/sealer/fr32" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type Unsealer interface { diff --git a/extern/sector-storage/piece_provider_test.go b/storage/sealer/piece_provider_test.go similarity index 98% rename from extern/sector-storage/piece_provider_test.go rename to storage/sealer/piece_provider_test.go index 7a67cf9ad..5c66482c1 100644 --- a/extern/sector-storage/piece_provider_test.go +++ b/storage/sealer/piece_provider_test.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "bytes" @@ -22,9 +22,9 @@ import ( "github.com/filecoin-project/go-statestore" specstorage "github.com/filecoin-project/specs-storage/storage" - "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/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // TestPieceProviderReadPiece verifies that the ReadPiece method works correctly diff --git a/extern/sector-storage/piece_reader.go b/storage/sealer/piece_reader.go similarity index 99% rename from extern/sector-storage/piece_reader.go rename to storage/sealer/piece_reader.go index 56e19142c..6ef616e41 100644 --- a/extern/sector-storage/piece_reader.go +++ b/storage/sealer/piece_reader.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "bufio" diff --git a/extern/sector-storage/request_queue.go b/storage/sealer/request_queue.go similarity index 97% rename from extern/sector-storage/request_queue.go rename to storage/sealer/request_queue.go index 87a057923..1107fb90e 100644 --- a/extern/sector-storage/request_queue.go +++ b/storage/sealer/request_queue.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import "sort" diff --git a/extern/sector-storage/request_queue_test.go b/storage/sealer/request_queue_test.go similarity index 92% rename from extern/sector-storage/request_queue_test.go rename to storage/sealer/request_queue_test.go index c95548c43..5a48586a0 100644 --- a/extern/sector-storage/request_queue_test.go +++ b/storage/sealer/request_queue_test.go @@ -1,10 +1,10 @@ -package sectorstorage +package sealer import ( "fmt" "testing" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) func TestRequestQueue(t *testing.T) { diff --git a/extern/sector-storage/roprov.go b/storage/sealer/roprov.go similarity index 86% rename from extern/sector-storage/roprov.go rename to storage/sealer/roprov.go index ebc7610d7..7b2371f9e 100644 --- a/extern/sector-storage/roprov.go +++ b/storage/sealer/roprov.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type readonlyProvider struct { diff --git a/extern/sector-storage/sched.go b/storage/sealer/sched.go similarity index 98% rename from extern/sector-storage/sched.go rename to storage/sealer/sched.go index 32f91b4e7..192e415c8 100644 --- a/extern/sector-storage/sched.go +++ b/storage/sealer/sched.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -11,8 +11,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type schedPrioCtxKey int diff --git a/extern/sector-storage/sched_assigner_common.go b/storage/sealer/sched_assigner_common.go similarity index 99% rename from extern/sector-storage/sched_assigner_common.go rename to storage/sealer/sched_assigner_common.go index 41cf866b2..09ff82a89 100644 --- a/extern/sector-storage/sched_assigner_common.go +++ b/storage/sealer/sched_assigner_common.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" diff --git a/extern/sector-storage/sched_assigner_spread.go b/storage/sealer/sched_assigner_spread.go similarity index 95% rename from extern/sector-storage/sched_assigner_spread.go rename to storage/sealer/sched_assigner_spread.go index c62cd42b2..7c3466202 100644 --- a/extern/sector-storage/sched_assigner_spread.go +++ b/storage/sealer/sched_assigner_spread.go @@ -1,9 +1,9 @@ -package sectorstorage +package sealer import ( "math" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func NewSpreadAssigner() Assigner { diff --git a/extern/sector-storage/sched_assigner_utilization.go b/storage/sealer/sched_assigner_utilization.go similarity index 96% rename from extern/sector-storage/sched_assigner_utilization.go rename to storage/sealer/sched_assigner_utilization.go index 6cea72a1c..6d29b2b83 100644 --- a/extern/sector-storage/sched_assigner_utilization.go +++ b/storage/sealer/sched_assigner_utilization.go @@ -1,9 +1,9 @@ -package sectorstorage +package sealer import ( "math" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func NewLowestUtilizationAssigner() Assigner { diff --git a/extern/sector-storage/sched_post.go b/storage/sealer/sched_post.go similarity index 95% rename from extern/sector-storage/sched_post.go rename to storage/sealer/sched_post.go index 9c3838e08..3019d26be 100644 --- a/extern/sector-storage/sched_post.go +++ b/storage/sealer/sched_post.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -10,9 +10,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" - sealtasks "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/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type poStScheduler struct { diff --git a/extern/sector-storage/sched_resources.go b/storage/sealer/sched_resources.go similarity index 97% rename from extern/sector-storage/sched_resources.go rename to storage/sealer/sched_resources.go index 0f1f259b7..a0e5a2132 100644 --- a/extern/sector-storage/sched_resources.go +++ b/storage/sealer/sched_resources.go @@ -1,12 +1,12 @@ -package sectorstorage +package sealer import ( "context" "sync" "time" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type ActiveResources struct { diff --git a/extern/sector-storage/sched_test.go b/storage/sealer/sched_test.go similarity index 98% rename from extern/sector-storage/sched_test.go rename to storage/sealer/sched_test.go index dc87bc744..4d15df36b 100644 --- a/extern/sector-storage/sched_test.go +++ b/storage/sealer/sched_test.go @@ -1,5 +1,5 @@ //stm: #unit -package sectorstorage +package sealer import ( "context" @@ -20,10 +20,10 @@ import ( prooftypes "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "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/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func init() { diff --git a/extern/sector-storage/sched_worker.go b/storage/sealer/sched_worker.go similarity index 98% rename from extern/sector-storage/sched_worker.go rename to storage/sealer/sched_worker.go index c9b019ad0..ebe3cce97 100644 --- a/extern/sector-storage/sched_worker.go +++ b/storage/sealer/sched_worker.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -6,9 +6,9 @@ import ( "golang.org/x/xerrors" - "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/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type schedWorker struct { diff --git a/extern/sector-storage/sealtasks/task.go b/storage/sealer/sealtasks/task.go similarity index 100% rename from extern/sector-storage/sealtasks/task.go rename to storage/sealer/sealtasks/task.go diff --git a/extern/sector-storage/selector_alloc.go b/storage/sealer/selector_alloc.go similarity index 87% rename from extern/sector-storage/selector_alloc.go rename to storage/sealer/selector_alloc.go index ffdf35b5e..cc26544f8 100644 --- a/extern/sector-storage/selector_alloc.go +++ b/storage/sealer/selector_alloc.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -7,9 +7,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "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/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type allocSelector struct { diff --git a/extern/sector-storage/selector_existing.go b/storage/sealer/selector_existing.go similarity index 88% rename from extern/sector-storage/selector_existing.go rename to storage/sealer/selector_existing.go index 78a3b1988..a31d7e787 100644 --- a/extern/sector-storage/selector_existing.go +++ b/storage/sealer/selector_existing.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -7,9 +7,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "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/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type existingSelector struct { diff --git a/extern/sector-storage/selector_move.go b/storage/sealer/selector_move.go similarity index 91% rename from extern/sector-storage/selector_move.go rename to storage/sealer/selector_move.go index 7c63691b1..a980b7289 100644 --- a/extern/sector-storage/selector_move.go +++ b/storage/sealer/selector_move.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -7,9 +7,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "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/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type moveSelector struct { diff --git a/extern/sector-storage/selector_task.go b/storage/sealer/selector_task.go similarity index 88% rename from extern/sector-storage/selector_task.go rename to storage/sealer/selector_task.go index d5ea9618b..cc12b514e 100644 --- a/extern/sector-storage/selector_task.go +++ b/storage/sealer/selector_task.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -7,8 +7,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type taskSelector struct { diff --git a/extern/sector-storage/stats.go b/storage/sealer/stats.go similarity index 94% rename from extern/sector-storage/stats.go rename to storage/sealer/stats.go index 56866793b..f34109d78 100644 --- a/extern/sector-storage/stats.go +++ b/storage/sealer/stats.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func (m *Manager) WorkerStats(ctx context.Context) map[uuid.UUID]storiface.WorkerStats { diff --git a/extern/sector-storage/stores/http_handler.go b/storage/sealer/stores/http_handler.go similarity index 97% rename from extern/sector-storage/stores/http_handler.go rename to storage/sealer/stores/http_handler.go index 6667b1662..8be7027e5 100644 --- a/extern/sector-storage/stores/http_handler.go +++ b/storage/sealer/stores/http_handler.go @@ -15,9 +15,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" - "github.com/filecoin-project/lotus/extern/sector-storage/tarutil" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" + "github.com/filecoin-project/lotus/storage/sealer/tarutil" ) var log = logging.Logger("stores") diff --git a/extern/sector-storage/stores/http_handler_test.go b/storage/sealer/stores/http_handler_test.go similarity index 97% rename from extern/sector-storage/stores/http_handler_test.go rename to storage/sealer/stores/http_handler_test.go index 3533e4f4e..343b96c14 100644 --- a/extern/sector-storage/stores/http_handler_test.go +++ b/storage/sealer/stores/http_handler_test.go @@ -16,10 +16,10 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/stores/mocks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + "github.com/filecoin-project/lotus/storage/sealer/stores" + mocks "github.com/filecoin-project/lotus/storage/sealer/stores/mocks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func TestRemoteGetAllocated(t *testing.T) { diff --git a/extern/sector-storage/stores/index.go b/storage/sealer/stores/index.go similarity index 98% rename from extern/sector-storage/stores/index.go rename to storage/sealer/stores/index.go index 5a0d0f3a3..792e8a10f 100644 --- a/extern/sector-storage/stores/index.go +++ b/storage/sealer/stores/index.go @@ -17,9 +17,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/metrics" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var HeartbeatInterval = 10 * time.Second diff --git a/extern/sector-storage/stores/index_locks.go b/storage/sealer/stores/index_locks.go similarity index 98% rename from extern/sector-storage/stores/index_locks.go rename to storage/sealer/stores/index_locks.go index ade437c6b..a929e3c7b 100644 --- a/extern/sector-storage/stores/index_locks.go +++ b/storage/sealer/stores/index_locks.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type sectorLock struct { diff --git a/extern/sector-storage/stores/index_locks_test.go b/storage/sealer/stores/index_locks_test.go similarity index 98% rename from extern/sector-storage/stores/index_locks_test.go rename to storage/sealer/stores/index_locks_test.go index ec7f34927..225a71efb 100644 --- a/extern/sector-storage/stores/index_locks_test.go +++ b/storage/sealer/stores/index_locks_test.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var aSector = abi.SectorID{ diff --git a/extern/sector-storage/stores/index_locks_util.go b/storage/sealer/stores/index_locks_util.go similarity index 100% rename from extern/sector-storage/stores/index_locks_util.go rename to storage/sealer/stores/index_locks_util.go diff --git a/extern/sector-storage/stores/index_test.go b/storage/sealer/stores/index_test.go similarity index 96% rename from extern/sector-storage/stores/index_test.go rename to storage/sealer/stores/index_test.go index 64a9271c4..fe1302b07 100644 --- a/extern/sector-storage/stores/index_test.go +++ b/storage/sealer/stores/index_test.go @@ -10,8 +10,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) func init() { diff --git a/extern/sector-storage/stores/interface.go b/storage/sealer/stores/interface.go similarity index 92% rename from extern/sector-storage/stores/interface.go rename to storage/sealer/stores/interface.go index 980beee47..fc8bd0a6a 100644 --- a/extern/sector-storage/stores/interface.go +++ b/storage/sealer/stores/interface.go @@ -7,9 +7,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) //go:generate go run github.com/golang/mock/mockgen -destination=mocks/pf.go -package=mocks . PartialFileHandler diff --git a/extern/sector-storage/stores/local.go b/storage/sealer/stores/local.go similarity index 99% rename from extern/sector-storage/stores/local.go rename to storage/sealer/stores/local.go index 549a8d4ec..089b73b81 100644 --- a/extern/sector-storage/stores/local.go +++ b/storage/sealer/stores/local.go @@ -18,8 +18,8 @@ import ( "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // LocalStorageMeta [path]/sectorstore.json diff --git a/extern/sector-storage/stores/local_test.go b/storage/sealer/stores/local_test.go similarity index 92% rename from extern/sector-storage/stores/local_test.go rename to storage/sealer/stores/local_test.go index 913a73b77..bb3dac5f0 100644 --- a/extern/sector-storage/stores/local_test.go +++ b/storage/sealer/stores/local_test.go @@ -11,8 +11,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) const pathSize = 16 << 20 diff --git a/extern/sector-storage/stores/localstorage_cached.go b/storage/sealer/stores/localstorage_cached.go similarity index 97% rename from extern/sector-storage/stores/localstorage_cached.go rename to storage/sealer/stores/localstorage_cached.go index 9ada06cbf..e6a58d9dd 100644 --- a/extern/sector-storage/stores/localstorage_cached.go +++ b/storage/sealer/stores/localstorage_cached.go @@ -6,7 +6,7 @@ import ( lru "github.com/hashicorp/golang-lru" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" ) var StatTimeout = 5 * time.Second diff --git a/extern/sector-storage/stores/mocks/index.go b/storage/sealer/stores/mocks/index.go similarity index 97% rename from extern/sector-storage/stores/mocks/index.go rename to storage/sealer/stores/mocks/index.go index b194d0d84..3781421de 100644 --- a/extern/sector-storage/stores/mocks/index.go +++ b/storage/sealer/stores/mocks/index.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/lotus/extern/sector-storage/stores (interfaces: SectorIndex) +// Source: github.com/filecoin-project/lotus/extern/sealer/stores (interfaces: SectorIndex) // Package mocks is a generated GoMock package. package mocks @@ -12,8 +12,8 @@ import ( abi "github.com/filecoin-project/go-state-types/abi" - fsutil "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - storiface "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // MockSectorIndex is a mock of SectorIndex interface. diff --git a/extern/sector-storage/stores/mocks/pf.go b/storage/sealer/stores/mocks/pf.go similarity index 92% rename from extern/sector-storage/stores/mocks/pf.go rename to storage/sealer/stores/mocks/pf.go index 5e8fe62cc..e88c36260 100644 --- a/extern/sector-storage/stores/mocks/pf.go +++ b/storage/sealer/stores/mocks/pf.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/lotus/extern/sector-storage/stores (interfaces: PartialFileHandler) +// Source: github.com/filecoin-project/lotus/extern/sealer/stores (interfaces: PartialFileHandler) // Package mocks is a generated GoMock package. package mocks @@ -12,8 +12,8 @@ import ( abi "github.com/filecoin-project/go-state-types/abi" - partialfile "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - storiface "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // MockPartialFileHandler is a mock of PartialFileHandler interface. diff --git a/extern/sector-storage/stores/mocks/store.go b/storage/sealer/stores/mocks/store.go similarity index 95% rename from extern/sector-storage/stores/mocks/store.go rename to storage/sealer/stores/mocks/store.go index 2377433ee..53b777f0b 100644 --- a/extern/sector-storage/stores/mocks/store.go +++ b/storage/sealer/stores/mocks/store.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/lotus/extern/sector-storage/stores (interfaces: Store) +// Source: github.com/filecoin-project/lotus/extern/sealer/stores (interfaces: Store) // Package mocks is a generated GoMock package. package mocks @@ -13,8 +13,8 @@ import ( abi "github.com/filecoin-project/go-state-types/abi" storage "github.com/filecoin-project/specs-storage/storage" - fsutil "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" - storiface "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) // MockStore is a mock of Store interface. diff --git a/extern/sector-storage/stores/remote.go b/storage/sealer/stores/remote.go similarity index 99% rename from extern/sector-storage/stores/remote.go rename to storage/sealer/stores/remote.go index 989e913ee..39158ca89 100644 --- a/extern/sector-storage/stores/remote.go +++ b/storage/sealer/stores/remote.go @@ -23,9 +23,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "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/lotus/storage/sealer/fsutil" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" + "github.com/filecoin-project/lotus/storage/sealer/tarutil" ) var FetchTempSubdir = "fetching" diff --git a/extern/sector-storage/stores/remote_test.go b/storage/sealer/stores/remote_test.go similarity index 98% rename from extern/sector-storage/stores/remote_test.go rename to storage/sealer/stores/remote_test.go index 1b6160a8f..a843c46fe 100644 --- a/extern/sector-storage/stores/remote_test.go +++ b/storage/sealer/stores/remote_test.go @@ -23,11 +23,11 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/partialfile" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/stores/mocks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/partialfile" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + mocks "github.com/filecoin-project/lotus/storage/sealer/stores/mocks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) const metaFile = "sectorstore.json" diff --git a/extern/sector-storage/stores/util_unix.go b/storage/sealer/stores/util_unix.go similarity index 100% rename from extern/sector-storage/stores/util_unix.go rename to storage/sealer/stores/util_unix.go diff --git a/extern/sector-storage/storiface/cbor_gen.go b/storage/sealer/storiface/cbor_gen.go similarity index 100% rename from extern/sector-storage/storiface/cbor_gen.go rename to storage/sealer/storiface/cbor_gen.go diff --git a/extern/sector-storage/storiface/ffi.go b/storage/sealer/storiface/ffi.go similarity index 100% rename from extern/sector-storage/storiface/ffi.go rename to storage/sealer/storiface/ffi.go diff --git a/extern/sector-storage/storiface/filetype.go b/storage/sealer/storiface/filetype.go similarity index 100% rename from extern/sector-storage/storiface/filetype.go rename to storage/sealer/storiface/filetype.go diff --git a/extern/sector-storage/storiface/index.go b/storage/sealer/storiface/index.go similarity index 94% rename from extern/sector-storage/storiface/index.go rename to storage/sealer/storiface/index.go index d198c91f6..fdac7057f 100644 --- a/extern/sector-storage/storiface/index.go +++ b/storage/sealer/storiface/index.go @@ -5,7 +5,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" + "github.com/filecoin-project/lotus/storage/sealer/fsutil" ) // ID identifies sector storage by UUID. One sector storage should map to one diff --git a/extern/sector-storage/storiface/resources.go b/storage/sealer/storiface/resources.go similarity index 99% rename from extern/sector-storage/storiface/resources.go rename to storage/sealer/storiface/resources.go index cd55924d5..f3a658e34 100644 --- a/extern/sector-storage/storiface/resources.go +++ b/storage/sealer/storiface/resources.go @@ -10,7 +10,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) type Resources struct { diff --git a/extern/sector-storage/storiface/resources_test.go b/storage/sealer/storiface/resources_test.go similarity index 96% rename from extern/sector-storage/storiface/resources_test.go rename to storage/sealer/storiface/resources_test.go index fd0359116..1040ef96e 100644 --- a/extern/sector-storage/storiface/resources_test.go +++ b/storage/sealer/storiface/resources_test.go @@ -8,7 +8,7 @@ import ( stabi "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) func TestListResourceVars(t *testing.T) { diff --git a/extern/sector-storage/storiface/storage.go b/storage/sealer/storiface/storage.go similarity index 100% rename from extern/sector-storage/storiface/storage.go rename to storage/sealer/storiface/storage.go diff --git a/extern/sector-storage/storiface/worker.go b/storage/sealer/storiface/worker.go similarity index 99% rename from extern/sector-storage/storiface/worker.go rename to storage/sealer/storiface/worker.go index d5a243fc7..e03c546ec 100644 --- a/extern/sector-storage/storiface/worker.go +++ b/storage/sealer/storiface/worker.go @@ -13,7 +13,7 @@ import ( "github.com/filecoin-project/go-state-types/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" ) type WorkerID uuid.UUID // worker session UUID diff --git a/extern/sector-storage/tarutil/systar.go b/storage/sealer/tarutil/systar.go similarity index 100% rename from extern/sector-storage/tarutil/systar.go rename to storage/sealer/tarutil/systar.go diff --git a/extern/sector-storage/teststorage_test.go b/storage/sealer/teststorage_test.go similarity index 96% rename from extern/sector-storage/teststorage_test.go rename to storage/sealer/teststorage_test.go index b687e37a2..e1e59c0b0 100644 --- a/extern/sector-storage/teststorage_test.go +++ b/storage/sealer/teststorage_test.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -10,8 +10,8 @@ import ( "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type apres struct { diff --git a/extern/sector-storage/testworker_test.go b/storage/sealer/testworker_test.go similarity index 93% rename from extern/sector-storage/testworker_test.go rename to storage/sealer/testworker_test.go index 608a6d5c5..33dd5d54a 100644 --- a/extern/sector-storage/testworker_test.go +++ b/storage/sealer/testworker_test.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -10,10 +10,10 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "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" + "github.com/filecoin-project/lotus/storage/sealer/mock" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type testWorker struct { diff --git a/extern/sector-storage/worker_calltracker.go b/storage/sealer/worker_calltracker.go similarity index 95% rename from extern/sector-storage/worker_calltracker.go rename to storage/sealer/worker_calltracker.go index 049c604c1..eb5bab145 100644 --- a/extern/sector-storage/worker_calltracker.go +++ b/storage/sealer/worker_calltracker.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "fmt" @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/go-statestore" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type workerCallTracker struct { diff --git a/extern/sector-storage/worker_local.go b/storage/sealer/worker_local.go similarity index 98% rename from extern/sector-storage/worker_local.go rename to storage/sealer/worker_local.go index 13e00a414..a03a1bbe1 100644 --- a/extern/sector-storage/worker_local.go +++ b/storage/sealer/worker_local.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -23,10 +23,10 @@ import ( "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/specs-storage/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/extern/sector-storage/storiface" + ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + stores "github.com/filecoin-project/lotus/storage/sealer/stores" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) var pathTypes = []storiface.SectorFileType{storiface.FTUnsealed, storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache} diff --git a/extern/sector-storage/worker_local_test.go b/storage/sealer/worker_local_test.go similarity index 89% rename from extern/sector-storage/worker_local_test.go rename to storage/sealer/worker_local_test.go index 3ca4544e5..5795735b0 100644 --- a/extern/sector-storage/worker_local_test.go +++ b/storage/sealer/worker_local_test.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -11,8 +11,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-statestore" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type hangStore struct { diff --git a/extern/sector-storage/worker_tracked.go b/storage/sealer/worker_tracked.go similarity index 96% rename from extern/sector-storage/worker_tracked.go rename to storage/sealer/worker_tracked.go index e3ce0a46a..00745c9a3 100644 --- a/extern/sector-storage/worker_tracked.go +++ b/storage/sealer/worker_tracked.go @@ -1,4 +1,4 @@ -package sectorstorage +package sealer import ( "context" @@ -13,9 +13,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/metrics" + "github.com/filecoin-project/lotus/storage/sealer/sealtasks" + storiface "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type trackedWork struct { @@ -175,7 +175,9 @@ func (t *trackedWorker) SealPreCommit2(ctx context.Context, sector storage.Secto } func (t *trackedWorker) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) { - return t.tracker.track(ctx, t.execute, t.wid, t.workerInfo, sector, sealtasks.TTCommit1, func() (storiface.CallID, error) { return t.Worker.SealCommit1(ctx, sector, ticket, seed, pieces, cids) }) + return t.tracker.track(ctx, t.execute, t.wid, t.workerInfo, sector, sealtasks.TTCommit1, func() (storiface.CallID, error) { + return t.Worker.SealCommit1(ctx, sector, ticket, seed, pieces, cids) + }) } func (t *trackedWorker) SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) { diff --git a/storage/wdpost/wdpost_run_test.go b/storage/wdpost/wdpost_run_test.go index fac17b01a..db3e535dd 100644 --- a/storage/wdpost/wdpost_run_test.go +++ b/storage/wdpost/wdpost_run_test.go @@ -29,9 +29,9 @@ import ( lbuiltin "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/storage/ctladdr" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) type mockStorageMinerAPI struct { diff --git a/storage/wdpost/wdpost_sched.go b/storage/wdpost/wdpost_sched.go index 81de65521..99f14c691 100644 --- a/storage/wdpost/wdpost_sched.go +++ b/storage/wdpost/wdpost_sched.go @@ -22,11 +22,11 @@ import ( "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" - sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/storage/ctladdr" + "github.com/filecoin-project/lotus/storage/sealer" + "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" ) var log = logging.Logger("wdpost") @@ -68,7 +68,7 @@ type WindowPoStScheduler struct { addrSel *ctladdr.AddressSelector prover storage.Prover verifier ffiwrapper.Verifier - faultTracker sectorstorage.FaultTracker + faultTracker sealer.FaultTracker proofType abi.RegisteredPoStProof partitionSectors uint64 ch *changeHandler @@ -88,7 +88,7 @@ func NewWindowedPoStScheduler(api NodeAPI, as *ctladdr.AddressSelector, sp storage.Prover, verif ffiwrapper.Verifier, - ft sectorstorage.FaultTracker, + ft sealer.FaultTracker, j journal.Journal, actor address.Address) (*WindowPoStScheduler, error) { mi, err := api.StateMinerInfo(context.TODO(), actor, types.EmptyTSK) diff --git a/testplans/lotus-soup/testkit/role_miner.go b/testplans/lotus-soup/testkit/role_miner.go index 7df7961c8..5f11dfd32 100644 --- a/testplans/lotus-soup/testkit/role_miner.go +++ b/testplans/lotus-soup/testkit/role_miner.go @@ -34,8 +34,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/wallet/key" "github.com/filecoin-project/lotus/cmd/lotus-seed/seed" - "github.com/filecoin-project/lotus/extern/sector-storage/stores" - "github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node" @@ -43,6 +41,8 @@ import ( "github.com/filecoin-project/lotus/node/impl" "github.com/filecoin-project/lotus/node/modules" "github.com/filecoin-project/lotus/node/repo" + "github.com/filecoin-project/lotus/storage/sealer/stores" + "github.com/filecoin-project/lotus/storage/sealer/storiface" ) const (