From b8e4f9284e65c62cca02ca0b4da7a4d5a29054ad Mon Sep 17 00:00:00 2001 From: dbanks12 Date: Thu, 3 Aug 2023 22:57:18 +0000 Subject: [PATCH] rename function to validate private call hash in PKC since it also has a side-effect of popping --- .../private/native_private_kernel_circuit_inner.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 1475360c571..1ed14d432b2 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 @@ -74,13 +74,14 @@ namespace aztec3::circuits::kernel::private_kernel { // return aggregation_object; // } -void validate_this_private_call_hash(DummyCircuitBuilder& builder, - PrivateCallData const& private_call, - KernelCircuitPublicInputs& public_inputs) +void pop_and_validate_this_private_call_hash( + DummyCircuitBuilder& builder, + PrivateCallData const& private_call, + std::array& private_call_stack) { // TODO(mike): this logic might need to change to accommodate the weird edge 3 initial txs (the 'main' tx, the 'fee' // tx, and the 'gas rebate' tx). - const auto popped_private_call_hash = array_pop(public_inputs.end.private_call_stack); + const auto popped_private_call_hash = array_pop(private_call_stack); const auto calculated_this_private_call_hash = private_call.call_stack_item.hash(); builder.do_assert( @@ -151,7 +152,7 @@ KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBu validate_inputs(builder, private_inputs); - validate_this_private_call_hash(builder, private_inputs.private_call, public_inputs); + pop_and_validate_this_private_call_hash(builder, private_inputs.private_call, public_inputs.end.private_call_stack); common_validate_call_stack(builder, private_inputs.private_call);