From 38c0c14fe90a1a920818f2f99a7d3204f0211091 Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:07:08 +0100 Subject: [PATCH] chore(avm): remove function selector type of getenv opcode (#10406) Resolves #9396 --- avm-transpiler/src/transpile.rs | 2 - barretenberg/cpp/pil/avm/constants_gen.pil | 1 - barretenberg/cpp/pil/avm/kernel.pil | 5 +- barretenberg/cpp/pil/avm/main.pil | 4 +- .../vm/avm/generated/circuit_builder.cpp | 1 - .../barretenberg/vm/avm/generated/flavor.cpp | 1185 +++++----- .../barretenberg/vm/avm/generated/flavor.hpp | 6 +- .../vm/avm/generated/full_row.cpp | 2 - .../vm/avm/generated/full_row.hpp | 3 +- .../vm/avm/generated/relations/main.hpp | 313 ++- .../vm/avm/tests/execution.test.cpp | 154 +- .../barretenberg/vm/avm/tests/kernel.test.cpp | 63 - .../src/barretenberg/vm/avm/trace/helper.hpp | 1 - .../vm/avm/trace/kernel_trace.cpp | 14 - .../vm/avm/trace/kernel_trace.hpp | 2 - .../src/barretenberg/vm/avm/trace/opcode.hpp | 1 - .../src/barretenberg/vm/avm/trace/trace.cpp | 16 - .../src/barretenberg/vm/avm/trace/trace.hpp | 1 - .../src/barretenberg/vm/aztec_constants.hpp | 3 +- .../cpp/src/barretenberg/vm/constants.hpp | 1 - .../public-vm/gen/_instruction-set.mdx | 2057 ++++++++++------- .../InstructionSet/InstructionSet.js | 19 - .../src/core/libraries/ConstantsGen.sol | 1 - .../aztec/src/context/public_context.nr | 15 - .../contracts/avm_test_contract/src/main.nr | 23 +- .../crates/types/src/constants.nr | 3 +- yarn-project/circuits.js/src/constants.gen.ts | 3 +- .../circuits.js/src/scripts/constants.in.ts | 2 - .../simulator/src/avm/avm_simulator.test.ts | 12 - .../avm/opcodes/environment_getters.test.ts | 1 - .../src/avm/opcodes/environment_getters.ts | 5 +- .../txe/src/txe_service/txe_service.ts | 5 - 32 files changed, 2061 insertions(+), 1863 deletions(-) diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index 5e302c08020..79f4a3f02bb 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -786,7 +786,6 @@ fn handle_getter_instruction( enum EnvironmentVariable { ADDRESS, SENDER, - FUNCTIONSELECTOR, TRANSACTIONFEE, CHAINID, VERSION, @@ -821,7 +820,6 @@ fn handle_getter_instruction( "avmOpcodeTimestamp" => EnvironmentVariable::TIMESTAMP, "avmOpcodeL2GasLeft" => EnvironmentVariable::L2GASLEFT, "avmOpcodeDaGasLeft" => EnvironmentVariable::DAGASLEFT, - "avmOpcodeFunctionSelector" => EnvironmentVariable::FUNCTIONSELECTOR, "avmOpcodeIsStaticCall" => EnvironmentVariable::ISSTATICCALL, _ => panic!("Transpiler doesn't know how to process getter {:?}", function), }; diff --git a/barretenberg/cpp/pil/avm/constants_gen.pil b/barretenberg/cpp/pil/avm/constants_gen.pil index 0aa1c519355..942924d0d9e 100644 --- a/barretenberg/cpp/pil/avm/constants_gen.pil +++ b/barretenberg/cpp/pil/avm/constants_gen.pil @@ -21,7 +21,6 @@ namespace constants(256); pol MEM_TAG_U128 = 6; pol SENDER_KERNEL_INPUTS_COL_OFFSET = 0; pol ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - pol FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; pol IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; pol CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; pol VERSION_KERNEL_INPUTS_COL_OFFSET = 5; diff --git a/barretenberg/cpp/pil/avm/kernel.pil b/barretenberg/cpp/pil/avm/kernel.pil index 03da4e3d1f7..ee7579ab7be 100644 --- a/barretenberg/cpp/pil/avm/kernel.pil +++ b/barretenberg/cpp/pil/avm/kernel.pil @@ -95,9 +95,6 @@ namespace main(256); #[SENDER_KERNEL] sel_op_sender * (kernel_in_offset - constants.SENDER_KERNEL_INPUTS_COL_OFFSET) = 0; - #[FUNCTION_SELECTOR_KERNEL] - sel_op_function_selector * (kernel_in_offset - constants.FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET) = 0; - #[FEE_TRANSACTION_FEE_KERNEL] sel_op_transaction_fee * (kernel_in_offset - constants.TRANSACTION_FEE_KERNEL_INPUTS_COL_OFFSET) = 0; @@ -172,7 +169,7 @@ namespace main(256); //===== LOOKUPS INTO THE PUBLIC INPUTS =========================================== pol KERNEL_INPUT_SELECTORS = sel_op_address + sel_op_sender - + sel_op_function_selector + sel_op_transaction_fee + sel_op_chain_id + + sel_op_transaction_fee + sel_op_chain_id + sel_op_version + sel_op_block_number + sel_op_timestamp + sel_op_fee_per_l2_gas + sel_op_fee_per_da_gas + sel_op_is_static_call; // Ensure that only one kernel lookup is active when the kernel_in_offset is active diff --git a/barretenberg/cpp/pil/avm/main.pil b/barretenberg/cpp/pil/avm/main.pil index d264a8f8ce2..31921621216 100644 --- a/barretenberg/cpp/pil/avm/main.pil +++ b/barretenberg/cpp/pil/avm/main.pil @@ -61,7 +61,6 @@ namespace main(256); // CONTEXT - ENVIRONMENT pol commit sel_op_address; pol commit sel_op_sender; - pol commit sel_op_function_selector; pol commit sel_op_transaction_fee; pol commit sel_op_is_static_call; @@ -234,7 +233,6 @@ namespace main(256); // opcode decomposition. sel_op_address * (1 - sel_op_address) = 0; sel_op_sender * (1 - sel_op_sender) = 0; - sel_op_function_selector * (1 - sel_op_function_selector) = 0; sel_op_transaction_fee * (1 - sel_op_transaction_fee) = 0; sel_op_chain_id * (1 - sel_op_chain_id) = 0; sel_op_version * (1 - sel_op_version) = 0; @@ -445,7 +443,7 @@ namespace main(256); + sel_op_ecadd + sel_op_msm; pol SEL_ALL_MEMORY = sel_op_mov + sel_op_set; pol KERNEL_INPUT_SELECTORS = sel_op_address + sel_op_sender - + sel_op_function_selector + sel_op_transaction_fee + sel_op_chain_id + + sel_op_transaction_fee + sel_op_chain_id + sel_op_version + sel_op_block_number + sel_op_timestamp + sel_op_fee_per_l2_gas + sel_op_fee_per_da_gas + sel_op_is_static_call; pol KERNEL_OUTPUT_SELECTORS = sel_op_note_hash_exists + sel_op_emit_note_hash + sel_op_nullifier_exists diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp index 53f2cbf9bdf..cc096543dc7 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/circuit_builder.cpp @@ -323,7 +323,6 @@ AvmCircuitBuilder::ProverPolynomials AvmCircuitBuilder::compute_polynomials() co polys.main_sel_op_fdiv.set_if_valid_index(i, rows[i].main_sel_op_fdiv); polys.main_sel_op_fee_per_da_gas.set_if_valid_index(i, rows[i].main_sel_op_fee_per_da_gas); polys.main_sel_op_fee_per_l2_gas.set_if_valid_index(i, rows[i].main_sel_op_fee_per_l2_gas); - polys.main_sel_op_function_selector.set_if_valid_index(i, rows[i].main_sel_op_function_selector); polys.main_sel_op_get_contract_instance.set_if_valid_index(i, rows[i].main_sel_op_get_contract_instance); polys.main_sel_op_internal_call.set_if_valid_index(i, rows[i].main_sel_op_internal_call); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index a1a7ca40675..59c37874fe6 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -230,598 +230,597 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , main_sel_op_fdiv(il[222]) , main_sel_op_fee_per_da_gas(il[223]) , main_sel_op_fee_per_l2_gas(il[224]) - , main_sel_op_function_selector(il[225]) - , main_sel_op_get_contract_instance(il[226]) - , main_sel_op_internal_call(il[227]) - , main_sel_op_internal_return(il[228]) - , main_sel_op_is_static_call(il[229]) - , main_sel_op_jump(il[230]) - , main_sel_op_jumpi(il[231]) - , main_sel_op_keccak(il[232]) - , main_sel_op_l1_to_l2_msg_exists(il[233]) - , main_sel_op_l2gasleft(il[234]) - , main_sel_op_lt(il[235]) - , main_sel_op_lte(il[236]) - , main_sel_op_mov(il[237]) - , main_sel_op_msm(il[238]) - , main_sel_op_mul(il[239]) - , main_sel_op_not(il[240]) - , main_sel_op_note_hash_exists(il[241]) - , main_sel_op_nullifier_exists(il[242]) - , main_sel_op_or(il[243]) - , main_sel_op_poseidon2(il[244]) - , main_sel_op_radix_be(il[245]) - , main_sel_op_returndata_copy(il[246]) - , main_sel_op_returndata_size(il[247]) - , main_sel_op_sender(il[248]) - , main_sel_op_set(il[249]) - , main_sel_op_sha256(il[250]) - , main_sel_op_shl(il[251]) - , main_sel_op_shr(il[252]) - , main_sel_op_sload(il[253]) - , main_sel_op_sstore(il[254]) - , main_sel_op_static_call(il[255]) - , main_sel_op_sub(il[256]) - , main_sel_op_timestamp(il[257]) - , main_sel_op_transaction_fee(il[258]) - , main_sel_op_version(il[259]) - , main_sel_op_xor(il[260]) - , main_sel_q_kernel_lookup(il[261]) - , main_sel_q_kernel_output_lookup(il[262]) - , main_sel_resolve_ind_addr_a(il[263]) - , main_sel_resolve_ind_addr_b(il[264]) - , main_sel_resolve_ind_addr_c(il[265]) - , main_sel_resolve_ind_addr_d(il[266]) - , main_sel_returndata(il[267]) - , main_sel_rng_16(il[268]) - , main_sel_rng_8(il[269]) - , main_sel_slice_gadget(il[270]) - , main_space_id(il[271]) - , main_tag_err(il[272]) - , main_w_in_tag(il[273]) - , mem_addr(il[274]) - , mem_clk(il[275]) - , mem_diff(il[276]) - , mem_glob_addr(il[277]) - , mem_last(il[278]) - , mem_lastAccess(il[279]) - , mem_one_min_inv(il[280]) - , mem_r_in_tag(il[281]) - , mem_rw(il[282]) - , mem_sel_mem(il[283]) - , mem_sel_mov_ia_to_ic(il[284]) - , mem_sel_mov_ib_to_ic(il[285]) - , mem_sel_op_a(il[286]) - , mem_sel_op_b(il[287]) - , mem_sel_op_c(il[288]) - , mem_sel_op_d(il[289]) - , mem_sel_op_poseidon_read_a(il[290]) - , mem_sel_op_poseidon_read_b(il[291]) - , mem_sel_op_poseidon_read_c(il[292]) - , mem_sel_op_poseidon_read_d(il[293]) - , mem_sel_op_poseidon_write_a(il[294]) - , mem_sel_op_poseidon_write_b(il[295]) - , mem_sel_op_poseidon_write_c(il[296]) - , mem_sel_op_poseidon_write_d(il[297]) - , mem_sel_op_slice(il[298]) - , mem_sel_resolve_ind_addr_a(il[299]) - , mem_sel_resolve_ind_addr_b(il[300]) - , mem_sel_resolve_ind_addr_c(il[301]) - , mem_sel_resolve_ind_addr_d(il[302]) - , mem_sel_rng_chk(il[303]) - , mem_skip_check_tag(il[304]) - , mem_space_id(il[305]) - , mem_tag(il[306]) - , mem_tag_err(il[307]) - , mem_tsp(il[308]) - , mem_u16_r0(il[309]) - , mem_u16_r1(il[310]) - , mem_u8_r0(il[311]) - , mem_val(il[312]) - , mem_w_in_tag(il[313]) - , merkle_tree_clk(il[314]) - , merkle_tree_expected_tree_root(il[315]) - , merkle_tree_latch(il[316]) - , merkle_tree_leaf_index(il[317]) - , merkle_tree_leaf_index_is_even(il[318]) - , merkle_tree_leaf_value(il[319]) - , merkle_tree_left_hash(il[320]) - , merkle_tree_output_hash(il[321]) - , merkle_tree_path_len(il[322]) - , merkle_tree_path_len_inv(il[323]) - , merkle_tree_right_hash(il[324]) - , merkle_tree_sel_merkle_tree(il[325]) - , merkle_tree_sibling_value(il[326]) - , poseidon2_B_10_0(il[327]) - , poseidon2_B_10_1(il[328]) - , poseidon2_B_10_2(il[329]) - , poseidon2_B_10_3(il[330]) - , poseidon2_B_11_0(il[331]) - , poseidon2_B_11_1(il[332]) - , poseidon2_B_11_2(il[333]) - , poseidon2_B_11_3(il[334]) - , poseidon2_B_12_0(il[335]) - , poseidon2_B_12_1(il[336]) - , poseidon2_B_12_2(il[337]) - , poseidon2_B_12_3(il[338]) - , poseidon2_B_13_0(il[339]) - , poseidon2_B_13_1(il[340]) - , poseidon2_B_13_2(il[341]) - , poseidon2_B_13_3(il[342]) - , poseidon2_B_14_0(il[343]) - , poseidon2_B_14_1(il[344]) - , poseidon2_B_14_2(il[345]) - , poseidon2_B_14_3(il[346]) - , poseidon2_B_15_0(il[347]) - , poseidon2_B_15_1(il[348]) - , poseidon2_B_15_2(il[349]) - , poseidon2_B_15_3(il[350]) - , poseidon2_B_16_0(il[351]) - , poseidon2_B_16_1(il[352]) - , poseidon2_B_16_2(il[353]) - , poseidon2_B_16_3(il[354]) - , poseidon2_B_17_0(il[355]) - , poseidon2_B_17_1(il[356]) - , poseidon2_B_17_2(il[357]) - , poseidon2_B_17_3(il[358]) - , poseidon2_B_18_0(il[359]) - , poseidon2_B_18_1(il[360]) - , poseidon2_B_18_2(il[361]) - , poseidon2_B_18_3(il[362]) - , poseidon2_B_19_0(il[363]) - , poseidon2_B_19_1(il[364]) - , poseidon2_B_19_2(il[365]) - , poseidon2_B_19_3(il[366]) - , poseidon2_B_20_0(il[367]) - , poseidon2_B_20_1(il[368]) - , poseidon2_B_20_2(il[369]) - , poseidon2_B_20_3(il[370]) - , poseidon2_B_21_0(il[371]) - , poseidon2_B_21_1(il[372]) - , poseidon2_B_21_2(il[373]) - , poseidon2_B_21_3(il[374]) - , poseidon2_B_22_0(il[375]) - , poseidon2_B_22_1(il[376]) - , poseidon2_B_22_2(il[377]) - , poseidon2_B_22_3(il[378]) - , poseidon2_B_23_0(il[379]) - , poseidon2_B_23_1(il[380]) - , poseidon2_B_23_2(il[381]) - , poseidon2_B_23_3(il[382]) - , poseidon2_B_24_0(il[383]) - , poseidon2_B_24_1(il[384]) - , poseidon2_B_24_2(il[385]) - , poseidon2_B_24_3(il[386]) - , poseidon2_B_25_0(il[387]) - , poseidon2_B_25_1(il[388]) - , poseidon2_B_25_2(il[389]) - , poseidon2_B_25_3(il[390]) - , poseidon2_B_26_0(il[391]) - , poseidon2_B_26_1(il[392]) - , poseidon2_B_26_2(il[393]) - , poseidon2_B_26_3(il[394]) - , poseidon2_B_27_0(il[395]) - , poseidon2_B_27_1(il[396]) - , poseidon2_B_27_2(il[397]) - , poseidon2_B_27_3(il[398]) - , poseidon2_B_28_0(il[399]) - , poseidon2_B_28_1(il[400]) - , poseidon2_B_28_2(il[401]) - , poseidon2_B_28_3(il[402]) - , poseidon2_B_29_0(il[403]) - , poseidon2_B_29_1(il[404]) - , poseidon2_B_29_2(il[405]) - , poseidon2_B_29_3(il[406]) - , poseidon2_B_30_0(il[407]) - , poseidon2_B_30_1(il[408]) - , poseidon2_B_30_2(il[409]) - , poseidon2_B_30_3(il[410]) - , poseidon2_B_31_0(il[411]) - , poseidon2_B_31_1(il[412]) - , poseidon2_B_31_2(il[413]) - , poseidon2_B_31_3(il[414]) - , poseidon2_B_32_0(il[415]) - , poseidon2_B_32_1(il[416]) - , poseidon2_B_32_2(il[417]) - , poseidon2_B_32_3(il[418]) - , poseidon2_B_33_0(il[419]) - , poseidon2_B_33_1(il[420]) - , poseidon2_B_33_2(il[421]) - , poseidon2_B_33_3(il[422]) - , poseidon2_B_34_0(il[423]) - , poseidon2_B_34_1(il[424]) - , poseidon2_B_34_2(il[425]) - , poseidon2_B_34_3(il[426]) - , poseidon2_B_35_0(il[427]) - , poseidon2_B_35_1(il[428]) - , poseidon2_B_35_2(il[429]) - , poseidon2_B_35_3(il[430]) - , poseidon2_B_36_0(il[431]) - , poseidon2_B_36_1(il[432]) - , poseidon2_B_36_2(il[433]) - , poseidon2_B_36_3(il[434]) - , poseidon2_B_37_0(il[435]) - , poseidon2_B_37_1(il[436]) - , poseidon2_B_37_2(il[437]) - , poseidon2_B_37_3(il[438]) - , poseidon2_B_38_0(il[439]) - , poseidon2_B_38_1(il[440]) - , poseidon2_B_38_2(il[441]) - , poseidon2_B_38_3(il[442]) - , poseidon2_B_39_0(il[443]) - , poseidon2_B_39_1(il[444]) - , poseidon2_B_39_2(il[445]) - , poseidon2_B_39_3(il[446]) - , poseidon2_B_40_0(il[447]) - , poseidon2_B_40_1(il[448]) - , poseidon2_B_40_2(il[449]) - , poseidon2_B_40_3(il[450]) - , poseidon2_B_41_0(il[451]) - , poseidon2_B_41_1(il[452]) - , poseidon2_B_41_2(il[453]) - , poseidon2_B_41_3(il[454]) - , poseidon2_B_42_0(il[455]) - , poseidon2_B_42_1(il[456]) - , poseidon2_B_42_2(il[457]) - , poseidon2_B_42_3(il[458]) - , poseidon2_B_43_0(il[459]) - , poseidon2_B_43_1(il[460]) - , poseidon2_B_43_2(il[461]) - , poseidon2_B_43_3(il[462]) - , poseidon2_B_44_0(il[463]) - , poseidon2_B_44_1(il[464]) - , poseidon2_B_44_2(il[465]) - , poseidon2_B_44_3(il[466]) - , poseidon2_B_45_0(il[467]) - , poseidon2_B_45_1(il[468]) - , poseidon2_B_45_2(il[469]) - , poseidon2_B_45_3(il[470]) - , poseidon2_B_46_0(il[471]) - , poseidon2_B_46_1(il[472]) - , poseidon2_B_46_2(il[473]) - , poseidon2_B_46_3(il[474]) - , poseidon2_B_47_0(il[475]) - , poseidon2_B_47_1(il[476]) - , poseidon2_B_47_2(il[477]) - , poseidon2_B_47_3(il[478]) - , poseidon2_B_48_0(il[479]) - , poseidon2_B_48_1(il[480]) - , poseidon2_B_48_2(il[481]) - , poseidon2_B_48_3(il[482]) - , poseidon2_B_49_0(il[483]) - , poseidon2_B_49_1(il[484]) - , poseidon2_B_49_2(il[485]) - , poseidon2_B_49_3(il[486]) - , poseidon2_B_4_0(il[487]) - , poseidon2_B_4_1(il[488]) - , poseidon2_B_4_2(il[489]) - , poseidon2_B_4_3(il[490]) - , poseidon2_B_50_0(il[491]) - , poseidon2_B_50_1(il[492]) - , poseidon2_B_50_2(il[493]) - , poseidon2_B_50_3(il[494]) - , poseidon2_B_51_0(il[495]) - , poseidon2_B_51_1(il[496]) - , poseidon2_B_51_2(il[497]) - , poseidon2_B_51_3(il[498]) - , poseidon2_B_52_0(il[499]) - , poseidon2_B_52_1(il[500]) - , poseidon2_B_52_2(il[501]) - , poseidon2_B_52_3(il[502]) - , poseidon2_B_53_0(il[503]) - , poseidon2_B_53_1(il[504]) - , poseidon2_B_53_2(il[505]) - , poseidon2_B_53_3(il[506]) - , poseidon2_B_54_0(il[507]) - , poseidon2_B_54_1(il[508]) - , poseidon2_B_54_2(il[509]) - , poseidon2_B_54_3(il[510]) - , poseidon2_B_55_0(il[511]) - , poseidon2_B_55_1(il[512]) - , poseidon2_B_55_2(il[513]) - , poseidon2_B_55_3(il[514]) - , poseidon2_B_56_0(il[515]) - , poseidon2_B_56_1(il[516]) - , poseidon2_B_56_2(il[517]) - , poseidon2_B_56_3(il[518]) - , poseidon2_B_57_0(il[519]) - , poseidon2_B_57_1(il[520]) - , poseidon2_B_57_2(il[521]) - , poseidon2_B_57_3(il[522]) - , poseidon2_B_58_0(il[523]) - , poseidon2_B_58_1(il[524]) - , poseidon2_B_58_2(il[525]) - , poseidon2_B_58_3(il[526]) - , poseidon2_B_59_0(il[527]) - , poseidon2_B_59_1(il[528]) - , poseidon2_B_59_2(il[529]) - , poseidon2_B_59_3(il[530]) - , poseidon2_B_5_0(il[531]) - , poseidon2_B_5_1(il[532]) - , poseidon2_B_5_2(il[533]) - , poseidon2_B_5_3(il[534]) - , poseidon2_B_6_0(il[535]) - , poseidon2_B_6_1(il[536]) - , poseidon2_B_6_2(il[537]) - , poseidon2_B_6_3(il[538]) - , poseidon2_B_7_0(il[539]) - , poseidon2_B_7_1(il[540]) - , poseidon2_B_7_2(il[541]) - , poseidon2_B_7_3(il[542]) - , poseidon2_B_8_0(il[543]) - , poseidon2_B_8_1(il[544]) - , poseidon2_B_8_2(il[545]) - , poseidon2_B_8_3(il[546]) - , poseidon2_B_9_0(il[547]) - , poseidon2_B_9_1(il[548]) - , poseidon2_B_9_2(il[549]) - , poseidon2_B_9_3(il[550]) - , poseidon2_EXT_LAYER_4(il[551]) - , poseidon2_EXT_LAYER_5(il[552]) - , poseidon2_EXT_LAYER_6(il[553]) - , poseidon2_EXT_LAYER_7(il[554]) - , poseidon2_T_0_4(il[555]) - , poseidon2_T_0_5(il[556]) - , poseidon2_T_0_6(il[557]) - , poseidon2_T_0_7(il[558]) - , poseidon2_T_1_4(il[559]) - , poseidon2_T_1_5(il[560]) - , poseidon2_T_1_6(il[561]) - , poseidon2_T_1_7(il[562]) - , poseidon2_T_2_4(il[563]) - , poseidon2_T_2_5(il[564]) - , poseidon2_T_2_6(il[565]) - , poseidon2_T_2_7(il[566]) - , poseidon2_T_3_4(il[567]) - , poseidon2_T_3_5(il[568]) - , poseidon2_T_3_6(il[569]) - , poseidon2_T_3_7(il[570]) - , poseidon2_T_60_4(il[571]) - , poseidon2_T_60_5(il[572]) - , poseidon2_T_60_6(il[573]) - , poseidon2_T_60_7(il[574]) - , poseidon2_T_61_4(il[575]) - , poseidon2_T_61_5(il[576]) - , poseidon2_T_61_6(il[577]) - , poseidon2_T_61_7(il[578]) - , poseidon2_T_62_4(il[579]) - , poseidon2_T_62_5(il[580]) - , poseidon2_T_62_6(il[581]) - , poseidon2_T_62_7(il[582]) - , poseidon2_T_63_4(il[583]) - , poseidon2_T_63_5(il[584]) - , poseidon2_T_63_6(il[585]) - , poseidon2_T_63_7(il[586]) - , poseidon2_a_0(il[587]) - , poseidon2_a_1(il[588]) - , poseidon2_a_2(il[589]) - , poseidon2_a_3(il[590]) - , poseidon2_b_0(il[591]) - , poseidon2_b_1(il[592]) - , poseidon2_b_2(il[593]) - , poseidon2_b_3(il[594]) - , poseidon2_clk(il[595]) - , poseidon2_full_a_0(il[596]) - , poseidon2_full_a_1(il[597]) - , poseidon2_full_a_2(il[598]) - , poseidon2_full_a_3(il[599]) - , poseidon2_full_b_0(il[600]) - , poseidon2_full_b_1(il[601]) - , poseidon2_full_b_2(il[602]) - , poseidon2_full_b_3(il[603]) - , poseidon2_full_clk(il[604]) - , poseidon2_full_end_poseidon(il[605]) - , poseidon2_full_execute_poseidon_perm(il[606]) - , poseidon2_full_input_0(il[607]) - , poseidon2_full_input_1(il[608]) - , poseidon2_full_input_2(il[609]) - , poseidon2_full_input_len(il[610]) - , poseidon2_full_num_perm_rounds_rem(il[611]) - , poseidon2_full_num_perm_rounds_rem_inv(il[612]) - , poseidon2_full_output(il[613]) - , poseidon2_full_padding(il[614]) - , poseidon2_full_sel_merkle_tree(il[615]) - , poseidon2_full_sel_poseidon(il[616]) - , poseidon2_full_start_poseidon(il[617]) - , poseidon2_input_addr(il[618]) - , poseidon2_mem_addr_read_a(il[619]) - , poseidon2_mem_addr_read_b(il[620]) - , poseidon2_mem_addr_read_c(il[621]) - , poseidon2_mem_addr_read_d(il[622]) - , poseidon2_mem_addr_write_a(il[623]) - , poseidon2_mem_addr_write_b(il[624]) - , poseidon2_mem_addr_write_c(il[625]) - , poseidon2_mem_addr_write_d(il[626]) - , poseidon2_output_addr(il[627]) - , poseidon2_sel_poseidon_perm(il[628]) - , poseidon2_sel_poseidon_perm_immediate(il[629]) - , poseidon2_sel_poseidon_perm_mem_op(il[630]) - , poseidon2_space_id(il[631]) - , range_check_alu_rng_chk(il[632]) - , range_check_clk(il[633]) - , range_check_cmp_hi_bits_rng_chk(il[634]) - , range_check_cmp_lo_bits_rng_chk(il[635]) - , range_check_cmp_non_ff_rng_chk(il[636]) - , range_check_dyn_diff(il[637]) - , range_check_dyn_rng_chk_bits(il[638]) - , range_check_dyn_rng_chk_pow_2(il[639]) - , range_check_gas_da_rng_chk(il[640]) - , range_check_gas_l2_rng_chk(il[641]) - , range_check_is_lte_u112(il[642]) - , range_check_is_lte_u128(il[643]) - , range_check_is_lte_u16(il[644]) - , range_check_is_lte_u32(il[645]) - , range_check_is_lte_u48(il[646]) - , range_check_is_lte_u64(il[647]) - , range_check_is_lte_u80(il[648]) - , range_check_is_lte_u96(il[649]) - , range_check_rng_chk_bits(il[650]) - , range_check_sel_lookup_0(il[651]) - , range_check_sel_lookup_1(il[652]) - , range_check_sel_lookup_2(il[653]) - , range_check_sel_lookup_3(il[654]) - , range_check_sel_lookup_4(il[655]) - , range_check_sel_lookup_5(il[656]) - , range_check_sel_lookup_6(il[657]) - , range_check_sel_rng_chk(il[658]) - , range_check_u16_r0(il[659]) - , range_check_u16_r1(il[660]) - , range_check_u16_r2(il[661]) - , range_check_u16_r3(il[662]) - , range_check_u16_r4(il[663]) - , range_check_u16_r5(il[664]) - , range_check_u16_r6(il[665]) - , range_check_u16_r7(il[666]) - , range_check_value(il[667]) - , sha256_clk(il[668]) - , sha256_input(il[669]) - , sha256_output(il[670]) - , sha256_sel_sha256_compression(il[671]) - , sha256_state(il[672]) - , slice_addr(il[673]) - , slice_clk(il[674]) - , slice_cnt(il[675]) - , slice_col_offset(il[676]) - , slice_one_min_inv(il[677]) - , slice_sel_cd_cpy(il[678]) - , slice_sel_mem_active(il[679]) - , slice_sel_return(il[680]) - , slice_sel_start(il[681]) - , slice_space_id(il[682]) - , slice_val(il[683]) - , lookup_rng_chk_pow_2_counts(il[684]) - , lookup_rng_chk_diff_counts(il[685]) - , lookup_rng_chk_0_counts(il[686]) - , lookup_rng_chk_1_counts(il[687]) - , lookup_rng_chk_2_counts(il[688]) - , lookup_rng_chk_3_counts(il[689]) - , lookup_rng_chk_4_counts(il[690]) - , lookup_rng_chk_5_counts(il[691]) - , lookup_rng_chk_6_counts(il[692]) - , lookup_rng_chk_7_counts(il[693]) - , lookup_mem_rng_chk_0_counts(il[694]) - , lookup_mem_rng_chk_1_counts(il[695]) - , lookup_mem_rng_chk_2_counts(il[696]) - , lookup_pow_2_0_counts(il[697]) - , lookup_pow_2_1_counts(il[698]) - , lookup_byte_lengths_counts(il[699]) - , lookup_byte_operations_counts(il[700]) - , lookup_opcode_gas_counts(il[701]) - , lookup_l2_gas_rng_chk_0_counts(il[702]) - , lookup_l2_gas_rng_chk_1_counts(il[703]) - , lookup_da_gas_rng_chk_0_counts(il[704]) - , lookup_da_gas_rng_chk_1_counts(il[705]) - , lookup_cd_value_counts(il[706]) - , lookup_ret_value_counts(il[707]) - , incl_main_tag_err_counts(il[708]) - , incl_mem_tag_err_counts(il[709]) - , perm_rng_non_ff_cmp_inv(il[710]) - , perm_rng_cmp_lo_inv(il[711]) - , perm_rng_cmp_hi_inv(il[712]) - , perm_rng_alu_inv(il[713]) - , perm_cmp_alu_inv(il[714]) - , perm_pos_mem_read_a_inv(il[715]) - , perm_pos_mem_read_b_inv(il[716]) - , perm_pos_mem_read_c_inv(il[717]) - , perm_pos_mem_read_d_inv(il[718]) - , perm_pos_mem_write_a_inv(il[719]) - , perm_pos_mem_write_b_inv(il[720]) - , perm_pos_mem_write_c_inv(il[721]) - , perm_pos_mem_write_d_inv(il[722]) - , perm_pos2_fixed_pos2_perm_inv(il[723]) - , perm_slice_mem_inv(il[724]) - , perm_merkle_poseidon2_inv(il[725]) - , perm_main_alu_inv(il[726]) - , perm_main_bin_inv(il[727]) - , perm_main_conv_inv(il[728]) - , perm_main_sha256_inv(il[729]) - , perm_main_pos2_perm_inv(il[730]) - , perm_main_slice_inv(il[731]) - , perm_main_mem_a_inv(il[732]) - , perm_main_mem_b_inv(il[733]) - , perm_main_mem_c_inv(il[734]) - , perm_main_mem_d_inv(il[735]) - , perm_main_mem_ind_addr_a_inv(il[736]) - , perm_main_mem_ind_addr_b_inv(il[737]) - , perm_main_mem_ind_addr_c_inv(il[738]) - , perm_main_mem_ind_addr_d_inv(il[739]) - , lookup_rng_chk_pow_2_inv(il[740]) - , lookup_rng_chk_diff_inv(il[741]) - , lookup_rng_chk_0_inv(il[742]) - , lookup_rng_chk_1_inv(il[743]) - , lookup_rng_chk_2_inv(il[744]) - , lookup_rng_chk_3_inv(il[745]) - , lookup_rng_chk_4_inv(il[746]) - , lookup_rng_chk_5_inv(il[747]) - , lookup_rng_chk_6_inv(il[748]) - , lookup_rng_chk_7_inv(il[749]) - , lookup_mem_rng_chk_0_inv(il[750]) - , lookup_mem_rng_chk_1_inv(il[751]) - , lookup_mem_rng_chk_2_inv(il[752]) - , lookup_pow_2_0_inv(il[753]) - , lookup_pow_2_1_inv(il[754]) - , lookup_byte_lengths_inv(il[755]) - , lookup_byte_operations_inv(il[756]) - , lookup_opcode_gas_inv(il[757]) - , lookup_l2_gas_rng_chk_0_inv(il[758]) - , lookup_l2_gas_rng_chk_1_inv(il[759]) - , lookup_da_gas_rng_chk_0_inv(il[760]) - , lookup_da_gas_rng_chk_1_inv(il[761]) - , lookup_cd_value_inv(il[762]) - , lookup_ret_value_inv(il[763]) - , incl_main_tag_err_inv(il[764]) - , incl_mem_tag_err_inv(il[765]) - , binary_acc_ia_shift(il[766]) - , binary_acc_ib_shift(il[767]) - , binary_acc_ic_shift(il[768]) - , binary_mem_tag_ctr_shift(il[769]) - , binary_op_id_shift(il[770]) - , cmp_a_hi_shift(il[771]) - , cmp_a_lo_shift(il[772]) - , cmp_b_hi_shift(il[773]) - , cmp_b_lo_shift(il[774]) - , cmp_cmp_rng_ctr_shift(il[775]) - , cmp_op_gt_shift(il[776]) - , cmp_p_sub_a_hi_shift(il[777]) - , cmp_p_sub_a_lo_shift(il[778]) - , cmp_p_sub_b_hi_shift(il[779]) - , cmp_p_sub_b_lo_shift(il[780]) - , cmp_sel_rng_chk_shift(il[781]) - , main_da_gas_remaining_shift(il[782]) - , main_internal_return_ptr_shift(il[783]) - , main_l2_gas_remaining_shift(il[784]) - , main_pc_shift(il[785]) - , main_sel_execution_end_shift(il[786]) - , main_sel_execution_row_shift(il[787]) - , mem_glob_addr_shift(il[788]) - , mem_rw_shift(il[789]) - , mem_sel_mem_shift(il[790]) - , mem_tag_shift(il[791]) - , mem_tsp_shift(il[792]) - , mem_val_shift(il[793]) - , merkle_tree_leaf_index_shift(il[794]) - , merkle_tree_leaf_value_shift(il[795]) - , merkle_tree_path_len_shift(il[796]) - , poseidon2_full_a_0_shift(il[797]) - , poseidon2_full_a_1_shift(il[798]) - , poseidon2_full_a_2_shift(il[799]) - , poseidon2_full_a_3_shift(il[800]) - , poseidon2_full_execute_poseidon_perm_shift(il[801]) - , poseidon2_full_input_0_shift(il[802]) - , poseidon2_full_input_1_shift(il[803]) - , poseidon2_full_input_2_shift(il[804]) - , poseidon2_full_num_perm_rounds_rem_shift(il[805]) - , poseidon2_full_sel_poseidon_shift(il[806]) - , poseidon2_full_start_poseidon_shift(il[807]) - , slice_addr_shift(il[808]) - , slice_clk_shift(il[809]) - , slice_cnt_shift(il[810]) - , slice_col_offset_shift(il[811]) - , slice_sel_cd_cpy_shift(il[812]) - , slice_sel_mem_active_shift(il[813]) - , slice_sel_return_shift(il[814]) - , slice_sel_start_shift(il[815]) - , slice_space_id_shift(il[816]) + , main_sel_op_get_contract_instance(il[225]) + , main_sel_op_internal_call(il[226]) + , main_sel_op_internal_return(il[227]) + , main_sel_op_is_static_call(il[228]) + , main_sel_op_jump(il[229]) + , main_sel_op_jumpi(il[230]) + , main_sel_op_keccak(il[231]) + , main_sel_op_l1_to_l2_msg_exists(il[232]) + , main_sel_op_l2gasleft(il[233]) + , main_sel_op_lt(il[234]) + , main_sel_op_lte(il[235]) + , main_sel_op_mov(il[236]) + , main_sel_op_msm(il[237]) + , main_sel_op_mul(il[238]) + , main_sel_op_not(il[239]) + , main_sel_op_note_hash_exists(il[240]) + , main_sel_op_nullifier_exists(il[241]) + , main_sel_op_or(il[242]) + , main_sel_op_poseidon2(il[243]) + , main_sel_op_radix_be(il[244]) + , main_sel_op_returndata_copy(il[245]) + , main_sel_op_returndata_size(il[246]) + , main_sel_op_sender(il[247]) + , main_sel_op_set(il[248]) + , main_sel_op_sha256(il[249]) + , main_sel_op_shl(il[250]) + , main_sel_op_shr(il[251]) + , main_sel_op_sload(il[252]) + , main_sel_op_sstore(il[253]) + , main_sel_op_static_call(il[254]) + , main_sel_op_sub(il[255]) + , main_sel_op_timestamp(il[256]) + , main_sel_op_transaction_fee(il[257]) + , main_sel_op_version(il[258]) + , main_sel_op_xor(il[259]) + , main_sel_q_kernel_lookup(il[260]) + , main_sel_q_kernel_output_lookup(il[261]) + , main_sel_resolve_ind_addr_a(il[262]) + , main_sel_resolve_ind_addr_b(il[263]) + , main_sel_resolve_ind_addr_c(il[264]) + , main_sel_resolve_ind_addr_d(il[265]) + , main_sel_returndata(il[266]) + , main_sel_rng_16(il[267]) + , main_sel_rng_8(il[268]) + , main_sel_slice_gadget(il[269]) + , main_space_id(il[270]) + , main_tag_err(il[271]) + , main_w_in_tag(il[272]) + , mem_addr(il[273]) + , mem_clk(il[274]) + , mem_diff(il[275]) + , mem_glob_addr(il[276]) + , mem_last(il[277]) + , mem_lastAccess(il[278]) + , mem_one_min_inv(il[279]) + , mem_r_in_tag(il[280]) + , mem_rw(il[281]) + , mem_sel_mem(il[282]) + , mem_sel_mov_ia_to_ic(il[283]) + , mem_sel_mov_ib_to_ic(il[284]) + , mem_sel_op_a(il[285]) + , mem_sel_op_b(il[286]) + , mem_sel_op_c(il[287]) + , mem_sel_op_d(il[288]) + , mem_sel_op_poseidon_read_a(il[289]) + , mem_sel_op_poseidon_read_b(il[290]) + , mem_sel_op_poseidon_read_c(il[291]) + , mem_sel_op_poseidon_read_d(il[292]) + , mem_sel_op_poseidon_write_a(il[293]) + , mem_sel_op_poseidon_write_b(il[294]) + , mem_sel_op_poseidon_write_c(il[295]) + , mem_sel_op_poseidon_write_d(il[296]) + , mem_sel_op_slice(il[297]) + , mem_sel_resolve_ind_addr_a(il[298]) + , mem_sel_resolve_ind_addr_b(il[299]) + , mem_sel_resolve_ind_addr_c(il[300]) + , mem_sel_resolve_ind_addr_d(il[301]) + , mem_sel_rng_chk(il[302]) + , mem_skip_check_tag(il[303]) + , mem_space_id(il[304]) + , mem_tag(il[305]) + , mem_tag_err(il[306]) + , mem_tsp(il[307]) + , mem_u16_r0(il[308]) + , mem_u16_r1(il[309]) + , mem_u8_r0(il[310]) + , mem_val(il[311]) + , mem_w_in_tag(il[312]) + , merkle_tree_clk(il[313]) + , merkle_tree_expected_tree_root(il[314]) + , merkle_tree_latch(il[315]) + , merkle_tree_leaf_index(il[316]) + , merkle_tree_leaf_index_is_even(il[317]) + , merkle_tree_leaf_value(il[318]) + , merkle_tree_left_hash(il[319]) + , merkle_tree_output_hash(il[320]) + , merkle_tree_path_len(il[321]) + , merkle_tree_path_len_inv(il[322]) + , merkle_tree_right_hash(il[323]) + , merkle_tree_sel_merkle_tree(il[324]) + , merkle_tree_sibling_value(il[325]) + , poseidon2_B_10_0(il[326]) + , poseidon2_B_10_1(il[327]) + , poseidon2_B_10_2(il[328]) + , poseidon2_B_10_3(il[329]) + , poseidon2_B_11_0(il[330]) + , poseidon2_B_11_1(il[331]) + , poseidon2_B_11_2(il[332]) + , poseidon2_B_11_3(il[333]) + , poseidon2_B_12_0(il[334]) + , poseidon2_B_12_1(il[335]) + , poseidon2_B_12_2(il[336]) + , poseidon2_B_12_3(il[337]) + , poseidon2_B_13_0(il[338]) + , poseidon2_B_13_1(il[339]) + , poseidon2_B_13_2(il[340]) + , poseidon2_B_13_3(il[341]) + , poseidon2_B_14_0(il[342]) + , poseidon2_B_14_1(il[343]) + , poseidon2_B_14_2(il[344]) + , poseidon2_B_14_3(il[345]) + , poseidon2_B_15_0(il[346]) + , poseidon2_B_15_1(il[347]) + , poseidon2_B_15_2(il[348]) + , poseidon2_B_15_3(il[349]) + , poseidon2_B_16_0(il[350]) + , poseidon2_B_16_1(il[351]) + , poseidon2_B_16_2(il[352]) + , poseidon2_B_16_3(il[353]) + , poseidon2_B_17_0(il[354]) + , poseidon2_B_17_1(il[355]) + , poseidon2_B_17_2(il[356]) + , poseidon2_B_17_3(il[357]) + , poseidon2_B_18_0(il[358]) + , poseidon2_B_18_1(il[359]) + , poseidon2_B_18_2(il[360]) + , poseidon2_B_18_3(il[361]) + , poseidon2_B_19_0(il[362]) + , poseidon2_B_19_1(il[363]) + , poseidon2_B_19_2(il[364]) + , poseidon2_B_19_3(il[365]) + , poseidon2_B_20_0(il[366]) + , poseidon2_B_20_1(il[367]) + , poseidon2_B_20_2(il[368]) + , poseidon2_B_20_3(il[369]) + , poseidon2_B_21_0(il[370]) + , poseidon2_B_21_1(il[371]) + , poseidon2_B_21_2(il[372]) + , poseidon2_B_21_3(il[373]) + , poseidon2_B_22_0(il[374]) + , poseidon2_B_22_1(il[375]) + , poseidon2_B_22_2(il[376]) + , poseidon2_B_22_3(il[377]) + , poseidon2_B_23_0(il[378]) + , poseidon2_B_23_1(il[379]) + , poseidon2_B_23_2(il[380]) + , poseidon2_B_23_3(il[381]) + , poseidon2_B_24_0(il[382]) + , poseidon2_B_24_1(il[383]) + , poseidon2_B_24_2(il[384]) + , poseidon2_B_24_3(il[385]) + , poseidon2_B_25_0(il[386]) + , poseidon2_B_25_1(il[387]) + , poseidon2_B_25_2(il[388]) + , poseidon2_B_25_3(il[389]) + , poseidon2_B_26_0(il[390]) + , poseidon2_B_26_1(il[391]) + , poseidon2_B_26_2(il[392]) + , poseidon2_B_26_3(il[393]) + , poseidon2_B_27_0(il[394]) + , poseidon2_B_27_1(il[395]) + , poseidon2_B_27_2(il[396]) + , poseidon2_B_27_3(il[397]) + , poseidon2_B_28_0(il[398]) + , poseidon2_B_28_1(il[399]) + , poseidon2_B_28_2(il[400]) + , poseidon2_B_28_3(il[401]) + , poseidon2_B_29_0(il[402]) + , poseidon2_B_29_1(il[403]) + , poseidon2_B_29_2(il[404]) + , poseidon2_B_29_3(il[405]) + , poseidon2_B_30_0(il[406]) + , poseidon2_B_30_1(il[407]) + , poseidon2_B_30_2(il[408]) + , poseidon2_B_30_3(il[409]) + , poseidon2_B_31_0(il[410]) + , poseidon2_B_31_1(il[411]) + , poseidon2_B_31_2(il[412]) + , poseidon2_B_31_3(il[413]) + , poseidon2_B_32_0(il[414]) + , poseidon2_B_32_1(il[415]) + , poseidon2_B_32_2(il[416]) + , poseidon2_B_32_3(il[417]) + , poseidon2_B_33_0(il[418]) + , poseidon2_B_33_1(il[419]) + , poseidon2_B_33_2(il[420]) + , poseidon2_B_33_3(il[421]) + , poseidon2_B_34_0(il[422]) + , poseidon2_B_34_1(il[423]) + , poseidon2_B_34_2(il[424]) + , poseidon2_B_34_3(il[425]) + , poseidon2_B_35_0(il[426]) + , poseidon2_B_35_1(il[427]) + , poseidon2_B_35_2(il[428]) + , poseidon2_B_35_3(il[429]) + , poseidon2_B_36_0(il[430]) + , poseidon2_B_36_1(il[431]) + , poseidon2_B_36_2(il[432]) + , poseidon2_B_36_3(il[433]) + , poseidon2_B_37_0(il[434]) + , poseidon2_B_37_1(il[435]) + , poseidon2_B_37_2(il[436]) + , poseidon2_B_37_3(il[437]) + , poseidon2_B_38_0(il[438]) + , poseidon2_B_38_1(il[439]) + , poseidon2_B_38_2(il[440]) + , poseidon2_B_38_3(il[441]) + , poseidon2_B_39_0(il[442]) + , poseidon2_B_39_1(il[443]) + , poseidon2_B_39_2(il[444]) + , poseidon2_B_39_3(il[445]) + , poseidon2_B_40_0(il[446]) + , poseidon2_B_40_1(il[447]) + , poseidon2_B_40_2(il[448]) + , poseidon2_B_40_3(il[449]) + , poseidon2_B_41_0(il[450]) + , poseidon2_B_41_1(il[451]) + , poseidon2_B_41_2(il[452]) + , poseidon2_B_41_3(il[453]) + , poseidon2_B_42_0(il[454]) + , poseidon2_B_42_1(il[455]) + , poseidon2_B_42_2(il[456]) + , poseidon2_B_42_3(il[457]) + , poseidon2_B_43_0(il[458]) + , poseidon2_B_43_1(il[459]) + , poseidon2_B_43_2(il[460]) + , poseidon2_B_43_3(il[461]) + , poseidon2_B_44_0(il[462]) + , poseidon2_B_44_1(il[463]) + , poseidon2_B_44_2(il[464]) + , poseidon2_B_44_3(il[465]) + , poseidon2_B_45_0(il[466]) + , poseidon2_B_45_1(il[467]) + , poseidon2_B_45_2(il[468]) + , poseidon2_B_45_3(il[469]) + , poseidon2_B_46_0(il[470]) + , poseidon2_B_46_1(il[471]) + , poseidon2_B_46_2(il[472]) + , poseidon2_B_46_3(il[473]) + , poseidon2_B_47_0(il[474]) + , poseidon2_B_47_1(il[475]) + , poseidon2_B_47_2(il[476]) + , poseidon2_B_47_3(il[477]) + , poseidon2_B_48_0(il[478]) + , poseidon2_B_48_1(il[479]) + , poseidon2_B_48_2(il[480]) + , poseidon2_B_48_3(il[481]) + , poseidon2_B_49_0(il[482]) + , poseidon2_B_49_1(il[483]) + , poseidon2_B_49_2(il[484]) + , poseidon2_B_49_3(il[485]) + , poseidon2_B_4_0(il[486]) + , poseidon2_B_4_1(il[487]) + , poseidon2_B_4_2(il[488]) + , poseidon2_B_4_3(il[489]) + , poseidon2_B_50_0(il[490]) + , poseidon2_B_50_1(il[491]) + , poseidon2_B_50_2(il[492]) + , poseidon2_B_50_3(il[493]) + , poseidon2_B_51_0(il[494]) + , poseidon2_B_51_1(il[495]) + , poseidon2_B_51_2(il[496]) + , poseidon2_B_51_3(il[497]) + , poseidon2_B_52_0(il[498]) + , poseidon2_B_52_1(il[499]) + , poseidon2_B_52_2(il[500]) + , poseidon2_B_52_3(il[501]) + , poseidon2_B_53_0(il[502]) + , poseidon2_B_53_1(il[503]) + , poseidon2_B_53_2(il[504]) + , poseidon2_B_53_3(il[505]) + , poseidon2_B_54_0(il[506]) + , poseidon2_B_54_1(il[507]) + , poseidon2_B_54_2(il[508]) + , poseidon2_B_54_3(il[509]) + , poseidon2_B_55_0(il[510]) + , poseidon2_B_55_1(il[511]) + , poseidon2_B_55_2(il[512]) + , poseidon2_B_55_3(il[513]) + , poseidon2_B_56_0(il[514]) + , poseidon2_B_56_1(il[515]) + , poseidon2_B_56_2(il[516]) + , poseidon2_B_56_3(il[517]) + , poseidon2_B_57_0(il[518]) + , poseidon2_B_57_1(il[519]) + , poseidon2_B_57_2(il[520]) + , poseidon2_B_57_3(il[521]) + , poseidon2_B_58_0(il[522]) + , poseidon2_B_58_1(il[523]) + , poseidon2_B_58_2(il[524]) + , poseidon2_B_58_3(il[525]) + , poseidon2_B_59_0(il[526]) + , poseidon2_B_59_1(il[527]) + , poseidon2_B_59_2(il[528]) + , poseidon2_B_59_3(il[529]) + , poseidon2_B_5_0(il[530]) + , poseidon2_B_5_1(il[531]) + , poseidon2_B_5_2(il[532]) + , poseidon2_B_5_3(il[533]) + , poseidon2_B_6_0(il[534]) + , poseidon2_B_6_1(il[535]) + , poseidon2_B_6_2(il[536]) + , poseidon2_B_6_3(il[537]) + , poseidon2_B_7_0(il[538]) + , poseidon2_B_7_1(il[539]) + , poseidon2_B_7_2(il[540]) + , poseidon2_B_7_3(il[541]) + , poseidon2_B_8_0(il[542]) + , poseidon2_B_8_1(il[543]) + , poseidon2_B_8_2(il[544]) + , poseidon2_B_8_3(il[545]) + , poseidon2_B_9_0(il[546]) + , poseidon2_B_9_1(il[547]) + , poseidon2_B_9_2(il[548]) + , poseidon2_B_9_3(il[549]) + , poseidon2_EXT_LAYER_4(il[550]) + , poseidon2_EXT_LAYER_5(il[551]) + , poseidon2_EXT_LAYER_6(il[552]) + , poseidon2_EXT_LAYER_7(il[553]) + , poseidon2_T_0_4(il[554]) + , poseidon2_T_0_5(il[555]) + , poseidon2_T_0_6(il[556]) + , poseidon2_T_0_7(il[557]) + , poseidon2_T_1_4(il[558]) + , poseidon2_T_1_5(il[559]) + , poseidon2_T_1_6(il[560]) + , poseidon2_T_1_7(il[561]) + , poseidon2_T_2_4(il[562]) + , poseidon2_T_2_5(il[563]) + , poseidon2_T_2_6(il[564]) + , poseidon2_T_2_7(il[565]) + , poseidon2_T_3_4(il[566]) + , poseidon2_T_3_5(il[567]) + , poseidon2_T_3_6(il[568]) + , poseidon2_T_3_7(il[569]) + , poseidon2_T_60_4(il[570]) + , poseidon2_T_60_5(il[571]) + , poseidon2_T_60_6(il[572]) + , poseidon2_T_60_7(il[573]) + , poseidon2_T_61_4(il[574]) + , poseidon2_T_61_5(il[575]) + , poseidon2_T_61_6(il[576]) + , poseidon2_T_61_7(il[577]) + , poseidon2_T_62_4(il[578]) + , poseidon2_T_62_5(il[579]) + , poseidon2_T_62_6(il[580]) + , poseidon2_T_62_7(il[581]) + , poseidon2_T_63_4(il[582]) + , poseidon2_T_63_5(il[583]) + , poseidon2_T_63_6(il[584]) + , poseidon2_T_63_7(il[585]) + , poseidon2_a_0(il[586]) + , poseidon2_a_1(il[587]) + , poseidon2_a_2(il[588]) + , poseidon2_a_3(il[589]) + , poseidon2_b_0(il[590]) + , poseidon2_b_1(il[591]) + , poseidon2_b_2(il[592]) + , poseidon2_b_3(il[593]) + , poseidon2_clk(il[594]) + , poseidon2_full_a_0(il[595]) + , poseidon2_full_a_1(il[596]) + , poseidon2_full_a_2(il[597]) + , poseidon2_full_a_3(il[598]) + , poseidon2_full_b_0(il[599]) + , poseidon2_full_b_1(il[600]) + , poseidon2_full_b_2(il[601]) + , poseidon2_full_b_3(il[602]) + , poseidon2_full_clk(il[603]) + , poseidon2_full_end_poseidon(il[604]) + , poseidon2_full_execute_poseidon_perm(il[605]) + , poseidon2_full_input_0(il[606]) + , poseidon2_full_input_1(il[607]) + , poseidon2_full_input_2(il[608]) + , poseidon2_full_input_len(il[609]) + , poseidon2_full_num_perm_rounds_rem(il[610]) + , poseidon2_full_num_perm_rounds_rem_inv(il[611]) + , poseidon2_full_output(il[612]) + , poseidon2_full_padding(il[613]) + , poseidon2_full_sel_merkle_tree(il[614]) + , poseidon2_full_sel_poseidon(il[615]) + , poseidon2_full_start_poseidon(il[616]) + , poseidon2_input_addr(il[617]) + , poseidon2_mem_addr_read_a(il[618]) + , poseidon2_mem_addr_read_b(il[619]) + , poseidon2_mem_addr_read_c(il[620]) + , poseidon2_mem_addr_read_d(il[621]) + , poseidon2_mem_addr_write_a(il[622]) + , poseidon2_mem_addr_write_b(il[623]) + , poseidon2_mem_addr_write_c(il[624]) + , poseidon2_mem_addr_write_d(il[625]) + , poseidon2_output_addr(il[626]) + , poseidon2_sel_poseidon_perm(il[627]) + , poseidon2_sel_poseidon_perm_immediate(il[628]) + , poseidon2_sel_poseidon_perm_mem_op(il[629]) + , poseidon2_space_id(il[630]) + , range_check_alu_rng_chk(il[631]) + , range_check_clk(il[632]) + , range_check_cmp_hi_bits_rng_chk(il[633]) + , range_check_cmp_lo_bits_rng_chk(il[634]) + , range_check_cmp_non_ff_rng_chk(il[635]) + , range_check_dyn_diff(il[636]) + , range_check_dyn_rng_chk_bits(il[637]) + , range_check_dyn_rng_chk_pow_2(il[638]) + , range_check_gas_da_rng_chk(il[639]) + , range_check_gas_l2_rng_chk(il[640]) + , range_check_is_lte_u112(il[641]) + , range_check_is_lte_u128(il[642]) + , range_check_is_lte_u16(il[643]) + , range_check_is_lte_u32(il[644]) + , range_check_is_lte_u48(il[645]) + , range_check_is_lte_u64(il[646]) + , range_check_is_lte_u80(il[647]) + , range_check_is_lte_u96(il[648]) + , range_check_rng_chk_bits(il[649]) + , range_check_sel_lookup_0(il[650]) + , range_check_sel_lookup_1(il[651]) + , range_check_sel_lookup_2(il[652]) + , range_check_sel_lookup_3(il[653]) + , range_check_sel_lookup_4(il[654]) + , range_check_sel_lookup_5(il[655]) + , range_check_sel_lookup_6(il[656]) + , range_check_sel_rng_chk(il[657]) + , range_check_u16_r0(il[658]) + , range_check_u16_r1(il[659]) + , range_check_u16_r2(il[660]) + , range_check_u16_r3(il[661]) + , range_check_u16_r4(il[662]) + , range_check_u16_r5(il[663]) + , range_check_u16_r6(il[664]) + , range_check_u16_r7(il[665]) + , range_check_value(il[666]) + , sha256_clk(il[667]) + , sha256_input(il[668]) + , sha256_output(il[669]) + , sha256_sel_sha256_compression(il[670]) + , sha256_state(il[671]) + , slice_addr(il[672]) + , slice_clk(il[673]) + , slice_cnt(il[674]) + , slice_col_offset(il[675]) + , slice_one_min_inv(il[676]) + , slice_sel_cd_cpy(il[677]) + , slice_sel_mem_active(il[678]) + , slice_sel_return(il[679]) + , slice_sel_start(il[680]) + , slice_space_id(il[681]) + , slice_val(il[682]) + , lookup_rng_chk_pow_2_counts(il[683]) + , lookup_rng_chk_diff_counts(il[684]) + , lookup_rng_chk_0_counts(il[685]) + , lookup_rng_chk_1_counts(il[686]) + , lookup_rng_chk_2_counts(il[687]) + , lookup_rng_chk_3_counts(il[688]) + , lookup_rng_chk_4_counts(il[689]) + , lookup_rng_chk_5_counts(il[690]) + , lookup_rng_chk_6_counts(il[691]) + , lookup_rng_chk_7_counts(il[692]) + , lookup_mem_rng_chk_0_counts(il[693]) + , lookup_mem_rng_chk_1_counts(il[694]) + , lookup_mem_rng_chk_2_counts(il[695]) + , lookup_pow_2_0_counts(il[696]) + , lookup_pow_2_1_counts(il[697]) + , lookup_byte_lengths_counts(il[698]) + , lookup_byte_operations_counts(il[699]) + , lookup_opcode_gas_counts(il[700]) + , lookup_l2_gas_rng_chk_0_counts(il[701]) + , lookup_l2_gas_rng_chk_1_counts(il[702]) + , lookup_da_gas_rng_chk_0_counts(il[703]) + , lookup_da_gas_rng_chk_1_counts(il[704]) + , lookup_cd_value_counts(il[705]) + , lookup_ret_value_counts(il[706]) + , incl_main_tag_err_counts(il[707]) + , incl_mem_tag_err_counts(il[708]) + , perm_rng_non_ff_cmp_inv(il[709]) + , perm_rng_cmp_lo_inv(il[710]) + , perm_rng_cmp_hi_inv(il[711]) + , perm_rng_alu_inv(il[712]) + , perm_cmp_alu_inv(il[713]) + , perm_pos_mem_read_a_inv(il[714]) + , perm_pos_mem_read_b_inv(il[715]) + , perm_pos_mem_read_c_inv(il[716]) + , perm_pos_mem_read_d_inv(il[717]) + , perm_pos_mem_write_a_inv(il[718]) + , perm_pos_mem_write_b_inv(il[719]) + , perm_pos_mem_write_c_inv(il[720]) + , perm_pos_mem_write_d_inv(il[721]) + , perm_pos2_fixed_pos2_perm_inv(il[722]) + , perm_slice_mem_inv(il[723]) + , perm_merkle_poseidon2_inv(il[724]) + , perm_main_alu_inv(il[725]) + , perm_main_bin_inv(il[726]) + , perm_main_conv_inv(il[727]) + , perm_main_sha256_inv(il[728]) + , perm_main_pos2_perm_inv(il[729]) + , perm_main_slice_inv(il[730]) + , perm_main_mem_a_inv(il[731]) + , perm_main_mem_b_inv(il[732]) + , perm_main_mem_c_inv(il[733]) + , perm_main_mem_d_inv(il[734]) + , perm_main_mem_ind_addr_a_inv(il[735]) + , perm_main_mem_ind_addr_b_inv(il[736]) + , perm_main_mem_ind_addr_c_inv(il[737]) + , perm_main_mem_ind_addr_d_inv(il[738]) + , lookup_rng_chk_pow_2_inv(il[739]) + , lookup_rng_chk_diff_inv(il[740]) + , lookup_rng_chk_0_inv(il[741]) + , lookup_rng_chk_1_inv(il[742]) + , lookup_rng_chk_2_inv(il[743]) + , lookup_rng_chk_3_inv(il[744]) + , lookup_rng_chk_4_inv(il[745]) + , lookup_rng_chk_5_inv(il[746]) + , lookup_rng_chk_6_inv(il[747]) + , lookup_rng_chk_7_inv(il[748]) + , lookup_mem_rng_chk_0_inv(il[749]) + , lookup_mem_rng_chk_1_inv(il[750]) + , lookup_mem_rng_chk_2_inv(il[751]) + , lookup_pow_2_0_inv(il[752]) + , lookup_pow_2_1_inv(il[753]) + , lookup_byte_lengths_inv(il[754]) + , lookup_byte_operations_inv(il[755]) + , lookup_opcode_gas_inv(il[756]) + , lookup_l2_gas_rng_chk_0_inv(il[757]) + , lookup_l2_gas_rng_chk_1_inv(il[758]) + , lookup_da_gas_rng_chk_0_inv(il[759]) + , lookup_da_gas_rng_chk_1_inv(il[760]) + , lookup_cd_value_inv(il[761]) + , lookup_ret_value_inv(il[762]) + , incl_main_tag_err_inv(il[763]) + , incl_mem_tag_err_inv(il[764]) + , binary_acc_ia_shift(il[765]) + , binary_acc_ib_shift(il[766]) + , binary_acc_ic_shift(il[767]) + , binary_mem_tag_ctr_shift(il[768]) + , binary_op_id_shift(il[769]) + , cmp_a_hi_shift(il[770]) + , cmp_a_lo_shift(il[771]) + , cmp_b_hi_shift(il[772]) + , cmp_b_lo_shift(il[773]) + , cmp_cmp_rng_ctr_shift(il[774]) + , cmp_op_gt_shift(il[775]) + , cmp_p_sub_a_hi_shift(il[776]) + , cmp_p_sub_a_lo_shift(il[777]) + , cmp_p_sub_b_hi_shift(il[778]) + , cmp_p_sub_b_lo_shift(il[779]) + , cmp_sel_rng_chk_shift(il[780]) + , main_da_gas_remaining_shift(il[781]) + , main_internal_return_ptr_shift(il[782]) + , main_l2_gas_remaining_shift(il[783]) + , main_pc_shift(il[784]) + , main_sel_execution_end_shift(il[785]) + , main_sel_execution_row_shift(il[786]) + , mem_glob_addr_shift(il[787]) + , mem_rw_shift(il[788]) + , mem_sel_mem_shift(il[789]) + , mem_tag_shift(il[790]) + , mem_tsp_shift(il[791]) + , mem_val_shift(il[792]) + , merkle_tree_leaf_index_shift(il[793]) + , merkle_tree_leaf_value_shift(il[794]) + , merkle_tree_path_len_shift(il[795]) + , poseidon2_full_a_0_shift(il[796]) + , poseidon2_full_a_1_shift(il[797]) + , poseidon2_full_a_2_shift(il[798]) + , poseidon2_full_a_3_shift(il[799]) + , poseidon2_full_execute_poseidon_perm_shift(il[800]) + , poseidon2_full_input_0_shift(il[801]) + , poseidon2_full_input_1_shift(il[802]) + , poseidon2_full_input_2_shift(il[803]) + , poseidon2_full_num_perm_rounds_rem_shift(il[804]) + , poseidon2_full_sel_poseidon_shift(il[805]) + , poseidon2_full_start_poseidon_shift(il[806]) + , slice_addr_shift(il[807]) + , slice_clk_shift(il[808]) + , slice_cnt_shift(il[809]) + , slice_col_offset_shift(il[810]) + , slice_sel_cd_cpy_shift(il[811]) + , slice_sel_mem_active_shift(il[812]) + , slice_sel_return_shift(il[813]) + , slice_sel_start_shift(il[814]) + , slice_space_id_shift(il[815]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) @@ -1063,7 +1062,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id main_sel_op_fdiv[row_idx], main_sel_op_fee_per_da_gas[row_idx], main_sel_op_fee_per_l2_gas[row_idx], - main_sel_op_function_selector[row_idx], main_sel_op_get_contract_instance[row_idx], main_sel_op_internal_call[row_idx], main_sel_op_internal_return[row_idx], @@ -1884,7 +1882,6 @@ AvmFlavor::CommitmentLabels::CommitmentLabels() Base::main_sel_op_fdiv = "MAIN_SEL_OP_FDIV"; Base::main_sel_op_fee_per_da_gas = "MAIN_SEL_OP_FEE_PER_DA_GAS"; Base::main_sel_op_fee_per_l2_gas = "MAIN_SEL_OP_FEE_PER_L2_GAS"; - Base::main_sel_op_function_selector = "MAIN_SEL_OP_FUNCTION_SELECTOR"; Base::main_sel_op_get_contract_instance = "MAIN_SEL_OP_GET_CONTRACT_INSTANCE"; Base::main_sel_op_internal_call = "MAIN_SEL_OP_INTERNAL_CALL"; Base::main_sel_op_internal_return = "MAIN_SEL_OP_INTERNAL_RETURN"; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index f82d78abe6e..ae4c6a9dec1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -96,7 +96,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_da_end_gas_kernel_input, main_sel_da_start_gas_kernel_input, main_sel_first, main_sel_l2_end_gas_kernel_input, main_sel_l2_start_gas_kernel_input, main_sel_start_exec, main_zeroes, powers_power_of_2 -#define WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_non_ff_gt, 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_arifact_hash, bytecode_as_fields, bytecode_bytes, bytecode_bytes_pc, bytecode_class_id, bytecode_contract_address, bytecode_decomposed, bytecode_deployer_addr, bytecode_end_latch, bytecode_incoming_viewing_key_x, bytecode_incoming_viewing_key_y, bytecode_initialization_hash, bytecode_length_remaining, bytecode_nullifier_key_x, bytecode_nullifier_key_y, bytecode_outgoing_viewing_key_x, bytecode_outgoing_viewing_key_y, bytecode_private_fn_root, bytecode_public_key_hash, bytecode_running_hash, bytecode_salt, bytecode_tagging_key_x, bytecode_tagging_key_y, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_diff, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_op_non_ff_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_be, 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_gas_u16_r0, main_da_gas_u16_r1, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_l2_gas_remaining, main_l2_gas_u16_r0, main_l2_gas_u16_r1, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_end, main_sel_execution_row, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_debug_log, 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_poseidon2, main_sel_op_radix_be, main_sel_op_returndata_copy, main_sel_op_returndata_size, 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_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_space_id, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_u16_r0, mem_u16_r1, mem_u8_r0, mem_val, mem_w_in_tag, merkle_tree_clk, merkle_tree_expected_tree_root, merkle_tree_latch, merkle_tree_leaf_index, merkle_tree_leaf_index_is_even, merkle_tree_leaf_value, merkle_tree_left_hash, merkle_tree_output_hash, merkle_tree_path_len, merkle_tree_path_len_inv, merkle_tree_right_hash, merkle_tree_sel_merkle_tree, merkle_tree_sibling_value, 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_full_a_0, poseidon2_full_a_1, poseidon2_full_a_2, poseidon2_full_a_3, poseidon2_full_b_0, poseidon2_full_b_1, poseidon2_full_b_2, poseidon2_full_b_3, poseidon2_full_clk, poseidon2_full_end_poseidon, poseidon2_full_execute_poseidon_perm, poseidon2_full_input_0, poseidon2_full_input_1, poseidon2_full_input_2, poseidon2_full_input_len, poseidon2_full_num_perm_rounds_rem, poseidon2_full_num_perm_rounds_rem_inv, poseidon2_full_output, poseidon2_full_padding, poseidon2_full_sel_merkle_tree, poseidon2_full_sel_poseidon, poseidon2_full_start_poseidon, 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, poseidon2_sel_poseidon_perm_immediate, poseidon2_sel_poseidon_perm_mem_op, poseidon2_space_id, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_cmp_non_ff_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_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_mem_rng_chk_0_counts, lookup_mem_rng_chk_1_counts, lookup_mem_rng_chk_2_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, lookup_l2_gas_rng_chk_0_counts, lookup_l2_gas_rng_chk_1_counts, lookup_da_gas_rng_chk_0_counts, lookup_da_gas_rng_chk_1_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_non_ff_gt, 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_arifact_hash, bytecode_as_fields, bytecode_bytes, bytecode_bytes_pc, bytecode_class_id, bytecode_contract_address, bytecode_decomposed, bytecode_deployer_addr, bytecode_end_latch, bytecode_incoming_viewing_key_x, bytecode_incoming_viewing_key_y, bytecode_initialization_hash, bytecode_length_remaining, bytecode_nullifier_key_x, bytecode_nullifier_key_y, bytecode_outgoing_viewing_key_x, bytecode_outgoing_viewing_key_y, bytecode_private_fn_root, bytecode_public_key_hash, bytecode_running_hash, bytecode_salt, bytecode_tagging_key_x, bytecode_tagging_key_y, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_diff, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_op_non_ff_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_be, 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_gas_u16_r0, main_da_gas_u16_r1, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_l2_gas_remaining, main_l2_gas_u16_r0, main_l2_gas_u16_r1, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_end, main_sel_execution_row, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_debug_log, 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_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_poseidon2, main_sel_op_radix_be, main_sel_op_returndata_copy, main_sel_op_returndata_size, 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_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_space_id, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_u16_r0, mem_u16_r1, mem_u8_r0, mem_val, mem_w_in_tag, merkle_tree_clk, merkle_tree_expected_tree_root, merkle_tree_latch, merkle_tree_leaf_index, merkle_tree_leaf_index_is_even, merkle_tree_leaf_value, merkle_tree_left_hash, merkle_tree_output_hash, merkle_tree_path_len, merkle_tree_path_len_inv, merkle_tree_right_hash, merkle_tree_sel_merkle_tree, merkle_tree_sibling_value, 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_full_a_0, poseidon2_full_a_1, poseidon2_full_a_2, poseidon2_full_a_3, poseidon2_full_b_0, poseidon2_full_b_1, poseidon2_full_b_2, poseidon2_full_b_3, poseidon2_full_clk, poseidon2_full_end_poseidon, poseidon2_full_execute_poseidon_perm, poseidon2_full_input_0, poseidon2_full_input_1, poseidon2_full_input_2, poseidon2_full_input_len, poseidon2_full_num_perm_rounds_rem, poseidon2_full_num_perm_rounds_rem_inv, poseidon2_full_output, poseidon2_full_padding, poseidon2_full_sel_merkle_tree, poseidon2_full_sel_poseidon, poseidon2_full_start_poseidon, 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, poseidon2_sel_poseidon_perm_immediate, poseidon2_sel_poseidon_perm_mem_op, poseidon2_space_id, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_cmp_non_ff_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_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_mem_rng_chk_0_counts, lookup_mem_rng_chk_1_counts, lookup_mem_rng_chk_2_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, lookup_l2_gas_rng_chk_0_counts, lookup_l2_gas_rng_chk_1_counts, lookup_da_gas_rng_chk_0_counts, lookup_da_gas_rng_chk_1_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_non_ff_cmp_inv, perm_rng_cmp_lo_inv, perm_rng_cmp_hi_inv, perm_rng_alu_inv, perm_cmp_alu_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_pos2_fixed_pos2_perm_inv, perm_slice_mem_inv, perm_merkle_poseidon2_inv, perm_main_alu_inv, perm_main_bin_inv, perm_main_conv_inv, perm_main_sha256_inv, perm_main_pos2_perm_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_mem_rng_chk_0_inv, lookup_mem_rng_chk_1_inv, lookup_mem_rng_chk_2_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_byte_lengths_inv, lookup_byte_operations_inv, lookup_opcode_gas_inv, lookup_l2_gas_rng_chk_0_inv, lookup_l2_gas_rng_chk_1_inv, lookup_da_gas_rng_chk_0_inv, lookup_da_gas_rng_chk_1_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_internal_return_ptr_shift, main_l2_gas_remaining_shift, main_pc_shift, main_sel_execution_end_shift, main_sel_execution_row_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, merkle_tree_leaf_index_shift, merkle_tree_leaf_value_shift, merkle_tree_path_len_shift, poseidon2_full_a_0_shift, poseidon2_full_a_1_shift, poseidon2_full_a_2_shift, poseidon2_full_a_3_shift, poseidon2_full_execute_poseidon_perm_shift, poseidon2_full_input_0_shift, poseidon2_full_input_1_shift, poseidon2_full_input_2_shift, poseidon2_full_num_perm_rounds_rem_shift, poseidon2_full_sel_poseidon_shift, poseidon2_full_start_poseidon_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_internal_return_ptr, e.main_l2_gas_remaining, e.main_pc, e.main_sel_execution_end, e.main_sel_execution_row, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.merkle_tree_leaf_index, e.merkle_tree_leaf_value, e.merkle_tree_path_len, e.poseidon2_full_a_0, e.poseidon2_full_a_1, e.poseidon2_full_a_2, e.poseidon2_full_a_3, e.poseidon2_full_execute_poseidon_perm, e.poseidon2_full_input_0, e.poseidon2_full_input_1, e.poseidon2_full_input_2, e.poseidon2_full_num_perm_rounds_rem, e.poseidon2_full_sel_poseidon, e.poseidon2_full_start_poseidon, 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 @@ -125,12 +125,12 @@ class AvmFlavor { static constexpr bool HasZK = false; static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 21; - static constexpr size_t NUM_WITNESS_ENTITIES = 745; + static constexpr size_t NUM_WITNESS_ENTITIES = 744; static constexpr size_t NUM_SHIFTED_ENTITIES = 51; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for // the unshifted and one for the shifted - static constexpr size_t NUM_ALL_ENTITIES = 817; + static constexpr size_t NUM_ALL_ENTITIES = 816; // 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.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp index cff3284cea7..496d30cc203 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.cpp @@ -244,7 +244,6 @@ template std::vector AvmFullRow::names() "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", @@ -1015,7 +1014,6 @@ template RefVector AvmFullRow::as_vector() const 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, 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 ebfbce7f71b..fab4b834263 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp @@ -235,7 +235,6 @@ template struct AvmFullRow { FF main_sel_op_fdiv{}; FF main_sel_op_fee_per_da_gas{}; FF main_sel_op_fee_per_l2_gas{}; - FF main_sel_op_function_selector{}; FF main_sel_op_get_contract_instance{}; FF main_sel_op_internal_call{}; FF main_sel_op_internal_return{}; @@ -780,7 +779,7 @@ template struct AvmFullRow { RefVector as_vector() const; static std::vector names(); - static constexpr size_t SIZE = 766; + static constexpr size_t SIZE = 765; }; template std::ostream& operator<<(std::ostream& os, AvmFullRow const& row); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp index 3ebb15e5293..8f3bd984d59 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/main.hpp @@ -10,11 +10,11 @@ template class mainImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { - 2, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 2, 3 + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { + 2, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, 3, 3, 3, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 2, 3 }; template @@ -53,8 +53,7 @@ template class mainImpl { new_term.main_sel_op_ecadd) + new_term.main_sel_op_msm); const auto main_SEL_ALL_MEMORY = (new_term.main_sel_op_mov + new_term.main_sel_op_set); - const auto main_KERNEL_INPUT_SELECTORS = ((((((((((new_term.main_sel_op_address + new_term.main_sel_op_sender) + - new_term.main_sel_op_function_selector) + + const auto main_KERNEL_INPUT_SELECTORS = (((((((((new_term.main_sel_op_address + new_term.main_sel_op_sender) + new_term.main_sel_op_transaction_fee) + new_term.main_sel_op_chain_id) + new_term.main_sel_op_version) + @@ -123,671 +122,665 @@ template class mainImpl { } { using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_function_selector * (FF(1) - new_term.main_sel_op_function_selector)); + auto tmp = (new_term.main_sel_op_transaction_fee * (FF(1) - new_term.main_sel_op_transaction_fee)); tmp *= scaling_factor; std::get<5>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_transaction_fee * (FF(1) - new_term.main_sel_op_transaction_fee)); + auto tmp = (new_term.main_sel_op_chain_id * (FF(1) - new_term.main_sel_op_chain_id)); tmp *= scaling_factor; std::get<6>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_chain_id * (FF(1) - new_term.main_sel_op_chain_id)); + auto tmp = (new_term.main_sel_op_version * (FF(1) - new_term.main_sel_op_version)); tmp *= scaling_factor; std::get<7>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_version * (FF(1) - new_term.main_sel_op_version)); + auto tmp = (new_term.main_sel_op_block_number * (FF(1) - new_term.main_sel_op_block_number)); tmp *= scaling_factor; std::get<8>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_block_number * (FF(1) - new_term.main_sel_op_block_number)); + auto tmp = (new_term.main_sel_op_timestamp * (FF(1) - new_term.main_sel_op_timestamp)); tmp *= scaling_factor; std::get<9>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_timestamp * (FF(1) - new_term.main_sel_op_timestamp)); + auto tmp = (new_term.main_sel_op_fee_per_l2_gas * (FF(1) - new_term.main_sel_op_fee_per_l2_gas)); tmp *= scaling_factor; std::get<10>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fee_per_l2_gas * (FF(1) - new_term.main_sel_op_fee_per_l2_gas)); + auto tmp = (new_term.main_sel_op_fee_per_da_gas * (FF(1) - new_term.main_sel_op_fee_per_da_gas)); tmp *= scaling_factor; std::get<11>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fee_per_da_gas * (FF(1) - new_term.main_sel_op_fee_per_da_gas)); + auto tmp = (new_term.main_sel_op_is_static_call * (FF(1) - new_term.main_sel_op_is_static_call)); tmp *= scaling_factor; std::get<12>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_is_static_call * (FF(1) - new_term.main_sel_op_is_static_call)); + auto tmp = (new_term.main_sel_op_l2gasleft * (FF(1) - new_term.main_sel_op_l2gasleft)); tmp *= scaling_factor; std::get<13>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l2gasleft * (FF(1) - new_term.main_sel_op_l2gasleft)); + auto tmp = (new_term.main_sel_op_dagasleft * (FF(1) - new_term.main_sel_op_dagasleft)); tmp *= scaling_factor; std::get<14>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_dagasleft * (FF(1) - new_term.main_sel_op_dagasleft)); + auto tmp = (new_term.main_sel_op_note_hash_exists * (FF(1) - new_term.main_sel_op_note_hash_exists)); tmp *= scaling_factor; std::get<15>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_note_hash_exists * (FF(1) - new_term.main_sel_op_note_hash_exists)); + auto tmp = (new_term.main_sel_op_emit_note_hash * (FF(1) - new_term.main_sel_op_emit_note_hash)); tmp *= scaling_factor; std::get<16>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_note_hash * (FF(1) - new_term.main_sel_op_emit_note_hash)); + auto tmp = (new_term.main_sel_op_nullifier_exists * (FF(1) - new_term.main_sel_op_nullifier_exists)); tmp *= scaling_factor; std::get<17>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_nullifier_exists * (FF(1) - new_term.main_sel_op_nullifier_exists)); + auto tmp = (new_term.main_sel_op_emit_nullifier * (FF(1) - new_term.main_sel_op_emit_nullifier)); tmp *= scaling_factor; std::get<18>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<19, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_nullifier * (FF(1) - new_term.main_sel_op_emit_nullifier)); + auto tmp = (new_term.main_sel_op_l1_to_l2_msg_exists * (FF(1) - new_term.main_sel_op_l1_to_l2_msg_exists)); tmp *= scaling_factor; std::get<19>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<20, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l1_to_l2_msg_exists * (FF(1) - new_term.main_sel_op_l1_to_l2_msg_exists)); + auto tmp = + (new_term.main_sel_op_emit_unencrypted_log * (FF(1) - new_term.main_sel_op_emit_unencrypted_log)); tmp *= scaling_factor; std::get<20>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<21, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_emit_unencrypted_log * (FF(1) - new_term.main_sel_op_emit_unencrypted_log)); + auto tmp = (new_term.main_sel_op_emit_l2_to_l1_msg * (FF(1) - new_term.main_sel_op_emit_l2_to_l1_msg)); tmp *= scaling_factor; std::get<21>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<22, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_emit_l2_to_l1_msg * (FF(1) - new_term.main_sel_op_emit_l2_to_l1_msg)); + auto tmp = + (new_term.main_sel_op_get_contract_instance * (FF(1) - new_term.main_sel_op_get_contract_instance)); tmp *= scaling_factor; std::get<22>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<23, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_get_contract_instance * (FF(1) - new_term.main_sel_op_get_contract_instance)); + auto tmp = (new_term.main_sel_op_sload * (FF(1) - new_term.main_sel_op_sload)); tmp *= scaling_factor; std::get<23>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<24, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sload * (FF(1) - new_term.main_sel_op_sload)); + auto tmp = (new_term.main_sel_op_sstore * (FF(1) - new_term.main_sel_op_sstore)); tmp *= scaling_factor; std::get<24>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<25, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sstore * (FF(1) - new_term.main_sel_op_sstore)); + auto tmp = (new_term.main_sel_op_debug_log * (FF(1) - new_term.main_sel_op_debug_log)); tmp *= scaling_factor; std::get<25>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<26, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_debug_log * (FF(1) - new_term.main_sel_op_debug_log)); + auto tmp = (new_term.main_sel_op_radix_be * (FF(1) - new_term.main_sel_op_radix_be)); tmp *= scaling_factor; std::get<26>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<27, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_radix_be * (FF(1) - new_term.main_sel_op_radix_be)); + auto tmp = (new_term.main_sel_op_sha256 * (FF(1) - new_term.main_sel_op_sha256)); tmp *= scaling_factor; std::get<27>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<28, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sha256 * (FF(1) - new_term.main_sel_op_sha256)); + auto tmp = (new_term.main_sel_op_poseidon2 * (FF(1) - new_term.main_sel_op_poseidon2)); tmp *= scaling_factor; std::get<28>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<29, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_poseidon2 * (FF(1) - new_term.main_sel_op_poseidon2)); + auto tmp = (new_term.main_sel_op_keccak * (FF(1) - new_term.main_sel_op_keccak)); tmp *= scaling_factor; std::get<29>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<30, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_keccak * (FF(1) - new_term.main_sel_op_keccak)); + auto tmp = (new_term.main_sel_op_ecadd * (FF(1) - new_term.main_sel_op_ecadd)); tmp *= scaling_factor; std::get<30>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<31, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_ecadd * (FF(1) - new_term.main_sel_op_ecadd)); + auto tmp = (new_term.main_sel_op_msm * (FF(1) - new_term.main_sel_op_msm)); tmp *= scaling_factor; std::get<31>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<32, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_msm * (FF(1) - new_term.main_sel_op_msm)); + auto tmp = (new_term.main_sel_op_add * (FF(1) - new_term.main_sel_op_add)); tmp *= scaling_factor; std::get<32>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<33, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_add * (FF(1) - new_term.main_sel_op_add)); + auto tmp = (new_term.main_sel_op_sub * (FF(1) - new_term.main_sel_op_sub)); tmp *= scaling_factor; std::get<33>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<34, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_sub * (FF(1) - new_term.main_sel_op_sub)); + auto tmp = (new_term.main_sel_op_mul * (FF(1) - new_term.main_sel_op_mul)); tmp *= scaling_factor; std::get<34>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<35, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mul * (FF(1) - new_term.main_sel_op_mul)); + auto tmp = (new_term.main_sel_op_div * (FF(1) - new_term.main_sel_op_div)); tmp *= scaling_factor; std::get<35>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<36, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_div * (FF(1) - new_term.main_sel_op_div)); + auto tmp = (new_term.main_sel_op_fdiv * (FF(1) - new_term.main_sel_op_fdiv)); tmp *= scaling_factor; std::get<36>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<37, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (FF(1) - new_term.main_sel_op_fdiv)); + auto tmp = (new_term.main_sel_op_not * (FF(1) - new_term.main_sel_op_not)); tmp *= scaling_factor; std::get<37>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<38, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_not * (FF(1) - new_term.main_sel_op_not)); + auto tmp = (new_term.main_sel_op_eq * (FF(1) - new_term.main_sel_op_eq)); tmp *= scaling_factor; std::get<38>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<39, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_eq * (FF(1) - new_term.main_sel_op_eq)); + auto tmp = (new_term.main_sel_op_and * (FF(1) - new_term.main_sel_op_and)); tmp *= scaling_factor; std::get<39>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<40, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_and * (FF(1) - new_term.main_sel_op_and)); + auto tmp = (new_term.main_sel_op_or * (FF(1) - new_term.main_sel_op_or)); tmp *= scaling_factor; std::get<40>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<41, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_or * (FF(1) - new_term.main_sel_op_or)); + auto tmp = (new_term.main_sel_op_xor * (FF(1) - new_term.main_sel_op_xor)); tmp *= scaling_factor; std::get<41>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<42, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_xor * (FF(1) - new_term.main_sel_op_xor)); + auto tmp = (new_term.main_sel_op_cast * (FF(1) - new_term.main_sel_op_cast)); tmp *= scaling_factor; std::get<42>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<43, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_cast * (FF(1) - new_term.main_sel_op_cast)); + auto tmp = (new_term.main_sel_op_lt * (FF(1) - new_term.main_sel_op_lt)); tmp *= scaling_factor; std::get<43>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<44, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_lt * (FF(1) - new_term.main_sel_op_lt)); + auto tmp = (new_term.main_sel_op_lte * (FF(1) - new_term.main_sel_op_lte)); tmp *= scaling_factor; std::get<44>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<45, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_lte * (FF(1) - new_term.main_sel_op_lte)); + auto tmp = (new_term.main_sel_op_shl * (FF(1) - new_term.main_sel_op_shl)); tmp *= scaling_factor; std::get<45>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<46, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_shl * (FF(1) - new_term.main_sel_op_shl)); + auto tmp = (new_term.main_sel_op_shr * (FF(1) - new_term.main_sel_op_shr)); tmp *= scaling_factor; std::get<46>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<47, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_shr * (FF(1) - new_term.main_sel_op_shr)); + auto tmp = (new_term.main_sel_op_internal_call * (FF(1) - new_term.main_sel_op_internal_call)); tmp *= scaling_factor; std::get<47>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<48, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (FF(1) - new_term.main_sel_op_internal_call)); + auto tmp = (new_term.main_sel_op_internal_return * (FF(1) - new_term.main_sel_op_internal_return)); tmp *= scaling_factor; std::get<48>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<49, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (FF(1) - new_term.main_sel_op_internal_return)); + auto tmp = (new_term.main_sel_op_jump * (FF(1) - new_term.main_sel_op_jump)); tmp *= scaling_factor; std::get<49>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<50, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jump * (FF(1) - new_term.main_sel_op_jump)); + auto tmp = (new_term.main_sel_op_jumpi * (FF(1) - new_term.main_sel_op_jumpi)); tmp *= scaling_factor; std::get<50>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<51, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * (FF(1) - new_term.main_sel_op_jumpi)); + auto tmp = (new_term.main_sel_op_external_call * (FF(1) - new_term.main_sel_op_external_call)); tmp *= scaling_factor; std::get<51>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<52, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_call * (FF(1) - new_term.main_sel_op_external_call)); + auto tmp = (new_term.main_sel_op_static_call * (FF(1) - new_term.main_sel_op_static_call)); tmp *= scaling_factor; std::get<52>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<53, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_static_call * (FF(1) - new_term.main_sel_op_static_call)); + auto tmp = (new_term.main_sel_op_calldata_copy * (FF(1) - new_term.main_sel_op_calldata_copy)); tmp *= scaling_factor; std::get<53>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<54, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_calldata_copy * (FF(1) - new_term.main_sel_op_calldata_copy)); + auto tmp = (new_term.main_sel_op_returndata_size * (FF(1) - new_term.main_sel_op_returndata_size)); tmp *= scaling_factor; std::get<54>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<55, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_returndata_size * (FF(1) - new_term.main_sel_op_returndata_size)); + auto tmp = (new_term.main_sel_op_returndata_copy * (FF(1) - new_term.main_sel_op_returndata_copy)); tmp *= scaling_factor; std::get<55>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<56, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_returndata_copy * (FF(1) - new_term.main_sel_op_returndata_copy)); + auto tmp = (new_term.main_sel_op_external_return * (FF(1) - new_term.main_sel_op_external_return)); tmp *= scaling_factor; std::get<56>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<57, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_return * (FF(1) - new_term.main_sel_op_external_return)); + auto tmp = (new_term.main_sel_op_external_revert * (FF(1) - new_term.main_sel_op_external_revert)); tmp *= scaling_factor; std::get<57>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<58, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_external_revert * (FF(1) - new_term.main_sel_op_external_revert)); + auto tmp = (new_term.main_sel_op_set * (FF(1) - new_term.main_sel_op_set)); tmp *= scaling_factor; std::get<58>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<59, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_set * (FF(1) - new_term.main_sel_op_set)); + auto tmp = (new_term.main_sel_op_mov * (FF(1) - new_term.main_sel_op_mov)); tmp *= scaling_factor; std::get<59>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<60, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mov * (FF(1) - new_term.main_sel_op_mov)); + auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); tmp *= scaling_factor; std::get<60>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<61, ContainerOverSubrelations>; - auto tmp = (new_term.main_op_err * (FF(1) - new_term.main_op_err)); + auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); tmp *= scaling_factor; std::get<61>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<62, ContainerOverSubrelations>; - auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_tag_err)); + auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); tmp *= scaling_factor; std::get<62>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<63, ContainerOverSubrelations>; - auto tmp = (new_term.main_id_zero * (FF(1) - new_term.main_id_zero)); + auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); tmp *= scaling_factor; std::get<63>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<64, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_a * (FF(1) - new_term.main_sel_mem_op_a)); + auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); tmp *= scaling_factor; std::get<64>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<65, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_b * (FF(1) - new_term.main_sel_mem_op_b)); + auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); tmp *= scaling_factor; std::get<65>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<66, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_c * (FF(1) - new_term.main_sel_mem_op_c)); + auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); tmp *= scaling_factor; std::get<66>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<67, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mem_op_d * (FF(1) - new_term.main_sel_mem_op_d)); + auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); tmp *= scaling_factor; std::get<67>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<68, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwa * (FF(1) - new_term.main_rwa)); + auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); tmp *= scaling_factor; std::get<68>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<69, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwb * (FF(1) - new_term.main_rwb)); + auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); tmp *= scaling_factor; std::get<69>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<70, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwc * (FF(1) - new_term.main_rwc)); + auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); tmp *= scaling_factor; std::get<70>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<71, ContainerOverSubrelations>; - auto tmp = (new_term.main_rwd * (FF(1) - new_term.main_rwd)); + auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); tmp *= scaling_factor; std::get<71>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<72, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_a * (FF(1) - new_term.main_sel_resolve_ind_addr_a)); + auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); tmp *= scaling_factor; std::get<72>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<73, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_b * (FF(1) - new_term.main_sel_resolve_ind_addr_b)); + auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); tmp *= scaling_factor; std::get<73>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<74, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_c * (FF(1) - new_term.main_sel_resolve_ind_addr_c)); + auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); tmp *= scaling_factor; std::get<74>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<75, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_resolve_ind_addr_d * (FF(1) - new_term.main_sel_resolve_ind_addr_d)); + auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * + (new_term.main_w_in_tag - constants_MEM_TAG_U1)); tmp *= scaling_factor; std::get<75>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<76, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_eq + new_term.main_sel_op_lte) + new_term.main_sel_op_lt) * - (new_term.main_w_in_tag - constants_MEM_TAG_U1)); + auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * + ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); tmp *= scaling_factor; std::get<76>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<77, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv * (FF(1) - new_term.main_op_err)) * - ((new_term.main_ic * new_term.main_ib) - new_term.main_ia)); + auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * + (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); tmp *= scaling_factor; std::get<77>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<78, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * - (((new_term.main_ib * new_term.main_inv) - FF(1)) + new_term.main_op_err)); + auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * + (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<78>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<79, ContainerOverSubrelations>; - auto tmp = (((new_term.main_sel_op_fdiv + new_term.main_sel_op_div) * new_term.main_op_err) * - (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<79>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<80, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_r_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); tmp *= scaling_factor; std::get<80>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<81, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_fdiv * (new_term.main_w_in_tag - constants_MEM_TAG_FF)); + auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_op_err)); tmp *= scaling_factor; std::get<81>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<82, ContainerOverSubrelations>; - auto tmp = (new_term.main_tag_err * (FF(1) - new_term.main_op_err)); + auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<82>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<83, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jump * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_jumpi * + (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + + (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(8))))); tmp *= scaling_factor; std::get<83>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<84, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * - (((FF(1) - new_term.main_id_zero) * (new_term.main_pc_shift - new_term.main_ia)) + - (new_term.main_id_zero * ((new_term.main_pc_shift - new_term.main_pc) - FF(8))))); + auto tmp = (new_term.main_sel_op_internal_call * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); tmp *= scaling_factor; std::get<84>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<85, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr + FF(1)))); + auto tmp = + (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); tmp *= scaling_factor; std::get<85>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<86, ContainerOverSubrelations>; - auto tmp = - (new_term.main_sel_op_internal_call * (new_term.main_internal_return_ptr - new_term.main_mem_addr_b)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<86>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<87, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(5)) - new_term.main_ib)); tmp *= scaling_factor; std::get<87>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<88, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * ((new_term.main_pc + FF(5)) - new_term.main_ib)); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); tmp *= scaling_factor; std::get<88>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<89, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_rwb - FF(1))); + auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); tmp *= scaling_factor; std::get<89>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<90, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_call * (new_term.main_sel_mem_op_b - FF(1))); + auto tmp = (new_term.main_sel_op_internal_return * + (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); tmp *= scaling_factor; std::get<90>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<91, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_op_internal_return * - (new_term.main_internal_return_ptr_shift - (new_term.main_internal_return_ptr - FF(1)))); + ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); tmp *= scaling_factor; std::get<91>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<92, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * - ((new_term.main_internal_return_ptr - FF(1)) - new_term.main_mem_addr_a)); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); tmp *= scaling_factor; std::get<92>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<93, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_pc_shift - new_term.main_ia)); + auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); tmp *= scaling_factor; std::get<93>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<94, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * new_term.main_rwa); + auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); tmp *= scaling_factor; std::get<94>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<95, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_internal_return * (new_term.main_sel_mem_op_a - FF(1))); + auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * + (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); tmp *= scaling_factor; std::get<95>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<96, ContainerOverSubrelations>; - auto tmp = ((main_CUR_AND_NEXT_ARE_MAIN * (FF(1) - main_SEL_ALL_CTRL_FLOW)) * - (new_term.main_internal_return_ptr_shift - new_term.main_internal_return_ptr)); + auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * + (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); tmp *= scaling_factor; std::get<96>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<97, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_internal_call + new_term.main_sel_op_internal_return) * - (new_term.main_space_id - constants_misc_INTERNAL_CALL_SPACE_ID)); + auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * + (new_term.main_call_ptr - new_term.main_space_id)); tmp *= scaling_factor; std::get<97>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<98, ContainerOverSubrelations>; - auto tmp = (((FF(1) - new_term.main_sel_op_internal_call) - new_term.main_sel_op_internal_return) * - (new_term.main_call_ptr - new_term.main_space_id)); + auto tmp = (new_term.main_sel_op_jumpi * + (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); tmp *= scaling_factor; std::get<98>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<99, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_jumpi * - (((new_term.main_id * new_term.main_inv) - FF(1)) + new_term.main_id_zero)); + auto tmp = ((new_term.main_sel_op_jumpi * new_term.main_id_zero) * (FF(1) - new_term.main_inv)); tmp *= scaling_factor; std::get<99>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<100, ContainerOverSubrelations>; - auto tmp = ((new_term.main_sel_op_jumpi * new_term.main_id_zero) * (FF(1) - new_term.main_inv)); + auto tmp = (new_term.main_sel_mov_ia_to_ic - (new_term.main_sel_op_mov * (FF(1) - new_term.main_id_zero))); tmp *= scaling_factor; std::get<100>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<101, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic - (new_term.main_sel_op_mov * (FF(1) - new_term.main_id_zero))); + auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); tmp *= scaling_factor; std::get<101>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<102, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ia_to_ic * (new_term.main_ia - new_term.main_ic)); + auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); tmp *= scaling_factor; std::get<102>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<103, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_mov_ib_to_ic * (new_term.main_ib - new_term.main_ic)); + auto tmp = (new_term.main_sel_op_mov * (new_term.main_r_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<103>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<104, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_mov * (new_term.main_r_in_tag - new_term.main_w_in_tag)); + auto tmp = (new_term.main_sel_alu - (main_SEL_ALL_ALU * (FF(1) - new_term.main_op_err))); tmp *= scaling_factor; std::get<104>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<105, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_alu - (main_SEL_ALL_ALU * (FF(1) - new_term.main_op_err))); + auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); tmp *= scaling_factor; std::get<105>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<106, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_R_TAG * (new_term.main_alu_in_tag - new_term.main_r_in_tag)); + auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); tmp *= scaling_factor; std::get<106>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<107, ContainerOverSubrelations>; - auto tmp = (main_SEL_ALU_W_TAG * (new_term.main_alu_in_tag - new_term.main_w_in_tag)); + auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); tmp *= scaling_factor; std::get<107>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<108, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_l2gasleft * (new_term.main_ia - new_term.main_l2_gas_remaining_shift)); + auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); tmp *= scaling_factor; std::get<108>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<109, ContainerOverSubrelations>; - auto tmp = (new_term.main_sel_op_dagasleft * (new_term.main_ia - new_term.main_da_gas_remaining_shift)); - tmp *= scaling_factor; - std::get<109>(evals) += typename Accumulator::View(tmp); - } - { - using Accumulator = typename std::tuple_element_t<110, ContainerOverSubrelations>; auto tmp = ((new_term.main_ib * (FF(1) - new_term.main_op_err)) * ((new_term.main_sel_op_calldata_copy + new_term.main_sel_op_external_return) - new_term.main_sel_slice_gadget)); tmp *= scaling_factor; - std::get<110>(evals) += typename Accumulator::View(tmp); + std::get<109>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<110, ContainerOverSubrelations>; auto tmp = (new_term.main_bin_op_id - (new_term.main_sel_op_or + (FF(2) * new_term.main_sel_op_xor))); tmp *= scaling_factor; - std::get<111>(evals) += typename Accumulator::View(tmp); + std::get<110>(evals) += typename Accumulator::View(tmp); } { - using Accumulator = typename std::tuple_element_t<112, ContainerOverSubrelations>; + using Accumulator = typename std::tuple_element_t<111, ContainerOverSubrelations>; auto tmp = (new_term.main_sel_bin - (((new_term.main_sel_op_and + new_term.main_sel_op_or) + new_term.main_sel_op_xor) * (FF(1) - new_term.main_op_err))); tmp *= scaling_factor; - std::get<112>(evals) += typename Accumulator::View(tmp); + std::get<111>(evals) += typename Accumulator::View(tmp); } } }; @@ -801,51 +794,51 @@ template class main : public Relation> { switch (index) { case 0: return "OPCODE_SELECTORS"; - case 76: + case 75: return "OUTPUT_U1"; - case 77: + case 76: return "SUBOP_FDIV"; - case 78: + case 77: return "SUBOP_FDIV_ZERO_ERR1"; - case 79: + case 78: return "SUBOP_FDIV_ZERO_ERR2"; - case 80: + case 79: return "SUBOP_FDIV_R_IN_TAG_FF"; - case 81: + case 80: return "SUBOP_FDIV_W_IN_TAG_FF"; - case 82: + case 81: return "TAG_ERR_IMPLIES_OP_ERR"; - case 83: + case 82: return "PC_JUMP"; - case 84: + case 83: return "PC_JUMPI"; - case 85: + case 84: return "RETURN_POINTER_INCREMENT"; - case 91: + case 90: return "RETURN_POINTER_DECREMENT"; - case 96: + case 95: return "INTERNAL_RETURN_POINTER_CONSISTENCY"; - case 97: + case 96: return "SPACE_ID_INTERNAL"; - case 98: + case 97: return "SPACE_ID_STANDARD_OPCODES"; - case 99: + case 98: return "JMP_CONDITION_RES_1"; - case 100: + case 99: return "JMP_CONDITION_RES_2"; - case 102: + case 101: return "MOV_SAME_VALUE_A"; - case 103: + case 102: return "MOV_SAME_VALUE_B"; - case 104: + case 103: return "MOV_MAIN_SAME_TAG"; - case 108: + case 107: return "L2GASLEFT"; - case 109: + case 108: return "DAGASLEFT"; - case 111: + case 110: return "BIN_SEL_1"; - case 112: + case 111: return "BIN_SEL_2"; } return std::to_string(index); 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 433fafbc7b6..f6fd838234e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -1373,65 +1373,61 @@ TEST_F(AvmExecutionTests, msmOpCode) TEST_F(AvmExecutionTests, getEnvOpcode) { std::string bytecode_hex = - to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0001" // dst_offset - + to_hex(static_cast(EnvironmentVariable::ADDRESS)) // envvar ADDRESS - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0002" // dst_offset - + to_hex(static_cast(EnvironmentVariable::SENDER)) // envvar SENDER - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0003" // dst_offset - + to_hex(static_cast(EnvironmentVariable::FUNCTIONSELECTOR)) // envvar FUNCTIONSELECTOR - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0004" // dst_offset - + to_hex(static_cast(EnvironmentVariable::TRANSACTIONFEE)) // envvar TRANSACTIONFEE - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0005" // dst_offset - + to_hex(static_cast(EnvironmentVariable::CHAINID)) // envvar CHAINID - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0006" // dst_offset - + to_hex(static_cast(EnvironmentVariable::VERSION)) // envvar VERSION - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0007" // dst_offset - + to_hex(static_cast(EnvironmentVariable::BLOCKNUMBER)) // envvar BLOCKNUMBER - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0008" // dst_offset - + to_hex(static_cast(EnvironmentVariable::TIMESTAMP)) // envvar TIMESTAMP - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "0009" // dst_offset - + to_hex(static_cast(EnvironmentVariable::FEEPERL2GAS)) // envvar FEEPERL2GAS - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "000A" // dst_offset - + to_hex(static_cast(EnvironmentVariable::FEEPERDAGAS)) // envvar FEEPERDAGAS - + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 - "00" // Indirect flag - "000B" // dst_offset - + to_hex(static_cast(EnvironmentVariable::ISSTATICCALL)) // envvar ISSTATICCALL - + to_hex(OpCode::SET_16) + // opcode SET (for return size) - "00" // Indirect flag - "0200" // dst_offset=512 - + to_hex(AvmMemoryTag::U32) + // tag U32 - "000B" // val: 12 - + to_hex(OpCode::RETURN) + // opcode RETURN - "00" // Indirect flag - "0001" // ret offset 1 - "0200"; // ret size offset 512 + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0001" // dst_offset + + to_hex(static_cast(EnvironmentVariable::ADDRESS)) // envvar ADDRESS + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0002" // dst_offset + + to_hex(static_cast(EnvironmentVariable::SENDER)) // envvar SENDER + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0003" // dst_offset + + to_hex(static_cast(EnvironmentVariable::TRANSACTIONFEE)) // envvar TRANSACTIONFEE + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0004" // dst_offset + + to_hex(static_cast(EnvironmentVariable::CHAINID)) // envvar CHAINID + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0005" // dst_offset + + to_hex(static_cast(EnvironmentVariable::VERSION)) // envvar VERSION + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0006" // dst_offset + + to_hex(static_cast(EnvironmentVariable::BLOCKNUMBER)) // envvar BLOCKNUMBER + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0007" // dst_offset + + to_hex(static_cast(EnvironmentVariable::TIMESTAMP)) // envvar TIMESTAMP + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0008" // dst_offset + + to_hex(static_cast(EnvironmentVariable::FEEPERL2GAS)) // envvar FEEPERL2GAS + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "0009" // dst_offset + + to_hex(static_cast(EnvironmentVariable::FEEPERDAGAS)) // envvar FEEPERDAGAS + + to_hex(OpCode::GETENVVAR_16) + // opcode GETENVVAR_16 + "00" // Indirect flag + "000A" // dst_offset + + to_hex(static_cast(EnvironmentVariable::ISSTATICCALL)) // envvar ISSTATICCALL + + to_hex(OpCode::SET_16) + // opcode SET (for return size) + "00" // Indirect flag + "0200" // dst_offset=512 + + to_hex(AvmMemoryTag::U32) + // tag U32 + "000A" // val: 12 + + to_hex(OpCode::RETURN) + // opcode RETURN + "00" // Indirect flag + "0001" // ret offset 1 + "0200"; // ret size offset 512 auto bytecode = hex_to_bytes(bytecode_hex); auto [instructions, error] = Deserialization::parse_bytecode_statically(bytecode); ASSERT_TRUE(is_ok(error)); - ASSERT_THAT(instructions, SizeIs(13)); + ASSERT_THAT(instructions, SizeIs(12)); // ADDRESS EXPECT_THAT(instructions.at(0), @@ -1449,82 +1445,73 @@ TEST_F(AvmExecutionTests, getEnvOpcode) VariantWith(2), VariantWith(static_cast(EnvironmentVariable::SENDER)))))); - // FUNCTIONSELECTOR + // TRANSACTIONFEE EXPECT_THAT( instructions.at(2), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), VariantWith(3), - VariantWith(static_cast(EnvironmentVariable::FUNCTIONSELECTOR)))))); - - // TRANSACTIONFEE - EXPECT_THAT( - instructions.at(3), - AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), - Field(&Instruction::operands, - ElementsAre(VariantWith(0), - VariantWith(4), VariantWith(static_cast(EnvironmentVariable::TRANSACTIONFEE)))))); // CHAINID - EXPECT_THAT(instructions.at(4), + EXPECT_THAT(instructions.at(3), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(5), + VariantWith(4), VariantWith(static_cast(EnvironmentVariable::CHAINID)))))); // VERSION - EXPECT_THAT(instructions.at(5), + EXPECT_THAT(instructions.at(4), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(6), + VariantWith(5), VariantWith(static_cast(EnvironmentVariable::VERSION)))))); // BLOCKNUMBER EXPECT_THAT( - instructions.at(6), + instructions.at(5), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(7), + VariantWith(6), VariantWith(static_cast(EnvironmentVariable::BLOCKNUMBER)))))); // TIMESTAMP - EXPECT_THAT(instructions.at(7), + EXPECT_THAT(instructions.at(6), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(8), + VariantWith(7), VariantWith(static_cast(EnvironmentVariable::TIMESTAMP)))))); // FEEPERL2GAS EXPECT_THAT( - instructions.at(8), + instructions.at(7), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(9), + VariantWith(8), VariantWith(static_cast(EnvironmentVariable::FEEPERL2GAS)))))); // FEEPERDAGAS EXPECT_THAT( - instructions.at(9), + instructions.at(8), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(10), + VariantWith(9), VariantWith(static_cast(EnvironmentVariable::FEEPERDAGAS)))))); // ISSTATICCALL EXPECT_THAT( - instructions.at(10), + instructions.at(9), AllOf(Field(&Instruction::op_code, OpCode::GETENVVAR_16), Field(&Instruction::operands, ElementsAre(VariantWith(0), - VariantWith(11), + VariantWith(10), VariantWith(static_cast(EnvironmentVariable::ISSTATICCALL)))))); // Public inputs for the circuit @@ -1533,7 +1520,6 @@ TEST_F(AvmExecutionTests, getEnvOpcode) FF sender = 1; FF address = contract_instance.address; - FF function_selector = 3; FF transaction_fee = 5; FF chainid = 6; FF version = 7; @@ -1546,8 +1532,8 @@ TEST_F(AvmExecutionTests, getEnvOpcode) // The return data for this test should be a the opcodes in sequence, as the opcodes dst address lines up with // this array The returndata call above will then return this array std::vector const expected_returndata = { - address, sender, function_selector, transaction_fee, chainid, version, - blocknumber, timestamp, feeperl2gas, feeperdagas, is_static_call, + address, sender, transaction_fee, chainid, version, + blocknumber, timestamp, feeperl2gas, feeperdagas, is_static_call, }; // Set up public inputs to contain the above values @@ -1556,7 +1542,6 @@ TEST_F(AvmExecutionTests, getEnvOpcode) // public_inputs.public_app_logic_call_requests[0].contract_address = address; public_inputs.public_app_logic_call_requests[0].msg_sender = sender; - public_inputs.public_app_logic_call_requests[0].function_selector = static_cast(function_selector); public_inputs.transaction_fee = transaction_fee; public_inputs.public_app_logic_call_requests[0].is_static_call = is_static_call > FF::zero(); @@ -1587,11 +1572,6 @@ TEST_F(AvmExecutionTests, getEnvOpcode) auto sender_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_sender == 1; }); EXPECT_EQ(sender_row->main_ia, sender); - // Check function selector - auto function_selector_row = - std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_function_selector == 1; }); - EXPECT_EQ(function_selector_row->main_ia, function_selector); - // Check transactionfee auto transaction_fee_row = std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_transaction_fee == 1; }); diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp index da811713573..c2f7fc1f1ef 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp @@ -257,42 +257,6 @@ // test_kernel_lookup(true, indirect_apply_opcodes, checks); // } // -// TEST_F(AvmKernelPositiveTests, kernelFunctionSelector) -// { -// // Direct -// uint32_t dst_offset = 42; -// uint32_t indirect_dst_offset = 69; -// // We test that the function selector opcode is included at index 0 in the public inputs -// auto direct_apply_opcodes = [=](AvmTraceBuilder& trace_builder) { -// trace_builder.op_function_selector(/*indirect*/ 0, dst_offset); -// }; -// auto indirect_apply_opcodes = [=](AvmTraceBuilder& trace_builder) { -// trace_builder.op_set( -// /*indirect*/ 0, -// /*value*/ dst_offset, -// /*dst_offset*/ indirect_dst_offset, -// AvmMemoryTag::U32); -// trace_builder.op_function_selector(/*indirect*/ 1, indirect_dst_offset); -// }; -// -// auto checks = [=](bool indirect, const std::vector& trace) { -// auto row = std::ranges::find_if( -// trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_function_selector == FF(1); }); -// EXPECT_TRUE(row != trace.end()); -// -// expect_row(row, -// /*kernel_in_offset=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET, -// /*ia=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET + -// 1, // Note the value generated above for public inputs is the same as the index read + 1 -// /*ind_a*/ indirect ? indirect_dst_offset : 0, -// /*mem_addr_a=*/dst_offset, -// /*w_in_tag=*/AvmMemoryTag::U32); -// }; -// -// test_kernel_lookup(false, direct_apply_opcodes, checks); -// test_kernel_lookup(true, indirect_apply_opcodes, checks); -// } -// // TEST_F(AvmKernelPositiveTests, kernelFeePerDa) // { // uint32_t dst_offset = 42; @@ -652,33 +616,6 @@ // negative_test_incorrect_ia_kernel_lookup(apply_opcodes, checks, incorrect_ia, BAD_LOOKUP); // } // -// TEST_F(AvmKernelNegativeTests, incorrectIaFunctionSelector) -// { -// uint32_t dst_offset = 42; -// FF incorrect_ia = FF(69); -// -// // We test that the sender opcode is inlcuded at index x in the public inputs -// auto apply_opcodes = [=](AvmTraceBuilder& trace_builder) { -// trace_builder.op_function_selector(/*indirect*/ 0, dst_offset); -// }; -// auto checks = [=](bool indirect, const std::vector& trace) { -// auto row = std::ranges::find_if( -// trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_function_selector == FF(1); }); -// EXPECT_TRUE(row != trace.end()); -// -// expect_row( -// row, -// /*kernel_in_offset=*/FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET, -// /*ia=*/incorrect_ia, // Note the value generated above for public inputs is the same as the index read + -// 1 -// /*ind_a*/ indirect, -// /*mem_addr_a=*/dst_offset, -// /*w_in_tag=*/AvmMemoryTag::U32); -// }; -// -// negative_test_incorrect_ia_kernel_lookup(apply_opcodes, checks, incorrect_ia, BAD_LOOKUP); -// } -// // TEST_F(AvmKernelNegativeTests, incorrectIaDaGas) // { // uint32_t dst_offset = 42; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp index 1ba7375276b..0c622cfe024 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/helper.hpp @@ -59,7 +59,6 @@ template VmPublicInputs_ convert_public_inputs(std::vectorcurrent_public_call_request.function_selector; - auto [row, error] = create_kernel_lookup_opcode(indirect, dst_offset, ia_value, AvmMemoryTag::U32); - row.main_sel_op_function_selector = FF(1); - - // Constrain gas cost - gas_trace_builder.constrain_gas(static_cast(row.main_clk), OpCode::GETENVVAR_16); - - main_trace.push_back(row); - return error; -} - AvmError AvmTraceBuilder::op_transaction_fee(uint8_t indirect, uint32_t dst_offset) { FF ia_value = public_inputs.transaction_fee; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp index d62fff47f0b..aee0c4d0e61 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp @@ -100,7 +100,6 @@ class AvmTraceBuilder { AvmError op_get_env_var(uint8_t indirect, uint32_t dst_offset, uint8_t env_var); AvmError op_address(uint8_t indirect, uint32_t dst_offset); AvmError op_sender(uint8_t indirect, uint32_t dst_offset); - AvmError op_function_selector(uint8_t indirect, uint32_t dst_offset); AvmError op_transaction_fee(uint8_t indirect, uint32_t dst_offset); AvmError op_is_static_call(uint8_t indirect, uint32_t dst_offset); diff --git a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp index d2fff918e9a..acc05883409 100644 --- a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp @@ -43,7 +43,7 @@ #define AVM_ACCUMULATED_DATA_LENGTH 318 #define AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH 1006 #define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 86 -#define AVM_PROOF_LENGTH_IN_FIELDS 4166 +#define AVM_PROOF_LENGTH_IN_FIELDS 4161 #define AVM_PUBLIC_COLUMN_MAX_SIZE 1024 #define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2915 #define MEM_TAG_FF 0 @@ -55,7 +55,6 @@ #define MEM_TAG_U128 6 #define SENDER_KERNEL_INPUTS_COL_OFFSET 0 #define ADDRESS_KERNEL_INPUTS_COL_OFFSET 1 -#define FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET 2 #define IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET 3 #define CHAIN_ID_KERNEL_INPUTS_COL_OFFSET 4 #define VERSION_KERNEL_INPUTS_COL_OFFSET 5 diff --git a/barretenberg/cpp/src/barretenberg/vm/constants.hpp b/barretenberg/cpp/src/barretenberg/vm/constants.hpp index fe1c0a83560..5efbbfd82dd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/constants.hpp @@ -27,7 +27,6 @@ static_assert(KERNEL_OUTPUTS_LENGTH < AVM_PUBLIC_COLUMN_MAX_SIZE, // https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts inline const uint32_t SENDER_PCPI_OFFSET = 0; inline const uint32_t ADDRESS_PCPI_OFFSET = 1; -inline const uint32_t FUNCTION_SELECTOR_PCPI_OFFSET = 2; inline const uint32_t IS_STATIC_CALL_PCPI_OFFSET = 3; inline const uint32_t PCPI_GLOBALS_START = PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH - 7 - GLOBAL_VARIABLES_LENGTH; diff --git a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx index 126d9e239ad..d5409d96aef 100644 --- a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx +++ b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx @@ -1,375 +1,636 @@ -[comment]: # (THIS IS A GENERATED FILE! DO NOT EDIT!) -[comment]: # (Generated via `yarn preprocess`) - -[comment]: # (Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js) - -import Markdown from 'react-markdown' -import CodeBlock from '@theme/CodeBlock' +[comment]: # "THIS IS A GENERATED FILE! DO NOT EDIT!" +[comment]: # "Generated via `yarn preprocess`" +[comment]: # "Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js" +import Markdown from "react-markdown"; +import CodeBlock from "@theme/CodeBlock"; ## Instructions Table Click on an instruction name to jump to its section. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + + +
OpcodeNameSummaryExpression
0x00\[\`ADD\`\](#isa-section-add)Addition (a + b){ - `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` - }
0x01\[\`SUB\`\](#isa-section-sub)Subtraction (a - b){ - `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` - }
0x02\[\`MUL\`\](#isa-section-mul)Multiplication (a * b){ - `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` - }
0x03\[\`DIV\`\](#isa-section-div)Unsigned integer division (a / b){ - `M[dstOffset] = M[aOffset] / M[bOffset]` - }
0x04\[\`FDIV\`\](#isa-section-fdiv)Field division (a / b){ - `M[dstOffset] = M[aOffset] / M[bOffset]` - }
0x05\[\`EQ\`\](#isa-section-eq)Equality check (a == b){ - `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` - }
0x06\[\`LT\`\](#isa-section-lt)Less-than check (a < b){ - `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` - }
0x07\[\`LTE\`\](#isa-section-lte)Less-than-or-equals check (a <= b){ - `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` - }
0x08\[\`AND\`\](#isa-section-and)Bitwise AND (a & b){ - `M[dstOffset] = M[aOffset] AND M[bOffset]` - }
0x09\[\`OR\`\](#isa-section-or)Bitwise OR (a | b){ - `M[dstOffset] = M[aOffset] OR M[bOffset]` - }
0x0a\[\`XOR\`\](#isa-section-xor)Bitwise XOR (a ^ b){ - `M[dstOffset] = M[aOffset] XOR M[bOffset]` - }
0x0b\[\`NOT\`\](#isa-section-not)Bitwise NOT (inversion){ - `M[dstOffset] = NOT M[aOffset]` - }
0x0c\[\`SHL\`\](#isa-section-shl)Bitwise leftward shift (a << b){ - `M[dstOffset] = M[aOffset] << M[bOffset]` - }
0x0d\[\`SHR\`\](#isa-section-shr)Bitwise rightward shift (a >> b){ - `M[dstOffset] = M[aOffset] >> M[bOffset]` - }
0x0e\[\`CAST\`\](#isa-section-cast)Type cast{ - `M[dstOffset] = cast(M[aOffset])` - }
0x0f\[\`ADDRESS\`\](#isa-section-address)Get the address of the currently executing l2 contract{ - `M[dstOffset] = context.environment.address` - }
0x10\[\`SENDER\`\](#isa-section-sender)Get the address of the sender (caller of the current context){ - `M[dstOffset] = context.environment.sender` - }
0x11\[\`FUNCTIONSELECTOR\`\](#isa-section-functionselector)Get the function selector of the contract function being executed{ - `M[dstOffset] = context.environment.functionSelector` - }
0x12\[\`TRANSACTIONFEE\`\](#isa-section-transactionfee)Get the computed transaction fee during teardown phase, zero otherwise{ - `M[dstOffset] = context.environment.transactionFee` - }
0x13\[\`CHAINID\`\](#isa-section-chainid)Get this rollup's L1 chain ID{ - `M[dstOffset] = context.environment.globals.chainId` - }
0x14\[\`VERSION\`\](#isa-section-version)Get this rollup's L2 version ID{ - `M[dstOffset] = context.environment.globals.version` - }
0x15\[\`BLOCKNUMBER\`\](#isa-section-blocknumber)Get this L2 block's number{ - `M[dstOffset] = context.environment.globals.blocknumber` - }
0x16\[\`TIMESTAMP\`\](#isa-section-timestamp)Get this L2 block's timestamp{ - `M[dstOffset] = context.environment.globals.timestamp` - }
0x17\[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas)Get the fee to be paid per "L2 gas" - constant for entire transaction{ - `M[dstOffset] = context.environment.globals.feePerL2Gas` - }
0x18\[\`FEEPERDAGAS\`\](#isa-section-feeperdagas)Get the fee to be paid per "DA gas" - constant for entire transaction{ - `M[dstOffset] = context.environment.globals.feePerDaGas` - }
0x19\[\`CALLDATACOPY\`\](#isa-section-calldatacopy)Copy calldata into memory{ - `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` - }
0x1a\[\`L2GASLEFT\`\](#isa-section-l2gasleft)Remaining "L2 gas" for this call (after this instruction){ - `M[dstOffset] = context.MachineState.l2GasLeft` - }
0x1b\[\`DAGASLEFT\`\](#isa-section-dagasleft)Remaining "DA gas" for this call (after this instruction){ - `M[dstOffset] = context.machineState.daGasLeft` - }
0x1c\[\`JUMP\`\](#isa-section-jump)Jump to a location in the bytecode{ - `context.machineState.pc = loc` - }
0x1d\[\`JUMPI\`\](#isa-section-jumpi)Conditionally jump to a location in the bytecode{ - `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` - }
0x1e\[\`INTERNALCALL\`\](#isa-section-internalcall)Make an internal call. Push the current PC to the internal call stack and jump to the target location. -{`context.machineState.internalCallStack.push(context.machineState.pc) + OpcodeNameSummaryExpression
0x00 + + \[\`ADD\`\](#isa-section-add) + + Addition (a + b) + + {`M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k`} +
0x01 + + \[\`SUB\`\](#isa-section-sub) + + Subtraction (a - b) + + {`M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k`} +
0x02 + + \[\`MUL\`\](#isa-section-mul) + + Multiplication (a * b) + + {`M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k`} +
0x03 + + \[\`DIV\`\](#isa-section-div) + + Unsigned integer division (a / b) + + {`M[dstOffset] = M[aOffset] / M[bOffset]`} +
0x04 + + \[\`FDIV\`\](#isa-section-fdiv) + + Field division (a / b) + + {`M[dstOffset] = M[aOffset] / M[bOffset]`} +
0x05 + + \[\`EQ\`\](#isa-section-eq) + + Equality check (a == b) + + {`M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0`} +
0x06 + + \[\`LT\`\](#isa-section-lt) + + Less-than check (a < b) + + {`M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0`} +
0x07 + + \[\`LTE\`\](#isa-section-lte) + + Less-than-or-equals check (a <= b) + + {`M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0`} +
0x08 + + \[\`AND\`\](#isa-section-and) + + Bitwise AND (a & b) + + {`M[dstOffset] = M[aOffset] AND M[bOffset]`} +
0x09 + + \[\`OR\`\](#isa-section-or) + + Bitwise OR (a | b) + + {`M[dstOffset] = M[aOffset] OR M[bOffset]`} +
0x0a + + \[\`XOR\`\](#isa-section-xor) + + Bitwise XOR (a ^ b) + + {`M[dstOffset] = M[aOffset] XOR M[bOffset]`} +
0x0b + + \[\`NOT\`\](#isa-section-not) + + Bitwise NOT (inversion) + + {`M[dstOffset] = NOT M[aOffset]`} +
0x0c + + \[\`SHL\`\](#isa-section-shl) + + Bitwise leftward shift (a << b) + + {`M[dstOffset] = M[aOffset] << M[bOffset]`} +
0x0d + + \[\`SHR\`\](#isa-section-shr) + + Bitwise rightward shift (a >> b) + + {`M[dstOffset] = M[aOffset] >> M[bOffset]`} +
0x0e + + \[\`CAST\`\](#isa-section-cast) + + Type cast + + {`M[dstOffset] = cast(M[aOffset])`} +
0x0f + + \[\`ADDRESS\`\](#isa-section-address) + + + Get the address of the currently executing l2 contract + + + {`M[dstOffset] = context.environment.address`} +
0x10 + + \[\`SENDER\`\](#isa-section-sender) + + + Get the address of the sender (caller of the current context) + + + {`M[dstOffset] = context.environment.sender`} +
0x12 + + \[\`TRANSACTIONFEE\`\](#isa-section-transactionfee) + + + Get the computed transaction fee during teardown phase, zero otherwise + + + {`M[dstOffset] = context.environment.transactionFee`} +
0x13 + + \[\`CHAINID\`\](#isa-section-chainid) + + Get this rollup's L1 chain ID + + {`M[dstOffset] = context.environment.globals.chainId`} +
0x14 + + \[\`VERSION\`\](#isa-section-version) + + Get this rollup's L2 version ID + + {`M[dstOffset] = context.environment.globals.version`} +
0x15 + + \[\`BLOCKNUMBER\`\](#isa-section-blocknumber) + + Get this L2 block's number + + {`M[dstOffset] = context.environment.globals.blocknumber`} +
0x16 + + \[\`TIMESTAMP\`\](#isa-section-timestamp) + + Get this L2 block's timestamp + + {`M[dstOffset] = context.environment.globals.timestamp`} +
0x17 + + \[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas) + + + Get the fee to be paid per "L2 gas" - constant for entire transaction + + + {`M[dstOffset] = context.environment.globals.feePerL2Gas`} +
0x18 + + \[\`FEEPERDAGAS\`\](#isa-section-feeperdagas) + + + Get the fee to be paid per "DA gas" - constant for entire transaction + + + {`M[dstOffset] = context.environment.globals.feePerDaGas`} +
0x19 + + \[\`CALLDATACOPY\`\](#isa-section-calldatacopy) + + Copy calldata into memory + + {`M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]`} +
0x1a + + \[\`L2GASLEFT\`\](#isa-section-l2gasleft) + + + Remaining "L2 gas" for this call (after this instruction) + + + {`M[dstOffset] = context.MachineState.l2GasLeft`} +
0x1b + + \[\`DAGASLEFT\`\](#isa-section-dagasleft) + + + Remaining "DA gas" for this call (after this instruction) + + + {`M[dstOffset] = context.machineState.daGasLeft`} +
0x1c + + \[\`JUMP\`\](#isa-section-jump) + + Jump to a location in the bytecode + + {`context.machineState.pc = loc`} +
0x1d + + \[\`JUMPI\`\](#isa-section-jumpi) + + Conditionally jump to a location in the bytecode + + {`context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc`} +
0x1e + + \[\`INTERNALCALL\`\](#isa-section-internalcall) + + + Make an internal call. Push the current PC to the internal call stack + and jump to the target location. + + + + {`context.machineState.internalCallStack.push(context.machineState.pc) context.machineState.pc = loc`} -
0x1f\[\`INTERNALRETURN\`\](#isa-section-internalreturn)Return from an internal call. Pop from the internal call stack and jump to the popped location.{ - `context.machineState.pc = context.machineState.internalCallStack.pop()` - }
0x20\[\`SET\`\](#isa-section-set)Set a memory word from a constant in the bytecode{ - `M[dstOffset] = const` - }
0x21\[\`MOV\`\](#isa-section-mov)Move a word from source memory location to destination{ - `M[dstOffset] = M[srcOffset]` - }
0x22\[\`CMOV\`\](#isa-section-cmov)Move a word (conditionally chosen) from one memory location to another (`d = cond > 0 ? a : b`){ - `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` - }
0x23\[\`SLOAD\`\](#isa-section-sload)Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. -{`M[dstOffset] = S[M[slotOffset]]`} -
0x24\[\`SSTORE\`\](#isa-section-sstore)Write a word to this contract's persistent public storage -{`S[M[slotOffset]] = M[srcOffset]`} -
0x25\[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists)Check whether a note hash exists in the note hash tree (as of the start of the current block) -{`exists = context.worldState.noteHashes.has({ + +
0x1f + + \[\`INTERNALRETURN\`\](#isa-section-internalreturn) + + + Return from an internal call. Pop from the internal call stack and jump + to the popped location. + + + {`context.machineState.pc = context.machineState.internalCallStack.pop()`} +
0x20 + + \[\`SET\`\](#isa-section-set) + + Set a memory word from a constant in the bytecode + + {`M[dstOffset] = const`} +
0x21 + + \[\`MOV\`\](#isa-section-mov) + + + Move a word from source memory location to destination + + + {`M[dstOffset] = M[srcOffset]`} +
0x22 + + \[\`CMOV\`\](#isa-section-cmov) + + + Move a word (conditionally chosen) from one memory location to another + (`d = cond > 0 ? a : b`) + + + {`M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]`} +
0x23 + + \[\`SLOAD\`\](#isa-section-sload) + + + Load a word from this contract's persistent public storage. Zero is + loaded for unwritten slots. + + + {`M[dstOffset] = S[M[slotOffset]]`} +
0x24 + + \[\`SSTORE\`\](#isa-section-sstore) + + + Write a word to this contract's persistent public storage + + + {`S[M[slotOffset]] = M[srcOffset]`} +
0x25 + + \[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists) + + + Check whether a note hash exists in the note hash tree (as of the start + of the current block) + + + + {`exists = context.worldState.noteHashes.has({ leafIndex: M[leafIndexOffset] leaf: hash(context.environment.address, M[noteHashOffset]), }) M[existsOffset] = exists`} -
0x26\[\`EMITNOTEHASH\`\](#isa-section-emitnotehash)Emit a new note hash to be inserted into the note hash tree -{`context.worldState.noteHashes.append( + +
0x26 + + \[\`EMITNOTEHASH\`\](#isa-section-emitnotehash) + + + Emit a new note hash to be inserted into the note hash tree + + + + {`context.worldState.noteHashes.append( hash(context.environment.address, M[noteHashOffset]) )`} -
0x27\[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists)Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) -{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( + +
0x27 + + \[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists) + + + Check whether a nullifier exists in the nullifier tree (including + nullifiers from earlier in the current transaction or from earlier in + the current block) + + + + {`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( hash(M[addressOffset], M[nullifierOffset]) ) M[existsOffset] = exists`} -
0x28\[\`EMITNULLIFIER\`\](#isa-section-emitnullifier)Emit a new nullifier to be inserted into the nullifier tree -{`context.worldState.nullifiers.append( + +
0x28 + + \[\`EMITNULLIFIER\`\](#isa-section-emitnullifier) + + + Emit a new nullifier to be inserted into the nullifier tree + + + + {`context.worldState.nullifiers.append( hash(context.environment.address, M[nullifierOffset]) )`} -
0x29\[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists)Check if a message exists in the L1-to-L2 message tree -{`exists = context.worldState.l1ToL2Messages.has({ + +
0x29 + + \[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists) + + + Check if a message exists in the L1-to-L2 message tree + + + + {`exists = context.worldState.l1ToL2Messages.has({ leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] }) M[existsOffset] = exists`} -
0x2a\[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance)Copies contract instance data to memory -{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ + +
0x2a + + + \[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance) + + + Copies contract instance data to memory + + + {`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ instance_found_in_address, instance.salt ?? 0, instance.deployer ?? 0, @@ -378,41 +639,64 @@ M[existsOffset] = exists`} instance.portalContractAddress ?? 0, instance.publicKeysHash ?? 0, ]`} -
0x2b\[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog)Emit an unencrypted log -{`context.accruedSubstate.unencryptedLogs.append( + +
0x2b + + + \[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog) + + + Emit an unencrypted log + + + {`context.accruedSubstate.unencryptedLogs.append( UnencryptedLog { address: context.environment.address, log: M[logOffset:logOffset+M[logSizeOffset]], } )`} -
0x2c\[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg)Send an L2-to-L1 message -{`context.accruedSubstate.sentL2ToL1Messages.append( + +
0x2c + + \[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg) + + Send an L2-to-L1 message + + + {`context.accruedSubstate.sentL2ToL1Messages.append( SentL2ToL1Message { address: context.environment.address, recipient: M[recipientOffset], message: M[contentOffset] } )`} -
0x2d\[\`CALL\`\](#isa-section-call)Call into another contract -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } + +
0x2d + + \[\`CALL\`\](#isa-section-call) + + Call into another contract + + + {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -420,14 +704,24 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=false) execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} -
0x2e\[\`STATICCALL\`\](#isa-section-staticcall)Call into another contract, disallowing World State and Accrued Substate modifications -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } + +
0x2e + + \[\`STATICCALL\`\](#isa-section-staticcall) + + + Call into another contract, disallowing World State and Accrued Substate + modifications + + + + {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -435,52 +729,84 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=true execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} -
0x2f\[\`RETURN\`\](#isa-section-return)Halt execution within this context (without revert), optionally returning some data -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] + +
0x2f + + \[\`RETURN\`\](#isa-section-return) + + + Halt execution within this context (without revert), optionally + returning some data + + + + {`context.contractCallResults.output = M[retOffset:retOffset+retSize] halt`} -
0x30\[\`REVERT\`\](#isa-section-revert)Halt execution within this context as `reverted`, optionally returning some data -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] + +
0x30 + + \[\`REVERT\`\](#isa-section-revert) + + + Halt execution within this context as `reverted`, optionally returning + some data + + + + {`context.contractCallResults.output = M[retOffset:retOffset+retSize] context.contractCallResults.reverted = true halt`} -
0x31\[\`TORADIXLE\`\](#isa-section-to_radix_le)Convert a word to an array of limbs in little-endian radix formTBD: Storage of limbs and if T[dstOffset] is constrained to U8
0x31 + + \[\`TORADIXLE\`\](#isa-section-to_radix_le) + + + Convert a word to an array of limbs in little-endian radix form + + + + TBD: Storage of limbs and if T[dstOffset] is constrained to U8 + +
- ## Instructions ### `ADD` + Addition (a + b) [See in table.](#isa-table-add) - **Opcode**: 0x00 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` - **Details**: Wraps on overflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -490,19 +816,20 @@ Addition (a + b) [![](/img/protocol-specs/public-vm/bit-formats/ADD.png)](/img/protocol-specs/public-vm/bit-formats/ADD.png) ### `SUB` + Subtraction (a - b) [See in table.](#isa-table-sub) - **Opcode**: 0x01 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` - **Details**: Wraps on undeflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -512,19 +839,20 @@ Subtraction (a - b) [![](/img/protocol-specs/public-vm/bit-formats/SUB.png)](/img/protocol-specs/public-vm/bit-formats/SUB.png) ### `MUL` -Multiplication (a * b) + +Multiplication (a \* b) [See in table.](#isa-table-mul) - **Opcode**: 0x02 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` - **Details**: Wraps on overflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -534,19 +862,20 @@ Multiplication (a * b) [![](/img/protocol-specs/public-vm/bit-formats/MUL.png)](/img/protocol-specs/public-vm/bit-formats/MUL.png) ### `DIV` + Unsigned integer division (a / b) [See in table.](#isa-table-div) - **Opcode**: 0x03 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` - **Details**: If the input is a field, it will be interpreted as an integer - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -556,38 +885,39 @@ Unsigned integer division (a / b) [![](/img/protocol-specs/public-vm/bit-formats/DIV.png)](/img/protocol-specs/public-vm/bit-formats/DIV.png) ### `FDIV` + Field division (a / b) [See in table.](#isa-table-fdiv) - **Opcode**: 0x04 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == field` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 120 - ### `EQ` + Equality check (a \=\= b) [See in table.](#isa-table-eq) - **Opcode**: 0x05 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -596,19 +926,20 @@ Equality check (a \=\= b) [![](/img/protocol-specs/public-vm/bit-formats/EQ.png)](/img/protocol-specs/public-vm/bit-formats/EQ.png) ### `LT` + Less-than check (a \< b) [See in table.](#isa-table-lt) - **Opcode**: 0x06 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -617,19 +948,20 @@ Less-than check (a \< b) [![](/img/protocol-specs/public-vm/bit-formats/LT.png)](/img/protocol-specs/public-vm/bit-formats/LT.png) ### `LTE` + Less-than-or-equals check (a \<\= b) [See in table.](#isa-table-lte) - **Opcode**: 0x07 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -638,19 +970,20 @@ Less-than-or-equals check (a \<\= b) [![](/img/protocol-specs/public-vm/bit-formats/LTE.png)](/img/protocol-specs/public-vm/bit-formats/LTE.png) ### `AND` + Bitwise AND (a & b) [See in table.](#isa-table-and) - **Opcode**: 0x08 - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] AND M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -659,19 +992,20 @@ Bitwise AND (a & b) [![](/img/protocol-specs/public-vm/bit-formats/AND.png)](/img/protocol-specs/public-vm/bit-formats/AND.png) ### `OR` + Bitwise OR (a | b) [See in table.](#isa-table-or) - **Opcode**: 0x09 - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] OR M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -680,19 +1014,20 @@ Bitwise OR (a | b) [![](/img/protocol-specs/public-vm/bit-formats/OR.png)](/img/protocol-specs/public-vm/bit-formats/OR.png) ### `XOR` + Bitwise XOR (a ^ b) [See in table.](#isa-table-xor) - **Opcode**: 0x0a - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] XOR M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -701,18 +1036,19 @@ Bitwise XOR (a ^ b) [![](/img/protocol-specs/public-vm/bit-formats/XOR.png)](/img/protocol-specs/public-vm/bit-formats/XOR.png) ### `NOT` + Bitwise NOT (inversion) [See in table.](#isa-table-not) - **Opcode**: 0x0b - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = NOT M[aOffset]` - **Tag checks**: `T[aOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -721,19 +1057,20 @@ Bitwise NOT (inversion) [![](/img/protocol-specs/public-vm/bit-formats/NOT.png)](/img/protocol-specs/public-vm/bit-formats/NOT.png) ### `SHL` + Bitwise leftward shift (a \<\< b) [See in table.](#isa-table-shl) - **Opcode**: 0x0c - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] << M[bOffset]` - **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` - **Tag updates**: `T[dstOffset] = inTag` @@ -742,19 +1079,20 @@ Bitwise leftward shift (a \<\< b) [![](/img/protocol-specs/public-vm/bit-formats/SHL.png)](/img/protocol-specs/public-vm/bit-formats/SHL.png) ### `SHR` + Bitwise rightward shift (a \>\> b) [See in table.](#isa-table-shr) - **Opcode**: 0x0d - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] >> M[bOffset]` - **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` - **Tag updates**: `T[dstOffset] = inTag` @@ -763,18 +1101,19 @@ Bitwise rightward shift (a \>\> b) [![](/img/protocol-specs/public-vm/bit-formats/SHR.png)](/img/protocol-specs/public-vm/bit-formats/SHR.png) ### `CAST` + Type cast [See in table.](#isa-table-cast) - **Opcode**: 0x0e - **Category**: Type Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. -- **Args**: - - **aOffset**: memory offset of word to cast - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. +- **Args**: + - **aOffset**: memory offset of word to cast + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = cast(M[aOffset])` - **Details**: Cast a word in memory based on the `dstTag` specified in the bytecode. Truncates (`M[dstOffset] = M[aOffset] mod 2^dstsize`) when casting to a smaller type, left-zero-pads when casting to a larger type. See [here](./memory-model#cast-and-tag-conversions) for more details. - **Tag updates**: `T[dstOffset] = dstTag` @@ -783,16 +1122,17 @@ Type cast [![](/img/protocol-specs/public-vm/bit-formats/CAST.png)](/img/protocol-specs/public-vm/bit-formats/CAST.png) ### `ADDRESS` + Get the address of the currently executing l2 contract [See in table.](#isa-table-address) - **Opcode**: 0x0f - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.address` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -800,65 +1140,51 @@ Get the address of the currently executing l2 contract [![](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png)](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png) ### `SENDER` + Get the address of the sender (caller of the current context) [See in table.](#isa-table-sender) - **Opcode**: 0x10 - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.sender` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 [![](/img/protocol-specs/public-vm/bit-formats/SENDER.png)](/img/protocol-specs/public-vm/bit-formats/SENDER.png) -### `FUNCTIONSELECTOR` -Get the function selector of the contract function being executed - -[See in table.](#isa-table-functionselector) - -- **Opcode**: 0x11 -- **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.functionSelector` -- **Tag updates**: `T[dstOffset] = u32` -- **Bit-size**: 56 - - ### `TRANSACTIONFEE` + Get the computed transaction fee during teardown phase, zero otherwise [See in table.](#isa-table-transactionfee) - **Opcode**: 0x12 - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.transactionFee` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 - ### `CHAINID` + Get this rollup's L1 chain ID [See in table.](#isa-table-chainid) - **Opcode**: 0x13 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.chainId` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -866,16 +1192,17 @@ Get this rollup's L1 chain ID [![](/img/protocol-specs/public-vm/bit-formats/CHAINID.png)](/img/protocol-specs/public-vm/bit-formats/CHAINID.png) ### `VERSION` + Get this rollup's L2 version ID [See in table.](#isa-table-version) - **Opcode**: 0x14 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.version` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -883,16 +1210,17 @@ Get this rollup's L2 version ID [![](/img/protocol-specs/public-vm/bit-formats/VERSION.png)](/img/protocol-specs/public-vm/bit-formats/VERSION.png) ### `BLOCKNUMBER` + Get this L2 block's number [See in table.](#isa-table-blocknumber) - **Opcode**: 0x15 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.blocknumber` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -900,16 +1228,17 @@ Get this L2 block's number [![](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png)](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png) ### `TIMESTAMP` + Get this L2 block's timestamp [See in table.](#isa-table-timestamp) - **Opcode**: 0x16 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.timestamp` - **Tag updates**: `T[dstOffset] = u64` - **Bit-size**: 56 @@ -917,16 +1246,17 @@ Get this L2 block's timestamp [![](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png)](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png) ### `FEEPERL2GAS` + Get the fee to be paid per "L2 gas" - constant for entire transaction [See in table.](#isa-table-feeperl2gas) - **Opcode**: 0x17 - **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.feePerL2Gas` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -934,16 +1264,17 @@ Get the fee to be paid per "L2 gas" - constant for entire transaction [![](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png) ### `FEEPERDAGAS` + Get the fee to be paid per "DA gas" - constant for entire transaction [See in table.](#isa-table-feeperdagas) - **Opcode**: 0x18 - **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.feePerDaGas` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -951,18 +1282,19 @@ Get the fee to be paid per "DA gas" - constant for entire transaction [![](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png) ### `CALLDATACOPY` + Copy calldata into memory [See in table.](#isa-table-calldatacopy) - **Opcode**: 0x19 - **Category**: Execution Environment - Calldata -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **cdOffset**: offset into calldata to copy from - - **copySize**: number of words to copy - - **dstOffset**: memory offset specifying where to copy the first word to +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **cdOffset**: offset into calldata to copy from + - **copySize**: number of words to copy + - **dstOffset**: memory offset specifying where to copy the first word to - **Expression**: `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` - **Details**: Calldata is read-only and cannot be directly operated on by other instructions. This instruction moves words from calldata into memory so they can be operated on normally. - **Tag updates**: `T[dstOffset:dstOffset+copySize] = field` @@ -971,16 +1303,17 @@ Copy calldata into memory [![](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png)](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png) ### `L2GASLEFT` + Remaining "L2 gas" for this call (after this instruction) [See in table.](#isa-table-l2gasleft) - **Opcode**: 0x1a - **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.MachineState.l2GasLeft` - **Tag updates**: `T[dstOffset] = u32` - **Bit-size**: 56 @@ -988,16 +1321,17 @@ Remaining "L2 gas" for this call (after this instruction) [![](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png) ### `DAGASLEFT` + Remaining "DA gas" for this call (after this instruction) [See in table.](#isa-table-dagasleft) - **Opcode**: 0x1b - **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.machineState.daGasLeft` - **Tag updates**: `T[dstOffset] = u32` - **Bit-size**: 56 @@ -1005,14 +1339,15 @@ Remaining "DA gas" for this call (after this instruction) [![](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png) ### `JUMP` + Jump to a location in the bytecode [See in table.](#isa-table-jump) - **Opcode**: 0x1c - **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump to +- **Args**: + - **loc**: target location to jump to - **Expression**: `context.machineState.pc = loc` - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 @@ -1020,17 +1355,18 @@ Jump to a location in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/JUMP.png)](/img/protocol-specs/public-vm/bit-formats/JUMP.png) ### `JUMPI` + Conditionally jump to a location in the bytecode [See in table.](#isa-table-jumpi) - **Opcode**: 0x1d - **Category**: Machine State - Control Flow -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **loc**: target location conditionally jump to - - **condOffset**: memory offset of the operations 'conditional' input +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **loc**: target location conditionally jump to + - **condOffset**: memory offset of the operations 'conditional' input - **Expression**: `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` - **Details**: Target location is an immediate value (a constant in the bytecode). `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. - **Bit-size**: 88 @@ -1038,25 +1374,30 @@ Conditionally jump to a location in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/JUMPI.png)](/img/protocol-specs/public-vm/bit-formats/JUMPI.png) ### `INTERNALCALL` + Make an internal call. Push the current PC to the internal call stack and jump to the target location. [See in table.](#isa-table-internalcall) - **Opcode**: 0x1e - **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump/call to -- **Expression**: - -{`context.machineState.internalCallStack.push(context.machineState.pc) +- **Args**: + - **loc**: target location to jump/call to +- **Expression**: + {" "} + {" "} + {" "} + + {`context.machineState.internalCallStack.push(context.machineState.pc) context.machineState.pc = loc`} - + - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 [![](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png) ### `INTERNALRETURN` + Return from an internal call. Pop from the internal call stack and jump to the popped location. [See in table.](#isa-table-internalreturn) @@ -1069,18 +1410,19 @@ Return from an internal call. Pop from the internal call stack and jump to the p [![](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png) ### `SET` + Set a memory word from a constant in the bytecode [See in table.](#isa-table-set) - **Opcode**: 0x20 - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. -- **Args**: - - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) - - **dstOffset**: memory offset specifying where to store the constant +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. +- **Args**: + - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) + - **dstOffset**: memory offset specifying where to store the constant - **Expression**: `M[dstOffset] = const` - **Details**: Set memory word at `dstOffset` to `const`'s immediate value. `const`'s bit-size (N) can be 8, 16, 32, 64, or 128 based on `inTag`. It _cannot be 254 (`field` type)_! - **Tag updates**: `T[dstOffset] = inTag` @@ -1089,17 +1431,18 @@ Set a memory word from a constant in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/SET.png)](/img/protocol-specs/public-vm/bit-formats/SET.png) ### `MOV` + Move a word from source memory location to destination [See in table.](#isa-table-mov) - **Opcode**: 0x21 - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to move - - **dstOffset**: memory offset specifying where to store that word +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to move + - **dstOffset**: memory offset specifying where to store that word - **Expression**: `M[dstOffset] = M[srcOffset]` - **Tag updates**: `T[dstOffset] = T[srcOffset]` - **Bit-size**: 88 @@ -1107,19 +1450,20 @@ Move a word from source memory location to destination [![](/img/protocol-specs/public-vm/bit-formats/MOV.png)](/img/protocol-specs/public-vm/bit-formats/MOV.png) ### `CMOV` + Move a word (conditionally chosen) from one memory location to another (`d \= cond \> 0 ? a : b`) [See in table.](#isa-table-cmov) - **Opcode**: 0x22 - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of word 'a' to conditionally move - - **bOffset**: memory offset of word 'b' to conditionally move - - **condOffset**: memory offset of the operations 'conditional' input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of word 'a' to conditionally move + - **bOffset**: memory offset of word 'b' to conditionally move + - **condOffset**: memory offset of the operations 'conditional' input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` - **Details**: One of two source memory locations is chosen based on the condition. `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. - **Tag updates**: `T[dstOffset] = M[condOffset] > 0 ? T[aOffset] : T[bOffset]` @@ -1128,24 +1472,26 @@ Move a word (conditionally chosen) from one memory location to another (`d \= co [![](/img/protocol-specs/public-vm/bit-formats/CMOV.png)](/img/protocol-specs/public-vm/bit-formats/CMOV.png) ### `SLOAD` + Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. [See in table.](#isa-table-sload) - **Opcode**: 0x23 - **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **slotOffset**: memory offset of the storage slot to load from - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: - -{`M[dstOffset] = S[M[slotOffset]]`} - -- **Details**: - -{`// Expression is shorthand for +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **slotOffset**: memory offset of the storage slot to load from + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: + {`M[dstOffset] = S[M[slotOffset]]`} +- **Details**: + {" "} + {" "} + {" "} + + {`// Expression is shorthand for leafIndex = hash(context.environment.address, M[slotOffset]) exists = context.worldState.publicStorage.has(leafIndex) // exists == previously-written if exists: @@ -1153,10 +1499,13 @@ if exists: else: value = 0 M[dstOffset] = value`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.publicStorageReads.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.publicStorageReads.append( TracedStorageRead { callPointer: context.environment.callPointer, slot: M[slotOffset], @@ -1165,7 +1514,7 @@ M[dstOffset] = value`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree membership check - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 88 @@ -1173,32 +1522,37 @@ M[dstOffset] = value`} [![](/img/protocol-specs/public-vm/bit-formats/SLOAD.png)](/img/protocol-specs/public-vm/bit-formats/SLOAD.png) ### `SSTORE` + Write a word to this contract's persistent public storage [See in table.](#isa-table-sstore) - **Opcode**: 0x24 - **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of the word to store - - **slotOffset**: memory offset containing the storage slot to store to -- **Expression**: - -{`S[M[slotOffset]] = M[srcOffset]`} - -- **Details**: - -{`// Expression is shorthand for +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of the word to store + - **slotOffset**: memory offset containing the storage slot to store to +- **Expression**: + {`S[M[slotOffset]] = M[srcOffset]`} +- **Details**: + {" "} + {" "} + {" "} + + {`// Expression is shorthand for context.worldState.publicStorage.set({ leafIndex: hash(context.environment.address, M[slotOffset]), leaf: M[srcOffset], })`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.publicStorageWrites.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.publicStorageWrites.append( TracedStorageWrite { callPointer: context.environment.callPointer, slot: M[slotOffset], @@ -1206,36 +1560,43 @@ context.worldState.publicStorage.set({ counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree update - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/SSTORE.png)](/img/protocol-specs/public-vm/bit-formats/SSTORE.png) ### `NOTEHASHEXISTS` + Check whether a note hash exists in the note hash tree (as of the start of the current block) [See in table.](#isa-table-notehashexists) - **Opcode**: 0x25 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash - - **leafIndexOffset**: memory offset of the leaf index - - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) -- **Expression**: - -{`exists = context.worldState.noteHashes.has({ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash + - **leafIndexOffset**: memory offset of the leaf index + - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) +- **Expression**: + {" "} + {" "} + {" "} + + {`exists = context.worldState.noteHashes.has({ leafIndex: M[leafIndexOffset] leaf: hash(context.environment.address, M[noteHashOffset]), }) M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.noteHashChecks.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.noteHashChecks.append( TracedNoteHashCheck { callPointer: context.environment.callPointer, leafIndex: M[leafIndexOffset] @@ -1244,67 +1605,80 @@ M[existsOffset] = exists`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Note hash siloing (hash with storage contract address), note hash tree membership check - **Tag updates**: `T[existsOffset] = u8` - **Bit-size**: 120 - ### `EMITNOTEHASH` + Emit a new note hash to be inserted into the note hash tree [See in table.](#isa-table-emitnotehash) - **Opcode**: 0x26 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash -- **Expression**: - -{`context.worldState.noteHashes.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash +- **Expression**: + {" "} + {" "} + {" "} + + {`context.worldState.noteHashes.append( hash(context.environment.address, M[noteHashOffset]) )`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.noteHashes.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.noteHashes.append( TracedNoteHash { callPointer: context.environment.callPointer, noteHash: M[noteHashOffset], // unsiloed note hash counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Note hash siloing (hash with contract address), note hash tree insertion. - **Bit-size**: 56 [![](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png)](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png) ### `NULLIFIEREXISTS` + Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) [See in table.](#isa-table-nullifierexists) - **Opcode**: 0x27 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of the unsiloed nullifier - - **addressOffset**: memory offset of the storage address - - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) -- **Expression**: - -{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of the unsiloed nullifier + - **addressOffset**: memory offset of the storage address + - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) +- **Expression**: + {" "} + {" "} + {" "} + + {`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( hash(M[addressOffset], M[nullifierOffset]) ) M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.nullifierChecks.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.nullifierChecks.append( TracedNullifierCheck { callPointer: context.environment.callPointer, nullifier: M[nullifierOffset], @@ -1313,67 +1687,80 @@ M[existsOffset] = exists`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Nullifier siloing (hash with storage contract address), nullifier tree membership check - **Tag updates**: `T[existsOffset] = u8` - **Bit-size**: 120 - ### `EMITNULLIFIER` + Emit a new nullifier to be inserted into the nullifier tree [See in table.](#isa-table-emitnullifier) - **Opcode**: 0x28 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of nullifier -- **Expression**: - -{`context.worldState.nullifiers.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of nullifier +- **Expression**: + {" "} + {" "} + {" "} + + {`context.worldState.nullifiers.append( hash(context.environment.address, M[nullifierOffset]) )`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.nullifiers.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.nullifiers.append( TracedNullifier { callPointer: context.environment.callPointer, nullifier: M[nullifierOffset], // unsiloed nullifier counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Nullifier siloing (hash with contract address), nullifier tree non-membership-check and insertion. - **Bit-size**: 56 [![](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png)](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png) ### `L1TOL2MSGEXISTS` + Check if a message exists in the L1-to-L2 message tree [See in table.](#isa-table-l1tol2msgexists) - **Opcode**: 0x29 - **Category**: World State - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **msgHashOffset**: memory offset of the message hash - - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree - - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) -- **Expression**: - -{`exists = context.worldState.l1ToL2Messages.has({ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **msgHashOffset**: memory offset of the message hash + - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree + - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) +- **Expression**: + {" "} + {" "} + {" "} + + {`exists = context.worldState.l1ToL2Messages.has({ leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] }) M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( + +- **World State access tracing**: + {" "} + {" "} + {" "} + + {`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( L1ToL2Message { callPointer: context.environment.callPointer, leafIndex: M[msgLeafIndexOffset], @@ -1381,30 +1768,31 @@ M[existsOffset] = exists`} exists: exists, // defined above } )`} - + - **Triggers downstream circuit operations**: L1-to-L2 message tree membership check -- **Tag updates**: - -{`T[existsOffset] = u8,`} - +- **Tag updates**: + {`T[existsOffset] = u8,`} - **Bit-size**: 120 - ### `GETCONTRACTINSTANCE` + Copies contract instance data to memory [See in table.](#isa-table-getcontractinstance) - **Opcode**: 0x2a - **Category**: Other -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **addressOffset**: memory offset of the contract instance address - - **dstOffset**: location to write the contract instance information to -- **Expression**: - -{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **addressOffset**: memory offset of the contract instance address + - **dstOffset**: location to write the contract instance information to +- **Expression**: + {" "} + {" "} + {" "} + + {`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ instance_found_in_address, instance.salt ?? 0, instance.deployer ?? 0, @@ -1413,84 +1801,95 @@ Copies contract instance data to memory instance.portalContractAddress ?? 0, instance.publicKeysHash ?? 0, ]`} - + - **Additional AVM circuit checks**: TO-DO - **Triggers downstream circuit operations**: TO-DO - **Tag updates**: T[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = field - **Bit-size**: 88 - ### `EMITUNENCRYPTEDLOG` + Emit an unencrypted log [See in table.](#isa-table-emitunencryptedlog) - **Opcode**: 0x2b - **Category**: Accrued Substate - Logging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **logOffset**: memory offset of the data to log - - **logSizeOffset**: memory offset to number of words to log -- **Expression**: - -{`context.accruedSubstate.unencryptedLogs.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **logOffset**: memory offset of the data to log + - **logSizeOffset**: memory offset to number of words to log +- **Expression**: + {" "} + {" "} + {" "} + + {`context.accruedSubstate.unencryptedLogs.append( UnencryptedLog { address: context.environment.address, log: M[logOffset:logOffset+M[logSizeOffset]], } )`} - + - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png)](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png) ### `SENDL2TOL1MSG` + Send an L2-to-L1 message [See in table.](#isa-table-sendl2tol1msg) - **Opcode**: 0x2c - **Category**: Accrued Substate - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **recipientOffset**: memory offset of the message recipient - - **contentOffset**: memory offset of the message content -- **Expression**: - -{`context.accruedSubstate.sentL2ToL1Messages.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **recipientOffset**: memory offset of the message recipient + - **contentOffset**: memory offset of the message content +- **Expression**: + {" "} + {" "} + {" "} + + {`context.accruedSubstate.sentL2ToL1Messages.append( SentL2ToL1Message { address: context.environment.address, recipient: M[recipientOffset], message: M[contentOffset] } )`} - + - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png)](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png) ### `CALL` + Call into another contract [See in table.](#isa-table-call) - **Opcode**: 0x2d - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + {" "} + {" "} + {" "} + + {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -1498,46 +1897,53 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=false) execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - + - **Details**: Creates a new (nested) execution context and triggers execution within that context. - Execution proceeds in the nested context until it reaches a halt at which point - execution resumes in the current/calling context. - A non-existent contract or one with no code will return success. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. + Execution proceeds in the nested context until it reaches a halt at which point + execution resumes in the current/calling context. + A non-existent contract or one with no code will return success. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. - **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - -{`T[successOffset] = u8 +- **Tag updates**: + {" "} + {" "} + {" "} + + {`T[successOffset] = u8 T[retOffset:retOffset+retSize] = field`} - + - **Bit-size**: 248 [![](/img/protocol-specs/public-vm/bit-formats/CALL.png)](/img/protocol-specs/public-vm/bit-formats/CALL.png) ### `STATICCALL` + Call into another contract, disallowing World State and Accrued Substate modifications [See in table.](#isa-table-staticcall) - **Opcode**: 0x2e - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + {" "} + {" "} + {" "} + + {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -1545,84 +1951,95 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=true execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. + +- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. - **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - -{`T[successOffset] = u8 +- **Tag updates**: + {" "} + {" "} + {" "} + + {`T[successOffset] = u8 T[retOffset:retOffset+retSize] = field`} - + - **Bit-size**: 248 [![](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png)](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png) ### `RETURN` + Halt execution within this context (without revert), optionally returning some data [See in table.](#isa-table-return) - **Opcode**: 0x2f - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + {" "} + {" "} + {" "} + + {`context.contractCallResults.output = M[retOffset:retOffset+retSize] halt`} - + - **Details**: Return control flow to the calling context/contract. Caller will accept World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/RETURN.png)](/img/protocol-specs/public-vm/bit-formats/RETURN.png) ### `REVERT` + Halt execution within this context as `reverted`, optionally returning some data [See in table.](#isa-table-revert) - **Opcode**: 0x30 - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + {" "} + {" "} + {" "} + + {`context.contractCallResults.output = M[retOffset:retOffset+retSize] context.contractCallResults.reverted = true halt`} - + - **Details**: Return control flow to the calling context/contract. Caller will reject World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/REVERT.png)](/img/protocol-specs/public-vm/bit-formats/REVERT.png) ### `TORADIXLE` + Convert a word to an array of limbs in little-endian radix form [See in table.](#isa-table-to_radix_le) - **Opcode**: 0x31 - **Category**: Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to convert. - - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. - - **radix**: the maximum bit-size of each limb. - - **numLimbs**: the number of limbs the word will be converted into. +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to convert. + - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. + - **radix**: the maximum bit-size of each limb. + - **numLimbs**: the number of limbs the word will be converted into. - **Expression**: TBD: Storage of limbs and if T[dstOffset] is constrained to U8 - **Details**: The limbs will be stored in a contiguous memory block starting at `dstOffset`. - **Tag checks**: `T[srcOffset] == field` - **Bit-size**: 152 - diff --git a/docs/src/preprocess/InstructionSet/InstructionSet.js b/docs/src/preprocess/InstructionSet/InstructionSet.js index cec5a392c7c..f7c04fe07d3 100644 --- a/docs/src/preprocess/InstructionSet/InstructionSet.js +++ b/docs/src/preprocess/InstructionSet/InstructionSet.js @@ -531,25 +531,6 @@ const INSTRUCTION_SET_RAW = [ "Tag checks": "", "Tag updates": "`T[dstOffset] = field`", }, - { - id: "functionselector", - Name: "`FUNCTIONSELECTOR`", - Category: "Execution Environment", - Flags: [{ name: "indirect", description: INDIRECT_FLAG_DESCRIPTION }], - Args: [ - { - name: "dstOffset", - description: - "memory offset specifying where to store operation's result", - }, - ], - Expression: "`M[dstOffset] = context.environment.functionSelector`", - Summary: - "Get the function selector of the contract function being executed", - Details: "", - "Tag checks": "", - "Tag updates": "`T[dstOffset] = u32`", - }, { id: "transactionfee", Name: "`TRANSACTIONFEE`", diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index f76deaaf78c..eef7eeb48a1 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -248,7 +248,6 @@ library Constants { uint256 internal constant MEM_TAG_U128 = 6; uint256 internal constant SENDER_KERNEL_INPUTS_COL_OFFSET = 0; uint256 internal constant ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; - uint256 internal constant FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; uint256 internal constant IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; uint256 internal constant CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; uint256 internal constant VERSION_KERNEL_INPUTS_COL_OFFSET = 5; diff --git a/noir-projects/aztec-nr/aztec/src/context/public_context.nr b/noir-projects/aztec-nr/aztec/src/context/public_context.nr index 2d0320b4da6..d8095be42dd 100644 --- a/noir-projects/aztec-nr/aztec/src/context/public_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/public_context.nr @@ -253,14 +253,6 @@ unconstrained fn address() -> AztecAddress { unconstrained fn sender() -> AztecAddress { sender_opcode() } -// TODO(9396): Remove. -unconstrained fn portal() -> EthAddress { - portal_opcode() -} -// TODO(9396): Remove. -//unconstrained fn function_selector() -> u32 { -// function_selector_opcode() -//} unconstrained fn transaction_fee() -> Field { transaction_fee_opcode() } @@ -364,13 +356,6 @@ unconstrained fn address_opcode() -> AztecAddress {} #[oracle(avmOpcodeSender)] unconstrained fn sender_opcode() -> AztecAddress {} -#[oracle(avmOpcodePortal)] -unconstrained fn portal_opcode() -> EthAddress {} - -// TODO(9396): Remove. -//#[oracle(avmOpcodeFunctionSelector)] -//unconstrained fn function_selector_opcode() -> u32 {} - #[oracle(avmOpcodeTransactionFee)] unconstrained fn transaction_fee_opcode() -> Field {} diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index 1a4c3fee584..f1b1e149f5f 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -37,16 +37,14 @@ contract AvmTest { get_contract_instance_initialization_hash_avm, }; use dep::aztec::prelude::Map; - use dep::aztec::protocol_types::{ - abis::function_selector::FunctionSelector, contract_class_id::ContractClassId, - storage::map::derive_storage_slot_in_map, - }; use dep::aztec::protocol_types::{ address::{AztecAddress, EthAddress}, point::Point, scalar::Scalar, }; - use dep::aztec::protocol_types::constants::CONTRACT_INSTANCE_LENGTH; + use dep::aztec::protocol_types::{ + contract_class_id::ContractClassId, storage::map::derive_storage_slot_in_map, + }; use dep::aztec::state_vars::PublicMutable; use dep::compressed_string::CompressedString; use std::embedded_curve_ops::{EmbeddedCurvePoint, multi_scalar_mul}; @@ -378,11 +376,6 @@ contract AvmTest { context.msg_sender() } - #[public] - fn get_function_selector() -> FunctionSelector { - context.selector() - } - #[public] fn get_transaction_fee() -> Field { context.transaction_fee() @@ -434,14 +427,6 @@ contract AvmTest { assert(timestamp == expected_timestamp, "timestamp does not match"); } - #[public] - fn check_selector() { - assert( - context.selector() == comptime { FunctionSelector::from_signature("check_selector()") }, - "Unexpected selector!", - ); - } - #[public] fn get_args_hash(_a: u8, _fields: [Field; 3]) -> Field { context.get_args_hash() @@ -659,8 +644,6 @@ contract AvmTest { let _ = get_address(); dep::aztec::oracle::debug_log::debug_log("get_sender"); let _ = get_sender(); - dep::aztec::oracle::debug_log::debug_log("get_function_selector"); - let _ = get_function_selector(); dep::aztec::oracle::debug_log::debug_log("get_transaction_fee"); let _ = get_transaction_fee(); dep::aztec::oracle::debug_log::debug_log("get_chain_id"); 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 c49164566fc..488d22b26c9 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -502,7 +502,7 @@ pub global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32 = 2 + 21 * 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 -pub global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 4166; +pub global AVM_PROOF_LENGTH_IN_FIELDS: u32 = 4161; pub global AVM_PUBLIC_COLUMN_MAX_SIZE: u32 = 1024; pub global AVM_PUBLIC_INPUTS_FLATTENED_SIZE: u32 = 2 * AVM_PUBLIC_COLUMN_MAX_SIZE + PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH; @@ -587,7 +587,6 @@ pub global MEM_TAG_U128: Field = 6; // Keep the number of offsets aligned with KERNEL_INPUTS_LENGTH defined in constants.hpp pub global SENDER_KERNEL_INPUTS_COL_OFFSET: u32 = 0; pub global ADDRESS_KERNEL_INPUTS_COL_OFFSET: u32 = 1; -pub global FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET: u32 = 2; pub global IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET: u32 = 3; // pub global Variables pub global CHAIN_ID_KERNEL_INPUTS_COL_OFFSET: u32 = 4; diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 3168b6099f6..8015d4dbc7c 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -220,7 +220,7 @@ export const TUBE_PROOF_LENGTH = 463; export const HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS = 128; export const CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS = 143; export const AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS = 86; -export const AVM_PROOF_LENGTH_IN_FIELDS = 4166; +export const AVM_PROOF_LENGTH_IN_FIELDS = 4161; export const AVM_PUBLIC_COLUMN_MAX_SIZE = 1024; export const AVM_PUBLIC_INPUTS_FLATTENED_SIZE = 2915; export const MEM_TAG_FF = 0; @@ -232,7 +232,6 @@ export const MEM_TAG_U64 = 5; export const MEM_TAG_U128 = 6; export const SENDER_KERNEL_INPUTS_COL_OFFSET = 0; export const ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1; -export const FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2; export const IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3; export const CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4; export const VERSION_KERNEL_INPUTS_COL_OFFSET = 5; diff --git a/yarn-project/circuits.js/src/scripts/constants.in.ts b/yarn-project/circuits.js/src/scripts/constants.in.ts index 26a4857e2c5..ba05f256162 100644 --- a/yarn-project/circuits.js/src/scripts/constants.in.ts +++ b/yarn-project/circuits.js/src/scripts/constants.in.ts @@ -63,7 +63,6 @@ const CPP_CONSTANTS = [ 'START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET', 'SENDER_KERNEL_INPUTS_COL_OFFSET', 'ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET', 'CHAIN_ID_KERNEL_INPUTS_COL_OFFSET', 'VERSION_KERNEL_INPUTS_COL_OFFSET', 'BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET', @@ -123,7 +122,6 @@ const PIL_CONSTANTS = [ 'START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET', 'SENDER_KERNEL_INPUTS_COL_OFFSET', 'ADDRESS_KERNEL_INPUTS_COL_OFFSET', - 'FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET', 'CHAIN_ID_KERNEL_INPUTS_COL_OFFSET', 'VERSION_KERNEL_INPUTS_COL_OFFSET', 'BLOCK_NUMBER_KERNEL_INPUTS_COL_OFFSET', diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index 72889ea63c1..4c9cb102703 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -234,18 +234,6 @@ describe('AVM simulator: transpiled Noir contracts', () => { expect(results.output).toEqual([computeVarArgsHash(calldata)]); }); - it('functionSelector getter via dispatch', async () => { - const selector = FunctionSelector.fromSignature('get_function_selector()').toField(); - const dispatchCalldata = [selector]; - - const context = initContext({ env: initExecutionEnvironment({ calldata: dispatchCalldata }) }); - const bytecode = getAvmTestContractBytecode('public_dispatch'); - const results = await new AvmSimulator(context).executeBytecode(bytecode); - - expect(results.reverted).toBe(false); - expect(results.output).toEqual([selector]); - }); - it('modulo and u1', async () => { const calldata: Fr[] = [new Fr(2)]; const context = initContext({ env: initExecutionEnvironment({ calldata }) }); diff --git a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts index c13cc8a70e9..cd7c8fafab0 100644 --- a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts @@ -63,7 +63,6 @@ describe('Environment getters', () => { describe.each([ [EnvironmentVariable.ADDRESS, address.toField()], [EnvironmentVariable.SENDER, sender.toField()], - [EnvironmentVariable.FUNCTIONSELECTOR, functionSelector.toField(), TypeTag.UINT32], [EnvironmentVariable.TRANSACTIONFEE, transactionFee.toField()], [EnvironmentVariable.CHAINID, chainId.toField()], [EnvironmentVariable.VERSION, version.toField()], diff --git a/yarn-project/simulator/src/avm/opcodes/environment_getters.ts b/yarn-project/simulator/src/avm/opcodes/environment_getters.ts index da29aa3948b..97c78488d1b 100644 --- a/yarn-project/simulator/src/avm/opcodes/environment_getters.ts +++ b/yarn-project/simulator/src/avm/opcodes/environment_getters.ts @@ -1,5 +1,5 @@ import type { AvmContext } from '../avm_context.js'; -import { Field, Uint32, Uint64 } from '../avm_memory_types.js'; +import { Field, Uint64 } from '../avm_memory_types.js'; import { InstructionExecutionError } from '../errors.js'; import { Opcode, OperandType } from '../serialization/instruction_serialization.js'; import { Addressing } from './addressing_mode.js'; @@ -8,7 +8,6 @@ import { Instruction } from './instruction.js'; export enum EnvironmentVariable { ADDRESS, SENDER, - FUNCTIONSELECTOR, TRANSACTIONFEE, CHAINID, VERSION, @@ -27,8 +26,6 @@ function getValue(e: EnvironmentVariable, ctx: AvmContext) { return new Field(ctx.environment.address.toField()); case EnvironmentVariable.SENDER: return new Field(ctx.environment.sender.toField()); - case EnvironmentVariable.FUNCTIONSELECTOR: - return new Uint32(ctx.environment.functionSelector.value); case EnvironmentVariable.TRANSACTIONFEE: return new Field(ctx.environment.transactionFee); case EnvironmentVariable.CHAINID: diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index 1fdaee4d635..fe8ebd2d738 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -661,11 +661,6 @@ export class TXEService { return toForeignCallResult([toSingle(new Fr(blockNumber))]); } - avmOpcodeFunctionSelector() { - const functionSelector = (this.typedOracle as TXE).getFunctionSelector(); - return toForeignCallResult([toSingle(functionSelector.toField())]); - } - avmOpcodeIsStaticCall() { const isStaticCall = (this.typedOracle as TXE).getIsStaticCall(); return toForeignCallResult([toSingle(new Fr(isStaticCall ? 1 : 0))]);