#include <data_copy.hpp>
|
| uint64_t | min (uint64_t a, uint64_t b) |
| |
Definition at line 15 of file data_copy.hpp.
◆ DataCopy()
◆ cd_copy()
Writes calldata into dst_addr. There is slight difference in how enqueued and nested contexts are handled, this is mostly encapsulated in context.get_calldata()
Notes on DataCopy: The simulation for DataCopy has a lot of subtle complexity due to the requirements of the circuit constraints. The main complexity comes from the need to have the following 32-bit range checks (1) Computing read_index_upper_bound via min, which is used to determine the final index in the cd/rd to read up to. (2) Clamping reads at the memory boundary when src_addr + read_index_upper_bound exceeds AVM_MEMORY_SIZE. (3) Checking that writes are within bounds of the memory (only dst out of range is an error). (4) Checking whether the offset exceeds the clamped read index upper bound to determine the actual number of elements from calldata/returndata to read (i.e. from [offset, clamped]).
- Parameters
-
| copy_size | The size of calldata to copy (u32). |
| offset | The offset in calldata to start copying from (u32). |
| dst_addr | The address in memory to write the calldata to. |
- Exceptions
-
Implements bb::avm2::simulation::DataCopyInterface.
Definition at line 101 of file data_copy.cpp.
◆ min()
| uint64_t bb::avm2::simulation::DataCopy::min |
( |
uint64_t |
a, |
|
|
uint64_t |
b |
|
) |
| |
|
private |
◆ rd_copy()
Copies returndata from the last executed context to the dst_addr.
- Parameters
-
| copy_size | The size of returndata to copy (u32). |
| offset | The offset in returndata to start copying from (u32). |
| dst_addr | The address in memory to write the returndata to. |
- Exceptions
-
Implements bb::avm2::simulation::DataCopyInterface.
Definition at line 155 of file data_copy.cpp.
◆ events
◆ execution_id_manager
◆ gt
The documentation for this class was generated from the following files: