Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
addressing_event.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <stdexcept>
6#include <string>
7#include <vector>
8
11
12namespace bb::avm2::simulation {
13
15 // The base address (mem[0]) is not a valid address.
17 // The relative computation overflowed.
19 // The address obtained after applying indirection is not a valid address.
21};
22
23inline std::string to_string(AddressingEventError e)
24{
25 switch (e) {
27 return "BASE_ADDRESS_INVALID";
29 return "RELATIVE_COMPUTATION_OOB";
31 return "INVALID_ADDRESS_AFTER_INDIRECTION";
32 }
33
34 // We should be catching all the cases above.
35 __builtin_unreachable();
36}
37
38struct AddressingException : public std::runtime_error {
40 : std::runtime_error("Error resolving operands.")
41 {}
42};
43
49
50// See https://docs.google.com/document/d/1EgFj0OQYZCWufjzLgoAAiVL9jV0-fUAaCCIVlvRc8bY/ for circuit details.
51// - The activation mask can be derived from spec.num_addresses.
57
58} // namespace bb::avm2::simulation
std::string to_string(AddressingEventError e)
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::vector< OperandResolutionInfo > resolution_info
std::optional< AddressingEventError > error