Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
avm_execute.hpp
Go to the documentation of this file.
1#pragma once
12
13#include <atomic>
14
15namespace bb::avm {
16
18// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
20
29
34 static constexpr const char MSGPACK_SCHEMA_NAME[] = "AvmErrorResponse";
35 std::string message;
37 bool operator==(const AvmErrorResponse&) const = default;
38};
39
44
50
55{
56 return std::move(command).visit([&request](auto&& cmd) -> AvmCommandResponse {
57 using CmdType = std::decay_t<decltype(cmd)>;
58 return std::forward<CmdType>(cmd).execute(request);
59 });
60}
61
65AvmCommandResponse avm_dispatch(AvmRequest& request, AvmCommand&& command);
66
67} // namespace bb::avm
NamedUnion command structs for the aztec-avm simulation API.
A wrapper around std::variant that provides msgpack serialization based on type names.
decltype(auto) visit(Visitor &&vis) &&
Auto-generated IPC client.
AvmCommandResponse execute(AvmRequest &request, AvmCommand &&command)
Execute an AVM command using the visitor pattern.
NamedUnion< AvmErrorResponse, AvmSimulate::Response, AvmSimulateWithHints::Response, AvmShutdown::Response > AvmCommandResponse
Union of all AVM response types.
std::atomic< avm2::simulation::CancellationToken * > g_active_cancellation_token
AvmCommandResponse avm_dispatch(AvmRequest &request, AvmCommand &&command)
Top-level AVM API entry point. Takes an AvmRequest and dispatches the command.
NamedUnion< AvmSimulate, AvmSimulateWithHints, AvmShutdown > AvmCommand
Union of all AVM commands (request types).
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Error response returned when a command fails.
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const AvmErrorResponse &) const =default
Context passed to each command's execute() method. Provides access to WSDB and CDB IPC clients.
cdb::CdbIpcContractDB & cdb_client
wsdb::WsdbIpcClient & wsdb_client