Skip to content

Commit f42ead3

Browse files
authored
Merge pull request #205 from o1-labs/mimoo/msgpack
[kimchi] choosing messagepack as our serialization format
2 parents 8fd39dc + 5f21a68 commit f42ead3

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

circuits/plonk-15-wires/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ocaml = { version = "0.22.2", optional = true }
3030
ocaml-gen = { path = "../../ocaml/ocaml-gen", optional = true }
3131

3232
[dev-dependencies]
33-
bincode = "1.3.3"
33+
rmp-serde = "0.15.5"
3434
proptest = "1.0.0"
3535
proptest-derive = "0.3.0"
3636

circuits/plonk-15-wires/src/gate.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ mod tests {
527527
use mina_curves::pasta::Fp;
528528
use proptest::prelude::*;
529529
use rand::SeedableRng as _;
530+
use serde::{Deserialize, Serialize};
530531

531532
// TODO: move to mina-curves
532533
prop_compose! {
@@ -561,10 +562,11 @@ mod tests {
561562
proptest! {
562563
#[test]
563564
fn test_gate_serialization(cg in arb_circuit_gate()) {
564-
let encoded = bincode::serialize(&cg).unwrap();
565+
let encoded = rmp_serde::to_vec(&cg).unwrap();
565566
println!("gate: {:?}", cg);
566567
println!("encoded gate: {:?}", encoded);
567-
let decoded: CircuitGate<Fp> = bincode::deserialize(&encoded).unwrap();
568+
let decoded: CircuitGate<Fp> = rmp_serde::from_read_ref(&encoded).unwrap();
569+
568570
println!("decoded gate: {:?}", decoded);
569571
prop_assert_eq!(cg.row, decoded.row);
570572
prop_assert_eq!(cg.typ, decoded.typ);

dlog/plonk-15-wires/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ark-ec = { version = "0.3.0", features = [ "parallel" ] }
1212
ark-poly = { version = "0.3.0", features = [ "parallel" ] }
1313
ark-serialize = "0.3.0"
1414
array-init = "1.0.0"
15-
bincode = "1.3.3"
1615
colored = "2.0.0"
1716
rand = "0.8.0"
1817
rand_core = { version = "0.5" }
1918
rayon = "1.5.0"
19+
rmp-serde = "0.15.5"
2020
serde = "1.0.130"
2121
serde_with = "1.10.0"
2222
sprs = "0.9.2"
@@ -32,7 +32,6 @@ plonk_15_wires_circuits = { path = "../../circuits/plonk-15-wires" }
3232
[dev-dependencies]
3333
groupmap = { path = "../../groupmap" }
3434
mina-curves = { path = "../../curves" }
35-
bincode = "1.3.3"
3635

3736
[features]
3837
default = []

dlog/plonk-15-wires/src/index.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ where
308308
};
309309

310310
// deserialize
311-
let mut verifier_index: Self =
312-
bincode::deserialize_from(&mut reader).map_err(|e| e.to_string())?;
311+
let mut verifier_index = Self::deserialize(&mut rmp_serde::Deserializer::new(reader))
312+
.map_err(|e| e.to_string())?;
313313

314314
// fill in the rest
315315
verifier_index.srs = srs;
@@ -333,6 +333,7 @@ where
333333

334334
let writer = BufWriter::new(file);
335335

336-
bincode::serialize_into(writer, self).map_err(|e| e.to_string())
336+
self.serialize(&mut rmp_serde::Serializer::new(writer))
337+
.map_err(|e| e.to_string())
337338
}
338339
}

0 commit comments

Comments
 (0)