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

feat: split up window post API into separate calls #1278

Merged
merged 4 commits into from
Sep 14, 2020

Conversation

cryptonemo
Copy link
Collaborator

An alternate PR/proposal to #1269. Winning PoSt is not working at the moment.

Copy link
Collaborator

@porcuquine porcuquine left a comment

Choose a reason for hiding this comment

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

I think this is good. The general form and structure is much better than before and basically as I would expect. There are some rough edges in terms of shape/names and also where some assumptions feel too baked in. Getting this right is tricky, and as you suggest, we may need to make another pass to improve things even after moving forward to release this feature. I think one round of effort to incorporate at least the low-hanging fruit in my comments may be worthwhile. I'd also like to take one more look at it, perhaps after just a little more cleanup, in light of having had time to absorb it. As I said, I think everything looks right, and passing tests is good. However, there are ways a refactor like this could lead to hard-to-detect changes of meaning, so we should be sure before merging. Just a little more scrubbing (on your part) and study/thought (on mine) should get us there.

filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
storage-proofs/post/src/fallback/vanilla.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/types/mod.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
filecoin-proofs/src/api/post.rs Outdated Show resolved Hide resolved
@vmx
Copy link
Contributor

vmx commented Sep 11, 2020

I don't have a enough knowledge to do a review about the correctness. I saw that there are quite some iterators which are not parallel ones. I don't know if that matter and I also know that many of them are likely hard to fix. Parallel iterators are hard to do with the current code, there are just too many side effects in the loops. In order to make it easier, the coding style would need to change to a more functional, side-effect free style.

I guess making everything parallelizable is probably out of scope for this PR, I just wanted to mention it to keep it in mind for future refactors.

Copy link
Collaborator

@porcuquine porcuquine 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.

assert_eq!(post_config.typ, PoStType::Winning);
},
PoStType::Winning => {
assert_eq!(post_config.typ, PoStType::Winning);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This assertion is quite redundant here. The previous line literally guarantees this will never fail, so I think it can be removed. I would instead add a comment justifying the decision. Since I don't think the number of partitions is structurally guaranteed to be one, I would probably add a comment justifying this decision. That comment should make clear what change to the code base (even if it can't be conveniently checked here) would necessitate a change here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, that looks like a hold-over from the previous if/else branch change. Rather than update and push, I'm opting to merge this and update in a future PR.

@cryptonemo cryptonemo merged commit 0450d4d into master Sep 14, 2020
@cryptonemo cryptonemo deleted the split-window-post-new branch September 14, 2020 11:50
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.

3 participants