sealevel

package
v0.0.0-...-3423c7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CUSyscallBaseCost = 100
)
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

Functions

func SyscallAbortImpl

func SyscallAbortImpl(_ sbf.VM, _ int) (r0 uint64, cuOut int, err error)

func SyscallLog64Impl

func SyscallLog64Impl(vm sbf.VM, r1, r2, r3, r4, r5 uint64, cuIn int) (r0 uint64, cuOut int, err error)

func SyscallLogCUsImpl

func SyscallLogCUsImpl(vm sbf.VM, cuIn int) (r0 uint64, cuOut int, err error)

func SyscallLogImpl

func SyscallLogImpl(vm sbf.VM, ptr, strlen uint64, cuIn int) (r0 uint64, cuOut int, err error)

func SyscallLogPubkeyImpl

func SyscallLogPubkeyImpl(vm sbf.VM, pubkeyAddr uint64, cuIn int) (r0 uint64, cuOut int, err error)

func Syscalls

func Syscalls() sbf.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 Execution

type Execution struct {
	Log Logger
}

type LogRecorder

type LogRecorder struct {
	Logs []string
}

func (*LogRecorder) Log

func (r *LogRecorder) Log(s string)

type Logger

type Logger interface {
	Log(s string)
}

type Params

type Params struct {
	Accounts  []AccountParam
	Data      []byte // per-instruction data
	ProgramID solana.PublicKey
}

Params is the data passed to programs via the Sealevel VM input segment.

func (*Params) Serialize

func (p *Params) Serialize(buf *bytes.Buffer)

Serialize writes the params to the provided buffer.

func (*Params) Update

func (p *Params) Update(buf *bytes.Reader) error

Update writes data modified by a program back to the params struct.

type TxContext

type TxContext struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL