Skip to content

Commit

Permalink
cargo fix+fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Sep 21, 2023
1 parent 07432db commit a8a06e7
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion eth-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![feature(associated_type_defaults)]
#![feature(generic_const_exprs)]
mod spec;
pub use spec::{Spec, Minimal, Testnet, Mainnet};
pub use spec::{Mainnet, Minimal, Spec, Testnet};

mod curve;
pub use curve::{AppCurveExt, HashCurveExt};
Expand Down
5 changes: 4 additions & 1 deletion lightclient-circuits/src/aggregation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{env::{var, set_var}, iter};
use std::{
env::{set_var, var},
iter,
};

use eth_types::Testnet;
use halo2_base::{
Expand Down
2 changes: 1 addition & 1 deletion lightclient-circuits/src/committee_update_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ mod tests {
// let instances =
// CommitteeUpdateCircuit::<Testnet, bn256::Fr>::instance(witness.pubkeys_compressed);
// let num_instances = instances[0].len();

let instances = agg_circuit.instances();
let num_instances = agg_circuit.num_instance();

Expand Down
16 changes: 11 additions & 5 deletions lightclient-circuits/src/gadget/crypto/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use eth_types::Field;
use halo2_base::{
gates::{
builder::{
assign_threads_in, FlexGateConfigParams, KeygenAssignments,
MultiPhaseThreadBreakPoints, ThreadBreakPoints, CircuitBuilderStage,
assign_threads_in, CircuitBuilderStage, FlexGateConfigParams, KeygenAssignments,
MultiPhaseThreadBreakPoints, ThreadBreakPoints,
},
range::{RangeConfig, RangeStrategy},
},
Expand Down Expand Up @@ -65,8 +65,15 @@ impl<F: Field, ThreadBuilder: ThreadBuilderBase<F>> ShaCircuitBuilder<F, ThreadB
}
}

pub fn from_stage(builder: ThreadBuilder, break_points: Option<MultiPhaseThreadBreakPoints>, stage: CircuitBuilderStage) -> Self {
Self::new(builder.unknown(stage == CircuitBuilderStage::Keygen), break_points)
pub fn from_stage(
builder: ThreadBuilder,
break_points: Option<MultiPhaseThreadBreakPoints>,
stage: CircuitBuilderStage,
) -> Self {
Self::new(
builder.unknown(stage == CircuitBuilderStage::Keygen),
break_points,
)
}

/// Creates a new [ShaCircuitBuilder] with `use_unknown` of [ShaThreadBuilder] set to true.
Expand All @@ -77,7 +84,6 @@ impl<F: Field, ThreadBuilder: ThreadBuilderBase<F>> ShaCircuitBuilder<F, ThreadB
/// Creates a new [ShaCircuitBuilder] with `use_unknown` of [GateThreadBuilder] set to false.
pub fn mock(builder: ThreadBuilder) -> Self {
Self::new(builder.unknown(false), None)

}

/// Creates a new [ShaCircuitBuilder].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ impl<F: Field> ThreadBuilderBase<F> for ShaThreadBuilder<F> {
}

fn from_stage(stage: CircuitBuilderStage) -> Self {
Self::new(stage == CircuitBuilderStage::Prover).unknown(stage == CircuitBuilderStage::Keygen)
Self::new(stage == CircuitBuilderStage::Prover)
.unknown(stage == CircuitBuilderStage::Keygen)
}

fn unknown(mut self, use_unknown: bool) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ impl<F: Field> ThreadBuilderBase<F> for ShaBitThreadBuilder<F> {
}

fn from_stage(stage: CircuitBuilderStage) -> Self {
Self::new(stage == CircuitBuilderStage::Prover).unknown(stage == CircuitBuilderStage::Keygen)
Self::new(stage == CircuitBuilderStage::Prover)
.unknown(stage == CircuitBuilderStage::Keygen)
}

fn unknown(mut self, use_unknown: bool) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion lightclient-circuits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pub mod gadget;
pub mod util;
pub mod witness;

pub mod aggregation;
pub mod committee_update_circuit;
pub mod sync_step_circuit;
pub mod aggregation;

mod builder;
mod poseidon;
Expand Down
5 changes: 1 addition & 4 deletions lightclient-circuits/src/sync_step_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,7 @@ impl<S: Spec, F: Field> SyncStepCircuit<S, F> {

let h = sha256_chip.digest::<64>(
thread_pool,
HashInput::TwoToOne(
h.output_bytes.into(),
participation_sum_bytes.into(),
),
HashInput::TwoToOne(h.output_bytes.into(), participation_sum_bytes.into()),
false,
)?;

Expand Down
1 change: 0 additions & 1 deletion lightclient-circuits/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub use common::*;

use std::{cell::RefCell, path::Path, rc::Rc};


mod constraint_builder;
pub(crate) use constraint_builder::*;

Expand Down
5 changes: 4 additions & 1 deletion lightclient-circuits/src/util/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ use crate::gadget::Expr;
use eth_types::*;
use halo2_base::{
gates::{
builder::{FlexGateConfigParams, KeygenAssignments, MultiPhaseThreadBreakPoints, CircuitBuilderStage},
builder::{
CircuitBuilderStage, FlexGateConfigParams, KeygenAssignments,
MultiPhaseThreadBreakPoints,
},
flex_gate::FlexGateConfig,
},
Context,
Expand Down
10 changes: 7 additions & 3 deletions prover/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct Args {
pub out: Out,

#[clap(long, short)]
pub k: Option<u32>,
pub k: Option<u32>,

#[clap(
long,
Expand All @@ -39,14 +39,18 @@ pub struct Args {
#[clap(long, short)]
pub input_path: Option<PathBuf>,

#[clap(long, short, help = "Beacon node URL", default_value = "http://localhost::5052")]
#[clap(
long,
short,
help = "Beacon node URL",
default_value = "http://localhost::5052"
)]
pub node_url: String,

#[clap(index = 1, help = "path to output", default_value = ".")]
pub path_out: PathBuf,
}


#[derive(Clone, clap::Args)]
pub struct AggregationArgs {
#[clap(flatten)]
Expand Down

0 comments on commit a8a06e7

Please sign in to comment.