mon

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContractCreation = errors.New("failed to create contract")
	ErrMetadataFetch    = errors.New("failed to fetch game metadata")
	ErrClaimFetch       = errors.New("failed to fetch game claims")
	ErrResolver         = errors.New("failed to resolve game")
	ErrRootAgreement    = errors.New("failed to check root agreement")
)

Functions

func Resolve added in v1.6.1

func Resolve(claims []faultTypes.Claim) (types.GameStatus, error)

Resolve creates the bidirectional tree of claims and then computes the resolved game status.

Types

type BidirectionalClaim added in v1.6.1

type BidirectionalClaim struct {
	Claim    *faultTypes.Claim
	Children []*BidirectionalClaim
}

type BlockHashFetcher added in v1.6.1

type BlockHashFetcher func(ctx context.Context, number *big.Int) (common.Hash, error)

type BlockNumberFetcher added in v1.6.1

type BlockNumberFetcher func(ctx context.Context) (uint64, error)

type Detect added in v1.6.1

type Detect func(ctx context.Context, games []types.GameMetadata)

type DetectorMetrics added in v1.6.1

type DetectorMetrics interface {
	RecordGameAgreement(status string, count int)
	RecordGamesStatus(inProgress, defenderWon, challengerWon int)
}

type FactoryGameFetcher added in v1.6.1

type FactoryGameFetcher func(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]types.GameMetadata, error)

type Forecast added in v1.6.1

type Forecast func(ctx context.Context, games []types.GameMetadata)

type ForecastMetrics added in v1.6.1

type ForecastMetrics interface {
	RecordGameAgreement(status string, count int)
}

type GameCallerCreator added in v1.6.1

type GameCallerCreator interface {
	CreateContract(game types.GameMetadata) (extract.GameCaller, error)
}

type OutputRollupClient added in v1.6.1

type OutputRollupClient interface {
	OutputAtBlock(ctx context.Context, blockNum uint64) (*eth.OutputResponse, error)
}

type OutputValidator added in v1.6.1

type OutputValidator interface {
	CheckRootAgreement(ctx context.Context, blockNum uint64, root common.Hash) (bool, common.Hash, error)
}

type Service

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

func NewService

func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Service, error)

NewService creates a new Service.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) error

func (*Service) Stopped

func (s *Service) Stopped() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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