Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
internal_call_stack_manager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <stdexcept>
5#include <vector>
6
11
12namespace bb::avm2::simulation {
13
19
20// This contains the context_id due to circuit requirements similar to memory (i.e. it is used in the event emitter)
21// There might be a way to avoid this by emitting in the context / execution itself.
23 public:
28
29 void push(PC caller_pc, PC return_pc) override;
30 PC pop() override;
31 InternalCallId get_next_call_id() const override;
32 InternalCallId get_call_id() const override;
33 InternalCallId get_return_call_id() const override;
34 std::vector<PC> get_current_call_stack() const override;
35
36 private:
37 InternalCallId next_internal_call_id = 2; // dont start at 0
39 InternalCallId current_return_call_id = 0; // this is the return id of the current call
40
41 uint32_t context_id;
42
43 // NOTE: Using vector because we need iterators.
46};
47
62
63} // namespace bb::avm2::simulation
void push(PC caller_pc, PC return_pc) override
EventEmitterInterface< InternalCallStackEvent > & internal_call_stack_events
InternalCallStackManager(uint32_t context_id, EventEmitterInterface< InternalCallStackEvent > &emitter)
InternalCallStackManagerProvider(EventEmitterInterface< InternalCallStackEvent > &event_emitter)
EventEmitterInterface< InternalCallStackEvent > & events
std::unique_ptr< InternalCallStackManagerInterface > make_internal_call_stack_manager(uint32_t context_id) override
EventEmitter< DataCopyEvent > event_emitter
uint32_t PC
uint32_t InternalCallId
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
uint32_t context_id