Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -179,14 +179,10 @@ void process_call_data_operations(Builder& builder,
BB_ASSERT_EQ(op.access_type, 0);
field_ct value = poly_to_field_ct(op.value, builder);
field_ct index = poly_to_field_ct(op.index, builder);
fr w_value = 0;
if (has_valid_witness_assignments) {
// If witness are assigned, we use the correct value for w
w_value = index.get_value();
value.assert_equal(calldata_array[index]);
if (!has_valid_witness_assignments) {
index.is_zero();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need to do this? This if is only reached when mocking. We were already checking that the index value is zero with the copy constraint. But if it's only in mock cases, do we need to assert it's zero in circuit? I think the change I made causes issues because the mock would have an extra gate, so probably vk generation will be wrong

}
field_ct w = field_ct::from_witness(&builder, w_value);
value.assert_equal(calldata_array[w]);
w.assert_equal(index);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ field_t<Builder> databus<Builder>::bus_vector::operator[](const field_pt& index)
if (index.is_constant()) {
index_witness_idx = context->put_constant_variable(index.get_value());
} else {
index_witness_idx = index.normalize().get_witness_index();
index_witness_idx = index.get_normalized_witness_index();
}

// Read from the bus vector at the specified index. Creates a single read gate
Expand Down
Loading