Skip to content

Commit

Permalink
feat: add support for Non-interactive PoRep
Browse files Browse the repository at this point in the history
This commit adds support for ni-porep.

Also Rust >= 1.70 is needed due to the dependency on `home` v0.5.9 and
fix the corresponding new Clippy warnings.
  • Loading branch information
vmx committed Apr 23, 2024
1 parent 1fb52f0 commit 18407d0
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
- publish_darwin_release
rustfmt:
docker:
- image: cimg/rust:1.67
- image: cimg/rust:1.70
resource_class: small
steps:
- checkout
Expand Down
30 changes: 9 additions & 21 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,10 @@ c-headers = ["safer-ffi/headers"]
# This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD`
# setting is ignored, no `TemporaryAux` file will be written.
fixed-rows-to-discard = ["filecoin-proofs-api/fixed-rows-to-discard"]

[patch.crates-io]
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", branch = "ni-porep" }
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs" }
filecoin-hashers = { git = "https://github.com/filecoin-project/rust-fil-proofs" }
fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs" }
storage-proofs-core = { git = "https://github.com/filecoin-project/rust-fil-proofs" }
2 changes: 1 addition & 1 deletion rust/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.67.1"
channel = "1.70.0"
components = ["clippy", "rustfmt"]
2 changes: 1 addition & 1 deletion rust/src/fvm/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl TryFrom<u32> for EngineVersion {
16 | 17 => Ok(EngineVersion::V1),
18 | 19 | 20 => Ok(EngineVersion::V2),
21 | 22 => Ok(EngineVersion::V3),
_ => return Err(anyhow!("network version not supported")),
_ => Err(anyhow!("network version not supported")),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions rust/src/proofs/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,7 @@ pub mod tests {
RegisteredSealProof::StackedDrg2KiBV1,
RegisteredSealProof::StackedDrg2KiBV1_1,
RegisteredSealProof::StackedDrg2KiBV1_1_Feat_SyntheticPoRep,
RegisteredSealProof::StackedDrg2KiBV1_1_Feat_NonInteractivePoRep,
];
for version in versions {
info!("test_sealing_versions[{:?}]", version);
Expand Down
36 changes: 36 additions & 0 deletions rust/src/proofs/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ pub enum RegisteredSealProof {
StackedDrg512MiBV1_1_Feat_SyntheticPoRep,
StackedDrg32GiBV1_1_Feat_SyntheticPoRep,
StackedDrg64GiBV1_1_Feat_SyntheticPoRep,
StackedDrg2KiBV1_1_Feat_NonInteractivePoRep,
StackedDrg8MiBV1_1_Feat_NonInteractivePoRep,
StackedDrg512MiBV1_1_Feat_NonInteractivePoRep,
StackedDrg32GiBV1_1_Feat_NonInteractivePoRep,
StackedDrg64GiBV1_1_Feat_NonInteractivePoRep,
}

impl From<api::RegisteredSealProof> for RegisteredSealProof {
Expand Down Expand Up @@ -90,6 +95,21 @@ impl From<api::RegisteredSealProof> for RegisteredSealProof {
StackedDrg64GiBV1_1_Feat_SyntheticPoRep => {
RegisteredSealProof::StackedDrg64GiBV1_1_Feat_SyntheticPoRep
}
StackedDrg2KiBV1_1_Feat_NonInteractivePoRep => {
RegisteredSealProof::StackedDrg2KiBV1_1_Feat_NonInteractivePoRep
}
StackedDrg8MiBV1_1_Feat_NonInteractivePoRep => {
RegisteredSealProof::StackedDrg8MiBV1_1_Feat_NonInteractivePoRep
}
StackedDrg512MiBV1_1_Feat_NonInteractivecPoRep => {
RegisteredSealProof::StackedDrg512MiBV1_1_Feat_NonInteractivePoRep
}
StackedDrg32GiBV1_1_Feat_NonInteractivePoRep => {
RegisteredSealProof::StackedDrg32GiBV1_1_Feat_NonInteractivePoRep
}
StackedDrg64GiBV1_1_Feat_NonInteractivePoRep => {
RegisteredSealProof::StackedDrg64GiBV1_1_Feat_NonInteractivePoRep
}
}
}
}
Expand Down Expand Up @@ -125,6 +145,22 @@ impl From<RegisteredSealProof> for api::RegisteredSealProof {
RegisteredSealProof::StackedDrg64GiBV1_1_Feat_SyntheticPoRep => {
StackedDrg64GiBV1_1_Feat_SyntheticPoRep
}

RegisteredSealProof::StackedDrg2KiBV1_1_Feat_NonInteractivePoRep => {
StackedDrg2KiBV1_1_Feat_NonInteractivePoRep
}
RegisteredSealProof::StackedDrg8MiBV1_1_Feat_NonInteractivePoRep => {
StackedDrg8MiBV1_1_Feat_NonInteractivePoRep
}
RegisteredSealProof::StackedDrg512MiBV1_1_Feat_NonInteractivePoRep => {
StackedDrg512MiBV1_1_Feat_NonInteractivecPoRep
}
RegisteredSealProof::StackedDrg32GiBV1_1_Feat_NonInteractivePoRep => {
StackedDrg32GiBV1_1_Feat_NonInteractivePoRep
}
RegisteredSealProof::StackedDrg64GiBV1_1_Feat_NonInteractivePoRep => {
StackedDrg64GiBV1_1_Feat_NonInteractivePoRep
}
}
}
}
Expand Down

0 comments on commit 18407d0

Please sign in to comment.