From b95cf98d2a5106fe6ed45bc73d2c7b3b387e7f2f Mon Sep 17 00:00:00 2001 From: Ryan Kim Date: Thu, 11 Jul 2024 14:22:29 +0900 Subject: [PATCH] feat(halo2_proofs): set `format` to `RawBytesUnchecked` by default Tachyon only recognizes the `RawBytesUnchecked` format for serialization. To ensure compatibility and prevent errors, this commit forces the format to be set to `RawBytesUnchecked` by default. --- halo2_proofs/src/plonk.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/halo2_proofs/src/plonk.rs b/halo2_proofs/src/plonk.rs index c49e029c..b16d0ed4 100644 --- a/halo2_proofs/src/plonk.rs +++ b/halo2_proofs/src/plonk.rs @@ -62,11 +62,8 @@ where C::Scalar: SerdePrimeField + FromUniformBytes<64>, { /// Writes a verifying key to a buffer including constraint system. - pub fn write_including_cs( - &self, - writer: &mut W, - format: SerdeFormat, - ) -> io::Result<()> { + pub fn write_including_cs(&self, writer: &mut W) -> io::Result<()> { + let format = SerdeFormat::RawBytesUnchecked; writer.write_all(&self.domain.k().to_be_bytes())?; // the `fixed_commitments` here includes selectors writer.write_all(&(self.fixed_commitments.len() as u32).to_be_bytes())?; @@ -355,12 +352,9 @@ where C::Scalar: SerdePrimeField + FromUniformBytes<64>, { /// Writes a proving key to a buffer including constraint system. - pub fn write_including_cs( - &self, - writer: &mut W, - format: SerdeFormat, - ) -> io::Result<()> { - self.vk.write_including_cs(writer, format)?; + pub fn write_including_cs(&self, writer: &mut W) -> io::Result<()> { + let format = SerdeFormat::RawBytesUnchecked; + self.vk.write_including_cs(writer)?; self.l0.write(writer, format)?; self.l_last.write(writer, format)?; self.l_active_row.write(writer, format)?;