Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove uneeded Serialization bounds on Coprocessors #540

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub type NovaPublicParams<'a, C> = nova::PublicParams<G1, G2, C1<'a, C>, C2>;

/// A struct that contains public parameters for the Nova proving system.
#[derive(Serialize, Deserialize)]
#[serde(bound = "")]
pub struct PublicParams<'a, C: Coprocessor<S1>> {
pp: NovaPublicParams<'a, C>,
pk: ProverKey<G1, G2, C1<'a, C>, C2, SS1, SS2>,
Expand Down
3 changes: 1 addition & 2 deletions src/public_parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{
proof::nova::{self, PublicParams},
};
use pasta_curves::pallas;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};

pub mod error;
Expand All @@ -20,7 +19,7 @@ use crate::public_parameters::error::Error;

pub type S1 = pallas::Scalar;

pub fn public_params<C: Coprocessor<S1> + Serialize + DeserializeOwned + 'static>(
pub fn public_params<C: Coprocessor<S1> + 'static>(
rc: usize,
lang: Arc<Lang<S1, C>>,
) -> Result<Arc<PublicParams<'static, C>>, Error> {
Expand Down
5 changes: 2 additions & 3 deletions src/public_parameters/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::{
use log::info;
use once_cell::sync::Lazy;
use pasta_curves::pallas;
use serde::{de::DeserializeOwned, Serialize};
use tap::TapFallible;

use crate::public_parameters::error::Error;
Expand Down Expand Up @@ -34,7 +33,7 @@ pub(crate) static CACHE_REG: Lazy<Registry> = Lazy::new(|| Registry {

impl Registry {
fn get_from_file_cache_or_update_with<
C: Coprocessor<S1> + Serialize + DeserializeOwned + 'static,
C: Coprocessor<S1> + 'static,
F: FnOnce(Arc<Lang<S1, C>>) -> Arc<PublicParams<'static, C>>,
>(
&'static self,
Expand Down Expand Up @@ -66,7 +65,7 @@ impl Registry {
/// Check if params for this Coproc are in registry, if so, return them.
/// Otherwise, initialize with the passed in function.
pub(crate) fn get_coprocessor_or_update_with<
C: Coprocessor<S1> + Serialize + DeserializeOwned + 'static,
C: Coprocessor<S1> + 'static,
F: FnOnce(Arc<Lang<S1, C>>) -> Arc<PublicParams<'static, C>>,
>(
&'static self,
Expand Down