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.
Activity
vmx commentedon Aug 17, 2023
It wold be cool to read out the sector size from the compiled library. I've opened #24 for that.
simonatsn commentedon Aug 17, 2023
We are looking into supporting more sector sizes as well runtime selection of sector size.
sandsentinel commentedon Sep 19, 2023
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 commentedon 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. The
RegisteredSealProofcontain the sector swhich we have officially blessed groth16 parameters for. The IDs of those
RegisteredSealProofare used to generate a so-called
PorepID`. 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. ThatPoRep
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 thePoRep
that doesn't use theRegisteredSealProof
at all.simonatsn commentedon Sep 19, 2023
@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 commentedon 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 commentedon Oct 5, 2023
With #40 merged, this is now possible, hence closing this issue.