cmd

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT, MIT Imports: 30 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LoadELFVMTypeFlag = &cli.StringFlag{
		Name:     "type",
		Usage:    "VM type to create state for. Valid options: " + openum.EnumString(versions.GetStateVersionStrings()),
		Required: true,
	}
	LoadELFPathFlag = &cli.PathFlag{
		Name:      "path",
		Usage:     "Path to 32/64-bit big-endian MIPS ELF file",
		TakesFile: true,
		Required:  true,
	}
	LoadELFOutFlag = &cli.PathFlag{
		Name:     "out",
		Usage:    "Output path to write state to. State is dumped to stdout if set to '-'. Not written if empty. Use file extension '.bin', '.bin.gz', or '.json' for binary, compressed binary, or JSON formats.",
		Value:    "state.bin.gz",
		Required: false,
	}
	LoadELFMetaFlag = &cli.PathFlag{
		Name:     "meta",
		Usage:    "Write metadata file, for symbol lookup during program execution. None if empty.",
		Value:    "meta.json",
		Required: false,
	}
)
View Source
var (
	RunInputFlag = &cli.PathFlag{
		Name:      "input",
		Usage:     "path of input binary state. Stdin if left empty.",
		TakesFile: true,
		Value:     "state.bin.gz",
		Required:  true,
	}
	RunOutputFlag = &cli.PathFlag{
		Name:      "output",
		Usage:     "path of output binary state. Not written if empty, use - to write to Stdout.",
		TakesFile: true,
		Value:     "out.bin.gz",
		Required:  false,
	}

	RunProofAtFlag = &cli.GenericFlag{
		Name:     "proof-at",
		Usage:    "step pattern to output proof at: " + patternHelp,
		Value:    new(StepMatcherFlag),
		Required: false,
	}
	RunProofFmtFlag = &cli.StringFlag{
		Name:     "proof-fmt",
		Usage:    "format for proof data output file names. Proof data is written to stdout if -.",
		Value:    "proof-%d.json",
		Required: false,
	}
	RunSnapshotAtFlag = &cli.GenericFlag{
		Name:     "snapshot-at",
		Usage:    "step pattern to output snapshots at: " + patternHelp,
		Value:    new(StepMatcherFlag),
		Required: false,
	}
	RunSnapshotFmtFlag = &cli.StringFlag{
		Name:     "snapshot-fmt",
		Usage:    "format for snapshot output file names.",
		Value:    "state-%d.bin.gz",
		Required: false,
	}
	RunStopAtFlag = &cli.GenericFlag{
		Name:     "stop-at",
		Usage:    "step pattern to stop at: " + patternHelp,
		Value:    new(StepMatcherFlag),
		Required: false,
	}
	RunStopAtPreimageFlag = &cli.StringFlag{
		Name:     "stop-at-preimage",
		Usage:    "stop at the first preimage request matching this key. Format: <key-prefix>@<offset>@<step>",
		Required: false,
	}
	RunStopAtPreimageTypeFlag = &cli.StringFlag{
		Name:     "stop-at-preimage-type",
		Usage:    "stop at the first preimage request matching this type",
		Required: false,
	}
	RunStopAtPreimageLargerThanFlag = &cli.IntFlag{
		Name:     "stop-at-preimage-larger-than",
		Usage:    "stop at the first step that requests a preimage larger than the specified size (in bytes)",
		Required: false,
	}
	RunMetaFlag = &cli.PathFlag{
		Name:     "meta",
		Usage:    "path to metadata file for symbol lookup for enhanced debugging info during execution.",
		Value:    "meta.json",
		Required: false,
	}
	RunInfoAtFlag = &cli.GenericFlag{
		Name:     "info-at",
		Usage:    "step pattern to print info at: " + patternHelp,
		Value:    MustStepMatcherFlag("%1000000000"),
		Required: false,
	}
	RunPProfCPU = &cli.BoolFlag{
		Name:  "pprof.cpu",
		Usage: "enable pprof cpu profiling",
	}
	RunDebugFlag = &cli.BoolFlag{
		Name:  "debug",
		Usage: "enable debug mode, which includes stack traces and other debug info in the output. Requires --meta.",
	}
	RunDebugInfoFlag = &cli.PathFlag{
		Name:      "debug-info",
		Usage:     "path to write debug info to",
		TakesFile: true,
		Required:  false,
	}

	OutFilePerm = os.FileMode(0o755)
)
View Source
var (
	WitnessInputFlag = &cli.PathFlag{
		Name:      "input",
		Usage:     "path of input JSON state.",
		TakesFile: true,
		Required:  true,
	}
	WitnessOutputFlag = &cli.PathFlag{
		Name:      "output",
		Usage:     "path to write binary witness.",
		TakesFile: true,
	}
)
View Source
var LoadELFCommand = CreateLoadELFCommand(LoadELF)
View Source
var RunCommand = CreateRunCommand(Run)
View Source
var WitnessCommand = CreateWitnessCommand(Witness)

Functions

func CreateLoadELFCommand

func CreateLoadELFCommand(action cli.ActionFunc) *cli.Command

func CreateRunCommand

func CreateRunCommand(action cli.ActionFunc) *cli.Command

func CreateWitnessCommand

func CreateWitnessCommand(action cli.ActionFunc) *cli.Command

func LoadELF

func LoadELF(ctx *cli.Context) error

func Logger

func Logger(w io.Writer, lvl slog.Level) log.Logger

func Run

func Run(ctx *cli.Context) error

func Witness

func Witness(ctx *cli.Context) error

Types

type ProcessPreimageOracle

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

func NewProcessPreimageOracle

func NewProcessPreimageOracle(logger log.Logger, name string, args []string, stdout log.Logger, stderr log.Logger) (*ProcessPreimageOracle, error)

func (*ProcessPreimageOracle) Close

func (p *ProcessPreimageOracle) Close() error

func (*ProcessPreimageOracle) GetPreimage

func (p *ProcessPreimageOracle) GetPreimage(k [32]byte) []byte

func (*ProcessPreimageOracle) Hint

func (p *ProcessPreimageOracle) Hint(v []byte)

func (*ProcessPreimageOracle) Start

func (p *ProcessPreimageOracle) Start() error

type Proof

type Proof struct {
	Step uint64 `json:"step"`

	Pre  common.Hash `json:"pre"`
	Post common.Hash `json:"post"`

	StateData hexutil.Bytes `json:"state-data"`
	ProofData hexutil.Bytes `json:"proof-data"`

	OracleKey    hexutil.Bytes `json:"oracle-key,omitempty"`
	OracleValue  hexutil.Bytes `json:"oracle-value,omitempty"`
	OracleOffset arch.Word     `json:"oracle-offset,omitempty"`
}

type StepFn

type StepFn func(proof bool) (*mipsevm.StepWitness, error)

func Guard

func Guard(proc *os.ProcessState, fn StepFn) StepFn

type StepMatcher

type StepMatcher func(st VMState) bool

type StepMatcherFlag

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

func MustStepMatcherFlag

func MustStepMatcherFlag(pattern string) *StepMatcherFlag

func (*StepMatcherFlag) Clone

func (m *StepMatcherFlag) Clone() any

func (*StepMatcherFlag) Matcher

func (m *StepMatcherFlag) Matcher() StepMatcher

func (*StepMatcherFlag) Set

func (m *StepMatcherFlag) Set(value string) error

func (*StepMatcherFlag) String

func (m *StepMatcherFlag) String() string

type VMState

type VMState interface {
	GetStep() uint64
}

Jump to

Keyboard shortcuts

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