Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
execution.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <string_view>
5
10
11namespace bb::avm2 {
12
13template <typename FF_> class executionImpl {
14 public:
15 using FF = FF_;
16
17 static constexpr std::array<size_t, 90> SUBRELATION_PARTIAL_LENGTHS = {
18 3, 3, 3, 3, 2, 4, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
19 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3,
20 3, 3, 3, 4, 3, 5, 6, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2
21 };
22
23 template <typename AllEntities> inline static bool skip(const AllEntities& in)
24 {
25 using C = ColumnAndShifts;
26
27 return (in.get(C::execution_sel)).is_zero();
28 }
29
30 template <typename ContainerOverSubrelations, typename AllEntities>
31 void static accumulate(ContainerOverSubrelations& evals,
32 const AllEntities& in,
33 [[maybe_unused]] const RelationParameters<FF>&,
34 [[maybe_unused]] const FF& scaling_factor);
35};
36
37template <typename FF> class execution : public Relation<executionImpl<FF>> {
38 public:
39 static constexpr const std::string_view NAME = "execution";
40
41 // Subrelation indices constants, to be used in tests.
42 static constexpr size_t SR_ENQUEUED_CALL_START = 2;
43 static constexpr size_t SR_ENQUEUED_CALL_END = 3;
44 static constexpr size_t SR_TRACE_CONTINUITY = 5;
45 static constexpr size_t SR_LAST_IS_LAST = 6;
46 static constexpr size_t SR_NUM_P_LIMBS_CEIL = 13;
47 static constexpr size_t SR_DYN_L2_FACTOR_TO_RADIX_BE = 14;
48 static constexpr size_t SR_SSTORE_DYN_L2_GAS_IS_ZERO = 15;
49 static constexpr size_t SR_SUBTRACE_ID_DECOMPOSITION = 34;
50 static constexpr size_t SR_EXEC_OP_ID_DECOMPOSITION = 56;
51 static constexpr size_t SR_DYN_GAS_ID_DECOMPOSITION = 63;
52 static constexpr size_t SR_PC_NEXT_ROW_INT_CALL_JUMP = 65;
53 static constexpr size_t SR_PC_NEXT_ROW_JUMPI = 66;
54 static constexpr size_t SR_MOV_SAME_VALUE = 67;
55 static constexpr size_t SR_MOV_SAME_TAG = 68;
56 static constexpr size_t SR_SUCCESS_COPY_WRITE_REG = 69;
57 static constexpr size_t SR_SUCCESS_COPY_U1_TAG = 70;
58 static constexpr size_t SR_RETURNDATA_SIZE_WRITE_REG = 71;
59 static constexpr size_t SR_RETURNDATA_SIZE_U32_TAG = 72;
60 static constexpr size_t SR_PUBLIC_DATA_TREE_ROOT_NOT_CHANGED = 73;
61 static constexpr size_t SR_PUBLIC_DATA_TREE_SIZE_NOT_CHANGED = 74;
64 static constexpr size_t SR_NOTE_HASH_TREE_ROOT_NOT_CHANGED = 77;
65 static constexpr size_t SR_NOTE_HASH_TREE_SIZE_NOT_CHANGED = 78;
66 static constexpr size_t SR_NUM_NOTE_HASHES_EMITTED_NOT_CHANGED = 79;
67 static constexpr size_t SR_NULLIFIER_TREE_ROOT_NOT_CHANGED = 80;
68 static constexpr size_t SR_NULLIFIER_TREE_SIZE_NOT_CHANGED = 81;
69 static constexpr size_t SR_NUM_NULLIFIERS_EMITTED_NOT_CHANGED = 82;
70 static constexpr size_t SR_NUM_UNENCRYPTED_LOGS_NOT_CHANGED = 83;
71 static constexpr size_t SR_NUM_L2_TO_L1_MESSAGES_NOT_CHANGED = 84;
74
75 static std::string get_subrelation_label(size_t index)
76 {
77 switch (index) {
79 return "ENQUEUED_CALL_START";
81 return "ENQUEUED_CALL_END";
83 return "TRACE_CONTINUITY";
84 case SR_LAST_IS_LAST:
85 return "LAST_IS_LAST";
87 return "NUM_P_LIMBS_CEIL";
89 return "DYN_L2_FACTOR_TO_RADIX_BE";
91 return "SSTORE_DYN_L2_GAS_IS_ZERO";
93 return "SUBTRACE_ID_DECOMPOSITION";
95 return "EXEC_OP_ID_DECOMPOSITION";
97 return "DYN_GAS_ID_DECOMPOSITION";
99 return "PC_NEXT_ROW_INT_CALL_JUMP";
101 return "PC_NEXT_ROW_JUMPI";
103 return "MOV_SAME_VALUE";
104 case SR_MOV_SAME_TAG:
105 return "MOV_SAME_TAG";
107 return "SUCCESS_COPY_WRITE_REG";
109 return "SUCCESS_COPY_U1_TAG";
111 return "RETURNDATA_SIZE_WRITE_REG";
113 return "RETURNDATA_SIZE_U32_TAG";
115 return "PUBLIC_DATA_TREE_ROOT_NOT_CHANGED";
117 return "PUBLIC_DATA_TREE_SIZE_NOT_CHANGED";
119 return "WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_NOT_CHANGED";
121 return "WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_NOT_CHANGED";
123 return "NOTE_HASH_TREE_ROOT_NOT_CHANGED";
125 return "NOTE_HASH_TREE_SIZE_NOT_CHANGED";
127 return "NUM_NOTE_HASHES_EMITTED_NOT_CHANGED";
129 return "NULLIFIER_TREE_ROOT_NOT_CHANGED";
131 return "NULLIFIER_TREE_SIZE_NOT_CHANGED";
133 return "NUM_NULLIFIERS_EMITTED_NOT_CHANGED";
135 return "NUM_UNENCRYPTED_LOGS_NOT_CHANGED";
137 return "NUM_L2_TO_L1_MESSAGES_NOT_CHANGED";
139 return "RETRIEVED_BYTECODES_TREE_ROOT_NOT_CHANGED";
141 return "RETRIEVED_BYTECODES_TREE_SIZE_NOT_CHANGED";
142 }
143 return std::to_string(index);
144 }
145};
146
147} // namespace bb::avm2
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static constexpr size_t SR_NUM_L2_TO_L1_MESSAGES_NOT_CHANGED
Definition execution.hpp:71
static constexpr size_t SR_RETURNDATA_SIZE_WRITE_REG
Definition execution.hpp:58
static constexpr size_t SR_PC_NEXT_ROW_INT_CALL_JUMP
Definition execution.hpp:52
static constexpr size_t SR_ENQUEUED_CALL_END
Definition execution.hpp:43
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_ROOT_NOT_CHANGED
Definition execution.hpp:72
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_NOT_CHANGED
Definition execution.hpp:63
static constexpr size_t SR_NULLIFIER_TREE_SIZE_NOT_CHANGED
Definition execution.hpp:68
static constexpr size_t SR_MOV_SAME_TAG
Definition execution.hpp:55
static std::string get_subrelation_label(size_t index)
Definition execution.hpp:75
static constexpr size_t SR_DYN_L2_FACTOR_TO_RADIX_BE
Definition execution.hpp:47
static constexpr size_t SR_MOV_SAME_VALUE
Definition execution.hpp:54
static constexpr size_t SR_LAST_IS_LAST
Definition execution.hpp:45
static constexpr size_t SR_RETURNDATA_SIZE_U32_TAG
Definition execution.hpp:59
static constexpr size_t SR_ENQUEUED_CALL_START
Definition execution.hpp:42
static constexpr size_t SR_NUM_NULLIFIERS_EMITTED_NOT_CHANGED
Definition execution.hpp:69
static constexpr size_t SR_SUCCESS_COPY_U1_TAG
Definition execution.hpp:57
static constexpr size_t SR_DYN_GAS_ID_DECOMPOSITION
Definition execution.hpp:51
static constexpr size_t SR_PC_NEXT_ROW_JUMPI
Definition execution.hpp:53
static constexpr size_t SR_PUBLIC_DATA_TREE_SIZE_NOT_CHANGED
Definition execution.hpp:61
static constexpr size_t SR_NOTE_HASH_TREE_ROOT_NOT_CHANGED
Definition execution.hpp:64
static constexpr size_t SR_TRACE_CONTINUITY
Definition execution.hpp:44
static constexpr size_t SR_SUBTRACE_ID_DECOMPOSITION
Definition execution.hpp:49
static constexpr size_t SR_SUCCESS_COPY_WRITE_REG
Definition execution.hpp:56
static constexpr size_t SR_NULLIFIER_TREE_ROOT_NOT_CHANGED
Definition execution.hpp:67
static constexpr size_t SR_NUM_UNENCRYPTED_LOGS_NOT_CHANGED
Definition execution.hpp:70
static constexpr size_t SR_EXEC_OP_ID_DECOMPOSITION
Definition execution.hpp:50
static constexpr size_t SR_PUBLIC_DATA_TREE_ROOT_NOT_CHANGED
Definition execution.hpp:60
static constexpr const std::string_view NAME
Definition execution.hpp:39
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_NOT_CHANGED
Definition execution.hpp:62
static constexpr size_t SR_NOTE_HASH_TREE_SIZE_NOT_CHANGED
Definition execution.hpp:65
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_SIZE_NOT_CHANGED
Definition execution.hpp:73
static constexpr size_t SR_SSTORE_DYN_L2_GAS_IS_ZERO
Definition execution.hpp:48
static constexpr size_t SR_NUM_P_LIMBS_CEIL
Definition execution.hpp:46
static constexpr size_t SR_NUM_NOTE_HASHES_EMITTED_NOT_CHANGED
Definition execution.hpp:66
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
static constexpr std::array< size_t, 90 > SUBRELATION_PARTIAL_LENGTHS
Definition execution.hpp:17
static bool skip(const AllEntities &in)
Definition execution.hpp:23
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10
std::string to_string(bb::avm2::ValueTag tag)
Container for parameters used by the grand product (permutation, lookup) Honk relations.