Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::tracegen::DataCopyTraceBuilder Class Referencefinal

#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
 

Detailed Description

Definition at line 10 of file data_copy_trace.hpp.

Member Function Documentation

◆ process()

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.

Parameters
eventsThe events to process.
traceThe trace to populate.

Definition at line 45 of file data_copy_trace.cpp.

Member Data Documentation

◆ interactions

const InteractionDefinition bb::avm2::tracegen::DataCopyTraceBuilder::interactions
static
Initial value:
=
InteractionDefinition()
.add<lookup_data_copy_offset_plus_size_is_gt_data_size_settings, InteractionType::LookupGeneric>(Column::gt_sel)
.add<lookup_data_copy_check_dst_addr_in_range_settings, InteractionType::LookupGeneric>(Column::gt_sel)
Column::gt_sel)
lookup_settings< lookup_data_copy_col_read_settings_ > lookup_data_copy_col_read_settings
lookup_settings< lookup_data_copy_data_index_upper_bound_gt_offset_settings_ > lookup_data_copy_data_index_upper_bound_gt_offset_settings
lookup_settings< lookup_data_copy_check_src_addr_in_range_settings_ > lookup_data_copy_check_src_addr_in_range_settings

Definition at line 15 of file data_copy_trace.hpp.


The documentation for this class was generated from the following files: