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

miner: fix deadline calc after missed proving period #339

Closed
wants to merge 1 commit into from

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented May 4, 2020

No description provided.

@magik6k magik6k requested review from anorth and whyrusleeping May 4, 2020 13:06
@@ -57,7 +57,7 @@ func ComputeProvingPeriodDeadline(periodStart, currEpoch abi.ChainEpoch) *Deadli
return &DeadlineInfo{
CurrentEpoch: currEpoch,
PeriodStart: periodStart,
Index: deadlineIdx,
Index: deadlineIdx % WPoStPeriodDeadlines,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasoning for this operation is a bit opaque (tho I understand it). I think clearer would be to cap periodProgress to WPoStProvingPeriod - 1, and then the rest of the arithmetic will work out.

Although if the period has been missed, I think Index == WPoStPeriodDeadlines is correct. I don't think this index should be inconsistent with the PeriodStart and other fields of this struct. The caller shouldn't be using if if it's expired. So now maybe I don't think we should change it, except to ensure it doesn't exceed WPoStPeriodDeadlines.

@anorth
Copy link
Member

anorth commented May 12, 2020

Subsumed by #349

@anorth anorth closed this May 12, 2020
@anorth anorth deleted the fix/deadlines-missed-pp branch October 10, 2020 04:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants