|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <data_copy_trace.hpp>
Public Member Functions | |
| void | process (const simulation::EventEmitterInterface< simulation::DataCopyEvent >::Container &events, TraceContainer &trace) |
| Builds the data copy trace. | |
Static Public Attributes | |
| static const InteractionDefinition | interactions |
Definition at line 10 of file data_copy_trace.hpp.
| void bb::avm2::tracegen::DataCopyTraceBuilder::process | ( | const simulation::EventEmitterInterface< simulation::DataCopyEvent >::Container & | events, |
| TraceContainer & | trace | ||
| ) |
Builds the data copy trace.
This trace handles CALLDATACOPY and RETURNDATACOPY (both enqueued and nested) events. The enum DataCopyOperation is used to distinguish between the two operations and is set in the field operation of the DataCopyEvent.
Memory I/O, this subtrace can potentially read and write across two different memory space ids (indicated by the context_ids). All memory reads are performed in the src context (using the src_context_id) and writes are performed in the current executing context (using dst_context_id). For an enqueued call, we do not read from memory as there is no parent context but read from the calldata column.
Error Handling: There is one class of errors that is checked: memory out of range accesses for reads and writes. Both are part of the same temporality group and therefore are checked simultaneously. If an error occurs, we populate a single row with the error flag set.
Writing Data: If the copy size is zero, we do not read or write any data. If the copy size is non-zero, we read and write the data to the current context. For each read/write, we populate one row in the trace.
Padding Data: If we read past the end of the data, we populate a padding row (value = 0).
Precondition: If there is no error, the field copying_data is a vector of size copy_size.
| events | The events to process. |
| trace | The trace to populate. |
Definition at line 45 of file data_copy_trace.cpp.
|
static |
Definition at line 15 of file data_copy_trace.hpp.