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

Reject deals that are > 7 days in the future in the BasicDealFilter #4173

Merged
merged 2 commits into from
Oct 5, 2020

Conversation

ingar
Copy link
Contributor

@ingar ingar commented Oct 5, 2020

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

@@ -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)
Copy link
Contributor

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

@magik6k magik6k merged commit dd1661c into master Oct 5, 2020
@magik6k magik6k deleted the feat/basic-filter-on-start-epoch branch October 5, 2020 22:57
@schomatis schomatis changed the title Reject deals that are > 90 days in the future in the BasicDealFilter Reject deals that are > 7 days in the future in the BasicDealFilter Oct 7, 2020
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using earliest here.

Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

Copy link
Contributor

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.

@TippyFlitsUK
Copy link
Contributor

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!!

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.

BasicDealFilter upper bound on StartEpoch
5 participants