-
Notifications
You must be signed in to change notification settings - Fork 315
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
feat: bus updates #7522
feat: bus updates #7522
Changes from all commits
a75ef3c
0255cb0
fc42e8b
1a645f6
336e99f
05cd650
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,16 @@ template <typename FF> class MegaCircuitBuilder_ : public UltraCircuitBuilder_<M | |
*/ | ||
void add_public_calldata(const uint32_t& in) { return append_to_bus_vector(BusId::CALLDATA, in); } | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a comment why we have two of this function. We could specialise the name for Aztec usecase (our proving system is not that general in the end) and call them calldata_function and calldata_kernel so 1 and 2 are not misused, but prolly there's even better naming options in terms of generality There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the comment (this was just an oversight) and updated the naming to |
||
* @brief Add a witness variable to secondary_calldata. | ||
* @details In practice this is used in aztec by the kernel circuit to recieve output from a function circuit | ||
* | ||
*/ | ||
void add_public_secondary_calldata(const uint32_t& in) | ||
{ | ||
return append_to_bus_vector(BusId::SECONDARY_CALLDATA, in); | ||
} | ||
|
||
/** | ||
* @brief Add a witness variable to the public return_data. | ||
* | ||
|
@@ -190,6 +200,17 @@ template <typename FF> class MegaCircuitBuilder_ : public UltraCircuitBuilder_<M | |
return read_bus_vector(BusId::CALLDATA, read_idx_witness_idx); | ||
}; | ||
|
||
/** | ||
* @brief Read from secondary_calldata and create a corresponding databus read gate | ||
* | ||
* @param read_idx_witness_idx Witness index for the secondary_calldata read index | ||
* @return uint32_t Witness index for the result of the read | ||
*/ | ||
uint32_t read_secondary_calldata(const uint32_t& read_idx_witness_idx) | ||
{ | ||
return read_bus_vector(BusId::SECONDARY_CALLDATA, read_idx_witness_idx); | ||
}; | ||
|
||
/** | ||
* @brief Read from return_data and create a corresponding databus read gate | ||
* | ||
|
@@ -207,6 +228,7 @@ template <typename FF> class MegaCircuitBuilder_ : public UltraCircuitBuilder_<M | |
} | ||
|
||
const BusVector& get_calldata() { return databus[static_cast<size_t>(BusId::CALLDATA)]; } | ||
const BusVector& get_secondary_calldata() { return databus[static_cast<size_t>(BusId::SECONDARY_CALLDATA)]; } | ||
const BusVector& get_return_data() { return databus[static_cast<size_t>(BusId::RETURNDATA)]; } | ||
|
||
void create_poseidon2_external_gate(const poseidon2_external_gate_<FF>& in); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's somehow strange to me in hindsight that we were using q_r rather than q_o for a return value but supposingly it was for optimisations purposes so we dont have yet another column, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this has nothing to do with the original purpose of the selector, its just a means for not having a new individual selector for each bus column. This is similar to what is done in the aux relation