diff --git a/fil-proofs-tooling/src/shared.rs b/fil-proofs-tooling/src/shared.rs index c475efa80..d54191e2d 100644 --- a/fil-proofs-tooling/src/shared.rs +++ b/fil-proofs-tooling/src/shared.rs @@ -5,29 +5,12 @@ use std::io::{BufWriter, Seek, SeekFrom, Write}; use ff::PrimeField; use filecoin_hashers::Hasher; use filecoin_proofs::{ - add_piece, - fauxrep_aux, - seal_pre_commit_phase1, - seal_pre_commit_phase2, - validate_cache_for_precommit_phase2, - DefaultPieceHasher, - DefaultTreeHasher, - MerkleTreeTrait, - PaddedBytesAmount, - PieceInfo, - PoRepConfig, - PoStConfig, - PoStType, - PrivateReplicaInfo, - PublicReplicaInfo, - SealPreCommitOutput, - SealPreCommitPhase1Output, - SectorSize, - UnpaddedBytesAmount, - WINDOW_POST_CHALLENGE_COUNT, - WINDOW_POST_SECTOR_COUNT, - WINNING_POST_CHALLENGE_COUNT, - WINNING_POST_SECTOR_COUNT, + add_piece, fauxrep_aux, seal_pre_commit_phase1, seal_pre_commit_phase2, + validate_cache_for_precommit_phase2, DefaultPieceHasher, DefaultTreeHasher, MerkleTreeTrait, + PaddedBytesAmount, PieceInfo, PoRepConfig, PoStConfig, PoStType, PrivateReplicaInfo, + PublicReplicaInfo, SealPreCommitOutput, SealPreCommitPhase1Output, SectorSize, + UnpaddedBytesAmount, WINDOW_POST_CHALLENGE_COUNT, WINDOW_POST_SECTOR_COUNT, + WINNING_POST_CHALLENGE_COUNT, WINNING_POST_SECTOR_COUNT, }; use generic_array::typenum::Unsigned; use log::info; @@ -349,7 +332,7 @@ pub fn get_porep_config(sector_size: u64, api_version: ApiVersion let arbitrary_porep_id = [99; 32]; if util::is_groth16_field::() { - PoRepConfig::new_groth16(sector_size.into(), arbitrary_porep_id, api_version) + PoRepConfig::new_groth16(sector_size, arbitrary_porep_id, api_version) } else { PoRepConfig::new_halo2(sector_size.into(), arbitrary_porep_id, api_version) } diff --git a/filecoin-proofs/src/api/seal.rs b/filecoin-proofs/src/api/seal.rs index 6ce336fa4..4983651cf 100644 --- a/filecoin-proofs/src/api/seal.rs +++ b/filecoin-proofs/src/api/seal.rs @@ -47,12 +47,8 @@ use crate::{ get_stacked_verifying_key, }, constants::{ - DefaultBinaryTree, - DefaultPieceDomain, - DefaultPieceHasher, - DefaultTreeDomain, - DefaultTreeHasher, - SINGLE_PARTITION_PROOF_LEN, + DefaultBinaryTree, DefaultPieceDomain, DefaultPieceHasher, DefaultTreeDomain, + DefaultTreeHasher, SINGLE_PARTITION_PROOF_LEN, }, parameters::setup_params, pieces::{self, verify_pieces}, diff --git a/filecoin-proofs/src/parameters.rs b/filecoin-proofs/src/parameters.rs index 17a69acfb..7db393ffc 100644 --- a/filecoin-proofs/src/parameters.rs +++ b/filecoin-proofs/src/parameters.rs @@ -106,7 +106,7 @@ pub fn setup_params( let layer_challenges = if is_groth16_field::() { select_challenges( partitions, - POREP_MINIMUM_CHALLENGES.from_sector_size(u64::from(sector_bytes)), + POREP_MINIMUM_CHALLENGES.from_sector_size(sector_bytes), num_layers, ) } else { diff --git a/storage-proofs-core/Cargo.toml b/storage-proofs-core/Cargo.toml index 5a00c7fbd..676b2e0be 100644 --- a/storage-proofs-core/Cargo.toml +++ b/storage-proofs-core/Cargo.toml @@ -39,10 +39,8 @@ gperftools = { version = "0.2", optional = true } num_cpus = "1.10.1" semver = "1.0.6" fr32 = { path = "../fr32", version = "~5.0.0"} -# -#blstrs = "0.6.0" + blstrs = "0.6.1" -#>>>>>>> 128f7209ec583e023f04630102ef1dd17fbe2370 cbc = { version = "0.1.2", features = ["std"] } halo2_proofs = "0.2.0" fil-halo2-gadgets = { path = "../fil-halo2-gadgets" } diff --git a/storage-proofs-core/benches/merkle_groth16_halo2.rs b/storage-proofs-core/benches/merkle_groth16_halo2.rs index e2d10bca3..5a44e40ea 100644 --- a/storage-proofs-core/benches/merkle_groth16_halo2.rs +++ b/storage-proofs-core/benches/merkle_groth16_halo2.rs @@ -20,8 +20,9 @@ use halo2_proofs::{ plonk::{self, Circuit, Column, ConstraintSystem, Instance}, }; use rand::thread_rng; +use storage_proofs_core::compound_proof::CompoundProof; +use storage_proofs_core::merkle::MerkleProofTrait; use storage_proofs_core::{ - compound_proof::CompoundProof as _, gadgets::por::{PoRCircuit, PoRCompound}, halo2::{ self, @@ -31,7 +32,7 @@ use storage_proofs_core::{ }, CircuitRows, Halo2Field, Halo2Keypair, }, - merkle::{MerkleProofTrait, MerkleTree, MerkleTreeTrait}, + merkle::{MerkleTree, MerkleTreeTrait}, por as vanilla, }; diff --git a/storage-proofs-core/src/merkle/mod.rs b/storage-proofs-core/src/merkle/mod.rs index 87df4dd6d..7526647f0 100644 --- a/storage-proofs-core/src/merkle/mod.rs +++ b/storage-proofs-core/src/merkle/mod.rs @@ -18,6 +18,8 @@ pub use tree::*; pub type LCStore = LevelCacheStore; +pub type MerkleTree = DiskTree; + /// A tree that is fully persisted to disk. /// /// It's generic over the hash function `H`, the base arity `U`, sub-tree arity `V` and top-tree diff --git a/storage-proofs-update/src/constants.rs b/storage-proofs-update/src/constants.rs index 168420ba6..fb1dee633 100644 --- a/storage-proofs-update/src/constants.rs +++ b/storage-proofs-update/src/constants.rs @@ -76,11 +76,11 @@ pub type TreeD = BinaryMerkleTree>; pub type TreeDStore = DiskStore>; pub type TreeDArity = U2; +pub type TreeRHasher = PoseidonHasher; pub type TreeRDomain = as Hasher>::Domain; pub type TreeR = LCTree, U, V, W>; // All valid TreeR shapes have the same base-tree shape. pub type TreeRBase = LCTree, U8, U0, U0>; -pub type TreeRHasher = PoseidonHasher; // The number of groth16 partitions for the given sector size. pub const fn partition_count(sector_nodes: usize) -> usize {