Skip to content

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

@vmx

Description

@vmx
Contributor

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

vmx commented on Aug 17, 2023

@vmx
ContributorAuthor

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

simonatsn

simonatsn commented on Aug 17, 2023

@simonatsn
Contributor

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

sandsentinel

sandsentinel commented on Sep 19, 2023

@sandsentinel
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

vmx commented on Sep 19, 2023

@vmx
ContributorAuthor

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

simonatsn commented on Sep 19, 2023

@simonatsn
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

vmx commented on Sep 22, 2023

@vmx
ContributorAuthor

@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

vmx commented on Oct 5, 2023

@vmx
ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @vmx@simonatsn@sandsentinel

        Issue actions

          PC1/PC2: sector size at compile time only? · Issue #23 · supranational/supra_seal