-
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
fix SectorState #3881
fix SectorState #3881
Conversation
@@ -1,43 +1,43 @@ | |||
package sealing | |||
|
|||
type SectorState string | |||
type SectorState uint8 |
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.
Changing this will break everyones miner sector states (this is used in on-disk state). Using strings also makes it much easier to migrate states.
The correct fix for this issue is likely just having a list of valid states, and checking against that list in the update-state command
a03f37e
to
ed74091
Compare
@@ -2,6 +2,8 @@ package sealing | |||
|
|||
type SectorState string | |||
|
|||
var ExistSectorStateList = make(map[SectorState]struct{}) |
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.
Initializing the values here instead of in init would be cleaner / safer
var ExistSectorStateList = make(map[SectorState]struct{}) | |
var ExistSectorStateList = map[SectorState]struct{}{ | |
Empty: {}, | |
... | |
} |
(also looks like we need |
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.
Looks good, thanks!
fix #3626
update SectorState type.