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

PC1/PC2: sector size at compile time only? #23

Closed
vmx opened this issue Aug 17, 2023 · 7 comments
Closed

PC1/PC2: sector size at compile time only? #23

vmx opened this issue Aug 17, 2023 · 7 comments

Comments

@vmx
Copy link
Contributor

vmx commented Aug 17, 2023

Am I current that the sector size can only be set at compile time to a single size (currently only 512MiB and 32GiB). Are there any plans to support several sizes at run time?

This is mostly a question, I'm not blocked by having a single size only, it's just inconvenient for testing.

@vmx
Copy link
Contributor Author

vmx commented Aug 17, 2023

It wold be cool to read out the sector size from the compiled library. I've opened #24 for that.

@simonatsn
Copy link
Contributor

We are looking into supporting more sector sizes as well runtime selection of sector size.

@sandsentinel
Copy link
Collaborator

Hi, we were using RegisteredSealProof in our Rust side. But I noticed that RegisteredSealProof only has half of all the sector sizes in it. Is there an alternative struct or parameter that we can use which has all the sector sizes?

@vmx
Copy link
Contributor Author

vmx commented Sep 19, 2023

Let me first explain what the RegisteredSealProof is about. This is defined on our highest level API, the Filecoin Proofs APIwhich lives in the https://github.com/filecoin-project/rust-filecoin-proofs-api/ repo. TheRegisteredSealProofcontain the sector swhich we have officially blessed groth16 parameters for. The IDs of thoseRegisteredSealProofare used to generate a so-calledPorepID`. The code generate it can be found at https://github.com/filecoin-project/rust-filecoin-proofs-api/blob/c8b73874051a6e16ee968bca3415405009f7a38c/src/registry.rs#L241-L251.

That PoRep is then used in the lower level API which lives at https://github.com/filecoin-project/rust-fil-proofs. That PoRep is just an array of 32 bytes.

In your current Rust code, you just use an arbitrary value for it, but ideally it should use the correct PoRep ID as outlined above.

So now it depends on whether you only want to support only the sector sizes with the blessed parameter files that are part of the RegisteredSealProof, or if you also want to support other sizes (in a meeting we thought that supporting 16KiB might make sense, as the trees have the same shape as a 32GiB sector), then you would just use an arbitrary value for the PoRep that doesn't use the RegisteredSealProof at all.

@simonatsn
Copy link
Contributor

@vmx I pushed up a fork that should enable you to choose sector size at runtime. https://github.com/simonatsn/supra_seal. The changes are pretty broad reaching so it would be good if you can give it a try and let me know if you see any issues. If you build it with RUNTIME_SECTOR_SIZE defined it will include support for 2KB through 32GB. Without that define it builds 512MB and 32GB only.

@vmx
Copy link
Contributor Author

vmx commented Sep 22, 2023

@simonatsn sorry for taking so long I finally found the time. I've build it with ./build.sh -r. I then run the PC2 tool (which is easiest for me as I don't need any special NVMe setup for that). I've run and compared it to the Rust implementation with CC sectors of size 2KiB, 4KiB, 16KiB and 512MiB. I then also ran it on a non-CC 16KiB sector. All outputs were as expected.

Let me know if you'd further testing from my side. But I'd say it's good.

@vmx
Copy link
Contributor Author

vmx commented Oct 5, 2023

With #40 merged, this is now possible, hence closing this issue.

@vmx vmx closed this as completed Oct 5, 2023
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

No branches or pull requests

3 participants