Skip to content

Commit

Permalink
Merge pull request #2937 from o1-labs/dw/rust-1.79
Browse files Browse the repository at this point in the history
Support Rust 1.79
  • Loading branch information
dannywillems authored Jan 10, 2025
2 parents db28894 + 2136d6c commit c7f78ba
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
RUST_TOOLCHAIN_COVERAGE_VERSION: "1.74"
strategy:
matrix:
rust_toolchain_version: ["1.72", "1.73", "1.74", "1.75", "1.76", "1.77", "1.78"]
rust_toolchain_version: ["1.72", "1.73", "1.74", "1.75", "1.76", "1.77", "1.78", "1.79"]
# FIXME: currently not available for 5.0.0.
# It might be related to boxroot dependency, and we would need to bump
# up the ocaml-rs dependency
Expand Down
12 changes: 4 additions & 8 deletions ivc/src/ivc/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,11 @@ pub fn build_fixed_selectors<const N_COL_TOTAL: usize, const N_CHALS: usize>(
}

for i in N_BLOCKS..N_FSEL_IVC - N_BLOCKS {
PoseidonBN254Parameters
.constants()
.iter()
.enumerate()
.for_each(|(_round, rcs)| {
rcs.iter().enumerate().for_each(|(_state_index, rc)| {
selectors[i] = vec![*rc; domain_size];
});
PoseidonBN254Parameters.constants().iter().for_each(|rcs| {
rcs.iter().for_each(|rc| {
selectors[i] = vec![*rc; domain_size];
});
});
}

selectors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn create_chain<F: PrimeField>(
// Make sure that the inputs are smaller than the modulus just in case
let inputs: Vec<BigUint> = inputs.iter().map(|input| input % modulus.clone()).collect();

let mut witness = array::from_fn(|_| vec![F::zero(); 0]);
let mut witness: [Vec<F>; COLUMNS] = array::from_fn(|_| vec![]);

let foreign_modulus = ForeignElement::from_biguint(modulus);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub fn create<F: PrimeField>(
right_input: &BigUint,
foreign_field_modulus: &BigUint,
) -> ([Vec<F>; COLUMNS], ExternalChecks<F>) {
let mut witness = array::from_fn(|_| vec![F::zero(); 0]);
let mut witness: [Vec<F>; COLUMNS] = array::from_fn(|_| vec![]);
let mut external_checks = ExternalChecks::<F>::default();

// Compute quotient and remainder using foreign field modulus
Expand Down
3 changes: 1 addition & 2 deletions kimchi/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,7 @@ where
index_evals.extend(
foreign_field_mul::gadget::circuit_gates()
.iter()
.enumerate()
.map(|(_, gate_type)| (*gate_type, selector)),
.map(|gate_type| (*gate_type, selector)),
);
}

Expand Down
3 changes: 1 addition & 2 deletions kimchi/src/tests/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fn create_keccak_witness<G: KimchiCurve>(message: BigUint) -> [Vec<G::ScalarFiel
where
G::BaseField: PrimeField,
{
let mut witness: [Vec<G::ScalarField>; KECCAK_COLS] =
array::from_fn(|_| vec![G::ScalarField::zero(); 0]);
let mut witness: [Vec<G::ScalarField>; KECCAK_COLS] = array::from_fn(|_| vec![]);
extend_keccak_witness(&mut witness, message);
// Adding dummy row to avoid out of bounds in squeeze constraints accessing Next row
let dummy_row: [Vec<G::ScalarField>; KECCAK_COLS] =
Expand Down
2 changes: 1 addition & 1 deletion o1vm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ mod tests {
assert_eq!(memory_size(1024_usize), "1.0 KiB");
assert_eq!(memory_size(1024 * 1024_usize), "1.0 MiB");
assert_eq!(memory_size(2100 * 1024 * 1024_usize), "2.1 GiB");
assert_eq!(memory_size(std::usize::MAX), "16.0 EiB");
assert_eq!(memory_size(usize::MAX), "16.0 EiB");
}
}

0 comments on commit c7f78ba

Please sign in to comment.