thresholdvm

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package thresholdvm re-exports the canonical Threshold (FHE / MPC) VM from github.com/luxfi/chains/thresholdvm so existing callers that imported github.com/luxfi/node/vms/thresholdvm pre-extraction keep working without source changes.

New code should import the canonical path:

"github.com/luxfi/chains/thresholdvm"

This file is a thin alias wrapper kept for backward compatibility.

Index

Constants

View Source
const (
	GPUBackendNone   = thresholdvm.GPUBackendNone
	GPUBackendCUDA   = thresholdvm.GPUBackendCUDA
	GPUBackendHIP    = thresholdvm.GPUBackendHIP
	GPUBackendMetal  = thresholdvm.GPUBackendMetal
	GPUBackendVulkan = thresholdvm.GPUBackendVulkan
	GPUBackendWebGPU = thresholdvm.GPUBackendWebGPU
)

Backend constants re-exported. Matches the chains/thresholdvm dlopen probe order: cuda → hip → metal → vulkan → webgpu.

Variables

View Source
var (
	ErrInvalidOperation = thresholdvm.ErrInvalidOperation
	NewClient           = thresholdvm.NewClient
)
View Source
var ErrGPUNotAvailable = thresholdvm.ErrGPUNotAvailable

ErrGPUNotAvailable is the canonical "no plugin loaded" error. Callers `errors.Is(err, thresholdvm.ErrGPUNotAvailable)` to distinguish a fallback-to-CPU condition from a hard launcher failure.

Functions

This section is empty.

Types

type Block

type Block = thresholdvm.Block

type BlockError

type BlockError = thresholdvm.BlockError

type Client

type Client = thresholdvm.Client

type GPUBackend added in v1.29.0

type GPUBackend = thresholdvm.GPUBackend

func GPUBackendInstance added in v1.29.0

func GPUBackendInstance() *GPUBackend

GPUBackendInstance returns the dlopen'd GPU plugin handle resolved at chains/thresholdvm package init. nil means no plugin was loaded (CPU-only mode). The handle is shared across the whole process — both the node and chains paths see the same instance.

The name is GPUBackendInstance (not GPUBackend / Backend) because Go disallows a function named the same as a type alias in the same package, and `Backend` is already a domain term in the threshold state machine. Callers write:

if g := thresholdvm.GPUBackendInstance(); g != nil && g.IsAvailable() {
    _, err := g.CeremonyApply(desc, ops, ceremonies)
    ...
}

This mirrors the cevm pattern `cevm.AvailableBackends()` / `cevm.LibraryABIVersion()` — discovery via package-scope function, not via a global variable.

func SelectGPUBackend added in v1.29.0

func SelectGPUBackend() (*GPUBackend, string)

SelectGPUBackend returns the resolved GPU plugin (or nil) and a single human-readable diagnostic string. luxd startup logs use this to surface "thresholdvm-gpu backend=<name>" lines alongside the cevm backend selection, matching the cevm.go pattern at ~/work/lux/chains/evm/backend_cgo.go.

Calling this multiple times is cheap — the underlying probe runs once at package init via sync.Once in chains/thresholdvm/backend.go.

type GPUBackendKind added in v1.29.0

type GPUBackendKind = thresholdvm.GPUBackendKind

type GPUCeremony added in v1.29.0

type GPUCeremony = thresholdvm.GPUCeremony

type GPUCeremonyOp added in v1.29.0

type GPUCeremonyOp = thresholdvm.GPUCeremonyOp

type GPUContribution added in v1.29.0

type GPUContribution = thresholdvm.GPUContribution

type GPUContributionOp added in v1.29.0

type GPUContributionOp = thresholdvm.GPUContributionOp

type GPUKeyShare added in v1.29.0

type GPUKeyShare = thresholdvm.GPUKeyShare

type GPUMPCVMRoundDescriptor added in v1.29.0

type GPUMPCVMRoundDescriptor = thresholdvm.GPUMPCVMRoundDescriptor

type GPUMPCVMState added in v1.29.0

type GPUMPCVMState = thresholdvm.GPUMPCVMState

type GPUMPCVMTransitionResult added in v1.29.0

type GPUMPCVMTransitionResult = thresholdvm.GPUMPCVMTransitionResult

type Operation

type Operation = thresholdvm.Operation

Jump to

Keyboard shortcuts

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