Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type StateVersion ¶
type StateVersion uint8
const ( // VersionSingleThreaded is the version of the Cannon STF found in op-contracts/v1.6.0 - https://github.com/ethereum-optimism/optimism/blob/op-contracts/v1.6.0/packages/contracts-bedrock/src/cannon/MIPS.sol VersionSingleThreaded StateVersion = iota // VersionMultiThreaded is the original implementation of 32-bit multithreaded cannon, tagged at cannon/v1.3.0 VersionMultiThreaded // VersionSingleThreaded2 is based on VersionSingleThreaded with the addition of support for fcntl(F_GETFD) syscall // This is the latest 32-bit single-threaded vm VersionSingleThreaded2 // VersionMultiThreaded64 is the original 64-bit MTCannon implementation (pre-audit), tagged at cannon/v1.2.0 VersionMultiThreaded64 // VersionMultiThreaded64_v2 includes an audit fix to ensure futex values are always 32-bit, tagged at cannon/v1.3.0 VersionMultiThreaded64_v2 // VersionMultiThreaded_v2 is the latest 32-bit multithreaded vm VersionMultiThreaded_v2 // VersionMultiThreaded64_v3 is the latest 64-bit multithreaded vm VersionMultiThreaded64_v3 )
func DetectVersion ¶
func DetectVersion(path string) (StateVersion, error)
func ParseStateVersion ¶
func ParseStateVersion(ver string) (StateVersion, error)
func (StateVersion) String ¶
func (s StateVersion) String() string
type VersionedState ¶
type VersionedState struct { Version StateVersion mipsevm.FPVMState }
VersionedState deserializes a FPVMState and implements VersionedState based on the version of that state. It does this based on the version byte read in Deserialize
func LoadStateFromFile ¶
func LoadStateFromFile(path string) (*VersionedState, error)
func NewFromState ¶
func NewFromState(state mipsevm.FPVMState) (*VersionedState, error)
func (*VersionedState) Deserialize ¶
func (s *VersionedState) Deserialize(in io.Reader) error
func (*VersionedState) MarshalJSON ¶
func (s *VersionedState) MarshalJSON() ([]byte, error)
MarshalJSON marshals the underlying state without adding version prefix. JSON states are always assumed to be single threaded
Click to show internal directories.
Click to hide internal directories.