singlethreaded

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const STATE_WITNESS_SIZE = 226

STATE_WITNESS_SIZE is the size of the state witness encoding in bytes. ignoring 64-bit STATE_WITNESS_SIZE as it's not supported for singlethreaded

Variables

This section is empty.

Functions

func GetStateHashFn

func GetStateHashFn() mipsevm.HashFn

Types

type InstrumentedState

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

func NewInstrumentedState

func NewInstrumentedState(state *State, po mipsevm.PreimageOracle, stdOut, stdErr io.Writer, meta mipsevm.Metadata) *InstrumentedState

func (*InstrumentedState) CheckInfiniteLoop

func (m *InstrumentedState) CheckInfiniteLoop() bool

func (*InstrumentedState) GetDebugInfo

func (m *InstrumentedState) GetDebugInfo() *mipsevm.DebugInfo

func (*InstrumentedState) GetState

func (m *InstrumentedState) GetState() mipsevm.FPVMState

func (*InstrumentedState) InitDebug

func (m *InstrumentedState) InitDebug() error

func (*InstrumentedState) LastPreimage

func (m *InstrumentedState) LastPreimage() ([32]byte, []byte, Word)

func (*InstrumentedState) LookupSymbol added in v1.9.1

func (m *InstrumentedState) LookupSymbol(addr Word) string

func (*InstrumentedState) Step

func (m *InstrumentedState) Step(proof bool) (wit *mipsevm.StepWitness, err error)

func (*InstrumentedState) Traceback

func (m *InstrumentedState) Traceback()

type State

type State struct {
	Memory *memory.Memory `json:"memory"`

	PreimageKey    common.Hash `json:"preimageKey"`
	PreimageOffset Word        `json:"preimageOffset"` // note that the offset includes the 8-byte length prefix

	Cpu mipsevm.CpuScalars `json:"cpu"`

	Heap Word `json:"heap"` // to handle mmap growth

	ExitCode uint8 `json:"exit"`
	Exited   bool  `json:"exited"`

	Step uint64 `json:"step"`

	Registers [32]Word `json:"registers"`

	// LastHint is optional metadata, and not part of the VM state itself.
	LastHint hexutil.Bytes `json:"lastHint,omitempty"`
}

func CreateEmptyState

func CreateEmptyState() *State

func CreateInitialState

func CreateInitialState(pc, heapStart Word) *State

func (*State) CreateVM added in v1.9.3

func (s *State) CreateVM(logger log.Logger, po mipsevm.PreimageOracle, stdOut, stdErr io.Writer, meta mipsevm.Metadata) mipsevm.FPVM

func (*State) Deserialize added in v1.9.3

func (s *State) Deserialize(in io.Reader) error

func (*State) EncodeWitness

func (s *State) EncodeWitness() ([]byte, common.Hash)

func (*State) GetCpu added in v1.9.1

func (s *State) GetCpu() mipsevm.CpuScalars

func (*State) GetExitCode

func (s *State) GetExitCode() uint8

func (*State) GetExited

func (s *State) GetExited() bool

func (*State) GetHeap added in v1.9.1

func (s *State) GetHeap() Word

func (*State) GetLastHint added in v1.9.1

func (s *State) GetLastHint() hexutil.Bytes

func (*State) GetMemory

func (s *State) GetMemory() *memory.Memory

func (*State) GetPC

func (s *State) GetPC() Word

func (*State) GetPreimageKey added in v1.9.1

func (s *State) GetPreimageKey() common.Hash

func (*State) GetPreimageOffset added in v1.9.1

func (s *State) GetPreimageOffset() Word

func (*State) GetRegistersRef added in v1.9.1

func (s *State) GetRegistersRef() *[32]Word

func (*State) GetStep

func (s *State) GetStep() uint64

func (*State) MarshalJSON

func (s *State) MarshalJSON() ([]byte, error)

func (*State) Serialize added in v1.9.3

func (s *State) Serialize(out io.Writer) error

Serialize writes the state in a simple binary format which can be read again using Deserialize The format is a simple concatenation of fields, with prefixed item count for repeating items and using big endian encoding for numbers.

StateVersion uint8(0) Memory As per Memory.Serialize PreimageKey [32]byte PreimageOffset Word Cpu.PC Word Cpu.NextPC Word Cpu.LO Word Cpu.HI Word Heap Word ExitCode uint8 Exited uint8 - 0 for false, 1 for true Step uint64 Registers [32]Word len(LastHint) Word (0 when LastHint is nil) LastHint []byte

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) error

func (*State) VMStatus

func (s *State) VMStatus() uint8

type StateWitness

type StateWitness []byte

func (StateWitness) StateHash

func (sw StateWitness) StateHash() (common.Hash, error)

type Word added in v1.9.4

type Word = arch.Word

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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