-
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
Reject deals that are > 7 days in the future in the BasicDealFilter #4173
Conversation
node/modules/storageminer.go
Outdated
@@ -468,6 +469,13 @@ func BasicDealFilter(user dtypes.DealFilter) func(onlineOk dtypes.ConsiderOnline | |||
return false, fmt.Sprintf("cannot seal a sector before %s", deal.Proposal.StartEpoch), nil | |||
} | |||
|
|||
// Reject if it's more than 90 days in the future | |||
// TODO: read from cfg | |||
maxStartEpoch := ht + abi.ChainEpoch(90*builtin.EpochsInDay) |
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.
90 days is probably way more than most miners would expect.
I'd set this to 7 days for now, than work on getting this to the config
@@ -468,6 +469,13 @@ func BasicDealFilter(user dtypes.DealFilter) func(onlineOk dtypes.ConsiderOnline | |||
return false, fmt.Sprintf("cannot seal a sector before %s", deal.Proposal.StartEpoch), nil | |||
} | |||
|
|||
// Reject if it's more than 7 days in the future | |||
// TODO: read from cfg | |||
maxStartEpoch := ht + abi.ChainEpoch(7*builtin.EpochsInDay) |
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.
Consider using earliest
here.
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.
@schomatis this is actually the latest epoch that the deal can start at, to prevent them for setting a start date really far in the future. Sorry if the terminology was confusing.
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.
@ingar the suggestion is to use earliest in place of ht
here -- cause if sealDuration > 7 days, then there is no acceptable window for StartEpoch.
We need to use
maxStartEpoch := earliest + abi.ChainEpoch(7*builtin.EpochsInDay)
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.
Got it.
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.
Follow-up fix in #4337.
Just had a batch of offline deals rejected because the start epoch was 10 days away. There is a TODO in the above summary that states "read from config". Is this something that can be added fairly soon? Many thanks!! |
Summary
Reject deals that start too far in the future. Right now, just make this 7 days, as discussed in the issue.
TODO: read from config
Resolves #3929