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

markets - separate watching for pre-commit from prove-commit #4945

Merged
merged 5 commits into from
Nov 26, 2020

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Nov 20, 2020

Depends on filecoin-project/go-fil-markets#453
Fixes #4900

TODO:

@dirkmc dirkmc force-pushed the feat/deal-await-precommit branch 3 times, most recently from fa85007 to 078e0c9 Compare November 20, 2020 16:51
@dineshshenoy dineshshenoy added this to the 💹Storage Deal Success milestone Nov 23, 2020
@dineshshenoy dineshshenoy linked an issue Nov 23, 2020 that may be closed by this pull request
@dirkmc dirkmc force-pushed the feat/deal-await-precommit branch 3 times, most recently from fe3db0b to ce3dbda Compare November 24, 2020 13:27
@dirkmc dirkmc marked this pull request as ready for review November 24, 2020 13:37
@dirkmc dirkmc force-pushed the feat/deal-await-precommit branch 2 times, most recently from 6d8a8d7 to 37a212d Compare November 24, 2020 14:54
@magik6k magik6k requested a review from hannahhoward November 24, 2020 17:40
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Looks good, but it seems we want filecoin-project/go-fil-markets#453 in before this lands

Copy link
Contributor

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

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

There's a lot of logic in here to deal with the ProveCommitSector message in OnDealSectorPreCommitted -- why would we need this? The problem 4900 captures is that we weren't persisting the progression from PreCommit to PostCommit, so, theoretically, if node restarts in between, we lose the sector number from the pre-commit and never get to the end. It's not to cover for the possibility of missing PreCommit entirely. Unless @magik6k wants to say otherwise, I think we can remove the ProveCommitSector logic (which is complicated) from OnDealSectorPreCommitted.

} else {
// If it's a prove-commit message, the parameters don't have deal IDs,
// just a sector number
var params miner.ProveCommitSectorParams
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of logic in here to deal with ProveCommitSector messages -- I'm not clear why we're dealing with this. As I see it, the only case of isActive = true we need to deal with is in the called function.

The goal of #4900 is designed to fix the case where a restart happens between pre-commit and prove-commit. We don't need this code for that.

What is the scenario that causes us to miss the pre-commit message entirely? Even if we shut down the node a long time, we will see the pre-commit when we sync the chain.

Copy link
Contributor Author

@dirkmc dirkmc Nov 25, 2020

Choose a reason for hiding this comment

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

Ah yes that's a good point 👍

Nice catch @hannahhoward. I think it is worth the effort to refactor the code because it will simplify things significantly. I will do so today.

Edit: this is now fixed

@hannahhoward hannahhoward force-pushed the feat/deal-await-precommit branch from 37a212d to c00e19d Compare November 24, 2020 21:09
@hannahhoward
Copy link
Contributor

Oh dear, I think I broke this. So now I need to fix the problem actually.

@hannahhoward hannahhoward force-pushed the feat/deal-await-precommit branch from c00e19d to 47a4128 Compare November 24, 2020 21:26
@hannahhoward
Copy link
Contributor

I've fixed the history... #oops

And I downgraded my comment from a "request changes" to a suggestion, it's up to you if you want to change. Either way, you can merge at your leisure pending @magik6k's approval

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

(testing on my miner; will merge in a bit)

@magik6k magik6k merged commit 6df0340 into master Nov 26, 2020
@magik6k magik6k deleted the feat/deal-await-precommit branch November 26, 2020 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants