Documentation ¶
Index ¶
- Constants
- func GetStateHashFn() mipsevm.HashFn
- type InstrumentedState
- func (m *InstrumentedState) CheckInfiniteLoop() bool
- func (m *InstrumentedState) GetDebugInfo() *mipsevm.DebugInfo
- func (m *InstrumentedState) GetState() mipsevm.FPVMState
- func (m *InstrumentedState) InitDebug() error
- func (m *InstrumentedState) LastPreimage() ([32]byte, []byte, Word)
- func (m *InstrumentedState) LookupSymbol(addr Word) string
- func (m *InstrumentedState) Step(proof bool) (wit *mipsevm.StepWitness, err error)
- func (m *InstrumentedState) Traceback()
- type State
- func (s *State) CreateVM(logger log.Logger, po mipsevm.PreimageOracle, stdOut, stdErr io.Writer, ...) mipsevm.FPVM
- func (s *State) Deserialize(in io.Reader) error
- func (s *State) EncodeWitness() ([]byte, common.Hash)
- func (s *State) GetCpu() mipsevm.CpuScalars
- func (s *State) GetExitCode() uint8
- func (s *State) GetExited() bool
- func (s *State) GetHeap() Word
- func (s *State) GetLastHint() hexutil.Bytes
- func (s *State) GetMemory() *memory.Memory
- func (s *State) GetPC() Word
- func (s *State) GetPreimageKey() common.Hash
- func (s *State) GetPreimageOffset() Word
- func (s *State) GetRegistersRef() *[32]Word
- func (s *State) GetStep() uint64
- func (s *State) MarshalJSON() ([]byte, error)
- func (s *State) Serialize(out io.Writer) error
- func (s *State) UnmarshalJSON(data []byte) error
- func (s *State) VMStatus() uint8
- type StateWitness
- type Word
Constants ¶
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 ¶
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 (*State) GetCpu ¶ added in v1.9.1
func (s *State) GetCpu() mipsevm.CpuScalars
func (*State) GetExitCode ¶
func (*State) GetLastHint ¶ added in v1.9.1
func (*State) GetPreimageKey ¶ added in v1.9.1
func (*State) GetPreimageOffset ¶ added in v1.9.1
func (*State) GetRegistersRef ¶ added in v1.9.1
func (*State) MarshalJSON ¶
func (*State) Serialize ¶ added in v1.9.3
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 ¶
type StateWitness ¶
type StateWitness []byte