Skip to content

Commit

Permalink
ci: Apply rustfmt and fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
storojs72 committed Jan 17, 2023
1 parent 16e2319 commit 3b74d96
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 37 deletions.
31 changes: 7 additions & 24 deletions fil-proofs-tooling/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -349,7 +332,7 @@ pub fn get_porep_config<F: PrimeField>(sector_size: u64, api_version: ApiVersion
let arbitrary_porep_id = [99; 32];

if util::is_groth16_field::<F>() {
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)
}
Expand Down
8 changes: 2 additions & 6 deletions filecoin-proofs/src/api/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion filecoin-proofs/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn setup_params<F: PrimeField>(
let layer_challenges = if is_groth16_field::<F>() {
select_challenges(
partitions,
POREP_MINIMUM_CHALLENGES.from_sector_size(u64::from(sector_bytes)),
POREP_MINIMUM_CHALLENGES.from_sector_size(sector_bytes),
num_layers,
)
} else {
Expand Down
4 changes: 1 addition & 3 deletions storage-proofs-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
5 changes: 3 additions & 2 deletions storage-proofs-core/benches/merkle_groth16_halo2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -31,7 +32,7 @@ use storage_proofs_core::{
},
CircuitRows, Halo2Field, Halo2Keypair,
},
merkle::{MerkleProofTrait, MerkleTree, MerkleTreeTrait},
merkle::{MerkleTree, MerkleTreeTrait},
por as vanilla,
};

Expand Down
2 changes: 2 additions & 0 deletions storage-proofs-core/src/merkle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub use tree::*;

pub type LCStore<E> = LevelCacheStore<E, File>;

pub type MerkleTree<H, U> = DiskTree<H, U, U0, U0>;

/// 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
Expand Down
2 changes: 1 addition & 1 deletion storage-proofs-update/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ pub type TreeD<F> = BinaryMerkleTree<TreeDHasher<F>>;
pub type TreeDStore<F> = DiskStore<TreeDDomain<F>>;
pub type TreeDArity = U2;

pub type TreeRHasher<F> = PoseidonHasher<F>;
pub type TreeRDomain<F> = <TreeRHasher<F> as Hasher>::Domain;
pub type TreeR<F, U, V, W> = LCTree<TreeRHasher<F>, U, V, W>;
// All valid TreeR shapes have the same base-tree shape.
pub type TreeRBase<F> = LCTree<TreeRHasher<F>, U8, U0, U0>;
pub type TreeRHasher<F> = PoseidonHasher<F>;

// The number of groth16 partitions for the given sector size.
pub const fn partition_count(sector_nodes: usize) -> usize {
Expand Down

0 comments on commit 3b74d96

Please sign in to comment.