Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrChainBroken = errors.New("batch is not the ancestor of a known finalized root")
ErrChainBroken indicates a backfill batch can't be imported to the db because it is not known to be the ancestor of the canonical chain.
Functions ¶
This section is empty.
Types ¶
type BeaconDB ¶ added in v4.2.1
type BeaconDB interface { SaveBackfillStatus(context.Context, *dbval.BackfillStatus) error BackfillStatus(context.Context) (*dbval.BackfillStatus, error) BackfillFinalizedIndex(ctx context.Context, blocks []blocks.ROBlock, finalizedChildRoot [32]byte) error OriginCheckpointBlockRoot(context.Context) ([32]byte, error) Block(context.Context, [32]byte) (interfaces.ReadOnlySignedBeaconBlock, error) SaveROBlocks(ctx context.Context, blks []blocks.ROBlock, cache bool) error StateOrError(ctx context.Context, blockRoot [32]byte) (state.BeaconState, error) }
BeaconDB describes the set of DB methods that the StatusUpdater type needs to function.
type PeerAssigner ¶ added in v4.2.1
PeerAssigner describes a type that provides an Assign method, which can assign the best peer to service an RPC request. The Assign method takes a map of peers that should be excluded, allowing the caller to avoid making multiple concurrent requests to the same peer.
type Service ¶ added in v4.2.1
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶ added in v4.2.1
func NewService(ctx context.Context, su *Store, cw startup.ClockWaiter, p p2p.P2P, pa PeerAssigner, opts ...ServiceOption) (*Service, error)
NewService initializes the backfill Service. Like all implementations of the Service interface, the service won't begin its runloop until Start() is called.
type ServiceOption ¶ added in v4.2.1
func WithBatchSize ¶ added in v4.2.1
func WithBatchSize(n uint64) ServiceOption
func WithEnableBackfill ¶ added in v4.2.1
func WithEnableBackfill(enabled bool) ServiceOption
func WithWorkerCount ¶ added in v4.2.1
func WithWorkerCount(n int) ServiceOption
type Store ¶ added in v4.2.1
Store provides a way to update and query the status of a backfill process that may be necessary to track when a node was initialized via checkpoint sync. With checkpoint sync, there will be a gap in node history from genesis until the checkpoint sync origin block. Store provides the means to update the value keeping track of the lower end of the missing block range via the FillFwd() method, to check whether a Slot is missing from the database via the AvailableBlock() method, and to see the current StartGap() and EndGap().
func NewUpdater ¶ added in v4.2.1
NewUpdater correctly initializes a StatusUpdater value with the required database value.
func (*Store) AvailableBlock ¶ added in v4.2.1
func (s *Store) AvailableBlock(sl primitives.Slot) bool
AvailableBlock determines if the given slot is covered by the current chain history. If the slot is <= backfill low slot, or >= backfill high slot, the result is true. If the slot is between the backfill low and high slots, the result is false.
type VerifiedROBlocks ¶ added in v4.2.1
VerifiedROBlocks represents a slice of blocks that have passed signature verification.