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

Do not re-compute window PoSt on revert #3560

Closed
Stebalien opened this issue Sep 4, 2020 · 1 comment · Fixed by #3924
Closed

Do not re-compute window PoSt on revert #3560

Stebalien opened this issue Sep 4, 2020 · 1 comment · Fixed by #3924
Labels
area/mining Area: Mining kind/enhancement Kind: Enhancement

Comments

@Stebalien
Copy link
Member

Currently, lotus will re-compute a window PoSt whenever it sees the chain revert back to the previous deadline. However, this isn't necessary as the window PoSt randomness is based on drand (which won't change).

Instead, we should:

  1. Split the window PoSt process into two parts: proof generation, and message generation.
  2. On revert, do not restart the proof generation.
  3. If we revert past the ChainCommitEpoch, re-generate the window PoSt message with the new randomness, and re-submit it.
@Stebalien Stebalien added effort/day kind/enhancement Kind: Enhancement area/mining Area: Mining labels Sep 4, 2020
@dirkmc
Copy link
Contributor

dirkmc commented Sep 11, 2020

Proposed implementation:

  • Split the window PoST process as suggested above:
    1. Proof generation
    2. Getting beacon randomness & Submitting message to chain
  • Start Proving once we're at the deadline Challenge height (10 minutes before deadline Open)
  • Start Beacon randomness + submit to chain once both
    • Proving is complete
    • We're at the deadline start height + confidence

Proposed states:

  • Start
  • Proving (proof generation)
  • ProvingComplete (waiting for both proof and deadline Open + confidence)
  • Submitting (getting beacon randomness & submitting message to chain)
  • Complete

State changes would be triggered by changes in the chain height.

If the chain reverts to the previous deadline while we're in the Proving state, a state change would not be triggered. When the proof completes the scheduler would remain in ProvingComplete until the chain reached the required height.

If the chain proceeds past the deadline Close epoch, proving is aborted.

Note: Made some edits after talking to @magik6k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mining Area: Mining kind/enhancement Kind: Enhancement
Projects
None yet
2 participants