diff --git a/barretenberg/cpp/pil/avm/bytecode.pil b/barretenberg/cpp/pil/avm/bytecode.pil index a58f4501ba0..9a8444187a9 100644 --- a/barretenberg/cpp/pil/avm/bytecode.pil +++ b/barretenberg/cpp/pil/avm/bytecode.pil @@ -1,4 +1,3 @@ - namespace bytecode(256); pol commit packed; diff --git a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp index 70146181fcc..fbfa76960f0 100644 --- a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp @@ -153,4 +153,4 @@ template class ExecutionTrace_; template class ExecutionTrace_; template class ExecutionTrace_; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index 79a59dfd5d4..a2cb5d16712 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -88,670 +88,6 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , binary_op_id(il[80]) , binary_sel_bin(il[81]) , binary_start(il[82]) -<<<<<<< HEAD - , 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_kernel_in_offset(il[145]) - , main_kernel_out_offset(il[146]) - , main_l1_to_l2_msg_exists_write_offset(il[147]) - , main_l2_gas_remaining(il[148]) - , main_l2_out_of_gas(il[149]) - , main_mem_addr_a(il[150]) - , main_mem_addr_b(il[151]) - , main_mem_addr_c(il[152]) - , main_mem_addr_d(il[153]) - , main_note_hash_exist_write_offset(il[154]) - , main_nullifier_exists_write_offset(il[155]) - , main_nullifier_non_exists_write_offset(il[156]) - , main_op_err(il[157]) - , main_opcode_val(il[158]) - , main_pc(il[159]) - , main_r_in_tag(il[160]) - , main_rwa(il[161]) - , main_rwb(il[162]) - , main_rwc(il[163]) - , main_rwd(il[164]) - , main_sel_alu(il[165]) - , main_sel_bin(il[166]) - , main_sel_calldata(il[167]) - , main_sel_execution_row(il[168]) - , main_sel_kernel_inputs(il[169]) - , main_sel_kernel_out(il[170]) - , main_sel_last(il[171]) - , main_sel_mem_op_a(il[172]) - , main_sel_mem_op_b(il[173]) - , main_sel_mem_op_c(il[174]) - , main_sel_mem_op_d(il[175]) - , main_sel_mov_ia_to_ic(il[176]) - , main_sel_mov_ib_to_ic(il[177]) - , main_sel_op_add(il[178]) - , main_sel_op_address(il[179]) - , main_sel_op_and(il[180]) - , main_sel_op_block_number(il[181]) - , main_sel_op_calldata_copy(il[182]) - , main_sel_op_cast(il[183]) - , main_sel_op_chain_id(il[184]) - , main_sel_op_cmov(il[185]) - , main_sel_op_dagasleft(il[186]) - , main_sel_op_div(il[187]) - , main_sel_op_ecadd(il[188]) - , main_sel_op_emit_l2_to_l1_msg(il[189]) - , main_sel_op_emit_note_hash(il[190]) - , main_sel_op_emit_nullifier(il[191]) - , main_sel_op_emit_unencrypted_log(il[192]) - , main_sel_op_eq(il[193]) - , main_sel_op_external_call(il[194]) - , main_sel_op_external_return(il[195]) - , main_sel_op_external_revert(il[196]) - , main_sel_op_fdiv(il[197]) - , main_sel_op_fee_per_da_gas(il[198]) - , main_sel_op_fee_per_l2_gas(il[199]) - , main_sel_op_function_selector(il[200]) - , main_sel_op_get_contract_instance(il[201]) - , main_sel_op_internal_call(il[202]) - , main_sel_op_internal_return(il[203]) - , main_sel_op_is_static_call(il[204]) - , main_sel_op_jump(il[205]) - , main_sel_op_jumpi(il[206]) - , main_sel_op_keccak(il[207]) - , main_sel_op_l1_to_l2_msg_exists(il[208]) - , main_sel_op_l2gasleft(il[209]) - , main_sel_op_lt(il[210]) - , main_sel_op_lte(il[211]) - , main_sel_op_mov(il[212]) - , main_sel_op_msm(il[213]) - , main_sel_op_mul(il[214]) - , main_sel_op_not(il[215]) - , main_sel_op_note_hash_exists(il[216]) - , main_sel_op_nullifier_exists(il[217]) - , main_sel_op_or(il[218]) - , main_sel_op_pedersen(il[219]) - , main_sel_op_pedersen_commit(il[220]) - , main_sel_op_poseidon2(il[221]) - , main_sel_op_radix_le(il[222]) - , main_sel_op_sender(il[223]) - , main_sel_op_set(il[224]) - , main_sel_op_sha256(il[225]) - , main_sel_op_shl(il[226]) - , main_sel_op_shr(il[227]) - , main_sel_op_sload(il[228]) - , main_sel_op_sstore(il[229]) - , main_sel_op_static_call(il[230]) - , main_sel_op_storage_address(il[231]) - , main_sel_op_sub(il[232]) - , main_sel_op_timestamp(il[233]) - , main_sel_op_transaction_fee(il[234]) - , main_sel_op_version(il[235]) - , main_sel_op_xor(il[236]) - , main_sel_q_kernel_lookup(il[237]) - , main_sel_q_kernel_output_lookup(il[238]) - , main_sel_resolve_ind_addr_a(il[239]) - , main_sel_resolve_ind_addr_b(il[240]) - , main_sel_resolve_ind_addr_c(il[241]) - , main_sel_resolve_ind_addr_d(il[242]) - , main_sel_returndata(il[243]) - , main_sel_rng_16(il[244]) - , main_sel_rng_8(il[245]) - , main_sel_slice_gadget(il[246]) - , main_side_effect_counter(il[247]) - , main_sload_write_offset(il[248]) - , main_space_id(il[249]) - , main_sstore_write_offset(il[250]) - , main_tag_err(il[251]) - , main_w_in_tag(il[252]) - , mem_addr(il[253]) - , mem_clk(il[254]) - , mem_diff(il[255]) - , mem_glob_addr(il[256]) - , mem_last(il[257]) - , mem_lastAccess(il[258]) - , mem_one_min_inv(il[259]) - , mem_r_in_tag(il[260]) - , mem_rw(il[261]) - , mem_sel_mem(il[262]) - , mem_sel_mov_ia_to_ic(il[263]) - , mem_sel_mov_ib_to_ic(il[264]) - , mem_sel_op_a(il[265]) - , mem_sel_op_b(il[266]) - , mem_sel_op_c(il[267]) - , mem_sel_op_cmov(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]) -======= , bytecode_end_latch(il[83]) , bytecode_length_remaining(il[84]) , bytecode_packed(il[85]) @@ -877,547 +213,547 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , main_sel_op_get_contract_instance(il[205]) , main_sel_op_internal_call(il[206]) , main_sel_op_internal_return(il[207]) - , main_sel_op_jump(il[208]) - , main_sel_op_jumpi(il[209]) - , main_sel_op_keccak(il[210]) - , main_sel_op_l1_to_l2_msg_exists(il[211]) - , main_sel_op_l2gasleft(il[212]) - , main_sel_op_lt(il[213]) - , main_sel_op_lte(il[214]) - , main_sel_op_mov(il[215]) - , main_sel_op_msm(il[216]) - , main_sel_op_mul(il[217]) - , main_sel_op_not(il[218]) - , main_sel_op_note_hash_exists(il[219]) - , main_sel_op_nullifier_exists(il[220]) - , main_sel_op_or(il[221]) - , main_sel_op_pedersen(il[222]) - , main_sel_op_pedersen_commit(il[223]) - , main_sel_op_poseidon2(il[224]) - , main_sel_op_radix_le(il[225]) - , main_sel_op_sender(il[226]) - , main_sel_op_set(il[227]) - , main_sel_op_sha256(il[228]) - , main_sel_op_shl(il[229]) - , main_sel_op_shr(il[230]) - , main_sel_op_sload(il[231]) - , main_sel_op_sstore(il[232]) - , main_sel_op_static_call(il[233]) - , main_sel_op_storage_address(il[234]) - , main_sel_op_sub(il[235]) - , main_sel_op_timestamp(il[236]) - , main_sel_op_transaction_fee(il[237]) - , main_sel_op_version(il[238]) - , main_sel_op_xor(il[239]) - , main_sel_q_kernel_lookup(il[240]) - , main_sel_q_kernel_output_lookup(il[241]) - , main_sel_resolve_ind_addr_a(il[242]) - , main_sel_resolve_ind_addr_b(il[243]) - , main_sel_resolve_ind_addr_c(il[244]) - , main_sel_resolve_ind_addr_d(il[245]) - , main_sel_returndata(il[246]) - , main_sel_rng_16(il[247]) - , main_sel_rng_8(il[248]) - , main_sel_slice_gadget(il[249]) - , main_side_effect_counter(il[250]) - , main_sload_write_offset(il[251]) - , main_space_id(il[252]) - , main_sstore_write_offset(il[253]) - , main_tag_err(il[254]) - , main_w_in_tag(il[255]) - , mem_addr(il[256]) - , mem_clk(il[257]) - , mem_diff(il[258]) - , mem_glob_addr(il[259]) - , mem_last(il[260]) - , mem_lastAccess(il[261]) - , mem_one_min_inv(il[262]) - , mem_r_in_tag(il[263]) - , mem_rw(il[264]) - , mem_sel_mem(il[265]) - , mem_sel_mov_ia_to_ic(il[266]) - , mem_sel_mov_ib_to_ic(il[267]) - , mem_sel_op_a(il[268]) - , mem_sel_op_b(il[269]) - , mem_sel_op_c(il[270]) - , mem_sel_op_cmov(il[271]) - , mem_sel_op_d(il[272]) - , mem_sel_op_poseidon_read_a(il[273]) - , mem_sel_op_poseidon_read_b(il[274]) - , mem_sel_op_poseidon_read_c(il[275]) - , mem_sel_op_poseidon_read_d(il[276]) - , mem_sel_op_poseidon_write_a(il[277]) - , mem_sel_op_poseidon_write_b(il[278]) - , mem_sel_op_poseidon_write_c(il[279]) - , mem_sel_op_poseidon_write_d(il[280]) - , mem_sel_op_slice(il[281]) - , mem_sel_resolve_ind_addr_a(il[282]) - , mem_sel_resolve_ind_addr_b(il[283]) - , mem_sel_resolve_ind_addr_c(il[284]) - , mem_sel_resolve_ind_addr_d(il[285]) - , mem_sel_rng_chk(il[286]) - , mem_skip_check_tag(il[287]) - , mem_space_id(il[288]) - , mem_tag(il[289]) - , mem_tag_err(il[290]) - , mem_tsp(il[291]) - , mem_val(il[292]) - , mem_w_in_tag(il[293]) - , pedersen_clk(il[294]) - , pedersen_input(il[295]) - , pedersen_output(il[296]) - , pedersen_sel_pedersen(il[297]) - , poseidon2_B_10_0(il[298]) - , poseidon2_B_10_1(il[299]) - , poseidon2_B_10_2(il[300]) - , poseidon2_B_10_3(il[301]) - , poseidon2_B_11_0(il[302]) - , poseidon2_B_11_1(il[303]) - , poseidon2_B_11_2(il[304]) - , poseidon2_B_11_3(il[305]) - , poseidon2_B_12_0(il[306]) - , poseidon2_B_12_1(il[307]) - , poseidon2_B_12_2(il[308]) - , poseidon2_B_12_3(il[309]) - , poseidon2_B_13_0(il[310]) - , poseidon2_B_13_1(il[311]) - , poseidon2_B_13_2(il[312]) - , poseidon2_B_13_3(il[313]) - , poseidon2_B_14_0(il[314]) - , poseidon2_B_14_1(il[315]) - , poseidon2_B_14_2(il[316]) - , poseidon2_B_14_3(il[317]) - , poseidon2_B_15_0(il[318]) - , poseidon2_B_15_1(il[319]) - , poseidon2_B_15_2(il[320]) - , poseidon2_B_15_3(il[321]) - , poseidon2_B_16_0(il[322]) - , poseidon2_B_16_1(il[323]) - , poseidon2_B_16_2(il[324]) - , poseidon2_B_16_3(il[325]) - , poseidon2_B_17_0(il[326]) - , poseidon2_B_17_1(il[327]) - , poseidon2_B_17_2(il[328]) - , poseidon2_B_17_3(il[329]) - , poseidon2_B_18_0(il[330]) - , poseidon2_B_18_1(il[331]) - , poseidon2_B_18_2(il[332]) - , poseidon2_B_18_3(il[333]) - , poseidon2_B_19_0(il[334]) - , poseidon2_B_19_1(il[335]) - , poseidon2_B_19_2(il[336]) - , poseidon2_B_19_3(il[337]) - , poseidon2_B_20_0(il[338]) - , poseidon2_B_20_1(il[339]) - , poseidon2_B_20_2(il[340]) - , poseidon2_B_20_3(il[341]) - , poseidon2_B_21_0(il[342]) - , poseidon2_B_21_1(il[343]) - , poseidon2_B_21_2(il[344]) - , poseidon2_B_21_3(il[345]) - , poseidon2_B_22_0(il[346]) - , poseidon2_B_22_1(il[347]) - , poseidon2_B_22_2(il[348]) - , poseidon2_B_22_3(il[349]) - , poseidon2_B_23_0(il[350]) - , poseidon2_B_23_1(il[351]) - , poseidon2_B_23_2(il[352]) - , poseidon2_B_23_3(il[353]) - , poseidon2_B_24_0(il[354]) - , poseidon2_B_24_1(il[355]) - , poseidon2_B_24_2(il[356]) - , poseidon2_B_24_3(il[357]) - , poseidon2_B_25_0(il[358]) - , poseidon2_B_25_1(il[359]) - , poseidon2_B_25_2(il[360]) - , poseidon2_B_25_3(il[361]) - , poseidon2_B_26_0(il[362]) - , poseidon2_B_26_1(il[363]) - , poseidon2_B_26_2(il[364]) - , poseidon2_B_26_3(il[365]) - , poseidon2_B_27_0(il[366]) - , poseidon2_B_27_1(il[367]) - , poseidon2_B_27_2(il[368]) - , poseidon2_B_27_3(il[369]) - , poseidon2_B_28_0(il[370]) - , poseidon2_B_28_1(il[371]) - , poseidon2_B_28_2(il[372]) - , poseidon2_B_28_3(il[373]) - , poseidon2_B_29_0(il[374]) - , poseidon2_B_29_1(il[375]) - , poseidon2_B_29_2(il[376]) - , poseidon2_B_29_3(il[377]) - , poseidon2_B_30_0(il[378]) - , poseidon2_B_30_1(il[379]) - , poseidon2_B_30_2(il[380]) - , poseidon2_B_30_3(il[381]) - , poseidon2_B_31_0(il[382]) - , poseidon2_B_31_1(il[383]) - , poseidon2_B_31_2(il[384]) - , poseidon2_B_31_3(il[385]) - , poseidon2_B_32_0(il[386]) - , poseidon2_B_32_1(il[387]) - , poseidon2_B_32_2(il[388]) - , poseidon2_B_32_3(il[389]) - , poseidon2_B_33_0(il[390]) - , poseidon2_B_33_1(il[391]) - , poseidon2_B_33_2(il[392]) - , poseidon2_B_33_3(il[393]) - , poseidon2_B_34_0(il[394]) - , poseidon2_B_34_1(il[395]) - , poseidon2_B_34_2(il[396]) - , poseidon2_B_34_3(il[397]) - , poseidon2_B_35_0(il[398]) - , poseidon2_B_35_1(il[399]) - , poseidon2_B_35_2(il[400]) - , poseidon2_B_35_3(il[401]) - , poseidon2_B_36_0(il[402]) - , poseidon2_B_36_1(il[403]) - , poseidon2_B_36_2(il[404]) - , poseidon2_B_36_3(il[405]) - , poseidon2_B_37_0(il[406]) - , poseidon2_B_37_1(il[407]) - , poseidon2_B_37_2(il[408]) - , poseidon2_B_37_3(il[409]) - , poseidon2_B_38_0(il[410]) - , poseidon2_B_38_1(il[411]) - , poseidon2_B_38_2(il[412]) - , poseidon2_B_38_3(il[413]) - , poseidon2_B_39_0(il[414]) - , poseidon2_B_39_1(il[415]) - , poseidon2_B_39_2(il[416]) - , poseidon2_B_39_3(il[417]) - , poseidon2_B_40_0(il[418]) - , poseidon2_B_40_1(il[419]) - , poseidon2_B_40_2(il[420]) - , poseidon2_B_40_3(il[421]) - , poseidon2_B_41_0(il[422]) - , poseidon2_B_41_1(il[423]) - , poseidon2_B_41_2(il[424]) - , poseidon2_B_41_3(il[425]) - , poseidon2_B_42_0(il[426]) - , poseidon2_B_42_1(il[427]) - , poseidon2_B_42_2(il[428]) - , poseidon2_B_42_3(il[429]) - , poseidon2_B_43_0(il[430]) - , poseidon2_B_43_1(il[431]) - , poseidon2_B_43_2(il[432]) - , poseidon2_B_43_3(il[433]) - , poseidon2_B_44_0(il[434]) - , poseidon2_B_44_1(il[435]) - , poseidon2_B_44_2(il[436]) - , poseidon2_B_44_3(il[437]) - , poseidon2_B_45_0(il[438]) - , poseidon2_B_45_1(il[439]) - , poseidon2_B_45_2(il[440]) - , poseidon2_B_45_3(il[441]) - , poseidon2_B_46_0(il[442]) - , poseidon2_B_46_1(il[443]) - , poseidon2_B_46_2(il[444]) - , poseidon2_B_46_3(il[445]) - , poseidon2_B_47_0(il[446]) - , poseidon2_B_47_1(il[447]) - , poseidon2_B_47_2(il[448]) - , poseidon2_B_47_3(il[449]) - , poseidon2_B_48_0(il[450]) - , poseidon2_B_48_1(il[451]) - , poseidon2_B_48_2(il[452]) - , poseidon2_B_48_3(il[453]) - , poseidon2_B_49_0(il[454]) - , poseidon2_B_49_1(il[455]) - , poseidon2_B_49_2(il[456]) - , poseidon2_B_49_3(il[457]) - , poseidon2_B_4_0(il[458]) - , poseidon2_B_4_1(il[459]) - , poseidon2_B_4_2(il[460]) - , poseidon2_B_4_3(il[461]) - , poseidon2_B_50_0(il[462]) - , poseidon2_B_50_1(il[463]) - , poseidon2_B_50_2(il[464]) - , poseidon2_B_50_3(il[465]) - , poseidon2_B_51_0(il[466]) - , poseidon2_B_51_1(il[467]) - , poseidon2_B_51_2(il[468]) - , poseidon2_B_51_3(il[469]) - , poseidon2_B_52_0(il[470]) - , poseidon2_B_52_1(il[471]) - , poseidon2_B_52_2(il[472]) - , poseidon2_B_52_3(il[473]) - , poseidon2_B_53_0(il[474]) - , poseidon2_B_53_1(il[475]) - , poseidon2_B_53_2(il[476]) - , poseidon2_B_53_3(il[477]) - , poseidon2_B_54_0(il[478]) - , poseidon2_B_54_1(il[479]) - , poseidon2_B_54_2(il[480]) - , poseidon2_B_54_3(il[481]) - , poseidon2_B_55_0(il[482]) - , poseidon2_B_55_1(il[483]) - , poseidon2_B_55_2(il[484]) - , poseidon2_B_55_3(il[485]) - , poseidon2_B_56_0(il[486]) - , poseidon2_B_56_1(il[487]) - , poseidon2_B_56_2(il[488]) - , poseidon2_B_56_3(il[489]) - , poseidon2_B_57_0(il[490]) - , poseidon2_B_57_1(il[491]) - , poseidon2_B_57_2(il[492]) - , poseidon2_B_57_3(il[493]) - , poseidon2_B_58_0(il[494]) - , poseidon2_B_58_1(il[495]) - , poseidon2_B_58_2(il[496]) - , poseidon2_B_58_3(il[497]) - , poseidon2_B_59_0(il[498]) - , poseidon2_B_59_1(il[499]) - , poseidon2_B_59_2(il[500]) - , poseidon2_B_59_3(il[501]) - , poseidon2_B_5_0(il[502]) - , poseidon2_B_5_1(il[503]) - , poseidon2_B_5_2(il[504]) - , poseidon2_B_5_3(il[505]) - , poseidon2_B_6_0(il[506]) - , poseidon2_B_6_1(il[507]) - , poseidon2_B_6_2(il[508]) - , poseidon2_B_6_3(il[509]) - , poseidon2_B_7_0(il[510]) - , poseidon2_B_7_1(il[511]) - , poseidon2_B_7_2(il[512]) - , poseidon2_B_7_3(il[513]) - , poseidon2_B_8_0(il[514]) - , poseidon2_B_8_1(il[515]) - , poseidon2_B_8_2(il[516]) - , poseidon2_B_8_3(il[517]) - , poseidon2_B_9_0(il[518]) - , poseidon2_B_9_1(il[519]) - , poseidon2_B_9_2(il[520]) - , poseidon2_B_9_3(il[521]) - , poseidon2_EXT_LAYER_4(il[522]) - , poseidon2_EXT_LAYER_5(il[523]) - , poseidon2_EXT_LAYER_6(il[524]) - , poseidon2_EXT_LAYER_7(il[525]) - , poseidon2_T_0_4(il[526]) - , poseidon2_T_0_5(il[527]) - , poseidon2_T_0_6(il[528]) - , poseidon2_T_0_7(il[529]) - , poseidon2_T_1_4(il[530]) - , poseidon2_T_1_5(il[531]) - , poseidon2_T_1_6(il[532]) - , poseidon2_T_1_7(il[533]) - , poseidon2_T_2_4(il[534]) - , poseidon2_T_2_5(il[535]) - , poseidon2_T_2_6(il[536]) - , poseidon2_T_2_7(il[537]) - , poseidon2_T_3_4(il[538]) - , poseidon2_T_3_5(il[539]) - , poseidon2_T_3_6(il[540]) - , poseidon2_T_3_7(il[541]) - , poseidon2_T_60_4(il[542]) - , poseidon2_T_60_5(il[543]) - , poseidon2_T_60_6(il[544]) - , poseidon2_T_60_7(il[545]) - , poseidon2_T_61_4(il[546]) - , poseidon2_T_61_5(il[547]) - , poseidon2_T_61_6(il[548]) - , poseidon2_T_61_7(il[549]) - , poseidon2_T_62_4(il[550]) - , poseidon2_T_62_5(il[551]) - , poseidon2_T_62_6(il[552]) - , poseidon2_T_62_7(il[553]) - , poseidon2_T_63_4(il[554]) - , poseidon2_T_63_5(il[555]) - , poseidon2_T_63_6(il[556]) - , poseidon2_T_63_7(il[557]) - , poseidon2_a_0(il[558]) - , poseidon2_a_1(il[559]) - , poseidon2_a_2(il[560]) - , poseidon2_a_3(il[561]) - , poseidon2_b_0(il[562]) - , poseidon2_b_1(il[563]) - , poseidon2_b_2(il[564]) - , poseidon2_b_3(il[565]) - , poseidon2_clk(il[566]) - , poseidon2_input_addr(il[567]) - , poseidon2_mem_addr_read_a(il[568]) - , poseidon2_mem_addr_read_b(il[569]) - , poseidon2_mem_addr_read_c(il[570]) - , poseidon2_mem_addr_read_d(il[571]) - , poseidon2_mem_addr_write_a(il[572]) - , poseidon2_mem_addr_write_b(il[573]) - , poseidon2_mem_addr_write_c(il[574]) - , poseidon2_mem_addr_write_d(il[575]) - , poseidon2_output_addr(il[576]) - , poseidon2_sel_poseidon_perm(il[577]) - , range_check_alu_rng_chk(il[578]) - , range_check_clk(il[579]) - , range_check_cmp_hi_bits_rng_chk(il[580]) - , range_check_cmp_lo_bits_rng_chk(il[581]) - , range_check_dyn_diff(il[582]) - , range_check_dyn_rng_chk_bits(il[583]) - , range_check_dyn_rng_chk_pow_2(il[584]) - , range_check_gas_da_rng_chk(il[585]) - , range_check_gas_l2_rng_chk(il[586]) - , range_check_is_lte_u112(il[587]) - , range_check_is_lte_u128(il[588]) - , range_check_is_lte_u16(il[589]) - , range_check_is_lte_u32(il[590]) - , range_check_is_lte_u48(il[591]) - , range_check_is_lte_u64(il[592]) - , range_check_is_lte_u80(il[593]) - , range_check_is_lte_u96(il[594]) - , range_check_mem_rng_chk(il[595]) - , range_check_rng_chk_bits(il[596]) - , range_check_sel_lookup_0(il[597]) - , range_check_sel_lookup_1(il[598]) - , range_check_sel_lookup_2(il[599]) - , range_check_sel_lookup_3(il[600]) - , range_check_sel_lookup_4(il[601]) - , range_check_sel_lookup_5(il[602]) - , range_check_sel_lookup_6(il[603]) - , range_check_sel_rng_chk(il[604]) - , range_check_u16_r0(il[605]) - , range_check_u16_r1(il[606]) - , range_check_u16_r2(il[607]) - , range_check_u16_r3(il[608]) - , range_check_u16_r4(il[609]) - , range_check_u16_r5(il[610]) - , range_check_u16_r6(il[611]) - , range_check_u16_r7(il[612]) - , range_check_value(il[613]) - , sha256_clk(il[614]) - , sha256_input(il[615]) - , sha256_output(il[616]) - , sha256_sel_sha256_compression(il[617]) - , sha256_state(il[618]) - , slice_addr(il[619]) - , slice_clk(il[620]) - , slice_cnt(il[621]) - , slice_col_offset(il[622]) - , slice_one_min_inv(il[623]) - , slice_sel_cd_cpy(il[624]) - , slice_sel_mem_active(il[625]) - , slice_sel_return(il[626]) - , slice_sel_start(il[627]) - , slice_space_id(il[628]) - , slice_val(il[629]) - , lookup_rng_chk_pow_2_counts(il[630]) - , lookup_rng_chk_diff_counts(il[631]) - , lookup_rng_chk_0_counts(il[632]) - , lookup_rng_chk_1_counts(il[633]) - , lookup_rng_chk_2_counts(il[634]) - , lookup_rng_chk_3_counts(il[635]) - , lookup_rng_chk_4_counts(il[636]) - , lookup_rng_chk_5_counts(il[637]) - , lookup_rng_chk_6_counts(il[638]) - , lookup_rng_chk_7_counts(il[639]) - , lookup_pow_2_0_counts(il[640]) - , lookup_pow_2_1_counts(il[641]) - , lookup_byte_lengths_counts(il[642]) - , lookup_byte_operations_counts(il[643]) - , lookup_opcode_gas_counts(il[644]) - , kernel_output_lookup_counts(il[645]) - , lookup_into_kernel_counts(il[646]) - , lookup_cd_value_counts(il[647]) - , lookup_ret_value_counts(il[648]) - , incl_main_tag_err_counts(il[649]) - , incl_mem_tag_err_counts(il[650]) - , perm_rng_mem_inv(il[651]) - , perm_rng_cmp_lo_inv(il[652]) - , perm_rng_cmp_hi_inv(il[653]) - , perm_rng_alu_inv(il[654]) - , perm_cmp_alu_inv(il[655]) - , perm_rng_gas_l2_inv(il[656]) - , perm_rng_gas_da_inv(il[657]) - , perm_pos_mem_read_a_inv(il[658]) - , perm_pos_mem_read_b_inv(il[659]) - , perm_pos_mem_read_c_inv(il[660]) - , perm_pos_mem_read_d_inv(il[661]) - , perm_pos_mem_write_a_inv(il[662]) - , perm_pos_mem_write_b_inv(il[663]) - , perm_pos_mem_write_c_inv(il[664]) - , perm_pos_mem_write_d_inv(il[665]) - , perm_slice_mem_inv(il[666]) - , perm_main_alu_inv(il[667]) - , perm_main_bin_inv(il[668]) - , perm_main_conv_inv(il[669]) - , perm_main_pos2_perm_inv(il[670]) - , perm_main_pedersen_inv(il[671]) - , perm_main_slice_inv(il[672]) - , perm_main_mem_a_inv(il[673]) - , perm_main_mem_b_inv(il[674]) - , perm_main_mem_c_inv(il[675]) - , perm_main_mem_d_inv(il[676]) - , perm_main_mem_ind_addr_a_inv(il[677]) - , perm_main_mem_ind_addr_b_inv(il[678]) - , perm_main_mem_ind_addr_c_inv(il[679]) - , perm_main_mem_ind_addr_d_inv(il[680]) - , lookup_rng_chk_pow_2_inv(il[681]) - , lookup_rng_chk_diff_inv(il[682]) - , lookup_rng_chk_0_inv(il[683]) - , lookup_rng_chk_1_inv(il[684]) - , lookup_rng_chk_2_inv(il[685]) - , lookup_rng_chk_3_inv(il[686]) - , lookup_rng_chk_4_inv(il[687]) - , lookup_rng_chk_5_inv(il[688]) - , lookup_rng_chk_6_inv(il[689]) - , lookup_rng_chk_7_inv(il[690]) - , lookup_pow_2_0_inv(il[691]) - , lookup_pow_2_1_inv(il[692]) - , lookup_byte_lengths_inv(il[693]) - , lookup_byte_operations_inv(il[694]) - , lookup_opcode_gas_inv(il[695]) - , kernel_output_lookup_inv(il[696]) - , lookup_into_kernel_inv(il[697]) - , lookup_cd_value_inv(il[698]) - , lookup_ret_value_inv(il[699]) - , incl_main_tag_err_inv(il[700]) - , incl_mem_tag_err_inv(il[701]) - , binary_acc_ia_shift(il[702]) - , binary_acc_ib_shift(il[703]) - , binary_acc_ic_shift(il[704]) - , binary_mem_tag_ctr_shift(il[705]) - , binary_op_id_shift(il[706]) - , cmp_a_hi_shift(il[707]) - , cmp_a_lo_shift(il[708]) - , cmp_b_hi_shift(il[709]) - , cmp_b_lo_shift(il[710]) - , cmp_cmp_rng_ctr_shift(il[711]) - , cmp_op_gt_shift(il[712]) - , cmp_p_sub_a_hi_shift(il[713]) - , cmp_p_sub_a_lo_shift(il[714]) - , cmp_p_sub_b_hi_shift(il[715]) - , cmp_p_sub_b_lo_shift(il[716]) - , cmp_sel_rng_chk_shift(il[717]) - , main_da_gas_remaining_shift(il[718]) - , main_emit_l2_to_l1_msg_write_offset_shift(il[719]) - , main_emit_note_hash_write_offset_shift(il[720]) - , main_emit_nullifier_write_offset_shift(il[721]) - , main_emit_unencrypted_log_write_offset_shift(il[722]) - , main_internal_return_ptr_shift(il[723]) - , main_l1_to_l2_msg_exists_write_offset_shift(il[724]) - , main_l2_gas_remaining_shift(il[725]) - , main_note_hash_exist_write_offset_shift(il[726]) - , main_nullifier_exists_write_offset_shift(il[727]) - , main_nullifier_non_exists_write_offset_shift(il[728]) - , main_pc_shift(il[729]) - , main_sel_execution_row_shift(il[730]) - , main_sload_write_offset_shift(il[731]) - , main_sstore_write_offset_shift(il[732]) - , mem_glob_addr_shift(il[733]) - , mem_rw_shift(il[734]) - , mem_sel_mem_shift(il[735]) - , mem_tag_shift(il[736]) - , mem_tsp_shift(il[737]) - , mem_val_shift(il[738]) - , slice_addr_shift(il[739]) - , slice_clk_shift(il[740]) - , slice_cnt_shift(il[741]) - , slice_col_offset_shift(il[742]) - , slice_sel_cd_cpy_shift(il[743]) - , slice_sel_mem_active_shift(il[744]) - , slice_sel_return_shift(il[745]) - , slice_sel_start_shift(il[746]) - , slice_space_id_shift(il[747]) ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) + , main_sel_op_is_static_call(il[208]) + , main_sel_op_jump(il[209]) + , main_sel_op_jumpi(il[210]) + , main_sel_op_keccak(il[211]) + , main_sel_op_l1_to_l2_msg_exists(il[212]) + , main_sel_op_l2gasleft(il[213]) + , main_sel_op_lt(il[214]) + , main_sel_op_lte(il[215]) + , main_sel_op_mov(il[216]) + , main_sel_op_msm(il[217]) + , main_sel_op_mul(il[218]) + , main_sel_op_not(il[219]) + , main_sel_op_note_hash_exists(il[220]) + , main_sel_op_nullifier_exists(il[221]) + , main_sel_op_or(il[222]) + , main_sel_op_pedersen(il[223]) + , main_sel_op_pedersen_commit(il[224]) + , main_sel_op_poseidon2(il[225]) + , main_sel_op_radix_le(il[226]) + , main_sel_op_sender(il[227]) + , main_sel_op_set(il[228]) + , main_sel_op_sha256(il[229]) + , main_sel_op_shl(il[230]) + , main_sel_op_shr(il[231]) + , main_sel_op_sload(il[232]) + , main_sel_op_sstore(il[233]) + , main_sel_op_static_call(il[234]) + , main_sel_op_storage_address(il[235]) + , main_sel_op_sub(il[236]) + , main_sel_op_timestamp(il[237]) + , main_sel_op_transaction_fee(il[238]) + , main_sel_op_version(il[239]) + , main_sel_op_xor(il[240]) + , main_sel_q_kernel_lookup(il[241]) + , main_sel_q_kernel_output_lookup(il[242]) + , main_sel_resolve_ind_addr_a(il[243]) + , main_sel_resolve_ind_addr_b(il[244]) + , main_sel_resolve_ind_addr_c(il[245]) + , main_sel_resolve_ind_addr_d(il[246]) + , main_sel_returndata(il[247]) + , main_sel_rng_16(il[248]) + , main_sel_rng_8(il[249]) + , main_sel_slice_gadget(il[250]) + , main_side_effect_counter(il[251]) + , main_sload_write_offset(il[252]) + , main_space_id(il[253]) + , main_sstore_write_offset(il[254]) + , main_tag_err(il[255]) + , main_w_in_tag(il[256]) + , mem_addr(il[257]) + , mem_clk(il[258]) + , mem_diff(il[259]) + , mem_glob_addr(il[260]) + , mem_last(il[261]) + , mem_lastAccess(il[262]) + , mem_one_min_inv(il[263]) + , mem_r_in_tag(il[264]) + , mem_rw(il[265]) + , mem_sel_mem(il[266]) + , mem_sel_mov_ia_to_ic(il[267]) + , mem_sel_mov_ib_to_ic(il[268]) + , mem_sel_op_a(il[269]) + , mem_sel_op_b(il[270]) + , mem_sel_op_c(il[271]) + , mem_sel_op_cmov(il[272]) + , mem_sel_op_d(il[273]) + , mem_sel_op_poseidon_read_a(il[274]) + , mem_sel_op_poseidon_read_b(il[275]) + , mem_sel_op_poseidon_read_c(il[276]) + , mem_sel_op_poseidon_read_d(il[277]) + , mem_sel_op_poseidon_write_a(il[278]) + , mem_sel_op_poseidon_write_b(il[279]) + , mem_sel_op_poseidon_write_c(il[280]) + , mem_sel_op_poseidon_write_d(il[281]) + , mem_sel_op_slice(il[282]) + , mem_sel_resolve_ind_addr_a(il[283]) + , mem_sel_resolve_ind_addr_b(il[284]) + , mem_sel_resolve_ind_addr_c(il[285]) + , mem_sel_resolve_ind_addr_d(il[286]) + , mem_sel_rng_chk(il[287]) + , mem_skip_check_tag(il[288]) + , mem_space_id(il[289]) + , mem_tag(il[290]) + , mem_tag_err(il[291]) + , mem_tsp(il[292]) + , mem_val(il[293]) + , mem_w_in_tag(il[294]) + , pedersen_clk(il[295]) + , pedersen_input(il[296]) + , pedersen_output(il[297]) + , pedersen_sel_pedersen(il[298]) + , poseidon2_B_10_0(il[299]) + , poseidon2_B_10_1(il[300]) + , poseidon2_B_10_2(il[301]) + , poseidon2_B_10_3(il[302]) + , poseidon2_B_11_0(il[303]) + , poseidon2_B_11_1(il[304]) + , poseidon2_B_11_2(il[305]) + , poseidon2_B_11_3(il[306]) + , poseidon2_B_12_0(il[307]) + , poseidon2_B_12_1(il[308]) + , poseidon2_B_12_2(il[309]) + , poseidon2_B_12_3(il[310]) + , poseidon2_B_13_0(il[311]) + , poseidon2_B_13_1(il[312]) + , poseidon2_B_13_2(il[313]) + , poseidon2_B_13_3(il[314]) + , poseidon2_B_14_0(il[315]) + , poseidon2_B_14_1(il[316]) + , poseidon2_B_14_2(il[317]) + , poseidon2_B_14_3(il[318]) + , poseidon2_B_15_0(il[319]) + , poseidon2_B_15_1(il[320]) + , poseidon2_B_15_2(il[321]) + , poseidon2_B_15_3(il[322]) + , poseidon2_B_16_0(il[323]) + , poseidon2_B_16_1(il[324]) + , poseidon2_B_16_2(il[325]) + , poseidon2_B_16_3(il[326]) + , poseidon2_B_17_0(il[327]) + , poseidon2_B_17_1(il[328]) + , poseidon2_B_17_2(il[329]) + , poseidon2_B_17_3(il[330]) + , poseidon2_B_18_0(il[331]) + , poseidon2_B_18_1(il[332]) + , poseidon2_B_18_2(il[333]) + , poseidon2_B_18_3(il[334]) + , poseidon2_B_19_0(il[335]) + , poseidon2_B_19_1(il[336]) + , poseidon2_B_19_2(il[337]) + , poseidon2_B_19_3(il[338]) + , poseidon2_B_20_0(il[339]) + , poseidon2_B_20_1(il[340]) + , poseidon2_B_20_2(il[341]) + , poseidon2_B_20_3(il[342]) + , poseidon2_B_21_0(il[343]) + , poseidon2_B_21_1(il[344]) + , poseidon2_B_21_2(il[345]) + , poseidon2_B_21_3(il[346]) + , poseidon2_B_22_0(il[347]) + , poseidon2_B_22_1(il[348]) + , poseidon2_B_22_2(il[349]) + , poseidon2_B_22_3(il[350]) + , poseidon2_B_23_0(il[351]) + , poseidon2_B_23_1(il[352]) + , poseidon2_B_23_2(il[353]) + , poseidon2_B_23_3(il[354]) + , poseidon2_B_24_0(il[355]) + , poseidon2_B_24_1(il[356]) + , poseidon2_B_24_2(il[357]) + , poseidon2_B_24_3(il[358]) + , poseidon2_B_25_0(il[359]) + , poseidon2_B_25_1(il[360]) + , poseidon2_B_25_2(il[361]) + , poseidon2_B_25_3(il[362]) + , poseidon2_B_26_0(il[363]) + , poseidon2_B_26_1(il[364]) + , poseidon2_B_26_2(il[365]) + , poseidon2_B_26_3(il[366]) + , poseidon2_B_27_0(il[367]) + , poseidon2_B_27_1(il[368]) + , poseidon2_B_27_2(il[369]) + , poseidon2_B_27_3(il[370]) + , poseidon2_B_28_0(il[371]) + , poseidon2_B_28_1(il[372]) + , poseidon2_B_28_2(il[373]) + , poseidon2_B_28_3(il[374]) + , poseidon2_B_29_0(il[375]) + , poseidon2_B_29_1(il[376]) + , poseidon2_B_29_2(il[377]) + , poseidon2_B_29_3(il[378]) + , poseidon2_B_30_0(il[379]) + , poseidon2_B_30_1(il[380]) + , poseidon2_B_30_2(il[381]) + , poseidon2_B_30_3(il[382]) + , poseidon2_B_31_0(il[383]) + , poseidon2_B_31_1(il[384]) + , poseidon2_B_31_2(il[385]) + , poseidon2_B_31_3(il[386]) + , poseidon2_B_32_0(il[387]) + , poseidon2_B_32_1(il[388]) + , poseidon2_B_32_2(il[389]) + , poseidon2_B_32_3(il[390]) + , poseidon2_B_33_0(il[391]) + , poseidon2_B_33_1(il[392]) + , poseidon2_B_33_2(il[393]) + , poseidon2_B_33_3(il[394]) + , poseidon2_B_34_0(il[395]) + , poseidon2_B_34_1(il[396]) + , poseidon2_B_34_2(il[397]) + , poseidon2_B_34_3(il[398]) + , poseidon2_B_35_0(il[399]) + , poseidon2_B_35_1(il[400]) + , poseidon2_B_35_2(il[401]) + , poseidon2_B_35_3(il[402]) + , poseidon2_B_36_0(il[403]) + , poseidon2_B_36_1(il[404]) + , poseidon2_B_36_2(il[405]) + , poseidon2_B_36_3(il[406]) + , poseidon2_B_37_0(il[407]) + , poseidon2_B_37_1(il[408]) + , poseidon2_B_37_2(il[409]) + , poseidon2_B_37_3(il[410]) + , poseidon2_B_38_0(il[411]) + , poseidon2_B_38_1(il[412]) + , poseidon2_B_38_2(il[413]) + , poseidon2_B_38_3(il[414]) + , poseidon2_B_39_0(il[415]) + , poseidon2_B_39_1(il[416]) + , poseidon2_B_39_2(il[417]) + , poseidon2_B_39_3(il[418]) + , poseidon2_B_40_0(il[419]) + , poseidon2_B_40_1(il[420]) + , poseidon2_B_40_2(il[421]) + , poseidon2_B_40_3(il[422]) + , poseidon2_B_41_0(il[423]) + , poseidon2_B_41_1(il[424]) + , poseidon2_B_41_2(il[425]) + , poseidon2_B_41_3(il[426]) + , poseidon2_B_42_0(il[427]) + , poseidon2_B_42_1(il[428]) + , poseidon2_B_42_2(il[429]) + , poseidon2_B_42_3(il[430]) + , poseidon2_B_43_0(il[431]) + , poseidon2_B_43_1(il[432]) + , poseidon2_B_43_2(il[433]) + , poseidon2_B_43_3(il[434]) + , poseidon2_B_44_0(il[435]) + , poseidon2_B_44_1(il[436]) + , poseidon2_B_44_2(il[437]) + , poseidon2_B_44_3(il[438]) + , poseidon2_B_45_0(il[439]) + , poseidon2_B_45_1(il[440]) + , poseidon2_B_45_2(il[441]) + , poseidon2_B_45_3(il[442]) + , poseidon2_B_46_0(il[443]) + , poseidon2_B_46_1(il[444]) + , poseidon2_B_46_2(il[445]) + , poseidon2_B_46_3(il[446]) + , poseidon2_B_47_0(il[447]) + , poseidon2_B_47_1(il[448]) + , poseidon2_B_47_2(il[449]) + , poseidon2_B_47_3(il[450]) + , poseidon2_B_48_0(il[451]) + , poseidon2_B_48_1(il[452]) + , poseidon2_B_48_2(il[453]) + , poseidon2_B_48_3(il[454]) + , poseidon2_B_49_0(il[455]) + , poseidon2_B_49_1(il[456]) + , poseidon2_B_49_2(il[457]) + , poseidon2_B_49_3(il[458]) + , poseidon2_B_4_0(il[459]) + , poseidon2_B_4_1(il[460]) + , poseidon2_B_4_2(il[461]) + , poseidon2_B_4_3(il[462]) + , poseidon2_B_50_0(il[463]) + , poseidon2_B_50_1(il[464]) + , poseidon2_B_50_2(il[465]) + , poseidon2_B_50_3(il[466]) + , poseidon2_B_51_0(il[467]) + , poseidon2_B_51_1(il[468]) + , poseidon2_B_51_2(il[469]) + , poseidon2_B_51_3(il[470]) + , poseidon2_B_52_0(il[471]) + , poseidon2_B_52_1(il[472]) + , poseidon2_B_52_2(il[473]) + , poseidon2_B_52_3(il[474]) + , poseidon2_B_53_0(il[475]) + , poseidon2_B_53_1(il[476]) + , poseidon2_B_53_2(il[477]) + , poseidon2_B_53_3(il[478]) + , poseidon2_B_54_0(il[479]) + , poseidon2_B_54_1(il[480]) + , poseidon2_B_54_2(il[481]) + , poseidon2_B_54_3(il[482]) + , poseidon2_B_55_0(il[483]) + , poseidon2_B_55_1(il[484]) + , poseidon2_B_55_2(il[485]) + , poseidon2_B_55_3(il[486]) + , poseidon2_B_56_0(il[487]) + , poseidon2_B_56_1(il[488]) + , poseidon2_B_56_2(il[489]) + , poseidon2_B_56_3(il[490]) + , poseidon2_B_57_0(il[491]) + , poseidon2_B_57_1(il[492]) + , poseidon2_B_57_2(il[493]) + , poseidon2_B_57_3(il[494]) + , poseidon2_B_58_0(il[495]) + , poseidon2_B_58_1(il[496]) + , poseidon2_B_58_2(il[497]) + , poseidon2_B_58_3(il[498]) + , poseidon2_B_59_0(il[499]) + , poseidon2_B_59_1(il[500]) + , poseidon2_B_59_2(il[501]) + , poseidon2_B_59_3(il[502]) + , poseidon2_B_5_0(il[503]) + , poseidon2_B_5_1(il[504]) + , poseidon2_B_5_2(il[505]) + , poseidon2_B_5_3(il[506]) + , poseidon2_B_6_0(il[507]) + , poseidon2_B_6_1(il[508]) + , poseidon2_B_6_2(il[509]) + , poseidon2_B_6_3(il[510]) + , poseidon2_B_7_0(il[511]) + , poseidon2_B_7_1(il[512]) + , poseidon2_B_7_2(il[513]) + , poseidon2_B_7_3(il[514]) + , poseidon2_B_8_0(il[515]) + , poseidon2_B_8_1(il[516]) + , poseidon2_B_8_2(il[517]) + , poseidon2_B_8_3(il[518]) + , poseidon2_B_9_0(il[519]) + , poseidon2_B_9_1(il[520]) + , poseidon2_B_9_2(il[521]) + , poseidon2_B_9_3(il[522]) + , poseidon2_EXT_LAYER_4(il[523]) + , poseidon2_EXT_LAYER_5(il[524]) + , poseidon2_EXT_LAYER_6(il[525]) + , poseidon2_EXT_LAYER_7(il[526]) + , poseidon2_T_0_4(il[527]) + , poseidon2_T_0_5(il[528]) + , poseidon2_T_0_6(il[529]) + , poseidon2_T_0_7(il[530]) + , poseidon2_T_1_4(il[531]) + , poseidon2_T_1_5(il[532]) + , poseidon2_T_1_6(il[533]) + , poseidon2_T_1_7(il[534]) + , poseidon2_T_2_4(il[535]) + , poseidon2_T_2_5(il[536]) + , poseidon2_T_2_6(il[537]) + , poseidon2_T_2_7(il[538]) + , poseidon2_T_3_4(il[539]) + , poseidon2_T_3_5(il[540]) + , poseidon2_T_3_6(il[541]) + , poseidon2_T_3_7(il[542]) + , poseidon2_T_60_4(il[543]) + , poseidon2_T_60_5(il[544]) + , poseidon2_T_60_6(il[545]) + , poseidon2_T_60_7(il[546]) + , poseidon2_T_61_4(il[547]) + , poseidon2_T_61_5(il[548]) + , poseidon2_T_61_6(il[549]) + , poseidon2_T_61_7(il[550]) + , poseidon2_T_62_4(il[551]) + , poseidon2_T_62_5(il[552]) + , poseidon2_T_62_6(il[553]) + , poseidon2_T_62_7(il[554]) + , poseidon2_T_63_4(il[555]) + , poseidon2_T_63_5(il[556]) + , poseidon2_T_63_6(il[557]) + , poseidon2_T_63_7(il[558]) + , poseidon2_a_0(il[559]) + , poseidon2_a_1(il[560]) + , poseidon2_a_2(il[561]) + , poseidon2_a_3(il[562]) + , poseidon2_b_0(il[563]) + , poseidon2_b_1(il[564]) + , poseidon2_b_2(il[565]) + , poseidon2_b_3(il[566]) + , poseidon2_clk(il[567]) + , poseidon2_input_addr(il[568]) + , poseidon2_mem_addr_read_a(il[569]) + , poseidon2_mem_addr_read_b(il[570]) + , poseidon2_mem_addr_read_c(il[571]) + , poseidon2_mem_addr_read_d(il[572]) + , poseidon2_mem_addr_write_a(il[573]) + , poseidon2_mem_addr_write_b(il[574]) + , poseidon2_mem_addr_write_c(il[575]) + , poseidon2_mem_addr_write_d(il[576]) + , poseidon2_output_addr(il[577]) + , poseidon2_sel_poseidon_perm(il[578]) + , range_check_alu_rng_chk(il[579]) + , range_check_clk(il[580]) + , range_check_cmp_hi_bits_rng_chk(il[581]) + , range_check_cmp_lo_bits_rng_chk(il[582]) + , range_check_dyn_diff(il[583]) + , range_check_dyn_rng_chk_bits(il[584]) + , range_check_dyn_rng_chk_pow_2(il[585]) + , range_check_gas_da_rng_chk(il[586]) + , range_check_gas_l2_rng_chk(il[587]) + , range_check_is_lte_u112(il[588]) + , range_check_is_lte_u128(il[589]) + , range_check_is_lte_u16(il[590]) + , range_check_is_lte_u32(il[591]) + , range_check_is_lte_u48(il[592]) + , range_check_is_lte_u64(il[593]) + , range_check_is_lte_u80(il[594]) + , range_check_is_lte_u96(il[595]) + , range_check_mem_rng_chk(il[596]) + , range_check_rng_chk_bits(il[597]) + , range_check_sel_lookup_0(il[598]) + , range_check_sel_lookup_1(il[599]) + , range_check_sel_lookup_2(il[600]) + , range_check_sel_lookup_3(il[601]) + , range_check_sel_lookup_4(il[602]) + , range_check_sel_lookup_5(il[603]) + , range_check_sel_lookup_6(il[604]) + , range_check_sel_rng_chk(il[605]) + , range_check_u16_r0(il[606]) + , range_check_u16_r1(il[607]) + , range_check_u16_r2(il[608]) + , range_check_u16_r3(il[609]) + , range_check_u16_r4(il[610]) + , range_check_u16_r5(il[611]) + , range_check_u16_r6(il[612]) + , range_check_u16_r7(il[613]) + , range_check_value(il[614]) + , sha256_clk(il[615]) + , sha256_input(il[616]) + , sha256_output(il[617]) + , sha256_sel_sha256_compression(il[618]) + , sha256_state(il[619]) + , slice_addr(il[620]) + , slice_clk(il[621]) + , slice_cnt(il[622]) + , slice_col_offset(il[623]) + , slice_one_min_inv(il[624]) + , slice_sel_cd_cpy(il[625]) + , slice_sel_mem_active(il[626]) + , slice_sel_return(il[627]) + , slice_sel_start(il[628]) + , slice_space_id(il[629]) + , slice_val(il[630]) + , lookup_rng_chk_pow_2_counts(il[631]) + , lookup_rng_chk_diff_counts(il[632]) + , lookup_rng_chk_0_counts(il[633]) + , lookup_rng_chk_1_counts(il[634]) + , lookup_rng_chk_2_counts(il[635]) + , lookup_rng_chk_3_counts(il[636]) + , lookup_rng_chk_4_counts(il[637]) + , lookup_rng_chk_5_counts(il[638]) + , lookup_rng_chk_6_counts(il[639]) + , lookup_rng_chk_7_counts(il[640]) + , lookup_pow_2_0_counts(il[641]) + , lookup_pow_2_1_counts(il[642]) + , lookup_byte_lengths_counts(il[643]) + , lookup_byte_operations_counts(il[644]) + , lookup_opcode_gas_counts(il[645]) + , kernel_output_lookup_counts(il[646]) + , lookup_into_kernel_counts(il[647]) + , lookup_cd_value_counts(il[648]) + , lookup_ret_value_counts(il[649]) + , incl_main_tag_err_counts(il[650]) + , incl_mem_tag_err_counts(il[651]) + , perm_rng_mem_inv(il[652]) + , perm_rng_cmp_lo_inv(il[653]) + , perm_rng_cmp_hi_inv(il[654]) + , perm_rng_alu_inv(il[655]) + , perm_cmp_alu_inv(il[656]) + , perm_rng_gas_l2_inv(il[657]) + , perm_rng_gas_da_inv(il[658]) + , perm_pos_mem_read_a_inv(il[659]) + , perm_pos_mem_read_b_inv(il[660]) + , perm_pos_mem_read_c_inv(il[661]) + , perm_pos_mem_read_d_inv(il[662]) + , perm_pos_mem_write_a_inv(il[663]) + , perm_pos_mem_write_b_inv(il[664]) + , perm_pos_mem_write_c_inv(il[665]) + , perm_pos_mem_write_d_inv(il[666]) + , perm_slice_mem_inv(il[667]) + , perm_main_alu_inv(il[668]) + , perm_main_bin_inv(il[669]) + , perm_main_conv_inv(il[670]) + , perm_main_pos2_perm_inv(il[671]) + , perm_main_pedersen_inv(il[672]) + , perm_main_slice_inv(il[673]) + , perm_main_mem_a_inv(il[674]) + , perm_main_mem_b_inv(il[675]) + , perm_main_mem_c_inv(il[676]) + , perm_main_mem_d_inv(il[677]) + , perm_main_mem_ind_addr_a_inv(il[678]) + , perm_main_mem_ind_addr_b_inv(il[679]) + , perm_main_mem_ind_addr_c_inv(il[680]) + , perm_main_mem_ind_addr_d_inv(il[681]) + , lookup_rng_chk_pow_2_inv(il[682]) + , lookup_rng_chk_diff_inv(il[683]) + , lookup_rng_chk_0_inv(il[684]) + , lookup_rng_chk_1_inv(il[685]) + , lookup_rng_chk_2_inv(il[686]) + , lookup_rng_chk_3_inv(il[687]) + , lookup_rng_chk_4_inv(il[688]) + , lookup_rng_chk_5_inv(il[689]) + , lookup_rng_chk_6_inv(il[690]) + , lookup_rng_chk_7_inv(il[691]) + , lookup_pow_2_0_inv(il[692]) + , lookup_pow_2_1_inv(il[693]) + , lookup_byte_lengths_inv(il[694]) + , lookup_byte_operations_inv(il[695]) + , lookup_opcode_gas_inv(il[696]) + , kernel_output_lookup_inv(il[697]) + , lookup_into_kernel_inv(il[698]) + , lookup_cd_value_inv(il[699]) + , lookup_ret_value_inv(il[700]) + , incl_main_tag_err_inv(il[701]) + , incl_mem_tag_err_inv(il[702]) + , binary_acc_ia_shift(il[703]) + , binary_acc_ib_shift(il[704]) + , binary_acc_ic_shift(il[705]) + , binary_mem_tag_ctr_shift(il[706]) + , binary_op_id_shift(il[707]) + , cmp_a_hi_shift(il[708]) + , cmp_a_lo_shift(il[709]) + , cmp_b_hi_shift(il[710]) + , cmp_b_lo_shift(il[711]) + , cmp_cmp_rng_ctr_shift(il[712]) + , cmp_op_gt_shift(il[713]) + , cmp_p_sub_a_hi_shift(il[714]) + , cmp_p_sub_a_lo_shift(il[715]) + , cmp_p_sub_b_hi_shift(il[716]) + , cmp_p_sub_b_lo_shift(il[717]) + , cmp_sel_rng_chk_shift(il[718]) + , main_da_gas_remaining_shift(il[719]) + , main_emit_l2_to_l1_msg_write_offset_shift(il[720]) + , main_emit_note_hash_write_offset_shift(il[721]) + , main_emit_nullifier_write_offset_shift(il[722]) + , main_emit_unencrypted_log_write_offset_shift(il[723]) + , main_internal_return_ptr_shift(il[724]) + , main_l1_to_l2_msg_exists_write_offset_shift(il[725]) + , main_l2_gas_remaining_shift(il[726]) + , main_note_hash_exist_write_offset_shift(il[727]) + , main_nullifier_exists_write_offset_shift(il[728]) + , main_nullifier_non_exists_write_offset_shift(il[729]) + , main_pc_shift(il[730]) + , main_sel_execution_row_shift(il[731]) + , main_sload_write_offset_shift(il[732]) + , main_sstore_write_offset_shift(il[733]) + , mem_glob_addr_shift(il[734]) + , mem_rw_shift(il[735]) + , mem_sel_mem_shift(il[736]) + , mem_tag_shift(il[737]) + , mem_tsp_shift(il[738]) + , mem_val_shift(il[739]) + , slice_addr_shift(il[740]) + , slice_clk_shift(il[741]) + , slice_cnt_shift(il[742]) + , slice_col_offset_shift(il[743]) + , slice_sel_cd_cpy_shift(il[744]) + , slice_sel_mem_active_shift(il[745]) + , slice_sel_return_shift(il[746]) + , slice_sel_start_shift(il[747]) + , slice_space_id_shift(il[748]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index 4e64bd2f54c..34f4c8b0771 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -90,11 +90,7 @@ 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_first, main_zeroes, powers_power_of_2 -<<<<<<< HEAD -#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_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_cmov, 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_cmov, 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 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, bytecode_end_latch, bytecode_length_remaining, bytecode_packed, bytecode_running_hash, 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_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_cmov, 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_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_cmov, 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 ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) +#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, bytecode_end_latch, bytecode_length_remaining, bytecode_packed, bytecode_running_hash, 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_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_cmov, 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_cmov, 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 @@ -123,20 +119,12 @@ class AvmFlavor { static constexpr bool HasZK = false; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 16; -<<<<<<< HEAD - static constexpr size_t NUM_WITNESS_ENTITIES = 683; -======= - static constexpr size_t NUM_WITNESS_ENTITIES = 686; ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) + static constexpr size_t NUM_WITNESS_ENTITIES = 687; 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 -<<<<<<< HEAD - static constexpr size_t NUM_ALL_ENTITIES = 745; -======= - static constexpr size_t NUM_ALL_ENTITIES = 748; ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) + static constexpr size_t NUM_ALL_ENTITIES = 749; // The total number of witnesses including shifts and derived entities. static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; 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 eab489088fb..a0e1513ff67 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp @@ -717,11 +717,7 @@ template struct AvmFullRow { RefVector as_vector() const; static std::vector names(); -<<<<<<< HEAD - static constexpr size_t SIZE = 699; -======= - static constexpr size_t SIZE = 702; ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) + static constexpr size_t SIZE = 703; }; template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); 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 fcf44b645f0..16edd8d93a2 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -35,9 +35,13 @@ class AvmExecutionTests : public ::testing::Test { Execution::set_trace_builder_constructor([](VmPublicInputs public_inputs, ExecutionHints execution_hints, uint32_t side_effect_counter, - std::vector calldata) { - return AvmTraceBuilder( - std::move(public_inputs), std::move(execution_hints), side_effect_counter, std::move(calldata)) + std::vector calldata, + std::vector contract_bytecode) { + return AvmTraceBuilder(std::move(public_inputs), + std::move(execution_hints), + side_effect_counter, + std::move(calldata), + contract_bytecode) .set_full_precomputed_tables(false) .set_range_check_required(false); }); @@ -61,10 +65,12 @@ class AvmExecutionTests : public ::testing::Test { * @param instructions A vector of the instructions to be executed. * @return The trace as a vector of Row. */ - std::vector gen_trace_from_instr(std::vector const& instructions) const + std::vector gen_trace_from_instr(std::vector bytecode) const { std::vector calldata{}; - return Execution::gen_trace(instructions, calldata, public_inputs_vec); + std::vector returndata{}; + + return Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); } void feed_output(uint32_t output_offset, FF const& value, FF const& side_effect_counter, FF const& metadata) @@ -112,7 +118,7 @@ TEST_F(AvmExecutionTests, basicAddReturn) Field(&Instruction::operands, ElementsAre(VariantWith(0), VariantWith(0), VariantWith(0))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); validate_trace(std::move(trace), public_inputs, {}, {}); } @@ -173,7 +179,7 @@ TEST_F(AvmExecutionTests, setAndSubOpcodes) VariantWith(51), VariantWith(1))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the subtraction selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sub == 1; }); @@ -249,7 +255,7 @@ TEST_F(AvmExecutionTests, powerWithMulOpcodes) Field(&Instruction::operands, ElementsAre(VariantWith(0), VariantWith(0), VariantWith(0))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the multiplication selector and pc = 13 auto row = std::ranges::find_if( @@ -310,7 +316,7 @@ TEST_F(AvmExecutionTests, simpleInternalCall) // INTERNALRETURN EXPECT_EQ(instructions.at(5).op_code, OpCode::INTERNALRETURN); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Expected sequence of PCs during execution std::vector pc_sequence{ 0, 1, 4, 5, 2, 3 }; @@ -386,7 +392,7 @@ TEST_F(AvmExecutionTests, nestedInternalCalls) EXPECT_EQ(instructions.at(i).op_code, opcode_sequence.at(i)); } - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Expected sequence of PCs during execution std::vector pc_sequence{ 0, 1, 2, 8, 6, 7, 9, 10, 4, 5, 11, 3 }; @@ -468,7 +474,8 @@ TEST_F(AvmExecutionTests, jumpAndCalldatacopy) Field(&Instruction::operands, ElementsAre(VariantWith(5))))); std::vector returndata; - auto trace = Execution::gen_trace(instructions, returndata, std::vector{ 13, 156 }, public_inputs_vec); + auto trace = + Execution::gen_trace(bytecode, std::vector{ 13, 156 }, public_inputs_vec, returndata, ExecutionHints()); // Expected sequence of PCs during execution std::vector pc_sequence{ @@ -559,8 +566,10 @@ TEST_F(AvmExecutionTests, jumpiAndCalldatacopy) ElementsAre(VariantWith(0), VariantWith(6), VariantWith(10))))); std::vector returndata; - auto trace_jump = Execution::gen_trace(instructions, returndata, std::vector{ 9873123 }, public_inputs_vec); - auto trace_no_jump = Execution::gen_trace(instructions, returndata, std::vector{ 0 }, public_inputs_vec); + auto trace_jump = + Execution::gen_trace(bytecode, std::vector{ 9873123 }, public_inputs_vec, returndata, ExecutionHints()); + auto trace_no_jump = + Execution::gen_trace(bytecode, std::vector{ 0 }, public_inputs_vec, returndata, ExecutionHints()); // Expected sequence of PCs during execution with jump std::vector pc_sequence_jump{ 0, 1, 2, 3, 4, 6, 7 }; @@ -618,7 +627,7 @@ TEST_F(AvmExecutionTests, movOpcode) Field(&Instruction::operands, ElementsAre(VariantWith(0), VariantWith(171), VariantWith(33))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the MOV selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mov == 1; }); @@ -672,7 +681,7 @@ TEST_F(AvmExecutionTests, cmovOpcode) VariantWith(32), VariantWith(18))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the CMOV selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cmov == 1; }); @@ -722,7 +731,7 @@ TEST_F(AvmExecutionTests, indMovOpcode) Field(&Instruction::operands, ElementsAre(VariantWith(1), VariantWith(1), VariantWith(2))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the MOV selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_mov == 1; }); @@ -764,7 +773,7 @@ TEST_F(AvmExecutionTests, setAndCastOpcodes) VariantWith(17), VariantWith(18))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the cast selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_cast == 1; }); @@ -823,8 +832,8 @@ TEST_F(AvmExecutionTests, toRadixLeOpcode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata; - auto trace = - Execution::gen_trace(instructions, returndata, std::vector{ FF::modulus - FF(1) }, public_inputs_vec); + auto trace = Execution::gen_trace( + bytecode, std::vector{ FF::modulus - FF(1) }, public_inputs_vec, returndata, ExecutionHints()); // Find the first row enabling the TORADIXLE selector // Expected output is bitwise decomposition of MODULUS - 1..could hardcode the result but it's a bit long @@ -889,8 +898,8 @@ TEST_F(AvmExecutionTests, toRadixLeOpcodeBitsMode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata; - auto trace = - Execution::gen_trace(instructions, returndata, std::vector{ FF::modulus - FF(1) }, public_inputs_vec); + auto trace = Execution::gen_trace( + bytecode, std::vector{ FF::modulus - FF(1) }, public_inputs_vec, returndata, ExecutionHints()); // Find the first row enabling the TORADIXLE selector // Expected output is bitwise decomposition of MODULUS - 1..could hardcode the result but it's a bit long @@ -966,7 +975,7 @@ TEST_F(AvmExecutionTests, sha256CompressionOpcode) // 4091010797,3974542186]), std::vector expected_output = { 1862536192, 526086805, 2067405084, 593147560, 726610467, 813867028, 4091010797ULL, 3974542186ULL }; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1027,7 +1036,7 @@ TEST_F(AvmExecutionTests, poseidon2PermutationOpCode) FF(std::string("0x018555a8eb50cf07f64b019ebaf3af3c925c93e631f3ecd455db07bbb52bbdd3")), FF(std::string("0x0cbea457c91c22c6c31fd89afd2541efc2edf31736b9f721e823b2165c90fd41")) }; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1100,7 +1109,7 @@ TEST_F(AvmExecutionTests, keccakf1600OpCode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector calldata = std::vector(); std::vector returndata = std::vector(); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1157,7 +1166,7 @@ TEST_F(AvmExecutionTests, keccakOpCode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector calldata = std::vector(); std::vector returndata = std::vector(); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1219,7 +1228,7 @@ TEST_F(AvmExecutionTests, pedersenHashOpCode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata = std::vector(); std::vector calldata = { FF(1), FF(1) }; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata[0], expected_output); @@ -1286,7 +1295,7 @@ TEST_F(AvmExecutionTests, embeddedCurveAddOpCode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata; std::vector calldata = { a.x, a.y, FF(a_is_inf ? 1 : 0), b.x, b.y, FF(b_is_inf ? 1 : 0) }; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1373,7 +1382,7 @@ TEST_F(AvmExecutionTests, msmOpCode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1446,7 +1455,7 @@ TEST_F(AvmExecutionTests, pedersenCommitmentOpcode) // Assign a vector that we will mutate internally in gen_trace to store the return values; std::vector returndata; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); EXPECT_EQ(returndata, expected_output); @@ -1658,7 +1667,7 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes) public_inputs_vec[FEE_PER_L2_GAS_OFFSET] = feeperl2gas; std::vector returndata; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); // Validate returndata EXPECT_EQ(returndata, expected_returndata); @@ -1756,7 +1765,7 @@ TEST_F(AvmExecutionTests, l2GasLeft) VariantWith(static_cast(EnvironmentVariable::L2GASLEFT)), VariantWith(17))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the L2GASLEFT selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_l2gasleft == 1; }); @@ -1802,7 +1811,7 @@ TEST_F(AvmExecutionTests, daGasLeft) VariantWith(static_cast(EnvironmentVariable::DAGASLEFT)), VariantWith(39))))); - auto trace = gen_trace_from_instr(instructions); + auto trace = gen_trace_from_instr(bytecode); // Find the first row enabling the DAGASLEFT selector auto row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_dagasleft == 1; }); @@ -1831,7 +1840,7 @@ TEST_F(AvmExecutionTests, ExecutorThrowsWithIncorrectNumberOfPublicInputs) auto bytecode = hex_to_bytes(bytecode_hex); auto instructions = Deserialization::parse(bytecode); - EXPECT_THROW_WITH_MESSAGE(Execution::gen_trace(instructions, calldata, returndata, public_inputs_vec), + EXPECT_THROW_WITH_MESSAGE(Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()), "Public inputs vector is not of PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH"); } @@ -1874,7 +1883,7 @@ TEST_F(AvmExecutionTests, kernelOutputEmitOpcodes) std::vector calldata = {}; std::vector returndata = {}; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); // CHECK EMIT NOTE HASH // Check output data + side effect counters have been set correctly @@ -1972,7 +1981,7 @@ TEST_F(AvmExecutionTests, kernelOutputStorageLoadOpcodeSimple) // side effect counter 0 = value 42 auto execution_hints = ExecutionHints().with_storage_value_hints({ { 0, 42 } }); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints); // CHECK SLOAD // Check output data + side effect counters have been set correctly @@ -2026,7 +2035,7 @@ TEST_F(AvmExecutionTests, kernelOutputStorageStoreOpcodeSimple) std::vector returndata; - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, ExecutionHints()); // CHECK SSTORE auto sstore_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sstore == 1; }); EXPECT_EQ(sstore_row->main_ia, 42); // Read value @@ -2089,7 +2098,7 @@ TEST_F(AvmExecutionTests, kernelOutputStorageOpcodes) // side effect counter 0 = value 42 auto execution_hints = ExecutionHints().with_storage_value_hints({ { 0, 42 } }); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints); // CHECK SLOAD // Check output data + side effect counters have been set correctly @@ -2172,7 +2181,7 @@ TEST_F(AvmExecutionTests, kernelOutputHashExistsOpcodes) .with_storage_value_hints({ { 0, 1 }, { 1, 1 }, { 2, 1 } }) .with_note_hash_exists_hints({ { 0, 1 }, { 1, 1 }, { 2, 1 } }); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints); // CHECK NOTEHASHEXISTS auto note_hash_row = @@ -2306,10 +2315,10 @@ TEST_F(AvmExecutionTests, opCallOpcodes) .l2_gas_used = 0, .da_gas_used = 0, .end_side_effect_counter = 0, - .packed_bytecode = {}, + .bytecode = {}, } }); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints); EXPECT_EQ(returndata, std::vector({ 9, 8, 1 })); // The 1 represents the success validate_trace(std::move(trace), public_inputs, calldata, returndata); @@ -2358,7 +2367,7 @@ TEST_F(AvmExecutionTests, opGetContractInstanceOpcodes) auto execution_hints = ExecutionHints().with_contract_instance_hints({ { address, { address, 1, 2, 3, 4, 5, 6 } } }); - auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec, execution_hints); + auto trace = Execution::gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints); EXPECT_EQ(returndata, std::vector({ 1, 2, 3, 4, 5, 6 })); // The first one represents true validate_trace(std::move(trace), public_inputs, calldata, returndata); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.cpp index 905e4651abe..199ae2b15ce 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.cpp @@ -1,19 +1,38 @@ - #include "barretenberg/vm/avm/trace/bytecode_trace.hpp" #include "barretenberg/crypto/poseidon2/poseidon2.hpp" #include "barretenberg/crypto/poseidon2/poseidon2_params.hpp" -#include "barretenberg/vm/avm/trace/common.hpp" -namespace bb::avm_trace { +namespace bb::avm_trace { using poseidon2 = crypto::Poseidon2; +AvmBytecodeTraceBuilder::AvmBytecodeTraceBuilder(const std::vector& contract_bytecode, + const ExecutionHints& hints) +{ + // Do we need to pad contract_bytecode to be 31bytes? + std::vector> all_contracts_bytecode{ contract_bytecode }; + for (const auto& hint : hints.externalcall_hints) { + all_contracts_bytecode.push_back(hint.bytecode); + } + for (auto& contract : all_contracts_bytecode) { + // To make from_buffer work properly, we need to make sure the contract is a multiple of 31 bytes + // Otherwise we will end up over-reading the buffer + size_t padding = 31 - (contract.size() % 31); + contract.resize(contract.size() + padding, 0); + std::vector contract_bytecode_fields; + for (size_t i = 0; i < contract.size(); i += 31) { + uint256_t u256_elem = from_buffer(contract, i); + // Drop the last byte + contract_bytecode_fields.emplace_back(u256_elem >> 8); + } + this->all_contracts_bytecode.push_back(contract_bytecode_fields); + } +} + void AvmBytecodeTraceBuilder::build_bytecode_columns() { - // Loop over the hints, getting the bytecode for (auto& contract_bytecode : all_contracts_bytecode) { FF running_hash = FF::zero(); - // This should be checked to be the same as MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS - size_t bytecode_length = contract_bytecode.size(); - for (size_t i = 0; i < bytecode_length; ++i) { + // This size is already based on the number of fields + for (size_t i = 0; i < contract_bytecode.size(); ++i) { bytecode_trace.push_back(BytecodeTraceEntry{ .packed_bytecode = contract_bytecode[i], .running_hash = running_hash, @@ -22,7 +41,7 @@ void AvmBytecodeTraceBuilder::build_bytecode_columns() running_hash = poseidon2::hash({ contract_bytecode[i], running_hash }); } // Now running_hash actually contains the bytecode hash - BytecodeTraceEntry last_entry{}; + BytecodeTraceEntry last_entry; last_entry.running_hash = running_hash; last_entry.bytecode_length_remaining = 0; // TODO: Come back to this later diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.hpp index 9225fcf93cb..10700807ae0 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/bytecode_trace.hpp @@ -9,10 +9,11 @@ namespace bb::avm_trace { class AvmBytecodeTraceBuilder { public: struct BytecodeTraceEntry { - // Calculate the bytecode hash + // The field packed bytecode FF packed_bytecode{}; + // Calculate the bytecode hash FF running_hash{}; - // This is the length in fields, not bytes - max 1000 fields + // This is the length in fields, not bytes - max 3000 fields uint16_t bytecode_length_remaining = 0; // Derive the class Id @@ -22,24 +23,8 @@ class AvmBytecodeTraceBuilder { FF contract_address{}; }; // These interfaces will change when we start feeding in more inputs and hints - AvmBytecodeTraceBuilder(std::vector> all_contracts_bytecode) - : all_contracts_bytecode(std::move(all_contracts_bytecode)) - {} - - AvmBytecodeTraceBuilder(const std::vector>& all_contracts_bytecode_bytes) - { - for (const auto& contract_bytecode : all_contracts_bytecode_bytes) { - std::vector contract_bytecode_fields; - size_t num_fields_required = - (contract_bytecode.size() / 31) + static_cast(contract_bytecode.size() % 31 != 0); - contract_bytecode_fields.reserve(num_fields_required); - for (size_t i = 0; i < contract_bytecode.size(); i += 31) { - auto field_elem = from_buffer(contract_bytecode.data(), i); - contract_bytecode_fields.push_back(field_elem); - } - this->all_contracts_bytecode.push_back(contract_bytecode_fields); - } - } + AvmBytecodeTraceBuilder(const std::vector& contract_bytecode, const ExecutionHints& hints); + size_t size() const { return bytecode_trace.size(); } void reset(); void finalize(std::vector>& main_trace); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp index a780aa6ac7e..e7cb2b51e82 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp @@ -149,9 +149,13 @@ void show_trace_info(const auto& trace) Execution::TraceBuilderConstructor Execution::trace_builder_constructor = [](VmPublicInputs public_inputs, ExecutionHints execution_hints, uint32_t side_effect_counter, - std::vector calldata) { - return AvmTraceBuilder( - std::move(public_inputs), std::move(execution_hints), side_effect_counter, std::move(calldata)); + std::vector calldata, + std::vector contract_bytecode) { + return AvmTraceBuilder(std::move(public_inputs), + std::move(execution_hints), + side_effect_counter, + std::move(calldata), + contract_bytecode); }; /** @@ -186,7 +190,7 @@ std::tuple Execution::prove(std::vector returndata; std::vector trace = AVM_TRACK_TIME_V( - "prove/gen_trace", gen_trace(bytecode, returndata, calldata, public_inputs_vec, execution_hints)); + "prove/gen_trace", gen_trace(bytecode, calldata, public_inputs_vec, returndata, execution_hints)); if (!avm_dump_trace_path.empty()) { info("Dumping trace as CSV to: " + avm_dump_trace_path.string()); dump_trace_as_csv(trace, avm_dump_trace_path); @@ -406,21 +410,6 @@ bool Execution::verify(AvmFlavor::VerificationKey vk, HonkProof const& proof) return verifier.verify_proof(raw_proof, public_inputs_columns); } -/** - * @brief Generate the execution trace pertaining to the supplied instructions. - * - * @param instructions A vector of the instructions to be executed. - * @param calldata expressed as a vector of finite field elements. - * @return The trace as a vector of Row. - */ -std::vector Execution::gen_trace(std::vector const& bytecode, - std::vector const& calldata, - std::vector const& public_inputs_vec) -{ - std::vector returndata{}; - return gen_trace(bytecode, returndata, calldata, public_inputs_vec); -} - /** * @brief Generate the execution trace pertaining to the supplied instructions returns the return data. * @@ -430,9 +419,9 @@ std::vector Execution::gen_trace(std::vector const& bytecode, * @return The trace as a vector of Row. */ std::vector Execution::gen_trace(std::vector const& bytecode, - std::vector& returndata, std::vector const& calldata, std::vector const& public_inputs_vec, + std::vector& returndata, ExecutionHints const& execution_hints) { @@ -446,8 +435,8 @@ std::vector Execution::gen_trace(std::vector const& bytecode, !public_inputs_vec.empty() ? static_cast(public_inputs_vec[PCPI_START_SIDE_EFFECT_COUNTER_OFFSET]) : 0; - AvmTraceBuilder trace_builder = - Execution::trace_builder_constructor(public_inputs, execution_hints, start_side_effect_counter, calldata); + AvmTraceBuilder trace_builder = Execution::trace_builder_constructor( + public_inputs, execution_hints, start_side_effect_counter, calldata, bytecode); // Copied version of pc maintained in trace builder. The value of pc is evolving based // on opcode logic and therefore is not maintained here. However, the next opcode in the execution @@ -955,6 +944,7 @@ std::vector Execution::gen_trace(std::vector const& bytecode, } auto trace = trace_builder.finalize(); + show_trace_info(trace); return trace; } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp index 93f33adba08..6ad0d777249 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp @@ -18,7 +18,8 @@ class Execution { using TraceBuilderConstructor = std::function calldata)>; + std::vector calldata, + std::vector contract_bytecode)>; Execution() = default; @@ -26,18 +27,12 @@ class Execution { static VmPublicInputs convert_public_inputs(std::vector const& public_inputs_vec); - // TODO: Clean these overloaded functions. We probably need less and confusing overloading. - static std::vector gen_trace(std::vector const& bytecode, - std::vector& returndata, - std::vector const& calldata, - std::vector const& public_inputs, - ExecutionHints const& execution_hints = {}); - static std::vector gen_trace(std::vector const& bytecode, - std::vector const& calldata = {}, - std::vector const& public_inputs = {}); + // Bytecode is currently the bytecode of the top-level function call + // Eventually this will be the bytecode of the dispatch function of top-level contract static std::vector gen_trace(std::vector const& bytecode, std::vector const& calldata, std::vector const& public_inputs, + std::vector& returndata, ExecutionHints const& execution_hints); // For testing purposes only. diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp index 47ad097b2f8..db01e5e3a8c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp @@ -12,7 +12,7 @@ struct ExternalCallHint { uint32_t l2_gas_used; uint32_t da_gas_used; FF end_side_effect_counter; - std::vector packed_bytecode; + std::vector bytecode; }; // Add support for deserialization of ExternalCallHint. This is implicitly used by serialize::read @@ -25,7 +25,7 @@ inline void read(uint8_t const*& it, ExternalCallHint& hint) read(it, hint.l2_gas_used); read(it, hint.da_gas_used); read(it, hint.end_side_effect_counter); - read(it, hint.packed_bytecode); + read(it, hint.bytecode); } struct ContractInstanceHint { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp index 9a952c51431..a9162d4750d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp @@ -278,14 +278,16 @@ void AvmTraceBuilder::finalise_mem_trace_lookup_counts() * underlying traces and initialize gas values. */ AvmTraceBuilder::AvmTraceBuilder(VmPublicInputs public_inputs, - ExecutionHints execution_hints_, + const ExecutionHints& execution_hints_, uint32_t side_effect_counter, - std::vector calldata) + std::vector calldata, + const std::vector& contract_bytecode) // NOTE: we initialise the environment builder here as it requires public inputs : calldata(std::move(calldata)) , side_effect_counter(side_effect_counter) , execution_hints(std::move(execution_hints_)) , kernel_trace_builder(side_effect_counter, public_inputs, execution_hints) + , bytecode_trace_builder(contract_bytecode, execution_hints) { // TODO: think about cast gas_trace_builder.set_initial_gas( @@ -2499,8 +2501,10 @@ void AvmTraceBuilder::op_l1_to_l2_msg_exists(uint8_t indirect, auto leaf_index = unconstrained_read_from_memory(leaf_index_offset); Row row = create_kernel_output_opcode_for_leaf_index(indirect, clk, log_offset, dest_offset, uint32_t(leaf_index)); - kernel_trace_builder.op_l1_to_l2_msg_exists( - clk, uint32_t(leaf_index) /*side_effect_counter*/, row.main_ia, /*safe*/ static_cast(row.main_ib)); + kernel_trace_builder.op_l1_to_l2_msg_exists(clk, + uint32_t(leaf_index) /*side_effect_counter*/, + row.main_ia, + /*safe*/ static_cast(row.main_ib)); row.main_sel_op_l1_to_l2_msg_exists = FF(1); // Constrain gas cost @@ -2607,12 +2611,12 @@ void AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, // Truncate the hash to 31 bytes so it will be a valid field element FF trunc_hash = FF(from_buffer(output.data()) >> 8); - // The + 32 here is for the contract_address in bytes, the +4 is for the extra 4 bytes that contain log_size and is - // prefixed to message see toBuffer in unencrypted_l2_log.ts + // The + 32 here is for the contract_address in bytes, the +4 is for the extra 4 bytes that contain log_size and + // is prefixed to message see toBuffer in unencrypted_l2_log.ts FF length_of_preimage = num_bytes + 32 + 4; // The + 4 is because the kernels store the length of the - // processed log as 4 bytes; thus for this length value to match the log length stored in the kernels, we need to - // add four to the length here. [Copied from unencrypted_l2_log.ts] + // processed log as 4 bytes; thus for this length value to match the log length stored in the kernels, we need + // to add four to the length here. [Copied from unencrypted_l2_log.ts] FF metadata_log_length = length_of_preimage + 4; Row row = Row{ .main_clk = clk, @@ -3351,8 +3355,8 @@ void AvmTraceBuilder::op_pedersen_commit(uint8_t indirect, * @param indirect A byte encoding information about indirect/direct memory access. * @param src_offset An index in memory pointing to the input of the To_Radix_LE conversion. * @param dst_offset An index in memory pointing to the output of the To_Radix_LE conversion. - * @param radix_offset An index in memory pointing to the strict upper bound of each converted limb, i.e., 0 <= limb < - * radix. + * @param radix_offset An index in memory pointing to the strict upper bound of each converted limb, i.e., 0 <= limb + * < radix. * @param num_limbs The number of limbs to the value into. * @param output_bits Should the output be U1s instead of U8s? */ @@ -3880,21 +3884,14 @@ std::vector AvmTraceBuilder::finalize() /********************************************************************************************** * BYTECODE TRACE INCLUSION **********************************************************************************************/ - // For now we just calculate bytecode hashing, but we will do more here - std::vector> all_contracts_bytecode{}; - all_contracts_bytecode.reserve(execution_hints.externalcall_hints.size() + 1); - for (auto const& hint : execution_hints.externalcall_hints) { - all_contracts_bytecode.push_back(hint.packed_bytecode); - } - // This interface will change when we start feeding in more inputs and hints - auto avm_bytecode_builder = AvmBytecodeTraceBuilder(all_contracts_bytecode); - avm_bytecode_builder.build_bytecode_columns(); - if (avm_bytecode_builder.size() > main_trace_size) { - main_trace_size = avm_bytecode_builder.size(); - main_trace.resize(main_trace_size, {}); + bytecode_trace_builder.build_bytecode_columns(); + // Should not have to resize in the future, but for now we do + if (bytecode_trace_builder.size() > main_trace_size) { + main_trace_size = bytecode_trace_builder.size(); + main_trace.resize(main_trace_size); } - avm_bytecode_builder.finalize(main_trace); + bytecode_trace_builder.finalize(main_trace); /********************************************************************************************** * ONLY FIXED TABLES FROM HERE ON @@ -3982,7 +3979,8 @@ std::vector AvmTraceBuilder::finalize() } } // In case the range entries are larger than the main trace, we need to resize the main trace - // Normally this would happen at the start of finalize, but we cannot finalize the range checks until after gas :( + // Normally this would happen at the start of finalize, but we cannot finalize the range checks until after gas + // :( if (range_entries.size() > new_trace_size) { main_trace.resize(range_entries.size(), {}); new_trace_size = range_entries.size(); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp index a9a1ee74476..0ccb8fe03b3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp @@ -4,6 +4,7 @@ #include "barretenberg/vm/avm/trace/alu_trace.hpp" #include "barretenberg/vm/avm/trace/binary_trace.hpp" +#include "barretenberg/vm/avm/trace/bytecode_trace.hpp" #include "barretenberg/vm/avm/trace/common.hpp" #include "barretenberg/vm/avm/trace/execution_hints.hpp" #include "barretenberg/vm/avm/trace/gadgets/conversion_trace.hpp" @@ -53,9 +54,10 @@ class AvmTraceBuilder { public: AvmTraceBuilder(VmPublicInputs public_inputs = {}, - ExecutionHints execution_hints = {}, + const ExecutionHints& execution_hints = {}, uint32_t side_effect_counter = 0, - std::vector calldata = {}); + std::vector calldata = {}, + const std::vector& contract_bytecode = {}); uint32_t getPc() const { return pc; } @@ -255,6 +257,7 @@ class AvmTraceBuilder { AvmEccTraceBuilder ecc_trace_builder; AvmSliceTraceBuilder slice_trace_builder; AvmRangeCheckBuilder range_check_builder; + AvmBytecodeTraceBuilder bytecode_trace_builder; Row create_kernel_lookup_opcode(uint8_t indirect, uint32_t dst_offset, FF value, AvmMemoryTag w_tag); diff --git a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp index 33bb17bdd7d..3815af00a71 100644 --- a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp @@ -35,12 +35,8 @@ #define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 691 #define PUBLIC_CONTEXT_INPUTS_LENGTH 42 #define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 66 -<<<<<<< HEAD -#define AVM_PROOF_LENGTH_IN_FIELDS 3822 +#define AVM_PROOF_LENGTH_IN_FIELDS 3842 #define AVM_PUBLIC_COLUMN_MAX_SIZE_LOG2 8 -======= -#define AVM_PROOF_LENGTH_IN_FIELDS 3837 ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) #define MEM_TAG_U1 1 #define MEM_TAG_U8 2 #define MEM_TAG_U16 3 diff --git a/docs/docs/protocol-specs/contract-deployment/classes.md b/docs/docs/protocol-specs/contract-deployment/classes.md index 1dc82aaeb37..47a244707c1 100644 --- a/docs/docs/protocol-specs/contract-deployment/classes.md +++ b/docs/docs/protocol-specs/contract-deployment/classes.md @@ -351,7 +351,7 @@ It is strongly recommended for developers registering new classes to broadcast t The `register`, `broadcast_unconstrained_function`, and `broadcast_private_function` functions all receive and emit variable-length bytecode in unencrypted events. In every function, bytecode is encoded in a fixed-length array of field elements, which sets a maximum length for each: -- `MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS`: 20000 field elements, used for a contract's public bytecode in the `register` function. +- `MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS`: 3000 field elements, used for a contract's public bytecode in the `register` function. - `MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS`: 3000 field elements, used for the ACIR and Brillig bytecode of a broadcasted private function in `broadcast_private_function`. - `MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS`: 3000 field elements, used for the Brillig bytecode of a broadcasted unconstrained function in `broadcast_unconstrained_function`. diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 2ba8c116f88..785a7a3e1dd 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -139,15 +139,15 @@ library Constants { uint256 internal constant L2_GAS_PER_LOG_BYTE = 4; uint256 internal constant L2_GAS_PER_L2_TO_L1_MSG = 200; uint256 internal constant CANONICAL_AUTH_REGISTRY_ADDRESS = - 10367652630266020489903597403740855630875483787219246409272999235813107556528; + 21858690510998468448249336576047234693354455518526085448004898459468113886010; uint256 internal constant DEPLOYER_CONTRACT_ADDRESS = - 21792654422491608007482167227129894566813584910736822764811909177844536634641; + 21384973585466946178399054773394323067029798423084751755473882358686503448343; uint256 internal constant REGISTERER_CONTRACT_ADDRESS = - 15585798673853010492123669545215912437570562212426440404568423552367406586114; + 10581302492939110815750835056397422686553529472299821216715038456465456345884; uint256 internal constant FEE_JUICE_ADDRESS = - 4444336541168247213466174979492237365557250727898612974872691091083784293944; + 20062978023835234645866731546586295662228679649547491742647880733929078945532; uint256 internal constant ROUTER_ADDRESS = - 8564859233461589816161798798617919343839107831666181567459338285971665485386; + 13927089119125078473425402705541267665490602945311909051580945109517632906396; uint256 internal constant AZTEC_ADDRESS_LENGTH = 1; uint256 internal constant GAS_FEES_LENGTH = 2; uint256 internal constant GAS_LENGTH = 2; diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index e6c63ed9594..069f0829028 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -29,23 +29,31 @@ contract ContractClassRegisterer { // docs:start:import_pop_capsule use crate::capsule::pop_capsule; + // docs:end:import_pop_capsule #[private] fn register(artifact_hash: Field, private_functions_root: Field, public_bytecode_commitment: Field) { - // TODO: Validate public_bytecode_commitment is the correct commitment of packed_public_bytecode // TODO: Validate packed_public_bytecode is legit public bytecode + // TODO: We should be able to remove public_bytecode_commitment from the input if it's calculated in this function // docs:start:pop_capsule let packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS] = pop_capsule(); // docs:end:pop_capsule + // First field element contains the length of the bytecode + let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32; + let bytecode_length_in_fields: u32 = (bytecode_length_in_bytes / 31) + (bytecode_length_in_bytes % 31 != 0) as u32; + assert(bytecode_length_in_fields < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); + let mut computed_public_bytecode_commitment = 0; - for i in 0..MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS { + // We can hash up to MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS - 1, since the first element is the length + for i in 0..(MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS - 1) { // While we are forced to run the hash MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS times in the circuit, - // for future reasons, we may want the computed_public_bytecode_commitment to be based on the real bytecode length + // we want the bytecode commitment to be based on the actual length if (i < bytecode_length_in_fields) { - computed_public_bytecode_commitment = std::hash::poseidon2::Poseidon2::hash([packed_public_bytecode[i],computed_public_bytecode_commitment],2); + // We skip the first element when hashing since it is the length + computed_public_bytecode_commitment = std::hash::poseidon2::Poseidon2::hash([packed_public_bytecode[i + 1],computed_public_bytecode_commitment],2); } } assert_eq(computed_public_bytecode_commitment, public_bytecode_commitment); 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 20b13443742..19b298f462f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -209,11 +209,11 @@ global L2_GAS_PER_LOG_BYTE: u32 = 4; global L2_GAS_PER_L2_TO_L1_MSG: u32 = 200; // CANONICAL CONTRACT ADDRESSES -global CANONICAL_AUTH_REGISTRY_ADDRESS = AztecAddress::from_field(0x16ebe2290b321d9de51756a082a44977307b972263f029e7c0f911d3fcffe0b0); -global DEPLOYER_CONTRACT_ADDRESS = AztecAddress::from_field(0x302e348e3cb37144495941e9450f4350a869346137cdd9615ba4c683e28eed11); -global REGISTERER_CONTRACT_ADDRESS = AztecAddress::from_field(0x22753fdb0b58309a2aa5879c6288c3d6aaa176c1b0253bda46874f58d56b9902); -global FEE_JUICE_ADDRESS = AztecAddress::from_field(0x09d367c4579e6e8a0ee3e0c4489e30676873499dba621be0850b027f81c70e38); -global ROUTER_ADDRESS = AztecAddress::from_field(0x12ef89dd7c3b1a0d52b7b6a06dc3ab8f6febeb9683fc4bca7b9f74a3df4a7e4a); +global CANONICAL_AUTH_REGISTRY_ADDRESS = AztecAddress::from_field(0x30539494e4c86792ef4265203db5434af9a2a39f02cb16627ea990a31c93bb3a); +global DEPLOYER_CONTRACT_ADDRESS = AztecAddress::from_field(0x2f4777538e15d064071a53d91bbb6d6881fdd71505bd786c368091aff228af17); +global REGISTERER_CONTRACT_ADDRESS = AztecAddress::from_field(0x1764ce12e414933685cbdeb8e9781c2a63dc7df5e775580d306aa8044323b31c); +global FEE_JUICE_ADDRESS = AztecAddress::from_field(0x2c5b3e3edf047c3f6f7a54593796997e9e7c1eeb7be4603bee7a6bf0acde76fc); +global ROUTER_ADDRESS = AztecAddress::from_field(0x1eca73fe37e2e759f257a4a2d5aeff9561c4d3dd549f8edecd4f19a8adc9a49c); // LENGTH OF STRUCTS SERIALIZED TO FIELDS global AZTEC_ADDRESS_LENGTH: u32 = 1; @@ -323,7 +323,7 @@ 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 = 3837; +global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 3842; global AVM_PUBLIC_COLUMN_MAX_SIZE_LOG2 = 8; /** * Enumerate the hash_indices which are used for pedersen hashing. diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index 18211486e8b..8ba9c99f55a 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -7,14 +7,13 @@ import { getRegistererContract } from './protocol_contracts.js'; /** Sets up a call to register a contract class given its artifact. */ export async function registerContractClass( - wallet: Wallet, - artifact: ContractArtifact, + wallet: Wallet, + artifact: ContractArtifact, ): Promise { - const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } = - getContractClassFromArtifact(artifact); - const bytecodeLength = Math.ceil(packedBytecode.length / 31); // We pack them into chunks of 31 bytes - const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); - const registerer = getRegistererContract(wallet); - await wallet.addCapsule(encodedBytecode); - return registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment, bytecodeLength); + const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } = + getContractClassFromArtifact(artifact); + const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); + const registerer = getRegistererContract(wallet); + await wallet.addCapsule(encodedBytecode); + return registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment); } diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index ca3aaf5244d..0decf21e921 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -124,12 +124,12 @@ export const L2_GAS_PER_L1_TO_L2_MSG_READ_REQUEST = 480; export const L2_GAS_PER_LOG_BYTE = 4; export const L2_GAS_PER_L2_TO_L1_MSG = 200; export const CANONICAL_AUTH_REGISTRY_ADDRESS = - 10367652630266020489903597403740855630875483787219246409272999235813107556528n; -export const DEPLOYER_CONTRACT_ADDRESS = 21792654422491608007482167227129894566813584910736822764811909177844536634641n; + 21858690510998468448249336576047234693354455518526085448004898459468113886010n; +export const DEPLOYER_CONTRACT_ADDRESS = 21384973585466946178399054773394323067029798423084751755473882358686503448343n; export const REGISTERER_CONTRACT_ADDRESS = - 15585798673853010492123669545215912437570562212426440404568423552367406586114n; -export const FEE_JUICE_ADDRESS = 4444336541168247213466174979492237365557250727898612974872691091083784293944n; -export const ROUTER_ADDRESS = 8564859233461589816161798798617919343839107831666181567459338285971665485386n; + 10581302492939110815750835056397422686553529472299821216715038456465456345884n; +export const FEE_JUICE_ADDRESS = 20062978023835234645866731546586295662228679649547491742647880733929078945532n; +export const ROUTER_ADDRESS = 13927089119125078473425402705541267665490602945311909051580945109517632906396n; export const AZTEC_ADDRESS_LENGTH = 1; export const GAS_FEES_LENGTH = 2; export const GAS_LENGTH = 2; @@ -212,12 +212,8 @@ export const NESTED_RECURSIVE_PROOF_LENGTH = 439; export const TUBE_PROOF_LENGTH = 439; export const VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 66; -<<<<<<< HEAD -export const AVM_PROOF_LENGTH_IN_FIELDS = 3822; +export const AVM_PROOF_LENGTH_IN_FIELDS = 3842; export const AVM_PUBLIC_COLUMN_MAX_SIZE_LOG2 = 8; -======= -export const AVM_PROOF_LENGTH_IN_FIELDS = 3837; ->>>>>>> 47c2f8135 (feat(avm): add pil + trace placeholders) export const MEM_TAG_U1 = 1; export const MEM_TAG_U8 = 2; export const MEM_TAG_U16 = 3; diff --git a/yarn-project/circuits.js/src/contract/contract_class_id.ts b/yarn-project/circuits.js/src/contract/contract_class_id.ts index 4f082ac2f59..7e046a6f406 100644 --- a/yarn-project/circuits.js/src/contract/contract_class_id.ts +++ b/yarn-project/circuits.js/src/contract/contract_class_id.ts @@ -3,6 +3,8 @@ import { poseidon2Hash, poseidon2HashWithSeparator } from '@aztec/foundation/cry import { Fr } from '@aztec/foundation/fields'; import { type ContractClass } from '@aztec/types/contracts'; +import { strict as assert } from 'assert'; + import { GeneratorIndex, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS } from '../constants.gen.js'; import { computePrivateFunctionsRoot } from './private_function.js'; @@ -20,53 +22,54 @@ import { computePrivateFunctionsRoot } from './private_function.js'; * @returns The identifier. */ export function computeContractClassId(contractClass: ContractClass | ContractClassIdPreimage): Fr { - return computeContractClassIdWithPreimage(contractClass).id; + return computeContractClassIdWithPreimage(contractClass).id; } /** Computes a contract class id and returns it along with its preimage. */ export function computeContractClassIdWithPreimage( - contractClass: ContractClass | ContractClassIdPreimage, + contractClass: ContractClass | ContractClassIdPreimage, ): ContractClassIdPreimage & { id: Fr } { - const artifactHash = contractClass.artifactHash; - const privateFunctionsRoot = - 'privateFunctionsRoot' in contractClass - ? contractClass.privateFunctionsRoot - : computePrivateFunctionsRoot(contractClass.privateFunctions); - const publicBytecodeCommitment = - 'publicBytecodeCommitment' in contractClass - ? contractClass.publicBytecodeCommitment - : computePublicBytecodeCommitment(contractClass.packedBytecode); - const id = poseidon2HashWithSeparator( - [artifactHash, privateFunctionsRoot, publicBytecodeCommitment], - GeneratorIndex.CONTRACT_LEAF, // TODO(@spalladino): Review all generator indices in this file - ); - return { id, artifactHash, privateFunctionsRoot, publicBytecodeCommitment }; + const artifactHash = contractClass.artifactHash; + const privateFunctionsRoot = + 'privateFunctionsRoot' in contractClass + ? contractClass.privateFunctionsRoot + : computePrivateFunctionsRoot(contractClass.privateFunctions); + const publicBytecodeCommitment = + 'publicBytecodeCommitment' in contractClass + ? contractClass.publicBytecodeCommitment + : computePublicBytecodeCommitment(contractClass.packedBytecode); + const id = poseidon2HashWithSeparator( + [artifactHash, privateFunctionsRoot, publicBytecodeCommitment], + GeneratorIndex.CONTRACT_LEAF, // TODO(@spalladino): Review all generator indices in this file + ); + return { id, artifactHash, privateFunctionsRoot, publicBytecodeCommitment }; } /** Returns the preimage of a contract class id given a contract class. */ export function computeContractClassIdPreimage(contractClass: ContractClass): ContractClassIdPreimage { - const privateFunctionsRoot = computePrivateFunctionsRoot(contractClass.privateFunctions); - const publicBytecodeCommitment = computePublicBytecodeCommitment(contractClass.packedBytecode); - return { artifactHash: contractClass.artifactHash, privateFunctionsRoot, publicBytecodeCommitment }; + const privateFunctionsRoot = computePrivateFunctionsRoot(contractClass.privateFunctions); + const publicBytecodeCommitment = computePublicBytecodeCommitment(contractClass.packedBytecode); + return { artifactHash: contractClass.artifactHash, privateFunctionsRoot, publicBytecodeCommitment }; } /** Preimage of a contract class id. */ export type ContractClassIdPreimage = { - artifactHash: Fr; - privateFunctionsRoot: Fr; - publicBytecodeCommitment: Fr; + artifactHash: Fr; + privateFunctionsRoot: Fr; + publicBytecodeCommitment: Fr; }; -// TODO(#5860): Replace with actual implementation -// Changed to work with canonical contracts that may have non-deterministic noir compiles and we want to keep the address constant export function computePublicBytecodeCommitment(packedBytecode: Buffer) { - const numFieldElems = Math.ceil(packedBytecode.length / (Fr.SIZE_IN_BYTES - 1)); // We pack them into chunks of 31 bytes - // Convert Buffer into chunks of field elements - const encodedBytecode: Fr[] = bufferAsFields(packedBytecode, numFieldElems); - // Hash it - let bytecodeCommitment = new Fr(0); - for (let i = 0; i < encodedBytecode.length; i++) { - bytecodeCommitment = poseidon2Hash([encodedBytecode[i], bytecodeCommitment]); - } - return bytecodeCommitment; + // Encode the buffer into field elements (chunked into 31 bytes each) + const encodedBytecode: Fr[] = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); + // The first element is the length of the bytecode (in bytes) + const bytecodeLength = Math.ceil(encodedBytecode[0].toNumber() / (Fr.SIZE_IN_BYTES - 1)); + assert(bytecodeLength < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, 'Bytecode exceeds maximum deployable size'); + + let bytecodeCommitment = new Fr(0); + for (let i = 0; i < bytecodeLength; i++) { + // We skip the first element, which is the length of the bytecode + bytecodeCommitment = poseidon2Hash([encodedBytecode[i + 1], bytecodeCommitment]); + } + return bytecodeCommitment; } diff --git a/yarn-project/circuits.js/src/scripts/constants.in.ts b/yarn-project/circuits.js/src/scripts/constants.in.ts index bf922fa24fa..b7be9cd0c49 100644 --- a/yarn-project/circuits.js/src/scripts/constants.in.ts +++ b/yarn-project/circuits.js/src/scripts/constants.in.ts @@ -77,6 +77,7 @@ const CPP_CONSTANTS = [ 'MEM_TAG_U64', 'MEM_TAG_U128', 'MEM_TAG_FF', + 'MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS', ]; const PIL_CONSTANTS = [ @@ -123,6 +124,7 @@ const PIL_CONSTANTS = [ 'MEM_TAG_U64', 'MEM_TAG_U128', 'MEM_TAG_FF', + 'MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS', ]; /** diff --git a/yarn-project/circuits.js/src/structs/avm/avm.ts b/yarn-project/circuits.js/src/structs/avm/avm.ts index db71997b205..21d7062d0e8 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm.ts @@ -74,7 +74,6 @@ export class AvmKeyValueHint { export class AvmExternalCallHint { public readonly returnData: Vector; - public readonly packedBytecode: Vector; /** * Creates a new instance. @@ -82,16 +81,16 @@ export class AvmExternalCallHint { * @param returnData the data returned by the external call. * @param gasUsed gas used by the external call (not including the cost of the CALL opcode itself). * @param endSideEffectCounter value of side effect counter at the end of the external call. + * @param bytecode currently the bytecode of the nested call function, will be changed to the contract bytecode (via the dispatch function) of the nested call */ constructor( public readonly success: Fr, returnData: Fr[], public readonly gasUsed: Gas, public readonly endSideEffectCounter: Fr, - packedBytecode: Fr[], // This might be easier to work with, but buffer would be more efficient. + public readonly bytecode: Buffer, ) { this.returnData = new Vector(returnData); - this.packedBytecode = new Vector(packedBytecode); } /** @@ -119,7 +118,8 @@ export class AvmExternalCallHint { this.success.isZero() && this.returnData.items.length == 0 && this.gasUsed.isEmpty() && - this.endSideEffectCounter.isZero() + this.endSideEffectCounter.isZero() && + this.bytecode.length == 0 ); } @@ -134,7 +134,7 @@ export class AvmExternalCallHint { fields.returnData.items, fields.gasUsed, fields.endSideEffectCounter, - fields.packedBytecode.items, + fields.bytecode, ); } @@ -144,12 +144,17 @@ export class AvmExternalCallHint { * @returns An array of fields. */ static getFields(fields: FieldsOf) { + // Buffers aren't serialised the same way as they are read (lenth prefixed), so we need to do this manually. + const lengthPrefixedBytecode = Buffer.alloc(fields.bytecode.length + 4); + // Add a 4-byte length prefix to the bytecode. + lengthPrefixedBytecode.writeUInt32BE(fields.bytecode.length); + fields.bytecode.copy(lengthPrefixedBytecode, 4); return [ fields.success, fields.returnData, fields.gasUsed, fields.endSideEffectCounter, - fields.packedBytecode, + lengthPrefixedBytecode, ] as const; } @@ -165,7 +170,7 @@ export class AvmExternalCallHint { reader.readVector(Fr), reader.readObject(Gas), Fr.fromBuffer(reader), - reader.readVector(Fr), + reader.readBuffer(), ); } diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index 58923ed4da4..5b37aea6140 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -1,4 +1,3 @@ -import { bufferAsFields } from '@aztec/foundation/abi'; import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/array'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; @@ -61,7 +60,6 @@ import { MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_TX, - MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, @@ -1402,7 +1400,7 @@ export function makeAvmExternalCallHint(seed = 0): AvmExternalCallHint { makeArray((seed % 100) + 10, i => new Fr(i), seed + 0x1000), new Gas(seed + 0x200, seed), new Fr(seed + 0x300), - makeArray((seed % 200) + 11, i => new Fr(i), seed + 0x1000), + makeBytes((seed % 100) + 10, seed + 0x400), ); } diff --git a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap index 0e0fa79d21e..d1c95bdbc2d 100644 --- a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap +++ b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap @@ -4,11 +4,11 @@ exports[`Data generation for noir tests Computes contract info for defaultContra "{ contract_address_salt: 0x000000000000000000000000000000000000000000000000000000000000ddd5, artifact_hash: 0x0000000000000000000000000000000000000000000000000000000000003039, - public_bytecode_commitment: 0x0000000000000000000000000000000000000000000000000000000000000005, + public_bytecode_commitment: 0x11fb08be2c55e530172e671f647b16dddf9b66acf42489d0236785d8f7bc8b48, private_functions_root: 0x25d76df45434ec75a83321daf941cfc667ff3a9027942e17105da4f50d1d13f9, - address: AztecAddress { inner: 0x0e66d7cd9692428c550b93c9ef5f49ca9f02c03e98cb3c922d8c773f78f79fed }, - partial_address: PartialAddress { inner: 0x0cf203c94c91bed28440b00ecd888d88cce1f86ddf2aa8d33acbb9b6fc06d382 }, - contract_class_id: ContractClassId { inner: 0x28e91aaf764bc6083e2796ff884079ad895d4b948d6ce8f37f01b29d0bc95a21 }, + address: AztecAddress { inner: 0x1db08fcbf345d786b0d36c768d552a54d68bb30fd3228630fa0f8a639af8eb4d }, + partial_address: PartialAddress { inner: 0x1a68423cf4f04eaede2b0e93131916b8b7330dae6e8ee202679d12a4eb49cc0b }, + contract_class_id: ContractClassId { inner: 0x1195b865ef122d75c8c4d6102d536193b69bbb712c85bafcbf7694f52e2d8c36 }, public_keys_hash: PublicKeysHash { inner: 0x000000000000000000000000000000000000000000000000000000000000b26e }, salted_initialization_hash: SaltedInitializationHash { inner: 0x13a939daa511233e5446905ed2cadbee14948fa75df183b53b5c14b612bffe88 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } @@ -19,11 +19,11 @@ exports[`Data generation for noir tests Computes contract info for parentContrac "{ contract_address_salt: 0x0000000000000000000000000000000000000000000000000000000000001618, artifact_hash: 0x00000000000000000000000000000000000000000000000000000000000004bc, - public_bytecode_commitment: 0x0000000000000000000000000000000000000000000000000000000000000005, + public_bytecode_commitment: 0x1c5009dd5e8baedc8dfb2e801c9f97361b1ae152ff52f82104119c476b369bef, private_functions_root: 0x1228b39ba6702af03e595300e8484c6373f00790d0148cc3d4ff0fd1c778a83a, - address: AztecAddress { inner: 0x24415b2e716d6c7099580ab8e383fd5b16dc9fb441aa308571d8e24a2257da24 }, - partial_address: PartialAddress { inner: 0x245df9f519d616473880260dd64b19a838081bb44dc17cd6ea5d870a63d2bf57 }, - contract_class_id: ContractClassId { inner: 0x00236b0dc6c537d5106543053c5b85c4cbe95b0474f8238b094bae63f1cbcfee }, + address: AztecAddress { inner: 0x2eaad643d690e6c2634c17686493370a0572358b439367dc4c05254328901256 }, + partial_address: PartialAddress { inner: 0x1c30ee02dcd41bcdfc5191dc36ccaae15cdc7e1fc6bd8a0cbe1baeaf1335a771 }, + contract_class_id: ContractClassId { inner: 0x24f1b8df215c10ee7edd213b439c8f8e99198a802a3e1e41597b6554b17049a3 }, public_keys_hash: PublicKeysHash { inner: 0x00000000000000000000000000000000000000000000000000000000000011c1 }, salted_initialization_hash: SaltedInitializationHash { inner: 0x24bd6ac7a182e2cf25e437c72f53544ef81dfd97d9afee23abb07a638e7be749 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } diff --git a/yarn-project/simulator/src/public/side_effect_trace.ts b/yarn-project/simulator/src/public/side_effect_trace.ts index 270246edc7f..f96fac88844 100644 --- a/yarn-project/simulator/src/public/side_effect_trace.ts +++ b/yarn-project/simulator/src/public/side_effect_trace.ts @@ -18,7 +18,6 @@ import { ReadRequest, TreeLeafReadRequest, } from '@aztec/circuits.js'; -import { bufferAsFields } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; import { type ContractInstanceWithAddress } from '@aztec/types/contracts'; @@ -184,10 +183,8 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface { const basicLogHash = Fr.fromBuffer(ulog.hash()); this.unencryptedLogs.push(ulog); this.allUnencryptedLogs.push(ulog); - // We want the length of the buffer output from function_l2_logs -> toBuffer to equal the stored log length in the kernels. - // The kernels store the length of the processed log as 4 bytes; thus for this length value to match the log length stored in the kernels, - // we need to add four to the length here. - // https://github.com/AztecProtocol/aztec-packages/issues/6578#issuecomment-2125003435 + // This length is for charging DA and is checked on-chain - has to be length of log preimage + 4 bytes. + // The .length call also has a +4 but that is unrelated this.unencryptedLogsHashes.push(new LogHash(basicLogHash, this.sideEffectCounter, new Fr(ulog.length + 4))); this.logger.debug(`NEW_UNENCRYPTED_LOG cnt: ${this.sideEffectCounter}`); this.incrementSideEffectCounter(); @@ -253,17 +250,13 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface { this.publicCallRequests.push(resultToPublicCallRequest(result)); - // The number of 31 bytes chunks required to store the bytecode - const numFields = Math.ceil(bytecode.length / (Fr.SIZE_IN_BYTES - 1)); - // TODO: Check this is packed in the same way as during deployment - const encodedBytecode: Fr[] = bufferAsFields(bytecode, numFields); this.avmCircuitHints.externalCalls.items.push( new AvmExternalCallHint( /*success=*/ new Fr(result.reverted ? 0 : 1), result.returnValues, gasUsed, result.endSideEffectCounter, - encodedBytecode, + bytecode, ), ); }