@@ -21,6 +21,156 @@ ConfigVersion = 2
2121MyNewKey = "Hello"
2222`
2323
24+ const testConfig = `
25+ ConfigVersion = 4
26+ SealerApiInfo = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.0LyVxqOde8UjLTcHPEo3VEBILtPQqCDNEHcoCbTRQ_Y:/ip4/127.0.0.1/tcp/2345/http"
27+ SectorIndexApiInfo = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.0LyVxqOde8UjLTcHPEo3VEBILtPQqCDNEHcoCbTRQ_Y:/ip4/127.0.0.1/tcp/2345/http"
28+
29+ [API]
30+ ListenAddress = "/ip4/127.0.0.1/tcp/1288/http"
31+ RemoteListenAddress = ""
32+ Timeout = "30s"
33+
34+ [Backup]
35+ DisableMetadataLog = false
36+
37+ [Libp2p]
38+ ListenAddresses = ["/ip4/0.0.0.1/tcp/50000", "/ip6/::/tcp/0"]
39+ AnnounceAddresses = []
40+ NoAnnounceAddresses = []
41+ DisableNatPortMap = false
42+ ConnMgrLow = 150
43+ ConnMgrHigh = 180
44+ ConnMgrGrace = "20s"
45+
46+ [Pubsub]
47+ Bootstrapper = false
48+ RemoteTracer = ""
49+ JsonTracer = ""
50+ ElasticSearchTracer = ""
51+ ElasticSearchIndex = ""
52+ TracerSourceAuth = ""
53+
54+ [Storage]
55+ ParallelFetchLimit = 10
56+ StorageListRefreshDuration = "1h0m0s"
57+ RedeclareOnStorageListRefresh = true
58+
59+ [Dealmaking]
60+ ConsiderOnlineStorageDeals = true
61+ ConsiderOfflineStorageDeals = true
62+ ConsiderOnlineRetrievalDeals = true
63+ ConsiderOfflineRetrievalDeals = true
64+ ConsiderVerifiedStorageDeals = true
65+ ConsiderUnverifiedStorageDeals = true
66+ PieceCidBlocklist = []
67+ ExpectedSealDuration = "24h0m0s"
68+ MaxDealStartDelay = "336h0m0s"
69+ MaxProviderCollateralMultiplier = 2
70+ MaxStagingDealsBytes = 2000000000
71+ MaxStagingDealsPercentPerHost = 0
72+ StartEpochSealingBuffer = 480
73+ DealProposalLogDuration = "24h0m0s"
74+ RetrievalLogDuration = "24h0m0s"
75+ StalledRetrievalTimeout = "30s"
76+ Filter = ""
77+ RetrievalFilter = ""
78+ BlockstoreCacheMaxShards = 20
79+ BlockstoreCacheExpiry = "30s"
80+ IsUnsealedCacheExpiry = "5m0s"
81+ MaxTransferDuration = "24h0m0s"
82+ RemoteCommp = false
83+ MaxConcurrentLocalCommp = 1
84+ HTTPRetrievalMultiaddr = ""
85+ HttpTransferMaxConcurrentDownloads = 20
86+ HttpTransferStallCheckPeriod = "30s"
87+ HttpTransferStallTimeout = "5m0s"
88+ BitswapPeerID = ""
89+ BitswapPrivKeyFile = ""
90+ DealLogDurationDays = 30
91+ SealingPipelineCacheTimeout = "30s"
92+ FundsTaggingEnabled = true
93+ [Dealmaking.RetrievalPricing]
94+ Strategy = "default"
95+ [Dealmaking.RetrievalPricing.Default]
96+ VerifiedDealsFreeTransfer = false
97+ [Dealmaking.RetrievalPricing.External]
98+ Path = ""
99+
100+ [Wallets]
101+ Miner = "t01000"
102+ PublishStorageDeals = "t3rjh3byfhhrlmdl6ofou544rmwuazp4bbqzuleahtn66ejnh73bsaonwyg54qrokvnbv5bmg37dfd5vu2bx4q"
103+ DealCollateral = "t3qa5i54vprhl7gmdfgriubvjc5kdffx7cvbqvumopgvsy2osre5dcjdjhz5coruxp4co3chj3gbtxin7vtoia"
104+ PledgeCollateral = ""
105+
106+ [Graphql]
107+ ListenAddress = "0.0.0.0"
108+ Port = 8080
109+
110+ [Tracing]
111+ Enabled = false
112+ ServiceName = "boostd"
113+ Endpoint = ""
114+
115+ [ContractDeals]
116+ Enabled = false
117+ AllowlistContracts = []
118+ From = "0x0000000000000000000000000000000000000000"
119+
120+ [LotusDealmaking]
121+ ConsiderOnlineStorageDeals = true
122+ ConsiderOfflineStorageDeals = true
123+ ConsiderOnlineRetrievalDeals = true
124+ ConsiderOfflineRetrievalDeals = true
125+ ConsiderVerifiedStorageDeals = true
126+ ConsiderUnverifiedStorageDeals = true
127+ PieceCidBlocklist = []
128+ ExpectedSealDuration = "24h0m0s"
129+ MaxDealStartDelay = "336h0m0s"
130+ PublishMsgPeriod = "1h0m0s"
131+ MaxDealsPerPublishMsg = 8
132+ MaxProviderCollateralMultiplier = 2
133+ MaxStagingDealsBytes = 0
134+ SimultaneousTransfersForStorage = 20
135+ SimultaneousTransfersForStoragePerClient = 0
136+ SimultaneousTransfersForRetrieval = 20
137+ StartEpochSealingBuffer = 480
138+ Filter = ""
139+ RetrievalFilter = ""
140+ [LotusDealmaking.RetrievalPricing]
141+ Strategy = "default"
142+ [LotusDealmaking.RetrievalPricing.Default]
143+ VerifiedDealsFreeTransfer = true
144+ [LotusDealmaking.RetrievalPricing.External]
145+ Path = ""
146+
147+ [LotusFees]
148+ MaxPublishDealsFee = "0.05 FIL"
149+ MaxMarketBalanceAddFee = "0.007 FIL"
150+
151+ [DAGStore]
152+ RootDir = ""
153+ MaxConcurrentIndex = 5
154+ MaxConcurrentReadyFetches = 0
155+ MaxConcurrentUnseals = 0
156+ MaxConcurrencyStorageCalls = 100
157+ GCInterval = "1m0s"
158+
159+ [IndexProvider]
160+ Enable = true
161+ EntriesCacheCapacity = 1024
162+ EntriesChunkSize = 16384
163+ TopicName = ""
164+ PurgeCacheOnStart = false
165+ [IndexProvider.Announce]
166+ AnnounceOverHttp = false
167+ DirectAnnounceURLs = ["https://cid.contact/ingest/announce", "http://localhost:3000"]
168+ [IndexProvider.HttpPublisher]
169+ Enabled = false
170+ PublicHostname = ""
171+ Port = 3104
172+ `
173+
24174func TestMigrate (t * testing.T ) {
25175 // Add a new mock migration so as to be able to test migrating up and down
26176 mockv1Tov2 := func (string ) (string , error ) {
@@ -101,3 +251,22 @@ func TestMigrate(t *testing.T) {
101251 require .NoError (t , err )
102252 require .Equal (t , v1FileContents , string (bz ))
103253}
254+
255+ func TestConfigDiff (t * testing.T ) {
256+ repoDir := t .TempDir ()
257+ err := os .WriteFile (path .Join (repoDir , "config.toml" ), []byte (testConfig ), 0644 )
258+ require .NoError (t , err )
259+
260+ cgf , err := FromFile (path .Join (repoDir , "config.toml" ), DefaultBoost ())
261+ require .NoError (t , err )
262+
263+ s , err := ConfigUpdate (cgf , DefaultBoost (), false , true )
264+ require .NoError (t , err )
265+
266+ require .False (t , strings .Contains (string (s ), `The connect string for the sealing RPC API` ))
267+
268+ s , err = ConfigUpdate (cgf , DefaultBoost (), true , true )
269+ require .NoError (t , err )
270+
271+ require .True (t , strings .Contains (string (s ), `The connect string for the sealing RPC API` ))
272+ }
0 commit comments