From fd400c68be7da9c54e08a80e59bd8eb2d568daf6 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 22 Feb 2023 10:53:55 +0000 Subject: [PATCH 1/2] feat(acvm)!: add `eth_contract_from_vk` to `SmartContract chore: deprecate `eth_contract_from_cs` --- acvm/src/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/acvm/src/lib.rs b/acvm/src/lib.rs index 52fe34b46..8845f6ad8 100644 --- a/acvm/src/lib.rs +++ b/acvm/src/lib.rs @@ -115,13 +115,6 @@ pub trait PartialWitnessGenerator { } pub trait SmartContract { - // Takes a verification key and produces a smart contract - // The platform indicator allows a backend to support multiple smart contract platforms - // - // fn verification_key(&self, platform: u8, vk: &[u8]) -> &[u8] { - // todo!("currently the backend is not configured to use this.") - // } - /// Takes an ACIR circuit, the number of witnesses and the number of public inputs /// Then returns an Ethereum smart contract /// @@ -129,7 +122,11 @@ pub trait SmartContract { /// This deprecation may happen in two stages: /// The first stage will remove `num_witnesses` and `num_public_inputs` parameters. /// If we cannot avoid `num_witnesses`, it can be added into the Circuit struct. + #[deprecated] fn eth_contract_from_cs(&self, circuit: Circuit) -> String; + + /// Returns an Ethereum smart contract to verify proofs against a given verification key. + fn eth_contract_from_vk(&self, verification_key: &[u8]) -> String; } pub trait ProofSystemCompiler { From 3c62ff9d0f3c1d618745b5e27dbfd66fe724ab8e Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Wed, 22 Feb 2023 10:57:56 +0000 Subject: [PATCH 2/2] chore: re-add note on multiple platforms --- acvm/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/acvm/src/lib.rs b/acvm/src/lib.rs index 8845f6ad8..4e2cdf0fd 100644 --- a/acvm/src/lib.rs +++ b/acvm/src/lib.rs @@ -115,6 +115,8 @@ pub trait PartialWitnessGenerator { } pub trait SmartContract { + // TODO: Allow a backend to support multiple smart contract platforms + /// Takes an ACIR circuit, the number of witnesses and the number of public inputs /// Then returns an Ethereum smart contract ///