Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(avm): remove avm prefix from pil and executor #7099

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "avm_main.pil";
include "main.pil";

namespace avm_alu(256);
namespace alu(256);

// ========= Table ALU-TR =================================================

Expand Down Expand Up @@ -246,7 +246,7 @@ namespace avm_alu(256);

// ========= EQUALITY Operation Constraints ===============================
// TODO: Note this method differs from the approach taken for "equality to zero" checks
// in handling the error tags found in avm_main and avm_mem files. The predicted relation difference
// in handling the error tags found in main and mem files. The predicted relation difference
// is minor and when we optimise we will harmonise the methods based on actual performance.

// Equality of two elements is found by performing an "equality to zero" check.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

include "avm_byte_lookup.pil";
include "avm_main.pil";
include "byte_lookup.pil";
include "main.pil";

namespace avm_binary(256);
namespace binary(256);

pol commit clk;

Expand Down Expand Up @@ -30,7 +30,7 @@ namespace avm_binary(256);
(op_id' - op_id) * mem_tag_ctr = 0;

// Little Endian bitwise decomposition of accumulators (which are processed top-down),
// constrained to be U8 given by the lookup to the avm_byte_lookup
// constrained to be U8 given by the lookup to the byte_lookup
pol commit ia_bytes;
pol commit ib_bytes;
pol commit ic_bytes;
Expand Down Expand Up @@ -65,12 +65,12 @@ namespace avm_binary(256);
#[LOOKUP_BYTE_LENGTHS]
start {in_tag, mem_tag_ctr}
in
avm_byte_lookup.bin_sel {avm_byte_lookup.table_in_tags, avm_byte_lookup.table_byte_lengths};
byte_lookup.bin_sel {byte_lookup.table_in_tags, byte_lookup.table_byte_lengths};

#[LOOKUP_BYTE_OPERATIONS]
bin_sel {op_id, ia_bytes, ib_bytes, ic_bytes}
in
avm_byte_lookup.bin_sel {avm_byte_lookup.table_op_id, avm_byte_lookup.table_input_a, avm_byte_lookup.table_input_b, avm_byte_lookup.table_output};
byte_lookup.bin_sel {byte_lookup.table_op_id, byte_lookup.table_input_a, byte_lookup.table_input_b, byte_lookup.table_output};

#[ACC_REL_A]
(acc_ia - ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace avm_byte_lookup(256);
namespace byte_lookup(256);
// These columns are commited for now, but will be migrated to constant/fixed when
// we support more *exotic* code generation options
pol commit table_op_id; // identifies if operation is AND/OR/XOR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "../avm_main.pil";
include "../main.pil";

namespace avm_conversion(256);
namespace conversion(256);

pol commit clk;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "../avm_main.pil";
include "../main.pil";

namespace avm_keccakf1600(256);
namespace keccakf1600(256);

pol commit clk;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

include "../avm_main.pil";
include "../main.pil";

namespace avm_pedersen(256);
namespace pedersen(256);

pol commit clk;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "../avm_main.pil";
include "../main.pil";

namespace avm_poseidon2(256);
namespace poseidon2(256);

pol commit clk;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include "../avm_main.pil";
include "../main.pil";

namespace avm_sha256(256);
namespace sha256(256);

pol commit clk;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

namespace avm_gas(256);
namespace gas(256);
// TODO: WILL BE FIXED - we should be able to have this be a fixed column / the lookup tables are fixed so require no selectors
// TODO: All the columns here will have to be constant (when supported by our powdr fork and proving system)
pol commit gas_cost_sel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include "avm_main.pil";
include "main.pil";
include "constants.pil";

namespace avm_kernel(256);
namespace kernel(256);
pol public(/*idx=*/0) kernel_inputs;

pol public(/*idx=*/1) kernel_value_out;
Expand Down Expand Up @@ -58,29 +58,29 @@ namespace avm_kernel(256);
pol commit emit_l2_to_l1_msg_write_offset;


pol NOT_LAST = (1 - avm_main.last);
pol NOT_LAST = (1 - main.last);

// Constraints to increase the offsets when the opcodes are found
#[NOTE_HASH_EXISTS_INC_CONSISTENCY_CHECK]
NOT_LAST * (note_hash_exist_write_offset' - (note_hash_exist_write_offset + avm_main.sel_op_note_hash_exists)) = 0;
NOT_LAST * (note_hash_exist_write_offset' - (note_hash_exist_write_offset + main.sel_op_note_hash_exists)) = 0;
#[EMIT_NOTE_HASH_INC_CONSISTENCY_CHECK]
NOT_LAST * (emit_note_hash_write_offset' - (emit_note_hash_write_offset + avm_main.sel_op_emit_note_hash)) = 0;
// if avm_main.ib is set on op_nullifier_exists, then the nullifier_exists_write_offset will be incremented by 1, otherwise non_exists will be incremented
NOT_LAST * (emit_note_hash_write_offset' - (emit_note_hash_write_offset + main.sel_op_emit_note_hash)) = 0;
// if main.ib is set on op_nullifier_exists, then the nullifier_exists_write_offset will be incremented by 1, otherwise non_exists will be incremented
#[NULLIFIER_EXISTS_INC_CONSISTENCY_CHECK]
NOT_LAST * (nullifier_exists_write_offset' - (nullifier_exists_write_offset + (avm_main.sel_op_nullifier_exists * avm_main.ib))) = 0;
NOT_LAST * (nullifier_exists_write_offset' - (nullifier_exists_write_offset + (main.sel_op_nullifier_exists * main.ib))) = 0;
#[NULLIFIER_NON_EXISTS_INC_CONSISTENCY_CHECK]
NOT_LAST * (nullifier_non_exists_write_offset' - (nullifier_non_exists_write_offset + (avm_main.sel_op_nullifier_exists * (1 - avm_main.ib)))) = 0;
NOT_LAST * (nullifier_non_exists_write_offset' - (nullifier_non_exists_write_offset + (main.sel_op_nullifier_exists * (1 - main.ib)))) = 0;
#[EMIT_NULLIFIER_INC_CONSISTENCY_CHECK]
NOT_LAST * (emit_nullifier_write_offset' - (emit_nullifier_write_offset + avm_main.sel_op_emit_nullifier)) = 0;
NOT_LAST * (emit_nullifier_write_offset' - (emit_nullifier_write_offset + main.sel_op_emit_nullifier)) = 0;
#[L1_TO_L2_MSG_EXISTS_INC_CONSISTENCY_CHECK]
NOT_LAST * (l1_to_l2_msg_exists_write_offset' - (l1_to_l2_msg_exists_write_offset + avm_main.sel_op_l1_to_l2_msg_exists)) = 0;
NOT_LAST * (l1_to_l2_msg_exists_write_offset' - (l1_to_l2_msg_exists_write_offset + main.sel_op_l1_to_l2_msg_exists)) = 0;
#[EMIT_UNENCRYPTED_LOG_INC_CONSISTENCY_CHECK]
NOT_LAST * (emit_unencrypted_log_write_offset' - (emit_unencrypted_log_write_offset + avm_main.sel_op_emit_unencrypted_log)) = 0;
NOT_LAST * (emit_unencrypted_log_write_offset' - (emit_unencrypted_log_write_offset + main.sel_op_emit_unencrypted_log)) = 0;
#[EMIT_L2_TO_L1_MSG_INC_CONSISTENCY_CHECK]
NOT_LAST * (emit_l2_to_l1_msg_write_offset' - (emit_l2_to_l1_msg_write_offset + avm_main.sel_op_emit_l2_to_l1_msg)) = 0;
NOT_LAST * (emit_l2_to_l1_msg_write_offset' - (emit_l2_to_l1_msg_write_offset + main.sel_op_emit_l2_to_l1_msg)) = 0;


#[SLOAD_INC_CONSISTENCY_CHECK]
NOT_LAST * (sload_write_offset' - (sload_write_offset + avm_main.sel_op_sload)) = 0;
NOT_LAST * (sload_write_offset' - (sload_write_offset + main.sel_op_sload)) = 0;
#[SSTORE_INC_CONSISTENCY_CHECK]
NOT_LAST * (sstore_write_offset' - (sstore_write_offset + avm_main.sel_op_sstore)) = 0;
NOT_LAST * (sstore_write_offset' - (sstore_write_offset + main.sel_op_sstore)) = 0;
Loading
Loading