vm

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SnapsDir     = "snapshots"
	PreimagesDir = "preimages"
	FinalState   = "final.json.gz"
)

Variables

This section is empty.

Functions

func FindStartingSnapshot

func FindStartingSnapshot(logger log.Logger, snapDir string, absolutePreState string, traceIndex uint64) (string, error)

FindStartingSnapshot finds the closest snapshot before the specified traceIndex in snapDir. If no suitable snapshot can be found it returns absolutePreState.

func PreimageDir

func PreimageDir(dir string) string

func RunCmd

func RunCmd(ctx context.Context, l log.Logger, binary string, args ...string) error

Types

type CmdExecutor

type CmdExecutor func(ctx context.Context, l log.Logger, binary string, args ...string) error

type Config

type Config struct {
	// VM Configuration
	VmType       types.TraceType
	VmBin        string // Path to the vm executable to run when generating trace data
	SnapshotFreq uint   // Frequency of snapshots to create when executing (in VM instructions)
	InfoFreq     uint   // Frequency of progress log messages (in VM instructions)
	DebugInfo    bool

	// Host Configuration
	L1               string
	L1Beacon         string
	L2               string
	Server           string // Path to the executable that provides the pre-image oracle server
	Network          string
	RollupConfigPath string
	L2GenesisPath    string
}

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(logger log.Logger, m Metricer, cfg Config, oracleServer OracleServerExecutor, prestate string, inputs utils.LocalGameInputs) *Executor

func (*Executor) DoGenerateProof

func (e *Executor) DoGenerateProof(ctx context.Context, dir string, begin uint64, end uint64, extraVmArgs ...string) error

DoGenerateProof executes vm from the specified starting trace index until the end trace index. The proof is stored at the specified directory.

func (*Executor) GenerateProof

func (e *Executor) GenerateProof(ctx context.Context, dir string, i uint64) error

GenerateProof executes vm to generate a proof at the specified trace index. The proof is stored at the specified directory.

type KonaServerExecutor added in v1.9.1

type KonaServerExecutor struct {
}

func NewKonaServerExecutor added in v1.9.1

func NewKonaServerExecutor() *KonaServerExecutor

func (*KonaServerExecutor) OracleCommand added in v1.9.1

func (s *KonaServerExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error)

type Metricer

type Metricer interface {
	RecordVmExecutionTime(vmType string, t time.Duration)
	RecordVmMemoryUsed(vmType string, memoryUsed uint64)
}

type OpProgramServerExecutor added in v1.9.1

type OpProgramServerExecutor struct {
}

func NewOpProgramServerExecutor added in v1.9.1

func NewOpProgramServerExecutor() *OpProgramServerExecutor

func (*OpProgramServerExecutor) OracleCommand added in v1.9.1

func (s *OpProgramServerExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error)

type OracleServerExecutor added in v1.9.0

type OracleServerExecutor interface {
	OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error)
}

type SnapshotSelect

type SnapshotSelect func(logger log.Logger, dir string, absolutePreState string, i uint64) (string, error)

Jump to

Keyboard shortcuts

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