Skip to content
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
5 changes: 3 additions & 2 deletions barretenberg/cpp/pil/vm2/opcodes/internal_call.pil
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ namespace execution;
// If we encounter a sel_execute_internal_call, the next internal_call_id is the current next_internal_call_id
#[NEW_CALL_ID_ON_CALL]
sel_execute_internal_call * (internal_call_id' - next_internal_call_id) = 0;
// If we encounter a sel_return_call, the next internal_call_id is the current internal_call_return_id
// If we unwind the call stack (i.e. sel_internal_return_call that does not error), the next internal_call_id is the current internal_call_return_id
// This is gated by (1 - sel_opcode_error) so we don't enforce the constraint when the callstack is empty
#[RESTORE_INTERNAL_ID_ON_RETURN]
sel_execute_internal_return * (internal_call_id' - internal_call_return_id) = 0;
sel_read_unwind_call_stack * (internal_call_id' - internal_call_return_id) = 0;
// Otherwise it's propagated down
#[DEFAULT_PROPAGATE_CALL_ID]
NOT_LAST_EXEC * PROPAGATE_CALL_ID * (internal_call_id' - internal_call_id) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void internal_callImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
}
{ // RESTORE_INTERNAL_ID_ON_RETURN
using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::execution_sel_execute_internal_return)) *
auto tmp = static_cast<View>(in.get(C::execution_sel_read_unwind_call_stack)) *
(static_cast<View>(in.get(C::execution_internal_call_id_shift)) -
static_cast<View>(in.get(C::execution_internal_call_return_id)));
std::get<2>(evals) += (tmp * scaling_factor);
Expand Down
Loading