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

Add fauxrep to API for fake sealing. #1194

Merged
merged 1 commit into from
Jul 1, 2020
Merged

Add fauxrep to API for fake sealing. #1194

merged 1 commit into from
Jul 1, 2020

Conversation

porcuquine
Copy link
Collaborator

This PR adds a new API function, fauxrep, which allows fake sealing for testing purposes. fauxrep takes a PoRepConfig, a replica path, and a cache path — and returns a new, random-but-valid CommR and writes all artifacts needed to legitimately pass PoSt. No PoRep is performed, and no proof is returned. If FIL_PROOFS_USE_GPU_TREE_BUILDER is set, the replica tree will be built on GPU.

All fake replicas consist entirely of null bytes, and the implementation depends on this assumption for simplicity. This means all such replicas have interchangeable base layers, partial trees, and comm_r_last values. They differ only in the value of their comm_c, which is stored in the p_aux file. This value is randomly generated and is the reason fake replicas have unique comm_rs.

The PoST API tests have been enhanced to use both real and fake sealing. This preserves their value in establishing the correctness of seal and PoSt in conjunction — and also demonstrates that fauxrep produces sectors indistinguishable from those produced by seal as far as PoSt is concerned. (Of course, they do not come with a seal proof so are no good for mining.)

cryptonemo
cryptonemo previously approved these changes Jul 1, 2020
Copy link
Collaborator

@cryptonemo cryptonemo left a comment

Choose a reason for hiding this comment

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

Looking good, left a few comments, none blocking.

filecoin-proofs/src/api/seal.rs Show resolved Hide resolved
@cryptonemo
Copy link
Collaborator

Hrm, I tried adding in just a fauxrep test for 512MiB and I'm seeing failures. Any reason you can think of that might happen? (proof did not verify). I created new params for all of the test sector sizes used and 2/4/16/32KiB were all good.

@porcuquine
Copy link
Collaborator Author

Hrm, I tried adding in just a fauxrep test for 512MiB and I'm seeing failures. Any reason you can think of that might happen? (proof did not verify). I created new params for all of the test sector sizes used and 2/4/16/32KiB were all good.

Not sure, but I will try it and debug. Should do the same for the real sector sizes, too to verify before finalizing this.

@porcuquine
Copy link
Collaborator Author

@cryptonemo I could not reproduce the problem with 512MiB sectors. I verified it working for me for both Window and Winning PoSt — on CPU and GPU. Given that you are seeing a failure of the proof itself, I suspect something is wrong with your params.

@cryptonemo
Copy link
Collaborator

@cryptonemo I could not reproduce the problem with 512MiB sectors. I verified it working for me for both Window and Winning PoSt — on CPU and GPU. Given that you are seeing a failure of the proof itself, I suspect something is wrong with your params.

32GiB sector test worked fine. I agree about the params.

cryptonemo
cryptonemo previously approved these changes Jul 1, 2020
@porcuquine porcuquine merged commit cd780e1 into master Jul 1, 2020
@porcuquine porcuquine deleted the feat/fauxrep branch August 12, 2020 18:48
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.

2 participants