Skip to content

Commit

Permalink
fix: cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Mar 28, 2023
1 parent 3755c75 commit 0f98dd8
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 170 deletions.
8 changes: 4 additions & 4 deletions gql/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/filecoin-project/boost/node/modules/dtypes"
"math"

"github.com/dustin/go-humanize"
"github.com/filecoin-project/boost-gfm/piecestore"
"github.com/filecoin-project/boost-gfm/retrievalmarket"
lotus_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
gfm_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
"github.com/filecoin-project/boost/db"
"github.com/filecoin-project/boost/fundmanager"
gqltypes "github.com/filecoin-project/boost/gql/types"
"github.com/filecoin-project/boost/markets/storageadapter"
"github.com/filecoin-project/boost/node/config"
"github.com/filecoin-project/boost/node/modules/dtypes"
"github.com/filecoin-project/boost/retrievalmarket/rtvllog"
"github.com/filecoin-project/boost/storagemanager"
"github.com/filecoin-project/boost/storagemarket"
Expand Down Expand Up @@ -54,7 +54,7 @@ type resolver struct {
fundMgr *fundmanager.FundManager
storageMgr *storagemanager.StorageManager
provider *storagemarket.Provider
legacyProv lotus_storagemarket.StorageProvider
legacyProv gfm_storagemarket.StorageProvider
legacyDT dtypes.ProviderDataTransfer
ps piecestore.PieceStore
sa retrievalmarket.SectorAccessor
Expand All @@ -64,7 +64,7 @@ type resolver struct {
fullNode v1api.FullNode
}

func NewResolver(cfg *config.Boost, r lotus_repo.LockedRepo, h host.Host, dealsDB *db.DealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager, storageMgr *storagemanager.StorageManager, spApi sealingpipeline.API, provider *storagemarket.Provider, legacyProv lotus_storagemarket.StorageProvider, legacyDT dtypes.ProviderDataTransfer, ps piecestore.PieceStore, sa retrievalmarket.SectorAccessor, dagst dagstore.Interface, publisher *storageadapter.DealPublisher, fullNode v1api.FullNode) *resolver {
func NewResolver(cfg *config.Boost, r lotus_repo.LockedRepo, h host.Host, dealsDB *db.DealsDB, logsDB *db.LogsDB, retDB *rtvllog.RetrievalLogDB, plDB *db.ProposalLogsDB, fundsDB *db.FundsDB, fundMgr *fundmanager.FundManager, storageMgr *storagemanager.StorageManager, spApi sealingpipeline.API, provider *storagemarket.Provider, legacyProv gfm_storagemarket.StorageProvider, legacyDT dtypes.ProviderDataTransfer, ps piecestore.PieceStore, sa retrievalmarket.SectorAccessor, dagst dagstore.Interface, publisher *storageadapter.DealPublisher, fullNode v1api.FullNode) *resolver {
return &resolver{
cfg: cfg,
repo: r,
Expand Down
8 changes: 4 additions & 4 deletions indexprovider/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
dst "github.com/filecoin-project/dagstore"
"github.com/filecoin-project/lotus/markets/dagstore"

lotus_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
gfm_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
"github.com/filecoin-project/boost/db"
"github.com/filecoin-project/boost/node/config"
"github.com/filecoin-project/boost/storagemarket/types/dealcheckpoints"
Expand All @@ -41,7 +41,7 @@ type Wrapper struct {
cfg *config.Boost
enabled bool
dealsDB *db.DealsDB
legacyProv lotus_storagemarket.StorageProvider
legacyProv gfm_storagemarket.StorageProvider
prov provider.Interface
dagStore *dagstore.Wrapper
meshCreator idxprov.MeshCreator
Expand All @@ -52,11 +52,11 @@ type Wrapper struct {
}

func NewWrapper(cfg *config.Boost) func(lc fx.Lifecycle, h host.Host, r repo.LockedRepo, dealsDB *db.DealsDB,
legacyProv lotus_storagemarket.StorageProvider, prov provider.Interface, dagStore *dagstore.Wrapper,
legacyProv gfm_storagemarket.StorageProvider, prov provider.Interface, dagStore *dagstore.Wrapper,
meshCreator idxprov.MeshCreator) (*Wrapper, error) {

return func(lc fx.Lifecycle, h host.Host, r repo.LockedRepo, dealsDB *db.DealsDB,
legacyProv lotus_storagemarket.StorageProvider, prov provider.Interface, dagStore *dagstore.Wrapper,
legacyProv gfm_storagemarket.StorageProvider, prov provider.Interface, dagStore *dagstore.Wrapper,
meshCreator idxprov.MeshCreator) (*Wrapper, error) {
if cfg.DAGStore.RootDir == "" {
cfg.DAGStore.RootDir = filepath.Join(r.Path(), defaultDagStoreDir)
Expand Down
64 changes: 0 additions & 64 deletions markets/dealfilter/cli.go

This file was deleted.

6 changes: 3 additions & 3 deletions node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"database/sql"
"errors"
"fmt"
storageimpl "github.com/filecoin-project/boost-gfm/storagemarket/impl"
lotus_gfm_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"time"

"github.com/filecoin-project/boost-gfm/retrievalmarket"
rmnet "github.com/filecoin-project/boost-gfm/retrievalmarket/network"
gfm_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
storageimpl "github.com/filecoin-project/boost-gfm/storagemarket/impl"
"github.com/filecoin-project/boost-gfm/storagemarket/impl/storedask"
"github.com/filecoin-project/boost-gfm/stores"
"github.com/filecoin-project/boost/api"
Expand Down Expand Up @@ -42,6 +41,7 @@ import (
"github.com/filecoin-project/boostd-data/shared/tracing"
"github.com/filecoin-project/dagstore"
"github.com/filecoin-project/go-address"
lotus_gfm_storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-state-types/abi"
lotus_api "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
Expand Down Expand Up @@ -593,7 +593,7 @@ func ConfigBoost(cfg *config.Boost) Option {
),

// Lotus markets retrieval deal filter
Override(new(lotus_gfm_storagemarket.StorageProviderNode), modules.LotusFGMStorageProviderNode),
Override(new(lotus_gfm_storagemarket.StorageProviderNode), modules.LotusGFMStorageProviderNode),
Override(new(lotus_dtypes.RetrievalDealFilter), lotus_modules.RetrievalDealFilter(nil)),
If(cfg.LotusDealmaking.RetrievalFilter != "",
Override(new(lotus_dtypes.RetrievalDealFilter), lotus_modules.RetrievalDealFilter(lotus_dealfilter.CliRetrievalDealFilter(cfg.LotusDealmaking.RetrievalFilter))),
Expand Down
4 changes: 2 additions & 2 deletions node/impl/boost.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"

"github.com/filecoin-project/boost-gfm/retrievalmarket"
lotus_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
gfm_storagemarket "github.com/filecoin-project/boost-gfm/storagemarket"
"github.com/filecoin-project/boost/api"
"github.com/filecoin-project/boost/gql"
"github.com/filecoin-project/boost/indexprovider"
Expand Down Expand Up @@ -60,7 +60,7 @@ type BoostAPI struct {
IndexProvider *indexprovider.Wrapper

// Legacy Lotus
LegacyStorageProvider lotus_storagemarket.StorageProvider
LegacyStorageProvider gfm_storagemarket.StorageProvider

// Lotus Markets
SectorBlocks *sectorblocks.SectorBlocks
Expand Down
2 changes: 1 addition & 1 deletion node/impl/boost_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package impl
import (
"context"
"fmt"
"github.com/filecoin-project/boost/api"
"os"
"strconv"
"time"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/filecoin-project/boost-gfm/piecestore"
"github.com/filecoin-project/boost-gfm/retrievalmarket"
"github.com/filecoin-project/boost-gfm/storagemarket"
"github.com/filecoin-project/boost/api"
"github.com/filecoin-project/go-address"
datatransfer "github.com/filecoin-project/go-data-transfer"
"github.com/filecoin-project/go-state-types/abi"
Expand Down
2 changes: 1 addition & 1 deletion node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ func RetrievalProvider(
)
}

func LotusFGMStorageProviderNode(spn gfm_storagemarket.StorageProviderNode) lotus_gfm_storagemarket.StorageProviderNode {
func LotusGFMStorageProviderNode(spn gfm_storagemarket.StorageProviderNode) lotus_gfm_storagemarket.StorageProviderNode {
return &lotusGFMSPN{StorageProviderNode: spn}
}

Expand Down
90 changes: 0 additions & 90 deletions node/modules/storageminer_dagstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,93 +136,3 @@ func (l *lotusProviderPieceStore) GetCIDInfo(payloadCID cid.Cid) (lotus_gfm_piec
PieceBlockLocations: bls,
}, nil
}

//import (
// "context"
// "fmt"
// "github.com/filecoin-project/boost/node/modules/dtypes"
// "github.com/filecoin-project/dagstore"
// mdagstore "github.com/filecoin-project/lotus/markets/dagstore"
// "github.com/filecoin-project/lotus/node/config"
// "github.com/filecoin-project/lotus/node/repo"
// "github.com/libp2p/go-libp2p/core/host"
// "go.uber.org/fx"
// "golang.org/x/xerrors"
// "os"
// "path/filepath"
// "strconv"
//)
//
//const (
// EnvDAGStoreCopyConcurrency = "LOTUS_DAGSTORE_COPY_CONCURRENCY"
// DefaultDAGStoreDir = "dagstore"
//)
//
//// NewMinerAPI creates a new MinerAPI adaptor for the dagstore mounts.
//func NewMinerAPI(cfg config.DAGStoreConfig) func(fx.Lifecycle, repo.LockedRepo, dtypes.ProviderPieceStore, mdagstore.SectorAccessor) (mdagstore.MinerAPI, error) {
// return func(lc fx.Lifecycle, r repo.LockedRepo, pieceStore dtypes.ProviderPieceStore, sa mdagstore.SectorAccessor) (mdagstore.MinerAPI, error) {
// // caps the amount of concurrent calls to the storage, so that we don't
// // spam it during heavy processes like bulk migration.
// if v, ok := os.LookupEnv("LOTUS_DAGSTORE_MOUNT_CONCURRENCY"); ok {
// concurrency, err := strconv.Atoi(v)
// if err == nil {
// cfg.MaxConcurrencyStorageCalls = concurrency
// }
// }
//
// mountApi := mdagstore.NewMinerAPI(pieceStore, sa, cfg.MaxConcurrencyStorageCalls, cfg.MaxConcurrentUnseals)
// ready := make(chan error, 1)
// pieceStore.OnReady(func(err error) {
// ready <- err
// })
// lc.Append(fx.Hook{
// OnStart: func(ctx context.Context) error {
// if err := <-ready; err != nil {
// return fmt.Errorf("aborting dagstore start; piecestore failed to start: %s", err)
// }
// return mountApi.Start(ctx)
// },
// OnStop: func(context.Context) error {
// return nil
// },
// })
//
// return mountApi, nil
// }
//}
//
//// DAGStore constructs a DAG store using the supplied minerAPI, and the
//// user configuration. It returns both the DAGStore and the Wrapper suitable for
//// passing to markets.
//func DAGStore(cfg config.DAGStoreConfig) func(lc fx.Lifecycle, r repo.LockedRepo, minerAPI mdagstore.MinerAPI, h host.Host) (*dagstore.DAGStore, *mdagstore.Wrapper, error) {
// return func(lc fx.Lifecycle, r repo.LockedRepo, minerAPI mdagstore.MinerAPI, h host.Host) (*dagstore.DAGStore, *mdagstore.Wrapper, error) {
// // fall back to default root directory if not explicitly set in the config.
// if cfg.RootDir == "" {
// cfg.RootDir = filepath.Join(r.Path(), DefaultDAGStoreDir)
// }
//
// v, ok := os.LookupEnv(EnvDAGStoreCopyConcurrency)
// if ok {
// concurrency, err := strconv.Atoi(v)
// if err == nil {
// cfg.MaxConcurrentReadyFetches = concurrency
// }
// }
//
// dagst, w, err := mdagstore.NewDAGStore(cfg, minerAPI, h)
// if err != nil {
// return nil, nil, xerrors.Errorf("failed to create DAG store: %w", err)
// }
//
// lc.Append(fx.Hook{
// OnStart: func(ctx context.Context) error {
// return w.Start(ctx)
// },
// OnStop: func(context.Context) error {
// return w.Close()
// },
// })
//
// return dagst, w, nil
// }
//}
2 changes: 1 addition & 1 deletion storagemarket/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"database/sql"
"errors"
"fmt"
"github.com/filecoin-project/dagstore"
"io"
"os"
"sync"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/filecoin-project/boost/storagemarket/types/dealcheckpoints"
"github.com/filecoin-project/boost/transport"
"github.com/filecoin-project/boostd-data/shared/tracing"
"github.com/filecoin-project/dagstore"
"github.com/filecoin-project/go-address"
lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v1api"
Expand Down

0 comments on commit 0f98dd8

Please sign in to comment.