Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
execution.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <memory>
4
#include <optional>
5
#include <stdexcept>
6
#include <string>
7
#include <vector>
8
9
#include "
barretenberg/vm2/common/aztec_types.hpp
"
10
#include "
barretenberg/vm2/common/field.hpp
"
11
#include "
barretenberg/vm2/common/memory_types.hpp
"
12
13
namespace
bb::avm2::simulation
{
14
15
// Forward declarations
16
class
ContextInterface;
17
18
enum
HaltingMode
: uint8_t {
19
UNDEFINED
,
20
RETURN
,
21
REVERT
,
22
EXCEPTIONAL_HALT
,
23
};
24
25
struct
EnqueuedCallResult
{
26
bool
success
;
27
Gas
gas_used
;
28
// For debugging.
29
HaltingMode
halting_mode
;
30
std::optional<std::string>
halting_message
;
31
};
32
33
class
ExecutionInterface
{
34
public
:
35
virtual
~ExecutionInterface
() =
default
;
36
// Returns the top-level execution result. TODO: This should only be top level enqueud calls
37
virtual
EnqueuedCallResult
execute
(
std::unique_ptr<ContextInterface>
context
) = 0;
38
};
39
40
class
RegisterValidationException
:
public
std::runtime_error {
41
public
:
42
RegisterValidationException
(
const
std::string& message)
43
:
std
::runtime_error(message)
44
{}
45
};
46
47
class
OpcodeExecutionException
:
public
std::runtime_error {
48
public
:
49
OpcodeExecutionException
(
const
std::string& message)
50
:
std
::runtime_error(message)
51
{}
52
};
53
54
}
// namespace bb::avm2::simulation
aztec_types.hpp
bb::avm2::context
Definition
context.hpp:37
bb::avm2::simulation::ExecutionInterface
Definition
execution.hpp:33
bb::avm2::simulation::ExecutionInterface::~ExecutionInterface
virtual ~ExecutionInterface()=default
bb::avm2::simulation::ExecutionInterface::execute
virtual EnqueuedCallResult execute(std::unique_ptr< ContextInterface > context)=0
bb::avm2::simulation::OpcodeExecutionException
Definition
execution.hpp:47
bb::avm2::simulation::OpcodeExecutionException::OpcodeExecutionException
OpcodeExecutionException(const std::string &message)
Definition
execution.hpp:49
bb::avm2::simulation::RegisterValidationException
Definition
execution.hpp:40
bb::avm2::simulation::RegisterValidationException::RegisterValidationException
RegisterValidationException(const std::string &message)
Definition
execution.hpp:42
memory_types.hpp
bb::avm2::simulation
AVM range check gadget for witness generation.
Definition
address_derivation_event.hpp:6
bb::avm2::simulation::HaltingMode
HaltingMode
Definition
execution.hpp:18
bb::avm2::simulation::UNDEFINED
@ UNDEFINED
Definition
execution.hpp:19
bb::avm2::simulation::RETURN
@ RETURN
Definition
execution.hpp:20
bb::avm2::simulation::REVERT
@ REVERT
Definition
execution.hpp:21
bb::avm2::simulation::EXCEPTIONAL_HALT
@ EXCEPTIONAL_HALT
Definition
execution.hpp:22
std
STL namespace.
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
bb::avm2::Gas
Definition
aztec_types.hpp:317
bb::avm2::simulation::EnqueuedCallResult
Definition
execution.hpp:25
bb::avm2::simulation::EnqueuedCallResult::halting_message
std::optional< std::string > halting_message
Definition
execution.hpp:30
bb::avm2::simulation::EnqueuedCallResult::halting_mode
HaltingMode halting_mode
Definition
execution.hpp:29
bb::avm2::simulation::EnqueuedCallResult::gas_used
Gas gas_used
Definition
execution.hpp:27
bb::avm2::simulation::EnqueuedCallResult::success
bool success
Definition
execution.hpp:26
field.hpp
src
barretenberg
vm2
simulation
interfaces
execution.hpp
Generated by
1.9.8