Miner: Treat initial pledge like precommit deposits #1007
Comments
The only open question for me is whether to handle debt repayment in I think implementing a method I'm not convinced it's necessary, though. |
Also may be worth noting - I think it's necessary to have an order of operations for debt repayment / penalty calculation, in case these are ever in the same method (like the above idea to put debt repayment in Debt repayment needs to happen first, and penalties calculated / applied last. |
This is wrong. When we burn from "pledge", we don't reduce total network pledge accounting. |
There's currently a wider unsolved problem of how genesis miners will cover their initial pledge requirement. In the current code, we have a policy option that they don't cover it: a genesis miner could have balance below the IP required by genesis sectors. Right now this isn't a practical option because we don't allow miners in IP debt to win blocks, so they couldn't win a reward in order to eventually meet the requirement. But if we change this, that option won't be possible at all. |
Note that there is a intrinsic difference between |
Yes - this issue proposes to remove that difference. |
Hey @wadealexc what is the motivation for this change? (I may be missing context) |
The motivation is simplicity. We currently have three or four different concepts for ways that part of a balance can be locked or unlocked, covered or un-covered. This removes one of them while maintaining the same properties of restricting a miner from election, growth etc. Rather than having both an IP debt and fee debt concepts, this removes the former. Rather than having both "required" and "locked" funds, this removes the former. |
This issue proposes to treat the miner's
st.InitialPledgeRequirement
the same asst.PreCommitDeposits
.When incurring penalties, the Miner's balance should never be reduced below the amount required to cover
st.LockedFunds + st.PreCommitDeposits + st.InitialPledgeRequirement
, with the remainder accumulated inst.FeeDebt
.Penalties are incurred via the method
st.PenalizeFundsInPriorityOrder
, which is invoked in 4 locations:SubmitWindowedPoSt
: No changes required.ReportConsensusFault
: Consensus fault penalties no longer come out of the miner's initial pledge. Although this may lower the possible reward for reporting a consensus fault, it also prevents miners from intentionally creating consensus faults in order to recover portions of their pledge.processEarlyTerminations
: Removal of initial pledge requirement should come before the termination penalty is applied:specs-actors/actors/builtin/miner/miner_actor.go
Lines 1612 to 1622 in ca1b772
handleProvingDeadline
: Penalties for ongoing faults and undeclared faults should be applied once, and only after initial pledge is adjusted to account for expired sectors:specs-actors/actors/builtin/miner/miner_actor.go
Lines 1746 to 1750 in ca1b772
Changes Required
The following changes are already implemented in #1004:
GetUnlockedBalance
should additionally subtractst.InitialPledgeRequirement
:specs-actors/actors/builtin/miner/miner_state.go
Line 864 in ca1b772
GetAvailableBalance
should no longer subtractst.InitialPledgeRequirement
:specs-actors/actors/builtin/miner/miner_state.go
Lines 872 to 873 in ca1b772
AssertBalanceInvariants
should additionally assert that:st.InitialPledgeRequirement >= 0
rt.CurrentBalance() >= Sum(st.LockedFunds, st.PreCommitDeposits, st.InitialPledgeRequirement)
MeetsInitialPledgeCondition
should returnfalse
IFF the miner has positiveFeeDebt
, as positiveFeeDebt
indicates that the miner is in "IP debt"The following changes have yet to be implemented:
processEarlyTerminations
: Remove IP requirement for terminated sectors before termination penalty is appliedhandleProvingDeadline
: Apply penalties in bulk after sector expiries are accounted for.The text was updated successfully, but these errors were encountered: