Skip to content

Commit a84e4ff

Browse files
committed
undo config
1 parent 5fe99f8 commit a84e4ff

File tree

14 files changed

+2
-122
lines changed

14 files changed

+2
-122
lines changed

gql/resolver_ipni.go

-4
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,3 @@ func (r *resolver) IpniDistanceFromLatestAd(ctx context.Context, args struct {
229229

230230
return count, nil
231231
}
232-
233-
func (r *resolver) IpniRemovedAllAdsStatus(ctx context.Context) (bool, error) {
234-
return r.idxProvWrapper.RemoveAllStatus(ctx), nil
235-
}

gql/schema.graphql

-3
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,6 @@ type RootQuery {
652652

653653
"""Get the latest IPNI advertisemen"""
654654
ipniDistanceFromLatestAd(LatestAdcid: String!, Adcid: String!): Int!
655-
656-
"""Get the IPNI Remove All Status"""
657-
ipniRemovedAllAdsStatus: Boolean!
658655
}
659656

660657
type RootMutation {

indexprovider/wrapper.go

+1-34
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"net/url"
99
"os"
10-
"time"
1110

1211
"github.com/filecoin-project/boost/lib/legacy"
1312
"github.com/filecoin-project/boost/storagemarket/types/legacytypes"
@@ -72,7 +71,6 @@ type Wrapper struct {
7271
bitswapEnabled bool
7372
httpEnabled bool
7473
stop context.CancelFunc
75-
removeAllAds bool
7674
}
7775

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

130128
log.Info("starting index provider")
131129

132-
if w.cfg.CurioMigration.Enable {
133-
go w.tryAnnounceRemoveAll(runCtx)
134-
} else {
135-
go w.checkForUpdates(runCtx)
136-
}
130+
go w.checkForUpdates(runCtx)
137131
}
138132

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

924918
}
925-
926-
func (w *Wrapper) tryAnnounceRemoveAll(ctx context.Context) {
927-
ticker := time.NewTicker(time.Minute)
928-
929-
for {
930-
select {
931-
case <-ticker.C:
932-
out, err := w.AnnounceRemoveAll(ctx)
933-
if err != nil {
934-
log.Errorw("error while announcing remove all", "err", err)
935-
continue
936-
}
937-
if len(out) > 0 {
938-
continue
939-
}
940-
log.Debugw("Cleaned up all the IPNI ads")
941-
w.removeAllAds = true
942-
return
943-
case <-ctx.Done():
944-
return
945-
}
946-
}
947-
}
948-
949-
func (w *Wrapper) RemoveAllStatus(ctx context.Context) bool {
950-
return w.removeAllAds
951-
}

node/config/def.go

-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ func DefaultBoost() *Boost {
170170
MaxDealsPerPublishMsg: 8,
171171
MaxPublishDealsFee: types.MustParseFIL("0.05"),
172172
},
173-
CurioMigration: CurioMigration{
174-
Enable: false,
175-
},
176173
}
177174
return cfg
178175
}

node/config/doc_gen.go

-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/config/migrate.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var log = logging.Logger("cfg")
1515

1616
// CurrentVersion is the config version expected by Boost.
1717
// We need to migrate the config file to this version.
18-
const CurrentVersion = 7
18+
const CurrentVersion = 6
1919

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

@@ -26,7 +26,6 @@ var migrations = []migrateUpFn{
2626
v3Tov4, // index 3 => version 4
2727
v4Tov5, // index 4 => version 5
2828
v5Tov6, // index 5 => version 6
29-
v6Tov7, // index 6 => version 7
3029
}
3130

3231
// This struct is used to get the config file version

node/config/types.go

-6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ type Boost struct {
5151
HttpDownload HttpDownloadConfig
5252
Retrievals RetrievalConfig
5353
IndexProvider IndexProviderConfig
54-
CurioMigration CurioMigration
5554
}
5655

5756
type WalletsConfig struct {
@@ -400,8 +399,3 @@ type DealPublishConfig struct {
400399
// The maximum fee to pay when sending the PublishStorageDeals message
401400
MaxPublishDealsFee types.FIL
402401
}
403-
404-
type CurioMigration struct {
405-
// Enable limits the Boost functionality to prepare for the migration
406-
Enable bool
407-
}

node/config/v6_to_v7.go

-28
This file was deleted.

node/modules/directdeals.go

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func NewDirectDealsProvider(provAddr address.Address, cfg *config.Boost) func(lc
3434
ddpCfg := storagemarket.DDPConfig{
3535
StartEpochSealingBuffer: abi.ChainEpoch(cfg.Dealmaking.StartEpochSealingBuffer),
3636
RemoteCommp: cfg.Dealmaking.RemoteCommp,
37-
CurioMigration: cfg.CurioMigration.Enable,
3837
}
3938

4039
prov := storagemarket.NewDirectDealsProvider(ddpCfg, provAddr, fullnodeApi, secb, commpc, commpt, sps, directDealsDB, dl, piecedirectory, ip)

node/modules/storageminer.go

-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ func NewStorageMarketProvider(provAddr address.Address, cfg *config.Boost) func(
486486
DealLogDurationDays: cfg.Dealmaking.DealLogDurationDays,
487487
StorageFilter: cfg.Dealmaking.Filter,
488488
SealingPipelineCacheTimeout: time.Duration(cfg.Dealmaking.SealingPipelineCacheTimeout),
489-
CurioMigration: cfg.CurioMigration.Enable,
490489
}
491490
dl := logs.NewDealLogger(logsDB)
492491
tspt := httptransport.New(h, dl, httptransport.NChunksOpt(cfg.HttpDownload.NChunks), httptransport.AllowPrivateIPsOpt(cfg.HttpDownload.AllowPrivateIPs))

react/src/Ipni.js

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
IpniProviderInfoQuery,
77
IpniLatestAdQuery,
88
IpniDistanceFromLatestAdQuery,
9-
IpniRemovedAllAdsStatus,
109
} from "./gql";
1110
import moment from "moment";
1211
import React, {useEffect, useState} from "react";
@@ -90,7 +89,6 @@ function ProviderIpniInfoRender(props){
9089
adcid: adCid
9190
}
9291
})
93-
const publishedRemoveAll = useQuery(IpniRemovedAllAdsStatus)
9492
return <div className="ipni-prov-info">
9593
<h3>Provider Indexer Info</h3>
9694
<div className="subtitle">
@@ -131,12 +129,6 @@ function ProviderIpniInfoRender(props){
131129
<span className="aux">({moment(data.LastErrorTime).fromNow()} ago)</span>
132130
</td>
133131
</tr>
134-
<tr>
135-
<th>Published Removal Ads for Curio Migration</th>
136-
<td>
137-
{publishedRemoveAll.data ? publishedRemoveAll.data: ''}
138-
</td>
139-
</tr>
140132
</tbody>
141133
</table>
142134
</div>

react/src/gql.js

-7
Original file line numberDiff line numberDiff line change
@@ -880,12 +880,6 @@ const IpniDistanceFromLatestAdQuery = gql`
880880
}
881881
`;
882882

883-
const IpniRemovedAllAdsStatus = gql`
884-
query AppIpniRemovedAllAdsStatusQuery{
885-
ipniRemovedAllAdsStatus
886-
}
887-
`;
888-
889883
export {
890884
gqlClient,
891885
EpochQuery,
@@ -937,5 +931,4 @@ export {
937931
StorageAskQuery,
938932
PublishPendingDealsMutation,
939933
PiecePayloadCidsQuery,
940-
IpniRemovedAllAdsStatus,
941934
}

storagemarket/direct_deals_provider.go

-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ type DDPConfig struct {
4444
// Minimum start epoch buffer to give time for sealing of sector with deal
4545
StartEpochSealingBuffer abi.ChainEpoch
4646
Curio bool
47-
CurioMigration bool
4847
}
4948

5049
type DirectDealsProvider struct {
@@ -198,9 +197,6 @@ func (ddp *DirectDealsProvider) Accept(ctx context.Context, entry *types.DirectD
198197
}
199198

200199
func (ddp *DirectDealsProvider) Import(ctx context.Context, params smtypes.DirectDealParams) (*api.ProviderDealRejectionInfo, error) {
201-
if ddp.config.CurioMigration {
202-
return &api.ProviderDealRejectionInfo{Reason: "Boost is migrating to Curio"}, nil
203-
}
204200
piececid := params.PieceCid.String()
205201
clientAddr := params.ClientAddr.String()
206202
log.Infow("received direct data import", "piececid", piececid, "filepath", params.FilePath, "clientAddr", clientAddr, "allocationId", params.AllocationID)

storagemarket/provider.go

-7
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ type Config struct {
8484
SealingPipelineCacheTimeout time.Duration
8585
StorageFilter string
8686
Curio bool
87-
CurioMigration bool
8887
}
8988

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

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

0 commit comments

Comments
 (0)