From f6137e581ae77f3e183463d4877ca1f23b53f65d Mon Sep 17 00:00:00 2001 From: jeanmon Date: Thu, 28 Sep 2023 07:22:17 +0000 Subject: [PATCH] Remove obsolete comments in native private kernel circuit --- .../native_private_kernel_circuit_init.cpp | 34 ++----------------- .../native_private_kernel_circuit_init.hpp | 1 - .../native_private_kernel_circuit_inner.cpp | 32 ++--------------- 3 files changed, 4 insertions(+), 63 deletions(-) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.cpp index 53df785c288..9e70e541a0a 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.cpp @@ -41,28 +41,6 @@ void initialise_end_values(PrivateKernelInputsInit const& private_inputs, namespace aztec3::circuits::kernel::private_kernel { -// using plonk::stdlib::merkle_tree:: - -// // TODO: NEED TO RECONCILE THE `proof`'s public inputs (which are uint8's) with the -// // private_call.call_stack_item.public_inputs! -// CT::AggregationObject verify_proofs(Builder& builder, -// PrivateKernelInputsInit const& private_inputs, -// size_t const& num_private_call_public_inputs, -// size_t const& num_private_kernel_public_inputs) -// { -// CT::AggregationObject aggregation_object = Aggregator::aggregate( -// &builder, private_inputs.private_call.vk, private_inputs.private_call.proof, -// num_private_call_public_inputs); - -// Aggregator::aggregate(&builder, -// private_inputs.previous_kernel.vk, -// private_inputs.previous_kernel.proof, -// num_private_kernel_public_inputs, -// aggregation_object); - -// return aggregation_object; -// } - void validate_this_private_call_against_tx_request(DummyCircuitBuilder& builder, PrivateKernelInputsInit const& private_inputs) { @@ -171,9 +149,6 @@ void update_end_values(DummyCircuitBuilder& builder, // https://github.com/AztecProtocol/aztec-packages/issues/660 } -// NOTE: THIS IS A VERY UNFINISHED WORK IN PROGRESS. -// TODO(mike): is there a way to identify whether an input has not been used by ths circuit? This would help us -// more-safely ensure we're constraining everything. KernelCircuitPublicInputs native_private_kernel_circuit_initial(DummyCircuitBuilder& builder, PrivateKernelInputsInit const& private_inputs) { @@ -205,13 +180,8 @@ KernelCircuitPublicInputs native_private_kernel_circuit_initial(DummyCircuit private_inputs.tx_request.tx_context.contract_deployment_data, private_inputs.tx_request.function_data); - // We'll skip any verification in this native implementation, because for a Local Developer Testnet, there won't - // _be_ a valid proof to verify!!! auto aggregation_object = verify_proofs(builder, - // private_inputs, - // _private_inputs.private_call.vk->num_public_inputs, - // _private_inputs.previous_kernel.vk->num_public_inputs); - - // TODO(dbanks12): kernel vk membership check! + // This is where a real circuit would perform recursive verification of the previous kernel proof and private call + // proof. // In the native version, as there is no verify_proofs call, we can initialize aggregation object with the default // constructor. diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.hpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.hpp index b5f23f4a928..8baabb77f1f 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.hpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.hpp @@ -10,7 +10,6 @@ namespace aztec3::circuits::kernel::private_kernel { using aztec3::circuits::abis::KernelCircuitPublicInputs; using aztec3::circuits::abis::private_kernel::PrivateKernelInputsInit; -// using abis::private_kernel::PublicInputs; using DummyBuilder = aztec3::utils::DummyCircuitBuilder; KernelCircuitPublicInputs native_private_kernel_circuit_initial(DummyBuilder& builder, diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp index db7662394fc..4312d82c04d 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp @@ -35,26 +35,6 @@ void initialise_end_values(PreviousKernelData const& previous_kernel, Kernel namespace aztec3::circuits::kernel::private_kernel { -// // TODO: NEED TO RECONCILE THE `proof`'s public inputs (which are uint8's) with the -// // private_call.call_stack_item.public_inputs! -// CT::AggregationObject verify_proofs(Builder& builder, -// PrivateInputs const& private_inputs, -// size_t const& num_private_call_public_inputs, -// size_t const& num_private_kernel_public_inputs) -// { -// CT::AggregationObject aggregation_object = Aggregator::aggregate( -// &builder, private_inputs.private_call.vk, private_inputs.private_call.proof, -// num_private_call_public_inputs); - -// Aggregator::aggregate(&builder, -// private_inputs.previous_kernel.vk, -// private_inputs.previous_kernel.proof, -// num_private_kernel_public_inputs, -// aggregation_object); - -// return aggregation_object; -// } - void pop_and_validate_this_private_call_hash( DummyCircuitBuilder& builder, PrivateCallData const& private_call, @@ -115,9 +95,6 @@ void validate_inputs(DummyCircuitBuilder& builder, PrivateKernelInputsInner common_validate_0th_nullifier(builder, private_inputs.previous_kernel.public_inputs.end); } -// NOTE: THIS IS A VERY UNFINISHED WORK IN PROGRESS. -// TODO(mike): is there a way to identify whether an input has not been used by ths circuit? This would help us -// more-safely ensure we're constraining everything. KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBuilder& builder, PrivateKernelInputsInner const& private_inputs) { @@ -153,13 +130,8 @@ KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBu private_call_stack_item.public_inputs.contract_deployment_data, private_call_stack_item.function_data); - // We'll skip any verification in this native implementation, because for a Local Developer Testnet, there won't - // _be_ a valid proof to verify!!! auto aggregation_object = verify_proofs(builder, - // private_inputs, - // _private_inputs.private_call.vk->num_public_inputs, - // _private_inputs.previous_kernel.vk->num_public_inputs); - - // TODO(dbanks12): kernel vk membership check! + // This is where a real circuit would perform recursive verification of the previous kernel proof and private call + // proof. // Note: given that we skipped the verify_proof function, the aggregation object we get at the end will just be // the same as we had at the start. public_inputs.end.aggregation_object = aggregation_object;