domino

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Case

type Case interface {
	// Checkpoint should get the state at or before the slot selected
	Checkpoint(ctx context.Context, slot uint64) (abstract.BeaconState, error)
	// Dominos should get a block
	Domino(ctx context.Context, slot uint64) (*cltypes.SignedBeaconBlock, error)
}

Case defines an interface for storage of dominoes. it should be thread safe

type Exhibit

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

Exhibit is for managing multiple domino runs

func NewExhibit

func NewExhibit(c Case, m machine.Interface) *Exhibit

func (*Exhibit) GetRun

func (e *Exhibit) GetRun(ctx context.Context, slot uint64) (*Run, error)

GetRun gets a run. in the future, the exhibit can be smarter and possibly reuse runs caller should call topple when they need to.

func (*Exhibit) PutRun

func (e *Exhibit) PutRun(*Run)

In the future, we can potentially reuse runs. for now we don't

type Run

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

A domino run is not thread safe and should be protected by a external mutex if needed to be called thread safe

func NewRun

func NewRun(c Case, m machine.Interface) *Run

func (*Run) Current

func (r *Run) Current() uint64

func (*Run) Reset

func (r *Run) Reset(ctx context.Context, slot uint64) (err error)

Reset will reset the domino stack to the nearest checkpoint

func (*Run) State

func (r *Run) State() abstract.BeaconState

func (*Run) ToppleTo

func (r *Run) ToppleTo(ctx context.Context, slot uint64) error

Directories

Path Synopsis
cases

Jump to

Keyboard shortcuts

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