-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathtypes.go
More file actions
1098 lines (902 loc) · 51 KB
/
Copy pathtypes.go
File metadata and controls
1098 lines (902 loc) · 51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package config
import (
"net/http"
"time"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/chain/types"
)
func DefaultCurioConfig() *CurioConfig {
return &CurioConfig{
Subsystems: CurioSubsystemsConfig{
GuiAddress: "0.0.0.0:4701",
RequireActivationSuccess: true,
RequireNotificationSuccess: true,
PDPPullPieceMaxTasks: 20,
PDPUnclaimedUploadKeepHours: NewDynamic(2),
IndexingMaxTasks: 8,
RemoteProofMaxUploads: 15,
ParkPieceMinFreeStoragePercent: 5,
},
Fees: CurioFees{
MaxPreCommitBatchGasFee: BatchFeeConfig{
Base: types.MustParseFIL("0"),
PerSector: types.MustParseFIL("0.02"),
},
MaxCommitBatchGasFee: BatchFeeConfig{
Base: types.MustParseFIL("0"),
PerSector: types.MustParseFIL("0.03"), // enough for 6 agg and 1nFIL base fee
},
MaxUpdateBatchGasFee: BatchFeeConfig{
Base: types.MustParseFIL("0"),
PerSector: types.MustParseFIL("0.03"),
},
MaxWindowPoStGasFee: types.MustParseFIL("5"),
CollateralFromMinerBalance: false,
DisableCollateralFallback: false,
MaximizeFeeCap: true,
},
Addresses: NewDynamic([]CurioAddresses{{
PreCommitControl: []string{},
CommitControl: []string{},
DealPublishControl: []string{},
TerminateControl: []string{},
MinerAddresses: []string{},
BalanceManager: DefaultBalanceManager(),
}}),
Proving: CurioProvingConfig{
ParallelCheckLimit: 32,
PartitionCheckTimeout: 20 * time.Minute,
SingleCheckTimeout: 10 * time.Minute,
},
Seal: CurioSealConfig{
BatchSealPipelines: 2,
BatchSealBatchSize: 32,
BatchSealSectorSize: "32GiB",
},
Ingest: CurioIngestConfig{
MaxMarketRunningPipelines: NewDynamic(64),
MaxQueueDownload: NewDynamic(8),
MaxQueueCommP: NewDynamic(8),
MaxQueueDealSector: NewDynamic(8), // default to 8 sectors open(or in process of opening) for deals
MaxQueueSDR: NewDynamic(8), // default to 8 (will cause backpressure even if deal sectors are 0)
MaxQueueTrees: NewDynamic(0), // default don't use this limit
MaxQueuePoRep: NewDynamic(0), // default don't use this limit
MaxQueueSnapEncode: NewDynamic(16),
MaxQueueSnapProve: NewDynamic(0),
MaxDealWaitTime: NewDynamic(time.Hour),
DisableSSRFProtection: NewDynamic(false),
SSRFAllowedHosts: NewDynamic([]string{}),
},
Alerting: CurioAlertingConfig{
MinimumWalletBalance: types.MustParseFIL("5"),
PagerDuty: PagerDutyConfig{
PagerDutyEventURL: "https://events.pagerduty.com/v2/enqueue",
},
PrometheusAlertManager: PrometheusAlertManagerConfig{
AlertManagerURL: "http://localhost:9093/api/v2/alerts",
},
},
Batching: CurioBatchingConfig{
PreCommit: PreCommitBatchingConfig{
BaseFeeThreshold: types.MustParseFIL("0.005"),
Timeout: 4 * time.Hour,
Slack: 6 * time.Hour,
},
Commit: CommitBatchingConfig{
BaseFeeThreshold: types.MustParseFIL("0.005"),
Timeout: time.Hour,
Slack: time.Hour,
},
Update: UpdateBatchingConfig{
BaseFeeThreshold: types.MustParseFIL("0.005"),
Timeout: time.Hour,
Slack: time.Hour,
},
},
Market: MarketConfig{
StorageMarketConfig: StorageMarketConfig{
PieceLocator: []PieceLocatorConfig{},
Indexing: IndexingConfig{
InsertConcurrency: 10,
InsertBatchSize: 1000,
},
MK12: MK12Config{
PublishMsgPeriod: 5 * time.Minute,
MaxDealsPerPublishMsg: 8,
MaxPublishDealFee: types.MustParseFIL("0.5 FIL"),
ExpectedPoRepSealDuration: 8 * time.Hour,
ExpectedSnapSealDuration: 2 * time.Hour,
CIDGravityTokens: []string{},
},
MK20: MK20Config{
ExpectedPoRepSealDuration: 8 * time.Hour,
ExpectedSnapSealDuration: 2 * time.Hour,
MaxParallelChunkUploads: 512,
MinimumChunkSize: 16 * 1024 * 1024, // 16 MiB
MaximumChunkSize: 256 * 1024 * 1024, // 256 MiB
},
IPNI: IPNIConfig{
ServiceURL: []string{"https://cid.contact", "https://filecoinpin.contact"},
DirectAnnounceURLs: []string{"https://cid.contact/ingest/announce", "https://filecoinpin.contact/announce"},
},
},
},
Cuzk: CuzkConfig{
MaxPending: 10,
ProveTimeout: 30 * time.Minute,
},
HTTP: HTTPConfig{
DomainName: "",
ListenAddress: "0.0.0.0:12310",
ReadTimeout: time.Minute * 30,
IdleTimeout: time.Minute * 30,
ReadHeaderTimeout: time.Second * 5,
CORSOrigins: []string{},
CSP: "inline",
CompressionLevels: CompressionConfig{
GzipLevel: 6,
BrotliLevel: 4,
DeflateLevel: 6,
},
DenylistServers: NewDynamic([]string{"https://badbits.dwebops.pub/denylist.json"}),
},
}
}
func DefaultBalanceManager() BalanceManagerConfig {
return BalanceManagerConfig{
MK12Collateral: MK12CollateralConfig{
DealCollateralWallet: "",
CollateralLowThreshold: types.MustParseFIL("5 FIL"),
CollateralHighThreshold: types.MustParseFIL("20 FIL"),
},
}
}
// CurioConfig defines configuration for the Curio node
type CurioConfig struct {
// Subsystems defines configuration settings for various subsystems within the Curio node.
Subsystems CurioSubsystemsConfig
// Fees holds the fee-related configuration parameters for various operations in the Curio node.
Fees CurioFees
// Addresses specifies the list of miner addresses and their related wallet addresses.
Addresses *Dynamic[[]CurioAddresses]
// Proving defines the configuration settings related to proving functionality within the Curio node.
Proving CurioProvingConfig
// HTTP represents the configuration for the HTTP server settings in the Curio node.
HTTP HTTPConfig
// Market specifies configuration options for the Market subsystem within the Curio node.
Market MarketConfig
// Ingest defines configuration parameters for handling and limiting deal ingestion pipelines within the Curio node.
Ingest CurioIngestConfig
// Seal defines the configuration related to the sealing process in Curio.
Seal CurioSealConfig
// Apis defines the configuration for API-related settings in the Curio system.
Apis ApisConfig
// Alerting specifies configuration settings for alerting mechanisms, including thresholds and external integrations.
Alerting CurioAlertingConfig
// Batching represents the batching configuration for pre-commit, commit, and update operations.
Batching CurioBatchingConfig
// Cuzk configures integration with the cuzk proving daemon.
// When enabled, SNARK proving tasks (PoRep C2, SnapDeals prove, and PSProve) are delegated
// to an external cuzk daemon over gRPC instead of using local GPU resources.
Cuzk CuzkConfig
}
type BatchFeeConfig struct {
// Accepts a decimal string (e.g., "123.45") with optional "fil" or "attofil" suffix.
Base types.FIL
// Accepts a decimal string (e.g., "123.45") with optional "fil" or "attofil" suffix.
PerSector types.FIL
}
func (b *BatchFeeConfig) FeeForSectors(nSectors int) abi.TokenAmount {
return big.Add(big.Int(b.Base), big.Mul(big.NewInt(int64(nSectors)), big.Int(b.PerSector)))
}
type CurioSubsystemsConfig struct {
// EnableWindowPost enables window post to be executed on this curio instance. Each machine in the cluster
// with WindowPoSt enabled will also participate in the window post scheduler. It is possible to have multiple
// machines with WindowPoSt enabled which will provide redundancy, and in case of multiple partitions per deadline,
// will allow for parallel processing of partitions.
//
// It is possible to have instances handling both WindowPoSt and WinningPoSt, which can provide redundancy without
// the need for additional machines. In setups like this it is generally recommended to run
// partitionsPerDeadline+1 machines. (Default: false)
EnableWindowPost bool
// The maximum amount of WindowPostMaxTasks tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. We do not recommend setting this value and let system resources determine
// the maximum tasks (Default: 0 - unlimited)
WindowPostMaxTasks int
// EnableWinningPost enables winning post to be executed on this curio instance.
// Each machine in the cluster with WinningPoSt enabled will also participate in the winning post scheduler.
// It is possible to mix machines with WindowPoSt and WinningPoSt enabled, for details see the EnableWindowPost
// documentation. (Default: false)
EnableWinningPost bool
// The maximum amount of WinningPostMaxTasks tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. We do not recommend setting this value and let system resources determine
// the maximum tasks (Default: 0 - unlimited)
WinningPostMaxTasks int
// EnableParkPiece enables the "piece parking" task to run on this node. This task is responsible for fetching
// pieces from the network and storing them in the storage subsystem until sectors are sealed. This task is
// only applicable when integrating with boost, and should be enabled on nodes which will hold deal data
// from boost until sectors containing the related pieces have the TreeD/TreeR constructed.
// Note that future Curio implementations will have a separate task type for fetching pieces from the internet. (Default: false)
EnableParkPiece bool
// The maximum amount of ParkPieceMaxTasks tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine (Default: 0 - unlimited)
ParkPieceMaxTasks int
// The maximum number of pieces that should be in storage + active tasks writing to storage on this node (Default: 0 - unlimited)
ParkPieceMaxInPark int
// The minimum free storage percentage required for the ParkPiece task to run. (Default: 5)
ParkPieceMinFreeStoragePercent float64
// EnableSealSDR enables SDR tasks to run. SDR is the long sequential computation
// creating 11 layer files in sector cache directory.
//
// SDR is the first task in the sealing pipeline. It's inputs are just the hash of the
// unsealed data (CommD), sector number, miner id, and the seal proof type.
// It's outputs are the 11 layer files in the sector cache directory.
//
// In lotus-miner this was run as part of PreCommit1. (Default: false)
EnableSealSDR bool
// The maximum amount of SDR tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
SealSDRMaxTasks int
// The maximum amount of SDR tasks that need to be queued before the system will start accepting new tasks.
// The main purpose of this setting is to allow for enough tasks to accumulate for batch sealing. When batch sealing
// nodes are present in the cluster, this value should be set to batch_size+1 to allow for the batch sealing node to
// fill up the batch.
// This setting can also be used to give priority to other nodes in the cluster by setting this value to a higher
// value on the nodes which should have less priority. (Default: 0 - unlimited)
SealSDRMinTasks int
// EnableSealSDRTrees enables the SDR pipeline tree-building task to run.
// This task handles encoding of unsealed data into last sdr layer and building
// of TreeR, TreeC and TreeD.
//
// This task runs after SDR
// TreeD is first computed with optional input of unsealed data
// TreeR is computed from replica, which is first computed as field
// addition of the last SDR layer and the bottom layer of TreeD (which is the unsealed data)
// TreeC is computed from the 11 SDR layers
// The 3 trees will later be used to compute the PoRep proof.
//
// In case of SyntheticPoRep challenges for PoRep will be pre-generated at this step, and trees and layers
// will be dropped. SyntheticPoRep works by pre-generating a very large set of challenges (~30GiB on disk)
// then using a small subset of them for the actual PoRep computation. This allows for significant scratch space
// saving between PreCommit and PoRep generation at the expense of more computation (generating challenges in this step)
//
// In lotus-miner this was run as part of PreCommit2 (TreeD was run in PreCommit1).
// Note that nodes with SDRTrees enabled will also answer to Finalize tasks,
// which just remove unneeded tree data after PoRep is computed. (Default: false)
EnableSealSDRTrees bool
// The maximum amount of SealSDRTrees tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
SealSDRTreesMaxTasks int
// FinalizeMaxTasks is the maximum amount of finalize tasks that can run simultaneously.
// The finalize task is enabled on all machines which also handle SDRTrees tasks. Finalize ALWAYS runs on whichever
// machine holds sector cache files, as it removes unneeded tree data after PoRep is computed.
// Finalize will run in parallel with the SubmitCommitMsg task. (Default: 0 - unlimited)
FinalizeMaxTasks int
// EnableSendPrecommitMsg enables the sending of precommit messages to the chain
// from this curio instance.
// This runs after SDRTrees and uses the output CommD / CommR (roots of TreeD / TreeR) for the message (Default: false)
EnableSendPrecommitMsg bool
// EnablePoRepProof enables the computation of the porep proof
//
// This task runs after interactive-porep seed becomes available, which happens 150 epochs (75min) after the
// precommit message lands on chain. This task should run on a machine with a GPU. Vanilla PoRep proofs are
// requested from the machine which holds sector cache files which most likely is the machine which ran the SDRTrees
// task.
//
// In lotus-miner this was Commit1 / Commit2 (Default: false)
EnablePoRepProof bool
// The maximum amount of PoRepProof tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
PoRepProofMaxTasks int
// EnableSendCommitMsg enables the sending of commit messages to the chain
// from this curio instance. (Default: false)
EnableSendCommitMsg bool
// Whether to abort if any sector activation in a batch fails (newly sealed sectors, only with ProveCommitSectors3). (Default: true)
RequireActivationSuccess bool
// Whether to abort if any sector activation in a batch fails (updating sectors, only with ProveReplicaUpdates3). (Default: true)
RequireNotificationSuccess bool
// EnableMoveStorage enables the move-into-long-term-storage task to run on this curio instance.
// This tasks should only be enabled on nodes with long-term storage.
//
// The MoveStorage task is the last task in the sealing pipeline. It moves the sealed sector data from the
// SDRTrees machine into long-term storage. This task runs after the Finalize task. (Default: false)
EnableMoveStorage bool
// NoUnsealedDecode disables the decoding sector data on this node. Normally data encoding is enabled by default on
// storage nodes with the MoveStorage task enabled. Setting this option to true means that unsealed data for sectors
// will not be stored on this node (Default: false)
NoUnsealedDecode bool
// The maximum amount of MoveStorage tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. It is recommended that this value is set to a number which
// uses all available network (or disk) bandwidth on the machine without causing bottlenecks. NOTE: unlike most other
// tasks, when this value is set the maximum number of concurrent tasks will not be bounded by CPU core count (Default: 0 - unlimited)
MoveStorageMaxTasks int
// EnableUpdateEncode enables the encoding step of the SnapDeal process on this curio instance.
// This step involves encoding the data into the sector and computing updated TreeR (uses gpu). (Default: false)
EnableUpdateEncode bool
// EnableUpdateProve enables the proving step of the SnapDeal process on this curio instance.
// This step generates the snark proof for the updated sector. (Default: false)
EnableUpdateProve bool
// EnableUpdateSubmit enables the submission of SnapDeal proofs to the blockchain from this curio instance.
// This step submits the generated proofs to the chain. (Default: false)
EnableUpdateSubmit bool
// UpdateEncodeMaxTasks sets the maximum number of concurrent SnapDeal encoding tasks that can run on this instance. (Default: 0 - unlimited)
UpdateEncodeMaxTasks int
// BindEncodeToData forces the Encode task to be executed on the same node where the data was parked.
// Please ensure that ParkPiece task is enabled and relevant resources are available before enabling this option.
// (Default: false)
BindEncodeToData bool
// AllowEncodeGPUOverprovision allows the Encode task to run on regardress of declared GPU usage. (Default: false)
// NOTE: This definitely is not safe on PoSt nodes.
AllowEncodeGPUOverprovision bool
// UpdateProveMaxTasks sets the maximum number of concurrent SnapDeal proving tasks that can run on this instance. (Default: 0 - unlimited)
UpdateProveMaxTasks int
// EnableWebGui enables the web GUI on this curio instance. The UI has minimal local overhead, but it should
// only need to be run on a single machine in the cluster. (Default: false)
EnableWebGui bool
// The address that should listen for Web GUI requests. It should be in form "x.x.x.x:1234" (Default: 0.0.0.0:4701)
GuiAddress string
// UseSyntheticPoRep enables the synthetic PoRep for all new sectors. When set to true, will reduce the amount of
// cache data held on disk after the completion of TreeRC task to 11GiB. (Default: false)
UseSyntheticPoRep bool
// The maximum amount of SyntheticPoRep tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
SyntheticPoRepMaxTasks int
// EnableBatchSeal enabled SupraSeal batch sealing on the node. (Default: false)
EnableBatchSeal bool
// EnableDealMarket enabled the deal market on the node. This would also enable libp2p on the node, if configured. (Default: false)
EnableDealMarket bool
// Enable handling for PDP (proof-of-data possession) deals / proving on this node.
// PDP deals allow the node to directly store and prove unsealed data with "PDP Services" like Storacha.
// This feature is BETA and should only be enabled on nodes which are part of a PDP network.
EnablePDP bool
// DataPath is the root directory Curio-PDP scans for writable storage locations.
// The node treats this directory and every subdirectory as a candidate store path.
// Overridden by the DATA_STORAGE env var and the --data CLI flag. (Default: /data)
DataPath string
// PDPPullPieceMaxTasks is the maximum number of PDPv0 pull-piece download tasks that can run simultaneously.
// Set 0 for unlimited. (Default: 20)
PDPPullPieceMaxTasks int
// PDPUnclaimedUploadKeepHours is how many hours to keep unclaimed PDP piece uploads (orphaned pdp_piecerefs
// with data_set_refcount = 0) before PieceGC deletes them. Must be >= 1. (Default: 2)
// Updates will affect running instances.
PDPUnclaimedUploadKeepHours *Dynamic[int]
// EnableCommP enables the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
// Must have EnableDealMarket = True (Default: false)
EnableCommP bool
// The maximum amount of CommP tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
CommPMaxTasks int
// BindCommPToData forces the CommP task to be executed on the same node where the data was parked.
// Please ensure that ParkPiece task is enabled and relevant resources are available before enabling this option.
// (Default: false)
BindCommPToData bool
// The maximum amount of indexing and IPNI tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 8)
IndexingMaxTasks int
// BindSDRTreeToNode forces the TreeD and TreeRC tasks to be executed on the same node where SDR task was executed
// for the sector. Please ensure that TreeD and TreeRC task are enabled and relevant resources are available before
// enabling this option. (Default: false)
BindSDRTreeToNode bool
// EnableProofShare enables the ProofShare tasks on the node. This subsystem will request proof work from a marketplace
// whenever local machine can take on more Snark work. ProofShare tasks have priority over local snark tasks, but new
// ProofShare work will only be requested if there is no local work to do.
//
// This feature is currently experimental and may change in the future. (Default: false)
EnableProofShare bool
// The maximum amount of ProofShare tasks that can run simultaneously. Note that the maximum number of tasks will
// also be bounded by resources available on the machine. (Default: 0 - unlimited)
ProofShareMaxTasks int
// EnableRemoteProofs enables the remote proof tasks on the node. Local snark tasks will be transformed into remote
// proving tasks when this option is enabled. Details on which SP IDs are allowed to request remote proofs are managed
// via Client Settings on the Proofshare webui page. Buy delay can also be set in the Client Settings page. (Default: false)
EnableRemoteProofs bool
// The maximum number of remote proofs that can be uploaded simultaneously by each node. (Default: 15)
RemoteProofMaxUploads int
// EnableWalletExporter enables the wallet exporter on the node. This will export wallet stats to prometheus.
// NOTE: THIS MUST BE ENABLED ONLY ON A SINGLE NODE IN THE CLUSTER TO BE USEFUL (Default: false)
EnableWalletExporter bool
}
type CurioFees struct {
// maxBatchFee = maxBase + maxPerSector * nSectors
// (Default: #Base = "0 FIL" and #PerSector = "0.02 FIL")
MaxPreCommitBatchGasFee BatchFeeConfig
// maxBatchFee = maxBase + maxPerSector * nSectors
// (Default: #Base = "0 FIL" and #PerSector = "0.03 FIL")
MaxCommitBatchGasFee BatchFeeConfig
// Accepts a decimal string (e.g., "123.45") with optional "fil" or "attofil" suffix.
// (Default: #Base = "0 FIL" and #PerSector = "0.03 FIL")
MaxUpdateBatchGasFee BatchFeeConfig
// WindowPoSt is a high-value operation, so the default fee should be high.
// Accepts a decimal string (e.g., "123.45") with optional "fil" or "attofil" suffix. (Default: "5 fil")
MaxWindowPoStGasFee types.FIL
// Whether to use available miner balance for sector collateral instead of sending it with each message (Default: false)
CollateralFromMinerBalance bool
// Don't send collateral with messages even if there is no available balance in the miner actor (Default: false)
DisableCollateralFallback bool
// MaximizeFeeCap makes the sender set maximum allowed FeeCap on all sent messages.
// This generally doesn't increase message cost, but in highly congested network messages
// are much less likely to get stuck in mempool. (Default: true)
MaximizeFeeCap bool
}
type CurioAddresses struct {
// PreCommitControl is an array of Addresses to send PreCommit messages from
PreCommitControl []string
// CommitControl is an array of Addresses to send Commit messages from
CommitControl []string
// DealPublishControl is an array of Address to send the deal collateral from with PublishStorageDeal Message
DealPublishControl []string
// TerminateControl is a list of addresses used to send Terminate messages.
TerminateControl []string
// DisableOwnerFallback disables usage of the owner address for messages
// sent automatically
DisableOwnerFallback bool
// DisableWorkerFallback disables usage of the worker address for messages
// sent automatically, if control addresses are configured.
// A control address that doesn't have enough funds will still be chosen
// over the worker address if this flag is set.
DisableWorkerFallback bool
// MinerAddresses are the addresses of the miner actors
MinerAddresses []string
// BalanceManagerConfig specifies the configuration parameters for managing wallet balances and actor-related funds,
// including collateral and other operational resources.
BalanceManager BalanceManagerConfig
}
type CurioProvingConfig struct {
// Maximum number of sector checks to run in parallel. (0 = unlimited)
//
// WARNING: Setting this value too high may make the node crash by running out of stack
// WARNING: Setting this value too low may make sector challenge reading much slower, resulting in failed PoSt due
// to late submission.
//
// After changing this option, confirm that the new value works in your setup by invoking
// 'curio test wd task 0' (Default: 32)
ParallelCheckLimit int
// Maximum amount of time a proving pre-check can take for a sector. If the check times out the sector will be skipped
//
// WARNING: Setting this value too low risks in sectors being skipped even though they are accessible, just reading the
// test challenge took longer than this timeout
// WARNING: Setting this value too high risks missing PoSt deadline in case IO operations related to this sector are
// blocked (e.g. in case of disconnected NFS mount)
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "10m0s")
SingleCheckTimeout time.Duration
// Maximum amount of time a proving pre-check can take for an entire partition. If the check times out, sectors in
// the partition which didn't get checked on time will be skipped
//
// WARNING: Setting this value too low risks in sectors being skipped even though they are accessible, just reading the
// test challenge took longer than this timeout
// WARNING: Setting this value too high risks missing PoSt deadline in case IO operations related to this partition are
// blocked or slow. Time duration string (e.g., "1h2m3s") in TOML format. (Default: "20m0s")
PartitionCheckTimeout time.Duration
}
// CuzkConfig configures integration with an external cuzk proving daemon.
// The cuzk daemon is a persistent GPU-resident SNARK proving engine that keeps SRS parameters
// loaded in memory across proofs, eliminating the 30-90s SRS loading overhead per proof.
// When enabled, Curio delegates SNARK computations to cuzk over gRPC and uses pipeline
// backpressure (via GetStatus) instead of local GPU/RAM resource accounting.
type CuzkConfig struct {
// Address of the cuzk daemon gRPC endpoint.
// Supports unix socket (e.g., "unix:///run/curio/cuzk.sock") or TCP (e.g., "127.0.0.1:9820").
// Empty string disables cuzk integration. (Default: "")
Address string
// MaxPending is the maximum number of proof jobs that may be pending in the cuzk daemon queue
// before Curio stops accepting new proving tasks (backpressure). When the daemon's pending
// queue reaches this level, CanAccept will reject new tasks until capacity frees up.
// (Default: 10)
MaxPending int
// ProveTimeout is the maximum time to wait for a proof result from the cuzk daemon.
// If the proof is not completed within this duration, the task will be retried.
// Time duration string (e.g., "30m", "1h"). (Default: "30m")
ProveTimeout time.Duration
}
type CurioIngestConfig struct {
// MaxMarketRunningPipelines is the maximum number of market pipelines that can be actively running tasks.
// A "running" pipeline is one that has at least one task currently assigned to a machine (owner_id is not null).
// If this limit is exceeded, the system will apply backpressure to delay processing of new deals.
// 0 means unlimited. (Default: 64)
MaxMarketRunningPipelines *Dynamic[int]
// MaxQueueDownload is the maximum number of pipelines that can be queued at the downloading stage,
// waiting for a machine to pick up their task (owner_id is null).
// If this limit is exceeded, the system will apply backpressure to slow the ingestion of new deals.
// 0 means unlimited. (Default: 8)
MaxQueueDownload *Dynamic[int]
// MaxQueueCommP is the maximum number of pipelines that can be queued at the CommP (verify) stage,
// waiting for a machine to pick up their verification task (owner_id is null).
// If this limit is exceeded, the system will apply backpressure, delaying new deal processing.
// 0 means unlimited. (Default: 8)
MaxQueueCommP *Dynamic[int]
// Maximum number of sectors that can be queued waiting for deals to start processing.
// 0 = unlimited
// Note: This mechanism will delay taking deal data from markets, providing backpressure to the market subsystem.
// The DealSector queue includes deals that are ready to enter the sealing pipeline but are not yet part of it.
// DealSector queue is the first queue in the sealing pipeline, making it the primary backpressure mechanism. (Default: 8)
// Updates will affect running instances.
MaxQueueDealSector *Dynamic[int]
// Maximum number of sectors that can be queued waiting for SDR to start processing.
// 0 = unlimited
// Note: This mechanism will delay taking deal data from markets, providing backpressure to the market subsystem.
// The SDR queue includes deals which are in the process of entering the sealing pipeline. In case of the SDR tasks it is
// possible that this queue grows more than this limit(CC sectors), the backpressure is only applied to sectors
// entering the pipeline.
// Only applies to PoRep pipeline (DoSnap = false) (Default: 8)
// Updates will affect running instances.
MaxQueueSDR *Dynamic[int]
// Maximum number of sectors that can be queued waiting for SDRTrees to start processing.
// 0 = unlimited
// Note: This mechanism will delay taking deal data from markets, providing backpressure to the market subsystem.
// In case of the trees tasks it is possible that this queue grows more than this limit, the backpressure is only
// applied to sectors entering the pipeline.
// Only applies to PoRep pipeline (DoSnap = false) (Default: 0)
// Updates will affect running instances.
MaxQueueTrees *Dynamic[int]
// Maximum number of sectors that can be queued waiting for PoRep to start processing.
// 0 = unlimited
// Note: This mechanism will delay taking deal data from markets, providing backpressure to the market subsystem.
// Like with the trees tasks, it is possible that this queue grows more than this limit, the backpressure is only
// applied to sectors entering the pipeline.
// Only applies to PoRep pipeline (DoSnap = false) (Default: 0)
// Updates will affect running instances.
MaxQueuePoRep *Dynamic[int]
// MaxQueueSnapEncode is the maximum number of sectors that can be queued waiting for UpdateEncode tasks to start.
// 0 means unlimited.
// This applies backpressure to the market subsystem by delaying the ingestion of deal data.
// Only applies to the Snap Deals pipeline (DoSnap = true). (Default: 16)
// Updates will affect running instances.
MaxQueueSnapEncode *Dynamic[int]
// MaxQueueSnapProve is the maximum number of sectors that can be queued waiting for UpdateProve to start processing.
// 0 means unlimited.
// This applies backpressure in the Snap Deals pipeline (DoSnap = true) by delaying new deal ingestion. (Default: 0)
// Updates will affect running instances.
MaxQueueSnapProve *Dynamic[int]
// Maximum time an open deal sector should wait for more deals before it starts sealing.
// This ensures that sectors don't remain open indefinitely, consuming resources.
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "1h0m0s")
// Updates will affect running instances.
MaxDealWaitTime *Dynamic[time.Duration]
// DoSnap, when set to true, enables snap deal processing for deals ingested by this instance.
// Unlike lotus-miner, there is no fallback to PoRep when no snap sectors are available.
// When enabled, all deals will be processed as snap deals. (Default: false)
DoSnap bool
// DisableSSRFProtection disables all SSRF (Server-Side Request Forgery) protection
// on deal data URL fetching. When true, URLs pointing to private IPs, loopback
// addresses, and local hostnames are allowed. URL structure validation (scheme,
// control characters) is still enforced.
// WARNING: Only enable in development or testing environments. (Default: false)
// Updates will affect running instances.
DisableSSRFProtection *Dynamic[bool]
// SSRFAllowedHosts is a list of hosts or host:port pairs that are allowed through
// SSRF protection. Matched hosts bypass IP and hostname restrictions while other
// safety checks (URL scheme, headers) remain active.
// Entries without a port match any port for that host.
// Example: ["192.168.1.100:8080", "my-dev-server.local"]
// (Default: [])
// Updates will affect running instances.
SSRFAllowedHosts *Dynamic[[]string]
}
type CurioAlertingConfig struct {
// ClusterName identifies the Curio cluster in external alerts. When empty, the hostname of the node sending the alert is used.
ClusterName string
// MinimumWalletBalance is the minimum balance all active wallets. If the balance is below this value, an
// alerts will be triggered for the wallet
// Accepts a decimal string (e.g., "123.45" or "123 fil") with optional "fil" or "attofil" suffix. (Default: "5 FIL")
MinimumWalletBalance types.FIL
// PagerDutyConfig is the configuration for the PagerDuty alerting integration.
PagerDuty PagerDutyConfig
// PrometheusAlertManagerConfig is the configuration for the Prometheus AlertManager alerting integration.
PrometheusAlertManager PrometheusAlertManagerConfig
// SlackWebhookConfig is a configuration type for Slack webhook integration.
SlackWebhook SlackWebhookConfig
// AppriseConfig is the configuration for the Apprise (https://github.com/caronc/apprise-api) integration.
Apprise AppriseConfig
}
type CurioSealConfig struct {
// BatchSealSectorSize Allows setting the sector size supported by the batch seal task.
// Can be any value as long as it is "32GiB". (Default: "32GiB")
BatchSealSectorSize string
// Number of sectors in a seal batch. Depends on hardware and supraseal configuration. (Default: 32)
BatchSealBatchSize int
// Number of parallel pipelines. Can be 1 or 2. Depends on available raw block storage (Default: 2)
BatchSealPipelines int
// SingleHasherPerThread is a compatibility flag for older CPUs. Zen3 and later supports two sectors per thread.
// Set to false for older CPUs (Zen 2 and before). (Default: false)
SingleHasherPerThread bool
// LayerNVMEDevices OPTIONAL! A list of pcie device addresses that should be used for SDR layer storage.
// The required storage is 11 * BatchSealBatchSize * BatchSealSectorSize * BatchSealPipelines
// Total Read IOPS for optimal performance should be 10M+.
// The devices MUST be NVMe devices, not used for anything else. Any data on the devices will be lost!
//
// It's recommend to define these settings in a per-machine layer, as the devices are machine-specific.
//
// If left empty a list will be inferred automatically from /sys/bus/pci/drivers/vfio-pci/... using all
// devices with the NVMe I/O PCI class - 0x010802
//
// Example: ["0000:01:00.0", "0000:01:00.1"]
LayerNVMEDevices []string
}
type PagerDutyConfig struct {
// Enable is a flag to enable or disable the PagerDuty integration.
Enable bool
// PagerDutyEventURL is URL for PagerDuty.com Events API v2 URL. Events sent to this API URL are ultimately
// routed to a PagerDuty.com service and processed.
// The default is sufficient for integration with the stock commercial PagerDuty.com company's service.
PagerDutyEventURL string
// PageDutyIntegrationKey is the integration key for a PagerDuty.com service. You can find this unique service
// identifier in the integration page for the service.
PageDutyIntegrationKey string
}
type PrometheusAlertManagerConfig struct {
// Enable is a flag to enable or disable the Prometheus AlertManager integration.
Enable bool
// AlertManagerURL is the URL for the Prometheus AlertManager API v2 URL.
AlertManagerURL string
}
type SlackWebhookConfig struct {
// Enable is a flag to enable or disable the Prometheus AlertManager integration.
Enable bool
// WebHookURL is the URL for the URL for slack Webhook.
// Example: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
WebHookURL string
}
type AppriseConfig struct {
// URL is the notify endpoint of a running Apprise API server (https://github.com/caronc/apprise-api).
// Either its stateless endpoint (e.g. "http://127.0.0.1:8000/notify", use with NotifyURLs) or a
// stateful, pre-configured endpoint (e.g. "http://127.0.0.1:8000/notify/curio", leave NotifyURLs empty).
// Leave empty to disable the Apprise integration.
URL string
// NotifyURLs is a list of Apprise notification URLs (e.g. "tgram://bottoken/ChatID", "discord://webhook_id/webhook_token").
// Required when URL is a stateless /notify endpoint; leave empty for a stateful /notify/<config-key> endpoint.
NotifyURLs []string
// Tag restricts delivery to Apprise URLs carrying this tag. Only applies to stateful configs. OPTIONAL.
Tag string
}
type ApisConfig struct {
// ChainApiInfo is the API endpoint for an external Lotus-compatible daemon.
ChainApiInfo []string
// API auth secret for the Curio nodes to use. This value should only be set on the bade layer.
StorageRPCSecret string
}
type CurioBatchingConfig struct {
// Precommit Batching configuration
PreCommit PreCommitBatchingConfig
// Commit batching configuration
Commit CommitBatchingConfig
// Snap Deals batching configuration
Update UpdateBatchingConfig
}
type PreCommitBatchingConfig struct {
// Base fee value below which we should try to send Precommit messages immediately
// Accepts a decimal string (e.g., "123.45" or "123 fil") with optional "fil" or "attofil" suffix. (Default: "0.005 FIL")
BaseFeeThreshold types.FIL
// Maximum amount of time any given sector in the batch can wait for the batch to accumulate
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "4h0m0s")
Timeout time.Duration
// Time buffer for forceful batch submission before sectors/deal in batch would start expiring
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "6h0m0s")
Slack time.Duration
// Maximum number of sectors per precommit batch message. The batch will be submitted
// immediately when this many sectors are ready, without waiting for the timeout.
// 0 = use the protocol maximum. (Default: 0)
MaxBatch int
}
type CommitBatchingConfig struct {
// Base fee value below which we should try to send Commit messages immediately
// Accepts a decimal string (e.g., "123.45" or "123 fil") with optional "fil" or "attofil" suffix. (Default: "0.005 FIL")
BaseFeeThreshold types.FIL
// Maximum amount of time any given sector in the batch can wait for the batch to accumulate
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "1h0m0s")
Timeout time.Duration
// Time buffer for forceful batch submission before sectors/deals in batch would start expiring
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "1h0m0s")
Slack time.Duration
// Maximum number of sectors per commit batch message. The batch will be submitted
// immediately when this many sectors are ready, without waiting for the timeout.
// 0 = use the protocol maximum. (Default: 0)
MaxBatch int
}
type UpdateBatchingConfig struct {
// Base fee value below which we should try to send Commit messages immediately
// Accepts a decimal string (e.g., "123.45" or "123 fil") with optional "fil" or "attofil" suffix. (Default: "0.005 FIL")
BaseFeeThreshold types.FIL
// Maximum amount of time any given sector in the batch can wait for the batch to accumulate
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "1h0m0s")
Timeout time.Duration
// Time buffer for forceful batch submission before sectors/deals in batch would start expiring
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "1h0m0s")
Slack time.Duration
}
type MarketConfig struct {
// StorageMarketConfig houses all the deal related market configuration
StorageMarketConfig StorageMarketConfig
}
type StorageMarketConfig struct {
// MK12 encompasses all configuration related to deal protocol mk1.2.0 and mk1.2.1 (i.e. Boost deals)
MK12 MK12Config
// MK20 encompasses all configuration related to deal protocol mk2.0 i.e. market 2.0
MK20 MK20Config
// IPNI configuration for ipni-provider
IPNI IPNIConfig
// Indexing configuration for deal indexing
Indexing IndexingConfig
// PieceLocator is a list of HTTP url and headers combination to query for a piece for offline deals
// User can run a remote file server which can host all the pieces over the HTTP and supply a reader when requested.
// The server must support "HEAD" request and "GET" request.
// 1. <URL>?id=pieceCID with "HEAD" request responds with 200 if found or 404 if not. Must send header "Content-Length" with file size as value
// 2. <URL>?id=pieceCID must provide a reader for the requested piece along with header "Content-Length" with file size as value
PieceLocator []PieceLocatorConfig
}
type MK12Config struct {
// When a deal is ready to publish, the amount of time to wait for more
// deals to be ready to publish before publishing them all as a batch
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "5m0s")
PublishMsgPeriod time.Duration
// The maximum number of deals to include in a single PublishStorageDeals
// message (Default: 8)
MaxDealsPerPublishMsg uint64
// The maximum fee to pay per deal when sending the PublishStorageDeals message
// Accepts a decimal string (e.g., "123.45" or "123 fil") with optional "fil" or "attofil" suffix. (Default: "0.5 FIL")
MaxPublishDealFee types.FIL
// ExpectedPoRepSealDuration is the expected time it would take to seal the deal sector
// This will be used to fail the deals which cannot be sealed on time.
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "8h0m0s")
ExpectedPoRepSealDuration time.Duration
// ExpectedSnapSealDuration is the expected time it would take to snap the deal sector
// This will be used to fail the deals which cannot be sealed on time.
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "2h0m0s")
ExpectedSnapSealDuration time.Duration
// SkipCommP can be used to skip doing a commP check before PublishDealMessage is sent on chain
// Warning: If this check is skipped and there is a commP mismatch, all deals in the
// sector will need to be sent again (Default: false)
SkipCommP bool
// DisabledMiners is a list of miner addresses that should be excluded from online deal making protocols
DisabledMiners []string
// MaxConcurrentDealSizeGiB is a sum of all size of all deals which are waiting to be added to a sector
// When the cumulative size of all deals in process reaches this number, new deals will be rejected.
// (Default: 0 = unlimited)
MaxConcurrentDealSizeGiB int64
// DenyUnknownClients determines the default behaviour for the deal of clients which are not in allow/deny list
// If True then all deals coming from unknown clients will be rejected. (Default: false)
DenyUnknownClients bool
// DenyOnlineDeals determines if the storage provider will accept online deals (Default: false)
DenyOnlineDeals bool
// DenyOfflineDeals determines if the storage provider will accept offline deals (Default: false)
DenyOfflineDeals bool
// CIDGravityTokens is the list of authorization token to use for CIDGravity filters. These should be in format
// "minerID1:Token1", "minerID2:Token2". If a token for a minerID within the cluster is not provided,
// CIDGravity filters will not be applied to deals associated with that miner ID.
CIDGravityTokens []string
// DefaultCIDGravityAccept when set to true till accept deals when CIDGravity service is not available.
// Default behaviors is to reject the deals (Default: false)
DefaultCIDGravityAccept bool
}
type PieceLocatorConfig struct {
URL string
Headers http.Header
}
type IndexingConfig struct {
// Number of records per insert batch
InsertBatchSize int
// Number of concurrent inserts to split AddIndex calls to
InsertConcurrency int
}
type IPNIConfig struct {
// Disable set whether to disable indexing announcement to the network and expose endpoints that
// allow indexer nodes to process announcements. Default: False
Disable bool
// The network indexer web UI URL for viewing published announcements
ServiceURL []string
// The list of URLs of indexing nodes to announce to. This is a list of hosts we talk to tell them about new
// heads.
DirectAnnounceURLs []string
}
// HTTPConfig represents the configuration for an HTTP server.
type HTTPConfig struct {
// Enable the HTTP server on the node
Enable bool
// DomainName specifies the domain name that the server uses to serve HTTP requests. DomainName cannot be empty and cannot be
// an IP address
DomainName string
// ListenAddress is the address that the server listens for HTTP requests. It should be in form "x.x.x.x:1234" (Default: 0.0.0.0:12310)
ListenAddress string
// DelegateTLS allows the server to delegate TLS to a reverse proxy. When enabled the listen address will serve
// HTTP and the reverse proxy will handle TLS termination.
DelegateTLS bool
// ReadTimeout is the maximum duration for reading the entire or next request, including body, from the client.
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "30m0s")
ReadTimeout time.Duration
// IdleTimeout is the maximum duration of an idle session. If set, idle connections are closed after this duration.
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "30m0s")
IdleTimeout time.Duration
// ReadHeaderTimeout is amount of time allowed to read request headers
// Time duration string (e.g., "1h2m3s") in TOML format. (Default: "0m5s")
ReadHeaderTimeout time.Duration
// CORSOrigins specifies the allowed origins for CORS requests to the Curio admin UI. If empty, CORS is disabled.
// If not empty, only the specified origins will be allowed for CORS requests.
// This is required for third-party UI servers.
// "*" allows everyone, it's best to specify the UI servers' hostname.
CORSOrigins []string
// CSP sets the Content Security Policy for content served via the /piece/ retrieval endpoint.
// Valid values: "off", "self", "inline" (Default: "inline")
//
// Since storage providers serve user-uploaded content on their domain, CSP helps control
// what these files can do when rendered in browsers. Choose based on your use case: