Skip to content

Commit

Permalink
chore(avm): remove shifts from full row (#7327)
Browse files Browse the repository at this point in the history
These values are not used by the circuit builder, rather they are
constructed virtually by the prover.
  • Loading branch information
Maddiaa0 authored Jul 3, 2024
1 parent 694e68e commit 4d641ee
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,71 +407,6 @@ template <typename FF> struct AvmFullRow {
FF lookup_div_u16_5_counts{};
FF lookup_div_u16_6_counts{};
FF lookup_div_u16_7_counts{};
FF alu_a_hi_shift{};
FF alu_a_lo_shift{};
FF alu_b_hi_shift{};
FF alu_b_lo_shift{};
FF alu_cmp_rng_ctr_shift{};
FF alu_div_u16_r0_shift{};
FF alu_div_u16_r1_shift{};
FF alu_div_u16_r2_shift{};
FF alu_div_u16_r3_shift{};
FF alu_div_u16_r4_shift{};
FF alu_div_u16_r5_shift{};
FF alu_div_u16_r6_shift{};
FF alu_div_u16_r7_shift{};
FF alu_op_add_shift{};
FF alu_op_cast_prev_shift{};
FF alu_op_cast_shift{};
FF alu_op_div_shift{};
FF alu_op_mul_shift{};
FF alu_op_shl_shift{};
FF alu_op_shr_shift{};
FF alu_op_sub_shift{};
FF alu_p_sub_a_hi_shift{};
FF alu_p_sub_a_lo_shift{};
FF alu_p_sub_b_hi_shift{};
FF alu_p_sub_b_lo_shift{};
FF alu_sel_alu_shift{};
FF alu_sel_cmp_shift{};
FF alu_sel_div_rng_chk_shift{};
FF alu_sel_rng_chk_lookup_shift{};
FF alu_sel_rng_chk_shift{};
FF alu_u16_r0_shift{};
FF alu_u16_r1_shift{};
FF alu_u16_r2_shift{};
FF alu_u16_r3_shift{};
FF alu_u16_r4_shift{};
FF alu_u16_r5_shift{};
FF alu_u16_r6_shift{};
FF alu_u8_r0_shift{};
FF alu_u8_r1_shift{};
FF binary_acc_ia_shift{};
FF binary_acc_ib_shift{};
FF binary_acc_ic_shift{};
FF binary_mem_tag_ctr_shift{};
FF binary_op_id_shift{};
FF kernel_emit_l2_to_l1_msg_write_offset_shift{};
FF kernel_emit_note_hash_write_offset_shift{};
FF kernel_emit_nullifier_write_offset_shift{};
FF kernel_emit_unencrypted_log_write_offset_shift{};
FF kernel_l1_to_l2_msg_exists_write_offset_shift{};
FF kernel_note_hash_exist_write_offset_shift{};
FF kernel_nullifier_exists_write_offset_shift{};
FF kernel_nullifier_non_exists_write_offset_shift{};
FF kernel_side_effect_counter_shift{};
FF kernel_sload_write_offset_shift{};
FF kernel_sstore_write_offset_shift{};
FF main_da_gas_remaining_shift{};
FF main_internal_return_ptr_shift{};
FF main_l2_gas_remaining_shift{};
FF main_pc_shift{};
FF mem_glob_addr_shift{};
FF mem_rw_shift{};
FF mem_sel_mem_shift{};
FF mem_tag_shift{};
FF mem_tsp_shift{};
FF mem_val_shift{};

[[maybe_unused]] static std::vector<std::string> names();
};
Expand Down
3 changes: 0 additions & 3 deletions bb-pilcom/bb-pil-backend/src/circuit_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub trait CircuitBuilder {
all_cols_without_inverses: &[String],
all_cols: &[String],
to_be_shifted: &[String],
all_cols_with_shifts: &[String],
);

fn create_circuit_builder_cpp(&mut self, name: &str, all_cols: &[String]);
Expand All @@ -26,7 +25,6 @@ impl CircuitBuilder for BBFiles {
all_cols_without_inverses: &[String],
all_cols: &[String],
to_be_shifted: &[String],
all_cols_with_shifts: &[String],
) {
let mut handlebars = Handlebars::new();

Expand All @@ -37,7 +35,6 @@ impl CircuitBuilder for BBFiles {
"all_cols_without_inverses": all_cols_without_inverses,
"all_cols": all_cols,
"to_be_shifted": to_be_shifted,
"all_cols_with_shifts": all_cols_with_shifts,
});

handlebars
Expand Down
1 change: 0 additions & 1 deletion bb-pilcom/bb-pil-backend/src/vm_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ pub fn analyzed_to_cpp<F: FieldElement>(
&all_cols_without_inverses,
&all_cols,
&to_be_shifted,
&all_cols_with_shifts,
);

bb_files.create_circuit_builder_cpp(file_name, &all_cols);
Expand Down
2 changes: 1 addition & 1 deletion bb-pilcom/bb-pil-backend/templates/circuit_builder.hpp.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace bb {

template <typename FF>
struct {{name}}FullRow {
{{#each all_cols_with_shifts as |col|}}
{{#each all_cols as |col|}}
FF {{col}}{};
{{/each}}

Expand Down

0 comments on commit 4d641ee

Please sign in to comment.