mon

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MaxResolveDelay = time.Minute
View Source
const MaximumResolutionResponseBuffer = time.Minute

Variables

View Source
var (
	ErrRootAgreement = errors.New("failed to check root agreement")
)

Functions

func Resolve added in v1.6.1

Resolve iterates backwards over the bidirectional tree, iteratively checking the leftmost counter of each claim, and updating the claim's counter claimant. Once the root claim is reached, the resolution game status is returned.

Types

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 Bonds added in v1.7.2

type Bonds func(games []*types.EnrichedGameData)

type ClaimMetrics added in v1.7.3

type ClaimMetrics interface {
	RecordClaims(statuses *metrics.ClaimStatuses)
	RecordHonestActorClaims(address common.Address, data *metrics.HonestActorData)
}

type ClaimMonitor added in v1.7.3

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

func NewClaimMonitor added in v1.7.3

func NewClaimMonitor(logger log.Logger, clock RClock, honestActors types.HonestActors, metrics ClaimMetrics) *ClaimMonitor

func (*ClaimMonitor) CheckClaims added in v1.7.3

func (c *ClaimMonitor) CheckClaims(games []*types.EnrichedGameData)

type Extract added in v1.7.0

type Extract func(ctx context.Context, blockHash common.Hash, minTimestamp uint64) ([]*types.EnrichedGameData, int, int, error)

type Forecast added in v1.6.1

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

func NewForecast added in v1.7.6

func NewForecast(logger log.Logger, metrics ForecastMetrics) *Forecast

func (*Forecast) Forecast added in v1.7.6

func (f *Forecast) Forecast(games []*monTypes.EnrichedGameData, ignoredCount, failedCount int)

type ForecastMetrics added in v1.6.1

type ForecastMetrics interface {
	RecordGameAgreement(status metrics.GameAgreementStatus, count int)
	RecordLatestValidProposalL2Block(validL2Block uint64)
	RecordLatestProposals(validTimestamp, invalidTimestamp uint64)
	RecordIgnoredGames(count int)
	RecordFailedGames(count int)
}

type ForecastResolution added in v1.7.6

type ForecastResolution func(games []*types.EnrichedGameData, ignoredCount, failedCount int)

type L2ChallengesMetrics added in v1.7.6

type L2ChallengesMetrics interface {
	RecordL2Challenges(agreement bool, count int)
}

type L2ChallengesMonitor added in v1.7.6

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

func NewL2ChallengesMonitor added in v1.7.6

func NewL2ChallengesMonitor(logger log.Logger, metrics L2ChallengesMetrics) *L2ChallengesMonitor

func (*L2ChallengesMonitor) CheckL2Challenges added in v1.7.6

func (m *L2ChallengesMonitor) CheckL2Challenges(games []*types.EnrichedGameData)

type Monitor added in v1.7.6

type Monitor func(games []*types.EnrichedGameData)

type MonitorMetrics added in v1.7.6

type MonitorMetrics interface {
	RecordMonitorDuration(dur time.Duration)
}

type RClock added in v1.7.3

type RClock interface {
	Now() time.Time
}

type ResolutionMetrics added in v1.7.3

type ResolutionMetrics interface {
	RecordGameResolutionStatus(status metrics.ResolutionStatus, count int)
}

type ResolutionMonitor added in v1.7.3

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

func NewResolutionMonitor added in v1.7.3

func NewResolutionMonitor(logger log.Logger, metrics ResolutionMetrics, clock RClock) *ResolutionMonitor

func (*ResolutionMonitor) CheckResolutions added in v1.7.3

func (r *ResolutionMonitor) CheckResolutions(games []*types.EnrichedGameData)

type Resolutions added in v1.7.3

type Resolutions func(games []*types.EnrichedGameData)

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

type WithdrawalMetrics added in v1.7.3

type WithdrawalMetrics interface {
	RecordWithdrawalRequests(delayedWeth common.Address, matches bool, count int)
	RecordHonestWithdrawableAmounts(map[common.Address]*big.Int)
}

type WithdrawalMonitor added in v1.7.3

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

func NewWithdrawalMonitor added in v1.7.3

func NewWithdrawalMonitor(logger log.Logger, clock RClock, metrics WithdrawalMetrics, honestActors types.HonestActors) *WithdrawalMonitor

func (*WithdrawalMonitor) CheckWithdrawals added in v1.7.3

func (w *WithdrawalMonitor) CheckWithdrawals(games []*types.EnrichedGameData)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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