This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
prevent faults from double subtracting cc upgrade power #1129
Merged
acruikshank
merged 25 commits into
master
from
bug/power_deducted_from_replaced_sector_twice
Sep 14, 2020
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
703f861
rework expiration group calculation to deal with sectors rescheduled …
ffa8663
capture faulty power before it expires (fixing earlier regression)
f2d6e29
lint
1e85101
rebase issue
afb6f92
test and fix terminating replaced sector
94118c7
test extend replaced sector expiration
66bd8eb
tests for skipping replaced sector in last PoSt and skipping last PoS…
2d2a512
add test for recovered replaced sector
6f5d6b1
refactor grouping a bit
d604ffb
add test for sector upgraded before proven
1224f65
rebase fix
8ec0dbb
refactor with new struct that always sets expiration set
248e684
improved findSectorsByExpiration
3538cb3
trim test of redundant assertions
25a95f3
clarifications and corrections
c38c99e
add check that sectors are not left over after all have been grouped
ca2724e
use mayGet to avoid problem where all sectors have been rescheduled o…
49a0ee1
pass bitfield by value
a3072f4
clarify comment
01f6169
assert that no attempt is made to group a sector found in EarlySector
1081b71
inline mustGet
6c0bc22
uninitialize empty slice
141fc0c
one more rename
da154e8
optimize set math by using map to record remaining sectors
8b7c42d
expand comment a little more
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Blocking: this needs to check
es.EarlySectors
as well. Especially for the case where the sector has moved because it was rescheduled. I'm a bit surprised this escaped the great testing.I think to hit this case we need to fault a sector (thus rescheduling it) and then terminate it (the other call path to this point, since it can't be faulted again).
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.
As far as I can tell,
findSectorsByExpiration
is only used in the context of non-faulty sectors.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.
i.e. when terminating a faulty sector as you mentioned,
EQ.RemoveSectors
treats faulty vs non-faulty terminations differently. The faulty sectors are removed by traversing the expiration queue.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.
I'm with @wadealexc that I don't think we could exercise this code. If we stop assuming that grouped sectors can be a mix of faulty and non-faulty sectors, our downstream accounting gets a lot more complicated. We could add an assertion that no sectors in the set are early. I tried it an the tests still pass.
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.
Ignoring
es.EarlySectors
(now down in groupExpirationSet) still makes me quite uncomfortable. Adding an error check that no such sectors are being sought would help.