Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
send_l2_to_l1_msg_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
10void send_l2_to_l1_msgImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
11 const AllEntities& in,
12 [[maybe_unused]] const RelationParameters<FF_>&,
13 [[maybe_unused]] const FF_& scaling_factor)
14{
15 using C = ColumnAndShifts;
16
17 PROFILE_THIS_NAME("accumulate/send_l2_to_l1_msg");
18
19 const auto constants_MAX_L2_TO_L1_MSGS_PER_TX = FF(8);
20 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX = FF(503);
21 const auto execution_REMAINING_L2_TO_L1_MSG_WRITES =
22 (constants_MAX_L2_TO_L1_MSGS_PER_TX - in.get(C::execution_prev_num_l2_to_l1_messages));
23
24 {
25 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
26 auto tmp = in.get(C::execution_sel_l2_to_l1_msg_limit_error) *
27 (FF(1) - in.get(C::execution_sel_l2_to_l1_msg_limit_error));
28 tmp *= scaling_factor;
29 std::get<0>(evals) += typename Accumulator::View(tmp);
30 }
31 { // MAX_WRITES_REACHED
32 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
33 auto tmp = in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
34 ((execution_REMAINING_L2_TO_L1_MSG_WRITES *
35 (in.get(C::execution_sel_l2_to_l1_msg_limit_error) *
36 (FF(1) - in.get(C::execution_remaining_l2_to_l1_msgs_inv)) +
37 in.get(C::execution_remaining_l2_to_l1_msgs_inv)) -
38 FF(1)) +
39 in.get(C::execution_sel_l2_to_l1_msg_limit_error));
40 tmp *= scaling_factor;
41 std::get<1>(evals) += typename Accumulator::View(tmp);
42 }
43 { // OPCODE_ERROR
44 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
45 auto tmp =
46 in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
47 ((FF(1) - in.get(C::execution_sel_l2_to_l1_msg_limit_error)) * (FF(1) - in.get(C::execution_is_static)) -
48 (FF(1) - in.get(C::execution_sel_opcode_error)));
49 tmp *= scaling_factor;
50 std::get<2>(evals) += typename Accumulator::View(tmp);
51 }
52 { // SEND_L2_TO_L1_MSG_CONDITION
53 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
54 auto tmp = in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
55 ((FF(1) - in.get(C::execution_sel_opcode_error)) * (FF(1) - in.get(C::execution_discard)) -
56 in.get(C::execution_sel_write_l2_to_l1_msg));
57 tmp *= scaling_factor;
58 std::get<3>(evals) += typename Accumulator::View(tmp);
59 }
60 {
61 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
62 auto tmp = in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
63 ((constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX +
64 in.get(C::execution_prev_num_l2_to_l1_messages)) -
65 in.get(C::execution_public_inputs_index));
66 tmp *= scaling_factor;
67 std::get<4>(evals) += typename Accumulator::View(tmp);
68 }
69 { // EMIT_L2_TO_L1_MSG_NUM_L2_TO_L1_MSGS_EMITTED_INCREASE
70 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
71 auto tmp =
72 in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
73 ((in.get(C::execution_prev_num_l2_to_l1_messages) + (FF(1) - in.get(C::execution_sel_opcode_error))) -
74 in.get(C::execution_num_l2_to_l1_messages));
75 tmp *= scaling_factor;
76 std::get<5>(evals) += typename Accumulator::View(tmp);
77 }
78}
79
80} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
Container for parameters used by the grand product (permutation, lookup) Honk relations.