Versions in this module Expand all Collapse all v0 v0.2.0 May 11, 2026 Changes in this version + const Addr0x80 + const Addr0xa0 + const AddrAbs + const AddrImm + const AddrInd + const AddrMem + const AddrXadd + const AluAdd + const AluAnd + const AluArsh + const AluDiv + const AluEnd + const AluHor + const AluLsh + const AluMod + const AluMov + const AluMul + const AluNeg + const AluOr + const AluRsh + const AluSdiv + const AluSub + const AluXor + const ClassAlu + const ClassAlu64 + const ClassJmp + const ClassLd + const ClassLdx + const ClassPqr + const ClassSt + const ClassStx + const DynamicStackFramesAlign + const EntrypointHash + const JumpAlways + const JumpCall + const JumpEq + const JumpExit + const JumpGe + const JumpGt + const JumpLe + const JumpLt + const JumpNe + const JumpSet + const JumpSge + const JumpSgt + const JumpSle + const JumpSlt + const MaxInsSize + const MinInsSize + const OpAdd32Imm + const OpAdd32Reg + const OpAdd64Imm + const OpAdd64Reg + const OpAnd32Imm + const OpAnd32Reg + const OpAnd64Imm + const OpAnd64Reg + const OpArsh32Imm + const OpArsh32Reg + const OpArsh64Imm + const OpArsh64Reg + const OpBe + const OpCall + const OpCallx + const OpDiv32Imm + const OpDiv32Reg + const OpDiv64Imm + const OpDiv64Reg + const OpExit + const OpHor64Imm + const OpJa + const OpJeqImm + const OpJeqReg + const OpJgeImm + const OpJgeReg + const OpJgtImm + const OpJgtReg + const OpJleImm + const OpJleReg + const OpJltImm + const OpJltReg + const OpJneImm + const OpJneReg + const OpJsetImm + const OpJsetReg + const OpJsgeImm + const OpJsgeReg + const OpJsgtImm + const OpJsgtReg + const OpJsleImm + const OpJsleReg + const OpJsltImm + const OpJsltReg + const OpLd1BReg + const OpLd2BReg + const OpLd4BReg + const OpLd8BReg + const OpLddw + const OpLdxb + const OpLdxdw + const OpLdxh + const OpLdxw + const OpLe + const OpLmul32Imm + const OpLmul32Reg + const OpLmul64Imm + const OpLmul64Reg + const OpLsh32Imm + const OpLsh32Reg + const OpLsh64Imm + const OpLsh64Reg + const OpMod32Imm + const OpMod32Reg + const OpMod64Imm + const OpMod64Reg + const OpMov32Imm + const OpMov32Reg + const OpMov64Imm + const OpMov64Reg + const OpMul32Imm + const OpMul32Reg + const OpMul64Imm + const OpMul64Reg + const OpNeg32 + const OpNeg64 + const OpOr32Imm + const OpOr32Reg + const OpOr64Imm + const OpOr64Reg + const OpRsh32Imm + const OpRsh32Reg + const OpRsh64Imm + const OpRsh64Reg + const OpSdiv32Imm + const OpSdiv32Reg + const OpSdiv64Imm + const OpSdiv64Reg + const OpShmul64Imm + const OpShmul64Reg + const OpSrem32Imm + const OpSrem32Reg + const OpSrem64Imm + const OpSrem64Reg + const OpSt1BImm + const OpSt1BReg + const OpSt2BImm + const OpSt2BReg + const OpSt4BImm + const OpSt4BReg + const OpSt8BImm + const OpSt8BReg + const OpStb + const OpStdw + const OpSth + const OpStw + const OpStxb + const OpStxdw + const OpStxh + const OpStxw + const OpSub32Imm + const OpSub32Reg + const OpSub64Imm + const OpSub64Reg + const OpUdiv32Imm + const OpUdiv32Reg + const OpUdiv64Imm + const OpUdiv64Reg + const OpUhmul64Imm + const OpUhmul64Reg + const OpUrem32Imm + const OpUrem32Reg + const OpUrem64Imm + const OpUrem64Reg + const OpXor32Imm + const OpXor32Reg + const OpXor64Imm + const OpXor64Reg + const PqrLmul + const PqrSdiv + const PqrShmul + const PqrSrem + const PqrUdiv + const PqrUhmul + const PqrUrem + const Size1B + const Size2B + const Size4B + const Size8B + const SizeB + const SizeDw + const SizeH + const SizeW + const SlotSize + const SrcK + const SrcX + const StackDepth + const StackFrameSize + const StackMax + const VaddrHeap + const VaddrInput + const VaddrProgram + const VaddrStack + var ExcCallDepth = errors.New("call depth exceeded") + var ExcDivideByZero = errors.New("divide by zero at BPF instruction") + var ExcDivideOverflow = errors.New("divide overflow") + var ExcExecutionOverrun = errors.New("attempted to execute past the end of the text segment") + var ExcInvalidInstr = errors.New("invalid instruction - feature not enabled") + var ExcOutOfCU = errors.New("compute unit overrun") + var ExcUnsupportedInstruction = errors.New("unsupported BPF instruction") + var GapMask = uint64(0xFFFFFFFFFFFFF000) + var UsePool = true + func IsLongIns(op uint8) bool + func PCHash(addr uint64) uint32 + func SymbolHash(s string) uint32 + type ExcBadAccess struct + Addr uint64 + Reason string + Size uint64 + Write bool + func NewExcBadAccess(addr uint64, size uint64, write bool, reason string) ExcBadAccess + func (e ExcBadAccess) Error() string + type ExcCallDest struct + Imm uint32 + func (e ExcCallDest) Error() string + type ExcSyscallError struct + Err error + func (e ExcSyscallError) Error() string + func (e ExcSyscallError) Unwrap() error + type Exception struct + Detail error + PC int64 + func (e *Exception) Error() string + func (e *Exception) Unwrap() error + type Frame struct + FramePtr uint64 + NVRegs [4]uint64 + RetAddr int64 + type Interpreter struct + func NewInterpreter(p *Program, opts *VMOpts) *Interpreter + func (ip *Interpreter) ComputeMeter() *cu.ComputeMeter + func (ip *Interpreter) DueInstrCount() uint64 + func (ip *Interpreter) Finish() + func (ip *Interpreter) GetOpcodeName(opc uint8) string + func (ip *Interpreter) HeapMax() uint64 + func (ip *Interpreter) HeapSize() uint64 + func (ip *Interpreter) PrevInstrMeter() uint64 + func (ip *Interpreter) Read(addr uint64, p []byte) error + func (ip *Interpreter) Read16(addr uint64) (uint16, error) + func (ip *Interpreter) Read32(addr uint64) (uint32, error) + func (ip *Interpreter) Read64(addr uint64) (uint64, error) + func (ip *Interpreter) Read8(addr uint64) (uint8, error) + func (ip *Interpreter) Run() (ret uint64, cuConsumed uint64, err error) + func (ip *Interpreter) SetPrevInstrMeter(num uint64) + func (ip *Interpreter) Translate(addr uint64, size uint64, write bool) ([]byte, error) + func (ip *Interpreter) UpdateHeapSize(size uint64) + func (ip *Interpreter) VMContext() any + func (ip *Interpreter) Write(addr uint64, p []byte) error + func (ip *Interpreter) Write16(addr uint64, x uint16) error + func (ip *Interpreter) Write32(addr uint64, x uint32) error + func (ip *Interpreter) Write64(addr uint64, x uint64) error + func (ip *Interpreter) Write8(addr uint64, x uint8) error + type Program struct + Entrypoint uint64 + Funcs map[uint32]int64 + RO []byte + SbpfVersion sbpfver.SbpfVersion + Text []Slot + TextVA uint64 + func (p *Program) Verify() error + type Slot uint64 + func (s Slot) Dst() uint8 + func (s Slot) Imm() int32 + func (s Slot) Off() int16 + func (s Slot) Op() uint8 + func (s Slot) Src() uint8 + func (s Slot) Uimm() uint32 + type Stack struct + func NewStack(sbpfVer sbpfver.SbpfVersion) Stack + func (s *Stack) Finish() + func (s *Stack) GetFrame(addr uint32) []byte + func (s *Stack) GetFramePtr() uint64 + func (s *Stack) Pop(regs []uint64) (int64, bool) + func (s *Stack) Push(regs []uint64, ret int64) bool + type Syscall interface + Invoke func(vm VM, r1, r2, r3, r4, r5 uint64) (r0 uint64, err error) + type SyscallFunc0 func(vm VM) (r0 uint64, err error) + func (f SyscallFunc0) Invoke(vm VM, _, _, _, _, _ uint64) (r0 uint64, err error) + type SyscallFunc1 func(vm VM, r1 uint64) (r0 uint64, err error) + func (f SyscallFunc1) Invoke(vm VM, r1, _, _, _, _ uint64) (r0 uint64, err error) + type SyscallFunc2 func(vm VM, r1, r2 uint64) (r0 uint64, err error) + func (f SyscallFunc2) Invoke(vm VM, r1, r2, _, _, _ uint64) (r0 uint64, err error) + type SyscallFunc3 func(vm VM, r1, r2, r3 uint64) (r0 uint64, err error) + func (f SyscallFunc3) Invoke(vm VM, r1, r2, r3, _, _ uint64) (r0 uint64, err error) + type SyscallFunc4 func(vm VM, r1, r2, r3, r4 uint64) (r0 uint64, err error) + func (f SyscallFunc4) Invoke(vm VM, r1, r2, r3, r4, _ uint64) (r0 uint64, err error) + type SyscallFunc5 func(vm VM, r1, r2, r3, r4, r5 uint64) (r0 uint64, err error) + func (f SyscallFunc5) Invoke(vm VM, r1, r2, r3, r4, r5 uint64) (r0 uint64, err error) + type SyscallRegistry func(uint32) (Syscall, bool) + func (s SyscallRegistry) ExistsByHash(hash uint32) bool + type TraceSink interface + Printf func(format string, v ...any) + type VM interface + ComputeMeter func() *cu.ComputeMeter + DueInstrCount func() uint64 + HeapMax func() uint64 + HeapSize func() uint64 + PrevInstrMeter func() uint64 + Read func(addr uint64, p []byte) error + Read16 func(addr uint64) (uint16, error) + Read32 func(addr uint64) (uint32, error) + Read64 func(addr uint64) (uint64, error) + Read8 func(addr uint64) (uint8, error) + SetPrevInstrMeter func(num uint64) + Translate func(addr uint64, size uint64, write bool) ([]byte, error) + UpdateHeapSize func(size uint64) + VMContext func() any + Write func(addr uint64, p []byte) error + Write16 func(addr uint64, x uint16) error + Write32 func(addr uint64, x uint32) error + Write64 func(addr uint64, x uint64) error + Write8 func(addr uint64, x uint8) error + type VMOpts struct + ComputeMeter *cu.ComputeMeter + Context any + EnableTracing bool + HeapMax int + Input []byte + InputDataVaddr uint64 + MaxCU int + ProgramId solana.PublicKey + Syscalls SyscallRegistry + Tracer TraceSink + TxSignature solana.Signature + type Verifier struct + Program *Program + func NewVerifier(p *Program) *Verifier + func (v *Verifier) VerifyProgram() error v0.1.0-alpha.1 Jan 15, 2026