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

PreCommitPolicy: Don't try to align expirations on proving period boundaries #7018

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

arajasek
Copy link
Contributor

After a thorough examination of actors code, the PreCommitPolicy trying to align expirations on proving period boundaries is entirely unnecessary (and not even doing what it thinks it should be doing). Removing this also fixes #6065.

Also included in this PR is a check that the proposed PCP expiration isn't at risk of being invalidly small as a result of the PC message taking too long to land on chain. "At risk" is currently defined as "within 24 hours", though this should probably be a config setting.

@arajasek arajasek requested a review from a team as a code owner August 10, 2021 18:33
@arajasek
Copy link
Contributor Author

Subsumes #6729

expected := h + policy.GetMaxSectorExpirationExtension() - (pBuffer * 2)
// as set just before returning within Expiration()
expected += miner.WPoStProvingPeriod - (expected % miner.WPoStProvingPeriod) + pBoundary - 1
expected := h + policy.GetMaxSectorExpirationExtension() - pBuffer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why these were subtracting out pBuffer * 2, since that isn't what the cc lifetime method seems to do.

Copy link
Contributor

@placer14 placer14 Aug 10, 2021

Choose a reason for hiding this comment

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

I did ask for extra scrutiny, but my implementation is definitely wrong here, hidden by the chosen constants. Thanks for catching this. Only rationale I can come with here was to match this but it's external to the Policy entirely. Not sure why I landed with that.

storage/miner.go Outdated
provingBoundary = md.PeriodStart % md.WPoStProvingPeriod
provingBuffer = md.WPoStProvingPeriod * 2
cfg = sealing.GetSealingConfigFunc(m.getSealConfig)
provingBuffer = md.WPoStProvingPeriod * 2

// TODO: Maybe we update this policy after actor upgrades?
Copy link
Member

Choose a reason for hiding this comment

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

Can drop the comment. That comment was probably about removing the proving boundary (which we used to require).

@arajasek arajasek merged commit 07c636b into master Aug 11, 2021
@arajasek arajasek deleted the asr/sector-exp-alignment branch August 11, 2021 17:05
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.

[BUG] Sector duration calculation causes Precommit rejection
3 participants