30 bool error_too_many_logs_wrong_tag_is_static =
31 event.error_too_many_log_fields ||
event.error_tag_mismatch ||
event.is_static;
32 bool error =
event.error_memory_out_of_bounds || error_too_many_logs_wrong_tag_is_static;
35 bool seen_wrong_tag =
false;
38 bool is_log_length_row = i == 0;
39 bool is_contract_address_row = i == 1;
40 bool is_value_row = i > 1;
48 if (value_index <
event.values.size()) {
49 value =
event.values[value_index].as_ff();
50 tag =
event.values[value_index].get_tag();
56 seen_wrong_tag =
true;
59 uint32_t expected_next_log_fields =
62 FF public_inputs_value = 0;
64 if (is_log_length_row) {
65 public_inputs_value =
event.log_size;
66 }
else if (is_contract_address_row) {
67 public_inputs_value =
event.contract_address;
68 }
else if (is_value_row) {
69 public_inputs_value =
value;
75 { C::emit_unencrypted_log_sel, 1 },
76 { C::emit_unencrypted_log_execution_clk,
event.execution_clk },
77 { C::emit_unencrypted_log_space_id,
event.space_id },
78 { C::emit_unencrypted_log_log_address, log_address },
79 { C::emit_unencrypted_log_log_size,
event.log_size },
80 { C::emit_unencrypted_log_contract_address,
event.contract_address },
81 { C::emit_unencrypted_log_prev_num_unencrypted_log_fields,
event.prev_num_unencrypted_log_fields },
82 { C::emit_unencrypted_log_next_num_unencrypted_log_fields,
event.next_num_unencrypted_log_fields },
83 { C::emit_unencrypted_log_is_static,
event.is_static },
84 { C::emit_unencrypted_log_error, error },
85 { C::emit_unencrypted_log_discard,
discard },
86 { C::emit_unencrypted_log_start, i == 0 },
88 { C::emit_unencrypted_log_remaining_rows, remaining_rows },
89 { C::emit_unencrypted_log_remaining_rows_inv, remaining_rows },
90 { C::emit_unencrypted_log_error_out_of_bounds,
event.error_memory_out_of_bounds },
92 { C::emit_unencrypted_log_end_log_address, log_address +
event.log_size - 1 },
93 { C::emit_unencrypted_log_error_too_many_log_fields,
event.error_too_many_log_fields },
94 { C::emit_unencrypted_log_expected_next_log_fields, expected_next_log_fields },
96 { C::emit_unencrypted_log_error_tag_mismatch,
event.error_tag_mismatch },
97 { C::emit_unencrypted_log_seen_wrong_tag, seen_wrong_tag },
98 { C::emit_unencrypted_log_error_too_many_logs_wrong_tag_is_static,
99 error_too_many_logs_wrong_tag_is_static },
100 { C::emit_unencrypted_log_sel_should_write_to_public_inputs, !error && !
discard },
101 { C::emit_unencrypted_log_is_write_contract_address, is_contract_address_row },
102 { C::emit_unencrypted_log_is_write_memory_value, is_value_row },
103 { C::emit_unencrypted_log_sel_should_read_memory,
104 is_value_row && !
event.error_memory_out_of_bounds },
105 { C::emit_unencrypted_log_value,
value },
106 { C::emit_unencrypted_log_tag,
static_cast<uint8_t
>(tag) },
107 { C::emit_unencrypted_log_correct_tag, correct_tag },
108 { C::emit_unencrypted_log_tag_inv,
static_cast<uint8_t
>(tag) },
109 { C::emit_unencrypted_log_public_inputs_index,
111 event.prev_num_unencrypted_log_fields + i },
112 { C::emit_unencrypted_log_public_inputs_value, public_inputs_value },
123 trace.invert_columns({ { C::emit_unencrypted_log_remaining_rows_inv, C::emit_unencrypted_log_tag_inv } });