This commit is contained in:
Andrew Jackson (Ajax)
2023-09-19 22:48:39 -05:00
parent 13b50ce6c8
commit a377033d22
8 changed files with 271 additions and 63 deletions
+43
View File
@@ -343,3 +343,46 @@ func DefaultUserRaftConfig() *UserRaftConfig {
return &cfg
}
func DefaultLotusProvider() *LotusProviderConfig {
/*
reqs := map[string]*regexp.Regexp{}
for _, str := range LotusRequired {
reqs[str]=regexp.MustCompile("(?i)"+str)
}
*/
return &LotusProviderConfig{
Fees: LotusProviderFees{
DefaultMaxFee: DefaultDefaultMaxFee,
MaxPreCommitGasFee: types.MustParseFIL("0.025"),
MaxCommitGasFee: types.MustParseFIL("0.05"),
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
},
MaxTerminateGasFee: types.MustParseFIL("0.5"),
MaxWindowPoStGasFee: types.MustParseFIL("5"),
MaxPublishDealsFee: types.MustParseFIL("0.05"),
},
Addresses: LotusProviderAddresses{
PreCommitControl: []string{},
CommitControl: []string{},
TerminateControl: []string{},
},
/*
HarmonyDB: HarmonyDB{
Hosts: []string{"127.0.0.1"},
Username: "yugabyte",
Password: "yugabyte",
Database: "yugabyte",
Port: "5433",
},
*/
}
}
+39
View File
@@ -65,6 +65,14 @@ type StorageMiner struct {
HarmonyDB HarmonyDB
}
type LotusProviderConfig struct {
EnableWindowPost bool
EnableWinningPost bool
Fees LotusProviderFees
Addresses LotusProviderAddresses
}
type DAGStoreConfig struct {
// Path to the dagstore root directory. This directory contains three
// subdirectories, which can be symlinked to alternative locations if
@@ -499,6 +507,20 @@ type MinerFeeConfig struct {
MaxMarketBalanceAddFee types.FIL
}
type LotusProviderFees struct {
DefaultMaxFee types.FIL
MaxPreCommitGasFee types.FIL
MaxCommitGasFee types.FIL
// maxBatchFee = maxBase + maxPerSector * nSectors
MaxPreCommitBatchGasFee BatchFeeConfig
MaxCommitBatchGasFee BatchFeeConfig
MaxTerminateGasFee types.FIL
// WindowPoSt is a high-value operation, so the default fee should be high.
MaxWindowPoStGasFee types.FIL
MaxPublishDealsFee types.FIL
}
type MinerAddressConfig struct {
// Addresses to send PreCommit messages from
PreCommitControl []string
@@ -517,6 +539,23 @@ type MinerAddressConfig struct {
DisableWorkerFallback bool
}
type LotusProviderAddresses struct {
// Addresses to send PreCommit messages from
PreCommitControl []string
// Addresses to send Commit messages from
CommitControl []string
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
}
// API contains configs for API endpoint
type API struct {
// Binding address for the Lotus API