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

DeadlineInfo handles expired proving period #343

Merged
merged 2 commits into from
May 5, 2020
Merged

Conversation

anorth
Copy link
Member

@anorth anorth commented May 5, 2020

This provides a PeriodElapsed() predicate and fixes the other ones to indicate that no challenge window is open after a proving period has elapsed and before the proving period start has been updated to the next period.

Also changes assertions from using a too-high deadline index into errors.

@anorth anorth requested a review from magik6k May 5, 2020 05:23
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Looks good, just 1 question to make sure I understand this correctly

func (d *DeadlineInfo) PeriodStarted() bool {
return d.CurrentEpoch >= d.PeriodStart
}

// Whether the proving period has elapsed.
func (d *DeadlineInfo) PeriodElapsed() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this returns true from ComputeProvingPeriodDeadline(minerStateFor(ts).periodStart, ts.Height()) in PoSt scheduling logic, am I supposed to abort, should the code just abort, or is there anything smarter it can do?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think aborting is pretty much it. You probably just have to wait for cron, and if the cron doesn't happen any proof will be rejected anyway.

Possibly you could compute the next period start that you know cron will set it to in order to eagerly begin, but I don't think that complexity is warranted at the moment.

@anorth
Copy link
Member Author

anorth commented May 5, 2020

FYI @acruikshank we probably need a similar check in go-filecoin.

@codecov-io
Copy link

Codecov Report

Merging #343 into master will increase coverage by 0.09%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #343      +/-   ##
==========================================
+ Coverage   37.72%   37.82%   +0.09%     
==========================================
  Files          40       40              
  Lines        4156     4172      +16     
==========================================
+ Hits         1568     1578      +10     
- Misses       2359     2363       +4     
- Partials      229      231       +2     

@anorth anorth merged commit 0eca835 into master May 5, 2020
@anorth anorth deleted the anorth/latedeadline branch May 5, 2020 23:59
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.

3 participants