Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont recompute post on revert <<redux>> #3924

Merged
merged 3 commits into from
Sep 30, 2020
Merged

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Sep 18, 2020

Supersedes #3833
Fixes #3560 #3561

The previous state machine implementation has an issue whereby:

  • Let's say we're in deadline 5
  • We generate a proof for deadline 5 and submit it successfully
  • When we reach the challenge epoch for deadline 6 (10 minutes before deadline 6 opens), we start proving for deadline 6
  • The chain reorgs such that the revert goes back into deadline 4
    At this point we should resubmit the proof for deadline 5. But the state machine is a single thread, so it would have to either
    • Cancel proving for deadline 6
    • Wait for proving for deadline 6 to complete, then try to resubmit for deadline 5 (if it hasn't already expired)

This PR instead creates two separate go routines:

  1. Go routine that just generates proofs:
    Each time the head advances
  • If a deadline has expired, abort any ongoing proof for that deadline
  • If we reach the challenge epoch for a deadline, start proving
  • Once the proof completes, add it to a cache
  1. Go routine that submits proofs:
    Each time the head changes
  • If the head reverted, invalidate any submitted proofs affected by the revert
  • If the head reaches submit confidence for a deadline, and the proof has been generated, submit the proof

@dirkmc dirkmc changed the title Dont recompute post on submit <<redux>> Dont recompute post on revert <<redux>> Sep 18, 2020
@dirkmc dirkmc force-pushed the feat/dont-recompute-PoST-redux branch 3 times, most recently from e4dea8d to 8e6b255 Compare September 22, 2020 14:01
@dirkmc dirkmc marked this pull request as ready for review September 22, 2020 14:01
@dirkmc dirkmc requested a review from Stebalien September 22, 2020 14:02
@dirkmc dirkmc force-pushed the feat/dont-recompute-PoST-redux branch 2 times, most recently from 22e23c5 to d33b474 Compare September 22, 2020 14:16
@dirkmc dirkmc force-pushed the feat/dont-recompute-PoST-redux branch from d33b474 to 7eb9bec Compare September 24, 2020 12:38
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 really good, I don't see anything obviously wrong

The only thing to do here is to convert some things to use the now actor abstraction layer

storage/wdpost_changehandler.go Outdated Show resolved Hide resolved
…ST-abstract

Use abstract types for Dont recompute post on revert
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, but I'd like to run this on some real miner node before merging

@magik6k
Copy link
Contributor

magik6k commented Sep 30, 2020

(Just worked on 3 partitions on my miner)

@magik6k magik6k merged commit 7a3a2f8 into master Sep 30, 2020
@magik6k magik6k deleted the feat/dont-recompute-PoST-redux branch September 30, 2020 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not re-compute window PoSt on revert
2 participants