Crate kona_common
source ·Expand description
§kona-common
This library offers utilities for developing verifiable client
executables that may run on top of Fault Proof Virtual
Machine targets.
- The
alloc_heap
macro allows for statically allocating a heap of a certain size, and allclient
programs will need to run it if they require heap allocation. Thealloc
crate can be used for programs targeting any FPVM, but is optional. - The
io
module provides a high-level safe interface over theread
,write
, andexit
syscalls on all available FPVM targets. While the FPVMs support a larger set of Linux syscalls, this crate looks to support the bare-minimum required forclient
programs to communicate back and forth with the host and exit properly. If a consumer of the library would like to extend the functionality of theClientIO
, an extension trait can be made for theClientIO
type in theio
module.
Modules§
- This module contains the ClientIO struct, which is used to perform various IO operations inside of the FPVM kernel within a
client
program. - This module contains an implementation of a basic memory allocator for client programs in running on top of various FPVMs. The allocator is a linked list allocator based on the
dlmalloc
algorithm, which is a well-known and widely used allocator software such as OS Kernels.
Macros§
- Initialize heap memory for the
client
program with the given size.
Enums§
- File descriptors available to the
client
within the FPVM kernel.
Traits§
- The BasicKernelInterface trait describes the functionality of several core system calls inside of the FPVM kernel. Commonly, FPVMs delegate IO operations to custom file descriptors in the
client
program. It is a safe wrapper around the raw system calls available to theclient
program.
Type Aliases§
- The size of the native target architecture’s registers.