-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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).
0caaf6b
to
a52352b
Compare
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.