helpers

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: GPL-3.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOptimistic

func IsOptimistic(ctx context.Context, st state.BeaconState, optimisticModeFetcher blockchain.OptimisticModeFetcher) (bool, error)

IsOptimistic checks whether the latest block header of the passed in beacon state is the header of an optimistic block.

func PrepareStateFetchGRPCError

func PrepareStateFetchGRPCError(err error) error

PrepareStateFetchGRPCError returns an appropriate gRPC error based on the supplied argument. The argument error should be a result of fetching state.

func ValidateSync

func ValidateSync(
	ctx context.Context,
	syncChecker sync.Checker,
	headFetcher blockchain.HeadFetcher,
	timeFetcher blockchain.TimeFetcher,
	optimisticModeFetcher blockchain.OptimisticModeFetcher,
) error

ValidateSync checks whether the node is currently syncing and returns an error if it is. It also appends syncing info to gRPC headers.

func ValidatorStatus

func ValidatorStatus(validator state.ReadOnlyValidator, epoch types.Epoch) (ethpb.ValidatorStatus, error)

ValidatorStatus returns a validator's status at the given epoch.

func ValidatorSubStatus

func ValidatorSubStatus(validator state.ReadOnlyValidator, epoch types.Epoch) (ethpb.ValidatorStatus, error)

ValidatorSubStatus returns a validator's sub-status at the given epoch.

Types

type IndexedVerificationFailure

type IndexedVerificationFailure struct {
	Failures []*SingleIndexedVerificationFailure `json:"failures"`
}

IndexedVerificationFailure represents a collection of verification failures.

type SingleIndexedVerificationFailure

type SingleIndexedVerificationFailure struct {
	Index   int    `json:"index"`
	Message string `json:"message"`
}

SingleIndexedVerificationFailure represents an issue when verifying a single indexed object e.g. an item in an array.

type SyncDetailsJson

type SyncDetailsJson struct {
	HeadSlot     string `json:"head_slot"`
	SyncDistance string `json:"sync_distance"`
	IsSyncing    bool   `json:"is_syncing"`
	IsOptimistic bool   `json:"is_optimistic"`
}

SyncDetailsJson contains information about node sync status.

Jump to

Keyboard shortcuts

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