Skip to content

Commit be10f24

Browse files
authored
refactor: use newly exported types (#100)
`storage_proofs_core` exports more commonly used types in newer released versions. This way we don't need to have a direct dependency on `bellperson` and `filecoin_hashers` anymore. This lowers the maintenance burden in case of new released. It also simplifies the feature handling, as we don't need to explicitly enable features on `filecoin_hashers` and `bellperson`.
1 parent 8aac37f commit be10f24

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,19 @@ readme = "README.md"
1010

1111
[dependencies]
1212
anyhow = "1.0.26"
13-
bellperson = { version = "0.26", default-features = false }
1413
bincode = "1.1.2"
1514
blstrs = "0.7"
1615
lazy_static = "1.2"
1716
serde = "1.0.104"
1817
filecoin-proofs-v1 = { package = "filecoin-proofs", version = "~18.0.0", default-features = false }
19-
filecoin-hashers = { version = "~12.0.0", default-features = false, features = ["poseidon", "sha256"] }
2018
fr32 = { version = "~10.0.0", default-features = false }
2119
storage-proofs-core = { version = "~18.0.0", default-features = false }
2220

2321
[features]
2422
default = ["opencl", "cuda"]
25-
cuda = ["filecoin-proofs-v1/cuda", "filecoin-hashers/cuda", "storage-proofs-core/cuda", "bellperson/cuda"]
26-
cuda-supraseal = ["filecoin-proofs-v1/cuda-supraseal", "filecoin-hashers/cuda", "storage-proofs-core/cuda-supraseal", "bellperson/cuda-supraseal"]
27-
opencl = ["filecoin-proofs-v1/opencl", "filecoin-hashers/opencl", "storage-proofs-core/opencl", "bellperson/opencl"]
23+
cuda = ["filecoin-proofs-v1/cuda", "storage-proofs-core/cuda"]
24+
cuda-supraseal = ["filecoin-proofs-v1/cuda-supraseal", "storage-proofs-core/cuda-supraseal"]
25+
opencl = ["filecoin-proofs-v1/opencl", "storage-proofs-core/opencl"]
2826
multicore-sdr = ["filecoin-proofs-v1/multicore-sdr"]
2927
big-tests = []
3028
# This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD`

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub use filecoin_proofs_v1::types::{
3636
pub use filecoin_proofs_v1::{FallbackPoStSectorProof, SnarkProof, VanillaProof};
3737
pub use fr32;
3838
pub use storage_proofs_core::{
39-
api_version::{ApiFeature, ApiVersion},
39+
api_version::{AggregateVersion, ApiFeature, ApiVersion},
4040
error::Error as StorageProofsError,
41-
merkle::MerkleTreeTrait,
41+
merkle::{Hasher, MerkleTreeTrait},
4242
parameter_cache::{get_parameter_data, get_verifying_key_data},
4343
sector::{OrderedSectorSet, SectorId},
4444
util::NODE_SIZE,

src/seal.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ use std::io::{Read, Seek, Write};
44
use std::path::{Path, PathBuf};
55

66
use anyhow::{bail, ensure, Error, Result};
7-
use bellperson::groth16::aggregate::AggregateVersion;
87
use blstrs::Scalar as Fr;
9-
use filecoin_hashers::Hasher;
108

119
use filecoin_proofs_v1::constants::{
1210
SectorShape16KiB, SectorShape16MiB, SectorShape1GiB, SectorShape2KiB, SectorShape32GiB,
@@ -20,8 +18,9 @@ use filecoin_proofs_v1::{with_shape, Labels as RawLabels};
2018
use serde::{Deserialize, Serialize};
2119

2220
use crate::{
23-
AggregateSnarkProof, ApiFeature, Commitment, PieceInfo, ProverId, RegisteredAggregationProof,
24-
RegisteredSealProof, SectorId, Ticket, UnpaddedByteIndex, UnpaddedBytesAmount,
21+
AggregateSnarkProof, AggregateVersion, ApiFeature, Commitment, Hasher, PieceInfo, ProverId,
22+
RegisteredAggregationProof, RegisteredSealProof, SectorId, Ticket, UnpaddedByteIndex,
23+
UnpaddedBytesAmount,
2524
};
2625

2726
/// The output of [`seal_pre_commit_phase1`].

0 commit comments

Comments
 (0)