-
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
sectors update-state checks if sector exists before changing its state #7762
Conversation
Haven't been able to test yet. Will get to it Sunday. Current approach will not allow state update for sectors in |
Codecov Report
@@ Coverage Diff @@
## master #7762 +/- ##
==========================================
- Coverage 39.57% 39.55% -0.03%
==========================================
Files 640 640
Lines 68468 68471 +3
==========================================
- Hits 27095 27081 -14
- Misses 36722 36734 +12
- Partials 4651 4656 +5
Continue to review full report at Codecov.
|
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.
LGTM, @magik6k express opinions on the undef state thing.
cmd/lotus-miner/sectors.go
Outdated
} | ||
} | ||
if !sectorExists { | ||
return xerrors.Errorf("sector %s not found, could not change state", cctx.Args().Get(0)) |
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 xerrors.Errorf("sector %s not found, could not change state", cctx.Args().Get(0)) | |
return xerrors.Errorf("sector %d not found, could not change state", id) |
return xerrors.Errorf("sector %s not found, could not change state", cctx.Args().Get(0)) | |
return xerrors.Errorf("sector %s not found, could not change state", cctx.Args().Get(0)) |
cmd/lotus-miner/sectors.go
Outdated
return xerrors.Errorf("could not get list of sectors: %w", err) | ||
} | ||
var sectorExists = false | ||
for _, x := range list { |
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.
nit: this variable is usually called v
for value
cmd/lotus-miner/sectors.go
Outdated
@@ -1648,6 +1648,21 @@ var sectorsUpdateCmd = &cli.Command{ | |||
return xerrors.Errorf("could not parse sector number: %w", err) | |||
} | |||
|
|||
list, err := nodeApi.SectorsList(ctx) |
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.
Why not SectorsStatus
? Getting a full list will be somewhat slow for bigger miners.
ff3958b
to
27e48d7
Compare
Closes issue #7754