machine

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockInfo added in v0.7.0

type BlockInfo struct {
	Hash     common.Hash
	BlockLog value.Value
	Bloom    types.Bloom
}

type BlockReason

type BlockReason interface {
	IsBlocked(m Machine, newMessages bool) bool
	Equals(b BlockReason) bool
}

type BlockStore added in v0.6.0

type BlockStore interface {
	PutBlock(id *common.BlockId, data []byte) error
	DeleteBlock(id *common.BlockId) error
	GetBlock(id *common.BlockId) ([]byte, error)
	BlocksAtHeight(height *common.TimeBlocks) []*common.BlockId
	IsBlockStoreEmpty() bool
	MaxBlockStoreHeight() *common.TimeBlocks
	MinBlockStoreHeight() *common.TimeBlocks
}

type BreakpointBlocked

type BreakpointBlocked struct {
}

func (BreakpointBlocked) Equals

func (b BreakpointBlocked) Equals(a BlockReason) bool

func (BreakpointBlocked) IsBlocked

func (b BreakpointBlocked) IsBlocked(Machine, bool) bool

func (BreakpointBlocked) String added in v0.4.0

func (b BreakpointBlocked) String() string

type CheckpointStorage added in v0.4.0

type CheckpointStorage interface {
	DeleteCheckpoint(machineHash common.Hash) bool
	Initialize(contractPath string) error
	Initialized() bool
	CloseCheckpointStorage() bool
	GetInitialMachine() (Machine, error)
	GetMachine(machineHash common.Hash) (Machine, error)
	SaveValue(val value.Value) bool
	GetValue(hashValue common.Hash) value.Value
	DeleteValue(hashValue common.Hash) bool
	SaveData(key []byte, serializedValue []byte) bool
	GetData(key []byte) []byte
	DeleteData(key []byte) bool
}

type ErrorBlocked

type ErrorBlocked struct {
}

func (ErrorBlocked) Equals

func (b ErrorBlocked) Equals(a BlockReason) bool

func (ErrorBlocked) IsBlocked

func (b ErrorBlocked) IsBlocked(Machine, bool) bool

func (ErrorBlocked) String added in v0.4.0

func (b ErrorBlocked) String() string

type HaltBlocked

type HaltBlocked struct {
}

func (HaltBlocked) Equals

func (b HaltBlocked) Equals(a BlockReason) bool

func (HaltBlocked) IsBlocked

func (b HaltBlocked) IsBlocked(Machine, bool) bool

func (HaltBlocked) String added in v0.4.0

func (b HaltBlocked) String() string

type InboxBlocked

type InboxBlocked struct {
}

func (InboxBlocked) Equals

func (b InboxBlocked) Equals(a BlockReason) bool

func (InboxBlocked) IsBlocked

func (b InboxBlocked) IsBlocked(_ Machine, newMessages bool) bool

func (InboxBlocked) String added in v0.4.0

func (b InboxBlocked) String() string

type Machine

type Machine interface {
	Hash() common.Hash
	Clone() Machine
	PrintState()

	CurrentStatus() Status
	IsBlocked(newMessages bool) BlockReason

	ExecuteAssertion(
		maxSteps uint64,
		messages []inbox.InboxMessage,
		maxWallTime time.Duration,
	) (*protocol.ExecutionAssertion, uint64)

	// Supply a value that the inbox peek opcode will return if the inbox
	// runs out of messages. For ArbOS, this can be used to simulate a message
	// from the next block arriving in order to trigger end-of-block processes
	// without waiting for the next block
	ExecuteCallServerAssertion(
		maxSteps uint64,
		inboxMessages []inbox.InboxMessage,
		fakeInboxPeekValue value.Value,
		maxWallTime time.Duration,
	) (*protocol.ExecutionAssertion, uint64)

	ExecuteSideloadedAssertion(
		maxSteps uint64,
		messages []inbox.InboxMessage,
		sideloadValue *value.TupleValue,
		maxWallTime time.Duration,
	) (*protocol.ExecutionAssertion, uint64)

	MarshalForProof() ([]byte, error)

	MarshalState() ([]byte, error)

	Checkpoint(storage CheckpointStorage) bool
}

type Status

type Status int
const (
	Extensive Status = iota
	ErrorStop
	Halt
)

Jump to

Keyboard shortcuts

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