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

Market State.dealGetPaymentRemaining: Bad assertion allows for panic #765

@wadealexc

Description

@wadealexc

func dealGetPaymentRemaining(deal *DealProposal, slashEpoch abi.ChainEpoch) abi.TokenAmount {
Assert(slashEpoch <= deal.EndEpoch)
// Payments are always for start -> end epoch irrespective of when the deal is slashed.
if slashEpoch < deal.StartEpoch {
slashEpoch = deal.StartEpoch
}
durationRemaining := deal.EndEpoch - slashEpoch
Assert(durationRemaining > 0)

Assert(durationRemaining > 0) does not account for the case where slashEpoch == deal.EndEpoch.

(This shouldn't happen as OnMinerSectorsTerminate will not allow a slash epoch to be set for expired deals.)

Metadata

Metadata

Labels

P1High priority, required for basic network functionality and growthbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions