-
Notifications
You must be signed in to change notification settings - Fork 315
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
Conversation
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.
Looking good, left a few comments, none blocking.
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? ( |
Not sure, but I will try it and debug. Should do the same for the real sector sizes, too to verify before finalizing this. |
@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. |
This PR adds a new API function,
fauxrep
, which allows fake sealing for testing purposes.fauxrep
takes aPoRepConfig
, a replica path, and a cache path — and returns a new, random-but-validCommR
and writes all artifacts needed to legitimately pass PoSt. No PoRep is performed, and no proof is returned. IfFIL_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 theircomm_c
, which is stored in thep_aux
file. This value is randomly generated and is the reason fake replicas have uniquecomm_r
s.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.)