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

sectors expired: Handle precomitted and unproven sectors correctly #7236

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Aug 31, 2021

Without this we'd say that sectors which were not PoSt-ed yet were already expired.

@magik6k magik6k requested a review from a team as a code owner August 31, 2021 14:25
@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #7236 (daaa725) into master (b0f57d7) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
chain/actors/builtin/miner/miner.go 27.35% <ø> (ø)
chain/actors/builtin/miner/v5.go 53.84% <0.00%> (-0.34%) ⬇️
cmd/lotus-miner/sectors.go 11.80% <0.00%> (-0.15%) ⬇️
extern/sector-storage/sched_resources.go 75.00% <0.00%> (-9.38%) ⬇️
extern/sector-storage/manager_calltracker.go 57.70% <0.00%> (-4.85%) ⬇️
chain/sub/incoming.go 49.70% <0.00%> (-2.37%) ⬇️
storage/wdpost_sched.go 77.22% <0.00%> (-1.99%) ⬇️
lib/rpcenc/reader.go 70.29% <0.00%> (-1.49%) ⬇️
chain/stmgr/searchwait.go 62.09% <0.00%> (-1.31%) ⬇️
chain/store/store.go 63.12% <0.00%> (-1.07%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0f57d7...daaa725. Read the comment docs.

Copy link
Contributor

@ZenGround0 ZenGround0 left a 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
Copy link
Contributor

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)
Copy link
Contributor

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.

@magik6k magik6k merged commit 7a38cd9 into master Aug 31, 2021
@magik6k magik6k deleted the fix/expired-precomm branch August 31, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants