|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Class for managing propagation of databus return data commitments used in consistency checks. More...
#include <databus.hpp>
Public Types | |
| using | Curve = stdlib::bn254< Builder > |
| using | Commitment = typename Curve::Group |
| using | CommitmentNative = typename Curve::AffineElementNative |
| using | FrNative = typename Curve::ScalarFieldNative |
Public Member Functions | |
| void | set_kernel_return_data_commitment (const Commitment &commitment) |
| bool | app_return_data_slots_are_empty () const |
| Whether all app return-data slots are currently empty. | |
| void | set_app_return_data_commitment (const Commitment &commitment) |
| Record an app return-data commitment in the next available slot. | |
| Commitment | get_kernel_return_data_commitment (Builder &builder) |
| Get the previously set kernel return data commitment if it exists, else a default one. | |
| Commitment | get_app_return_data_commitment (Builder &builder, const size_t idx) |
| Get the previously set app return data commitment if it exists, else a default one. | |
Static Public Member Functions | |
| static Commitment | construct_default_commitment (Builder &builder) |
| Construct a default commitment for the databus return data. | |
Public Attributes | |
| std::array< Commitment, MAX_APPS_PER_KERNEL > | app_return_data_commitments |
| Commitment | kernel_return_data_commitment |
| std::array< bool, MAX_APPS_PER_KERNEL > | app_return_data_commitment_exists |
| bool | kernel_return_data_commitment_exists = false |
Class for managing propagation of databus return data commitments used in consistency checks.
The databus consistency checks establish the transfer of data between two circuits (i-1 and i) in a third circuit (i+1) via commitment equality checks of the form [R_{i-1}] = [C_i], where R and C represent return data and calldata, respectively. In practice, circuit (i+1) is given access to [R_{i-1}] via the public inputs of \pi_i, and it has access to [C_i] directly from \pi_i. The consistency checks in circuit (i+1) are thus of the form \pi_i.public_inputs.[R_{i-1}] = \pi_i.[C_i].
For consistent behavior across kernels, every kernel propagates MAX_APPS_PER_KERNEL + 1 return-data commitments via its public inputs: one for the previous kernel and one per app slot. If any of these does not exist (e.g., the first kernel has no previous kernel; a kernel with fewer than MAX apps leaves the trailing app slots unset), it is populated with a default commitment value that will satisfy the consistency check on the next cycle. The "empty" calldata column on the next kernel side will commit to the same default value, so the commitments agree and the consistency check passes trivially.
| Builder |
Definition at line 93 of file databus.hpp.
| using bb::stdlib::DataBusDepot< Builder >::Commitment = typename Curve::Group |
Definition at line 96 of file databus.hpp.
| using bb::stdlib::DataBusDepot< Builder >::CommitmentNative = typename Curve::AffineElementNative |
Definition at line 97 of file databus.hpp.
| using bb::stdlib::DataBusDepot< Builder >::Curve = stdlib::bn254<Builder> |
Definition at line 95 of file databus.hpp.
| using bb::stdlib::DataBusDepot< Builder >::FrNative = typename Curve::ScalarFieldNative |
Definition at line 98 of file databus.hpp.
|
inline |
Whether all app return-data slots are currently empty.
Used to assert the kernel-boundary invariant: at the start of each kernel completion, every slot must have been drained by the prior kernel's get-loop so that set_app_return_data_commitment begins filling from slot 0.
Definition at line 124 of file databus.hpp.
|
inlinestatic |
Construct a default commitment for the databus return data.
Returns the point at infinity. This matches the commitment to a databus column containing only zero-valued entries (DEFAULT_VALUE = 0), regardless of the polynomial offset used for disabled rows.
Definition at line 158 of file databus.hpp.
|
inline |
Get the previously set app return data commitment if it exists, else a default one.
Definition at line 182 of file databus.hpp.
|
inline |
Get the previously set kernel return data commitment if it exists, else a default one.
Definition at line 169 of file databus.hpp.
|
inline |
Record an app return-data commitment in the next available slot.
Slot assignment is implicit: the depot fills slot 0 first, then slot 1, etc., as apps are processed in the kernel's verification queue. Slots are released by get_app_return_data_commitment; each kernel-completion pass drains every slot via the get-loop in Chonk::complete_kernel_circuit_logic, so the next kernel begins filling from slot 0 again.
Definition at line 141 of file databus.hpp.
|
inline |
Definition at line 112 of file databus.hpp.
| std::array<bool, MAX_APPS_PER_KERNEL> bb::stdlib::DataBusDepot< Builder >::app_return_data_commitment_exists |
Definition at line 105 of file databus.hpp.
| std::array<Commitment, MAX_APPS_PER_KERNEL> bb::stdlib::DataBusDepot< Builder >::app_return_data_commitments |
Definition at line 101 of file databus.hpp.
| Commitment bb::stdlib::DataBusDepot< Builder >::kernel_return_data_commitment |
Definition at line 102 of file databus.hpp.
| bool bb::stdlib::DataBusDepot< Builder >::kernel_return_data_commitment_exists = false |
Definition at line 110 of file databus.hpp.