sync

package
v1.9.7-0...-8dbb83f Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: LGPL-3.0 Imports: 41 Imported by: 0

Documentation

Overview

Package sync is a generated GoMock package.

Package sync is a generated GoMock package.

Package sync is a generated GoMock package.

Index

Constants

View Source
const InMemorySignatures = 4096 // Number of recent block signatures to keep in memory

Variables

View Source
var (
	ErrFailedToComputeHeadersRootHash = errors.New("failed to compute headers root hash")
	ErrBadHeadersRootHash             = errors.New("bad headers root hash")
	ErrIncorrectHeadersLength         = errors.New("incorrect headers length")
	ErrDisconnectedHeaders            = errors.New("disconnected headers")
)
View Source
var ErrExecutionClientBusy = errors.New("execution client busy")
View Source
var ErrForkChoiceUpdateBadBlock = errors.New("fork choice update bad block")
View Source
var ErrForkChoiceUpdateFailure = errors.New("fork choice update failure")

Functions

func NewWiggleCalculator

func NewWiggleCalculator(borConfig *borcfg.BorConfig, signaturesCache *lru.ARCCache[libcommon.Hash, libcommon.Address], blockProducersReader blockProducersReader) *wiggleCalc

func UpdateWiggleDuration

func UpdateWiggleDuration(duration time.Duration)

func VerifyBlocks

func VerifyBlocks(blocks []*types.Block) error

func VerifyCheckpointHeaders

func VerifyCheckpointHeaders(waypoint heimdall.Waypoint, headers []*types.Header) error

func VerifyMilestoneHeaders

func VerifyMilestoneHeaders(waypoint heimdall.Waypoint, headers []*types.Header) error

Types

type BlockDownloader

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

func NewBlockDownloader

func NewBlockDownloader(
	logger log.Logger,
	p2pService p2pService,
	waypointReader waypointReader,
	checkpointVerifier WaypointHeadersVerifier,
	milestoneVerifier WaypointHeadersVerifier,
	blocksVerifier BlocksVerifier,
	store Store,
	blockLimit uint,
	opts ...BlockDownloaderOption,
) *BlockDownloader

func (*BlockDownloader) DownloadBlocksUsingCheckpoints

func (d *BlockDownloader) DownloadBlocksUsingCheckpoints(ctx context.Context, start uint64, end *uint64) (*types.Header, error)

func (*BlockDownloader) DownloadBlocksUsingMilestones

func (d *BlockDownloader) DownloadBlocksUsingMilestones(ctx context.Context, start uint64, end *uint64) (*types.Header, error)

type BlockDownloaderOption

type BlockDownloaderOption func(downloader *BlockDownloader)

func WithMaxWorkers

func WithMaxWorkers(maxWorkers int) BlockDownloaderOption

func WithRetryBackOff

func WithRetryBackOff(retryBackOff time.Duration) BlockDownloaderOption

type BlocksVerifier

type BlocksVerifier func(blocks []*types.Block) error

type CanonicalChainBuilder

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

func NewCanonicalChainBuilder

func NewCanonicalChainBuilder(root *types.Header, dc difficultyCalculator, hv headerValidator) *CanonicalChainBuilder

func (*CanonicalChainBuilder) Connect

func (ccb *CanonicalChainBuilder) Connect(ctx context.Context, headers []*types.Header) ([]*types.Header, error)

Connect connects a list of headers to the canonical chain builder tree. Returns the list of newly connected headers (filtering out headers that already exist in the tree) or an error in case the header is invalid or the header chain cannot reach any of the nodes in the tree.

func (*CanonicalChainBuilder) ContainsHash

func (ccb *CanonicalChainBuilder) ContainsHash(hash libcommon.Hash) bool

func (*CanonicalChainBuilder) Headers

func (ccb *CanonicalChainBuilder) Headers() []*types.Header

func (*CanonicalChainBuilder) HeadersInRange

func (ccb *CanonicalChainBuilder) HeadersInRange(start uint64, count uint64) []*types.Header

func (*CanonicalChainBuilder) LowestCommonAncestor

func (ccb *CanonicalChainBuilder) LowestCommonAncestor(a, b libcommon.Hash) (*types.Header, bool)

func (*CanonicalChainBuilder) PruneNode

func (ccb *CanonicalChainBuilder) PruneNode(hash libcommon.Hash) error

func (*CanonicalChainBuilder) PruneRoot

func (ccb *CanonicalChainBuilder) PruneRoot(newRootNum uint64) error

func (*CanonicalChainBuilder) Reset

func (ccb *CanonicalChainBuilder) Reset(root *types.Header)

func (*CanonicalChainBuilder) Root

func (ccb *CanonicalChainBuilder) Root() *types.Header

func (*CanonicalChainBuilder) Tip

func (ccb *CanonicalChainBuilder) Tip() *types.Header

type CanonicalChainBuilderFactory

type CanonicalChainBuilderFactory func(root *types.Header) *CanonicalChainBuilder

func NewCanonicalChainBuilderFactory

func NewCanonicalChainBuilderFactory(
	chainConfig *chain.Config,
	borConfig *borcfg.BorConfig,
	blockProducersReader blockProducersReader,
	signaturesCache *lru.ARCCache[common.Hash, common.Address],
) CanonicalChainBuilderFactory

type DifficultyCalculator

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

func (*DifficultyCalculator) HeaderDifficulty

func (calc *DifficultyCalculator) HeaderDifficulty(ctx context.Context, header *types.Header) (uint64, error)

type EngineAPISwitcher

type EngineAPISwitcher interface {
	SetConsuming(consuming bool)
}

type Event

type Event struct {
	Type EventType
	// contains filtered or unexported fields
}

func (Event) AsNewBlock

func (e Event) AsNewBlock() EventNewBlock

func (Event) AsNewBlockHashes

func (e Event) AsNewBlockHashes() EventNewBlockHashes

func (Event) AsNewMilestone

func (e Event) AsNewMilestone() EventNewMilestone

func (Event) Topic

func (e Event) Topic() EventTopic

type EventChannel

type EventChannel[TEvent any] struct {
	// contains filtered or unexported fields
}

EventChannel is a buffered channel that drops oldest events when full.

func NewEventChannel

func NewEventChannel[TEvent any](capacity uint, opts ...EventChannelOption) *EventChannel[TEvent]

func (*EventChannel[TEvent]) Events

func (ec *EventChannel[TEvent]) Events() <-chan TEvent

Events returns a channel for reading events.

func (*EventChannel[TEvent]) PushEvent

func (ec *EventChannel[TEvent]) PushEvent(e TEvent)

PushEvent queues an event. If the queue is full, it drops the oldest event to make space.

func (*EventChannel[TEvent]) Run

func (ec *EventChannel[TEvent]) Run(ctx context.Context) error

Run pumps events from the queue to the events channel.

type EventChannelOption

type EventChannelOption func(opts *eventChannelOptions)

func WithEventChannelLogging

func WithEventChannelLogging(logger log.Logger, lvl log.Lvl, id string) EventChannelOption

type EventNewBlock

type EventNewBlock struct {
	NewBlock *types.Block
	PeerId   *p2p.PeerId
	Source   EventSource
}

type EventNewBlockHashes

type EventNewBlockHashes struct {
	NewBlockHashes eth.NewBlockHashesPacket
	PeerId         *p2p.PeerId
}

type EventNewMilestone

type EventNewMilestone = *heimdall.Milestone

type EventSource

type EventSource string
const EventSourceP2PNewBlock EventSource = "p2p-new-block-source"
const EventSourceP2PNewBlockHashes EventSource = "p2p-new-block-hashes-source"

type EventTopic

type EventTopic string
const EventTopicHeimdall EventTopic = "heimdall"
const EventTopicP2P EventTopic = "p2p"

func (EventTopic) String

func (t EventTopic) String() string

type EventType

type EventType string
const EventTypeNewBlock EventType = "new-block"
const EventTypeNewBlockHashes EventType = "new-block-hashes"
const EventTypeNewMilestone EventType = "new-milestone"

type ExecutionClient

type ExecutionClient interface {
	Prepare(ctx context.Context) error
	InsertBlocks(ctx context.Context, blocks []*types.Block) error
	UpdateForkChoice(ctx context.Context, tip *types.Header, finalizedHeader *types.Header) (common.Hash, error)
	CurrentHeader(ctx context.Context) (*types.Header, error)
	GetHeader(ctx context.Context, blockNum uint64) (*types.Header, error)
	GetTd(ctx context.Context, blockNum uint64, blockHash common.Hash) (*big.Int, error)
}

type ExecutionClientStore

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

func NewStore

func NewStore(logger log.Logger, executionStore executionStore, bridgeStore bridgeStore) *ExecutionClientStore

func (*ExecutionClientStore) Flush

func (s *ExecutionClientStore) Flush(ctx context.Context) error

func (*ExecutionClientStore) InsertBlocks

func (s *ExecutionClientStore) InsertBlocks(ctx context.Context, blocks []*types.Block) error

func (*ExecutionClientStore) Prepare

func (s *ExecutionClientStore) Prepare(ctx context.Context) error

func (*ExecutionClientStore) Run

type HeaderTimeValidator

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

func (*HeaderTimeValidator) ValidateHeaderTime

func (htv *HeaderTimeValidator) ValidateHeaderTime(
	ctx context.Context,
	header *types.Header,
	now time.Time,
	parent *types.Header,
) error

type HeaderValidator

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

func (*HeaderValidator) ValidateHeader

func (hv *HeaderValidator) ValidateHeader(
	ctx context.Context,
	header *types.Header,
	parent *types.Header,
	now time.Time,
) error

type MockStore

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

MockStore is a mock of Store interface.

func NewMockStore

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance.

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStore) Flush

func (m *MockStore) Flush(ctx context.Context) error

Flush mocks base method.

func (*MockStore) InsertBlocks

func (m *MockStore) InsertBlocks(ctx context.Context, blocks []*types.Block) error

InsertBlocks mocks base method.

func (*MockStore) Prepare

func (m *MockStore) Prepare(ctx context.Context) error

Prepare mocks base method.

func (*MockStore) Run

func (m *MockStore) Run(ctx context.Context) error

Run mocks base method.

type MockStoreFlushCall

type MockStoreFlushCall struct {
	*gomock.Call
}

MockStoreFlushCall wrap *gomock.Call

func (*MockStoreFlushCall) Do

Do rewrite *gomock.Call.Do

func (*MockStoreFlushCall) DoAndReturn

func (c *MockStoreFlushCall) DoAndReturn(f func(context.Context) error) *MockStoreFlushCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockStoreFlushCall) Return

func (c *MockStoreFlushCall) Return(arg0 error) *MockStoreFlushCall

Return rewrite *gomock.Call.Return

type MockStoreInsertBlocksCall

type MockStoreInsertBlocksCall struct {
	*gomock.Call
}

MockStoreInsertBlocksCall wrap *gomock.Call

func (*MockStoreInsertBlocksCall) Do

Do rewrite *gomock.Call.Do

func (*MockStoreInsertBlocksCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockStoreInsertBlocksCall) Return

Return rewrite *gomock.Call.Return

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore.

func (*MockStoreMockRecorder) Flush

Flush indicates an expected call of Flush.

func (*MockStoreMockRecorder) InsertBlocks

func (mr *MockStoreMockRecorder) InsertBlocks(ctx, blocks any) *MockStoreInsertBlocksCall

InsertBlocks indicates an expected call of InsertBlocks.

func (*MockStoreMockRecorder) Prepare

Prepare indicates an expected call of Prepare.

func (*MockStoreMockRecorder) Run

Run indicates an expected call of Run.

type MockStorePrepareCall

type MockStorePrepareCall struct {
	*gomock.Call
}

MockStorePrepareCall wrap *gomock.Call

func (*MockStorePrepareCall) Do

Do rewrite *gomock.Call.Do

func (*MockStorePrepareCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockStorePrepareCall) Return

Return rewrite *gomock.Call.Return

type MockStoreRunCall

type MockStoreRunCall struct {
	*gomock.Call
}

MockStoreRunCall wrap *gomock.Call

func (*MockStoreRunCall) Do

Do rewrite *gomock.Call.Do

func (*MockStoreRunCall) DoAndReturn

func (c *MockStoreRunCall) DoAndReturn(f func(context.Context) error) *MockStoreRunCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockStoreRunCall) Return

func (c *MockStoreRunCall) Return(arg0 error) *MockStoreRunCall

Return rewrite *gomock.Call.Return

type Mockp2pService

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

Mockp2pService is a mock of p2pService interface.

func NewMockp2pService

func NewMockp2pService(ctrl *gomock.Controller) *Mockp2pService

NewMockp2pService creates a new mock instance.

func (*Mockp2pService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mockp2pService) FetchBlocksBackwardsByHash

func (m *Mockp2pService) FetchBlocksBackwardsByHash(ctx context.Context, hash common.Hash, amount uint64, peerId *p2p.PeerId, opts ...p2p.FetcherOption) (p2p.FetcherResponse[[]*types.Block], error)

FetchBlocksBackwardsByHash mocks base method.

func (*Mockp2pService) FetchBodies

func (m *Mockp2pService) FetchBodies(ctx context.Context, headers []*types.Header, peerId *p2p.PeerId, opts ...p2p.FetcherOption) (p2p.FetcherResponse[[]*types.Body], error)

FetchBodies mocks base method.

func (*Mockp2pService) FetchHeaders

func (m *Mockp2pService) FetchHeaders(ctx context.Context, start, end uint64, peerId *p2p.PeerId, opts ...p2p.FetcherOption) (p2p.FetcherResponse[[]*types.Header], error)

FetchHeaders mocks base method.

func (*Mockp2pService) ListPeersMayHaveBlockNum

func (m *Mockp2pService) ListPeersMayHaveBlockNum(blockNum uint64) []*p2p.PeerId

ListPeersMayHaveBlockNum mocks base method.

func (*Mockp2pService) MaxPeers

func (m *Mockp2pService) MaxPeers() int

MaxPeers mocks base method.

func (*Mockp2pService) Penalize

func (m *Mockp2pService) Penalize(ctx context.Context, peerId *p2p.PeerId) error

Penalize mocks base method.

func (*Mockp2pService) PublishNewBlock

func (m *Mockp2pService) PublishNewBlock(block *types.Block, td *big.Int)

PublishNewBlock mocks base method.

func (*Mockp2pService) PublishNewBlockHashes

func (m *Mockp2pService) PublishNewBlockHashes(block *types.Block)

PublishNewBlockHashes mocks base method.

func (*Mockp2pService) Run

func (m *Mockp2pService) Run(ctx context.Context) error

Run mocks base method.

type Mockp2pServiceFetchBlocksBackwardsByHashCall

type Mockp2pServiceFetchBlocksBackwardsByHashCall struct {
	*gomock.Call
}

Mockp2pServiceFetchBlocksBackwardsByHashCall wrap *gomock.Call

func (*Mockp2pServiceFetchBlocksBackwardsByHashCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceFetchBlocksBackwardsByHashCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceFetchBlocksBackwardsByHashCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceFetchBodiesCall

type Mockp2pServiceFetchBodiesCall struct {
	*gomock.Call
}

Mockp2pServiceFetchBodiesCall wrap *gomock.Call

func (*Mockp2pServiceFetchBodiesCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceFetchBodiesCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceFetchBodiesCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceFetchHeadersCall

type Mockp2pServiceFetchHeadersCall struct {
	*gomock.Call
}

Mockp2pServiceFetchHeadersCall wrap *gomock.Call

func (*Mockp2pServiceFetchHeadersCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceFetchHeadersCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceFetchHeadersCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceListPeersMayHaveBlockNumCall

type Mockp2pServiceListPeersMayHaveBlockNumCall struct {
	*gomock.Call
}

Mockp2pServiceListPeersMayHaveBlockNumCall wrap *gomock.Call

func (*Mockp2pServiceListPeersMayHaveBlockNumCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceListPeersMayHaveBlockNumCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceListPeersMayHaveBlockNumCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceMaxPeersCall

type Mockp2pServiceMaxPeersCall struct {
	*gomock.Call
}

Mockp2pServiceMaxPeersCall wrap *gomock.Call

func (*Mockp2pServiceMaxPeersCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceMaxPeersCall) DoAndReturn

func (c *Mockp2pServiceMaxPeersCall) DoAndReturn(f func() int) *Mockp2pServiceMaxPeersCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceMaxPeersCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceMockRecorder

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

Mockp2pServiceMockRecorder is the mock recorder for Mockp2pService.

func (*Mockp2pServiceMockRecorder) FetchBlocksBackwardsByHash

func (mr *Mockp2pServiceMockRecorder) FetchBlocksBackwardsByHash(ctx, hash, amount, peerId any, opts ...any) *Mockp2pServiceFetchBlocksBackwardsByHashCall

FetchBlocksBackwardsByHash indicates an expected call of FetchBlocksBackwardsByHash.

func (*Mockp2pServiceMockRecorder) FetchBodies

func (mr *Mockp2pServiceMockRecorder) FetchBodies(ctx, headers, peerId any, opts ...any) *Mockp2pServiceFetchBodiesCall

FetchBodies indicates an expected call of FetchBodies.

func (*Mockp2pServiceMockRecorder) FetchHeaders

func (mr *Mockp2pServiceMockRecorder) FetchHeaders(ctx, start, end, peerId any, opts ...any) *Mockp2pServiceFetchHeadersCall

FetchHeaders indicates an expected call of FetchHeaders.

func (*Mockp2pServiceMockRecorder) ListPeersMayHaveBlockNum

func (mr *Mockp2pServiceMockRecorder) ListPeersMayHaveBlockNum(blockNum any) *Mockp2pServiceListPeersMayHaveBlockNumCall

ListPeersMayHaveBlockNum indicates an expected call of ListPeersMayHaveBlockNum.

func (*Mockp2pServiceMockRecorder) MaxPeers

MaxPeers indicates an expected call of MaxPeers.

func (*Mockp2pServiceMockRecorder) Penalize

func (mr *Mockp2pServiceMockRecorder) Penalize(ctx, peerId any) *Mockp2pServicePenalizeCall

Penalize indicates an expected call of Penalize.

func (*Mockp2pServiceMockRecorder) PublishNewBlock

func (mr *Mockp2pServiceMockRecorder) PublishNewBlock(block, td any) *Mockp2pServicePublishNewBlockCall

PublishNewBlock indicates an expected call of PublishNewBlock.

func (*Mockp2pServiceMockRecorder) PublishNewBlockHashes

PublishNewBlockHashes indicates an expected call of PublishNewBlockHashes.

func (*Mockp2pServiceMockRecorder) Run

Run indicates an expected call of Run.

type Mockp2pServicePenalizeCall

type Mockp2pServicePenalizeCall struct {
	*gomock.Call
}

Mockp2pServicePenalizeCall wrap *gomock.Call

func (*Mockp2pServicePenalizeCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServicePenalizeCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServicePenalizeCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServicePublishNewBlockCall

type Mockp2pServicePublishNewBlockCall struct {
	*gomock.Call
}

Mockp2pServicePublishNewBlockCall wrap *gomock.Call

func (*Mockp2pServicePublishNewBlockCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServicePublishNewBlockCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServicePublishNewBlockCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServicePublishNewBlockHashesCall

type Mockp2pServicePublishNewBlockHashesCall struct {
	*gomock.Call
}

Mockp2pServicePublishNewBlockHashesCall wrap *gomock.Call

func (*Mockp2pServicePublishNewBlockHashesCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServicePublishNewBlockHashesCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServicePublishNewBlockHashesCall) Return

Return rewrite *gomock.Call.Return

type Mockp2pServiceRunCall

type Mockp2pServiceRunCall struct {
	*gomock.Call
}

Mockp2pServiceRunCall wrap *gomock.Call

func (*Mockp2pServiceRunCall) Do

Do rewrite *gomock.Call.Do

func (*Mockp2pServiceRunCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*Mockp2pServiceRunCall) Return

Return rewrite *gomock.Call.Return

type MockwaypointReader

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

MockwaypointReader is a mock of waypointReader interface.

func NewMockwaypointReader

func NewMockwaypointReader(ctrl *gomock.Controller) *MockwaypointReader

NewMockwaypointReader creates a new mock instance.

func (*MockwaypointReader) CheckpointsFromBlock

func (m *MockwaypointReader) CheckpointsFromBlock(ctx context.Context, startBlock uint64) ([]*heimdall.Checkpoint, error)

CheckpointsFromBlock mocks base method.

func (*MockwaypointReader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockwaypointReader) MilestonesFromBlock

func (m *MockwaypointReader) MilestonesFromBlock(ctx context.Context, startBlock uint64) ([]*heimdall.Milestone, error)

MilestonesFromBlock mocks base method.

type MockwaypointReaderCheckpointsFromBlockCall

type MockwaypointReaderCheckpointsFromBlockCall struct {
	*gomock.Call
}

MockwaypointReaderCheckpointsFromBlockCall wrap *gomock.Call

func (*MockwaypointReaderCheckpointsFromBlockCall) Do

Do rewrite *gomock.Call.Do

func (*MockwaypointReaderCheckpointsFromBlockCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockwaypointReaderCheckpointsFromBlockCall) Return

Return rewrite *gomock.Call.Return

type MockwaypointReaderMilestonesFromBlockCall

type MockwaypointReaderMilestonesFromBlockCall struct {
	*gomock.Call
}

MockwaypointReaderMilestonesFromBlockCall wrap *gomock.Call

func (*MockwaypointReaderMilestonesFromBlockCall) Do

Do rewrite *gomock.Call.Do

func (*MockwaypointReaderMilestonesFromBlockCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockwaypointReaderMilestonesFromBlockCall) Return

Return rewrite *gomock.Call.Return

type MockwaypointReaderMockRecorder

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

MockwaypointReaderMockRecorder is the mock recorder for MockwaypointReader.

func (*MockwaypointReaderMockRecorder) CheckpointsFromBlock

func (mr *MockwaypointReaderMockRecorder) CheckpointsFromBlock(ctx, startBlock any) *MockwaypointReaderCheckpointsFromBlockCall

CheckpointsFromBlock indicates an expected call of CheckpointsFromBlock.

func (*MockwaypointReaderMockRecorder) MilestonesFromBlock

func (mr *MockwaypointReaderMockRecorder) MilestonesFromBlock(ctx, startBlock any) *MockwaypointReaderMilestonesFromBlockCall

MilestonesFromBlock indicates an expected call of MilestonesFromBlock.

type Service

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

func NewService

func NewService(
	config *ethconfig.Config,
	logger log.Logger,
	chainConfig *chain.Config,
	sentryClient sentryproto.SentryClient,
	maxPeers int,
	statusDataProvider *sentry.StatusDataProvider,
	executionClient executionproto.ExecutionClient,
	blockLimit uint,
	bridgeService *bridge.Service,
	heimdallService *heimdall.Service,
	notifications *shards.Notifications,
	engineAPISwitcher EngineAPISwitcher,

) *Service

func (*Service) Run

func (s *Service) Run(parentCtx context.Context) error

type Store

type Store interface {
	// Prepare runs initialisation of the store
	Prepare(ctx context.Context) error
	// InsertBlocks queues blocks for writing into the local canonical chain.
	InsertBlocks(ctx context.Context, blocks []*types.Block) error
	// Flush makes sure that all queued blocks have been written.
	Flush(ctx context.Context) error
	// Run performs the block writing.
	Run(ctx context.Context) error
}

type Sync

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

func NewSync

func NewSync(
	config *ethconfig.Config,
	logger log.Logger,
	store Store,
	execution ExecutionClient,
	milestoneVerifier WaypointHeadersVerifier,
	blocksVerifier BlocksVerifier,
	p2pService p2pService,
	blockDownloader *BlockDownloader,
	ccBuilderFactory CanonicalChainBuilderFactory,
	heimdallSync heimdallSynchronizer,
	bridgeSync bridgeSynchronizer,
	events <-chan Event,
	notifications *shards.Notifications,
	wiggleCalculator wiggleCalculator,
	engineAPISwitcher EngineAPISwitcher,
) *Sync

func (*Sync) Run

func (s *Sync) Run(ctx context.Context) error

type TipEvents

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

func NewTipEvents

func NewTipEvents(logger log.Logger, p2pReg p2pObserverRegistrar, heimdallReg heimdallObserverRegistrar) *TipEvents

func (*TipEvents) Events

func (te *TipEvents) Events() <-chan Event

func (*TipEvents) Run

func (te *TipEvents) Run(ctx context.Context) error

type TipEventsCompositeChannel

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

func NewTipEventsCompositeChannel

func NewTipEventsCompositeChannel(
	heimdallEventsChannel *EventChannel[Event],
	p2pEventsChannel *EventChannel[Event],
) *TipEventsCompositeChannel

func (TipEventsCompositeChannel) Events

func (c TipEventsCompositeChannel) Events() <-chan Event

func (TipEventsCompositeChannel) PushEvent

func (c TipEventsCompositeChannel) PushEvent(e Event)

func (TipEventsCompositeChannel) Run

type WaypointHeadersVerifier

type WaypointHeadersVerifier func(waypoint heimdall.Waypoint, headers []*types.Header) error

Jump to

Keyboard shortcuts

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