diff --git a/barretenberg/cpp/pil/avm/constants_gen.pil b/barretenberg/cpp/pil/avm/constants_gen.pil index 074be64de12..be8d4bfae2c 100644 --- a/barretenberg/cpp/pil/avm/constants_gen.pil +++ b/barretenberg/cpp/pil/avm/constants_gen.pil @@ -18,22 +18,21 @@ namespace constants(256); pol MEM_TAG_U64 = 5; pol MEM_TAG_U128 = 6; pol MEM_TAG_FF = 7; - pol SENDER_KERNEL_INPUTS_COL_OFFSET = 0; - pol ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - pol STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - pol FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; - pol IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; - pol CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; - pol VERSION_KERNEL_INPUTS_COL_OFFSET = 5; - pol BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET = 6; - pol TIMESTAMP_KERNEL_INPUTS_COL_OFFSET = 7; - pol FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET = 8; - pol FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET = 9; - pol DA_START_GAS_KERNEL_INPUTS_COL_OFFSET = 10; - pol L2_START_GAS_KERNEL_INPUTS_COL_OFFSET = 11; - pol DA_END_GAS_KERNEL_INPUTS_COL_OFFSET = 12; - pol L2_END_GAS_KERNEL_INPUTS_COL_OFFSET = 13; - pol TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET = 14; + pol SENDER_SELECTOR = 0; + pol ADDRESS_SELECTOR = 1; + pol STORAGE_ADDRESS_SELECTOR = 1; + pol FUNCTION_SELECTOR_SELECTOR = 2; + pol IS_STATIC_CALL_SELECTOR = 4; + pol START_GLOBAL_VARIABLES = 29; + pol CHAIN_ID_SELECTOR = 29; + pol VERSION_SELECTOR = 30; + pol BLOCK_NUMBER_SELECTOR = 31; + pol TIMESTAMP_SELECTOR = 33; + pol FEE_PER_DA_GAS_SELECTOR = 36; + pol FEE_PER_L2_GAS_SELECTOR = 37; + pol END_GLOBAL_VARIABLES = 38; + pol START_SIDE_EFFECT_COUNTER = 38; + pol TRANSACTION_FEE_SELECTOR = 41; pol START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; pol START_NULLIFIER_EXISTS_OFFSET = 16; pol START_NULLIFIER_NON_EXISTS_OFFSET = 32; diff --git a/barretenberg/cpp/pil/avm/kernel.pil b/barretenberg/cpp/pil/avm/kernel.pil index 133d293d0fc..df94d750dac 100644 --- a/barretenberg/cpp/pil/avm/kernel.pil +++ b/barretenberg/cpp/pil/avm/kernel.pil @@ -21,12 +21,6 @@ namespace main(256); pol commit sel_kernel_inputs; pol commit sel_kernel_out; - // Selectors toggling a fixed specific offset in kernel input column - pol constant sel_l2_start_gas_kernel_input; - pol constant sel_da_start_gas_kernel_input; - pol constant sel_l2_end_gas_kernel_input; - pol constant sel_da_end_gas_kernel_input; - // Kernel Outputs // // The current implementation of kernel outputs is described within https://hackmd.io/zP1oMXF6Rf-L-ZZLXWmfHg @@ -90,42 +84,42 @@ namespace main(256); // TODO: I think we can replace all these (IN) with a single lookup. // CONTEXT - ENVIRONMENT #[ADDRESS_KERNEL] - sel_op_address * (kernel_in_offset - constants.ADDRESS_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_address * (kernel_in_offset - constants.ADDRESS_SELECTOR) = 0; #[STORAGE_ADDRESS_KERNEL] - sel_op_storage_address * (kernel_in_offset - constants.STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_storage_address * (kernel_in_offset - constants.STORAGE_ADDRESS_SELECTOR) = 0; #[SENDER_KERNEL] - sel_op_sender * (kernel_in_offset - constants.SENDER_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_sender * (kernel_in_offset - constants.SENDER_SELECTOR) = 0; #[FUNCTION_SELECTOR_KERNEL] - sel_op_function_selector * (kernel_in_offset - constants.FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_function_selector * (kernel_in_offset - constants.FUNCTION_SELECTOR_SELECTOR) = 0; #[FEE_TRANSACTION_FEE_KERNEL] - sel_op_transaction_fee * (kernel_in_offset - constants.TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_transaction_fee * (kernel_in_offset - constants.TRANSACTION_FEE_SELECTOR) = 0; #[IS_STATIC_CALL_KERNEL] - sel_op_is_static_call * (kernel_in_offset - constants.IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_is_static_call * (kernel_in_offset - constants.IS_STATIC_CALL_SELECTOR) = 0; // CONTEXT - ENVIRONMENT - GLOBALS #[CHAIN_ID_KERNEL] - sel_op_chain_id * (kernel_in_offset - constants.CHAIN_ID_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_chain_id * (kernel_in_offset - constants.CHAIN_ID_SELECTOR) = 0; #[VERSION_KERNEL] - sel_op_version * (kernel_in_offset - constants.VERSION_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_version * (kernel_in_offset - constants.VERSION_SELECTOR) = 0; #[BLOCK_NUMBER_KERNEL] - sel_op_block_number * (kernel_in_offset - constants.BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_block_number * (kernel_in_offset - constants.BLOCK_NUMBER_SELECTOR) = 0; #[TIMESTAMP_KERNEL] - sel_op_timestamp * (kernel_in_offset - constants.TIMESTAMP_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_timestamp * (kernel_in_offset - constants.TIMESTAMP_SELECTOR) = 0; // CONTEXT - ENVIRONMENT - GLOBALS - FEES #[FEE_DA_GAS_KERNEL] - sel_op_fee_per_da_gas * (kernel_in_offset - constants.FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_fee_per_da_gas * (kernel_in_offset - constants.FEE_PER_DA_GAS_SELECTOR) = 0; #[FEE_L2_GAS_KERNEL] - sel_op_fee_per_l2_gas * (kernel_in_offset - constants.FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET) = 0; + sel_op_fee_per_l2_gas * (kernel_in_offset - constants.FEE_PER_L2_GAS_SELECTOR) = 0; // OUTPUTS LOOKUPS // Constrain the value of kernel_out_offset to be the correct offset for the operation being performed @@ -193,21 +187,4 @@ namespace main(256); sel_q_kernel_output_lookup {kernel_out_offset, /*ia,*/ /*side_effect_counter,*/ ib } in sel_kernel_out {clk, /*kernel_value_out,*/ /*kernel_side_effect_out,*/ kernel_metadata_out}; #[LOOKUP_INTO_KERNEL] - sel_q_kernel_lookup { ia, kernel_in_offset } in sel_kernel_inputs { kernel_inputs, clk }; - - // Start/End Gas related permutations - // A lookup of the form "{CONST, gas_remaining} in {clk, kernel_in}" was considered but cannot - // be performed as long as we are not supporting constants or expressions in a tuple involved - // in a lookup/permutation. - - #[PERM_L2_START_GAS] - sel_start_exec { l2_gas_remaining } is sel_l2_start_gas_kernel_input { kernel_inputs }; - - #[PERM_DA_START_GAS] - sel_start_exec { da_gas_remaining } is sel_da_start_gas_kernel_input { kernel_inputs }; - - #[PERM_L2_END_GAS] - sel_execution_end { l2_gas_remaining } is sel_l2_end_gas_kernel_input { kernel_inputs }; - - #[PERM_DA_END_GAS] - sel_execution_end { da_gas_remaining } is sel_da_end_gas_kernel_input { kernel_inputs }; \ No newline at end of file + sel_q_kernel_lookup { main.ia, kernel_in_offset } in sel_kernel_inputs { kernel_inputs, clk }; diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index 768de4483ec..0b70bee3f2b 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -19,7 +19,7 @@ namespace main(256); pol constant sel_first = [1] + [0]*; // Used mostly to toggle off the first row consisting // only in first element of shifted polynomials. pol constant zeroes = [0]*; // Helper for if we need to use a constant zero column - pol constant sel_start_exec; // Toggle row which starts main execution trace (clk == 1). + //===== HELPER POLYNOMIALS ================================================== // This column signals active rows in the main trace table, which should // be every row except the first, and the padding rows at the end. @@ -30,11 +30,6 @@ namespace main(256); sel_execution_row * (1 - sel_execution_row) = 0; // TODO: constrain that the right rows are marked with sel_execution_row - pol commit sel_execution_end; // Toggle next row of last execution trace row. - // Used as a LHS selector of the lookup to enforce final gas values which correspond to - // l2_gas_remaining and da_gas_remaining values located at the row after last execution row. - sel_execution_end' = sel_execution_row * (1 - sel_execution_row') * (1 - sel_first); - //===== PUBLIC COLUMNS========================================================= pol public calldata; pol commit sel_calldata; // Selector used for lookup in calldata. TODO: Might be removed or made constant. @@ -214,6 +209,10 @@ namespace main(256); pol commit sel_resolve_ind_addr_c; pol commit sel_resolve_ind_addr_d; + // Track the last line of the execution trace. It does NOT correspond to the last row of the whole table + // of size N. As this depends on the supplied bytecode, this polynomial cannot be constant. + pol commit sel_last; + // Relations on type constraints // TODO: Very likely, we can remove these constraints as the selectors should be derived during // opcode decomposition. diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp index e50d4e45a58..963e9e47d29 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp @@ -42,8 +42,7 @@ class AcirAvmRecursionConstraint : public ::testing::Test { static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } - // mutate the input kernel_public_inputs_vec to add end gas values - static InnerBuilder create_inner_circuit(std::vector& kernel_public_inputs_vec) + static InnerBuilder create_inner_circuit(const std::vector& kernel_public_inputs_vec) { auto public_inputs = convert_public_inputs(kernel_public_inputs_vec); AvmTraceBuilder trace_builder(public_inputs); @@ -57,12 +56,6 @@ class AcirAvmRecursionConstraint : public ::testing::Test { trace_builder.op_return(0, 0, 0); auto trace = trace_builder.finalize(); // Passing true enables a longer trace with lookups - avm_trace::inject_end_gas_values(public_inputs, trace); - kernel_public_inputs_vec.at(DA_END_GAS_LEFT_PCPI_OFFSET) = - std::get(public_inputs).at(DA_END_GAS_KERNEL_INPUTS_COL_OFFSET); - kernel_public_inputs_vec.at(L2_END_GAS_LEFT_PCPI_OFFSET) = - std::get(public_inputs).at(L2_END_GAS_KERNEL_INPUTS_COL_OFFSET); - builder.set_trace(std::move(trace)); builder.check_circuit(); return builder; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp index 717aca0a7fb..af82fc92610 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp @@ -59,14 +59,7 @@ AvmCircuitBuilder::ProverPolynomials AvmCircuitBuilder::compute_polynomials() co polys.gas_dyn_l2_gas_fixed_table.set_if_valid_index(i, rows[i].gas_dyn_l2_gas_fixed_table); polys.gas_sel_gas_cost.set_if_valid_index(i, rows[i].gas_sel_gas_cost); polys.main_clk.set_if_valid_index(i, rows[i].main_clk); - polys.main_sel_da_end_gas_kernel_input.set_if_valid_index(i, rows[i].main_sel_da_end_gas_kernel_input); - polys.main_sel_da_start_gas_kernel_input.set_if_valid_index(i, - rows[i].main_sel_da_start_gas_kernel_input); polys.main_sel_first.set_if_valid_index(i, rows[i].main_sel_first); - polys.main_sel_l2_end_gas_kernel_input.set_if_valid_index(i, rows[i].main_sel_l2_end_gas_kernel_input); - polys.main_sel_l2_start_gas_kernel_input.set_if_valid_index(i, - rows[i].main_sel_l2_start_gas_kernel_input); - polys.main_sel_start_exec.set_if_valid_index(i, rows[i].main_sel_start_exec); polys.main_zeroes.set_if_valid_index(i, rows[i].main_zeroes); polys.powers_power_of_2.set_if_valid_index(i, rows[i].powers_power_of_2); polys.main_kernel_inputs.set_if_valid_index(i, rows[i].main_kernel_inputs); @@ -229,10 +222,10 @@ AvmCircuitBuilder::ProverPolynomials AvmCircuitBuilder::compute_polynomials() co polys.main_sel_alu.set_if_valid_index(i, rows[i].main_sel_alu); polys.main_sel_bin.set_if_valid_index(i, rows[i].main_sel_bin); polys.main_sel_calldata.set_if_valid_index(i, rows[i].main_sel_calldata); - polys.main_sel_execution_end.set_if_valid_index(i, rows[i].main_sel_execution_end); polys.main_sel_execution_row.set_if_valid_index(i, rows[i].main_sel_execution_row); polys.main_sel_kernel_inputs.set_if_valid_index(i, rows[i].main_sel_kernel_inputs); polys.main_sel_kernel_out.set_if_valid_index(i, rows[i].main_sel_kernel_out); + polys.main_sel_last.set_if_valid_index(i, rows[i].main_sel_last); polys.main_sel_mem_op_a.set_if_valid_index(i, rows[i].main_sel_mem_op_a); polys.main_sel_mem_op_b.set_if_valid_index(i, rows[i].main_sel_mem_op_b); polys.main_sel_mem_op_c.set_if_valid_index(i, rows[i].main_sel_mem_op_c); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index 4e2a5a5290f..676f16380d5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -18,748 +18,738 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , gas_dyn_l2_gas_fixed_table(il[10]) , gas_sel_gas_cost(il[11]) , main_clk(il[12]) - , main_sel_da_end_gas_kernel_input(il[13]) - , main_sel_da_start_gas_kernel_input(il[14]) - , main_sel_first(il[15]) - , main_sel_l2_end_gas_kernel_input(il[16]) - , main_sel_l2_start_gas_kernel_input(il[17]) - , main_sel_start_exec(il[18]) - , main_zeroes(il[19]) - , powers_power_of_2(il[20]) - , main_kernel_inputs(il[21]) - , main_kernel_value_out(il[22]) - , main_kernel_side_effect_out(il[23]) - , main_kernel_metadata_out(il[24]) - , main_calldata(il[25]) - , main_returndata(il[26]) - , alu_a_hi(il[27]) - , alu_a_lo(il[28]) - , alu_b_hi(il[29]) - , alu_b_lo(il[30]) - , alu_b_pow(il[31]) - , alu_c_hi(il[32]) - , alu_c_lo(il[33]) - , alu_cf(il[34]) - , alu_clk(il[35]) - , alu_cmp_gadget_gt(il[36]) - , alu_cmp_gadget_input_a(il[37]) - , alu_cmp_gadget_input_b(il[38]) - , alu_cmp_gadget_result(il[39]) - , alu_cmp_gadget_sel(il[40]) - , alu_ff_tag(il[41]) - , alu_ia(il[42]) - , alu_ib(il[43]) - , alu_ic(il[44]) - , alu_in_tag(il[45]) - , alu_max_bits_sub_b_bits(il[46]) - , alu_max_bits_sub_b_pow(il[47]) - , alu_op_add(il[48]) - , alu_op_cast(il[49]) - , alu_op_div(il[50]) - , alu_op_eq(il[51]) - , alu_op_lt(il[52]) - , alu_op_lte(il[53]) - , alu_op_mul(il[54]) - , alu_op_not(il[55]) - , alu_op_shl(il[56]) - , alu_op_shr(il[57]) - , alu_op_sub(il[58]) - , alu_partial_prod_hi(il[59]) - , alu_partial_prod_lo(il[60]) - , alu_range_check_input_value(il[61]) - , alu_range_check_num_bits(il[62]) - , alu_range_check_sel(il[63]) - , alu_remainder(il[64]) - , alu_sel_alu(il[65]) - , alu_sel_cmp(il[66]) - , alu_sel_shift_which(il[67]) - , alu_u128_tag(il[68]) - , alu_u16_tag(il[69]) - , alu_u1_tag(il[70]) - , alu_u32_tag(il[71]) - , alu_u64_tag(il[72]) - , alu_u8_tag(il[73]) - , alu_zero_shift(il[74]) - , binary_acc_ia(il[75]) - , binary_acc_ib(il[76]) - , binary_acc_ic(il[77]) - , binary_clk(il[78]) - , binary_ia_bytes(il[79]) - , binary_ib_bytes(il[80]) - , binary_ic_bytes(il[81]) - , binary_in_tag(il[82]) - , binary_mem_tag_ctr(il[83]) - , binary_mem_tag_ctr_inv(il[84]) - , binary_op_id(il[85]) - , binary_sel_bin(il[86]) - , binary_start(il[87]) - , cmp_a_hi(il[88]) - , cmp_a_lo(il[89]) - , cmp_b_hi(il[90]) - , cmp_b_lo(il[91]) - , cmp_borrow(il[92]) - , cmp_clk(il[93]) - , cmp_cmp_rng_ctr(il[94]) - , cmp_input_a(il[95]) - , cmp_input_b(il[96]) - , cmp_op_eq(il[97]) - , cmp_op_eq_diff_inv(il[98]) - , cmp_op_gt(il[99]) - , cmp_p_a_borrow(il[100]) - , cmp_p_b_borrow(il[101]) - , cmp_p_sub_a_hi(il[102]) - , cmp_p_sub_a_lo(il[103]) - , cmp_p_sub_b_hi(il[104]) - , cmp_p_sub_b_lo(il[105]) - , cmp_range_chk_clk(il[106]) - , cmp_res_hi(il[107]) - , cmp_res_lo(il[108]) - , cmp_result(il[109]) - , cmp_sel_cmp(il[110]) - , cmp_sel_rng_chk(il[111]) - , cmp_shift_sel(il[112]) - , conversion_clk(il[113]) - , conversion_input(il[114]) - , conversion_num_limbs(il[115]) - , conversion_output_bits(il[116]) - , conversion_radix(il[117]) - , conversion_sel_to_radix_le(il[118]) - , keccakf1600_clk(il[119]) - , keccakf1600_input(il[120]) - , keccakf1600_output(il[121]) - , keccakf1600_sel_keccakf1600(il[122]) - , main_abs_da_rem_gas(il[123]) - , main_abs_l2_rem_gas(il[124]) - , main_alu_in_tag(il[125]) - , main_base_da_gas_op_cost(il[126]) - , main_base_l2_gas_op_cost(il[127]) - , main_bin_op_id(il[128]) - , main_call_ptr(il[129]) - , main_da_gas_remaining(il[130]) - , main_da_out_of_gas(il[131]) - , main_dyn_da_gas_op_cost(il[132]) - , main_dyn_gas_multiplier(il[133]) - , main_dyn_l2_gas_op_cost(il[134]) - , main_emit_l2_to_l1_msg_write_offset(il[135]) - , main_emit_note_hash_write_offset(il[136]) - , main_emit_nullifier_write_offset(il[137]) - , main_emit_unencrypted_log_write_offset(il[138]) - , main_ia(il[139]) - , main_ib(il[140]) - , main_ic(il[141]) - , main_id(il[142]) - , main_id_zero(il[143]) - , main_ind_addr_a(il[144]) - , main_ind_addr_b(il[145]) - , main_ind_addr_c(il[146]) - , main_ind_addr_d(il[147]) - , main_internal_return_ptr(il[148]) - , main_inv(il[149]) - , main_is_fake_row(il[150]) - , main_is_gas_accounted(il[151]) - , main_kernel_in_offset(il[152]) - , main_kernel_out_offset(il[153]) - , main_l1_to_l2_msg_exists_write_offset(il[154]) - , main_l2_gas_remaining(il[155]) - , main_l2_out_of_gas(il[156]) - , main_mem_addr_a(il[157]) - , main_mem_addr_b(il[158]) - , main_mem_addr_c(il[159]) - , main_mem_addr_d(il[160]) - , main_note_hash_exist_write_offset(il[161]) - , main_nullifier_exists_write_offset(il[162]) - , main_nullifier_non_exists_write_offset(il[163]) - , main_op_err(il[164]) - , main_opcode_val(il[165]) - , main_pc(il[166]) - , main_r_in_tag(il[167]) - , main_rwa(il[168]) - , main_rwb(il[169]) - , main_rwc(il[170]) - , main_rwd(il[171]) - , main_sel_alu(il[172]) - , main_sel_bin(il[173]) - , main_sel_calldata(il[174]) - , main_sel_execution_end(il[175]) - , main_sel_execution_row(il[176]) - , main_sel_kernel_inputs(il[177]) - , main_sel_kernel_out(il[178]) - , main_sel_mem_op_a(il[179]) - , main_sel_mem_op_b(il[180]) - , main_sel_mem_op_c(il[181]) - , main_sel_mem_op_d(il[182]) - , main_sel_mov_ia_to_ic(il[183]) - , main_sel_mov_ib_to_ic(il[184]) - , main_sel_op_add(il[185]) - , main_sel_op_address(il[186]) - , main_sel_op_and(il[187]) - , main_sel_op_block_number(il[188]) - , main_sel_op_calldata_copy(il[189]) - , main_sel_op_cast(il[190]) - , main_sel_op_chain_id(il[191]) - , main_sel_op_dagasleft(il[192]) - , main_sel_op_div(il[193]) - , main_sel_op_ecadd(il[194]) - , main_sel_op_emit_l2_to_l1_msg(il[195]) - , main_sel_op_emit_note_hash(il[196]) - , main_sel_op_emit_nullifier(il[197]) - , main_sel_op_emit_unencrypted_log(il[198]) - , main_sel_op_eq(il[199]) - , main_sel_op_external_call(il[200]) - , main_sel_op_external_return(il[201]) - , main_sel_op_external_revert(il[202]) - , main_sel_op_fdiv(il[203]) - , main_sel_op_fee_per_da_gas(il[204]) - , main_sel_op_fee_per_l2_gas(il[205]) - , main_sel_op_function_selector(il[206]) - , main_sel_op_get_contract_instance(il[207]) - , main_sel_op_internal_call(il[208]) - , main_sel_op_internal_return(il[209]) - , main_sel_op_is_static_call(il[210]) - , main_sel_op_jump(il[211]) - , main_sel_op_jumpi(il[212]) - , main_sel_op_keccak(il[213]) - , main_sel_op_l1_to_l2_msg_exists(il[214]) - , main_sel_op_l2gasleft(il[215]) - , main_sel_op_lt(il[216]) - , main_sel_op_lte(il[217]) - , main_sel_op_mov(il[218]) - , main_sel_op_msm(il[219]) - , main_sel_op_mul(il[220]) - , main_sel_op_not(il[221]) - , main_sel_op_note_hash_exists(il[222]) - , main_sel_op_nullifier_exists(il[223]) - , main_sel_op_or(il[224]) - , main_sel_op_pedersen(il[225]) - , main_sel_op_pedersen_commit(il[226]) - , main_sel_op_poseidon2(il[227]) - , main_sel_op_radix_le(il[228]) - , main_sel_op_sender(il[229]) - , main_sel_op_set(il[230]) - , main_sel_op_sha256(il[231]) - , main_sel_op_shl(il[232]) - , main_sel_op_shr(il[233]) - , main_sel_op_sload(il[234]) - , main_sel_op_sstore(il[235]) - , main_sel_op_static_call(il[236]) - , main_sel_op_storage_address(il[237]) - , main_sel_op_sub(il[238]) - , main_sel_op_timestamp(il[239]) - , main_sel_op_transaction_fee(il[240]) - , main_sel_op_version(il[241]) - , main_sel_op_xor(il[242]) - , main_sel_q_kernel_lookup(il[243]) - , main_sel_q_kernel_output_lookup(il[244]) - , main_sel_resolve_ind_addr_a(il[245]) - , main_sel_resolve_ind_addr_b(il[246]) - , main_sel_resolve_ind_addr_c(il[247]) - , main_sel_resolve_ind_addr_d(il[248]) - , main_sel_returndata(il[249]) - , main_sel_rng_16(il[250]) - , main_sel_rng_8(il[251]) - , main_sel_slice_gadget(il[252]) - , main_side_effect_counter(il[253]) - , main_sload_write_offset(il[254]) - , main_space_id(il[255]) - , main_sstore_write_offset(il[256]) - , main_tag_err(il[257]) - , main_w_in_tag(il[258]) - , mem_addr(il[259]) - , mem_clk(il[260]) - , mem_diff(il[261]) - , mem_glob_addr(il[262]) - , mem_last(il[263]) - , mem_lastAccess(il[264]) - , mem_one_min_inv(il[265]) - , mem_r_in_tag(il[266]) - , mem_rw(il[267]) - , mem_sel_mem(il[268]) - , mem_sel_mov_ia_to_ic(il[269]) - , mem_sel_mov_ib_to_ic(il[270]) - , mem_sel_op_a(il[271]) - , mem_sel_op_b(il[272]) - , mem_sel_op_c(il[273]) - , mem_sel_op_d(il[274]) - , mem_sel_op_poseidon_read_a(il[275]) - , mem_sel_op_poseidon_read_b(il[276]) - , mem_sel_op_poseidon_read_c(il[277]) - , mem_sel_op_poseidon_read_d(il[278]) - , mem_sel_op_poseidon_write_a(il[279]) - , mem_sel_op_poseidon_write_b(il[280]) - , mem_sel_op_poseidon_write_c(il[281]) - , mem_sel_op_poseidon_write_d(il[282]) - , mem_sel_op_slice(il[283]) - , mem_sel_resolve_ind_addr_a(il[284]) - , mem_sel_resolve_ind_addr_b(il[285]) - , mem_sel_resolve_ind_addr_c(il[286]) - , mem_sel_resolve_ind_addr_d(il[287]) - , mem_sel_rng_chk(il[288]) - , mem_skip_check_tag(il[289]) - , mem_space_id(il[290]) - , mem_tag(il[291]) - , mem_tag_err(il[292]) - , mem_tsp(il[293]) - , mem_val(il[294]) - , mem_w_in_tag(il[295]) - , pedersen_clk(il[296]) - , pedersen_input(il[297]) - , pedersen_output(il[298]) - , pedersen_sel_pedersen(il[299]) - , poseidon2_B_10_0(il[300]) - , poseidon2_B_10_1(il[301]) - , poseidon2_B_10_2(il[302]) - , poseidon2_B_10_3(il[303]) - , poseidon2_B_11_0(il[304]) - , poseidon2_B_11_1(il[305]) - , poseidon2_B_11_2(il[306]) - , poseidon2_B_11_3(il[307]) - , poseidon2_B_12_0(il[308]) - , poseidon2_B_12_1(il[309]) - , poseidon2_B_12_2(il[310]) - , poseidon2_B_12_3(il[311]) - , poseidon2_B_13_0(il[312]) - , poseidon2_B_13_1(il[313]) - , poseidon2_B_13_2(il[314]) - , poseidon2_B_13_3(il[315]) - , poseidon2_B_14_0(il[316]) - , poseidon2_B_14_1(il[317]) - , poseidon2_B_14_2(il[318]) - , poseidon2_B_14_3(il[319]) - , poseidon2_B_15_0(il[320]) - , poseidon2_B_15_1(il[321]) - , poseidon2_B_15_2(il[322]) - , poseidon2_B_15_3(il[323]) - , poseidon2_B_16_0(il[324]) - , poseidon2_B_16_1(il[325]) - , poseidon2_B_16_2(il[326]) - , poseidon2_B_16_3(il[327]) - , poseidon2_B_17_0(il[328]) - , poseidon2_B_17_1(il[329]) - , poseidon2_B_17_2(il[330]) - , poseidon2_B_17_3(il[331]) - , poseidon2_B_18_0(il[332]) - , poseidon2_B_18_1(il[333]) - , poseidon2_B_18_2(il[334]) - , poseidon2_B_18_3(il[335]) - , poseidon2_B_19_0(il[336]) - , poseidon2_B_19_1(il[337]) - , poseidon2_B_19_2(il[338]) - , poseidon2_B_19_3(il[339]) - , poseidon2_B_20_0(il[340]) - , poseidon2_B_20_1(il[341]) - , poseidon2_B_20_2(il[342]) - , poseidon2_B_20_3(il[343]) - , poseidon2_B_21_0(il[344]) - , poseidon2_B_21_1(il[345]) - , poseidon2_B_21_2(il[346]) - , poseidon2_B_21_3(il[347]) - , poseidon2_B_22_0(il[348]) - , poseidon2_B_22_1(il[349]) - , poseidon2_B_22_2(il[350]) - , poseidon2_B_22_3(il[351]) - , poseidon2_B_23_0(il[352]) - , poseidon2_B_23_1(il[353]) - , poseidon2_B_23_2(il[354]) - , poseidon2_B_23_3(il[355]) - , poseidon2_B_24_0(il[356]) - , poseidon2_B_24_1(il[357]) - , poseidon2_B_24_2(il[358]) - , poseidon2_B_24_3(il[359]) - , poseidon2_B_25_0(il[360]) - , poseidon2_B_25_1(il[361]) - , poseidon2_B_25_2(il[362]) - , poseidon2_B_25_3(il[363]) - , poseidon2_B_26_0(il[364]) - , poseidon2_B_26_1(il[365]) - , poseidon2_B_26_2(il[366]) - , poseidon2_B_26_3(il[367]) - , poseidon2_B_27_0(il[368]) - , poseidon2_B_27_1(il[369]) - , poseidon2_B_27_2(il[370]) - , poseidon2_B_27_3(il[371]) - , poseidon2_B_28_0(il[372]) - , poseidon2_B_28_1(il[373]) - , poseidon2_B_28_2(il[374]) - , poseidon2_B_28_3(il[375]) - , poseidon2_B_29_0(il[376]) - , poseidon2_B_29_1(il[377]) - , poseidon2_B_29_2(il[378]) - , poseidon2_B_29_3(il[379]) - , poseidon2_B_30_0(il[380]) - , poseidon2_B_30_1(il[381]) - , poseidon2_B_30_2(il[382]) - , poseidon2_B_30_3(il[383]) - , poseidon2_B_31_0(il[384]) - , poseidon2_B_31_1(il[385]) - , poseidon2_B_31_2(il[386]) - , poseidon2_B_31_3(il[387]) - , poseidon2_B_32_0(il[388]) - , poseidon2_B_32_1(il[389]) - , poseidon2_B_32_2(il[390]) - , poseidon2_B_32_3(il[391]) - , poseidon2_B_33_0(il[392]) - , poseidon2_B_33_1(il[393]) - , poseidon2_B_33_2(il[394]) - , poseidon2_B_33_3(il[395]) - , poseidon2_B_34_0(il[396]) - , poseidon2_B_34_1(il[397]) - , poseidon2_B_34_2(il[398]) - , poseidon2_B_34_3(il[399]) - , poseidon2_B_35_0(il[400]) - , poseidon2_B_35_1(il[401]) - , poseidon2_B_35_2(il[402]) - , poseidon2_B_35_3(il[403]) - , poseidon2_B_36_0(il[404]) - , poseidon2_B_36_1(il[405]) - , poseidon2_B_36_2(il[406]) - , poseidon2_B_36_3(il[407]) - , poseidon2_B_37_0(il[408]) - , poseidon2_B_37_1(il[409]) - , poseidon2_B_37_2(il[410]) - , poseidon2_B_37_3(il[411]) - , poseidon2_B_38_0(il[412]) - , poseidon2_B_38_1(il[413]) - , poseidon2_B_38_2(il[414]) - , poseidon2_B_38_3(il[415]) - , poseidon2_B_39_0(il[416]) - , poseidon2_B_39_1(il[417]) - , poseidon2_B_39_2(il[418]) - , poseidon2_B_39_3(il[419]) - , poseidon2_B_40_0(il[420]) - , poseidon2_B_40_1(il[421]) - , poseidon2_B_40_2(il[422]) - , poseidon2_B_40_3(il[423]) - , poseidon2_B_41_0(il[424]) - , poseidon2_B_41_1(il[425]) - , poseidon2_B_41_2(il[426]) - , poseidon2_B_41_3(il[427]) - , poseidon2_B_42_0(il[428]) - , poseidon2_B_42_1(il[429]) - , poseidon2_B_42_2(il[430]) - , poseidon2_B_42_3(il[431]) - , poseidon2_B_43_0(il[432]) - , poseidon2_B_43_1(il[433]) - , poseidon2_B_43_2(il[434]) - , poseidon2_B_43_3(il[435]) - , poseidon2_B_44_0(il[436]) - , poseidon2_B_44_1(il[437]) - , poseidon2_B_44_2(il[438]) - , poseidon2_B_44_3(il[439]) - , poseidon2_B_45_0(il[440]) - , poseidon2_B_45_1(il[441]) - , poseidon2_B_45_2(il[442]) - , poseidon2_B_45_3(il[443]) - , poseidon2_B_46_0(il[444]) - , poseidon2_B_46_1(il[445]) - , poseidon2_B_46_2(il[446]) - , poseidon2_B_46_3(il[447]) - , poseidon2_B_47_0(il[448]) - , poseidon2_B_47_1(il[449]) - , poseidon2_B_47_2(il[450]) - , poseidon2_B_47_3(il[451]) - , poseidon2_B_48_0(il[452]) - , poseidon2_B_48_1(il[453]) - , poseidon2_B_48_2(il[454]) - , poseidon2_B_48_3(il[455]) - , poseidon2_B_49_0(il[456]) - , poseidon2_B_49_1(il[457]) - , poseidon2_B_49_2(il[458]) - , poseidon2_B_49_3(il[459]) - , poseidon2_B_4_0(il[460]) - , poseidon2_B_4_1(il[461]) - , poseidon2_B_4_2(il[462]) - , poseidon2_B_4_3(il[463]) - , poseidon2_B_50_0(il[464]) - , poseidon2_B_50_1(il[465]) - , poseidon2_B_50_2(il[466]) - , poseidon2_B_50_3(il[467]) - , poseidon2_B_51_0(il[468]) - , poseidon2_B_51_1(il[469]) - , poseidon2_B_51_2(il[470]) - , poseidon2_B_51_3(il[471]) - , poseidon2_B_52_0(il[472]) - , poseidon2_B_52_1(il[473]) - , poseidon2_B_52_2(il[474]) - , poseidon2_B_52_3(il[475]) - , poseidon2_B_53_0(il[476]) - , poseidon2_B_53_1(il[477]) - , poseidon2_B_53_2(il[478]) - , poseidon2_B_53_3(il[479]) - , poseidon2_B_54_0(il[480]) - , poseidon2_B_54_1(il[481]) - , poseidon2_B_54_2(il[482]) - , poseidon2_B_54_3(il[483]) - , poseidon2_B_55_0(il[484]) - , poseidon2_B_55_1(il[485]) - , poseidon2_B_55_2(il[486]) - , poseidon2_B_55_3(il[487]) - , poseidon2_B_56_0(il[488]) - , poseidon2_B_56_1(il[489]) - , poseidon2_B_56_2(il[490]) - , poseidon2_B_56_3(il[491]) - , poseidon2_B_57_0(il[492]) - , poseidon2_B_57_1(il[493]) - , poseidon2_B_57_2(il[494]) - , poseidon2_B_57_3(il[495]) - , poseidon2_B_58_0(il[496]) - , poseidon2_B_58_1(il[497]) - , poseidon2_B_58_2(il[498]) - , poseidon2_B_58_3(il[499]) - , poseidon2_B_59_0(il[500]) - , poseidon2_B_59_1(il[501]) - , poseidon2_B_59_2(il[502]) - , poseidon2_B_59_3(il[503]) - , poseidon2_B_5_0(il[504]) - , poseidon2_B_5_1(il[505]) - , poseidon2_B_5_2(il[506]) - , poseidon2_B_5_3(il[507]) - , poseidon2_B_6_0(il[508]) - , poseidon2_B_6_1(il[509]) - , poseidon2_B_6_2(il[510]) - , poseidon2_B_6_3(il[511]) - , poseidon2_B_7_0(il[512]) - , poseidon2_B_7_1(il[513]) - , poseidon2_B_7_2(il[514]) - , poseidon2_B_7_3(il[515]) - , poseidon2_B_8_0(il[516]) - , poseidon2_B_8_1(il[517]) - , poseidon2_B_8_2(il[518]) - , poseidon2_B_8_3(il[519]) - , poseidon2_B_9_0(il[520]) - , poseidon2_B_9_1(il[521]) - , poseidon2_B_9_2(il[522]) - , poseidon2_B_9_3(il[523]) - , poseidon2_EXT_LAYER_4(il[524]) - , poseidon2_EXT_LAYER_5(il[525]) - , poseidon2_EXT_LAYER_6(il[526]) - , poseidon2_EXT_LAYER_7(il[527]) - , poseidon2_T_0_4(il[528]) - , poseidon2_T_0_5(il[529]) - , poseidon2_T_0_6(il[530]) - , poseidon2_T_0_7(il[531]) - , poseidon2_T_1_4(il[532]) - , poseidon2_T_1_5(il[533]) - , poseidon2_T_1_6(il[534]) - , poseidon2_T_1_7(il[535]) - , poseidon2_T_2_4(il[536]) - , poseidon2_T_2_5(il[537]) - , poseidon2_T_2_6(il[538]) - , poseidon2_T_2_7(il[539]) - , poseidon2_T_3_4(il[540]) - , poseidon2_T_3_5(il[541]) - , poseidon2_T_3_6(il[542]) - , poseidon2_T_3_7(il[543]) - , poseidon2_T_60_4(il[544]) - , poseidon2_T_60_5(il[545]) - , poseidon2_T_60_6(il[546]) - , poseidon2_T_60_7(il[547]) - , poseidon2_T_61_4(il[548]) - , poseidon2_T_61_5(il[549]) - , poseidon2_T_61_6(il[550]) - , poseidon2_T_61_7(il[551]) - , poseidon2_T_62_4(il[552]) - , poseidon2_T_62_5(il[553]) - , poseidon2_T_62_6(il[554]) - , poseidon2_T_62_7(il[555]) - , poseidon2_T_63_4(il[556]) - , poseidon2_T_63_5(il[557]) - , poseidon2_T_63_6(il[558]) - , poseidon2_T_63_7(il[559]) - , poseidon2_a_0(il[560]) - , poseidon2_a_1(il[561]) - , poseidon2_a_2(il[562]) - , poseidon2_a_3(il[563]) - , poseidon2_b_0(il[564]) - , poseidon2_b_1(il[565]) - , poseidon2_b_2(il[566]) - , poseidon2_b_3(il[567]) - , poseidon2_clk(il[568]) - , poseidon2_input_addr(il[569]) - , poseidon2_mem_addr_read_a(il[570]) - , poseidon2_mem_addr_read_b(il[571]) - , poseidon2_mem_addr_read_c(il[572]) - , poseidon2_mem_addr_read_d(il[573]) - , poseidon2_mem_addr_write_a(il[574]) - , poseidon2_mem_addr_write_b(il[575]) - , poseidon2_mem_addr_write_c(il[576]) - , poseidon2_mem_addr_write_d(il[577]) - , poseidon2_output_addr(il[578]) - , poseidon2_sel_poseidon_perm(il[579]) - , range_check_alu_rng_chk(il[580]) - , range_check_clk(il[581]) - , range_check_cmp_hi_bits_rng_chk(il[582]) - , range_check_cmp_lo_bits_rng_chk(il[583]) - , range_check_dyn_diff(il[584]) - , range_check_dyn_rng_chk_bits(il[585]) - , range_check_dyn_rng_chk_pow_2(il[586]) - , range_check_gas_da_rng_chk(il[587]) - , range_check_gas_l2_rng_chk(il[588]) - , range_check_is_lte_u112(il[589]) - , range_check_is_lte_u128(il[590]) - , range_check_is_lte_u16(il[591]) - , range_check_is_lte_u32(il[592]) - , range_check_is_lte_u48(il[593]) - , range_check_is_lte_u64(il[594]) - , range_check_is_lte_u80(il[595]) - , range_check_is_lte_u96(il[596]) - , range_check_mem_rng_chk(il[597]) - , range_check_rng_chk_bits(il[598]) - , range_check_sel_lookup_0(il[599]) - , range_check_sel_lookup_1(il[600]) - , range_check_sel_lookup_2(il[601]) - , range_check_sel_lookup_3(il[602]) - , range_check_sel_lookup_4(il[603]) - , range_check_sel_lookup_5(il[604]) - , range_check_sel_lookup_6(il[605]) - , range_check_sel_rng_chk(il[606]) - , range_check_u16_r0(il[607]) - , range_check_u16_r1(il[608]) - , range_check_u16_r2(il[609]) - , range_check_u16_r3(il[610]) - , range_check_u16_r4(il[611]) - , range_check_u16_r5(il[612]) - , range_check_u16_r6(il[613]) - , range_check_u16_r7(il[614]) - , range_check_value(il[615]) - , sha256_clk(il[616]) - , sha256_input(il[617]) - , sha256_output(il[618]) - , sha256_sel_sha256_compression(il[619]) - , sha256_state(il[620]) - , slice_addr(il[621]) - , slice_clk(il[622]) - , slice_cnt(il[623]) - , slice_col_offset(il[624]) - , slice_one_min_inv(il[625]) - , slice_sel_cd_cpy(il[626]) - , slice_sel_mem_active(il[627]) - , slice_sel_return(il[628]) - , slice_sel_start(il[629]) - , slice_space_id(il[630]) - , slice_val(il[631]) - , lookup_rng_chk_pow_2_counts(il[632]) - , lookup_rng_chk_diff_counts(il[633]) - , lookup_rng_chk_0_counts(il[634]) - , lookup_rng_chk_1_counts(il[635]) - , lookup_rng_chk_2_counts(il[636]) - , lookup_rng_chk_3_counts(il[637]) - , lookup_rng_chk_4_counts(il[638]) - , lookup_rng_chk_5_counts(il[639]) - , lookup_rng_chk_6_counts(il[640]) - , lookup_rng_chk_7_counts(il[641]) - , lookup_pow_2_0_counts(il[642]) - , lookup_pow_2_1_counts(il[643]) - , lookup_byte_lengths_counts(il[644]) - , lookup_byte_operations_counts(il[645]) - , lookup_opcode_gas_counts(il[646]) - , kernel_output_lookup_counts(il[647]) - , lookup_into_kernel_counts(il[648]) - , lookup_cd_value_counts(il[649]) - , lookup_ret_value_counts(il[650]) - , incl_main_tag_err_counts(il[651]) - , incl_mem_tag_err_counts(il[652]) - , perm_rng_mem_inv(il[653]) - , perm_rng_cmp_lo_inv(il[654]) - , perm_rng_cmp_hi_inv(il[655]) - , perm_rng_alu_inv(il[656]) - , perm_cmp_alu_inv(il[657]) - , perm_rng_gas_l2_inv(il[658]) - , perm_rng_gas_da_inv(il[659]) - , perm_l2_start_gas_inv(il[660]) - , perm_da_start_gas_inv(il[661]) - , perm_l2_end_gas_inv(il[662]) - , perm_da_end_gas_inv(il[663]) - , perm_pos_mem_read_a_inv(il[664]) - , perm_pos_mem_read_b_inv(il[665]) - , perm_pos_mem_read_c_inv(il[666]) - , perm_pos_mem_read_d_inv(il[667]) - , perm_pos_mem_write_a_inv(il[668]) - , perm_pos_mem_write_b_inv(il[669]) - , perm_pos_mem_write_c_inv(il[670]) - , perm_pos_mem_write_d_inv(il[671]) - , perm_slice_mem_inv(il[672]) - , perm_main_alu_inv(il[673]) - , perm_main_bin_inv(il[674]) - , perm_main_conv_inv(il[675]) - , perm_main_pos2_perm_inv(il[676]) - , perm_main_pedersen_inv(il[677]) - , perm_main_slice_inv(il[678]) - , perm_main_mem_a_inv(il[679]) - , perm_main_mem_b_inv(il[680]) - , perm_main_mem_c_inv(il[681]) - , perm_main_mem_d_inv(il[682]) - , perm_main_mem_ind_addr_a_inv(il[683]) - , perm_main_mem_ind_addr_b_inv(il[684]) - , perm_main_mem_ind_addr_c_inv(il[685]) - , perm_main_mem_ind_addr_d_inv(il[686]) - , lookup_rng_chk_pow_2_inv(il[687]) - , lookup_rng_chk_diff_inv(il[688]) - , lookup_rng_chk_0_inv(il[689]) - , lookup_rng_chk_1_inv(il[690]) - , lookup_rng_chk_2_inv(il[691]) - , lookup_rng_chk_3_inv(il[692]) - , lookup_rng_chk_4_inv(il[693]) - , lookup_rng_chk_5_inv(il[694]) - , lookup_rng_chk_6_inv(il[695]) - , lookup_rng_chk_7_inv(il[696]) - , lookup_pow_2_0_inv(il[697]) - , lookup_pow_2_1_inv(il[698]) - , lookup_byte_lengths_inv(il[699]) - , lookup_byte_operations_inv(il[700]) - , lookup_opcode_gas_inv(il[701]) - , kernel_output_lookup_inv(il[702]) - , lookup_into_kernel_inv(il[703]) - , lookup_cd_value_inv(il[704]) - , lookup_ret_value_inv(il[705]) - , incl_main_tag_err_inv(il[706]) - , incl_mem_tag_err_inv(il[707]) - , binary_acc_ia_shift(il[708]) - , binary_acc_ib_shift(il[709]) - , binary_acc_ic_shift(il[710]) - , binary_mem_tag_ctr_shift(il[711]) - , binary_op_id_shift(il[712]) - , cmp_a_hi_shift(il[713]) - , cmp_a_lo_shift(il[714]) - , cmp_b_hi_shift(il[715]) - , cmp_b_lo_shift(il[716]) - , cmp_cmp_rng_ctr_shift(il[717]) - , cmp_op_gt_shift(il[718]) - , cmp_p_sub_a_hi_shift(il[719]) - , cmp_p_sub_a_lo_shift(il[720]) - , cmp_p_sub_b_hi_shift(il[721]) - , cmp_p_sub_b_lo_shift(il[722]) - , cmp_sel_rng_chk_shift(il[723]) - , main_da_gas_remaining_shift(il[724]) - , main_emit_l2_to_l1_msg_write_offset_shift(il[725]) - , main_emit_note_hash_write_offset_shift(il[726]) - , main_emit_nullifier_write_offset_shift(il[727]) - , main_emit_unencrypted_log_write_offset_shift(il[728]) - , main_internal_return_ptr_shift(il[729]) - , main_l1_to_l2_msg_exists_write_offset_shift(il[730]) - , main_l2_gas_remaining_shift(il[731]) - , main_note_hash_exist_write_offset_shift(il[732]) - , main_nullifier_exists_write_offset_shift(il[733]) - , main_nullifier_non_exists_write_offset_shift(il[734]) - , main_pc_shift(il[735]) - , main_sel_execution_end_shift(il[736]) - , main_sel_execution_row_shift(il[737]) - , main_sload_write_offset_shift(il[738]) - , main_sstore_write_offset_shift(il[739]) - , mem_glob_addr_shift(il[740]) - , mem_rw_shift(il[741]) - , mem_sel_mem_shift(il[742]) - , mem_tag_shift(il[743]) - , mem_tsp_shift(il[744]) - , mem_val_shift(il[745]) - , slice_addr_shift(il[746]) - , slice_clk_shift(il[747]) - , slice_cnt_shift(il[748]) - , slice_col_offset_shift(il[749]) - , slice_sel_cd_cpy_shift(il[750]) - , slice_sel_mem_active_shift(il[751]) - , slice_sel_return_shift(il[752]) - , slice_sel_start_shift(il[753]) - , slice_space_id_shift(il[754]) + , main_sel_first(il[13]) + , main_zeroes(il[14]) + , powers_power_of_2(il[15]) + , main_kernel_inputs(il[16]) + , main_kernel_value_out(il[17]) + , main_kernel_side_effect_out(il[18]) + , main_kernel_metadata_out(il[19]) + , main_calldata(il[20]) + , main_returndata(il[21]) + , alu_a_hi(il[22]) + , alu_a_lo(il[23]) + , alu_b_hi(il[24]) + , alu_b_lo(il[25]) + , alu_b_pow(il[26]) + , alu_c_hi(il[27]) + , alu_c_lo(il[28]) + , alu_cf(il[29]) + , alu_clk(il[30]) + , alu_cmp_gadget_gt(il[31]) + , alu_cmp_gadget_input_a(il[32]) + , alu_cmp_gadget_input_b(il[33]) + , alu_cmp_gadget_result(il[34]) + , alu_cmp_gadget_sel(il[35]) + , alu_ff_tag(il[36]) + , alu_ia(il[37]) + , alu_ib(il[38]) + , alu_ic(il[39]) + , alu_in_tag(il[40]) + , alu_max_bits_sub_b_bits(il[41]) + , alu_max_bits_sub_b_pow(il[42]) + , alu_op_add(il[43]) + , alu_op_cast(il[44]) + , alu_op_div(il[45]) + , alu_op_eq(il[46]) + , alu_op_lt(il[47]) + , alu_op_lte(il[48]) + , alu_op_mul(il[49]) + , alu_op_not(il[50]) + , alu_op_shl(il[51]) + , alu_op_shr(il[52]) + , alu_op_sub(il[53]) + , alu_partial_prod_hi(il[54]) + , alu_partial_prod_lo(il[55]) + , alu_range_check_input_value(il[56]) + , alu_range_check_num_bits(il[57]) + , alu_range_check_sel(il[58]) + , alu_remainder(il[59]) + , alu_sel_alu(il[60]) + , alu_sel_cmp(il[61]) + , alu_sel_shift_which(il[62]) + , alu_u128_tag(il[63]) + , alu_u16_tag(il[64]) + , alu_u1_tag(il[65]) + , alu_u32_tag(il[66]) + , alu_u64_tag(il[67]) + , alu_u8_tag(il[68]) + , alu_zero_shift(il[69]) + , binary_acc_ia(il[70]) + , binary_acc_ib(il[71]) + , binary_acc_ic(il[72]) + , binary_clk(il[73]) + , binary_ia_bytes(il[74]) + , binary_ib_bytes(il[75]) + , binary_ic_bytes(il[76]) + , binary_in_tag(il[77]) + , binary_mem_tag_ctr(il[78]) + , binary_mem_tag_ctr_inv(il[79]) + , binary_op_id(il[80]) + , binary_sel_bin(il[81]) + , binary_start(il[82]) + , cmp_a_hi(il[83]) + , cmp_a_lo(il[84]) + , cmp_b_hi(il[85]) + , cmp_b_lo(il[86]) + , cmp_borrow(il[87]) + , cmp_clk(il[88]) + , cmp_cmp_rng_ctr(il[89]) + , cmp_input_a(il[90]) + , cmp_input_b(il[91]) + , cmp_op_eq(il[92]) + , cmp_op_eq_diff_inv(il[93]) + , cmp_op_gt(il[94]) + , cmp_p_a_borrow(il[95]) + , cmp_p_b_borrow(il[96]) + , cmp_p_sub_a_hi(il[97]) + , cmp_p_sub_a_lo(il[98]) + , cmp_p_sub_b_hi(il[99]) + , cmp_p_sub_b_lo(il[100]) + , cmp_range_chk_clk(il[101]) + , cmp_res_hi(il[102]) + , cmp_res_lo(il[103]) + , cmp_result(il[104]) + , cmp_sel_cmp(il[105]) + , cmp_sel_rng_chk(il[106]) + , cmp_shift_sel(il[107]) + , conversion_clk(il[108]) + , conversion_input(il[109]) + , conversion_num_limbs(il[110]) + , conversion_output_bits(il[111]) + , conversion_radix(il[112]) + , conversion_sel_to_radix_le(il[113]) + , keccakf1600_clk(il[114]) + , keccakf1600_input(il[115]) + , keccakf1600_output(il[116]) + , keccakf1600_sel_keccakf1600(il[117]) + , main_abs_da_rem_gas(il[118]) + , main_abs_l2_rem_gas(il[119]) + , main_alu_in_tag(il[120]) + , main_base_da_gas_op_cost(il[121]) + , main_base_l2_gas_op_cost(il[122]) + , main_bin_op_id(il[123]) + , main_call_ptr(il[124]) + , main_da_gas_remaining(il[125]) + , main_da_out_of_gas(il[126]) + , main_dyn_da_gas_op_cost(il[127]) + , main_dyn_gas_multiplier(il[128]) + , main_dyn_l2_gas_op_cost(il[129]) + , main_emit_l2_to_l1_msg_write_offset(il[130]) + , main_emit_note_hash_write_offset(il[131]) + , main_emit_nullifier_write_offset(il[132]) + , main_emit_unencrypted_log_write_offset(il[133]) + , main_ia(il[134]) + , main_ib(il[135]) + , main_ic(il[136]) + , main_id(il[137]) + , main_id_zero(il[138]) + , main_ind_addr_a(il[139]) + , main_ind_addr_b(il[140]) + , main_ind_addr_c(il[141]) + , main_ind_addr_d(il[142]) + , main_internal_return_ptr(il[143]) + , main_inv(il[144]) + , main_is_fake_row(il[145]) + , main_is_gas_accounted(il[146]) + , main_kernel_in_offset(il[147]) + , main_kernel_out_offset(il[148]) + , main_l1_to_l2_msg_exists_write_offset(il[149]) + , main_l2_gas_remaining(il[150]) + , main_l2_out_of_gas(il[151]) + , main_mem_addr_a(il[152]) + , main_mem_addr_b(il[153]) + , main_mem_addr_c(il[154]) + , main_mem_addr_d(il[155]) + , main_note_hash_exist_write_offset(il[156]) + , main_nullifier_exists_write_offset(il[157]) + , main_nullifier_non_exists_write_offset(il[158]) + , main_op_err(il[159]) + , main_opcode_val(il[160]) + , main_pc(il[161]) + , main_r_in_tag(il[162]) + , main_rwa(il[163]) + , main_rwb(il[164]) + , main_rwc(il[165]) + , main_rwd(il[166]) + , main_sel_alu(il[167]) + , main_sel_bin(il[168]) + , main_sel_calldata(il[169]) + , main_sel_execution_row(il[170]) + , main_sel_kernel_inputs(il[171]) + , main_sel_kernel_out(il[172]) + , main_sel_last(il[173]) + , main_sel_mem_op_a(il[174]) + , main_sel_mem_op_b(il[175]) + , main_sel_mem_op_c(il[176]) + , main_sel_mem_op_d(il[177]) + , main_sel_mov_ia_to_ic(il[178]) + , main_sel_mov_ib_to_ic(il[179]) + , main_sel_op_add(il[180]) + , main_sel_op_address(il[181]) + , main_sel_op_and(il[182]) + , main_sel_op_block_number(il[183]) + , main_sel_op_calldata_copy(il[184]) + , main_sel_op_cast(il[185]) + , main_sel_op_chain_id(il[186]) + , main_sel_op_dagasleft(il[187]) + , main_sel_op_div(il[188]) + , main_sel_op_ecadd(il[189]) + , main_sel_op_emit_l2_to_l1_msg(il[190]) + , main_sel_op_emit_note_hash(il[191]) + , main_sel_op_emit_nullifier(il[192]) + , main_sel_op_emit_unencrypted_log(il[193]) + , main_sel_op_eq(il[194]) + , main_sel_op_external_call(il[195]) + , main_sel_op_external_return(il[196]) + , main_sel_op_external_revert(il[197]) + , main_sel_op_fdiv(il[198]) + , main_sel_op_fee_per_da_gas(il[199]) + , main_sel_op_fee_per_l2_gas(il[200]) + , main_sel_op_function_selector(il[201]) + , main_sel_op_get_contract_instance(il[202]) + , main_sel_op_internal_call(il[203]) + , main_sel_op_internal_return(il[204]) + , main_sel_op_is_static_call(il[205]) + , main_sel_op_jump(il[206]) + , main_sel_op_jumpi(il[207]) + , main_sel_op_keccak(il[208]) + , main_sel_op_l1_to_l2_msg_exists(il[209]) + , main_sel_op_l2gasleft(il[210]) + , main_sel_op_lt(il[211]) + , main_sel_op_lte(il[212]) + , main_sel_op_mov(il[213]) + , main_sel_op_msm(il[214]) + , main_sel_op_mul(il[215]) + , main_sel_op_not(il[216]) + , main_sel_op_note_hash_exists(il[217]) + , main_sel_op_nullifier_exists(il[218]) + , main_sel_op_or(il[219]) + , main_sel_op_pedersen(il[220]) + , main_sel_op_pedersen_commit(il[221]) + , main_sel_op_poseidon2(il[222]) + , main_sel_op_radix_le(il[223]) + , main_sel_op_sender(il[224]) + , main_sel_op_set(il[225]) + , main_sel_op_sha256(il[226]) + , main_sel_op_shl(il[227]) + , main_sel_op_shr(il[228]) + , main_sel_op_sload(il[229]) + , main_sel_op_sstore(il[230]) + , main_sel_op_static_call(il[231]) + , main_sel_op_storage_address(il[232]) + , main_sel_op_sub(il[233]) + , main_sel_op_timestamp(il[234]) + , main_sel_op_transaction_fee(il[235]) + , main_sel_op_version(il[236]) + , main_sel_op_xor(il[237]) + , main_sel_q_kernel_lookup(il[238]) + , main_sel_q_kernel_output_lookup(il[239]) + , main_sel_resolve_ind_addr_a(il[240]) + , main_sel_resolve_ind_addr_b(il[241]) + , main_sel_resolve_ind_addr_c(il[242]) + , main_sel_resolve_ind_addr_d(il[243]) + , main_sel_returndata(il[244]) + , main_sel_rng_16(il[245]) + , main_sel_rng_8(il[246]) + , main_sel_slice_gadget(il[247]) + , main_side_effect_counter(il[248]) + , main_sload_write_offset(il[249]) + , main_space_id(il[250]) + , main_sstore_write_offset(il[251]) + , main_tag_err(il[252]) + , main_w_in_tag(il[253]) + , mem_addr(il[254]) + , mem_clk(il[255]) + , mem_diff(il[256]) + , mem_glob_addr(il[257]) + , mem_last(il[258]) + , mem_lastAccess(il[259]) + , mem_one_min_inv(il[260]) + , mem_r_in_tag(il[261]) + , mem_rw(il[262]) + , mem_sel_mem(il[263]) + , mem_sel_mov_ia_to_ic(il[264]) + , mem_sel_mov_ib_to_ic(il[265]) + , mem_sel_op_a(il[266]) + , mem_sel_op_b(il[267]) + , mem_sel_op_c(il[268]) + , mem_sel_op_d(il[269]) + , mem_sel_op_poseidon_read_a(il[270]) + , mem_sel_op_poseidon_read_b(il[271]) + , mem_sel_op_poseidon_read_c(il[272]) + , mem_sel_op_poseidon_read_d(il[273]) + , mem_sel_op_poseidon_write_a(il[274]) + , mem_sel_op_poseidon_write_b(il[275]) + , mem_sel_op_poseidon_write_c(il[276]) + , mem_sel_op_poseidon_write_d(il[277]) + , mem_sel_op_slice(il[278]) + , mem_sel_resolve_ind_addr_a(il[279]) + , mem_sel_resolve_ind_addr_b(il[280]) + , mem_sel_resolve_ind_addr_c(il[281]) + , mem_sel_resolve_ind_addr_d(il[282]) + , mem_sel_rng_chk(il[283]) + , mem_skip_check_tag(il[284]) + , mem_space_id(il[285]) + , mem_tag(il[286]) + , mem_tag_err(il[287]) + , mem_tsp(il[288]) + , mem_val(il[289]) + , mem_w_in_tag(il[290]) + , pedersen_clk(il[291]) + , pedersen_input(il[292]) + , pedersen_output(il[293]) + , pedersen_sel_pedersen(il[294]) + , poseidon2_B_10_0(il[295]) + , poseidon2_B_10_1(il[296]) + , poseidon2_B_10_2(il[297]) + , poseidon2_B_10_3(il[298]) + , poseidon2_B_11_0(il[299]) + , poseidon2_B_11_1(il[300]) + , poseidon2_B_11_2(il[301]) + , poseidon2_B_11_3(il[302]) + , poseidon2_B_12_0(il[303]) + , poseidon2_B_12_1(il[304]) + , poseidon2_B_12_2(il[305]) + , poseidon2_B_12_3(il[306]) + , poseidon2_B_13_0(il[307]) + , poseidon2_B_13_1(il[308]) + , poseidon2_B_13_2(il[309]) + , poseidon2_B_13_3(il[310]) + , poseidon2_B_14_0(il[311]) + , poseidon2_B_14_1(il[312]) + , poseidon2_B_14_2(il[313]) + , poseidon2_B_14_3(il[314]) + , poseidon2_B_15_0(il[315]) + , poseidon2_B_15_1(il[316]) + , poseidon2_B_15_2(il[317]) + , poseidon2_B_15_3(il[318]) + , poseidon2_B_16_0(il[319]) + , poseidon2_B_16_1(il[320]) + , poseidon2_B_16_2(il[321]) + , poseidon2_B_16_3(il[322]) + , poseidon2_B_17_0(il[323]) + , poseidon2_B_17_1(il[324]) + , poseidon2_B_17_2(il[325]) + , poseidon2_B_17_3(il[326]) + , poseidon2_B_18_0(il[327]) + , poseidon2_B_18_1(il[328]) + , poseidon2_B_18_2(il[329]) + , poseidon2_B_18_3(il[330]) + , poseidon2_B_19_0(il[331]) + , poseidon2_B_19_1(il[332]) + , poseidon2_B_19_2(il[333]) + , poseidon2_B_19_3(il[334]) + , poseidon2_B_20_0(il[335]) + , poseidon2_B_20_1(il[336]) + , poseidon2_B_20_2(il[337]) + , poseidon2_B_20_3(il[338]) + , poseidon2_B_21_0(il[339]) + , poseidon2_B_21_1(il[340]) + , poseidon2_B_21_2(il[341]) + , poseidon2_B_21_3(il[342]) + , poseidon2_B_22_0(il[343]) + , poseidon2_B_22_1(il[344]) + , poseidon2_B_22_2(il[345]) + , poseidon2_B_22_3(il[346]) + , poseidon2_B_23_0(il[347]) + , poseidon2_B_23_1(il[348]) + , poseidon2_B_23_2(il[349]) + , poseidon2_B_23_3(il[350]) + , poseidon2_B_24_0(il[351]) + , poseidon2_B_24_1(il[352]) + , poseidon2_B_24_2(il[353]) + , poseidon2_B_24_3(il[354]) + , poseidon2_B_25_0(il[355]) + , poseidon2_B_25_1(il[356]) + , poseidon2_B_25_2(il[357]) + , poseidon2_B_25_3(il[358]) + , poseidon2_B_26_0(il[359]) + , poseidon2_B_26_1(il[360]) + , poseidon2_B_26_2(il[361]) + , poseidon2_B_26_3(il[362]) + , poseidon2_B_27_0(il[363]) + , poseidon2_B_27_1(il[364]) + , poseidon2_B_27_2(il[365]) + , poseidon2_B_27_3(il[366]) + , poseidon2_B_28_0(il[367]) + , poseidon2_B_28_1(il[368]) + , poseidon2_B_28_2(il[369]) + , poseidon2_B_28_3(il[370]) + , poseidon2_B_29_0(il[371]) + , poseidon2_B_29_1(il[372]) + , poseidon2_B_29_2(il[373]) + , poseidon2_B_29_3(il[374]) + , poseidon2_B_30_0(il[375]) + , poseidon2_B_30_1(il[376]) + , poseidon2_B_30_2(il[377]) + , poseidon2_B_30_3(il[378]) + , poseidon2_B_31_0(il[379]) + , poseidon2_B_31_1(il[380]) + , poseidon2_B_31_2(il[381]) + , poseidon2_B_31_3(il[382]) + , poseidon2_B_32_0(il[383]) + , poseidon2_B_32_1(il[384]) + , poseidon2_B_32_2(il[385]) + , poseidon2_B_32_3(il[386]) + , poseidon2_B_33_0(il[387]) + , poseidon2_B_33_1(il[388]) + , poseidon2_B_33_2(il[389]) + , poseidon2_B_33_3(il[390]) + , poseidon2_B_34_0(il[391]) + , poseidon2_B_34_1(il[392]) + , poseidon2_B_34_2(il[393]) + , poseidon2_B_34_3(il[394]) + , poseidon2_B_35_0(il[395]) + , poseidon2_B_35_1(il[396]) + , poseidon2_B_35_2(il[397]) + , poseidon2_B_35_3(il[398]) + , poseidon2_B_36_0(il[399]) + , poseidon2_B_36_1(il[400]) + , poseidon2_B_36_2(il[401]) + , poseidon2_B_36_3(il[402]) + , poseidon2_B_37_0(il[403]) + , poseidon2_B_37_1(il[404]) + , poseidon2_B_37_2(il[405]) + , poseidon2_B_37_3(il[406]) + , poseidon2_B_38_0(il[407]) + , poseidon2_B_38_1(il[408]) + , poseidon2_B_38_2(il[409]) + , poseidon2_B_38_3(il[410]) + , poseidon2_B_39_0(il[411]) + , poseidon2_B_39_1(il[412]) + , poseidon2_B_39_2(il[413]) + , poseidon2_B_39_3(il[414]) + , poseidon2_B_40_0(il[415]) + , poseidon2_B_40_1(il[416]) + , poseidon2_B_40_2(il[417]) + , poseidon2_B_40_3(il[418]) + , poseidon2_B_41_0(il[419]) + , poseidon2_B_41_1(il[420]) + , poseidon2_B_41_2(il[421]) + , poseidon2_B_41_3(il[422]) + , poseidon2_B_42_0(il[423]) + , poseidon2_B_42_1(il[424]) + , poseidon2_B_42_2(il[425]) + , poseidon2_B_42_3(il[426]) + , poseidon2_B_43_0(il[427]) + , poseidon2_B_43_1(il[428]) + , poseidon2_B_43_2(il[429]) + , poseidon2_B_43_3(il[430]) + , poseidon2_B_44_0(il[431]) + , poseidon2_B_44_1(il[432]) + , poseidon2_B_44_2(il[433]) + , poseidon2_B_44_3(il[434]) + , poseidon2_B_45_0(il[435]) + , poseidon2_B_45_1(il[436]) + , poseidon2_B_45_2(il[437]) + , poseidon2_B_45_3(il[438]) + , poseidon2_B_46_0(il[439]) + , poseidon2_B_46_1(il[440]) + , poseidon2_B_46_2(il[441]) + , poseidon2_B_46_3(il[442]) + , poseidon2_B_47_0(il[443]) + , poseidon2_B_47_1(il[444]) + , poseidon2_B_47_2(il[445]) + , poseidon2_B_47_3(il[446]) + , poseidon2_B_48_0(il[447]) + , poseidon2_B_48_1(il[448]) + , poseidon2_B_48_2(il[449]) + , poseidon2_B_48_3(il[450]) + , poseidon2_B_49_0(il[451]) + , poseidon2_B_49_1(il[452]) + , poseidon2_B_49_2(il[453]) + , poseidon2_B_49_3(il[454]) + , poseidon2_B_4_0(il[455]) + , poseidon2_B_4_1(il[456]) + , poseidon2_B_4_2(il[457]) + , poseidon2_B_4_3(il[458]) + , poseidon2_B_50_0(il[459]) + , poseidon2_B_50_1(il[460]) + , poseidon2_B_50_2(il[461]) + , poseidon2_B_50_3(il[462]) + , poseidon2_B_51_0(il[463]) + , poseidon2_B_51_1(il[464]) + , poseidon2_B_51_2(il[465]) + , poseidon2_B_51_3(il[466]) + , poseidon2_B_52_0(il[467]) + , poseidon2_B_52_1(il[468]) + , poseidon2_B_52_2(il[469]) + , poseidon2_B_52_3(il[470]) + , poseidon2_B_53_0(il[471]) + , poseidon2_B_53_1(il[472]) + , poseidon2_B_53_2(il[473]) + , poseidon2_B_53_3(il[474]) + , poseidon2_B_54_0(il[475]) + , poseidon2_B_54_1(il[476]) + , poseidon2_B_54_2(il[477]) + , poseidon2_B_54_3(il[478]) + , poseidon2_B_55_0(il[479]) + , poseidon2_B_55_1(il[480]) + , poseidon2_B_55_2(il[481]) + , poseidon2_B_55_3(il[482]) + , poseidon2_B_56_0(il[483]) + , poseidon2_B_56_1(il[484]) + , poseidon2_B_56_2(il[485]) + , poseidon2_B_56_3(il[486]) + , poseidon2_B_57_0(il[487]) + , poseidon2_B_57_1(il[488]) + , poseidon2_B_57_2(il[489]) + , poseidon2_B_57_3(il[490]) + , poseidon2_B_58_0(il[491]) + , poseidon2_B_58_1(il[492]) + , poseidon2_B_58_2(il[493]) + , poseidon2_B_58_3(il[494]) + , poseidon2_B_59_0(il[495]) + , poseidon2_B_59_1(il[496]) + , poseidon2_B_59_2(il[497]) + , poseidon2_B_59_3(il[498]) + , poseidon2_B_5_0(il[499]) + , poseidon2_B_5_1(il[500]) + , poseidon2_B_5_2(il[501]) + , poseidon2_B_5_3(il[502]) + , poseidon2_B_6_0(il[503]) + , poseidon2_B_6_1(il[504]) + , poseidon2_B_6_2(il[505]) + , poseidon2_B_6_3(il[506]) + , poseidon2_B_7_0(il[507]) + , poseidon2_B_7_1(il[508]) + , poseidon2_B_7_2(il[509]) + , poseidon2_B_7_3(il[510]) + , poseidon2_B_8_0(il[511]) + , poseidon2_B_8_1(il[512]) + , poseidon2_B_8_2(il[513]) + , poseidon2_B_8_3(il[514]) + , poseidon2_B_9_0(il[515]) + , poseidon2_B_9_1(il[516]) + , poseidon2_B_9_2(il[517]) + , poseidon2_B_9_3(il[518]) + , poseidon2_EXT_LAYER_4(il[519]) + , poseidon2_EXT_LAYER_5(il[520]) + , poseidon2_EXT_LAYER_6(il[521]) + , poseidon2_EXT_LAYER_7(il[522]) + , poseidon2_T_0_4(il[523]) + , poseidon2_T_0_5(il[524]) + , poseidon2_T_0_6(il[525]) + , poseidon2_T_0_7(il[526]) + , poseidon2_T_1_4(il[527]) + , poseidon2_T_1_5(il[528]) + , poseidon2_T_1_6(il[529]) + , poseidon2_T_1_7(il[530]) + , poseidon2_T_2_4(il[531]) + , poseidon2_T_2_5(il[532]) + , poseidon2_T_2_6(il[533]) + , poseidon2_T_2_7(il[534]) + , poseidon2_T_3_4(il[535]) + , poseidon2_T_3_5(il[536]) + , poseidon2_T_3_6(il[537]) + , poseidon2_T_3_7(il[538]) + , poseidon2_T_60_4(il[539]) + , poseidon2_T_60_5(il[540]) + , poseidon2_T_60_6(il[541]) + , poseidon2_T_60_7(il[542]) + , poseidon2_T_61_4(il[543]) + , poseidon2_T_61_5(il[544]) + , poseidon2_T_61_6(il[545]) + , poseidon2_T_61_7(il[546]) + , poseidon2_T_62_4(il[547]) + , poseidon2_T_62_5(il[548]) + , poseidon2_T_62_6(il[549]) + , poseidon2_T_62_7(il[550]) + , poseidon2_T_63_4(il[551]) + , poseidon2_T_63_5(il[552]) + , poseidon2_T_63_6(il[553]) + , poseidon2_T_63_7(il[554]) + , poseidon2_a_0(il[555]) + , poseidon2_a_1(il[556]) + , poseidon2_a_2(il[557]) + , poseidon2_a_3(il[558]) + , poseidon2_b_0(il[559]) + , poseidon2_b_1(il[560]) + , poseidon2_b_2(il[561]) + , poseidon2_b_3(il[562]) + , poseidon2_clk(il[563]) + , poseidon2_input_addr(il[564]) + , poseidon2_mem_addr_read_a(il[565]) + , poseidon2_mem_addr_read_b(il[566]) + , poseidon2_mem_addr_read_c(il[567]) + , poseidon2_mem_addr_read_d(il[568]) + , poseidon2_mem_addr_write_a(il[569]) + , poseidon2_mem_addr_write_b(il[570]) + , poseidon2_mem_addr_write_c(il[571]) + , poseidon2_mem_addr_write_d(il[572]) + , poseidon2_output_addr(il[573]) + , poseidon2_sel_poseidon_perm(il[574]) + , range_check_alu_rng_chk(il[575]) + , range_check_clk(il[576]) + , range_check_cmp_hi_bits_rng_chk(il[577]) + , range_check_cmp_lo_bits_rng_chk(il[578]) + , range_check_dyn_diff(il[579]) + , range_check_dyn_rng_chk_bits(il[580]) + , range_check_dyn_rng_chk_pow_2(il[581]) + , range_check_gas_da_rng_chk(il[582]) + , range_check_gas_l2_rng_chk(il[583]) + , range_check_is_lte_u112(il[584]) + , range_check_is_lte_u128(il[585]) + , range_check_is_lte_u16(il[586]) + , range_check_is_lte_u32(il[587]) + , range_check_is_lte_u48(il[588]) + , range_check_is_lte_u64(il[589]) + , range_check_is_lte_u80(il[590]) + , range_check_is_lte_u96(il[591]) + , range_check_mem_rng_chk(il[592]) + , range_check_rng_chk_bits(il[593]) + , range_check_sel_lookup_0(il[594]) + , range_check_sel_lookup_1(il[595]) + , range_check_sel_lookup_2(il[596]) + , range_check_sel_lookup_3(il[597]) + , range_check_sel_lookup_4(il[598]) + , range_check_sel_lookup_5(il[599]) + , range_check_sel_lookup_6(il[600]) + , range_check_sel_rng_chk(il[601]) + , range_check_u16_r0(il[602]) + , range_check_u16_r1(il[603]) + , range_check_u16_r2(il[604]) + , range_check_u16_r3(il[605]) + , range_check_u16_r4(il[606]) + , range_check_u16_r5(il[607]) + , range_check_u16_r6(il[608]) + , range_check_u16_r7(il[609]) + , range_check_value(il[610]) + , sha256_clk(il[611]) + , sha256_input(il[612]) + , sha256_output(il[613]) + , sha256_sel_sha256_compression(il[614]) + , sha256_state(il[615]) + , slice_addr(il[616]) + , slice_clk(il[617]) + , slice_cnt(il[618]) + , slice_col_offset(il[619]) + , slice_one_min_inv(il[620]) + , slice_sel_cd_cpy(il[621]) + , slice_sel_mem_active(il[622]) + , slice_sel_return(il[623]) + , slice_sel_start(il[624]) + , slice_space_id(il[625]) + , slice_val(il[626]) + , lookup_rng_chk_pow_2_counts(il[627]) + , lookup_rng_chk_diff_counts(il[628]) + , lookup_rng_chk_0_counts(il[629]) + , lookup_rng_chk_1_counts(il[630]) + , lookup_rng_chk_2_counts(il[631]) + , lookup_rng_chk_3_counts(il[632]) + , lookup_rng_chk_4_counts(il[633]) + , lookup_rng_chk_5_counts(il[634]) + , lookup_rng_chk_6_counts(il[635]) + , lookup_rng_chk_7_counts(il[636]) + , lookup_pow_2_0_counts(il[637]) + , lookup_pow_2_1_counts(il[638]) + , lookup_byte_lengths_counts(il[639]) + , lookup_byte_operations_counts(il[640]) + , lookup_opcode_gas_counts(il[641]) + , kernel_output_lookup_counts(il[642]) + , lookup_into_kernel_counts(il[643]) + , lookup_cd_value_counts(il[644]) + , lookup_ret_value_counts(il[645]) + , incl_main_tag_err_counts(il[646]) + , incl_mem_tag_err_counts(il[647]) + , perm_rng_mem_inv(il[648]) + , perm_rng_cmp_lo_inv(il[649]) + , perm_rng_cmp_hi_inv(il[650]) + , perm_rng_alu_inv(il[651]) + , perm_cmp_alu_inv(il[652]) + , perm_rng_gas_l2_inv(il[653]) + , perm_rng_gas_da_inv(il[654]) + , perm_pos_mem_read_a_inv(il[655]) + , perm_pos_mem_read_b_inv(il[656]) + , perm_pos_mem_read_c_inv(il[657]) + , perm_pos_mem_read_d_inv(il[658]) + , perm_pos_mem_write_a_inv(il[659]) + , perm_pos_mem_write_b_inv(il[660]) + , perm_pos_mem_write_c_inv(il[661]) + , perm_pos_mem_write_d_inv(il[662]) + , perm_slice_mem_inv(il[663]) + , perm_main_alu_inv(il[664]) + , perm_main_bin_inv(il[665]) + , perm_main_conv_inv(il[666]) + , perm_main_pos2_perm_inv(il[667]) + , perm_main_pedersen_inv(il[668]) + , perm_main_slice_inv(il[669]) + , perm_main_mem_a_inv(il[670]) + , perm_main_mem_b_inv(il[671]) + , perm_main_mem_c_inv(il[672]) + , perm_main_mem_d_inv(il[673]) + , perm_main_mem_ind_addr_a_inv(il[674]) + , perm_main_mem_ind_addr_b_inv(il[675]) + , perm_main_mem_ind_addr_c_inv(il[676]) + , perm_main_mem_ind_addr_d_inv(il[677]) + , lookup_rng_chk_pow_2_inv(il[678]) + , lookup_rng_chk_diff_inv(il[679]) + , lookup_rng_chk_0_inv(il[680]) + , lookup_rng_chk_1_inv(il[681]) + , lookup_rng_chk_2_inv(il[682]) + , lookup_rng_chk_3_inv(il[683]) + , lookup_rng_chk_4_inv(il[684]) + , lookup_rng_chk_5_inv(il[685]) + , lookup_rng_chk_6_inv(il[686]) + , lookup_rng_chk_7_inv(il[687]) + , lookup_pow_2_0_inv(il[688]) + , lookup_pow_2_1_inv(il[689]) + , lookup_byte_lengths_inv(il[690]) + , lookup_byte_operations_inv(il[691]) + , lookup_opcode_gas_inv(il[692]) + , kernel_output_lookup_inv(il[693]) + , lookup_into_kernel_inv(il[694]) + , lookup_cd_value_inv(il[695]) + , lookup_ret_value_inv(il[696]) + , incl_main_tag_err_inv(il[697]) + , incl_mem_tag_err_inv(il[698]) + , binary_acc_ia_shift(il[699]) + , binary_acc_ib_shift(il[700]) + , binary_acc_ic_shift(il[701]) + , binary_mem_tag_ctr_shift(il[702]) + , binary_op_id_shift(il[703]) + , cmp_a_hi_shift(il[704]) + , cmp_a_lo_shift(il[705]) + , cmp_b_hi_shift(il[706]) + , cmp_b_lo_shift(il[707]) + , cmp_cmp_rng_ctr_shift(il[708]) + , cmp_op_gt_shift(il[709]) + , cmp_p_sub_a_hi_shift(il[710]) + , cmp_p_sub_a_lo_shift(il[711]) + , cmp_p_sub_b_hi_shift(il[712]) + , cmp_p_sub_b_lo_shift(il[713]) + , cmp_sel_rng_chk_shift(il[714]) + , main_da_gas_remaining_shift(il[715]) + , main_emit_l2_to_l1_msg_write_offset_shift(il[716]) + , main_emit_note_hash_write_offset_shift(il[717]) + , main_emit_nullifier_write_offset_shift(il[718]) + , main_emit_unencrypted_log_write_offset_shift(il[719]) + , main_internal_return_ptr_shift(il[720]) + , main_l1_to_l2_msg_exists_write_offset_shift(il[721]) + , main_l2_gas_remaining_shift(il[722]) + , main_note_hash_exist_write_offset_shift(il[723]) + , main_nullifier_exists_write_offset_shift(il[724]) + , main_nullifier_non_exists_write_offset_shift(il[725]) + , main_pc_shift(il[726]) + , main_sel_execution_row_shift(il[727]) + , main_sload_write_offset_shift(il[728]) + , main_sstore_write_offset_shift(il[729]) + , mem_glob_addr_shift(il[730]) + , mem_rw_shift(il[731]) + , mem_sel_mem_shift(il[732]) + , mem_tag_shift(il[733]) + , mem_tsp_shift(il[734]) + , mem_val_shift(il[735]) + , slice_addr_shift(il[736]) + , slice_clk_shift(il[737]) + , slice_cnt_shift(il[738]) + , slice_col_offset_shift(il[739]) + , slice_sel_cd_cpy_shift(il[740]) + , slice_sel_mem_active_shift(il[741]) + , slice_sel_return_shift(il[742]) + , slice_sel_start_shift(il[743]) + , slice_space_id_shift(il[744]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) @@ -789,12 +779,7 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id gas_dyn_l2_gas_fixed_table[row_idx], gas_sel_gas_cost[row_idx], main_clk[row_idx], - main_sel_da_end_gas_kernel_input[row_idx], - main_sel_da_start_gas_kernel_input[row_idx], main_sel_first[row_idx], - main_sel_l2_end_gas_kernel_input[row_idx], - main_sel_l2_start_gas_kernel_input[row_idx], - main_sel_start_exec[row_idx], main_zeroes[row_idx], powers_power_of_2[row_idx], main_kernel_inputs[row_idx], @@ -951,10 +936,10 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id main_sel_alu[row_idx], main_sel_bin[row_idx], main_sel_calldata[row_idx], - main_sel_execution_end[row_idx], main_sel_execution_row[row_idx], main_sel_kernel_inputs[row_idx], main_sel_kernel_out[row_idx], + main_sel_last[row_idx], main_sel_mem_op_a[row_idx], main_sel_mem_op_b[row_idx], main_sel_mem_op_c[row_idx], @@ -1436,10 +1421,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id perm_cmp_alu_inv[row_idx], perm_rng_gas_l2_inv[row_idx], perm_rng_gas_da_inv[row_idx], - perm_l2_start_gas_inv[row_idx], - perm_da_start_gas_inv[row_idx], - perm_l2_end_gas_inv[row_idx], - perm_da_end_gas_inv[row_idx], perm_pos_mem_read_a_inv[row_idx], perm_pos_mem_read_b_inv[row_idx], perm_pos_mem_read_c_inv[row_idx], @@ -1512,7 +1493,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id main_nullifier_exists_write_offset_shift[row_idx], main_nullifier_non_exists_write_offset_shift[row_idx], main_pc_shift[row_idx], - main_sel_execution_end_shift[row_idx], main_sel_execution_row_shift[row_idx], main_sload_write_offset_shift[row_idx], main_sstore_write_offset_shift[row_idx], @@ -1548,12 +1528,7 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::gas_dyn_l2_gas_fixed_table = "GAS_DYN_L2_GAS_FIXED_TABLE"; Base::gas_sel_gas_cost = "GAS_SEL_GAS_COST"; Base::main_clk = "MAIN_CLK"; - Base::main_sel_da_end_gas_kernel_input = "MAIN_SEL_DA_END_GAS_KERNEL_INPUT"; - Base::main_sel_da_start_gas_kernel_input = "MAIN_SEL_DA_START_GAS_KERNEL_INPUT"; Base::main_sel_first = "MAIN_SEL_FIRST"; - Base::main_sel_l2_end_gas_kernel_input = "MAIN_SEL_L2_END_GAS_KERNEL_INPUT"; - Base::main_sel_l2_start_gas_kernel_input = "MAIN_SEL_L2_START_GAS_KERNEL_INPUT"; - Base::main_sel_start_exec = "MAIN_SEL_START_EXEC"; Base::main_zeroes = "MAIN_ZEROES"; Base::powers_power_of_2 = "POWERS_POWER_OF_2"; Base::main_kernel_inputs = "MAIN_KERNEL_INPUTS"; @@ -1710,10 +1685,10 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::main_sel_alu = "MAIN_SEL_ALU"; Base::main_sel_bin = "MAIN_SEL_BIN"; Base::main_sel_calldata = "MAIN_SEL_CALLDATA"; - Base::main_sel_execution_end = "MAIN_SEL_EXECUTION_END"; Base::main_sel_execution_row = "MAIN_SEL_EXECUTION_ROW"; Base::main_sel_kernel_inputs = "MAIN_SEL_KERNEL_INPUTS"; Base::main_sel_kernel_out = "MAIN_SEL_KERNEL_OUT"; + Base::main_sel_last = "MAIN_SEL_LAST"; Base::main_sel_mem_op_a = "MAIN_SEL_MEM_OP_A"; Base::main_sel_mem_op_b = "MAIN_SEL_MEM_OP_B"; Base::main_sel_mem_op_c = "MAIN_SEL_MEM_OP_C"; @@ -2174,10 +2149,6 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::perm_cmp_alu_inv = "PERM_CMP_ALU_INV"; Base::perm_rng_gas_l2_inv = "PERM_RNG_GAS_L2_INV"; Base::perm_rng_gas_da_inv = "PERM_RNG_GAS_DA_INV"; - Base::perm_l2_start_gas_inv = "PERM_L2_START_GAS_INV"; - Base::perm_da_start_gas_inv = "PERM_DA_START_GAS_INV"; - Base::perm_l2_end_gas_inv = "PERM_L2_END_GAS_INV"; - Base::perm_da_end_gas_inv = "PERM_DA_END_GAS_INV"; Base::perm_pos_mem_read_a_inv = "PERM_POS_MEM_READ_A_INV"; Base::perm_pos_mem_read_b_inv = "PERM_POS_MEM_READ_B_INV"; Base::perm_pos_mem_read_c_inv = "PERM_POS_MEM_READ_C_INV"; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index 5805df2cf50..ed5e72bc482 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -54,10 +54,6 @@ #include "barretenberg/vm/avm/generated/relations/lookup_rng_chk_diff.hpp" #include "barretenberg/vm/avm/generated/relations/lookup_rng_chk_pow_2.hpp" #include "barretenberg/vm/avm/generated/relations/perm_cmp_alu.hpp" -#include "barretenberg/vm/avm/generated/relations/perm_da_end_gas.hpp" -#include "barretenberg/vm/avm/generated/relations/perm_da_start_gas.hpp" -#include "barretenberg/vm/avm/generated/relations/perm_l2_end_gas.hpp" -#include "barretenberg/vm/avm/generated/relations/perm_l2_start_gas.hpp" #include "barretenberg/vm/avm/generated/relations/perm_main_alu.hpp" #include "barretenberg/vm/avm/generated/relations/perm_main_bin.hpp" #include "barretenberg/vm/avm/generated/relations/perm_main_conv.hpp" @@ -93,11 +89,11 @@ template using tuple_cat_t = decltype(std::tuple_cat(std:: // The entities that will be used in the flavor. // clang-format off -#define PRECOMPUTED_ENTITIES byte_lookup_sel_bin, byte_lookup_table_byte_lengths, byte_lookup_table_in_tags, byte_lookup_table_input_a, byte_lookup_table_input_b, byte_lookup_table_op_id, byte_lookup_table_output, gas_base_da_gas_fixed_table, gas_base_l2_gas_fixed_table, gas_dyn_da_gas_fixed_table, gas_dyn_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, main_sel_da_end_gas_kernel_input, main_sel_da_start_gas_kernel_input, main_sel_first, main_sel_l2_end_gas_kernel_input, main_sel_l2_start_gas_kernel_input, main_sel_start_exec, main_zeroes, powers_power_of_2 -#define WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_result, alu_cmp_gadget_sel, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_max_bits_sub_b_bits, alu_max_bits_sub_b_pow, alu_op_add, alu_op_cast, alu_op_div, alu_op_eq, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_partial_prod_hi, alu_partial_prod_lo, alu_range_check_input_value, alu_range_check_num_bits, alu_range_check_sel, alu_remainder, alu_sel_alu, alu_sel_cmp, alu_sel_shift_which, alu_u128_tag, alu_u16_tag, alu_u1_tag, alu_u32_tag, alu_u64_tag, alu_u8_tag, alu_zero_shift, binary_acc_ia, binary_acc_ib, binary_acc_ic, binary_clk, binary_ia_bytes, binary_ib_bytes, binary_ic_bytes, binary_in_tag, binary_mem_tag_ctr, binary_mem_tag_ctr_inv, binary_op_id, binary_sel_bin, binary_start, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_p_a_borrow, cmp_p_b_borrow, cmp_p_sub_a_hi, cmp_p_sub_a_lo, cmp_p_sub_b_hi, cmp_p_sub_b_lo, cmp_range_chk_clk, cmp_res_hi, cmp_res_lo, cmp_result, cmp_sel_cmp, cmp_sel_rng_chk, cmp_shift_sel, conversion_clk, conversion_input, conversion_num_limbs, conversion_output_bits, conversion_radix, conversion_sel_to_radix_le, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, main_abs_da_rem_gas, main_abs_l2_rem_gas, main_alu_in_tag, main_base_da_gas_op_cost, main_base_l2_gas_op_cost, main_bin_op_id, main_call_ptr, main_da_gas_remaining, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_emit_l2_to_l1_msg_write_offset, main_emit_note_hash_write_offset, main_emit_nullifier_write_offset, main_emit_unencrypted_log_write_offset, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_kernel_in_offset, main_kernel_out_offset, main_l1_to_l2_msg_exists_write_offset, main_l2_gas_remaining, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_note_hash_exist_write_offset, main_nullifier_exists_write_offset, main_nullifier_non_exists_write_offset, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_end, main_sel_execution_row, main_sel_kernel_inputs, main_sel_kernel_out, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_div, main_sel_op_ecadd, main_sel_op_emit_l2_to_l1_msg, main_sel_op_emit_note_hash, main_sel_op_emit_nullifier, main_sel_op_emit_unencrypted_log, main_sel_op_eq, main_sel_op_external_call, main_sel_op_external_return, main_sel_op_external_revert, main_sel_op_fdiv, main_sel_op_fee_per_da_gas, main_sel_op_fee_per_l2_gas, main_sel_op_function_selector, main_sel_op_get_contract_instance, main_sel_op_internal_call, main_sel_op_internal_return, main_sel_op_is_static_call, main_sel_op_jump, main_sel_op_jumpi, main_sel_op_keccak, main_sel_op_l1_to_l2_msg_exists, main_sel_op_l2gasleft, main_sel_op_lt, main_sel_op_lte, main_sel_op_mov, main_sel_op_msm, main_sel_op_mul, main_sel_op_not, main_sel_op_note_hash_exists, main_sel_op_nullifier_exists, main_sel_op_or, main_sel_op_pedersen, main_sel_op_pedersen_commit, main_sel_op_poseidon2, main_sel_op_radix_le, main_sel_op_sender, main_sel_op_set, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, main_sel_op_static_call, main_sel_op_storage_address, main_sel_op_sub, main_sel_op_timestamp, main_sel_op_transaction_fee, main_sel_op_version, main_sel_op_xor, main_sel_q_kernel_lookup, main_sel_q_kernel_output_lookup, main_sel_resolve_ind_addr_a, main_sel_resolve_ind_addr_b, main_sel_resolve_ind_addr_c, main_sel_resolve_ind_addr_d, main_sel_returndata, main_sel_rng_16, main_sel_rng_8, main_sel_slice_gadget, main_side_effect_counter, main_sload_write_offset, main_space_id, main_sstore_write_offset, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_val, mem_w_in_tag, pedersen_clk, pedersen_input, pedersen_output, pedersen_sel_pedersen, poseidon2_B_10_0, poseidon2_B_10_1, poseidon2_B_10_2, poseidon2_B_10_3, poseidon2_B_11_0, poseidon2_B_11_1, poseidon2_B_11_2, poseidon2_B_11_3, poseidon2_B_12_0, poseidon2_B_12_1, poseidon2_B_12_2, poseidon2_B_12_3, poseidon2_B_13_0, poseidon2_B_13_1, poseidon2_B_13_2, poseidon2_B_13_3, poseidon2_B_14_0, poseidon2_B_14_1, poseidon2_B_14_2, poseidon2_B_14_3, poseidon2_B_15_0, poseidon2_B_15_1, poseidon2_B_15_2, poseidon2_B_15_3, poseidon2_B_16_0, poseidon2_B_16_1, poseidon2_B_16_2, poseidon2_B_16_3, poseidon2_B_17_0, poseidon2_B_17_1, poseidon2_B_17_2, poseidon2_B_17_3, poseidon2_B_18_0, poseidon2_B_18_1, poseidon2_B_18_2, poseidon2_B_18_3, poseidon2_B_19_0, poseidon2_B_19_1, poseidon2_B_19_2, poseidon2_B_19_3, poseidon2_B_20_0, poseidon2_B_20_1, poseidon2_B_20_2, poseidon2_B_20_3, poseidon2_B_21_0, poseidon2_B_21_1, poseidon2_B_21_2, poseidon2_B_21_3, poseidon2_B_22_0, poseidon2_B_22_1, poseidon2_B_22_2, poseidon2_B_22_3, poseidon2_B_23_0, poseidon2_B_23_1, poseidon2_B_23_2, poseidon2_B_23_3, poseidon2_B_24_0, poseidon2_B_24_1, poseidon2_B_24_2, poseidon2_B_24_3, poseidon2_B_25_0, poseidon2_B_25_1, poseidon2_B_25_2, poseidon2_B_25_3, poseidon2_B_26_0, poseidon2_B_26_1, poseidon2_B_26_2, poseidon2_B_26_3, poseidon2_B_27_0, poseidon2_B_27_1, poseidon2_B_27_2, poseidon2_B_27_3, poseidon2_B_28_0, poseidon2_B_28_1, poseidon2_B_28_2, poseidon2_B_28_3, poseidon2_B_29_0, poseidon2_B_29_1, poseidon2_B_29_2, poseidon2_B_29_3, poseidon2_B_30_0, poseidon2_B_30_1, poseidon2_B_30_2, poseidon2_B_30_3, poseidon2_B_31_0, poseidon2_B_31_1, poseidon2_B_31_2, poseidon2_B_31_3, poseidon2_B_32_0, poseidon2_B_32_1, poseidon2_B_32_2, poseidon2_B_32_3, poseidon2_B_33_0, poseidon2_B_33_1, poseidon2_B_33_2, poseidon2_B_33_3, poseidon2_B_34_0, poseidon2_B_34_1, poseidon2_B_34_2, poseidon2_B_34_3, poseidon2_B_35_0, poseidon2_B_35_1, poseidon2_B_35_2, poseidon2_B_35_3, poseidon2_B_36_0, poseidon2_B_36_1, poseidon2_B_36_2, poseidon2_B_36_3, poseidon2_B_37_0, poseidon2_B_37_1, poseidon2_B_37_2, poseidon2_B_37_3, poseidon2_B_38_0, poseidon2_B_38_1, poseidon2_B_38_2, poseidon2_B_38_3, poseidon2_B_39_0, poseidon2_B_39_1, poseidon2_B_39_2, poseidon2_B_39_3, poseidon2_B_40_0, poseidon2_B_40_1, poseidon2_B_40_2, poseidon2_B_40_3, poseidon2_B_41_0, poseidon2_B_41_1, poseidon2_B_41_2, poseidon2_B_41_3, poseidon2_B_42_0, poseidon2_B_42_1, poseidon2_B_42_2, poseidon2_B_42_3, poseidon2_B_43_0, poseidon2_B_43_1, poseidon2_B_43_2, poseidon2_B_43_3, poseidon2_B_44_0, poseidon2_B_44_1, poseidon2_B_44_2, poseidon2_B_44_3, poseidon2_B_45_0, poseidon2_B_45_1, poseidon2_B_45_2, poseidon2_B_45_3, poseidon2_B_46_0, poseidon2_B_46_1, poseidon2_B_46_2, poseidon2_B_46_3, poseidon2_B_47_0, poseidon2_B_47_1, poseidon2_B_47_2, poseidon2_B_47_3, poseidon2_B_48_0, poseidon2_B_48_1, poseidon2_B_48_2, poseidon2_B_48_3, poseidon2_B_49_0, poseidon2_B_49_1, poseidon2_B_49_2, poseidon2_B_49_3, poseidon2_B_4_0, poseidon2_B_4_1, poseidon2_B_4_2, poseidon2_B_4_3, poseidon2_B_50_0, poseidon2_B_50_1, poseidon2_B_50_2, poseidon2_B_50_3, poseidon2_B_51_0, poseidon2_B_51_1, poseidon2_B_51_2, poseidon2_B_51_3, poseidon2_B_52_0, poseidon2_B_52_1, poseidon2_B_52_2, poseidon2_B_52_3, poseidon2_B_53_0, poseidon2_B_53_1, poseidon2_B_53_2, poseidon2_B_53_3, poseidon2_B_54_0, poseidon2_B_54_1, poseidon2_B_54_2, poseidon2_B_54_3, poseidon2_B_55_0, poseidon2_B_55_1, poseidon2_B_55_2, poseidon2_B_55_3, poseidon2_B_56_0, poseidon2_B_56_1, poseidon2_B_56_2, poseidon2_B_56_3, poseidon2_B_57_0, poseidon2_B_57_1, poseidon2_B_57_2, poseidon2_B_57_3, poseidon2_B_58_0, poseidon2_B_58_1, poseidon2_B_58_2, poseidon2_B_58_3, poseidon2_B_59_0, poseidon2_B_59_1, poseidon2_B_59_2, poseidon2_B_59_3, poseidon2_B_5_0, poseidon2_B_5_1, poseidon2_B_5_2, poseidon2_B_5_3, poseidon2_B_6_0, poseidon2_B_6_1, poseidon2_B_6_2, poseidon2_B_6_3, poseidon2_B_7_0, poseidon2_B_7_1, poseidon2_B_7_2, poseidon2_B_7_3, poseidon2_B_8_0, poseidon2_B_8_1, poseidon2_B_8_2, poseidon2_B_8_3, poseidon2_B_9_0, poseidon2_B_9_1, poseidon2_B_9_2, poseidon2_B_9_3, poseidon2_EXT_LAYER_4, poseidon2_EXT_LAYER_5, poseidon2_EXT_LAYER_6, poseidon2_EXT_LAYER_7, poseidon2_T_0_4, poseidon2_T_0_5, poseidon2_T_0_6, poseidon2_T_0_7, poseidon2_T_1_4, poseidon2_T_1_5, poseidon2_T_1_6, poseidon2_T_1_7, poseidon2_T_2_4, poseidon2_T_2_5, poseidon2_T_2_6, poseidon2_T_2_7, poseidon2_T_3_4, poseidon2_T_3_5, poseidon2_T_3_6, poseidon2_T_3_7, poseidon2_T_60_4, poseidon2_T_60_5, poseidon2_T_60_6, poseidon2_T_60_7, poseidon2_T_61_4, poseidon2_T_61_5, poseidon2_T_61_6, poseidon2_T_61_7, poseidon2_T_62_4, poseidon2_T_62_5, poseidon2_T_62_6, poseidon2_T_62_7, poseidon2_T_63_4, poseidon2_T_63_5, poseidon2_T_63_6, poseidon2_T_63_7, poseidon2_a_0, poseidon2_a_1, poseidon2_a_2, poseidon2_a_3, poseidon2_b_0, poseidon2_b_1, poseidon2_b_2, poseidon2_b_3, poseidon2_clk, poseidon2_input_addr, poseidon2_mem_addr_read_a, poseidon2_mem_addr_read_b, poseidon2_mem_addr_read_c, poseidon2_mem_addr_read_d, poseidon2_mem_addr_write_a, poseidon2_mem_addr_write_b, poseidon2_mem_addr_write_c, poseidon2_mem_addr_write_d, poseidon2_output_addr, poseidon2_sel_poseidon_perm, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_dyn_diff, range_check_dyn_rng_chk_bits, range_check_dyn_rng_chk_pow_2, range_check_gas_da_rng_chk, range_check_gas_l2_rng_chk, range_check_is_lte_u112, range_check_is_lte_u128, range_check_is_lte_u16, range_check_is_lte_u32, range_check_is_lte_u48, range_check_is_lte_u64, range_check_is_lte_u80, range_check_is_lte_u96, range_check_mem_rng_chk, range_check_rng_chk_bits, range_check_sel_lookup_0, range_check_sel_lookup_1, range_check_sel_lookup_2, range_check_sel_lookup_3, range_check_sel_lookup_4, range_check_sel_lookup_5, range_check_sel_lookup_6, range_check_sel_rng_chk, range_check_u16_r0, range_check_u16_r1, range_check_u16_r2, range_check_u16_r3, range_check_u16_r4, range_check_u16_r5, range_check_u16_r6, range_check_u16_r7, range_check_value, sha256_clk, sha256_input, sha256_output, sha256_sel_sha256_compression, sha256_state, slice_addr, slice_clk, slice_cnt, slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, slice_sel_start, slice_space_id, slice_val, lookup_rng_chk_pow_2_counts, lookup_rng_chk_diff_counts, lookup_rng_chk_0_counts, lookup_rng_chk_1_counts, lookup_rng_chk_2_counts, lookup_rng_chk_3_counts, lookup_rng_chk_4_counts, lookup_rng_chk_5_counts, lookup_rng_chk_6_counts, lookup_rng_chk_7_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, kernel_output_lookup_counts, lookup_into_kernel_counts, lookup_cd_value_counts, lookup_ret_value_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts -#define DERIVED_WITNESS_ENTITIES perm_rng_mem_inv, perm_rng_cmp_lo_inv, perm_rng_cmp_hi_inv, perm_rng_alu_inv, perm_cmp_alu_inv, perm_rng_gas_l2_inv, perm_rng_gas_da_inv, perm_l2_start_gas_inv, perm_da_start_gas_inv, perm_l2_end_gas_inv, perm_da_end_gas_inv, perm_pos_mem_read_a_inv, perm_pos_mem_read_b_inv, perm_pos_mem_read_c_inv, perm_pos_mem_read_d_inv, perm_pos_mem_write_a_inv, perm_pos_mem_write_b_inv, perm_pos_mem_write_c_inv, perm_pos_mem_write_d_inv, perm_slice_mem_inv, perm_main_alu_inv, perm_main_bin_inv, perm_main_conv_inv, perm_main_pos2_perm_inv, perm_main_pedersen_inv, perm_main_slice_inv, perm_main_mem_a_inv, perm_main_mem_b_inv, perm_main_mem_c_inv, perm_main_mem_d_inv, perm_main_mem_ind_addr_a_inv, perm_main_mem_ind_addr_b_inv, perm_main_mem_ind_addr_c_inv, perm_main_mem_ind_addr_d_inv, lookup_rng_chk_pow_2_inv, lookup_rng_chk_diff_inv, lookup_rng_chk_0_inv, lookup_rng_chk_1_inv, lookup_rng_chk_2_inv, lookup_rng_chk_3_inv, lookup_rng_chk_4_inv, lookup_rng_chk_5_inv, lookup_rng_chk_6_inv, lookup_rng_chk_7_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_byte_lengths_inv, lookup_byte_operations_inv, lookup_opcode_gas_inv, kernel_output_lookup_inv, lookup_into_kernel_inv, lookup_cd_value_inv, lookup_ret_value_inv, incl_main_tag_err_inv, incl_mem_tag_err_inv -#define SHIFTED_ENTITIES binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, cmp_a_hi_shift, cmp_a_lo_shift, cmp_b_hi_shift, cmp_b_lo_shift, cmp_cmp_rng_ctr_shift, cmp_op_gt_shift, cmp_p_sub_a_hi_shift, cmp_p_sub_a_lo_shift, cmp_p_sub_b_hi_shift, cmp_p_sub_b_lo_shift, cmp_sel_rng_chk_shift, main_da_gas_remaining_shift, main_emit_l2_to_l1_msg_write_offset_shift, main_emit_note_hash_write_offset_shift, main_emit_nullifier_write_offset_shift, main_emit_unencrypted_log_write_offset_shift, main_internal_return_ptr_shift, main_l1_to_l2_msg_exists_write_offset_shift, main_l2_gas_remaining_shift, main_note_hash_exist_write_offset_shift, main_nullifier_exists_write_offset_shift, main_nullifier_non_exists_write_offset_shift, main_pc_shift, main_sel_execution_end_shift, main_sel_execution_row_shift, main_sload_write_offset_shift, main_sstore_write_offset_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, slice_addr_shift, slice_clk_shift, slice_cnt_shift, slice_col_offset_shift, slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, slice_sel_start_shift, slice_space_id_shift -#define TO_BE_SHIFTED(e) e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.cmp_a_hi, e.cmp_a_lo, e.cmp_b_hi, e.cmp_b_lo, e.cmp_cmp_rng_ctr, e.cmp_op_gt, e.cmp_p_sub_a_hi, e.cmp_p_sub_a_lo, e.cmp_p_sub_b_hi, e.cmp_p_sub_b_lo, e.cmp_sel_rng_chk, e.main_da_gas_remaining, e.main_emit_l2_to_l1_msg_write_offset, e.main_emit_note_hash_write_offset, e.main_emit_nullifier_write_offset, e.main_emit_unencrypted_log_write_offset, e.main_internal_return_ptr, e.main_l1_to_l2_msg_exists_write_offset, e.main_l2_gas_remaining, e.main_note_hash_exist_write_offset, e.main_nullifier_exists_write_offset, e.main_nullifier_non_exists_write_offset, e.main_pc, e.main_sel_execution_end, e.main_sel_execution_row, e.main_sload_write_offset, e.main_sstore_write_offset, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.slice_addr, e.slice_clk, e.slice_cnt, e.slice_col_offset, e.slice_sel_cd_cpy, e.slice_sel_mem_active, e.slice_sel_return, e.slice_sel_start, e.slice_space_id +#define PRECOMPUTED_ENTITIES byte_lookup_sel_bin, byte_lookup_table_byte_lengths, byte_lookup_table_in_tags, byte_lookup_table_input_a, byte_lookup_table_input_b, byte_lookup_table_op_id, byte_lookup_table_output, gas_base_da_gas_fixed_table, gas_base_l2_gas_fixed_table, gas_dyn_da_gas_fixed_table, gas_dyn_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, main_sel_first, main_zeroes, powers_power_of_2 +#define WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_result, alu_cmp_gadget_sel, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_max_bits_sub_b_bits, alu_max_bits_sub_b_pow, alu_op_add, alu_op_cast, alu_op_div, alu_op_eq, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_partial_prod_hi, alu_partial_prod_lo, alu_range_check_input_value, alu_range_check_num_bits, alu_range_check_sel, alu_remainder, alu_sel_alu, alu_sel_cmp, alu_sel_shift_which, alu_u128_tag, alu_u16_tag, alu_u1_tag, alu_u32_tag, alu_u64_tag, alu_u8_tag, alu_zero_shift, binary_acc_ia, binary_acc_ib, binary_acc_ic, binary_clk, binary_ia_bytes, binary_ib_bytes, binary_ic_bytes, binary_in_tag, binary_mem_tag_ctr, binary_mem_tag_ctr_inv, binary_op_id, binary_sel_bin, binary_start, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_p_a_borrow, cmp_p_b_borrow, cmp_p_sub_a_hi, cmp_p_sub_a_lo, cmp_p_sub_b_hi, cmp_p_sub_b_lo, cmp_range_chk_clk, cmp_res_hi, cmp_res_lo, cmp_result, cmp_sel_cmp, cmp_sel_rng_chk, cmp_shift_sel, conversion_clk, conversion_input, conversion_num_limbs, conversion_output_bits, conversion_radix, conversion_sel_to_radix_le, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, main_abs_da_rem_gas, main_abs_l2_rem_gas, main_alu_in_tag, main_base_da_gas_op_cost, main_base_l2_gas_op_cost, main_bin_op_id, main_call_ptr, main_da_gas_remaining, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_emit_l2_to_l1_msg_write_offset, main_emit_note_hash_write_offset, main_emit_nullifier_write_offset, main_emit_unencrypted_log_write_offset, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_kernel_in_offset, main_kernel_out_offset, main_l1_to_l2_msg_exists_write_offset, main_l2_gas_remaining, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_note_hash_exist_write_offset, main_nullifier_exists_write_offset, main_nullifier_non_exists_write_offset, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_row, main_sel_kernel_inputs, main_sel_kernel_out, main_sel_last, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_div, main_sel_op_ecadd, main_sel_op_emit_l2_to_l1_msg, main_sel_op_emit_note_hash, main_sel_op_emit_nullifier, main_sel_op_emit_unencrypted_log, main_sel_op_eq, main_sel_op_external_call, main_sel_op_external_return, main_sel_op_external_revert, main_sel_op_fdiv, main_sel_op_fee_per_da_gas, main_sel_op_fee_per_l2_gas, main_sel_op_function_selector, main_sel_op_get_contract_instance, main_sel_op_internal_call, main_sel_op_internal_return, main_sel_op_is_static_call, main_sel_op_jump, main_sel_op_jumpi, main_sel_op_keccak, main_sel_op_l1_to_l2_msg_exists, main_sel_op_l2gasleft, main_sel_op_lt, main_sel_op_lte, main_sel_op_mov, main_sel_op_msm, main_sel_op_mul, main_sel_op_not, main_sel_op_note_hash_exists, main_sel_op_nullifier_exists, main_sel_op_or, main_sel_op_pedersen, main_sel_op_pedersen_commit, main_sel_op_poseidon2, main_sel_op_radix_le, main_sel_op_sender, main_sel_op_set, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, main_sel_op_static_call, main_sel_op_storage_address, main_sel_op_sub, main_sel_op_timestamp, main_sel_op_transaction_fee, main_sel_op_version, main_sel_op_xor, main_sel_q_kernel_lookup, main_sel_q_kernel_output_lookup, main_sel_resolve_ind_addr_a, main_sel_resolve_ind_addr_b, main_sel_resolve_ind_addr_c, main_sel_resolve_ind_addr_d, main_sel_returndata, main_sel_rng_16, main_sel_rng_8, main_sel_slice_gadget, main_side_effect_counter, main_sload_write_offset, main_space_id, main_sstore_write_offset, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_val, mem_w_in_tag, pedersen_clk, pedersen_input, pedersen_output, pedersen_sel_pedersen, poseidon2_B_10_0, poseidon2_B_10_1, poseidon2_B_10_2, poseidon2_B_10_3, poseidon2_B_11_0, poseidon2_B_11_1, poseidon2_B_11_2, poseidon2_B_11_3, poseidon2_B_12_0, poseidon2_B_12_1, poseidon2_B_12_2, poseidon2_B_12_3, poseidon2_B_13_0, poseidon2_B_13_1, poseidon2_B_13_2, poseidon2_B_13_3, poseidon2_B_14_0, poseidon2_B_14_1, poseidon2_B_14_2, poseidon2_B_14_3, poseidon2_B_15_0, poseidon2_B_15_1, poseidon2_B_15_2, poseidon2_B_15_3, poseidon2_B_16_0, poseidon2_B_16_1, poseidon2_B_16_2, poseidon2_B_16_3, poseidon2_B_17_0, poseidon2_B_17_1, poseidon2_B_17_2, poseidon2_B_17_3, poseidon2_B_18_0, poseidon2_B_18_1, poseidon2_B_18_2, poseidon2_B_18_3, poseidon2_B_19_0, poseidon2_B_19_1, poseidon2_B_19_2, poseidon2_B_19_3, poseidon2_B_20_0, poseidon2_B_20_1, poseidon2_B_20_2, poseidon2_B_20_3, poseidon2_B_21_0, poseidon2_B_21_1, poseidon2_B_21_2, poseidon2_B_21_3, poseidon2_B_22_0, poseidon2_B_22_1, poseidon2_B_22_2, poseidon2_B_22_3, poseidon2_B_23_0, poseidon2_B_23_1, poseidon2_B_23_2, poseidon2_B_23_3, poseidon2_B_24_0, poseidon2_B_24_1, poseidon2_B_24_2, poseidon2_B_24_3, poseidon2_B_25_0, poseidon2_B_25_1, poseidon2_B_25_2, poseidon2_B_25_3, poseidon2_B_26_0, poseidon2_B_26_1, poseidon2_B_26_2, poseidon2_B_26_3, poseidon2_B_27_0, poseidon2_B_27_1, poseidon2_B_27_2, poseidon2_B_27_3, poseidon2_B_28_0, poseidon2_B_28_1, poseidon2_B_28_2, poseidon2_B_28_3, poseidon2_B_29_0, poseidon2_B_29_1, poseidon2_B_29_2, poseidon2_B_29_3, poseidon2_B_30_0, poseidon2_B_30_1, poseidon2_B_30_2, poseidon2_B_30_3, poseidon2_B_31_0, poseidon2_B_31_1, poseidon2_B_31_2, poseidon2_B_31_3, poseidon2_B_32_0, poseidon2_B_32_1, poseidon2_B_32_2, poseidon2_B_32_3, poseidon2_B_33_0, poseidon2_B_33_1, poseidon2_B_33_2, poseidon2_B_33_3, poseidon2_B_34_0, poseidon2_B_34_1, poseidon2_B_34_2, poseidon2_B_34_3, poseidon2_B_35_0, poseidon2_B_35_1, poseidon2_B_35_2, poseidon2_B_35_3, poseidon2_B_36_0, poseidon2_B_36_1, poseidon2_B_36_2, poseidon2_B_36_3, poseidon2_B_37_0, poseidon2_B_37_1, poseidon2_B_37_2, poseidon2_B_37_3, poseidon2_B_38_0, poseidon2_B_38_1, poseidon2_B_38_2, poseidon2_B_38_3, poseidon2_B_39_0, poseidon2_B_39_1, poseidon2_B_39_2, poseidon2_B_39_3, poseidon2_B_40_0, poseidon2_B_40_1, poseidon2_B_40_2, poseidon2_B_40_3, poseidon2_B_41_0, poseidon2_B_41_1, poseidon2_B_41_2, poseidon2_B_41_3, poseidon2_B_42_0, poseidon2_B_42_1, poseidon2_B_42_2, poseidon2_B_42_3, poseidon2_B_43_0, poseidon2_B_43_1, poseidon2_B_43_2, poseidon2_B_43_3, poseidon2_B_44_0, poseidon2_B_44_1, poseidon2_B_44_2, poseidon2_B_44_3, poseidon2_B_45_0, poseidon2_B_45_1, poseidon2_B_45_2, poseidon2_B_45_3, poseidon2_B_46_0, poseidon2_B_46_1, poseidon2_B_46_2, poseidon2_B_46_3, poseidon2_B_47_0, poseidon2_B_47_1, poseidon2_B_47_2, poseidon2_B_47_3, poseidon2_B_48_0, poseidon2_B_48_1, poseidon2_B_48_2, poseidon2_B_48_3, poseidon2_B_49_0, poseidon2_B_49_1, poseidon2_B_49_2, poseidon2_B_49_3, poseidon2_B_4_0, poseidon2_B_4_1, poseidon2_B_4_2, poseidon2_B_4_3, poseidon2_B_50_0, poseidon2_B_50_1, poseidon2_B_50_2, poseidon2_B_50_3, poseidon2_B_51_0, poseidon2_B_51_1, poseidon2_B_51_2, poseidon2_B_51_3, poseidon2_B_52_0, poseidon2_B_52_1, poseidon2_B_52_2, poseidon2_B_52_3, poseidon2_B_53_0, poseidon2_B_53_1, poseidon2_B_53_2, poseidon2_B_53_3, poseidon2_B_54_0, poseidon2_B_54_1, poseidon2_B_54_2, poseidon2_B_54_3, poseidon2_B_55_0, poseidon2_B_55_1, poseidon2_B_55_2, poseidon2_B_55_3, poseidon2_B_56_0, poseidon2_B_56_1, poseidon2_B_56_2, poseidon2_B_56_3, poseidon2_B_57_0, poseidon2_B_57_1, poseidon2_B_57_2, poseidon2_B_57_3, poseidon2_B_58_0, poseidon2_B_58_1, poseidon2_B_58_2, poseidon2_B_58_3, poseidon2_B_59_0, poseidon2_B_59_1, poseidon2_B_59_2, poseidon2_B_59_3, poseidon2_B_5_0, poseidon2_B_5_1, poseidon2_B_5_2, poseidon2_B_5_3, poseidon2_B_6_0, poseidon2_B_6_1, poseidon2_B_6_2, poseidon2_B_6_3, poseidon2_B_7_0, poseidon2_B_7_1, poseidon2_B_7_2, poseidon2_B_7_3, poseidon2_B_8_0, poseidon2_B_8_1, poseidon2_B_8_2, poseidon2_B_8_3, poseidon2_B_9_0, poseidon2_B_9_1, poseidon2_B_9_2, poseidon2_B_9_3, poseidon2_EXT_LAYER_4, poseidon2_EXT_LAYER_5, poseidon2_EXT_LAYER_6, poseidon2_EXT_LAYER_7, poseidon2_T_0_4, poseidon2_T_0_5, poseidon2_T_0_6, poseidon2_T_0_7, poseidon2_T_1_4, poseidon2_T_1_5, poseidon2_T_1_6, poseidon2_T_1_7, poseidon2_T_2_4, poseidon2_T_2_5, poseidon2_T_2_6, poseidon2_T_2_7, poseidon2_T_3_4, poseidon2_T_3_5, poseidon2_T_3_6, poseidon2_T_3_7, poseidon2_T_60_4, poseidon2_T_60_5, poseidon2_T_60_6, poseidon2_T_60_7, poseidon2_T_61_4, poseidon2_T_61_5, poseidon2_T_61_6, poseidon2_T_61_7, poseidon2_T_62_4, poseidon2_T_62_5, poseidon2_T_62_6, poseidon2_T_62_7, poseidon2_T_63_4, poseidon2_T_63_5, poseidon2_T_63_6, poseidon2_T_63_7, poseidon2_a_0, poseidon2_a_1, poseidon2_a_2, poseidon2_a_3, poseidon2_b_0, poseidon2_b_1, poseidon2_b_2, poseidon2_b_3, poseidon2_clk, poseidon2_input_addr, poseidon2_mem_addr_read_a, poseidon2_mem_addr_read_b, poseidon2_mem_addr_read_c, poseidon2_mem_addr_read_d, poseidon2_mem_addr_write_a, poseidon2_mem_addr_write_b, poseidon2_mem_addr_write_c, poseidon2_mem_addr_write_d, poseidon2_output_addr, poseidon2_sel_poseidon_perm, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_dyn_diff, range_check_dyn_rng_chk_bits, range_check_dyn_rng_chk_pow_2, range_check_gas_da_rng_chk, range_check_gas_l2_rng_chk, range_check_is_lte_u112, range_check_is_lte_u128, range_check_is_lte_u16, range_check_is_lte_u32, range_check_is_lte_u48, range_check_is_lte_u64, range_check_is_lte_u80, range_check_is_lte_u96, range_check_mem_rng_chk, range_check_rng_chk_bits, range_check_sel_lookup_0, range_check_sel_lookup_1, range_check_sel_lookup_2, range_check_sel_lookup_3, range_check_sel_lookup_4, range_check_sel_lookup_5, range_check_sel_lookup_6, range_check_sel_rng_chk, range_check_u16_r0, range_check_u16_r1, range_check_u16_r2, range_check_u16_r3, range_check_u16_r4, range_check_u16_r5, range_check_u16_r6, range_check_u16_r7, range_check_value, sha256_clk, sha256_input, sha256_output, sha256_sel_sha256_compression, sha256_state, slice_addr, slice_clk, slice_cnt, slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, slice_sel_start, slice_space_id, slice_val, lookup_rng_chk_pow_2_counts, lookup_rng_chk_diff_counts, lookup_rng_chk_0_counts, lookup_rng_chk_1_counts, lookup_rng_chk_2_counts, lookup_rng_chk_3_counts, lookup_rng_chk_4_counts, lookup_rng_chk_5_counts, lookup_rng_chk_6_counts, lookup_rng_chk_7_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, kernel_output_lookup_counts, lookup_into_kernel_counts, lookup_cd_value_counts, lookup_ret_value_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts +#define DERIVED_WITNESS_ENTITIES perm_rng_mem_inv, perm_rng_cmp_lo_inv, perm_rng_cmp_hi_inv, perm_rng_alu_inv, perm_cmp_alu_inv, perm_rng_gas_l2_inv, perm_rng_gas_da_inv, perm_pos_mem_read_a_inv, perm_pos_mem_read_b_inv, perm_pos_mem_read_c_inv, perm_pos_mem_read_d_inv, perm_pos_mem_write_a_inv, perm_pos_mem_write_b_inv, perm_pos_mem_write_c_inv, perm_pos_mem_write_d_inv, perm_slice_mem_inv, perm_main_alu_inv, perm_main_bin_inv, perm_main_conv_inv, perm_main_pos2_perm_inv, perm_main_pedersen_inv, perm_main_slice_inv, perm_main_mem_a_inv, perm_main_mem_b_inv, perm_main_mem_c_inv, perm_main_mem_d_inv, perm_main_mem_ind_addr_a_inv, perm_main_mem_ind_addr_b_inv, perm_main_mem_ind_addr_c_inv, perm_main_mem_ind_addr_d_inv, lookup_rng_chk_pow_2_inv, lookup_rng_chk_diff_inv, lookup_rng_chk_0_inv, lookup_rng_chk_1_inv, lookup_rng_chk_2_inv, lookup_rng_chk_3_inv, lookup_rng_chk_4_inv, lookup_rng_chk_5_inv, lookup_rng_chk_6_inv, lookup_rng_chk_7_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_byte_lengths_inv, lookup_byte_operations_inv, lookup_opcode_gas_inv, kernel_output_lookup_inv, lookup_into_kernel_inv, lookup_cd_value_inv, lookup_ret_value_inv, incl_main_tag_err_inv, incl_mem_tag_err_inv +#define SHIFTED_ENTITIES binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, cmp_a_hi_shift, cmp_a_lo_shift, cmp_b_hi_shift, cmp_b_lo_shift, cmp_cmp_rng_ctr_shift, cmp_op_gt_shift, cmp_p_sub_a_hi_shift, cmp_p_sub_a_lo_shift, cmp_p_sub_b_hi_shift, cmp_p_sub_b_lo_shift, cmp_sel_rng_chk_shift, main_da_gas_remaining_shift, main_emit_l2_to_l1_msg_write_offset_shift, main_emit_note_hash_write_offset_shift, main_emit_nullifier_write_offset_shift, main_emit_unencrypted_log_write_offset_shift, main_internal_return_ptr_shift, main_l1_to_l2_msg_exists_write_offset_shift, main_l2_gas_remaining_shift, main_note_hash_exist_write_offset_shift, main_nullifier_exists_write_offset_shift, main_nullifier_non_exists_write_offset_shift, main_pc_shift, main_sel_execution_row_shift, main_sload_write_offset_shift, main_sstore_write_offset_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, slice_addr_shift, slice_clk_shift, slice_cnt_shift, slice_col_offset_shift, slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, slice_sel_start_shift, slice_space_id_shift +#define TO_BE_SHIFTED(e) e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.cmp_a_hi, e.cmp_a_lo, e.cmp_b_hi, e.cmp_b_lo, e.cmp_cmp_rng_ctr, e.cmp_op_gt, e.cmp_p_sub_a_hi, e.cmp_p_sub_a_lo, e.cmp_p_sub_b_hi, e.cmp_p_sub_b_lo, e.cmp_sel_rng_chk, e.main_da_gas_remaining, e.main_emit_l2_to_l1_msg_write_offset, e.main_emit_note_hash_write_offset, e.main_emit_nullifier_write_offset, e.main_emit_unencrypted_log_write_offset, e.main_internal_return_ptr, e.main_l1_to_l2_msg_exists_write_offset, e.main_l2_gas_remaining, e.main_note_hash_exist_write_offset, e.main_nullifier_exists_write_offset, e.main_nullifier_non_exists_write_offset, e.main_pc, e.main_sel_execution_row, e.main_sload_write_offset, e.main_sstore_write_offset, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.slice_addr, e.slice_clk, e.slice_cnt, e.slice_col_offset, e.slice_sel_cd_cpy, e.slice_sel_mem_active, e.slice_sel_return, e.slice_sel_start, e.slice_space_id #define ALL_ENTITIES PRECOMPUTED_ENTITIES, WIRE_ENTITIES, DERIVED_WITNESS_ENTITIES, SHIFTED_ENTITIES // clang-format on @@ -122,13 +118,13 @@ class AvmFlavor { // This flavor would not be used with ZK Sumcheck static constexpr bool HasZK = false; - static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 21; - static constexpr size_t NUM_WITNESS_ENTITIES = 687; - static constexpr size_t NUM_SHIFTED_ENTITIES = 47; + static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 16; + static constexpr size_t NUM_WITNESS_ENTITIES = 683; + static constexpr size_t NUM_SHIFTED_ENTITIES = 46; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for // the unshifted and one for the shifted - static constexpr size_t NUM_ALL_ENTITIES = 755; + static constexpr size_t NUM_ALL_ENTITIES = 745; // The total number of witnesses including shifts and derived entities. static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; @@ -179,10 +175,6 @@ class AvmFlavor { lookup_rng_chk_diff_relation, lookup_rng_chk_pow_2_relation, perm_cmp_alu_relation, - perm_da_end_gas_relation, - perm_da_start_gas_relation, - perm_l2_end_gas_relation, - perm_l2_start_gas_relation, perm_main_alu_relation, perm_main_bin_relation, perm_main_conv_relation, @@ -475,12 +467,7 @@ class AvmFlavor { this->gas_dyn_l2_gas_fixed_table = verification_key->gas_dyn_l2_gas_fixed_table; this->gas_sel_gas_cost = verification_key->gas_sel_gas_cost; this->main_clk = verification_key->main_clk; - this->main_sel_da_end_gas_kernel_input = verification_key->main_sel_da_end_gas_kernel_input; - this->main_sel_da_start_gas_kernel_input = verification_key->main_sel_da_start_gas_kernel_input; this->main_sel_first = verification_key->main_sel_first; - this->main_sel_l2_end_gas_kernel_input = verification_key->main_sel_l2_end_gas_kernel_input; - this->main_sel_l2_start_gas_kernel_input = verification_key->main_sel_l2_start_gas_kernel_input; - this->main_sel_start_exec = verification_key->main_sel_start_exec; this->main_zeroes = verification_key->main_zeroes; this->powers_power_of_2 = verification_key->powers_power_of_2; } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp index 1ad7557bb26..72d5632f287 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp @@ -32,12 +32,7 @@ template std::vector AvmFullRow::names() "gas_dyn_l2_gas_fixed_table", "gas_sel_gas_cost", "main_clk", - "main_sel_da_end_gas_kernel_input", - "main_sel_da_start_gas_kernel_input", "main_sel_first", - "main_sel_l2_end_gas_kernel_input", - "main_sel_l2_start_gas_kernel_input", - "main_sel_start_exec", "main_zeroes", "powers_power_of_2", "main_kernel_inputs", @@ -194,10 +189,10 @@ template std::vector AvmFullRow::names() "main_sel_alu", "main_sel_bin", "main_sel_calldata", - "main_sel_execution_end", "main_sel_execution_row", "main_sel_kernel_inputs", "main_sel_kernel_out", + "main_sel_last", "main_sel_mem_op_a", "main_sel_mem_op_b", "main_sel_mem_op_c", @@ -658,10 +653,6 @@ template std::vector AvmFullRow::names() "perm_cmp_alu_inv", "perm_rng_gas_l2_inv", "perm_rng_gas_da_inv", - "perm_l2_start_gas_inv", - "perm_da_start_gas_inv", - "perm_l2_end_gas_inv", - "perm_da_end_gas_inv", "perm_pos_mem_read_a_inv", "perm_pos_mem_read_b_inv", "perm_pos_mem_read_c_inv", @@ -745,12 +736,7 @@ template RefVector AvmFullRow::as_vector() const gas_dyn_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, - main_sel_da_end_gas_kernel_input, - main_sel_da_start_gas_kernel_input, main_sel_first, - main_sel_l2_end_gas_kernel_input, - main_sel_l2_start_gas_kernel_input, - main_sel_start_exec, main_zeroes, powers_power_of_2, main_kernel_inputs, @@ -907,10 +893,10 @@ template RefVector AvmFullRow::as_vector() const main_sel_alu, main_sel_bin, main_sel_calldata, - main_sel_execution_end, main_sel_execution_row, main_sel_kernel_inputs, main_sel_kernel_out, + main_sel_last, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, @@ -1371,10 +1357,6 @@ template RefVector AvmFullRow::as_vector() const perm_cmp_alu_inv, perm_rng_gas_l2_inv, perm_rng_gas_da_inv, - perm_l2_start_gas_inv, - perm_da_start_gas_inv, - perm_l2_end_gas_inv, - perm_da_end_gas_inv, perm_pos_mem_read_a_inv, perm_pos_mem_read_b_inv, perm_pos_mem_read_c_inv, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp index 19bad253079..b8c2db298d4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp @@ -23,12 +23,7 @@ template struct AvmFullRow { FF gas_dyn_l2_gas_fixed_table{}; FF gas_sel_gas_cost{}; FF main_clk{}; - FF main_sel_da_end_gas_kernel_input{}; - FF main_sel_da_start_gas_kernel_input{}; FF main_sel_first{}; - FF main_sel_l2_end_gas_kernel_input{}; - FF main_sel_l2_start_gas_kernel_input{}; - FF main_sel_start_exec{}; FF main_zeroes{}; FF powers_power_of_2{}; FF main_kernel_inputs{}; @@ -185,10 +180,10 @@ template struct AvmFullRow { FF main_sel_alu{}; FF main_sel_bin{}; FF main_sel_calldata{}; - FF main_sel_execution_end{}; FF main_sel_execution_row{}; FF main_sel_kernel_inputs{}; FF main_sel_kernel_out{}; + FF main_sel_last{}; FF main_sel_mem_op_a{}; FF main_sel_mem_op_b{}; FF main_sel_mem_op_c{}; @@ -649,10 +644,6 @@ template struct AvmFullRow { FF perm_cmp_alu_inv{}; FF perm_rng_gas_l2_inv{}; FF perm_rng_gas_da_inv{}; - FF perm_l2_start_gas_inv{}; - FF perm_da_start_gas_inv{}; - FF perm_l2_end_gas_inv{}; - FF perm_da_end_gas_inv{}; FF perm_pos_mem_read_a_inv{}; FF perm_pos_mem_read_b_inv{}; FF perm_pos_mem_read_c_inv{}; @@ -722,7 +713,7 @@ template struct AvmFullRow { RefVector as_vector() const; static std::vector names(); - static constexpr size_t SIZE = 708; + static constexpr size_t SIZE = 699; }; template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp index 25607e0e926..eefe05d9e71 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/kernel.hpp @@ -20,18 +20,18 @@ template class kernelImpl { [[maybe_unused]] const RelationParameters&, [[maybe_unused]] const FF& scaling_factor) { - const auto constants_SENDER_KERNEL_INPUTS_COL_OFFSET = FF(0); - const auto constants_ADDRESS_KERNEL_INPUTS_COL_OFFSET = FF(1); - const auto constants_STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET = FF(1); - const auto constants_FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = FF(2); - const auto constants_IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = FF(3); - const auto constants_CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = FF(4); - const auto constants_VERSION_KERNEL_INPUTS_COL_OFFSET = FF(5); - const auto constants_BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET = FF(6); - const auto constants_TIMESTAMP_KERNEL_INPUTS_COL_OFFSET = FF(7); - const auto constants_FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET = FF(8); - const auto constants_FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET = FF(9); - const auto constants_TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET = FF(14); + const auto constants_SENDER_SELECTOR = FF(0); + const auto constants_ADDRESS_SELECTOR = FF(1); + const auto constants_STORAGE_ADDRESS_SELECTOR = FF(1); + const auto constants_FUNCTION_SELECTOR_SELECTOR = FF(2); + const auto constants_IS_STATIC_CALL_SELECTOR = FF(4); + const auto constants_CHAIN_ID_SELECTOR = FF(29); + const auto constants_VERSION_SELECTOR = FF(30); + const auto constants_BLOCK_NUMBER_SELECTOR = FF(31); + const auto constants_TIMESTAMP_SELECTOR = FF(33); + const auto constants_FEE_PER_DA_GAS_SELECTOR = FF(36); + const auto constants_FEE_PER_L2_GAS_SELECTOR = FF(37); + const auto constants_TRANSACTION_FEE_SELECTOR = FF(41); const auto constants_START_NOTE_HASH_EXISTS_WRITE_OFFSET = FF(0); const auto constants_START_NULLIFIER_EXISTS_OFFSET = FF(16); const auto constants_START_NULLIFIER_NON_EXISTS_OFFSET = FF(32); @@ -149,85 +149,81 @@ template class kernelImpl { } { using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_address * - (new_term.main_kernel_in_offset - constants_ADDRESS_KERNEL_INPUTS_COL_OFFSET)); + auto tmp = (new_term.main_sel_op_address * (new_term.main_kernel_in_offset - constants_ADDRESS_SELECTOR)); tmp *= scaling_factor; std::get<10>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_storage_address * - (new_term.main_kernel_in_offset - constants_STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_STORAGE_ADDRESS_SELECTOR)); tmp *= scaling_factor; std::get<11>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sender * - (new_term.main_kernel_in_offset - constants_SENDER_KERNEL_INPUTS_COL_OFFSET)); + auto tmp = (new_term.main_sel_op_sender * (new_term.main_kernel_in_offset - constants_SENDER_SELECTOR)); tmp *= scaling_factor; std::get<12>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_function_selector * - (new_term.main_kernel_in_offset - constants_FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_FUNCTION_SELECTOR_SELECTOR)); tmp *= scaling_factor; std::get<13>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_transaction_fee * - (new_term.main_kernel_in_offset - constants_TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_TRANSACTION_FEE_SELECTOR)); tmp *= scaling_factor; std::get<14>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_is_static_call * - (new_term.main_kernel_in_offset - constants_IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_IS_STATIC_CALL_SELECTOR)); tmp *= scaling_factor; std::get<15>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_chain_id * - (new_term.main_kernel_in_offset - constants_CHAIN_ID_KERNEL_INPUTS_COL_OFFSET)); + auto tmp = (new_term.main_sel_op_chain_id * (new_term.main_kernel_in_offset - constants_CHAIN_ID_SELECTOR)); tmp *= scaling_factor; std::get<16>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_version * - (new_term.main_kernel_in_offset - constants_VERSION_KERNEL_INPUTS_COL_OFFSET)); + auto tmp = (new_term.main_sel_op_version * (new_term.main_kernel_in_offset - constants_VERSION_SELECTOR)); tmp *= scaling_factor; std::get<17>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_block_number * - (new_term.main_kernel_in_offset - constants_BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_BLOCK_NUMBER_SELECTOR)); tmp *= scaling_factor; std::get<18>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<19, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_timestamp * - (new_term.main_kernel_in_offset - constants_TIMESTAMP_KERNEL_INPUTS_COL_OFFSET)); + auto tmp = + (new_term.main_sel_op_timestamp * (new_term.main_kernel_in_offset - constants_TIMESTAMP_SELECTOR)); tmp *= scaling_factor; std::get<19>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<20, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_fee_per_da_gas * - (new_term.main_kernel_in_offset - constants_FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_FEE_PER_DA_GAS_SELECTOR)); tmp *= scaling_factor; std::get<20>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<21, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_fee_per_l2_gas * - (new_term.main_kernel_in_offset - constants_FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET)); + (new_term.main_kernel_in_offset - constants_FEE_PER_L2_GAS_SELECTOR)); tmp *= scaling_factor; std::get<21>(evals) += typename Accumulator::View(tmp); } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp index 963b2b0895d..64377d819e5 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp @@ -10,11 +10,11 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { - 2, 3, 4, 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, + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + 2, 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, 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, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 3, 3, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 2, 2 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 3, 3, 4, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 2, 2 }; template @@ -102,698 +102,690 @@ template class mainImpl { } { using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_execution_end_shift - - ((new_term.main_sel_execution_row * (FF(1) - new_term.main_sel_execution_row_shift)) * - (FF(1) - new_term.main_sel_first))); + auto tmp = (new_term.main_sel_op_address * (FF(1) - new_term.main_sel_op_address)); tmp *= scaling_factor; std::get<2>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_address * (FF(1) - new_term.main_sel_op_address)); + auto tmp = (new_term.main_sel_op_storage_address * (FF(1) - new_term.main_sel_op_storage_address)); tmp *= scaling_factor; std::get<3>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_storage_address * (FF(1) - new_term.main_sel_op_storage_address)); + auto tmp = (new_term.main_sel_op_sender * (FF(1) - new_term.main_sel_op_sender)); tmp *= scaling_factor; std::get<4>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sender * (FF(1) - new_term.main_sel_op_sender)); + auto tmp = (new_term.main_sel_op_function_selector * (FF(1) - new_term.main_sel_op_function_selector)); tmp *= scaling_factor; std::get<5>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_function_selector * (FF(1) - new_term.main_sel_op_function_selector)); + auto tmp = (new_term.main_sel_op_transaction_fee * (FF(1) - new_term.main_sel_op_transaction_fee)); tmp *= scaling_factor; std::get<6>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_transaction_fee * (FF(1) - new_term.main_sel_op_transaction_fee)); + auto tmp = (new_term.main_sel_op_chain_id * (FF(1) - new_term.main_sel_op_chain_id)); tmp *= scaling_factor; std::get<7>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_chain_id * (FF(1) - new_term.main_sel_op_chain_id)); + auto tmp = (new_term.main_sel_op_version * (FF(1) - new_term.main_sel_op_version)); tmp *= scaling_factor; std::get<8>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_version * (FF(1) - new_term.main_sel_op_version)); + auto tmp = (new_term.main_sel_op_block_number * (FF(1) - new_term.main_sel_op_block_number)); tmp *= scaling_factor; std::get<9>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_block_number * (FF(1) - new_term.main_sel_op_block_number)); + auto tmp = (new_term.main_sel_op_timestamp * (FF(1) - new_term.main_sel_op_timestamp)); tmp *= scaling_factor; std::get<10>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_timestamp * (FF(1) - new_term.main_sel_op_timestamp)); + auto tmp = (new_term.main_sel_op_fee_per_l2_gas * (FF(1) - new_term.main_sel_op_fee_per_l2_gas)); tmp *= scaling_factor; std::get<11>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fee_per_l2_gas * (FF(1) - new_term.main_sel_op_fee_per_l2_gas)); + auto tmp = (new_term.main_sel_op_fee_per_da_gas * (FF(1) - new_term.main_sel_op_fee_per_da_gas)); tmp *= scaling_factor; std::get<12>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fee_per_da_gas * (FF(1) - new_term.main_sel_op_fee_per_da_gas)); + auto tmp = (new_term.main_sel_op_is_static_call * (FF(1) - new_term.main_sel_op_is_static_call)); tmp *= scaling_factor; std::get<13>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_is_static_call * (FF(1) - new_term.main_sel_op_is_static_call)); + auto tmp = (new_term.main_sel_op_l2gasleft * (FF(1) - new_term.main_sel_op_l2gasleft)); tmp *= scaling_factor; std::get<14>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l2gasleft * (FF(1) - new_term.main_sel_op_l2gasleft)); + auto tmp = (new_term.main_sel_op_dagasleft * (FF(1) - new_term.main_sel_op_dagasleft)); tmp *= scaling_factor; std::get<15>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_dagasleft * (FF(1) - new_term.main_sel_op_dagasleft)); + auto tmp = (new_term.main_sel_op_note_hash_exists * (FF(1) - new_term.main_sel_op_note_hash_exists)); tmp *= scaling_factor; std::get<16>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_note_hash_exists * (FF(1) - new_term.main_sel_op_note_hash_exists)); + auto tmp = (new_term.main_sel_op_emit_note_hash * (FF(1) - new_term.main_sel_op_emit_note_hash)); tmp *= scaling_factor; std::get<17>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_note_hash * (FF(1) - new_term.main_sel_op_emit_note_hash)); + auto tmp = (new_term.main_sel_op_nullifier_exists * (FF(1) - new_term.main_sel_op_nullifier_exists)); tmp *= scaling_factor; std::get<18>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<19, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_nullifier_exists * (FF(1) - new_term.main_sel_op_nullifier_exists)); + auto tmp = (new_term.main_sel_op_emit_nullifier * (FF(1) - new_term.main_sel_op_emit_nullifier)); tmp *= scaling_factor; std::get<19>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<20, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_nullifier * (FF(1) - new_term.main_sel_op_emit_nullifier)); + auto tmp = (new_term.main_sel_op_l1_to_l2_msg_exists * (FF(1) - new_term.main_sel_op_l1_to_l2_msg_exists)); tmp *= scaling_factor; std::get<20>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<21, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l1_to_l2_msg_exists * (FF(1) - new_term.main_sel_op_l1_to_l2_msg_exists)); + auto tmp = + (new_term.main_sel_op_emit_unencrypted_log * (FF(1) - new_term.main_sel_op_emit_unencrypted_log)); tmp *= scaling_factor; std::get<21>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<22, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_emit_unencrypted_log * (FF(1) - new_term.main_sel_op_emit_unencrypted_log)); + auto tmp = (new_term.main_sel_op_emit_l2_to_l1_msg * (FF(1) - new_term.main_sel_op_emit_l2_to_l1_msg)); tmp *= scaling_factor; std::get<22>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<23, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_l2_to_l1_msg * (FF(1) - new_term.main_sel_op_emit_l2_to_l1_msg)); + auto tmp = + (new_term.main_sel_op_get_contract_instance * (FF(1) - new_term.main_sel_op_get_contract_instance)); tmp *= scaling_factor; std::get<23>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<24, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_get_contract_instance * (FF(1) - new_term.main_sel_op_get_contract_instance)); + auto tmp = (new_term.main_sel_op_sload * (FF(1) - new_term.main_sel_op_sload)); tmp *= scaling_factor; std::get<24>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<25, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sload * (FF(1) - new_term.main_sel_op_sload)); + auto tmp = (new_term.main_sel_op_sstore * (FF(1) - new_term.main_sel_op_sstore)); tmp *= scaling_factor; std::get<25>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<26, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sstore * (FF(1) - new_term.main_sel_op_sstore)); + auto tmp = (new_term.main_sel_op_radix_le * (FF(1) - new_term.main_sel_op_radix_le)); tmp *= scaling_factor; std::get<26>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<27, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_radix_le * (FF(1) - new_term.main_sel_op_radix_le)); + auto tmp = (new_term.main_sel_op_sha256 * (FF(1) - new_term.main_sel_op_sha256)); tmp *= scaling_factor; std::get<27>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<28, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sha256 * (FF(1) - new_term.main_sel_op_sha256)); + auto tmp = (new_term.main_sel_op_poseidon2 * (FF(1) - new_term.main_sel_op_poseidon2)); tmp *= scaling_factor; std::get<28>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<29, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_poseidon2 * (FF(1) - new_term.main_sel_op_poseidon2)); + auto tmp = (new_term.main_sel_op_keccak * (FF(1) - new_term.main_sel_op_keccak)); tmp *= scaling_factor; std::get<29>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<30, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_keccak * (FF(1) - new_term.main_sel_op_keccak)); + auto tmp = (new_term.main_sel_op_pedersen * (FF(1) - new_term.main_sel_op_pedersen)); tmp *= scaling_factor; std::get<30>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<31, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_pedersen * (FF(1) - new_term.main_sel_op_pedersen)); + auto tmp = (new_term.main_sel_op_ecadd * (FF(1) - new_term.main_sel_op_ecadd)); tmp *= scaling_factor; std::get<31>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<32, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_ecadd * (FF(1) - new_term.main_sel_op_ecadd)); + auto tmp = (new_term.main_sel_op_pedersen_commit * (FF(1) - new_term.main_sel_op_pedersen_commit)); tmp *= scaling_factor; std::get<32>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<33, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_pedersen_commit * (FF(1) - new_term.main_sel_op_pedersen_commit)); + auto tmp = (new_term.main_sel_op_msm * (FF(1) - new_term.main_sel_op_msm)); tmp *= scaling_factor; std::get<33>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<34, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_msm * (FF(1) - new_term.main_sel_op_msm)); + auto tmp = (new_term.main_sel_op_add * (FF(1) - new_term.main_sel_op_add)); tmp *= scaling_factor; std::get<34>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<35, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_add * (FF(1) - new_term.main_sel_op_add)); + auto tmp = (new_term.main_sel_op_sub * (FF(1) - new_term.main_sel_op_sub)); tmp *= scaling_factor; std::get<35>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<36, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sub * (FF(1) - new_term.main_sel_op_sub)); + auto tmp = (new_term.main_sel_op_mul * (FF(1) - new_term.main_sel_op_mul)); tmp *= scaling_factor; std::get<36>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<37, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mul * (FF(1) - new_term.main_sel_op_mul)); + auto tmp = (new_term.main_sel_op_div * (FF(1) - new_term.main_sel_op_div)); tmp *= scaling_factor; std::get<37>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<38, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_div * (FF(1) - new_term.main_sel_op_div)); + auto tmp = (new_term.main_sel_op_fdiv * (FF(1) - new_term.main_sel_op_fdiv)); tmp *= scaling_factor; std::get<38>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<39, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (FF(1) - new_term.main_sel_op_fdiv)); + auto tmp = (new_term.main_sel_op_not * (FF(1) - new_term.main_sel_op_not)); tmp *= scaling_factor; std::get<39>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<40, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_not * (FF(1) - new_term.main_sel_op_not)); + auto tmp = (new_term.main_sel_op_eq * (FF(1) - new_term.main_sel_op_eq)); tmp *= scaling_factor; std::get<40>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<41, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_eq * (FF(1) - new_term.main_sel_op_eq)); + auto tmp = (new_term.main_sel_op_and * (FF(1) - new_term.main_sel_op_and)); tmp *= scaling_factor; std::get<41>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<42, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_and * (FF(1) - new_term.main_sel_op_and)); + auto tmp = (new_term.main_sel_op_or * (FF(1) - new_term.main_sel_op_or)); tmp *= scaling_factor; std::get<42>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<43, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_or * (FF(1) - new_term.main_sel_op_or)); + auto tmp = (new_term.main_sel_op_xor * (FF(1) - new_term.main_sel_op_xor)); tmp *= scaling_factor; std::get<43>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<44, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_xor * (FF(1) - new_term.main_sel_op_xor)); + auto tmp = (new_term.main_sel_op_cast * (FF(1) - new_term.main_sel_op_cast)); tmp *= scaling_factor; std::get<44>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<45, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_cast * (FF(1) - new_term.main_sel_op_cast)); + auto tmp = (new_term.main_sel_op_lt * (FF(1) - new_term.main_sel_op_lt)); tmp *= scaling_factor; std::get<45>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<46, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_lt * (FF(1) - new_term.main_sel_op_lt)); + auto tmp = (new_term.main_sel_op_lte * (FF(1) - new_term.main_sel_op_lte)); tmp *= scaling_factor; std::get<46>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<47, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_lte * (FF(1) - new_term.main_sel_op_lte)); + auto tmp = (new_term.main_sel_op_shl * (FF(1) - new_term.main_sel_op_shl)); tmp *= scaling_factor; std::get<47>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<48, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_shl * (FF(1) - new_term.main_sel_op_shl)); + auto tmp = (new_term.main_sel_op_shr * (FF(1) - new_term.main_sel_op_shr)); tmp *= scaling_factor; std::get<48>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<49, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_shr * (FF(1) - new_term.main_sel_op_shr)); + auto tmp = (new_term.main_sel_op_internal_call * (FF(1) - new_term.main_sel_op_internal_call)); tmp *= scaling_factor; std::get<49>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<50, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (FF(1) - new_term.main_sel_op_internal_call)); + auto tmp = (new_term.main_sel_op_internal_return * (FF(1) - new_term.main_sel_op_internal_return)); tmp *= scaling_factor; std::get<50>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<51, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (FF(1) - new_term.main_sel_op_internal_return)); + auto tmp = (new_term.main_sel_op_jump * (FF(1) - new_term.main_sel_op_jump)); tmp *= scaling_factor; std::get<51>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<52, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jump * (FF(1) - new_term.main_sel_op_jump)); + auto tmp = (new_term.main_sel_op_jumpi * (FF(1) - new_term.main_sel_op_jumpi)); tmp *= scaling_factor; std::get<52>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<53, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * (FF(1) - new_term.main_sel_op_jumpi)); + auto tmp = (new_term.main_sel_op_external_call * (FF(1) - new_term.main_sel_op_external_call)); tmp *= scaling_factor; std::get<53>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<54, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_call * (FF(1) - new_term.main_sel_op_external_call)); + auto tmp = (new_term.main_sel_op_static_call * (FF(1) - new_term.main_sel_op_static_call)); tmp *= scaling_factor; std::get<54>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<55, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_static_call * (FF(1) - new_term.main_sel_op_static_call)); + auto tmp = (new_term.main_sel_op_calldata_copy * (FF(1) - new_term.main_sel_op_calldata_copy)); tmp *= scaling_factor; std::get<55>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<56, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_calldata_copy * (FF(1) - new_term.main_sel_op_calldata_copy)); + auto tmp = (new_term.main_sel_op_external_return * (FF(1) - new_term.main_sel_op_external_return)); tmp *= scaling_factor; std::get<56>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<57, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_return * (FF(1) - new_term.main_sel_op_external_return)); + auto tmp = (new_term.main_sel_op_external_revert * (FF(1) - new_term.main_sel_op_external_revert)); tmp *= scaling_factor; std::get<57>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<58, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_revert * (FF(1) - new_term.main_sel_op_external_revert)); + auto tmp = (new_term.main_sel_op_set * (FF(1) - new_term.main_sel_op_set)); tmp *= scaling_factor; std::get<58>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<59, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_set * (FF(1) - new_term.main_sel_op_set)); + auto tmp = (new_term.main_sel_op_mov * (FF(1) - new_term.main_sel_op_mov)); tmp *= scaling_factor; std::get<59>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<60, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mov * (FF(1) - new_term.main_sel_op_mov)); + auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); tmp *= scaling_factor; std::get<60>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<61, ContainerOverSubrelations>; - auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); + auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); tmp *= scaling_factor; std::get<61>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<62, ContainerOverSubrelations>; - auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); + auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); tmp *= scaling_factor; std::get<62>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<63, ContainerOverSubrelations>; - auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); + auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); tmp *= scaling_factor; std::get<63>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<64, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); + auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); tmp *= scaling_factor; std::get<64>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<65, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); + auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); tmp *= scaling_factor; std::get<65>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<66, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); + auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); tmp *= scaling_factor; std::get<66>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<67, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); + auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); tmp *= scaling_factor; std::get<67>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<68, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); + auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); tmp *= scaling_factor; std::get<68>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<69, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); + auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); tmp *= scaling_factor; std::get<69>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<70, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); + auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); tmp *= scaling_factor; std::get<70>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<71, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); + auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); tmp *= scaling_factor; std::get<71>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<72, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); + auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); tmp *= scaling_factor; std::get<72>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<73, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); + auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); tmp *= scaling_factor; std::get<73>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<74, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); + auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); tmp *= scaling_factor; std::get<74>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<75, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); + auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * + (new_term.main_w_in_tag - constants_MEM_TAG_U1)); tmp *= scaling_factor; std::get<75>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<76, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * - (new_term.main_w_in_tag - constants_MEM_TAG_U1)); + auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * + ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); tmp *= scaling_factor; std::get<76>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<77, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * - ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); + auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * + (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); tmp *= scaling_factor; std::get<77>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<78, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * - (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); + auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * + (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<78>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<79, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * - (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<79>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<80, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<80>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<81, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_op_err * ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) - FF(1))); tmp *= scaling_factor; std::get<81>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<82, ContainerOverSubrelations>; - auto tmp = (new_term.main_op_err * ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) - FF(1))); + auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<82>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<83, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_jumpi * + (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + + (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(1))))); tmp *= scaling_factor; std::get<83>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<84, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * - (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + - (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(1))))); + auto tmp = (new_term.main_sel_op_internal_call * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<84>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<85, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); + auto tmp = + (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); tmp *= scaling_factor; std::get<85>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<86, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<86>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<87, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(1)) - new_term.main_ib)); tmp *= scaling_factor; std::get<87>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<88, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(1)) - new_term.main_ib)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); tmp *= scaling_factor; std::get<88>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<89, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<89>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<90, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); + auto tmp = (new_term.main_sel_op_internal_return * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<90>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<91, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_internal_return * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); + ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); tmp *= scaling_factor; std::get<91>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<92, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * - ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<92>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<93, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); tmp *= scaling_factor; std::get<93>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<94, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); tmp *= scaling_factor; std::get<94>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<95, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); + auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * + (new_term.main_pc_shift - (new_term.main_pc + FF(1)))); tmp *= scaling_factor; std::get<95>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<96, ContainerOverSubrelations>; auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * - (new_term.main_pc_shift - (new_term.main_pc + FF(1)))); + (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); tmp *= scaling_factor; std::get<96>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<97, ContainerOverSubrelations>; - auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * - (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); + auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * + (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); tmp *= scaling_factor; std::get<97>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<98, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * - (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); + auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * + (new_term.main_call_ptr - new_term.main_space_id)); tmp *= scaling_factor; std::get<98>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<99, ContainerOverSubrelations>; - auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * - (new_term.main_call_ptr - new_term.main_space_id)); + auto tmp = (new_term.main_sel_op_jumpi * + (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); tmp *= scaling_factor; std::get<99>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<100, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * - (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); + auto tmp = ((new_term.main_sel_op_jumpi * new_term.main_id_zero) * (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<100>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<101, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_jumpi * new_term.main_id_zero) * (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_mov_ia_to_ic - (new_term.main_sel_op_mov * (FF(1) - new_term.main_id_zero))); tmp *= scaling_factor; std::get<101>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<102, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic - (new_term.main_sel_op_mov * (FF(1) - new_term.main_id_zero))); + auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); tmp *= scaling_factor; std::get<102>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<103, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); + auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); tmp *= scaling_factor; std::get<103>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<104, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); + auto tmp = (new_term.main_sel_op_mov * (new_term.main_r_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<104>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<105, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mov * (new_term.main_r_in_tag - new_term.main_w_in_tag)); + auto tmp = (new_term.main_sel_alu - + ((main_SEL_ALL_ALU * (FF(1) - new_term.main_tag_err)) * (FF(1) - new_term.main_op_err))); tmp *= scaling_factor; std::get<105>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<106, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_alu - - ((main_SEL_ALL_ALU * (FF(1) - new_term.main_tag_err)) * (FF(1) - new_term.main_op_err))); + auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); tmp *= scaling_factor; std::get<106>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<107, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); + auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<107>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<108, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); + auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<108>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<109, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); + auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<109>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<110, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); - tmp *= scaling_factor; - std::get<110>(evals) += typename Accumulator::View(tmp); - } - { - using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; auto tmp = ((new_term.main_ib * (FF(1) - new_term.main_tag_err)) * ((new_term.main_sel_op_calldata_copy + new_term.main_sel_op_external_return) - new_term.main_sel_slice_gadget)); tmp *= scaling_factor; - std::get<111>(evals) += typename Accumulator::View(tmp); + std::get<110>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<112, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; auto tmp = (new_term.main_bin_op_id - (new_term.main_sel_op_or + (FF(2) * new_term.main_sel_op_xor))); tmp *= scaling_factor; - std::get<112>(evals) += typename Accumulator::View(tmp); + std::get<111>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<113, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<112, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_bin - ((new_term.main_sel_op_and + new_term.main_sel_op_or) + new_term.main_sel_op_xor)); tmp *= scaling_factor; - std::get<113>(evals) += typename Accumulator::View(tmp); + std::get<112>(evals) += typename Accumulator::View(tmp); } } }; @@ -807,53 +799,53 @@ template class main : public Relation> { switch (index) { case 0: return "OPCODE_SELECTORS"; - case 76: + case 75: return "OUTPUT_U1"; - case 77: + case 76: return "SUBOP_FDIV"; - case 78: + case 77: return "SUBOP_FDIV_ZERO_ERR1"; - case 79: + case 78: return "SUBOP_FDIV_ZERO_ERR2"; - case 80: + case 79: return "SUBOP_FDIV_R_IN_TAG_FF"; - case 81: + case 80: return "SUBOP_FDIV_W_IN_TAG_FF"; - case 82: + case 81: return "SUBOP_ERROR_RELEVANT_OP"; - case 83: + case 82: return "PC_JUMP"; - case 84: + case 83: return "PC_JUMPI"; - case 85: + case 84: return "RETURN_POINTER_INCREMENT"; - case 91: + case 90: return "RETURN_POINTER_DECREMENT"; - case 96: + case 95: return "PC_INCREMENT"; - case 97: + case 96: return "INTERNAL_RETURN_POINTER_CONSISTENCY"; - case 98: + case 97: return "SPACE_ID_INTERNAL"; - case 99: + case 98: return "SPACE_ID_STANDARD_OPCODES"; - case 100: + case 99: return "JMP_CONDITION_RES_1"; - case 101: + case 100: return "JMP_CONDITION_RES_2"; - case 103: + case 102: return "MOV_SAME_VALUE_A"; - case 104: + case 103: return "MOV_SAME_VALUE_B"; - case 105: + case 104: return "MOV_MAIN_SAME_TAG"; - case 109: + case 108: return "L2GASLEFT"; - case 110: + case 109: return "DAGASLEFT"; - case 112: + case 111: return "BIN_SEL_1"; - case 113: + case 112: return "BIN_SEL_2"; } return std::to_string(index); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_end_gas.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_end_gas.hpp deleted file mode 100644 index fadf779290b..00000000000 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_end_gas.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// AUTOGENERATED FILE -#pragma once - -#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" - -#include -#include - -namespace bb { - -class perm_da_end_gas_permutation_settings { - public: - // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 1; - - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) - { - return (in.main_sel_execution_end == 1 || in.main_sel_da_end_gas_kernel_input == 1); - } - - template static inline auto get_const_entities(const AllEntities& in) - { - return std::forward_as_tuple(in.perm_da_end_gas_inv, - in.main_sel_execution_end, - in.main_sel_execution_end, - in.main_sel_da_end_gas_kernel_input, - in.main_da_gas_remaining, - in.main_kernel_inputs); - } - - template static inline auto get_nonconst_entities(AllEntities& in) - { - return std::forward_as_tuple(in.perm_da_end_gas_inv, - in.main_sel_execution_end, - in.main_sel_execution_end, - in.main_sel_da_end_gas_kernel_input, - in.main_da_gas_remaining, - in.main_kernel_inputs); - } -}; - -template -class perm_da_end_gas_relation : public GenericPermutationRelation { - public: - static constexpr const char* NAME = "PERM_DA_END_GAS"; -}; -template using perm_da_end_gas = GenericPermutation; - -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_start_gas.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_start_gas.hpp deleted file mode 100644 index 30d86ff4966..00000000000 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_da_start_gas.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// AUTOGENERATED FILE -#pragma once - -#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" - -#include -#include - -namespace bb { - -class perm_da_start_gas_permutation_settings { - public: - // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 1; - - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) - { - return (in.main_sel_start_exec == 1 || in.main_sel_da_start_gas_kernel_input == 1); - } - - template static inline auto get_const_entities(const AllEntities& in) - { - return std::forward_as_tuple(in.perm_da_start_gas_inv, - in.main_sel_start_exec, - in.main_sel_start_exec, - in.main_sel_da_start_gas_kernel_input, - in.main_da_gas_remaining, - in.main_kernel_inputs); - } - - template static inline auto get_nonconst_entities(AllEntities& in) - { - return std::forward_as_tuple(in.perm_da_start_gas_inv, - in.main_sel_start_exec, - in.main_sel_start_exec, - in.main_sel_da_start_gas_kernel_input, - in.main_da_gas_remaining, - in.main_kernel_inputs); - } -}; - -template -class perm_da_start_gas_relation : public GenericPermutationRelation { - public: - static constexpr const char* NAME = "PERM_DA_START_GAS"; -}; -template using perm_da_start_gas = GenericPermutation; - -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_end_gas.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_end_gas.hpp deleted file mode 100644 index 6fff50ff54a..00000000000 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_end_gas.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// AUTOGENERATED FILE -#pragma once - -#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" - -#include -#include - -namespace bb { - -class perm_l2_end_gas_permutation_settings { - public: - // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 1; - - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) - { - return (in.main_sel_execution_end == 1 || in.main_sel_l2_end_gas_kernel_input == 1); - } - - template static inline auto get_const_entities(const AllEntities& in) - { - return std::forward_as_tuple(in.perm_l2_end_gas_inv, - in.main_sel_execution_end, - in.main_sel_execution_end, - in.main_sel_l2_end_gas_kernel_input, - in.main_l2_gas_remaining, - in.main_kernel_inputs); - } - - template static inline auto get_nonconst_entities(AllEntities& in) - { - return std::forward_as_tuple(in.perm_l2_end_gas_inv, - in.main_sel_execution_end, - in.main_sel_execution_end, - in.main_sel_l2_end_gas_kernel_input, - in.main_l2_gas_remaining, - in.main_kernel_inputs); - } -}; - -template -class perm_l2_end_gas_relation : public GenericPermutationRelation { - public: - static constexpr const char* NAME = "PERM_L2_END_GAS"; -}; -template using perm_l2_end_gas = GenericPermutation; - -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_start_gas.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_start_gas.hpp deleted file mode 100644 index 40d64f343c3..00000000000 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/perm_l2_start_gas.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// AUTOGENERATED FILE -#pragma once - -#include "barretenberg/relations/generic_permutation/generic_permutation_relation.hpp" - -#include -#include - -namespace bb { - -class perm_l2_start_gas_permutation_settings { - public: - // This constant defines how many columns are bundled together to form each set. - constexpr static size_t COLUMNS_PER_SET = 1; - - template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) - { - return (in.main_sel_start_exec == 1 || in.main_sel_l2_start_gas_kernel_input == 1); - } - - template static inline auto get_const_entities(const AllEntities& in) - { - return std::forward_as_tuple(in.perm_l2_start_gas_inv, - in.main_sel_start_exec, - in.main_sel_start_exec, - in.main_sel_l2_start_gas_kernel_input, - in.main_l2_gas_remaining, - in.main_kernel_inputs); - } - - template static inline auto get_nonconst_entities(AllEntities& in) - { - return std::forward_as_tuple(in.perm_l2_start_gas_inv, - in.main_sel_start_exec, - in.main_sel_start_exec, - in.main_sel_l2_start_gas_kernel_input, - in.main_l2_gas_remaining, - in.main_kernel_inputs); - } -}; - -template -class perm_l2_start_gas_relation : public GenericPermutationRelation { - public: - static constexpr const char* NAME = "PERM_L2_START_GAS"; -}; -template using perm_l2_start_gas = GenericPermutation; - -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp index 6ec1a943406..5280e49e616 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp @@ -41,12 +41,9 @@ class AvmRecursiveTests : public ::testing::Test { static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } - VmPublicInputsNT public_inputs; - // Generate an extremely simple avm trace - AvmCircuitBuilder generate_avm_circuit() + static AvmCircuitBuilder generate_avm_circuit(VmPublicInputsNT public_inputs) { - public_inputs = generate_base_public_inputs(); AvmTraceBuilder trace_builder(public_inputs); AvmCircuitBuilder builder; @@ -56,8 +53,6 @@ class AvmRecursiveTests : public ::testing::Test { trace_builder.op_return(0, 0, 0); auto trace = trace_builder.finalize(); // Passing true enables a longer trace with lookups - inject_end_gas_values(public_inputs, trace); - builder.set_trace(std::move(trace)); builder.check_circuit(); vinfo("inner builder - num gates: ", builder.get_num_gates()); @@ -68,7 +63,8 @@ class AvmRecursiveTests : public ::testing::Test { TEST_F(AvmRecursiveTests, recursion) { - AvmCircuitBuilder circuit_builder = generate_avm_circuit(); + const auto public_inputs = generate_base_public_inputs(); + AvmCircuitBuilder circuit_builder = generate_avm_circuit(public_inputs); AvmComposer composer = AvmComposer(); InnerProver prover = composer.create_prover(circuit_builder); InnerVerifier verifier = composer.create_verifier(circuit_builder); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp index 9e43b804768..68e8681d3fe 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -12,7 +12,6 @@ #include "barretenberg/vm/avm/trace/fixed_gas.hpp" #include "barretenberg/vm/avm/trace/kernel_trace.hpp" #include "barretenberg/vm/avm/trace/opcode.hpp" -#include "barretenberg/vm/constants.hpp" #include "common.test.hpp" #include "barretenberg/vm/aztec_constants.hpp" @@ -1400,53 +1399,53 @@ TEST_F(AvmExecutionTests, pedersenCommitmentOpcode) TEST_F(AvmExecutionTests, kernelInputOpcodes) { std::string bytecode_hex = - to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + to_hex(OpCode::GETENVVAR_16) + // opcode ADDRESS "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::ADDRESS)) + // envvar ADDRESS "0001" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode STORAGEADDRESS "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::STORAGEADDRESS)) + // envvar STORAGEADDRESS "0002" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode SENDER "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::SENDER)) + // envvar SENDER "0003" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode FUNCTIONSELECTOR "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::FUNCTIONSELECTOR)) + // envvar FUNCTIONSELECTOR "0004" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode TRANSACTIONFEE "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::TRANSACTIONFEE)) + // envvar TRANSACTIONFEE "0005" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode CHAINID "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::CHAINID)) + // envvar CHAINID "0006" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode VERSION "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::VERSION)) + // envvar VERSION "0007" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode BLOCKNUMBER "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::BLOCKNUMBER)) + // envvar BLOCKNUMBER "0008" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode TIMESTAMP "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::TIMESTAMP)) + // envvar TIMESTAMP "0009" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode FEEPERL2GAS "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::FEEPERL2GAS)) + // envvar FEEPERL2GAS "000A" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode FEEPERDAGAS "00" // Indirect flag + to_hex(static_cast(EnvironmentVariable::FEEPERDAGAS)) + // envvar FEEPERDAGAS "000B" // dst_offset - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + + to_hex(OpCode::GETENVVAR_16) + // opcode FEEPERDAGAS "00" // Indirect flag - + to_hex(static_cast(EnvironmentVariable::ISSTATICCALL)) + // envvar ISSTATICCALL + + to_hex(static_cast(EnvironmentVariable::ISSTATICCALL)) + // envvar FEEPERDAGAS "000C" // dst_offset + to_hex(OpCode::RETURN) + // opcode RETURN "00" // Indirect flag @@ -1584,21 +1583,21 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes) // TODO: maybe have a javascript like object construction so that this is readable // Reduce the amount of times we have similar code to this // - public_inputs_vec[STORAGE_ADDRESS_PCPI_OFFSET] = address; - public_inputs_vec[STORAGE_ADDRESS_PCPI_OFFSET] = storage_address; - public_inputs_vec[SENDER_PCPI_OFFSET] = sender; - public_inputs_vec[FUNCTION_SELECTOR_PCPI_OFFSET] = function_selector; - public_inputs_vec[TRANSACTION_FEE_PCPI_OFFSET] = transaction_fee; - public_inputs_vec[IS_STATIC_CALL_PCPI_OFFSET] = is_static_call; + public_inputs_vec[ADDRESS_SELECTOR] = address; + public_inputs_vec[STORAGE_ADDRESS_SELECTOR] = storage_address; + public_inputs_vec[SENDER_SELECTOR] = sender; + public_inputs_vec[FUNCTION_SELECTOR_SELECTOR] = function_selector; + public_inputs_vec[TRANSACTION_FEE_OFFSET] = transaction_fee; + public_inputs_vec[IS_STATIC_CALL_SELECTOR] = is_static_call; // Global variables - public_inputs_vec[CHAIN_ID_PCPI_OFFSET] = chainid; - public_inputs_vec[VERSION_PCPI_OFFSET] = version; - public_inputs_vec[BLOCK_NUMBER_PCPI_OFFSET] = blocknumber; - public_inputs_vec[TIMESTAMP_PCPI_OFFSET] = timestamp; + public_inputs_vec[CHAIN_ID_OFFSET] = chainid; + public_inputs_vec[VERSION_OFFSET] = version; + public_inputs_vec[BLOCK_NUMBER_OFFSET] = blocknumber; + public_inputs_vec[TIMESTAMP_OFFSET] = timestamp; // Global variables - Gas - public_inputs_vec[FEE_PER_DA_GAS_PCPI_OFFSET] = feeperdagas; - public_inputs_vec[FEE_PER_L2_GAS_PCPI_OFFSET] = feeperl2gas; + public_inputs_vec[FEE_PER_DA_GAS_OFFSET] = feeperdagas; + public_inputs_vec[FEE_PER_L2_GAS_OFFSET] = feeperl2gas; std::vector returndata; auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp index 9d8482dc417..c88bc8683fd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp @@ -33,8 +33,8 @@ void test_gas(StartGas startGas, OpcodesFunc apply_opcodes, CheckFunc check_trac { std::array kernel_inputs = {}; - kernel_inputs[L2_START_GAS_KERNEL_INPUTS_COL_OFFSET] = FF(startGas.l2_gas); - kernel_inputs[DA_START_GAS_KERNEL_INPUTS_COL_OFFSET] = FF(startGas.da_gas); + kernel_inputs[L2_GAS_LEFT_CONTEXT_INPUTS_OFFSET] = FF(startGas.l2_gas); + kernel_inputs[DA_GAS_LEFT_CONTEXT_INPUTS_OFFSET] = FF(startGas.da_gas); VmPublicInputsNT public_inputs; std::get<0>(public_inputs) = kernel_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp index 112f51fc577..a1c7317d47d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/helpers.test.cpp @@ -52,13 +52,6 @@ void validate_trace(std::vector&& trace, avm_trace::dump_trace_as_csv(trace, avm_dump_trace_path); } - // Inject computed end gas values in the public inputs - // This is ok because validate_trace is only used in cpp tests. - // TS integration tests will provide the correct end gas values in the public inputs and - // this will be validated. - auto public_inputs_with_end_gas = public_inputs; - avm_trace::inject_end_gas_values(public_inputs_with_end_gas, trace); - auto circuit_builder = AvmCircuitBuilder(); circuit_builder.set_trace(std::move(trace)); EXPECT_TRUE(circuit_builder.check_circuit()); @@ -71,7 +64,7 @@ void validate_trace(std::vector&& trace, AvmVerifier verifier = composer.create_verifier(circuit_builder); std::vector> public_inputs_as_vec = - bb::avm_trace::copy_public_inputs_columns(public_inputs_with_end_gas, calldata, returndata); + bb::avm_trace::copy_public_inputs_columns(public_inputs, calldata, returndata); bool verified = verifier.verify_proof(proof, { public_inputs_as_vec }); @@ -129,8 +122,8 @@ VmPublicInputsNT generate_base_public_inputs() { VmPublicInputsNT public_inputs; std::array kernel_inputs{}; - kernel_inputs.at(DA_START_GAS_KERNEL_INPUTS_COL_OFFSET) = DEFAULT_INITIAL_DA_GAS; - kernel_inputs.at(L2_START_GAS_KERNEL_INPUTS_COL_OFFSET) = DEFAULT_INITIAL_L2_GAS; + kernel_inputs.at(DA_GAS_LEFT_CONTEXT_INPUTS_OFFSET) = DEFAULT_INITIAL_DA_GAS; + kernel_inputs.at(L2_GAS_LEFT_CONTEXT_INPUTS_OFFSET) = DEFAULT_INITIAL_L2_GAS; std::get<0>(public_inputs) = kernel_inputs; return public_inputs; } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp index da5841ddcff..1ef1d921c3d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp @@ -40,8 +40,8 @@ VmPublicInputsNT get_base_public_inputs() } // Set high initial gas - kernel_inputs[L2_START_GAS_KERNEL_INPUTS_COL_OFFSET] = INITIAL_GAS; - kernel_inputs[DA_START_GAS_KERNEL_INPUTS_COL_OFFSET] = INITIAL_GAS; + kernel_inputs[L2_GAS_LEFT_CONTEXT_INPUTS_OFFSET] = INITIAL_GAS; + kernel_inputs[DA_GAS_LEFT_CONTEXT_INPUTS_OFFSET] = INITIAL_GAS; // Copy the kernel inputs into the public inputs object std::get(public_inputs) = kernel_inputs; @@ -210,8 +210,8 @@ TEST_F(AvmKernelPositiveTests, kernelSender) EXPECT_TRUE(row != trace.end()); expect_row(row, - /*kernel_in_offset=*/SENDER_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/SENDER_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/SENDER_SELECTOR, + /*ia=*/SENDER_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -244,8 +244,8 @@ TEST_F(AvmKernelPositiveTests, kernelAddress) EXPECT_TRUE(address_row != trace.end()); expect_row(address_row, - /*kernel_in_offset=*/ADDRESS_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/ADDRESS_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/ADDRESS_SELECTOR, + /*ia=*/ADDRESS_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -277,8 +277,8 @@ TEST_F(AvmKernelPositiveTests, kernelStorageAddress) EXPECT_TRUE(storage_address_row != trace.end()); expect_row(storage_address_row, - /*kernel_in_offset=*/STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/STORAGE_ADDRESS_SELECTOR, + /*ia=*/STORAGE_ADDRESS_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -313,8 +313,8 @@ TEST_F(AvmKernelPositiveTests, kernelFunctionSelector) EXPECT_TRUE(row != trace.end()); expect_row(row, - /*kernel_in_offset=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/FUNCTION_SELECTOR_SELECTOR, + /*ia=*/FUNCTION_SELECTOR_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -347,8 +347,8 @@ TEST_F(AvmKernelPositiveTests, kernelFeePerDa) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/FEE_PER_DA_GAS_SELECTOR, + /*ia=*/FEE_PER_DA_GAS_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -381,8 +381,8 @@ TEST_F(AvmKernelPositiveTests, kernelFeePerL2) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/FEE_PER_L2_GAS_SELECTOR, + /*ia=*/FEE_PER_L2_GAS_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -415,8 +415,8 @@ TEST_F(AvmKernelPositiveTests, kernelTransactionFee) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/TRANSACTION_FEE_SELECTOR, + /*ia=*/TRANSACTION_FEE_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -449,8 +449,8 @@ TEST_F(AvmKernelPositiveTests, kernelIsStaticCall) EXPECT_TRUE(row != trace.end()); expect_row(row, - /*kernel_in_offset=*/IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/IS_STATIC_CALL_SELECTOR, + /*ia=*/IS_STATIC_CALL_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -483,8 +483,8 @@ TEST_F(AvmKernelPositiveTests, kernelChainId) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/CHAIN_ID_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/CHAIN_ID_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/CHAIN_ID_SELECTOR, + /*ia=*/CHAIN_ID_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -517,8 +517,8 @@ TEST_F(AvmKernelPositiveTests, kernelVersion) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/VERSION_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/VERSION_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/VERSION_SELECTOR, + /*ia=*/VERSION_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -551,8 +551,8 @@ TEST_F(AvmKernelPositiveTests, kernelBlockNumber) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/BLOCK_NUMBER_SELECTOR, + /*ia=*/BLOCK_NUMBER_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a=*/dst_offset, @@ -585,8 +585,8 @@ TEST_F(AvmKernelPositiveTests, kernelTimestamp) EXPECT_TRUE(fee_row != trace.end()); expect_row(fee_row, - /*kernel_in_offset=*/TIMESTAMP_KERNEL_INPUTS_COL_OFFSET, - /*ia=*/TIMESTAMP_KERNEL_INPUTS_COL_OFFSET + + /*kernel_in_offset=*/TIMESTAMP_SELECTOR, + /*ia=*/TIMESTAMP_SELECTOR + 1, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect ? indirect_dst_offset : 0, /*mem_addr_a*/ dst_offset, @@ -646,7 +646,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaSender) expect_row( row, - /*kernel_in_offset=*/SENDER_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/SENDER_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -670,7 +670,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaAddress) expect_row( row, - /*kernel_in_offset=*/ADDRESS_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/ADDRESS_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -696,7 +696,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaStorageAddress) expect_row( row, - /*kernel_in_offset=*/STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/STORAGE_ADDRESS_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -722,7 +722,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaFunctionSelector) expect_row( row, - /*kernel_in_offset=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/FUNCTION_SELECTOR_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -748,7 +748,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaDaGas) expect_row( row, - /*kernel_in_offset=*/FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/FEE_PER_DA_GAS_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -774,7 +774,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIal2Gas) expect_row( row, - /*kernel_in_offset=*/FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/FEE_PER_L2_GAS_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -800,7 +800,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaTransactionFee) expect_row( row, - /*kernel_in_offset=*/TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/TRANSACTION_FEE_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -824,7 +824,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaChainId) expect_row( row, - /*kernel_in_offset=*/CHAIN_ID_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/CHAIN_ID_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -848,7 +848,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaVersion) expect_row( row, - /*kernel_in_offset=*/VERSION_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/VERSION_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -874,7 +874,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaBlockNumber) expect_row( row, - /*kernel_in_offset=*/BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/BLOCK_NUMBER_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a=*/dst_offset, @@ -900,7 +900,7 @@ TEST_F(AvmKernelNegativeTests, incorrectIaTimestamp) expect_row( row, - /*kernel_in_offset=*/TIMESTAMP_KERNEL_INPUTS_COL_OFFSET, + /*kernel_in_offset=*/TIMESTAMP_SELECTOR, /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + 1 /*ind_a*/ indirect, /*mem_addr_a*/ dst_offset, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp index 9b64c0c1965..0950d3cfe09 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp @@ -293,7 +293,7 @@ std::vector Execution::gen_trace(std::vector const& instructio // should be done in the kernel - this is stubbed and underconstrained VmPublicInputs public_inputs = convert_public_inputs(public_inputs_vec); uint32_t start_side_effect_counter = - !public_inputs_vec.empty() ? static_cast(public_inputs_vec[START_SIDE_EFFECT_COUNTER_PCPI_OFFSET]) + !public_inputs_vec.empty() ? static_cast(public_inputs_vec[PCPI_START_SIDE_EFFECT_COUNTER_OFFSET]) : 0; AvmTraceBuilder trace_builder = diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.cpp index 3adea143890..fb4f575a4d6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.cpp @@ -75,29 +75,4 @@ std::string to_hex(bb::avm_trace::AvmMemoryTag tag) return to_hex(static_cast(tag)); } -/** - * - * ONLY FOR TESTS - Required by dsl module and therefore cannot be moved to test/helpers.test.cpp - * - * @brief Helper routine which injects the end gas values in public inputs and in the public column - * of kernel inputs in the trace. - * - * @param public_inputs Public inputs structure - * @param trace The execution trace - */ -void inject_end_gas_values(VmPublicInputs& public_inputs, std::vector& trace) -{ - auto execution_end_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_execution_end == FF(1); }); - ASSERT(execution_end_row != trace.end()); - - trace.at(L2_END_GAS_KERNEL_INPUTS_COL_OFFSET).main_kernel_inputs = execution_end_row->main_l2_gas_remaining; - trace.at(DA_END_GAS_KERNEL_INPUTS_COL_OFFSET).main_kernel_inputs = execution_end_row->main_da_gas_remaining; - - std::get(public_inputs).at(L2_END_GAS_KERNEL_INPUTS_COL_OFFSET) = - execution_end_row->main_l2_gas_remaining; - std::get(public_inputs).at(DA_END_GAS_KERNEL_INPUTS_COL_OFFSET) = - execution_end_row->main_da_gas_remaining; -} - } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp index 946feea07c1..3b64afe1488 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp @@ -4,10 +4,10 @@ #include "barretenberg/vm/avm/trace/common.hpp" #include "barretenberg/vm/avm/trace/trace.hpp" -#include "barretenberg/vm/constants.hpp" namespace bb::avm_trace { +void log_avm_trace(std::vector const& trace, size_t beg, size_t end, bool enable_selectors = false); void dump_trace_as_csv(const std::vector& trace, const std::filesystem::path& filename); bool is_operand_indirect(uint8_t ind_value, uint8_t operand_idx); @@ -41,30 +41,27 @@ template VmPublicInputs convert_public_inputs(std::vector& ko_values = std::get(public_inputs); @@ -76,7 +73,7 @@ template VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector VmPublicInputs convert_public_inputs(std::vector& public_inputs, std::vector& trace); - } // namespace bb::avm_trace diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/kernel_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/kernel_trace.cpp index 39fc0698f1b..26e2a9a27b4 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/kernel_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/kernel_trace.cpp @@ -52,7 +52,7 @@ FF AvmKernelTraceBuilder::op_address(uint32_t clk) .operation = KernelTraceOpType::ADDRESS, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(ADDRESS_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(ADDRESS_SELECTOR); } FF AvmKernelTraceBuilder::op_storage_address(uint32_t clk) @@ -62,7 +62,7 @@ FF AvmKernelTraceBuilder::op_storage_address(uint32_t clk) .operation = KernelTraceOpType::STORAGE_ADDRESS, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(STORAGE_ADDRESS_SELECTOR); } FF AvmKernelTraceBuilder::op_sender(uint32_t clk) @@ -72,7 +72,7 @@ FF AvmKernelTraceBuilder::op_sender(uint32_t clk) .operation = KernelTraceOpType::SENDER, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(SENDER_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(SENDER_SELECTOR); } FF AvmKernelTraceBuilder::op_function_selector(uint32_t clk) @@ -82,7 +82,7 @@ FF AvmKernelTraceBuilder::op_function_selector(uint32_t clk) .operation = KernelTraceOpType::FUNCTION_SELECTOR, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(FUNCTION_SELECTOR_SELECTOR); } FF AvmKernelTraceBuilder::op_transaction_fee(uint32_t clk) @@ -92,7 +92,7 @@ FF AvmKernelTraceBuilder::op_transaction_fee(uint32_t clk) .operation = KernelTraceOpType::TRANSACTION_FEE, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(TRANSACTION_FEE_SELECTOR); } FF AvmKernelTraceBuilder::op_chain_id(uint32_t clk) @@ -102,7 +102,7 @@ FF AvmKernelTraceBuilder::op_chain_id(uint32_t clk) .operation = KernelTraceOpType::CHAIN_ID, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(CHAIN_ID_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(CHAIN_ID_SELECTOR); } FF AvmKernelTraceBuilder::op_version(uint32_t clk) @@ -112,7 +112,7 @@ FF AvmKernelTraceBuilder::op_version(uint32_t clk) .operation = KernelTraceOpType::VERSION, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(VERSION_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(VERSION_SELECTOR); } FF AvmKernelTraceBuilder::op_block_number(uint32_t clk) @@ -122,7 +122,7 @@ FF AvmKernelTraceBuilder::op_block_number(uint32_t clk) .operation = KernelTraceOpType::BLOCK_NUMBER, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(BLOCK_NUMBER_SELECTOR); } FF AvmKernelTraceBuilder::op_timestamp(uint32_t clk) @@ -132,7 +132,7 @@ FF AvmKernelTraceBuilder::op_timestamp(uint32_t clk) .operation = KernelTraceOpType::TIMESTAMP, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(TIMESTAMP_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(TIMESTAMP_SELECTOR); } FF AvmKernelTraceBuilder::op_fee_per_da_gas(uint32_t clk) @@ -142,7 +142,7 @@ FF AvmKernelTraceBuilder::op_fee_per_da_gas(uint32_t clk) .operation = KernelTraceOpType::FEE_PER_DA_GAS, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(FEE_PER_DA_GAS_SELECTOR); } FF AvmKernelTraceBuilder::op_fee_per_l2_gas(uint32_t clk) @@ -152,7 +152,7 @@ FF AvmKernelTraceBuilder::op_fee_per_l2_gas(uint32_t clk) .operation = KernelTraceOpType::FEE_PER_L2_GAS, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(FEE_PER_L2_GAS_SELECTOR); } FF AvmKernelTraceBuilder::op_is_static_call(uint32_t clk) @@ -162,7 +162,7 @@ FF AvmKernelTraceBuilder::op_is_static_call(uint32_t clk) .operation = KernelTraceOpType::IS_STATIC_CALL, }; kernel_trace.push_back(entry); - return perform_kernel_input_lookup(IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET); + return perform_kernel_input_lookup(IS_STATIC_CALL_SELECTOR); } // TODO(https://github.com/AztecProtocol/aztec-packages/issues/6481): need to process hint from avm in order to know if @@ -366,51 +366,51 @@ void AvmKernelTraceBuilder::finalize(std::vector>& main_trace) switch (src.operation) { // IN case KernelTraceOpType::ADDRESS: - dest.main_kernel_in_offset = ADDRESS_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = ADDRESS_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::STORAGE_ADDRESS: - dest.main_kernel_in_offset = STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = STORAGE_ADDRESS_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::SENDER: - dest.main_kernel_in_offset = SENDER_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = SENDER_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::FUNCTION_SELECTOR: - dest.main_kernel_in_offset = FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = FUNCTION_SELECTOR_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::TRANSACTION_FEE: - dest.main_kernel_in_offset = TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = TRANSACTION_FEE_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::CHAIN_ID: - dest.main_kernel_in_offset = CHAIN_ID_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = CHAIN_ID_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::VERSION: - dest.main_kernel_in_offset = VERSION_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = VERSION_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::BLOCK_NUMBER: - dest.main_kernel_in_offset = BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = BLOCK_NUMBER_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::TIMESTAMP: - dest.main_kernel_in_offset = TIMESTAMP_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = TIMESTAMP_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::FEE_PER_DA_GAS: - dest.main_kernel_in_offset = FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = FEE_PER_DA_GAS_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::FEE_PER_L2_GAS: - dest.main_kernel_in_offset = FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = FEE_PER_L2_GAS_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; case KernelTraceOpType::IS_STATIC_CALL: - dest.main_kernel_in_offset = IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET; + dest.main_kernel_in_offset = IS_STATIC_CALL_SELECTOR; dest.main_sel_q_kernel_lookup = 1; break; // OUT @@ -510,12 +510,6 @@ void AvmKernelTraceBuilder::finalize_columns(std::vector>& main_t dest.main_sel_kernel_out = FF(1); } - // Kernel inputs gas selectors - main_trace.at(DA_START_GAS_KERNEL_INPUTS_COL_OFFSET).main_sel_da_start_gas_kernel_input = FF(1); - main_trace.at(L2_START_GAS_KERNEL_INPUTS_COL_OFFSET).main_sel_l2_start_gas_kernel_input = FF(1); - main_trace.at(DA_END_GAS_KERNEL_INPUTS_COL_OFFSET).main_sel_da_end_gas_kernel_input = FF(1); - main_trace.at(L2_END_GAS_KERNEL_INPUTS_COL_OFFSET).main_sel_l2_end_gas_kernel_input = FF(1); - // Write lookup counts for inputs for (auto const& [selector, count] : kernel_input_selector_counter) { main_trace.at(selector).lookup_into_kernel_counts = FF(count); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp index f7f518c112b..1c27f3b8181 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp @@ -288,8 +288,8 @@ AvmTraceBuilder::AvmTraceBuilder(VmPublicInputs public_inputs, { // TODO: think about cast gas_trace_builder.set_initial_gas( - static_cast(std::get(public_inputs)[L2_START_GAS_KERNEL_INPUTS_COL_OFFSET]), - static_cast(std::get(public_inputs)[DA_START_GAS_KERNEL_INPUTS_COL_OFFSET])); + static_cast(std::get(public_inputs)[L2_GAS_LEFT_CONTEXT_INPUTS_OFFSET]), + static_cast(std::get(public_inputs)[DA_GAS_LEFT_CONTEXT_INPUTS_OFFSET])); } /************************************************************************************************** @@ -2459,7 +2459,7 @@ void AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, auto [resolved_log_offset, resolved_log_size_offset] = unpack_indirects<2>(indirect, { log_offset, log_size_offset }); - FF contract_address = std::get<0>(kernel_trace_builder.public_inputs)[ADDRESS_KERNEL_INPUTS_COL_OFFSET]; + FF contract_address = std::get<0>(kernel_trace_builder.public_inputs)[ADDRESS_SELECTOR]; std::vector contract_address_bytes = contract_address.to_buffer(); // Unencrypted logs are hashed with sha256 and truncated to 31 bytes - and then padded back to 32 bytes @@ -3528,13 +3528,8 @@ std::vector AvmTraceBuilder::finalize() for (size_t i = 0; i < main_trace_size; i++) { main_trace[i].main_sel_execution_row = FF(1); } - - // Append row with selector toggling execution end. - const Row end_exec_row = Row{ .main_sel_execution_end = FF(1) }; - main_trace.emplace_back(end_exec_row); - - // Set selector for toggling execution start (we have the guarantee that at least one row exists in main_trace) - main_trace[0].main_sel_start_exec = FF(1); + // This selector corresponds to the last row of the EXECUTION trace. + main_trace.back().main_sel_last = FF(1); // We only need to pad with zeroes to the size to the largest trace here, // pow_2 padding is handled in the subgroup_size check in BB. @@ -3659,6 +3654,7 @@ std::vector AvmTraceBuilder::finalize() **********************************************************************************************/ // Finalize cmp gadget of the ALU trace auto cmp_trace_size = alu_trace_builder.cmp_builder.get_cmp_trace_size(); + // HERE IS THE SEG FAULT BUG if (main_trace_size < cmp_trace_size) { main_trace_size = cmp_trace_size; main_trace.resize(cmp_trace_size, {}); @@ -3766,7 +3762,8 @@ std::vector AvmTraceBuilder::finalize() * ONLY FIXED TABLES FROM HERE ON **********************************************************************************************/ - main_trace.insert(main_trace.begin(), Row{ .main_sel_first = FF(1), .mem_lastAccess = FF(1) }); + Row first_row = Row{ .main_sel_first = FF(1), .mem_lastAccess = FF(1) }; + main_trace.insert(main_trace.begin(), first_row); /********************************************************************************************** * BYTES TRACE INCLUSION diff --git a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp index 29d9f4e8f19..0a934bb88af 100644 --- a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp @@ -41,8 +41,8 @@ #define HEADER_LENGTH 24 #define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 691 #define PUBLIC_CONTEXT_INPUTS_LENGTH 42 -#define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 86 -#define AVM_PROOF_LENGTH_IN_FIELDS 3848 +#define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 66 +#define AVM_PROOF_LENGTH_IN_FIELDS 3822 #define AVM_PUBLIC_COLUMN_MAX_SIZE 1024 #define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2739 #define MEM_TAG_U1 1 @@ -52,22 +52,21 @@ #define MEM_TAG_U64 5 #define MEM_TAG_U128 6 #define MEM_TAG_FF 7 -#define SENDER_KERNEL_INPUTS_COL_OFFSET 0 -#define ADDRESS_KERNEL_INPUTS_COL_OFFSET 1 -#define STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET 1 -#define FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET 2 -#define IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET 3 -#define CHAIN_ID_KERNEL_INPUTS_COL_OFFSET 4 -#define VERSION_KERNEL_INPUTS_COL_OFFSET 5 -#define BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET 6 -#define TIMESTAMP_KERNEL_INPUTS_COL_OFFSET 7 -#define FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET 8 -#define FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET 9 -#define DA_START_GAS_KERNEL_INPUTS_COL_OFFSET 10 -#define L2_START_GAS_KERNEL_INPUTS_COL_OFFSET 11 -#define DA_END_GAS_KERNEL_INPUTS_COL_OFFSET 12 -#define L2_END_GAS_KERNEL_INPUTS_COL_OFFSET 13 -#define TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET 14 +#define SENDER_SELECTOR 0 +#define ADDRESS_SELECTOR 1 +#define STORAGE_ADDRESS_SELECTOR 1 +#define FUNCTION_SELECTOR_SELECTOR 2 +#define IS_STATIC_CALL_SELECTOR 4 +#define START_GLOBAL_VARIABLES 29 +#define CHAIN_ID_SELECTOR 29 +#define VERSION_SELECTOR 30 +#define BLOCK_NUMBER_SELECTOR 31 +#define TIMESTAMP_SELECTOR 33 +#define FEE_PER_DA_GAS_SELECTOR 36 +#define FEE_PER_L2_GAS_SELECTOR 37 +#define END_GLOBAL_VARIABLES 38 +#define START_SIDE_EFFECT_COUNTER 38 +#define TRANSACTION_FEE_SELECTOR 41 #define START_NOTE_HASH_EXISTS_WRITE_OFFSET 0 #define START_NULLIFIER_EXISTS_OFFSET 16 #define START_NULLIFIER_NON_EXISTS_OFFSET 32 diff --git a/barretenberg/cpp/src/barretenberg/vm/constants.hpp b/barretenberg/cpp/src/barretenberg/vm/constants.hpp index ddfffef9e78..d8ee8a30dd8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/constants.hpp @@ -5,8 +5,10 @@ #include #include -// Keep it aligned with the XXX__KERNEL_INPUTS_COL_OFFSET constants defined in constants.nr -inline const std::size_t KERNEL_INPUTS_LENGTH = 15; +// NOTE(MD): for now we will only include the public inputs that are included in call_context +// With more being added in subsequent prs +// KERNEL_INPUTS_LENGTH = CALL_CONTEXT_LENGTH +inline const std::size_t KERNEL_INPUTS_LENGTH = PUBLIC_CONTEXT_INPUTS_LENGTH; inline const std::size_t KERNEL_OUTPUTS_LENGTH = MAX_NOTE_HASH_READ_REQUESTS_PER_CALL + MAX_NULLIFIER_READ_REQUESTS_PER_CALL + @@ -25,69 +27,66 @@ static_assert(KERNEL_OUTPUTS_LENGTH < AVM_PUBLIC_COLUMN_MAX_SIZE, // START INDEXES in the PUBLIC_CIRCUIT_PUBLIC_INPUTS // These line up with indexes found in // https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts -inline const uint32_t SENDER_PCPI_OFFSET = 0; -inline const uint32_t STORAGE_ADDRESS_PCPI_OFFSET = 1; -inline const uint32_t FUNCTION_SELECTOR_PCPI_OFFSET = 2; -inline const uint32_t IS_STATIC_CALL_PCPI_OFFSET = 4; - inline const uint32_t PCPI_GLOBALS_START = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 7 - GLOBAL_VARIABLES_LENGTH; // Global Variables -inline const uint32_t CHAIN_ID_PCPI_OFFSET = PCPI_GLOBALS_START; -inline const uint32_t VERSION_PCPI_OFFSET = PCPI_GLOBALS_START + 1; -inline const uint32_t BLOCK_NUMBER_PCPI_OFFSET = PCPI_GLOBALS_START + 2; -inline const uint32_t TIMESTAMP_PCPI_OFFSET = PCPI_GLOBALS_START + 3; +inline const uint32_t CHAIN_ID_OFFSET = PCPI_GLOBALS_START; +inline const uint32_t VERSION_OFFSET = PCPI_GLOBALS_START + 1; +inline const uint32_t BLOCK_NUMBER_OFFSET = PCPI_GLOBALS_START + 2; +inline const uint32_t TIMESTAMP_OFFSET = PCPI_GLOBALS_START + 3; // Global Variables - fees -inline const uint32_t FEE_PER_DA_GAS_PCPI_OFFSET = PCPI_GLOBALS_START + 6; -inline const uint32_t FEE_PER_L2_GAS_PCPI_OFFSET = PCPI_GLOBALS_START + 7; +inline const uint32_t FEE_PER_DA_GAS_OFFSET = PCPI_GLOBALS_START + 6; +inline const uint32_t FEE_PER_L2_GAS_OFFSET = PCPI_GLOBALS_START + 7; // Top-level PublicCircuitPublicInputs members inline const uint32_t DA_START_GAS_LEFT_PCPI_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 3 - GAS_LENGTH; inline const uint32_t L2_START_GAS_LEFT_PCPI_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 2 - GAS_LENGTH; -inline const uint32_t DA_END_GAS_LEFT_PCPI_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 3; -inline const uint32_t L2_END_GAS_LEFT_PCPI_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 2; -inline const uint32_t TRANSACTION_FEE_PCPI_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 1; +inline const uint32_t TRANSACTION_FEE_OFFSET = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 1; // Kernel output pil offset (Where update objects are inlined) // Side Effects (offsets to vectors in PublicCircuitPublicInputs) -inline const uint32_t NOTE_HASH_EXISTS_PCPI_OFFSET = CALL_CONTEXT_LENGTH + 2; -inline const uint32_t NULLIFIER_EXISTS_PCPI_OFFSET = - NOTE_HASH_EXISTS_PCPI_OFFSET + (MAX_NOTE_HASH_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); +inline const uint32_t PCPI_NOTE_HASH_EXISTS_OFFSET = CALL_CONTEXT_LENGTH + 2; +inline const uint32_t PCPI_NULLIFIER_EXISTS_OFFSET = + PCPI_NOTE_HASH_EXISTS_OFFSET + (MAX_NOTE_HASH_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); -inline const uint32_t NULLIFIER_NON_EXISTS_PCPI_OFFSET = - NULLIFIER_EXISTS_PCPI_OFFSET + (MAX_NULLIFIER_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); +inline const uint32_t PCPI_NULLIFIER_NON_EXISTS_OFFSET = + PCPI_NULLIFIER_EXISTS_OFFSET + (MAX_NULLIFIER_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); -inline const uint32_t L1_TO_L2_MSG_READ_REQUESTS_PCPI_OFFSET = - NULLIFIER_NON_EXISTS_PCPI_OFFSET + (MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); +inline const uint32_t PCPI_L1_TO_L2_MSG_READ_REQUESTS_OFFSET = + PCPI_NULLIFIER_NON_EXISTS_OFFSET + (MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); -inline const uint32_t PUBLIC_DATA_UPDATE_PCPI_OFFSET = - L1_TO_L2_MSG_READ_REQUESTS_PCPI_OFFSET + (MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); +inline const uint32_t PCPI_PUBLIC_DATA_UPDATE_OFFSET = + PCPI_L1_TO_L2_MSG_READ_REQUESTS_OFFSET + (MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL * READ_REQUEST_LENGTH); -inline const uint32_t PUBLIC_DATA_READ_PCPI_OFFSET = - PUBLIC_DATA_UPDATE_PCPI_OFFSET + +inline const uint32_t PCPI_PUBLIC_DATA_READ_OFFSET = + PCPI_PUBLIC_DATA_UPDATE_OFFSET + (MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL * CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH); -inline const uint32_t PUBLIC_CALLSTACK_PCPI_OFFSET = - PUBLIC_DATA_READ_PCPI_OFFSET + (MAX_PUBLIC_DATA_READS_PER_CALL * CONTRACT_STORAGE_READ_LENGTH); +inline const uint32_t PCPI_PUBLIC_CALLSTACK_OFFSET = + PCPI_PUBLIC_DATA_READ_OFFSET + (MAX_PUBLIC_DATA_READS_PER_CALL * CONTRACT_STORAGE_READ_LENGTH); -inline const uint32_t NEW_NOTE_HASHES_PCPI_OFFSET = - PUBLIC_CALLSTACK_PCPI_OFFSET + (MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL * PUBLIC_INNER_CALL_REQUEST_LENGTH); +inline const uint32_t PCPI_NEW_NOTE_HASHES_OFFSET = + PCPI_PUBLIC_CALLSTACK_OFFSET + (MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL * PUBLIC_INNER_CALL_REQUEST_LENGTH); -inline const uint32_t NEW_NULLIFIERS_PCPI_OFFSET = - NEW_NOTE_HASHES_PCPI_OFFSET + (MAX_NOTE_HASHES_PER_CALL * NOTE_HASH_LENGTH); +inline const uint32_t PCPI_NEW_NULLIFIERS_OFFSET = + PCPI_NEW_NOTE_HASHES_OFFSET + (MAX_NOTE_HASHES_PER_CALL * NOTE_HASH_LENGTH); // TODO(md): Note legnth of nullifier is 3? - it includes the note it is nullifying too -inline const uint32_t NEW_L2_TO_L1_MSGS_PCPI_OFFSET = - NEW_NULLIFIERS_PCPI_OFFSET + (MAX_NULLIFIERS_PER_CALL * NULLIFIER_LENGTH); +inline const uint32_t PCPI_NEW_L2_TO_L1_MSGS_OFFSET = + PCPI_NEW_NULLIFIERS_OFFSET + (MAX_NULLIFIERS_PER_CALL * NULLIFIER_LENGTH); -inline const uint32_t START_SIDE_EFFECT_COUNTER_PCPI_OFFSET = - NEW_L2_TO_L1_MSGS_PCPI_OFFSET + (MAX_L2_TO_L1_MSGS_PER_CALL * L2_TO_L1_MESSAGE_LENGTH); +inline const uint32_t PCPI_START_SIDE_EFFECT_COUNTER_OFFSET = + PCPI_NEW_L2_TO_L1_MSGS_OFFSET + (MAX_L2_TO_L1_MSGS_PER_CALL * L2_TO_L1_MESSAGE_LENGTH); // The +2 here is because the order is // START_SIDE_EFFECT_COUNTER // END_SIDE_EFFECT_COUNTER -> + 1 // NEW_UNENCRYPTED_LOGS -> + 2 -inline const uint32_t NEW_UNENCRYPTED_LOGS_PCPI_OFFSET = START_SIDE_EFFECT_COUNTER_PCPI_OFFSET + 2; +inline const uint32_t PCPI_NEW_UNENCRYPTED_LOGS_OFFSET = PCPI_START_SIDE_EFFECT_COUNTER_OFFSET + 2; // END INDEXES in the PUBLIC_CIRCUIT_PUBLIC_INPUTS + +// L2 and Da gas left are the 3rd last and 2nd last items in the context kernel inputs respectively +inline const std::size_t DA_GAS_LEFT_CONTEXT_INPUTS_OFFSET = KERNEL_INPUTS_LENGTH - 3; +inline const std::size_t L2_GAS_LEFT_CONTEXT_INPUTS_OFFSET = KERNEL_INPUTS_LENGTH - 2; diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 4c153ea758d..7dd1da435a6 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -236,22 +236,24 @@ library Constants { uint256 internal constant MEM_TAG_U64 = 5; uint256 internal constant MEM_TAG_U128 = 6; uint256 internal constant MEM_TAG_FF = 7; - uint256 internal constant SENDER_KERNEL_INPUTS_COL_OFFSET = 0; - uint256 internal constant ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - uint256 internal constant STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - uint256 internal constant FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; - uint256 internal constant IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; - uint256 internal constant CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; - uint256 internal constant VERSION_KERNEL_INPUTS_COL_OFFSET = 5; - uint256 internal constant BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET = 6; - uint256 internal constant TIMESTAMP_KERNEL_INPUTS_COL_OFFSET = 7; - uint256 internal constant FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET = 8; - uint256 internal constant FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET = 9; - uint256 internal constant DA_START_GAS_KERNEL_INPUTS_COL_OFFSET = 10; - uint256 internal constant L2_START_GAS_KERNEL_INPUTS_COL_OFFSET = 11; - uint256 internal constant DA_END_GAS_KERNEL_INPUTS_COL_OFFSET = 12; - uint256 internal constant L2_END_GAS_KERNEL_INPUTS_COL_OFFSET = 13; - uint256 internal constant TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET = 14; + uint256 internal constant SENDER_SELECTOR = 0; + uint256 internal constant ADDRESS_SELECTOR = 1; + uint256 internal constant STORAGE_ADDRESS_SELECTOR = 1; + uint256 internal constant FUNCTION_SELECTOR_SELECTOR = 2; + uint256 internal constant IS_STATIC_CALL_SELECTOR = 4; + uint256 internal constant START_GLOBAL_VARIABLES = 29; + uint256 internal constant CHAIN_ID_SELECTOR = 29; + uint256 internal constant VERSION_SELECTOR = 30; + uint256 internal constant BLOCK_NUMBER_SELECTOR = 31; + uint256 internal constant SLOT_NUMBER_SELECTOR = 32; + uint256 internal constant TIMESTAMP_SELECTOR = 33; + uint256 internal constant COINBASE_SELECTOR = 34; + uint256 internal constant UNUSED_FEE_RECIPIENT_SELECTOR = 35; + uint256 internal constant FEE_PER_DA_GAS_SELECTOR = 36; + uint256 internal constant FEE_PER_L2_GAS_SELECTOR = 37; + uint256 internal constant END_GLOBAL_VARIABLES = 38; + uint256 internal constant START_SIDE_EFFECT_COUNTER = 38; + uint256 internal constant TRANSACTION_FEE_SELECTOR = 41; uint256 internal constant START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; uint256 internal constant START_NULLIFIER_EXISTS_OFFSET = 16; uint256 internal constant START_NULLIFIER_NON_EXISTS_OFFSET = 32; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 059fe4958b0..dfafca47fd2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -318,14 +318,14 @@ global VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 128; // VK is composed of // - circuit size encoded as a fr field element (32 bytes) // - num of inputs encoded as a fr field element (32 bytes) -// - 21 affine elements (curve base field fq) encoded as fr elements takes (21 * 4 * 32 bytes) -// 21 above refers to the constant AvmFlavor::NUM_PRECOMPUTED_ENTITIES -global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 2 + 21 * 4; +// - 16 affine elements (curve base field fq) encoded as fr elements takes (16 * 4 * 32 bytes) +// 16 above refers to the constant AvmFlavor::NUM_PRECOMPUTED_ENTITIES +global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 2 + 16 * 4; // `AVM_PROOF_LENGTH_IN_FIELDS` must be updated when AVM circuit changes. // To determine latest value, hover `COMPUTED_AVM_PROOF_LENGTH_IN_FIELDS` // in barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp -global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 3848; +global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 3822; global AVM_PUBLIC_COLUMN_MAX_SIZE : u32 = 1024; global AVM_PUBLIC_INPUTS_FLATTENED_SIZE : u32 = 2 * AVM_PUBLIC_COLUMN_MAX_SIZE + PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH; /** @@ -405,32 +405,29 @@ global MEM_TAG_U64 = 5; global MEM_TAG_U128 = 6; global MEM_TAG_FF = 7; -// AVM CIRCUIT - PUBLIC KERNEL INPUTS COLUMN OFFSETS -// Keep the number of offsets aligned with KERNEL_INPUTS_LENGTH defined in constants.hpp -global SENDER_KERNEL_INPUTS_COL_OFFSET: u32 = 0; +global SENDER_SELECTOR: u32 = 0; // "address" actually does not exist in PublicCircuitPublicInputs, // so this is just an alias to "storage address" for now -global ADDRESS_KERNEL_INPUTS_COL_OFFSET: u32 = 1; -global STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET: u32 = ADDRESS_KERNEL_INPUTS_COL_OFFSET; -global FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET: u32 = 2; -global IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET: u32 = 3; +global ADDRESS_SELECTOR: u32 = SENDER_SELECTOR + 1; +global STORAGE_ADDRESS_SELECTOR: u32 = ADDRESS_SELECTOR; +global FUNCTION_SELECTOR_SELECTOR: u32 = ADDRESS_SELECTOR + 1; +global IS_STATIC_CALL_SELECTOR: u32 = FUNCTION_SELECTOR_SELECTOR + 2; // Global Variables -global CHAIN_ID_KERNEL_INPUTS_COL_OFFSET: u32 = 4; -global VERSION_KERNEL_INPUTS_COL_OFFSET: u32 = 5; -global BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET: u32 = 6; -global TIMESTAMP_KERNEL_INPUTS_COL_OFFSET: u32 = 7; +global START_GLOBAL_VARIABLES: u32 = CALL_CONTEXT_LENGTH + HEADER_LENGTH; +global CHAIN_ID_SELECTOR: u32 = START_GLOBAL_VARIABLES; +global VERSION_SELECTOR: u32 = CHAIN_ID_SELECTOR + 1; +global BLOCK_NUMBER_SELECTOR: u32 = VERSION_SELECTOR + 1; +global SLOT_NUMBER_SELECTOR: u32 = BLOCK_NUMBER_SELECTOR + 1; +global TIMESTAMP_SELECTOR: u32 = SLOT_NUMBER_SELECTOR + 1; +global COINBASE_SELECTOR: u32 = TIMESTAMP_SELECTOR + 1; +global UNUSED_FEE_RECIPIENT_SELECTOR: u32 = COINBASE_SELECTOR + 1; // Global Variables - fees -global FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET: u32 = 8; -global FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET: u32 = 9; -// Gas - start and end values -global DA_START_GAS_KERNEL_INPUTS_COL_OFFSET = 10; -global L2_START_GAS_KERNEL_INPUTS_COL_OFFSET = 11; -global DA_END_GAS_KERNEL_INPUTS_COL_OFFSET = 12; -global L2_END_GAS_KERNEL_INPUTS_COL_OFFSET = 13; +global FEE_PER_DA_GAS_SELECTOR: u32 = UNUSED_FEE_RECIPIENT_SELECTOR + 1; +global FEE_PER_L2_GAS_SELECTOR: u32 = FEE_PER_DA_GAS_SELECTOR + 1; +global END_GLOBAL_VARIABLES: u32 = START_GLOBAL_VARIABLES + GLOBAL_VARIABLES_LENGTH; // Top-level members -global TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET: u32 = 14; - -// AVM CIRCUIT - PUBLIC KERNEL OUTPUTS COLUMN OFFSETS +global START_SIDE_EFFECT_COUNTER: u32 = END_GLOBAL_VARIABLES; +global TRANSACTION_FEE_SELECTOR: u32 = PUBLIC_CONTEXT_INPUTS_LENGTH - 1; // Side effects global START_NOTE_HASH_EXISTS_WRITE_OFFSET: u32 = 0; global START_NULLIFIER_EXISTS_OFFSET: u32 = START_NOTE_HASH_EXISTS_WRITE_OFFSET + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL; diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 6374c9d0952..e958616e446 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -211,8 +211,8 @@ export const RECURSIVE_PROOF_LENGTH = 463; export const NESTED_RECURSIVE_PROOF_LENGTH = 463; export const TUBE_PROOF_LENGTH = 463; export const VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; -export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 86; -export const AVM_PROOF_LENGTH_IN_FIELDS = 3848; +export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 66; +export const AVM_PROOF_LENGTH_IN_FIELDS = 3822; export const AVM_PUBLIC_COLUMN_MAX_SIZE = 1024; export const AVM_PUBLIC_INPUTS_FLATTENED_SIZE = 2739; export const MEM_TAG_U1 = 1; @@ -222,22 +222,24 @@ export const MEM_TAG_U32 = 4; export const MEM_TAG_U64 = 5; export const MEM_TAG_U128 = 6; export const MEM_TAG_FF = 7; -export const SENDER_KERNEL_INPUTS_COL_OFFSET = 0; -export const ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; -export const STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; -export const FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; -export const IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; -export const CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; -export const VERSION_KERNEL_INPUTS_COL_OFFSET = 5; -export const BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET = 6; -export const TIMESTAMP_KERNEL_INPUTS_COL_OFFSET = 7; -export const FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET = 8; -export const FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET = 9; -export const DA_START_GAS_KERNEL_INPUTS_COL_OFFSET = 10; -export const L2_START_GAS_KERNEL_INPUTS_COL_OFFSET = 11; -export const DA_END_GAS_KERNEL_INPUTS_COL_OFFSET = 12; -export const L2_END_GAS_KERNEL_INPUTS_COL_OFFSET = 13; -export const TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET = 14; +export const SENDER_SELECTOR = 0; +export const ADDRESS_SELECTOR = 1; +export const STORAGE_ADDRESS_SELECTOR = 1; +export const FUNCTION_SELECTOR_SELECTOR = 2; +export const IS_STATIC_CALL_SELECTOR = 4; +export const START_GLOBAL_VARIABLES = 29; +export const CHAIN_ID_SELECTOR = 29; +export const VERSION_SELECTOR = 30; +export const BLOCK_NUMBER_SELECTOR = 31; +export const SLOT_NUMBER_SELECTOR = 32; +export const TIMESTAMP_SELECTOR = 33; +export const COINBASE_SELECTOR = 34; +export const UNUSED_FEE_RECIPIENT_SELECTOR = 35; +export const FEE_PER_DA_GAS_SELECTOR = 36; +export const FEE_PER_L2_GAS_SELECTOR = 37; +export const END_GLOBAL_VARIABLES = 38; +export const START_SIDE_EFFECT_COUNTER = 38; +export const TRANSACTION_FEE_SELECTOR = 41; export const START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; export const START_NULLIFIER_EXISTS_OFFSET = 16; export const START_NULLIFIER_NON_EXISTS_OFFSET = 32; diff --git a/yarn-project/circuits.js/src/scripts/constants.in.ts b/yarn-project/circuits.js/src/scripts/constants.in.ts index 887b35ca328..ef7fe559862 100644 --- a/yarn-project/circuits.js/src/scripts/constants.in.ts +++ b/yarn-project/circuits.js/src/scripts/constants.in.ts @@ -55,22 +55,21 @@ const CPP_CONSTANTS = [ 'START_EMIT_NULLIFIER_WRITE_OFFSET', 'START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET', 'START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET', - 'SENDER_KERNEL_INPUTS_COL_OFFSET', - 'ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET', - 'CHAIN_ID_KERNEL_INPUTS_COL_OFFSET', - 'VERSION_KERNEL_INPUTS_COL_OFFSET', - 'BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET', - 'TIMESTAMP_KERNEL_INPUTS_COL_OFFSET', - 'FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET', - 'FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET', - 'IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET', - 'DA_START_GAS_KERNEL_INPUTS_COL_OFFSET', - 'L2_START_GAS_KERNEL_INPUTS_COL_OFFSET', - 'DA_END_GAS_KERNEL_INPUTS_COL_OFFSET', - 'L2_END_GAS_KERNEL_INPUTS_COL_OFFSET', - 'TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET', + 'SENDER_SELECTOR', + 'ADDRESS_SELECTOR', + 'STORAGE_ADDRESS_SELECTOR', + 'FUNCTION_SELECTOR_SELECTOR', + 'START_GLOBAL_VARIABLES', + 'CHAIN_ID_SELECTOR', + 'VERSION_SELECTOR', + 'BLOCK_NUMBER_SELECTOR', + 'TIMESTAMP_SELECTOR', + 'FEE_PER_DA_GAS_SELECTOR', + 'FEE_PER_L2_GAS_SELECTOR', + 'IS_STATIC_CALL_SELECTOR', + 'END_GLOBAL_VARIABLES', + 'START_SIDE_EFFECT_COUNTER', + 'TRANSACTION_FEE_SELECTOR', 'MEM_TAG_U1', 'MEM_TAG_U8', 'MEM_TAG_U16', @@ -113,22 +112,21 @@ const PIL_CONSTANTS = [ 'START_EMIT_NULLIFIER_WRITE_OFFSET', 'START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET', 'START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET', - 'SENDER_KERNEL_INPUTS_COL_OFFSET', - 'ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET', - 'CHAIN_ID_KERNEL_INPUTS_COL_OFFSET', - 'VERSION_KERNEL_INPUTS_COL_OFFSET', - 'BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET', - 'TIMESTAMP_KERNEL_INPUTS_COL_OFFSET', - 'FEE_PER_DA_GAS_KERNEL_INPUTS_COL_OFFSET', - 'FEE_PER_L2_GAS_KERNEL_INPUTS_COL_OFFSET', - 'IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET', - 'DA_START_GAS_KERNEL_INPUTS_COL_OFFSET', - 'L2_START_GAS_KERNEL_INPUTS_COL_OFFSET', - 'DA_END_GAS_KERNEL_INPUTS_COL_OFFSET', - 'L2_END_GAS_KERNEL_INPUTS_COL_OFFSET', - 'TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET', + 'SENDER_SELECTOR', + 'ADDRESS_SELECTOR', + 'STORAGE_ADDRESS_SELECTOR', + 'FUNCTION_SELECTOR_SELECTOR', + 'START_GLOBAL_VARIABLES', + 'CHAIN_ID_SELECTOR', + 'VERSION_SELECTOR', + 'BLOCK_NUMBER_SELECTOR', + 'TIMESTAMP_SELECTOR', + 'FEE_PER_DA_GAS_SELECTOR', + 'FEE_PER_L2_GAS_SELECTOR', + 'IS_STATIC_CALL_SELECTOR', + 'END_GLOBAL_VARIABLES', + 'START_SIDE_EFFECT_COUNTER', + 'TRANSACTION_FEE_SELECTOR', 'MEM_TAG_U1', 'MEM_TAG_U8', 'MEM_TAG_U16', diff --git a/yarn-project/ivc-integration/src/avm_integration.test.ts b/yarn-project/ivc-integration/src/avm_integration.test.ts index e3d0872b0df..0811ca4c6bf 100644 --- a/yarn-project/ivc-integration/src/avm_integration.test.ts +++ b/yarn-project/ivc-integration/src/avm_integration.test.ts @@ -41,7 +41,7 @@ import { MockPublicKernelCircuit, witnessGenMockPublicKernelCircuit } from './in // Auto-generated types from noir are not in camel case. /* eslint-disable camelcase */ -jest.setTimeout(240_000); +jest.setTimeout(180_000); const logger = createDebugLogger('aztec:avm-integration');