-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding an RuntimeSubsystems API to storage miner; fix lotus-miner info
#6906
Conversation
a3895f7
to
3e0a339
Compare
3e0a339
to
7c6eb4f
Compare
Perms: read | ||
|
||
Inputs: `null` | ||
|
||
Response: `null` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something wrong here
node/builder_miner.go
Outdated
@@ -72,6 +72,7 @@ func ConfigStorageMiner(c interface{}) Option { | |||
return Options( | |||
ConfigCommon(&cfg.Common, enableLibp2pNode), | |||
|
|||
Override(new(*api.MinerSubsystem), modules.AddMinerSubsystems(cfg.Subsystems)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create a dtype here: dtypes.EnabledSubsystems = api.MinerSubsystems.
b902012
to
de4a847
Compare
72f9eb1
to
54c6a3a
Compare
Marking this as ready for review, as it is already in working state, and addresses the underlying issue with miners getting panics on |
lotus-miner info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll push a commit with these nits.
6b653a6
to
07f40b9
Compare
node/modules/storageminer.go
Outdated
@@ -1007,3 +1007,19 @@ func mutateCfg(r repo.LockedRepo, mutator func(*config.StorageMiner)) error { | |||
|
|||
return multierr.Combine(typeErr, setConfigErr) | |||
} | |||
|
|||
func PopulateEnabledMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.MinerSubsystems) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func PopulateEnabledMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.MinerSubsystems) { | |
func EnabledMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.MinerSubsystems) { |
Populate implies "fill in" (i.e., in the config).
node/modules/storageminer.go
Outdated
if cfg.EnableMarkets { | ||
res = append(res, api.SubsystemMarkets) | ||
} | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return | |
return res |
Always better to be explicit.
Fixes #6887
This PR is adding
RuntimeSubsystems
API endpoint, so that CLI commands such aslotus-miner info
can detect what kind of miner node they interact with, and issue the correct calls for information, depending on available subsystems.