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

chore(circuits): rename function to validate private call hash in PKC (it pops too) #1418

Merged
merged 2 commits into from
Aug 7, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ namespace aztec3::circuits::kernel::private_kernel {
// return aggregation_object;
// }

void validate_this_private_call_hash(DummyCircuitBuilder& builder,
PrivateCallData<NT> const& private_call,
KernelCircuitPublicInputs<NT>& public_inputs)
void pop_and_validate_this_private_call_hash(
DummyCircuitBuilder& builder,
PrivateCallData<NT> const& private_call,
std::array<NT::fr, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX>& 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(
Expand Down Expand Up @@ -151,7 +152,7 @@ KernelCircuitPublicInputs<NT> 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);

Expand Down