diff --git a/Cargo.lock b/Cargo.lock index 1538bed2fb5..da6ac2b91e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,6 @@ dependencies = [ "bincode", "brillig", "flate2", - "rmp-serde", "serde", "serde_json", "strum", @@ -3122,28 +3121,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "rmp" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" -dependencies = [ - "byteorder", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - [[package]] name = "rust-embed" version = "6.8.1" diff --git a/acvm-repo/acir/Cargo.toml b/acvm-repo/acir/Cargo.toml index f4bdd72e25a..a7c55b3d8ac 100644 --- a/acvm-repo/acir/Cargo.toml +++ b/acvm-repo/acir/Cargo.toml @@ -17,7 +17,6 @@ acir_field.workspace = true brillig.workspace = true serde.workspace = true thiserror.workspace = true -rmp-serde = { version = "1.1.0", optional = true } flate2 = "1.0.24" bincode.workspace = true @@ -30,4 +29,3 @@ strum_macros = "0.24" default = ["bn254"] bn254 = ["acir_field/bn254", "brillig/bn254"] bls12_381 = ["acir_field/bls12_381", "brillig/bls12_381"] -serialize-messagepack = ["rmp-serde"] diff --git a/acvm-repo/acir/src/circuit/mod.rs b/acvm-repo/acir/src/circuit/mod.rs index d03240af2c3..eef5a5fb6bc 100644 --- a/acvm-repo/acir/src/circuit/mod.rs +++ b/acvm-repo/acir/src/circuit/mod.rs @@ -125,24 +125,6 @@ impl Circuit { PublicInputs(public_inputs) } - #[cfg(feature = "serialize-messagepack")] - pub fn write(&self, writer: W) -> std::io::Result<()> { - let buf = rmp_serde::to_vec(&self).unwrap(); - let mut deflater = flate2::write::DeflateEncoder::new(writer, Compression::best()); - deflater.write_all(&buf).unwrap(); - - Ok(()) - } - #[cfg(feature = "serialize-messagepack")] - pub fn read(reader: R) -> std::io::Result { - let mut deflater = flate2::read::DeflateDecoder::new(reader); - let mut buf_d = Vec::new(); - deflater.read_to_end(&mut buf_d).unwrap(); - let circuit = rmp_serde::from_slice(buf_d.as_slice()).unwrap(); - Ok(circuit) - } - - #[cfg(not(feature = "serialize-messagepack"))] pub fn write(&self, writer: W) -> std::io::Result<()> { let buf = bincode::serialize(&self).unwrap(); let mut encoder = flate2::write::GzEncoder::new(writer, Compression::default()); @@ -151,7 +133,6 @@ impl Circuit { Ok(()) } - #[cfg(not(feature = "serialize-messagepack"))] pub fn read(reader: R) -> std::io::Result { let mut gz_decoder = flate2::read::GzDecoder::new(reader); let mut buf_d = Vec::new(); diff --git a/acvm-repo/acir/src/native_types/witness_map.rs b/acvm-repo/acir/src/native_types/witness_map.rs index 400e0a8ca1a..1734b0b907f 100644 --- a/acvm-repo/acir/src/native_types/witness_map.rs +++ b/acvm-repo/acir/src/native_types/witness_map.rs @@ -13,20 +13,6 @@ use thiserror::Error; use crate::native_types::Witness; -#[cfg(feature = "serialize-messagepack")] -#[derive(Debug, Error)] -enum SerializationError { - #[error(transparent)] - MsgpackEncode(#[from] rmp_serde::encode::Error), - - #[error(transparent)] - MsgpackDecode(#[from] rmp_serde::decode::Error), - - #[error(transparent)] - Deflate(#[from] std::io::Error), -} - -#[cfg(not(feature = "serialize-messagepack"))] #[derive(Debug, Error)] enum SerializationError { #[error(transparent)] @@ -92,20 +78,6 @@ impl From> for WitnessMap { } } -#[cfg(feature = "serialize-messagepack")] -impl TryFrom for Vec { - type Error = WitnessMapError; - - fn try_from(val: WitnessMap) -> Result { - let buf = rmp_serde::to_vec(&val).map_err(|err| WitnessMapError(err.into()))?; - let mut deflater = flate2::write::DeflateEncoder::new(buf.as_slice(), Compression::best()); - let mut buf_c = Vec::new(); - deflater.read_to_end(&mut buf_c).map_err(|err| WitnessMapError(err.into()))?; - Ok(buf_c) - } -} - -#[cfg(not(feature = "serialize-messagepack"))] impl TryFrom for Vec { type Error = WitnessMapError; @@ -118,21 +90,6 @@ impl TryFrom for Vec { } } -#[cfg(feature = "serialize-messagepack")] -impl TryFrom<&[u8]> for WitnessMap { - type Error = WitnessMapError; - - fn try_from(bytes: &[u8]) -> Result { - let mut deflater = flate2::bufread::DeflateDecoder::new(bytes); - let mut buf_d = Vec::new(); - deflater.read_to_end(&mut buf_d).map_err(|err| WitnessMapError(err.into()))?; - let witness_map = - rmp_serde::from_slice(buf_d.as_slice()).map_err(|err| WitnessMapError(err.into()))?; - Ok(Self(witness_map)) - } -} - -#[cfg(not(feature = "serialize-messagepack"))] impl TryFrom<&[u8]> for WitnessMap { type Error = WitnessMapError;