forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathiface.go
39 lines (27 loc) · 1.07 KB
/
iface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package mipsevm
import "github.com/ethereum/go-ethereum/common"
type FPVMState interface {
GetMemory() *Memory
// GetPC returns the currently executing program counter
GetPC() uint32
// GetStep returns the current VM step
GetStep() uint64
// GetExited returns whether the state exited bit is set
GetExited() bool
// GetExitCode returns the exit code
GetExitCode() uint8
// EncodeWitness returns the witness for the current state and the state hash
EncodeWitness() (witness []byte, hash common.Hash)
}
type FPVM interface {
// GetState returns the current state of the VM. The FPVMState is updated by successive calls to Step
GetState() FPVMState
// Step executes a single instruction and returns the witness for the step
Step(includeProof bool) (*StepWitness, error)
// LastPreimage returns the last preimage accessed by the VM
LastPreimage() (preimageKey [32]byte, preimage []byte, preimageOffset uint32)
// Traceback prints a traceback of the program to the console
Traceback()
// GetDebugInfo returns debug information about the VM
GetDebugInfo() *DebugInfo
}