1#include <gmock/gmock.h>
2#include <gtest/gtest.h>
22using testing::PublicInputsBuilder;
23using tracegen::ExecutionTraceBuilder;
24using tracegen::PrecomputedTraceBuilder;
25using tracegen::PublicInputsTraceBuilder;
26using tracegen::TestTraceContainer;
31TEST(GetEnvVarConstrainingTest, EmptyRow)
36TEST(GetEnvVarConstrainingTest, AddressContextVariable)
39 TestTraceContainer
trace({
40 { { C::precomputed_first_row, 1 } },
42 { { C::execution_sel, 1 },
43 { C::execution_sel_execute_get_env_var, 1 },
44 { C::execution_is_address, 1 },
45 { C::execution_register_0_,
FF(1234567890) },
46 { C::execution_contract_address,
FF(1234567890) },
47 { C::execution_rop_1_, 0 } },
49 { { C::execution_sel, 1 },
50 { C::execution_sel_execute_get_env_var, 1 },
51 { C::execution_is_address, 0 },
52 { C::execution_register_0_, 999 },
53 { C::execution_contract_address,
FF(1234567890) },
54 { C::execution_rop_1_, 1 } },
60 trace.
set(C::execution_register_0_, 1,
FF(0xDEADBEEF));
62 "ADDRESS_FROM_CONTEXT");
65TEST(GetEnvVarConstrainingTest, SenderContextVariable)
68 TestTraceContainer
trace({
69 { { C::precomputed_first_row, 1 } },
71 { { C::execution_sel, 1 },
72 { C::execution_sel_execute_get_env_var, 1 },
73 { C::execution_is_sender, 1 },
74 { C::execution_register_0_,
FF(1234567890) },
75 { C::execution_msg_sender,
FF(1234567890) },
76 { C::execution_rop_1_, 1 } },
78 { { C::execution_sel, 1 },
79 { C::execution_sel_execute_get_env_var, 1 },
80 { C::execution_is_sender, 0 },
81 { C::execution_register_0_, 999 },
82 { C::execution_msg_sender,
FF(1234567890) },
83 { C::execution_rop_1_, 0 } },
89 trace.
set(C::execution_register_0_, 1,
FF(0xDEADBEEF));
91 "SENDER_FROM_CONTEXT");
94TEST(GetEnvVarConstrainingTest, TransactionFeeContextVariable)
97 TestTraceContainer
trace({
98 { { C::precomputed_first_row, 1 } },
100 { { C::execution_sel, 1 },
101 { C::execution_sel_execute_get_env_var, 1 },
102 { C::execution_is_transactionfee, 1 },
103 { C::execution_register_0_, 1000 },
104 { C::execution_transaction_fee, 1000 },
105 { C::execution_rop_1_, 2 } },
107 { { C::execution_sel, 1 },
108 { C::execution_sel_execute_get_env_var, 1 },
109 { C::execution_is_transactionfee, 0 },
110 { C::execution_register_0_, 999 },
111 { C::execution_transaction_fee, 1000 },
112 { C::execution_rop_1_, 0 } },
118 trace.
set(C::execution_register_0_, 1, 2000);
120 "TRANSACTION_FEE_FROM_CONTEXT");
123TEST(GetEnvVarConstrainingTest, IsStaticCallContextVariable)
126 TestTraceContainer
trace({
127 { { C::precomputed_first_row, 1 } },
129 { { C::execution_sel, 1 },
130 { C::execution_sel_execute_get_env_var, 1 },
131 { C::execution_is_isstaticcall, 1 },
132 { C::execution_register_0_, 1 },
133 { C::execution_is_static, 1 },
134 { C::execution_rop_1_, 9 } },
136 { { C::execution_sel, 1 },
137 { C::execution_sel_execute_get_env_var, 1 },
138 { C::execution_is_isstaticcall, 1 },
139 { C::execution_register_0_, 0 },
140 { C::execution_is_static, 0 },
141 { C::execution_rop_1_, 9 } },
143 { { C::execution_sel, 1 },
144 { C::execution_sel_execute_get_env_var, 1 },
145 { C::execution_is_isstaticcall, 0 },
146 { C::execution_register_0_, 999 },
147 { C::execution_is_static, 1 },
148 { C::execution_rop_1_, 0 } },
154 trace.
set(C::execution_register_0_, 1, 0);
156 "ISSTATICCALL_FROM_CONTEXT");
159TEST(GetEnvVarConstrainingTest, L2GasLeftGasVariable)
162 TestTraceContainer
trace({
163 { { C::precomputed_first_row, 1 } },
165 { { C::execution_sel, 1 },
166 { C::execution_sel_execute_get_env_var, 1 },
167 { C::execution_is_l2gasleft, 1 },
168 { C::execution_register_0_, 7500 },
169 { C::execution_l2_gas_limit, 10000 },
170 { C::execution_l2_gas_used, 2500 },
171 { C::execution_rop_1_, 10 } },
173 { { C::execution_sel, 1 },
174 { C::execution_sel_execute_get_env_var, 1 },
175 { C::execution_is_l2gasleft, 0 },
176 { C::execution_register_0_, 999 },
177 { C::execution_l2_gas_limit, 10000 },
178 { C::execution_l2_gas_used, 2500 },
179 { C::execution_rop_1_, 0 } },
185 trace.
set(C::execution_register_0_, 1, 5000);
187 "L2GASLEFT_FROM_GAS");
190TEST(GetEnvVarConstrainingTest, DaGasLeftGasVariable)
193 TestTraceContainer
trace({
194 { { C::precomputed_first_row, 1 } },
196 { { C::execution_sel, 1 },
197 { C::execution_sel_execute_get_env_var, 1 },
198 { C::execution_is_dagasleft, 1 },
199 { C::execution_register_0_, 3000 },
200 { C::execution_da_gas_limit, 5000 },
201 { C::execution_da_gas_used, 2000 },
202 { C::execution_rop_1_, 11 } },
204 { { C::execution_sel, 1 },
205 { C::execution_sel_execute_get_env_var, 1 },
206 { C::execution_is_dagasleft, 0 },
207 { C::execution_register_0_, 999 },
208 { C::execution_da_gas_limit, 5000 },
209 { C::execution_da_gas_used, 2000 },
210 { C::execution_rop_1_, 0 } },
216 trace.
set(C::execution_register_0_, 1, 1000);
218 "DAGASLEFT_FROM_GAS");
221TEST(GetEnvVarConstrainingTest, NoSideEffectsWhenNotGettingEnvVar)
224 TestTraceContainer
trace({
225 { { C::precomputed_first_row, 1 } },
227 { { C::execution_sel, 1 },
228 { C::execution_sel_execute_get_env_var, 0 },
229 { C::execution_is_address, 1 },
230 { C::execution_register_0_, 0 },
231 { C::execution_contract_address,
FF(1234567890) },
232 { C::execution_msg_sender,
FF(1234567890) },
233 { C::execution_l2_gas_limit, 10000 },
234 { C::execution_l2_gas_used, 5000 },
235 { C::execution_rop_1_, 0 } },
239 check_relation<get_env_var>(
trace);
242TEST(GetEnvVarConstrainingTest, ComplexTraceWithAllEnumsAndInteractions)
244 auto test_public_inputs = PublicInputsBuilder().rand_global_variables().build();
249 bool is_static_call =
true;
256 TestTraceContainer
trace({
257 { { C::precomputed_first_row, 1 } },
259 { { C::execution_sel, 1 },
262 { C::execution_sel_should_execute_opcode, 1 },
264 { C::execution_sel_execute_get_env_var, 1 },
266 { C::execution_sel_opcode_error, 0 },
267 { C::execution_sel_envvar_pi_lookup_col0, 0 },
268 { C::execution_sel_envvar_pi_lookup_col1, 0 },
269 { C::execution_envvar_pi_row_idx, 0 },
270 { C::execution_is_address, 1 },
271 { C::execution_is_sender, 0 },
272 { C::execution_is_transactionfee, 0 },
273 { C::execution_is_isstaticcall, 0 },
274 { C::execution_is_l2gasleft, 0 },
275 { C::execution_is_dagasleft, 0 },
279 { C::execution_value_from_pi, 0 },
280 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
282 { { C::execution_sel, 1 },
283 { C::execution_msg_sender, sender },
285 { C::execution_sel_should_execute_opcode, 1 },
287 { C::execution_sel_execute_get_env_var, 1 },
289 { C::execution_sel_opcode_error, 0 },
290 { C::execution_sel_envvar_pi_lookup_col0, 0 },
291 { C::execution_sel_envvar_pi_lookup_col1, 0 },
292 { C::execution_envvar_pi_row_idx, 0 },
293 { C::execution_is_address, 0 },
294 { C::execution_is_sender, 1 },
295 { C::execution_is_transactionfee, 0 },
296 { C::execution_is_isstaticcall, 0 },
297 { C::execution_is_l2gasleft, 0 },
298 { C::execution_is_dagasleft, 0 },
300 { C::execution_register_0_, sender },
302 { C::execution_value_from_pi, 0 },
303 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
305 { { C::execution_sel, 1 },
306 { C::execution_transaction_fee, transaction_fee },
308 { C::execution_sel_should_execute_opcode, 1 },
310 { C::execution_sel_execute_get_env_var, 1 },
312 { C::execution_sel_opcode_error, 0 },
313 { C::execution_sel_envvar_pi_lookup_col0, 0 },
314 { C::execution_sel_envvar_pi_lookup_col1, 0 },
315 { C::execution_envvar_pi_row_idx, 0 },
316 { C::execution_is_address, 0 },
317 { C::execution_is_sender, 0 },
318 { C::execution_is_transactionfee, 1 },
319 { C::execution_is_isstaticcall, 0 },
320 { C::execution_is_l2gasleft, 0 },
321 { C::execution_is_dagasleft, 0 },
323 { C::execution_register_0_, transaction_fee },
325 { C::execution_value_from_pi, 0 },
326 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
328 { { C::execution_sel, 1 },
330 { C::execution_sel_should_execute_opcode, 1 },
332 { C::execution_sel_execute_get_env_var, 1 },
334 { C::execution_sel_opcode_error, 0 },
335 { C::execution_sel_envvar_pi_lookup_col0, 1 },
336 { C::execution_sel_envvar_pi_lookup_col1, 0 },
338 { C::execution_is_address, 0 },
339 { C::execution_is_sender, 0 },
340 { C::execution_is_transactionfee, 0 },
341 { C::execution_is_isstaticcall, 0 },
342 { C::execution_is_l2gasleft, 0 },
343 { C::execution_is_dagasleft, 0 },
345 { C::execution_register_0_, test_public_inputs.globalVariables.chainId },
347 { C::execution_value_from_pi, test_public_inputs.globalVariables.chainId },
348 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
350 { { C::execution_sel, 1 },
352 { C::execution_sel_should_execute_opcode, 1 },
354 { C::execution_sel_execute_get_env_var, 1 },
356 { C::execution_sel_opcode_error, 0 },
357 { C::execution_sel_envvar_pi_lookup_col0, 1 },
358 { C::execution_sel_envvar_pi_lookup_col1, 0 },
360 { C::execution_is_address, 0 },
361 { C::execution_is_sender, 0 },
362 { C::execution_is_transactionfee, 0 },
363 { C::execution_is_isstaticcall, 0 },
364 { C::execution_is_l2gasleft, 0 },
365 { C::execution_is_dagasleft, 0 },
367 { C::execution_register_0_, test_public_inputs.globalVariables.version },
369 { C::execution_value_from_pi, test_public_inputs.globalVariables.version },
370 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
372 { { C::execution_sel, 1 },
374 { C::execution_sel_should_execute_opcode, 1 },
376 { C::execution_sel_execute_get_env_var, 1 },
378 { C::execution_sel_opcode_error, 0 },
379 { C::execution_sel_envvar_pi_lookup_col0, 1 },
380 { C::execution_sel_envvar_pi_lookup_col1, 0 },
382 { C::execution_is_address, 0 },
383 { C::execution_is_sender, 0 },
384 { C::execution_is_transactionfee, 0 },
385 { C::execution_is_isstaticcall, 0 },
386 { C::execution_is_l2gasleft, 0 },
387 { C::execution_is_dagasleft, 0 },
389 { C::execution_register_0_, test_public_inputs.globalVariables.blockNumber },
391 { C::execution_value_from_pi, test_public_inputs.globalVariables.blockNumber },
392 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U32) } },
394 { { C::execution_sel, 1 },
396 { C::execution_sel_should_execute_opcode, 1 },
398 { C::execution_sel_execute_get_env_var, 1 },
400 { C::execution_sel_opcode_error, 0 },
401 { C::execution_sel_envvar_pi_lookup_col0, 1 },
402 { C::execution_sel_envvar_pi_lookup_col1, 0 },
404 { C::execution_is_address, 0 },
405 { C::execution_is_sender, 0 },
406 { C::execution_is_transactionfee, 0 },
407 { C::execution_is_isstaticcall, 0 },
408 { C::execution_is_l2gasleft, 0 },
409 { C::execution_is_dagasleft, 0 },
411 { C::execution_register_0_, test_public_inputs.globalVariables.timestamp },
413 { C::execution_value_from_pi, test_public_inputs.globalVariables.timestamp },
414 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U64) } },
416 { { C::execution_sel, 1 },
418 { C::execution_sel_should_execute_opcode, 1 },
420 { C::execution_sel_execute_get_env_var, 1 },
422 { C::execution_sel_opcode_error, 0 },
423 { C::execution_sel_envvar_pi_lookup_col0, 0 },
424 { C::execution_sel_envvar_pi_lookup_col1, 1 },
426 { C::execution_is_address, 0 },
427 { C::execution_is_sender, 0 },
428 { C::execution_is_transactionfee, 0 },
429 { C::execution_is_isstaticcall, 0 },
430 { C::execution_is_l2gasleft, 0 },
431 { C::execution_is_dagasleft, 0 },
433 { C::execution_register_0_, test_public_inputs.globalVariables.gasFees.feePerL2Gas },
435 { C::execution_value_from_pi, test_public_inputs.globalVariables.gasFees.feePerL2Gas },
436 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U128) } },
438 { { C::execution_sel, 1 },
440 { C::execution_sel_should_execute_opcode, 1 },
442 { C::execution_sel_execute_get_env_var, 1 },
444 { C::execution_sel_opcode_error, 0 },
445 { C::execution_sel_envvar_pi_lookup_col0, 1 },
446 { C::execution_sel_envvar_pi_lookup_col1, 0 },
448 { C::execution_is_address, 0 },
449 { C::execution_is_sender, 0 },
450 { C::execution_is_transactionfee, 0 },
451 { C::execution_is_isstaticcall, 0 },
452 { C::execution_is_l2gasleft, 0 },
453 { C::execution_is_dagasleft, 0 },
455 { C::execution_register_0_, test_public_inputs.globalVariables.gasFees.feePerDaGas },
457 { C::execution_value_from_pi, test_public_inputs.globalVariables.gasFees.feePerDaGas },
458 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U128) } },
460 { { C::execution_sel, 1 },
461 { C::execution_is_static, is_static_call },
463 { C::execution_sel_should_execute_opcode, 1 },
465 { C::execution_sel_execute_get_env_var, 1 },
467 { C::execution_sel_opcode_error, 0 },
468 { C::execution_sel_envvar_pi_lookup_col0, 0 },
469 { C::execution_sel_envvar_pi_lookup_col1, 0 },
470 { C::execution_envvar_pi_row_idx, 0 },
471 { C::execution_is_address, 0 },
472 { C::execution_is_sender, 0 },
473 { C::execution_is_transactionfee, 0 },
474 { C::execution_is_isstaticcall, 1 },
475 { C::execution_is_l2gasleft, 0 },
476 { C::execution_is_dagasleft, 0 },
478 { C::execution_register_0_, is_static_call },
480 { C::execution_value_from_pi, 0 },
481 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U1) } },
483 { { C::execution_sel, 1 },
484 { C::execution_l2_gas_limit, l2_gas_limit },
485 { C::execution_l2_gas_used, l2_gas_used },
487 { C::execution_sel_should_execute_opcode, 1 },
489 { C::execution_sel_execute_get_env_var, 1 },
491 { C::execution_sel_opcode_error, 0 },
492 { C::execution_sel_envvar_pi_lookup_col0, 0 },
493 { C::execution_sel_envvar_pi_lookup_col1, 0 },
494 { C::execution_envvar_pi_row_idx, 0 },
495 { C::execution_is_address, 0 },
496 { C::execution_is_sender, 0 },
497 { C::execution_is_transactionfee, 0 },
498 { C::execution_is_isstaticcall, 0 },
499 { C::execution_is_l2gasleft, 1 },
500 { C::execution_is_dagasleft, 0 },
502 { C::execution_register_0_, l2_gas_limit - l2_gas_used },
504 { C::execution_value_from_pi, 0 },
505 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U32) } },
507 { { C::execution_sel, 1 },
508 { C::execution_da_gas_limit, da_gas_limit },
509 { C::execution_da_gas_used, da_gas_used },
511 { C::execution_sel_should_execute_opcode, 1 },
513 { C::execution_sel_execute_get_env_var, 1 },
515 { C::execution_sel_opcode_error, 0 },
516 { C::execution_sel_envvar_pi_lookup_col0, 0 },
517 { C::execution_sel_envvar_pi_lookup_col1, 0 },
518 { C::execution_envvar_pi_row_idx, 0 },
519 { C::execution_is_address, 0 },
520 { C::execution_is_sender, 0 },
521 { C::execution_is_transactionfee, 0 },
522 { C::execution_is_isstaticcall, 0 },
523 { C::execution_is_l2gasleft, 0 },
524 { C::execution_is_dagasleft, 1 },
526 { C::execution_register_0_, da_gas_limit - da_gas_used },
528 { C::execution_value_from_pi, 0 },
529 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U32) } },
531 { { C::execution_sel, 1 },
532 { C::execution_rop_1_, 42 },
533 { C::execution_sel_should_execute_opcode, 1 },
535 { C::execution_sel_execute_get_env_var, 1 },
537 { C::execution_sel_opcode_error, 1 },
538 { C::execution_sel_envvar_pi_lookup_col0, 0 },
539 { C::execution_sel_envvar_pi_lookup_col1, 0 },
540 { C::execution_envvar_pi_row_idx, 0 },
541 { C::execution_is_address, 0 },
542 { C::execution_is_sender, 0 },
543 { C::execution_is_transactionfee, 0 },
544 { C::execution_is_isstaticcall, 0 },
545 { C::execution_is_l2gasleft, 0 },
546 { C::execution_is_dagasleft, 0 },
548 { C::execution_register_0_, 0 },
550 { C::execution_value_from_pi, 0 },
551 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
554 tracegen::PublicInputsTraceBuilder public_inputs_builder;
555 public_inputs_builder.process_public_inputs(
trace, test_public_inputs);
556 public_inputs_builder.process_public_inputs_aux_precomputed(
trace);
563 check_relation<get_env_var>(
trace);
564 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_precomputed_info_settings>(
trace);
565 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col0_settings>(
trace);
566 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col1_settings>(
trace);
569 trace.
set(C::execution_rop_1_, 1, 42);
571 (check_interaction<ExecutionTraceBuilder, lookup_get_env_var_precomputed_info_settings>(
trace)),
572 "Failed.*GET_ENV_VAR_PRECOMPUTED_INFO. Could not find tuple in destination.");
577TEST(GetEnvVarConstrainingTest, NegativeInteractionTests)
579 auto test_public_inputs = PublicInputsBuilder().rand_global_variables().build();
580 TestTraceContainer
trace({
581 { { C::execution_sel, 1 },
583 { C::execution_sel_should_execute_opcode, 1 },
585 { C::execution_sel_opcode_error, 0 },
586 { C::execution_sel_envvar_pi_lookup_col0, 1 },
587 { C::execution_sel_envvar_pi_lookup_col1, 0 },
589 { C::execution_is_address, 0 },
590 { C::execution_is_sender, 0 },
591 { C::execution_is_transactionfee, 0 },
592 { C::execution_is_isstaticcall, 0 },
593 { C::execution_is_l2gasleft, 0 },
594 { C::execution_is_dagasleft, 0 },
596 { C::execution_sel_execute_get_env_var, 1 },
598 { C::execution_register_0_, test_public_inputs.globalVariables.chainId },
600 { C::execution_value_from_pi, test_public_inputs.globalVariables.chainId },
601 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::FF) } },
604 PublicInputsTraceBuilder public_inputs_builder;
605 public_inputs_builder.process_public_inputs(
trace, test_public_inputs);
606 public_inputs_builder.process_public_inputs_aux_precomputed(
trace);
613 check_relation<get_env_var>(
trace);
614 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_precomputed_info_settings>(
trace);
615 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col0_settings>(
trace);
616 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col1_settings>(
trace);
619 trace.
set(C::execution_rop_1_, 0, 42);
621 (check_interaction<ExecutionTraceBuilder, lookup_get_env_var_precomputed_info_settings>(
trace)),
622 "Failed.*GET_ENV_VAR_PRECOMPUTED_INFO. Could not find tuple in destination.");
627 trace.
set(C::execution_value_from_pi, 0, test_public_inputs.globalVariables.chainId + 1);
629 (check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col0_settings>(
trace)),
630 "Failed.*GET_ENV_VAR_READ_FROM_PUBLIC_INPUTS_COL0. Could not find tuple in destination.");
632 trace.
set(C::execution_value_from_pi, 0, test_public_inputs.globalVariables.chainId);
635TEST(GetEnvVarConstrainingTest, NegativeInteractionTestsPICol1)
637 auto test_public_inputs = PublicInputsBuilder().rand_global_variables().build();
638 TestTraceContainer
trace({
639 { { C::execution_sel, 1 },
641 { C::execution_sel_should_execute_opcode, 1 },
643 { C::execution_sel_opcode_error, 0 },
644 { C::execution_sel_envvar_pi_lookup_col0, 0 },
645 { C::execution_sel_envvar_pi_lookup_col1, 1 },
647 { C::execution_is_address, 0 },
648 { C::execution_is_sender, 0 },
649 { C::execution_is_transactionfee, 0 },
650 { C::execution_is_isstaticcall, 0 },
651 { C::execution_is_l2gasleft, 0 },
652 { C::execution_is_dagasleft, 0 },
654 { C::execution_sel_execute_get_env_var, 1 },
656 { C::execution_register_0_, test_public_inputs.globalVariables.gasFees.feePerL2Gas },
658 { C::execution_value_from_pi, test_public_inputs.globalVariables.gasFees.feePerL2Gas },
659 { C::execution_mem_tag_reg_0_,
static_cast<uint8_t
>(
ValueTag::U128) } },
662 PublicInputsTraceBuilder public_inputs_builder;
663 public_inputs_builder.process_public_inputs(
trace, test_public_inputs);
664 public_inputs_builder.process_public_inputs_aux_precomputed(
trace);
671 check_relation<get_env_var>(
trace);
672 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_precomputed_info_settings>(
trace);
673 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col0_settings>(
trace);
674 check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col1_settings>(
trace);
677 trace.
set(C::execution_value_from_pi, 0, test_public_inputs.globalVariables.gasFees.feePerL2Gas + 1);
679 (check_interaction<ExecutionTraceBuilder, lookup_get_env_var_read_from_public_inputs_col1_settings>(
trace)),
680 "Failed.*GET_ENV_VAR_READ_FROM_PUBLIC_INPUTS_COL1. Could not find tuple in destination.");
682 trace.
set(C::execution_value_from_pi, 0, test_public_inputs.globalVariables.gasFees.feePerL2Gas);
#define AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX
#define AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX
#define AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX
#define AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX
#define AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX
static constexpr size_t SR_TRANSACTION_FEE_FROM_CONTEXT
static constexpr size_t SR_DAGASLEFT_FROM_GAS
static constexpr size_t SR_ISSTATICCALL_FROM_CONTEXT
static constexpr size_t SR_SENDER_FROM_CONTEXT
static constexpr size_t SR_ADDRESS_FROM_CONTEXT
static constexpr size_t SR_L2GASLEFT_FROM_GAS
uint32_t get_num_rows() const
void set(Column col, uint32_t row, const FF &value)
PrecomputedTraceBuilder precomputed_builder
AztecAddress contract_address
#define EXPECT_THROW_WITH_MESSAGE(code, expectedMessage)
TEST(TxExecutionConstrainingTest, WriteTreeValue)
TestTraceContainer empty_trace()