Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
forbid terminating sectors in a deadline being proved
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Dec 11, 2020
1 parent 5106966 commit f93667d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions actors/builtin/miner/miner_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,9 +1336,8 @@ type TerminateSectorsReturn = miner0.TerminateSectorsReturn
// AddressedPartitionsMax per epoch until the queue is empty.
//
// The sectors are immediately ignored for Window PoSt proofs, and should be
// masked in the same way as faulty sectors. A miner terminating sectors in the
// current deadline must be careful to compute an appropriate Window PoSt proof
// for the sectors that will be active at the time the PoSt is submitted.
// masked in the same way as faulty sectors. A miner may not terminate sectors in the
// current deadline or the next deadline to be proven.
//
// This function may be invoked with no new sectors to explicitly process the
// next batch of sectors.
Expand Down Expand Up @@ -1383,6 +1382,12 @@ func (a Actor) TerminateSectors(rt Runtime, params *TerminateSectorsParams) *Ter
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to load sectors")

err = toProcess.ForEach(func(dlIdx uint64, partitionSectors PartitionSectorMap) error {
// If the deadline the current or next deadline to prove, don't allow terminating sectors.
// We assume that deadlines are immutable when being proven.
if !deadlineIsMutable(st.ProvingPeriodStart, dlIdx, currEpoch) {
rt.Abortf(exitcode.ErrIllegalArgument, "cannot terminate sectors in immutable deadline %d", dlIdx)
}

quant := st.QuantSpecForDeadline(dlIdx)

deadline, err := deadlines.LoadDeadline(store, dlIdx)
Expand Down

0 comments on commit f93667d

Please sign in to comment.