-
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: Fix edge-case when deal duration is close to the MaxSectorExpirationExtension #6729
Conversation
36f4994
to
56283c4
Compare
exp = *hardLimit | ||
} | ||
|
||
exp += miner.WPoStProvingPeriod - (exp % miner.WPoStProvingPeriod) + p.provingBoundary - 1 |
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.
Not sure if this is even needed anymore in v5 actors. At least could add a comment on what this is doing
exp += miner.WPoStProvingPeriod - (exp % miner.WPoStProvingPeriod) + p.provingBoundary - 1 | |
// align on proving period boundary | |
exp += miner.WPoStProvingPeriod - (exp % miner.WPoStProvingPeriod) + p.provingBoundary - 1 |
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.
If it's not needed I'd love to take it out, I just don't know. Adding comment for now, with a TODO saying it could be taken out.
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 think it has been needed for a while. But @ZenGround0 would know fo rsure.
|
||
if exp < minEnd { | ||
// we need to add* ceil(end - maxEnd) days | ||
daysToAdd := (minEnd-exp)/miner.WPoStProvingPeriod + 1 |
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.
Isn't this doing floor()+1
? Ceil would be ((minEnd-exp) + miner.WPoStProvingPeriod - 1)/miner.WPoStProvingPeriod
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 mean, in this case with 2779/2880 probability, ceil = floor + 1
:P
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.
(and in the 1/2880 case, we're off by 1 day, so no biggie)
…MaxSectorExpirationExtension
56283c4
to
ef67e38
Compare
@arajasek this needs a rebase. I've tried, but it looks like the code currently in master is slightly different and takes some form of "proving buffer" into account. |
Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 48 hours. You are always more than welcome to reopen the PR later as well! |
Fixes #6065
TODO: Add tests to precommit_policy_test