-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
82b7755
to
6a2f64a
Compare
49f9968
to
3f057c8
Compare
6f58f2d
to
84d2f5e
Compare
fe1b1c9
to
257188e
Compare
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.
Epic, looking good. FYI @nicola
cb7c30b
to
5f0049c
Compare
This still needs more tests, but it's now passing the existing tests and is ready to review. |
45a9550
to
10a1e29
Compare
Codecov Report
@@ Coverage Diff @@
## master #883 +/- ##
========================================
- Coverage 74.0% 74.0% -0.1%
========================================
Files 57 57
Lines 6483 6550 +67
========================================
+ Hits 4803 4847 +44
- Misses 1083 1092 +9
- Partials 597 611 +14 |
a35cfdb
to
f8f822c
Compare
Ok, I've found a bug. I'm not correctly handling power when handling missing posts at the end of the proving deadline. I'll upload a fix with tests tomorrow. |
b4d387e
to
5075507
Compare
5075507
to
ec20956
Compare
b042b80
to
1c8dec8
Compare
1c8dec8
to
53bc152
Compare
@@ -328,10 +331,23 @@ func (rt *Runtime) Send(toAddr addr.Address, methodNum abi.MethodNum, params run | |||
exp := rt.expectSends[0] | |||
|
|||
if !exp.Equal(toAddr, methodNum, params, value) { |
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.
Unrelated change to the testing framework to make reading errors easier.
@anorth the second commit fixes the bug (and adds/fixes more tests). I'm now explicitly returning:
|
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.
Thanks.
It's slightly unfortunate that the "policy" logic of which power to penalize is now in the state, but not a huge problem. We could probably resolve this and make things a bit more concise with a "power deltas" struct for use as return value from the methods that return more than one power thingy.
Hm. Yeah, adding a power delta object would clean things up a bit (#1011). |
This will need a lot of tests, and the existing tests are now all broken.
Design
Every partition gets a new
Unproven
bitfield for sectors that have yet to be proven and anUnprovenPower
field store power to be proven and activated when the partition is next proven.Crucially, new faulty power from unproven sectors is never removed from the miner, because it was never activated. Furthermore, unproven power is added to the miner when it's proved the first time. To achieve this, many methods have gained
poweDelta
return values.Faults
When marked faulty, unproven sectors are removed from the unproven bitfield and added to the faulty bitfield. They now join the normal fault flow.
Termination
Unproven sectors may be terminated (early) like any other sector.
WindowPoSt
On WindowPoSt, skipped unproven sectors are added to the faulty sectors bitfield/power normally. Then,
UnprovenPower
and theUnproven
bitfield are zeroed.End of deadline
At the end of the deadline, unproven sectors in unposted partitions are marked faulty along with their power.
Handling sector expiration before handling unproven sectors is explicitly forbidden.