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
- Variables
- func VerifyBlocks(blocks []*types.Block) error
- func VerifyCheckpointHeaders(waypoint heimdall.Waypoint, headers []*types.Header) error
- func VerifyMilestoneHeaders(waypoint heimdall.Waypoint, headers []*types.Header) error
- func WithEventChannelLogging(logger log.Logger, lvl log.Lvl, id string) eventChannelOption
- type BlockDownloader
- type BlocksVerifier
- type CanonicalChainBuilder
- type CanonicalChainBuilderFactory
- type DifficultyCalculator
- type Event
- type EventChannel
- type EventNewBlock
- type EventNewBlockHashes
- type EventNewMilestone
- type EventSource
- type EventTopic
- type EventType
- type ExecutionClient
- type HeaderTimeValidator
- type HeaderValidator
- type MockCanonicalChainBuilder
- func (m *MockCanonicalChainBuilder) Connect(ctx context.Context, headers []*types.Header) ([]*types.Header, error)
- func (m *MockCanonicalChainBuilder) ContainsHash(hash common.Hash) bool
- func (m *MockCanonicalChainBuilder) EXPECT() *MockCanonicalChainBuilderMockRecorder
- func (m *MockCanonicalChainBuilder) HeadersInRange(start, count uint64) []*types.Header
- func (m *MockCanonicalChainBuilder) LowestCommonAncestor(a, b common.Hash) (*types.Header, bool)
- func (m *MockCanonicalChainBuilder) PruneNode(hash common.Hash) error
- func (m *MockCanonicalChainBuilder) PruneRoot(newRootNum uint64) error
- func (m *MockCanonicalChainBuilder) Reset(root *types.Header)
- func (m *MockCanonicalChainBuilder) Root() *types.Header
- func (m *MockCanonicalChainBuilder) Tip() *types.Header
- type MockCanonicalChainBuilderConnectCall
- func (c *MockCanonicalChainBuilderConnectCall) Do(f func(context.Context, []*types.Header) ([]*types.Header, error)) *MockCanonicalChainBuilderConnectCall
- func (c *MockCanonicalChainBuilderConnectCall) DoAndReturn(f func(context.Context, []*types.Header) ([]*types.Header, error)) *MockCanonicalChainBuilderConnectCall
- func (c *MockCanonicalChainBuilderConnectCall) Return(newConnectedHeaders []*types.Header, err error) *MockCanonicalChainBuilderConnectCall
- type MockCanonicalChainBuilderContainsHashCall
- func (c *MockCanonicalChainBuilderContainsHashCall) Do(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall
- func (c *MockCanonicalChainBuilderContainsHashCall) DoAndReturn(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall
- func (c *MockCanonicalChainBuilderContainsHashCall) Return(arg0 bool) *MockCanonicalChainBuilderContainsHashCall
- type MockCanonicalChainBuilderHeadersInRangeCall
- func (c *MockCanonicalChainBuilderHeadersInRangeCall) Do(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
- func (c *MockCanonicalChainBuilderHeadersInRangeCall) DoAndReturn(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
- func (c *MockCanonicalChainBuilderHeadersInRangeCall) Return(arg0 []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
- type MockCanonicalChainBuilderLowestCommonAncestorCall
- func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) Do(f func(common.Hash, common.Hash) (*types.Header, bool)) *MockCanonicalChainBuilderLowestCommonAncestorCall
- func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) DoAndReturn(f func(common.Hash, common.Hash) (*types.Header, bool)) *MockCanonicalChainBuilderLowestCommonAncestorCall
- func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) Return(arg0 *types.Header, arg1 bool) *MockCanonicalChainBuilderLowestCommonAncestorCall
- type MockCanonicalChainBuilderMockRecorder
- func (mr *MockCanonicalChainBuilderMockRecorder) Connect(ctx, headers any) *MockCanonicalChainBuilderConnectCall
- func (mr *MockCanonicalChainBuilderMockRecorder) ContainsHash(hash any) *MockCanonicalChainBuilderContainsHashCall
- func (mr *MockCanonicalChainBuilderMockRecorder) HeadersInRange(start, count any) *MockCanonicalChainBuilderHeadersInRangeCall
- func (mr *MockCanonicalChainBuilderMockRecorder) LowestCommonAncestor(a, b any) *MockCanonicalChainBuilderLowestCommonAncestorCall
- func (mr *MockCanonicalChainBuilderMockRecorder) PruneNode(hash any) *MockCanonicalChainBuilderPruneNodeCall
- func (mr *MockCanonicalChainBuilderMockRecorder) PruneRoot(newRootNum any) *MockCanonicalChainBuilderPruneRootCall
- func (mr *MockCanonicalChainBuilderMockRecorder) Reset(root any) *MockCanonicalChainBuilderResetCall
- func (mr *MockCanonicalChainBuilderMockRecorder) Root() *MockCanonicalChainBuilderRootCall
- func (mr *MockCanonicalChainBuilderMockRecorder) Tip() *MockCanonicalChainBuilderTipCall
- type MockCanonicalChainBuilderPruneNodeCall
- func (c *MockCanonicalChainBuilderPruneNodeCall) Do(f func(common.Hash) error) *MockCanonicalChainBuilderPruneNodeCall
- func (c *MockCanonicalChainBuilderPruneNodeCall) DoAndReturn(f func(common.Hash) error) *MockCanonicalChainBuilderPruneNodeCall
- func (c *MockCanonicalChainBuilderPruneNodeCall) Return(arg0 error) *MockCanonicalChainBuilderPruneNodeCall
- type MockCanonicalChainBuilderPruneRootCall
- func (c *MockCanonicalChainBuilderPruneRootCall) Do(f func(uint64) error) *MockCanonicalChainBuilderPruneRootCall
- func (c *MockCanonicalChainBuilderPruneRootCall) DoAndReturn(f func(uint64) error) *MockCanonicalChainBuilderPruneRootCall
- func (c *MockCanonicalChainBuilderPruneRootCall) Return(arg0 error) *MockCanonicalChainBuilderPruneRootCall
- type MockCanonicalChainBuilderResetCall
- func (c *MockCanonicalChainBuilderResetCall) Do(f func(*types.Header)) *MockCanonicalChainBuilderResetCall
- func (c *MockCanonicalChainBuilderResetCall) DoAndReturn(f func(*types.Header)) *MockCanonicalChainBuilderResetCall
- func (c *MockCanonicalChainBuilderResetCall) Return() *MockCanonicalChainBuilderResetCall
- type MockCanonicalChainBuilderRootCall
- func (c *MockCanonicalChainBuilderRootCall) Do(f func() *types.Header) *MockCanonicalChainBuilderRootCall
- func (c *MockCanonicalChainBuilderRootCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderRootCall
- func (c *MockCanonicalChainBuilderRootCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderRootCall
- type MockCanonicalChainBuilderTipCall
- func (c *MockCanonicalChainBuilderTipCall) Do(f func() *types.Header) *MockCanonicalChainBuilderTipCall
- func (c *MockCanonicalChainBuilderTipCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderTipCall
- func (c *MockCanonicalChainBuilderTipCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderTipCall
- type MockStore
- type MockStoreFlushCall
- type MockStoreInsertBlocksCall
- func (c *MockStoreInsertBlocksCall) Do(f func(context.Context, []*types.Block) error) *MockStoreInsertBlocksCall
- func (c *MockStoreInsertBlocksCall) DoAndReturn(f func(context.Context, []*types.Block) error) *MockStoreInsertBlocksCall
- func (c *MockStoreInsertBlocksCall) Return(arg0 error) *MockStoreInsertBlocksCall
- type MockStoreMockRecorder
- type MockStoreRunCall
- type MockwaypointReader
- func (m *MockwaypointReader) CheckpointsFromBlock(ctx context.Context, startBlock uint64) ([]*heimdall.Checkpoint, error)
- func (m *MockwaypointReader) EXPECT() *MockwaypointReaderMockRecorder
- func (m *MockwaypointReader) MilestonesFromBlock(ctx context.Context, startBlock uint64) ([]*heimdall.Milestone, error)
- type MockwaypointReaderCheckpointsFromBlockCall
- func (c *MockwaypointReaderCheckpointsFromBlockCall) Do(f func(context.Context, uint64) ([]*heimdall.Checkpoint, error)) *MockwaypointReaderCheckpointsFromBlockCall
- func (c *MockwaypointReaderCheckpointsFromBlockCall) DoAndReturn(f func(context.Context, uint64) ([]*heimdall.Checkpoint, error)) *MockwaypointReaderCheckpointsFromBlockCall
- func (c *MockwaypointReaderCheckpointsFromBlockCall) Return(arg0 []*heimdall.Checkpoint, arg1 error) *MockwaypointReaderCheckpointsFromBlockCall
- type MockwaypointReaderMilestonesFromBlockCall
- func (c *MockwaypointReaderMilestonesFromBlockCall) Do(f func(context.Context, uint64) ([]*heimdall.Milestone, error)) *MockwaypointReaderMilestonesFromBlockCall
- func (c *MockwaypointReaderMilestonesFromBlockCall) DoAndReturn(f func(context.Context, uint64) ([]*heimdall.Milestone, error)) *MockwaypointReaderMilestonesFromBlockCall
- func (c *MockwaypointReaderMilestonesFromBlockCall) Return(arg0 []*heimdall.Milestone, arg1 error) *MockwaypointReaderMilestonesFromBlockCall
- type MockwaypointReaderMockRecorder
- type Service
- type Store
- type Sync
- type TipEvents
- type TipEventsCompositeChannel
- type WaypointHeadersVerifier
Constants ¶
const InMemorySignatures = 4096 // Number of recent block signatures to keep in memory
Variables ¶
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") )
var ErrForkChoiceUpdateBadBlock = errors.New("fork choice update bad block")
var ErrForkChoiceUpdateFailure = errors.New("fork choice update failure")
Functions ¶
func VerifyBlocks ¶
func VerifyCheckpointHeaders ¶
func VerifyMilestoneHeaders ¶
func WithEventChannelLogging ¶
func WithEventChannelLogging(logger log.Logger, lvl log.Lvl, id string) eventChannelOption
Types ¶
type BlockDownloader ¶
type BlockDownloader interface { DownloadBlocksUsingCheckpoints(ctx context.Context, start uint64) (tip *types.Header, err error) DownloadBlocksUsingMilestones(ctx context.Context, start uint64) (tip *types.Header, err error) }
func NewBlockDownloader ¶
func NewBlockDownloader( logger log.Logger, p2pService p2p.Service, waypointReader waypointReader, checkpointVerifier WaypointHeadersVerifier, milestoneVerifier WaypointHeadersVerifier, blocksVerifier BlocksVerifier, store Store, blockLimit uint, ) BlockDownloader
type BlocksVerifier ¶
type CanonicalChainBuilder ¶
type CanonicalChainBuilder interface { Reset(root *types.Header) ContainsHash(hash libcommon.Hash) bool Tip() *types.Header Root() *types.Header HeadersInRange(start uint64, count uint64) []*types.Header PruneRoot(newRootNum uint64) error PruneNode(hash libcommon.Hash) error Connect(ctx context.Context, headers []*types.Header) (newConnectedHeaders []*types.Header, err error) LowestCommonAncestor(a, b libcommon.Hash) (*types.Header, bool) }
func NewCanonicalChainBuilder ¶
func NewCanonicalChainBuilder( root *types.Header, difficultyCalc difficultyCalculator, headerValidator headerValidator, ) CanonicalChainBuilder
type CanonicalChainBuilderFactory ¶
type CanonicalChainBuilderFactory func(root *types.Header) CanonicalChainBuilder
func NewCanonicalChainBuilderFactory ¶
func NewCanonicalChainBuilderFactory( chainConfig *chain.Config, borConfig *borcfg.BorConfig, blockProducersReader blockProducersReader, ) CanonicalChainBuilderFactory
type DifficultyCalculator ¶
type DifficultyCalculator struct {
// contains filtered or unexported fields
}
func (*DifficultyCalculator) HeaderDifficulty ¶
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.
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 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) }
func NewExecutionClient ¶
func NewExecutionClient(client executionproto.ExecutionClient) ExecutionClient
type HeaderTimeValidator ¶
type HeaderTimeValidator struct {
// contains filtered or unexported fields
}
type HeaderValidator ¶
type HeaderValidator struct {
// contains filtered or unexported fields
}
type MockCanonicalChainBuilder ¶
type MockCanonicalChainBuilder struct {
// contains filtered or unexported fields
}
MockCanonicalChainBuilder is a mock of CanonicalChainBuilder interface.
func NewMockCanonicalChainBuilder ¶
func NewMockCanonicalChainBuilder(ctrl *gomock.Controller) *MockCanonicalChainBuilder
NewMockCanonicalChainBuilder creates a new mock instance.
func (*MockCanonicalChainBuilder) Connect ¶
func (m *MockCanonicalChainBuilder) Connect(ctx context.Context, headers []*types.Header) ([]*types.Header, error)
Connect mocks base method.
func (*MockCanonicalChainBuilder) ContainsHash ¶
func (m *MockCanonicalChainBuilder) ContainsHash(hash common.Hash) bool
ContainsHash mocks base method.
func (*MockCanonicalChainBuilder) EXPECT ¶
func (m *MockCanonicalChainBuilder) EXPECT() *MockCanonicalChainBuilderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCanonicalChainBuilder) HeadersInRange ¶
func (m *MockCanonicalChainBuilder) HeadersInRange(start, count uint64) []*types.Header
HeadersInRange mocks base method.
func (*MockCanonicalChainBuilder) LowestCommonAncestor ¶
LowestCommonAncestor mocks base method.
func (*MockCanonicalChainBuilder) PruneNode ¶
func (m *MockCanonicalChainBuilder) PruneNode(hash common.Hash) error
PruneNode mocks base method.
func (*MockCanonicalChainBuilder) PruneRoot ¶
func (m *MockCanonicalChainBuilder) PruneRoot(newRootNum uint64) error
PruneRoot mocks base method.
func (*MockCanonicalChainBuilder) Reset ¶
func (m *MockCanonicalChainBuilder) Reset(root *types.Header)
Reset mocks base method.
func (*MockCanonicalChainBuilder) Root ¶
func (m *MockCanonicalChainBuilder) Root() *types.Header
Root mocks base method.
func (*MockCanonicalChainBuilder) Tip ¶
func (m *MockCanonicalChainBuilder) Tip() *types.Header
Tip mocks base method.
type MockCanonicalChainBuilderConnectCall ¶
MockCanonicalChainBuilderConnectCall wrap *gomock.Call
func (*MockCanonicalChainBuilderConnectCall) Do ¶
func (c *MockCanonicalChainBuilderConnectCall) Do(f func(context.Context, []*types.Header) ([]*types.Header, error)) *MockCanonicalChainBuilderConnectCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderConnectCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderConnectCall) DoAndReturn(f func(context.Context, []*types.Header) ([]*types.Header, error)) *MockCanonicalChainBuilderConnectCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderConnectCall) Return ¶
func (c *MockCanonicalChainBuilderConnectCall) Return(newConnectedHeaders []*types.Header, err error) *MockCanonicalChainBuilderConnectCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderContainsHashCall ¶
MockCanonicalChainBuilderContainsHashCall wrap *gomock.Call
func (*MockCanonicalChainBuilderContainsHashCall) Do ¶
func (c *MockCanonicalChainBuilderContainsHashCall) Do(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderContainsHashCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderContainsHashCall) DoAndReturn(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderContainsHashCall) Return ¶
func (c *MockCanonicalChainBuilderContainsHashCall) Return(arg0 bool) *MockCanonicalChainBuilderContainsHashCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderHeadersInRangeCall ¶
MockCanonicalChainBuilderHeadersInRangeCall wrap *gomock.Call
func (*MockCanonicalChainBuilderHeadersInRangeCall) Do ¶
func (c *MockCanonicalChainBuilderHeadersInRangeCall) Do(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderHeadersInRangeCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderHeadersInRangeCall) DoAndReturn(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderHeadersInRangeCall) Return ¶
func (c *MockCanonicalChainBuilderHeadersInRangeCall) Return(arg0 []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderLowestCommonAncestorCall ¶
MockCanonicalChainBuilderLowestCommonAncestorCall wrap *gomock.Call
func (*MockCanonicalChainBuilderLowestCommonAncestorCall) Do ¶
func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) Do(f func(common.Hash, common.Hash) (*types.Header, bool)) *MockCanonicalChainBuilderLowestCommonAncestorCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderLowestCommonAncestorCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) DoAndReturn(f func(common.Hash, common.Hash) (*types.Header, bool)) *MockCanonicalChainBuilderLowestCommonAncestorCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderLowestCommonAncestorCall) Return ¶
func (c *MockCanonicalChainBuilderLowestCommonAncestorCall) Return(arg0 *types.Header, arg1 bool) *MockCanonicalChainBuilderLowestCommonAncestorCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderMockRecorder ¶
type MockCanonicalChainBuilderMockRecorder struct {
// contains filtered or unexported fields
}
MockCanonicalChainBuilderMockRecorder is the mock recorder for MockCanonicalChainBuilder.
func (*MockCanonicalChainBuilderMockRecorder) Connect ¶
func (mr *MockCanonicalChainBuilderMockRecorder) Connect(ctx, headers any) *MockCanonicalChainBuilderConnectCall
Connect indicates an expected call of Connect.
func (*MockCanonicalChainBuilderMockRecorder) ContainsHash ¶
func (mr *MockCanonicalChainBuilderMockRecorder) ContainsHash(hash any) *MockCanonicalChainBuilderContainsHashCall
ContainsHash indicates an expected call of ContainsHash.
func (*MockCanonicalChainBuilderMockRecorder) HeadersInRange ¶
func (mr *MockCanonicalChainBuilderMockRecorder) HeadersInRange(start, count any) *MockCanonicalChainBuilderHeadersInRangeCall
HeadersInRange indicates an expected call of HeadersInRange.
func (*MockCanonicalChainBuilderMockRecorder) LowestCommonAncestor ¶
func (mr *MockCanonicalChainBuilderMockRecorder) LowestCommonAncestor(a, b any) *MockCanonicalChainBuilderLowestCommonAncestorCall
LowestCommonAncestor indicates an expected call of LowestCommonAncestor.
func (*MockCanonicalChainBuilderMockRecorder) PruneNode ¶
func (mr *MockCanonicalChainBuilderMockRecorder) PruneNode(hash any) *MockCanonicalChainBuilderPruneNodeCall
PruneNode indicates an expected call of PruneNode.
func (*MockCanonicalChainBuilderMockRecorder) PruneRoot ¶
func (mr *MockCanonicalChainBuilderMockRecorder) PruneRoot(newRootNum any) *MockCanonicalChainBuilderPruneRootCall
PruneRoot indicates an expected call of PruneRoot.
func (*MockCanonicalChainBuilderMockRecorder) Reset ¶
func (mr *MockCanonicalChainBuilderMockRecorder) Reset(root any) *MockCanonicalChainBuilderResetCall
Reset indicates an expected call of Reset.
func (*MockCanonicalChainBuilderMockRecorder) Root ¶
func (mr *MockCanonicalChainBuilderMockRecorder) Root() *MockCanonicalChainBuilderRootCall
Root indicates an expected call of Root.
func (*MockCanonicalChainBuilderMockRecorder) Tip ¶
func (mr *MockCanonicalChainBuilderMockRecorder) Tip() *MockCanonicalChainBuilderTipCall
Tip indicates an expected call of Tip.
type MockCanonicalChainBuilderPruneNodeCall ¶
MockCanonicalChainBuilderPruneNodeCall wrap *gomock.Call
func (*MockCanonicalChainBuilderPruneNodeCall) Do ¶
func (c *MockCanonicalChainBuilderPruneNodeCall) Do(f func(common.Hash) error) *MockCanonicalChainBuilderPruneNodeCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderPruneNodeCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderPruneNodeCall) DoAndReturn(f func(common.Hash) error) *MockCanonicalChainBuilderPruneNodeCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderPruneNodeCall) Return ¶
func (c *MockCanonicalChainBuilderPruneNodeCall) Return(arg0 error) *MockCanonicalChainBuilderPruneNodeCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderPruneRootCall ¶
MockCanonicalChainBuilderPruneRootCall wrap *gomock.Call
func (*MockCanonicalChainBuilderPruneRootCall) Do ¶
func (c *MockCanonicalChainBuilderPruneRootCall) Do(f func(uint64) error) *MockCanonicalChainBuilderPruneRootCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderPruneRootCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderPruneRootCall) DoAndReturn(f func(uint64) error) *MockCanonicalChainBuilderPruneRootCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderPruneRootCall) Return ¶
func (c *MockCanonicalChainBuilderPruneRootCall) Return(arg0 error) *MockCanonicalChainBuilderPruneRootCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderResetCall ¶
MockCanonicalChainBuilderResetCall wrap *gomock.Call
func (*MockCanonicalChainBuilderResetCall) Do ¶
func (c *MockCanonicalChainBuilderResetCall) Do(f func(*types.Header)) *MockCanonicalChainBuilderResetCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderResetCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderResetCall) DoAndReturn(f func(*types.Header)) *MockCanonicalChainBuilderResetCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderResetCall) Return ¶
func (c *MockCanonicalChainBuilderResetCall) Return() *MockCanonicalChainBuilderResetCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderRootCall ¶
MockCanonicalChainBuilderRootCall wrap *gomock.Call
func (*MockCanonicalChainBuilderRootCall) Do ¶
func (c *MockCanonicalChainBuilderRootCall) Do(f func() *types.Header) *MockCanonicalChainBuilderRootCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderRootCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderRootCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderRootCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderRootCall) Return ¶
func (c *MockCanonicalChainBuilderRootCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderRootCall
Return rewrite *gomock.Call.Return
type MockCanonicalChainBuilderTipCall ¶
MockCanonicalChainBuilderTipCall wrap *gomock.Call
func (*MockCanonicalChainBuilderTipCall) Do ¶
func (c *MockCanonicalChainBuilderTipCall) Do(f func() *types.Header) *MockCanonicalChainBuilderTipCall
Do rewrite *gomock.Call.Do
func (*MockCanonicalChainBuilderTipCall) DoAndReturn ¶
func (c *MockCanonicalChainBuilderTipCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderTipCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockCanonicalChainBuilderTipCall) Return ¶
func (c *MockCanonicalChainBuilderTipCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderTipCall
Return rewrite *gomock.Call.Return
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) InsertBlocks ¶
InsertBlocks mocks base method.
type MockStoreFlushCall ¶
MockStoreFlushCall wrap *gomock.Call
func (*MockStoreFlushCall) Do ¶
func (c *MockStoreFlushCall) Do(f func(context.Context) error) *MockStoreFlushCall
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 ¶
MockStoreInsertBlocksCall wrap *gomock.Call
func (*MockStoreInsertBlocksCall) Do ¶
func (c *MockStoreInsertBlocksCall) Do(f func(context.Context, []*types.Block) error) *MockStoreInsertBlocksCall
Do rewrite *gomock.Call.Do
func (*MockStoreInsertBlocksCall) DoAndReturn ¶
func (c *MockStoreInsertBlocksCall) DoAndReturn(f func(context.Context, []*types.Block) error) *MockStoreInsertBlocksCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockStoreInsertBlocksCall) Return ¶
func (c *MockStoreInsertBlocksCall) Return(arg0 error) *MockStoreInsertBlocksCall
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 ¶
func (mr *MockStoreMockRecorder) Flush(ctx any) *MockStoreFlushCall
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) Run ¶
func (mr *MockStoreMockRecorder) Run(ctx any) *MockStoreRunCall
Run indicates an expected call of Run.
type MockStoreRunCall ¶
MockStoreRunCall wrap *gomock.Call
func (*MockStoreRunCall) Do ¶
func (c *MockStoreRunCall) Do(f func(context.Context) error) *MockStoreRunCall
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 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 ¶
func (m *MockwaypointReader) EXPECT() *MockwaypointReaderMockRecorder
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 ¶
MockwaypointReaderCheckpointsFromBlockCall wrap *gomock.Call
func (*MockwaypointReaderCheckpointsFromBlockCall) Do ¶
func (c *MockwaypointReaderCheckpointsFromBlockCall) Do(f func(context.Context, uint64) ([]*heimdall.Checkpoint, error)) *MockwaypointReaderCheckpointsFromBlockCall
Do rewrite *gomock.Call.Do
func (*MockwaypointReaderCheckpointsFromBlockCall) DoAndReturn ¶
func (c *MockwaypointReaderCheckpointsFromBlockCall) DoAndReturn(f func(context.Context, uint64) ([]*heimdall.Checkpoint, error)) *MockwaypointReaderCheckpointsFromBlockCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockwaypointReaderCheckpointsFromBlockCall) Return ¶
func (c *MockwaypointReaderCheckpointsFromBlockCall) Return(arg0 []*heimdall.Checkpoint, arg1 error) *MockwaypointReaderCheckpointsFromBlockCall
Return rewrite *gomock.Call.Return
type MockwaypointReaderMilestonesFromBlockCall ¶
MockwaypointReaderMilestonesFromBlockCall wrap *gomock.Call
func (*MockwaypointReaderMilestonesFromBlockCall) Do ¶
func (c *MockwaypointReaderMilestonesFromBlockCall) Do(f func(context.Context, uint64) ([]*heimdall.Milestone, error)) *MockwaypointReaderMilestonesFromBlockCall
Do rewrite *gomock.Call.Do
func (*MockwaypointReaderMilestonesFromBlockCall) DoAndReturn ¶
func (c *MockwaypointReaderMilestonesFromBlockCall) DoAndReturn(f func(context.Context, uint64) ([]*heimdall.Milestone, error)) *MockwaypointReaderMilestonesFromBlockCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockwaypointReaderMilestonesFromBlockCall) Return ¶
func (c *MockwaypointReaderMilestonesFromBlockCall) Return(arg0 []*heimdall.Milestone, arg1 error) *MockwaypointReaderMilestonesFromBlockCall
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 ¶
func NewService ¶
func NewService( logger log.Logger, chainConfig *chain.Config, sentryClient sentryproto.SentryClient, maxPeers int, statusDataProvider *sentry.StatusDataProvider, executionClient executionproto.ExecutionClient, blockReader *freezeblocks.BlockReader, blockLimit uint, bridgeService bridge.Service, heimdallService heimdall.Service, ) Service
type Store ¶
type Store interface { // 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( store Store, execution ExecutionClient, milestoneVerifier WaypointHeadersVerifier, blocksVerifier BlocksVerifier, p2pService p2p.Service, blockDownloader BlockDownloader, ccBuilderFactory CanonicalChainBuilderFactory, heimdallSync heimdallSynchronizer, bridgeSync bridgeSynchronizer, events <-chan Event, logger log.Logger, ) *Sync
type TipEvents ¶
type TipEvents struct {
// contains filtered or unexported fields
}
func NewTipEvents ¶
func NewTipEvents( logger log.Logger, p2pObserverRegistrar p2pObserverRegistrar, heimdallObserverRegistrar heimdallObserverRegistrar, ) *TipEvents
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)
Source Files ¶
- block_downloader.go
- block_producers_reader.go
- blocks_verifier.go
- canonical_chain_builder.go
- canonical_chain_builder_factory.go
- canonical_chain_builder_mock.go
- difficulty.go
- event_channel.go
- execution_client.go
- header_time_validator.go
- header_validator.go
- log_prefix.go
- service.go
- store.go
- store_mock.go
- sync.go
- tip_events.go
- waypoint_headers_verifier.go
- waypoint_reader.go
- waypoint_reader_mock.go