Skip to content
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

Merged
merged 8 commits into from
Jul 28, 2021

Conversation

nonsense
Copy link
Member

@nonsense nonsense commented Jul 28, 2021

Fixes #6887


This PR is adding RuntimeSubsystems API endpoint, so that CLI commands such as lotus-miner info can detect what kind of miner node they interact with, and issue the correct calls for information, depending on available subsystems.

@nonsense nonsense requested a review from raulk July 28, 2021 09:10
@nonsense nonsense force-pushed the nonsense/get-enabled-subsystems-api branch 2 times, most recently from a3895f7 to 3e0a339 Compare July 28, 2021 10:03
api/api_subsystems.go Outdated Show resolved Hide resolved
@nonsense nonsense force-pushed the nonsense/get-enabled-subsystems-api branch from 3e0a339 to 7c6eb4f Compare July 28, 2021 10:14
Comment on lines 544 to 549
Perms: read

Inputs: `null`

Response: `null`

Copy link
Member

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

@@ -72,6 +72,7 @@ func ConfigStorageMiner(c interface{}) Option {
return Options(
ConfigCommon(&cfg.Common, enableLibp2pNode),

Override(new(*api.MinerSubsystem), modules.AddMinerSubsystems(cfg.Subsystems)),
Copy link
Member

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.

node/impl/storminer.go Outdated Show resolved Hide resolved
node/impl/storminer.go Outdated Show resolved Hide resolved
api/api_storage.go Outdated Show resolved Hide resolved
@nonsense nonsense force-pushed the nonsense/get-enabled-subsystems-api branch from b902012 to de4a847 Compare July 28, 2021 13:02
cmd/lotus-miner/info.go Outdated Show resolved Hide resolved
cmd/lotus-miner/info.go Outdated Show resolved Hide resolved
@nonsense nonsense force-pushed the nonsense/get-enabled-subsystems-api branch from 72f9eb1 to 54c6a3a Compare July 28, 2021 14:31
@nonsense nonsense marked this pull request as ready for review July 28, 2021 14:43
@nonsense nonsense requested a review from a team as a code owner July 28, 2021 14:43
@nonsense
Copy link
Member Author

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, and I know we want to issue a new RC tag today. Nevertheless we should address all outstanding comments.

@nonsense nonsense changed the title adding an GetEnabledSubsystems API to storage miner adding an RuntimeSubsystems API to storage miner; fix lotus-miner info Jul 28, 2021
@jacobheun jacobheun added release/backport team/ignite Issues and PRs being tracked by Team Ignite at Protocol Labs labels Jul 28, 2021
Copy link
Member

@raulk raulk left a 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.

api/api_subsystems.go Outdated Show resolved Hide resolved
api/api_subsystems.go Outdated Show resolved Hide resolved
api/api_subsystems.go Outdated Show resolved Hide resolved
api/api_subsystems.go Outdated Show resolved Hide resolved
documentation/en/api-v0-methods-miner.md Outdated Show resolved Hide resolved
node/impl/storminer.go Outdated Show resolved Hide resolved
api/api_subsystems.go Outdated Show resolved Hide resolved
api/api_storage.go Show resolved Hide resolved
@raulk raulk force-pushed the nonsense/get-enabled-subsystems-api branch from 6b653a6 to 07f40b9 Compare July 28, 2021 19:03
@raulk raulk requested review from magik6k and a team July 28, 2021 19:10
@raulk raulk changed the base branch from master to feat/replace-multistore-carv2 July 28, 2021 20:58
@raulk raulk changed the base branch from feat/replace-multistore-carv2 to master July 28, 2021 21:21
@jennijuju jennijuju added M1-release P1 P1: Must be resolved labels Jul 28, 2021
@jennijuju jennijuju added this to the 1.11.1 milestone Jul 28, 2021
@raulk raulk changed the base branch from master to release/v1.11.1 July 28, 2021 22:08
@raulk raulk changed the base branch from release/v1.11.1 to master July 28, 2021 22:09
@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).

if cfg.EnableMarkets {
res = append(res, api.SubsystemMarkets)
}
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return
return res

Always better to be explicit.

@raulk raulk merged commit 640407a into master Jul 28, 2021
@raulk raulk deleted the nonsense/get-enabled-subsystems-api branch July 28, 2021 23:04
@jennijuju jennijuju mentioned this pull request Aug 13, 2021
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 P1: Must be resolved team/ignite Issues and PRs being tracked by Team Ignite at Protocol Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lotus-miner info doesn't work after MRA service separation
6 participants