Skip to content

Commit 4b01854

Browse files
Fix bincode repo change (#1023)
* Fix bincode inclusion * Add feature serde * fix clippy * fix warnings in benches and solve bincode dependency * use crates io for bincode --------- Co-authored-by: jotabulacios <jbulacios@fi.uba.ar>
1 parent ad2a380 commit 4b01854

File tree

7 files changed

+24
-20
lines changed

7 files changed

+24
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ winter-math = { git = "https://github.com/lambdaclass/winterfell-for-lambdaworks
5353
winter-utils = { git = "https://github.com/lambdaclass/winterfell-for-lambdaworks.git", branch = "derive-clone-v6.4" }
5454
winter-crypto = { git = "https://github.com/lambdaclass/winterfell-for-lambdaworks.git", branch = "derive-clone-v6.4" }
5555

56+
5657
[profile.bench]
5758
lto = true
5859
codegen-units = 1

crates/crypto/src/commitments/kzg.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ impl<const N: usize, F: IsPrimeField<RepresentativeType = UnsignedInteger<N>>, P
276276
#[cfg(test)]
277277
mod tests {
278278
use alloc::vec::Vec;
279+
use core::slice;
279280
use lambdaworks_math::{
280281
cyclic_group::IsGroup,
281282
elliptic_curve::{
@@ -367,7 +368,7 @@ mod tests {
367368
let y0 = FieldElement::from(9000);
368369
let upsilon = &FieldElement::from(1);
369370

370-
let proof = kzg.open_batch(&x, &[y0.clone()], &[p0], upsilon);
371+
let proof = kzg.open_batch(&x, slice::from_ref(&y0), &[p0], upsilon);
371372

372373
assert!(kzg.verify_batch(&x, &[y0], &[p0_commitment], &proof, upsilon));
373374
}

crates/math/benches/fields/baby_bear.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ pub fn babybear_p3_ops_benchmarks(c: &mut Criterion) {
357357
group.bench_with_input(format!("Addition {:?}", &i.len()), &i, |bench, i| {
358358
bench.iter(|| {
359359
for (x, y) in i {
360-
black_box(black_box(*x) + black_box(*y));
360+
let _ = black_box(black_box(*x) + black_box(*y));
361361
}
362362
});
363363
});
@@ -367,7 +367,7 @@ pub fn babybear_p3_ops_benchmarks(c: &mut Criterion) {
367367
group.bench_with_input(format!("Multiplication {:?}", &i.len()), &i, |bench, i| {
368368
bench.iter(|| {
369369
for (x, y) in i {
370-
black_box(black_box(*x) * black_box(*y));
370+
let _ = black_box(black_box(*x) * black_box(*y));
371371
}
372372
});
373373
});
@@ -377,7 +377,7 @@ pub fn babybear_p3_ops_benchmarks(c: &mut Criterion) {
377377
group.bench_with_input(format!("Square {:?}", &i.len()), &i, |bench, i| {
378378
bench.iter(|| {
379379
for (x, _) in i {
380-
black_box(black_box(x).square());
380+
let _ = black_box(black_box(x).square());
381381
}
382382
});
383383
});
@@ -386,7 +386,7 @@ pub fn babybear_p3_ops_benchmarks(c: &mut Criterion) {
386386
group.bench_with_input(format!("Inverse {:?}", &i.len()), &i, |bench, i| {
387387
bench.iter(|| {
388388
for (x, _) in i {
389-
black_box(black_box(x).inverse());
389+
let _ = black_box(black_box(x).inverse());
390390
}
391391
});
392392
});
@@ -396,7 +396,7 @@ pub fn babybear_p3_ops_benchmarks(c: &mut Criterion) {
396396
group.bench_with_input(format!("Division {:?}", &i.len()), &i, |bench, i| {
397397
bench.iter(|| {
398398
for (x, y) in i {
399-
black_box(black_box(*x) / black_box(*y));
399+
let _ = black_box(black_box(*x) / black_box(*y));
400400
}
401401
});
402402
});
@@ -416,7 +416,7 @@ pub fn babybear_extension_ops_benchmarks_p3(c: &mut Criterion) {
416416
group.bench_with_input(format!("Addition of Fp4 {:?}", &i.len()), &i, |bench, i| {
417417
bench.iter(|| {
418418
for (x, y) in i {
419-
black_box(black_box(*x) + black_box(*y));
419+
let _ = black_box(black_box(*x) + black_box(*y));
420420
}
421421
});
422422
});
@@ -428,7 +428,7 @@ pub fn babybear_extension_ops_benchmarks_p3(c: &mut Criterion) {
428428
|bench, i| {
429429
bench.iter(|| {
430430
for (x, y) in i {
431-
black_box(black_box(*x) * black_box(*y));
431+
let _ = black_box(black_box(*x) * black_box(*y));
432432
}
433433
});
434434
},
@@ -438,7 +438,7 @@ pub fn babybear_extension_ops_benchmarks_p3(c: &mut Criterion) {
438438
group.bench_with_input(format!("Square of Fp4 {:?}", &i.len()), &i, |bench, i| {
439439
bench.iter(|| {
440440
for (x, _) in i {
441-
black_box(black_box(x).square());
441+
let _ = black_box(black_box(x).square());
442442
}
443443
});
444444
});
@@ -448,7 +448,7 @@ pub fn babybear_extension_ops_benchmarks_p3(c: &mut Criterion) {
448448
group.bench_with_input(format!("Inverse of Fp4 {:?}", &i.len()), &i, |bench, i| {
449449
bench.iter(|| {
450450
for (x, _) in i {
451-
black_box(black_box(x).inverse());
451+
let _ = black_box(black_box(x).inverse());
452452
}
453453
});
454454
});
@@ -458,7 +458,7 @@ pub fn babybear_extension_ops_benchmarks_p3(c: &mut Criterion) {
458458
group.bench_with_input(format!("Division of Fp4 {:?}", &i.len()), &i, |bench, i| {
459459
bench.iter(|| {
460460
for (x, y) in i {
461-
black_box(black_box(*x) / black_box(*y));
461+
let _ = black_box(black_box(*x) / black_box(*y));
462462
}
463463
});
464464
});

crates/math/src/polynomial/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::field::element::FieldElement;
22
use crate::field::traits::{IsField, IsPrimeField, IsSubFieldOf};
33
use alloc::string::{String, ToString};
44
use alloc::{borrow::ToOwned, format, vec, vec::Vec};
5-
use core::{fmt::Display, ops};
5+
use core::{fmt::Display, ops, slice};
66
pub mod dense_multilinear_poly;
77
mod error;
88
pub mod sparse_multilinear_poly;
@@ -79,7 +79,7 @@ impl<F: IsField> Polynomial<FieldElement<F>> {
7979
let mut result = Polynomial::zero();
8080

8181
for (i, y) in ys.iter().enumerate() {
82-
let mut y_term = Polynomial::new(&[y.clone()]);
82+
let mut y_term = Polynomial::new(slice::from_ref(y));
8383
for (j, x) in xs.iter().enumerate() {
8484
if i == j {
8585
continue;

crates/provers/stark/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ miden-core = { git = "https://github.com/lambdaclass/miden-vm", optional = true
2020
rand = "0.8.5"
2121
thiserror = "1.0.38"
2222
log = "0.4.17"
23-
bincode = { version = "2.0.0-rc.2", tag = "v2.0.0-rc.2", git = "https://github.com/bincode-org/bincode.git" }
23+
bincode = { version = "2.0.1", features = ["serde"] }
2424
sha3 = "0.10.6"
2525
serde = { version = "1.0", features = ["derive"] }
2626
serde_json = "1.0"

examples/merkle-tree-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ path = "src/main.rs"
1111

1212
[dependencies]
1313
clap = { version = "4.4.6", features = ["derive"] }
14-
lambdaworks-crypto = { workspace = true, features = ["serde"]}
14+
lambdaworks-crypto = { workspace = true, features = ["serde"] }
1515
lambdaworks-math = { workspace = true, features = ["lambdaworks-serde-string"] }
1616
serde = { version = "1.0" }
1717
serde_json = "1"
18-
bincode = { version = "2.0.0-rc.2", tag = "v2.0.0-rc.2", git = "https://github.com/bincode-org/bincode.git", features= ['serde'] }
18+
bincode = { version = "2.0.1", features = ["serde"] }

examples/prove-miden/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ path = "src/main.rs"
1313
lambdaworks-crypto = { workspace = true }
1414
lambdaworks-math = { workspace = true, features = ["lambdaworks-serde-string"] }
1515
lambdaworks-winterfell-adapter = { workspace = true }
16-
stark-platinum-prover = { git = "https://github.com/lambdaclass/lambdaworks" , branch = "miden-version", features = ["winter_compatibility"] }
16+
stark-platinum-prover = { git = "https://github.com/lambdaclass/lambdaworks", branch = "miden-version", features = [
17+
"winter_compatibility",
18+
] }
1719

1820
serde = { version = "1.0" }
1921
serde_json = "1"
20-
bincode = { version = "2.0.0-rc.2", tag = "v2.0.0-rc.2", git = "https://github.com/bincode-org/bincode.git", features= ['serde'] }
21-
miden-core = { package = "miden-core" , version = "0.7"}
22+
bincode = { version = "2.0.1", features = ["serde"] }
23+
miden-core = { package = "miden-core", version = "0.7" }
2224
miden-assembly = { package = "miden-assembly", version = "0.7" }
2325
miden-processor = { package = "miden-processor", version = "0.7" }
24-
miden-air = { package = "miden-air", version = "0.7"}
26+
miden-air = { package = "miden-air", version = "0.7" }
2527
winter-prover = { package = "winter-prover", version = "0.6.4" }

0 commit comments

Comments
 (0)