-
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 expired: Handle precomitted and unproven sectors correctly #7236
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7236 +/- ##
==========================================
- Coverage 39.10% 39.07% -0.04%
==========================================
Files 610 610
Lines 64716 64730 +14
==========================================
- Hits 25305 25291 -14
- Misses 35021 35045 +24
- Partials 4390 4394 +4
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
@@ -549,6 +549,10 @@ func (p *partition{{.v}}) RecoveringSectors() (bitfield.BitField, error) { | |||
return p.Partition.Recoveries, nil | |||
} | |||
|
|||
func (p *partition{{.v}}) UnprovenSectors() (bitfield.BitField, error) { | |||
return {{if (ge .v 2)}}p.Partition.Unproven{{else}}bitfield.New(){{end}}, nil |
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.
The fact that you can specify if (ge .v 2)
highlights how nice this autogen template format is 👌
@@ -1628,12 +1628,31 @@ var sectorsExpiredCmd = &cli.Command{ | |||
} | |||
|
|||
toCheck, err = bitfield.SubtractBitField(toCheck, live) |
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.
super nit: if we change the generic name toCheck
to something more descriptive i.e. deadSectors
it will make this slightly more readable.
Without this we'd say that sectors which were not PoSt-ed yet were already expired.