Skip to content

Commit

Permalink
undo config
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Oct 5, 2024
1 parent 2ac458f commit abb7d7e
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 122 deletions.
4 changes: 0 additions & 4 deletions gql/resolver_ipni.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,3 @@ func (r *resolver) IpniDistanceFromLatestAd(ctx context.Context, args struct {

return count, nil
}

func (r *resolver) IpniRemovedAllAdsStatus(ctx context.Context) (bool, error) {
return r.idxProvWrapper.RemoveAllStatus(ctx), nil
}
3 changes: 0 additions & 3 deletions gql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,6 @@ type RootQuery {

"""Get the latest IPNI advertisemen"""
ipniDistanceFromLatestAd(LatestAdcid: String!, Adcid: String!): Int!

"""Get the IPNI Remove All Status"""
ipniRemovedAllAdsStatus: Boolean!
}

type RootMutation {
Expand Down
35 changes: 1 addition & 34 deletions indexprovider/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"net/url"
"os"
"time"

"github.com/filecoin-project/boost/lib/legacy"
"github.com/filecoin-project/boost/storagemarket/types/legacytypes"
Expand Down Expand Up @@ -72,7 +71,6 @@ type Wrapper struct {
bitswapEnabled bool
httpEnabled bool
stop context.CancelFunc
removeAllAds bool
}

func NewWrapper(provAddr address.Address, cfg *config.Boost) func(lc fx.Lifecycle, h host.Host, r repo.LockedRepo, directDealsDB *db.DirectDealsDB, dealsDB *db.DealsDB,
Expand Down Expand Up @@ -129,11 +127,7 @@ func (w *Wrapper) Start(_ context.Context) {

log.Info("starting index provider")

if w.cfg.CurioMigration.Enable {
go w.tryAnnounceRemoveAll(runCtx)
} else {
go w.checkForUpdates(runCtx)
}
go w.checkForUpdates(runCtx)
}

func (w *Wrapper) checkForUpdates(ctx context.Context) {
Expand Down Expand Up @@ -922,30 +916,3 @@ func (w *Wrapper) AnnounceRemoveAll(ctx context.Context) ([]cid.Cid, error) {
return newAds, nil

}

func (w *Wrapper) tryAnnounceRemoveAll(ctx context.Context) {
ticker := time.NewTicker(time.Minute)

for {
select {
case <-ticker.C:
out, err := w.AnnounceRemoveAll(ctx)
if err != nil {
log.Errorw("error while announcing remove all", "err", err)
continue
}
if len(out) > 0 {
continue
}
log.Debugw("Cleaned up all the IPNI ads")
w.removeAllAds = true
return
case <-ctx.Done():
return
}
}
}

func (w *Wrapper) RemoveAllStatus(ctx context.Context) bool {
return w.removeAllAds
}
3 changes: 0 additions & 3 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ func DefaultBoost() *Boost {
MaxDealsPerPublishMsg: 8,
MaxPublishDealsFee: types.MustParseFIL("0.05"),
},
CurioMigration: CurioMigration{
Enable: false,
},
}
return cfg
}
Expand Down
14 changes: 0 additions & 14 deletions node/config/doc_gen.go

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

3 changes: 1 addition & 2 deletions node/config/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var log = logging.Logger("cfg")

// CurrentVersion is the config version expected by Boost.
// We need to migrate the config file to this version.
const CurrentVersion = 7
const CurrentVersion = 6

type migrateUpFn = func(cfgPath string) (string, error)

Expand All @@ -26,7 +26,6 @@ var migrations = []migrateUpFn{
v3Tov4, // index 3 => version 4
v4Tov5, // index 4 => version 5
v5Tov6, // index 5 => version 6
v6Tov7, // index 6 => version 7
}

// This struct is used to get the config file version
Expand Down
6 changes: 0 additions & 6 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ type Boost struct {
HttpDownload HttpDownloadConfig
Retrievals RetrievalConfig
IndexProvider IndexProviderConfig
CurioMigration CurioMigration
}

type WalletsConfig struct {
Expand Down Expand Up @@ -400,8 +399,3 @@ type DealPublishConfig struct {
// The maximum fee to pay when sending the PublishStorageDeals message
MaxPublishDealsFee types.FIL
}

type CurioMigration struct {
// Enable limits the Boost functionality to prepare for the migration
Enable bool
}
28 changes: 0 additions & 28 deletions node/config/v6_to_v7.go

This file was deleted.

1 change: 0 additions & 1 deletion node/modules/directdeals.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func NewDirectDealsProvider(provAddr address.Address, cfg *config.Boost) func(lc
ddpCfg := storagemarket.DDPConfig{
StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer),
RemoteCommp: cfg.Dealmaking.RemoteCommp,
CurioMigration: cfg.CurioMigration.Enable,
}

prov := storagemarket.NewDirectDealsProvider(ddpCfg, provAddr, fullnodeApi, secb, commpc, commpt, sps, directDealsDB, dl, piecedirectory, ip)
Expand Down
1 change: 0 additions & 1 deletion node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ func NewStorageMarketProvider(provAddr address.Address, cfg *config.Boost) func(
DealLogDurationDays: cfg.Dealmaking.DealLogDurationDays,
StorageFilter: cfg.Dealmaking.Filter,
SealingPipelineCacheTimeout: time.Duration(cfg.Dealmaking.SealingPipelineCacheTimeout),
CurioMigration: cfg.CurioMigration.Enable,
}
dl := logs.NewDealLogger(logsDB)
tspt := httptransport.New(h, dl, httptransport.NChunksOpt(cfg.HttpDownload.NChunks), httptransport.AllowPrivateIPsOpt(cfg.HttpDownload.AllowPrivateIPs))
Expand Down
8 changes: 0 additions & 8 deletions react/src/Ipni.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
IpniProviderInfoQuery,
IpniLatestAdQuery,
IpniDistanceFromLatestAdQuery,
IpniRemovedAllAdsStatus,
} from "./gql";
import moment from "moment";
import React, {useEffect, useState} from "react";
Expand Down Expand Up @@ -90,7 +89,6 @@ function ProviderIpniInfoRender(props){
adcid: adCid
}
})
const publishedRemoveAll = useQuery(IpniRemovedAllAdsStatus)
return <div className="ipni-prov-info">
<h3>Provider Indexer Info</h3>
<div className="subtitle">
Expand Down Expand Up @@ -131,12 +129,6 @@ function ProviderIpniInfoRender(props){
<span className="aux">({moment(data.LastErrorTime).fromNow()} ago)</span>
</td>
</tr>
<tr>
<th>Published Removal Ads for Curio Migration</th>
<td>
{publishedRemoveAll.data ? publishedRemoveAll.data: ''}
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
7 changes: 0 additions & 7 deletions react/src/gql.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,12 +880,6 @@ const IpniDistanceFromLatestAdQuery = gql`
}
`;

const IpniRemovedAllAdsStatus = gql`
query AppIpniRemovedAllAdsStatusQuery{
ipniRemovedAllAdsStatus
}
`;

export {
gqlClient,
EpochQuery,
Expand Down Expand Up @@ -937,5 +931,4 @@ export {
StorageAskQuery,
PublishPendingDealsMutation,
PiecePayloadCidsQuery,
IpniRemovedAllAdsStatus,
}
4 changes: 0 additions & 4 deletions storagemarket/direct_deals_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type DDPConfig struct {
// Minimum start epoch buffer to give time for sealing of sector with deal
StartEpochSealingBuffer abi.ChainEpoch
Curio bool
CurioMigration bool
}

type DirectDealsProvider struct {
Expand Down Expand Up @@ -182,9 +181,6 @@ func (ddp *DirectDealsProvider) Accept(ctx context.Context, entry *types.DirectD
}

func (ddp *DirectDealsProvider) Import(ctx context.Context, params smtypes.DirectDealParams) (*api.ProviderDealRejectionInfo, error) {
if ddp.config.CurioMigration {
return &api.ProviderDealRejectionInfo{Reason: "Boost is migrating to Curio"}, nil
}
piececid := params.PieceCid.String()
clientAddr := params.ClientAddr.String()
log.Infow("received direct data import", "piececid", piececid, "filepath", params.FilePath, "clientAddr", clientAddr, "allocationId", params.AllocationID)
Expand Down
7 changes: 0 additions & 7 deletions storagemarket/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ type Config struct {
SealingPipelineCacheTimeout time.Duration
StorageFilter string
Curio bool
CurioMigration bool
}

var log = logging.Logger("boost-provider")
Expand Down Expand Up @@ -251,9 +250,6 @@ func (p *Provider) GetAsk() *legacytypes.SignedStorageAsk {
// an offline deal (the deal must already have been proposed by the client)
func (p *Provider) ImportOfflineDealData(ctx context.Context, dealUuid uuid.UUID, filePath string, delAfterImport bool) (pi *api.ProviderDealRejectionInfo, err error) {
p.dealLogger.Infow(dealUuid, "import data for offline deal", "filepath", filePath, "delete after import", delAfterImport)
if p.config.CurioMigration {
return &api.ProviderDealRejectionInfo{Reason: "Boost is migrating to Curio"}, nil
}

// db should already have a deal with this uuid as the deal proposal should have been made beforehand
ds, err := p.dealsDB.ByID(p.ctx, dealUuid)
Expand Down Expand Up @@ -297,9 +293,6 @@ func (p *Provider) ImportOfflineDealData(ctx context.Context, dealUuid uuid.UUID
// ExecuteDeal is called when the Storage Provider receives a deal proposal
// from the network
func (p *Provider) ExecuteDeal(ctx context.Context, dp *types.DealParams, clientPeer peer.ID) (*api.ProviderDealRejectionInfo, error) {
if p.config.CurioMigration {
return &api.ProviderDealRejectionInfo{Reason: "Boost is migrating to Curio"}, nil
}
ctx, span := tracing.Tracer.Start(ctx, "Provider.ExecuteLibp2pDeal")
defer span.End()

Expand Down

0 comments on commit abb7d7e

Please sign in to comment.