Documentation ¶
Index ¶
- Constants
- Variables
- func MemOpConsume(cuIn int, n uint64) int
- func SyscallAbortImpl(_ sbpf.VM, _ int) (r0 uint64, cuOut int, err error)
- func SyscallLog64Impl(vm sbpf.VM, r1, r2, r3, r4, r5 uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallLogCUsImpl(vm sbpf.VM, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallLogImpl(vm sbpf.VM, ptr, strlen uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallLogPubkeyImpl(vm sbpf.VM, pubkeyAddr uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallMemcmpImpl(vm sbpf.VM, addr1, addr2, n, resultAddr uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallMemcpyImpl(vm sbpf.VM, dst, src, n uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func SyscallMemmoveImpl(vm sbpf.VM, dst, src, n uint64, cuIn int) (r0 uint64, cuOut int, err error)
- func Syscalls() sbpf.SyscallRegistry
- type AccountParam
- type Execution
- type LogRecorder
- type Logger
- type Params
- type TxContext
Constants ¶
View Source
const ( CUSyscallBaseCost = 100 CUMemOpBaseCost = 10 CuCpiBytesPerUnit = 250 )
View Source
const ReallocAlign = 8
ReallocAlign is the byte amount by which the data following a realloc is aligned.
View Source
const ReallocSpace = 1024 * 10
ReallocSpace is the allowed length by which an account is allowed to grow.
Variables ¶
View Source
var (
ErrCopyOverlapping = errors.New("Overlapping copy")
)
View Source
var SyscallAbort = sbpf.SyscallFunc0(SyscallAbortImpl)
View Source
var SyscallLog = sbpf.SyscallFunc2(SyscallLogImpl)
View Source
var SyscallLog64 = sbpf.SyscallFunc5(SyscallLog64Impl)
View Source
var SyscallLogCUs = sbpf.SyscallFunc0(SyscallLogCUsImpl)
View Source
var SyscallLogPubkey = sbpf.SyscallFunc1(SyscallLogPubkeyImpl)
View Source
var SyscallMemcmp = sbpf.SyscallFunc4(SyscallMemcmpImpl)
View Source
var SyscallMemcpy = sbpf.SyscallFunc3(SyscallMemcpyImpl)
View Source
var SyscallMemmove = sbpf.SyscallFunc3(SyscallMemmoveImpl)
Functions ¶
func MemOpConsume ¶
func SyscallLog64Impl ¶
func SyscallLogCUsImpl ¶
func SyscallLogImpl ¶
func SyscallLogPubkeyImpl ¶
func SyscallMemcmpImpl ¶
func SyscallMemcmpImpl(vm sbpf.VM, addr1, addr2, n, resultAddr uint64, cuIn int) (r0 uint64, cuOut int, err error)
SyscallMemcmpImpl is the implementation for the memcmp (sol_memcmp_) syscall.
func SyscallMemcpyImpl ¶
SyscallMemcpyImpl is the implementation of the memcpy (sol_memcpy_) syscall. Overlapping src and dst for a given n bytes to be copied results in an error being returned.
func SyscallMemmoveImpl ¶
SyscallMemmoveImpl is the implementation for the memmove (sol_memmove_) syscall.
func Syscalls ¶
func Syscalls() sbpf.SyscallRegistry
Syscalls creates a registry of all Sealevel syscalls.
Types ¶
type AccountParam ¶
type AccountParam struct { IsDuplicate bool DuplicateIndex uint8 // must not be 0xFF IsSigner bool IsWritable bool IsExecutable bool Key solana.PublicKey Owner solana.PublicKey Lamports uint64 Data []byte Padding int // ignored, written by serializer RentEpoch uint64 }
AccountParam is an account input to a program execution.
type LogRecorder ¶
type LogRecorder struct {
Logs []string
}
func (*LogRecorder) Log ¶
func (r *LogRecorder) Log(s string)
Click to show internal directories.
Click to hide internal directories.