Documentation ¶
Overview ¶
Package heimdall is a generated GoMock package.
Package heimdall is a generated GoMock package.
Package heimdall is a generated GoMock package.
Package heimdall is a generated GoMock package.
Index ¶
- Constants
- Variables
- func CalculateEventWindow(ctx context.Context, config *borcfg.BorConfig, header *types.Header, ...) (from time.Time, to time.Time, err error)
- func CheckpointsEnabled() bool
- func EventId(encodedEvent rlp.RawValue) uint64
- func EventTime(encodedEvent rlp.RawValue) time.Time
- func Fetch[T any](ctx context.Context, request *Request, logger log.Logger) (*T, error)
- func FetchWithRetry[T any](ctx context.Context, client *Client, url *url.URL, logger log.Logger) (*T, error)
- func FetchWithRetryEx[T any](ctx context.Context, client *Client, url *url.URL, ...) (result *T, err error)
- func IsBlockInLastSprintOfSpan(blockNum uint64, config *borcfg.BorConfig) bool
- func MilestonesEnabled() bool
- func NewSpanSnapshotStore(base EntityStore[*Span], snapshots *RoSnapshots) *spanSnapshotStore
- func RecordWayPoints(value bool)
- func RemoteEventCheckForBlock(header *types.Header, previousHeader *types.Header, chainId string, ...) error
- func SnapshotTypes() []snaptype.Type
- func SpanEndBlockNum(spanId SpanId) uint64
- func ValidateBorEvents(ctx context.Context, config *borcfg.BorConfig, db kv.RoDB, ...) (uint64, error)
- type BackendServer
- type Checkpoint
- func (c *Checkpoint) BlockNumRange() ClosedRange
- func (c *Checkpoint) CmpRange(n uint64) int
- func (c *Checkpoint) EndBlock() *big.Int
- func (c *Checkpoint) Length() uint64
- func (c *Checkpoint) MarshalJSON() ([]byte, error)
- func (c *Checkpoint) RawId() uint64
- func (c *Checkpoint) RootHash() libcommon.Hash
- func (c *Checkpoint) SetRawId(id uint64)
- func (c *Checkpoint) StartBlock() *big.Int
- func (c *Checkpoint) String() string
- func (c *Checkpoint) Timestamp() uint64
- func (c *Checkpoint) UnmarshalJSON(b []byte) error
- type CheckpointCount
- type CheckpointCountResponse
- type CheckpointId
- type CheckpointListResponse
- type CheckpointResponse
- type Client
- func (c *Client) Close()
- func (c *Client) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
- func (c *Client) FetchCheckpointCount(ctx context.Context) (int64, error)
- func (c *Client) FetchCheckpoints(ctx context.Context, page uint64, limit uint64) ([]*Checkpoint, error)
- func (c *Client) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
- func (c *Client) FetchLastNoAckMilestone(ctx context.Context) (string, error)
- func (c *Client) FetchLatestSpan(ctx context.Context) (*Span, error)
- func (c *Client) FetchMilestone(ctx context.Context, number int64) (*Milestone, error)
- func (c *Client) FetchMilestoneCount(ctx context.Context) (int64, error)
- func (c *Client) FetchMilestoneID(ctx context.Context, milestoneID string) error
- func (c *Client) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
- func (c *Client) FetchSpan(ctx context.Context, spanID uint64) (*Span, error)
- func (c *Client) FetchSpans(ctx context.Context, page uint64, limit uint64) ([]*Span, error)
- func (c *Client) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
- func (c *Client) FetchStateSyncEvents(ctx context.Context, fromID uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
- type ClosedRange
- type Entity
- type EntityStore
- type EventRangeExtractor
- type EventRecord
- type EventRecordWithTime
- type HeimdallClient
- type HttpClient
- type MdbxStore
- func (s *MdbxStore) Checkpoints() EntityStore[*Checkpoint]
- func (s *MdbxStore) Close()
- func (s *MdbxStore) Milestones() EntityStore[*Milestone]
- func (s *MdbxStore) Prepare(ctx context.Context) error
- func (s *MdbxStore) SpanBlockProducerSelections() EntityStore[*SpanBlockProducerSelection]
- func (s *MdbxStore) Spans() EntityStore[*Span]
- type Milestone
- func (m *Milestone) BlockNumRange() ClosedRange
- func (m *Milestone) CmpRange(n uint64) int
- func (m *Milestone) EndBlock() *big.Int
- func (m *Milestone) Length() uint64
- func (m *Milestone) MarshalJSON() ([]byte, error)
- func (m *Milestone) RawId() uint64
- func (m *Milestone) RootHash() libcommon.Hash
- func (m *Milestone) SetRawId(_ uint64)
- func (m *Milestone) StartBlock() *big.Int
- func (m *Milestone) String() string
- func (m *Milestone) Timestamp() uint64
- func (m *Milestone) UnmarshalJSON(b []byte) error
- type MilestoneCount
- type MilestoneCountResponse
- type MilestoneID
- type MilestoneIDResponse
- type MilestoneId
- type MilestoneLastNoAck
- type MilestoneLastNoAckResponse
- type MilestoneNoAck
- type MilestoneNoAckResponse
- type MilestoneResponse
- type MockEntityStore
- func (m *MockEntityStore[TEntity]) Close()
- func (m *MockEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, blockNum uint64) (int, error)
- func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, blockNum uint64, limit int) (int, error)
- func (m *MockEntityStore[TEntity]) EXPECT() *MockEntityStoreMockRecorder[TEntity]
- func (m *MockEntityStore[TEntity]) Entity(ctx context.Context, id uint64) (TEntity, bool, error)
- func (m *MockEntityStore[TEntity]) EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error)
- func (m *MockEntityStore[TEntity]) LastEntity(ctx context.Context) (TEntity, bool, error)
- func (m *MockEntityStore[TEntity]) LastEntityId(ctx context.Context) (uint64, bool, error)
- func (m *MockEntityStore[TEntity]) LastFrozenEntityId() uint64
- func (m *MockEntityStore[TEntity]) Prepare(ctx context.Context) error
- func (m *MockEntityStore[TEntity]) PutEntity(ctx context.Context, id uint64, entity TEntity) error
- func (m *MockEntityStore[TEntity]) RangeFromBlockNum(ctx context.Context, startBlockNum uint64) ([]TEntity, error)
- func (m *MockEntityStore[TEntity]) SnapType() snaptype.Type
- type MockEntityStoreCloseCall
- type MockEntityStoreDeleteFromBlockNumCall
- func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
- func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
- func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
- type MockEntityStoreDeleteToBlockNumCall
- func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Do(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity]
- func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity]
- func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteToBlockNumCall[TEntity]
- type MockEntityStoreEntityCall
- func (c *MockEntityStoreEntityCall[TEntity]) Do(f func(context.Context, uint64) (TEntity, bool, error)) *MockEntityStoreEntityCall[TEntity]
- func (c *MockEntityStoreEntityCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (TEntity, bool, error)) *MockEntityStoreEntityCall[TEntity]
- func (c *MockEntityStoreEntityCall[TEntity]) Return(arg0 TEntity, arg1 bool, arg2 error) *MockEntityStoreEntityCall[TEntity]
- type MockEntityStoreEntityIdFromBlockNumCall
- func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
- func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
- func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
- type MockEntityStoreLastEntityCall
- func (c *MockEntityStoreLastEntityCall[TEntity]) Do(f func(context.Context) (TEntity, bool, error)) *MockEntityStoreLastEntityCall[TEntity]
- func (c *MockEntityStoreLastEntityCall[TEntity]) DoAndReturn(f func(context.Context) (TEntity, bool, error)) *MockEntityStoreLastEntityCall[TEntity]
- func (c *MockEntityStoreLastEntityCall[TEntity]) Return(arg0 TEntity, arg1 bool, arg2 error) *MockEntityStoreLastEntityCall[TEntity]
- type MockEntityStoreLastEntityIdCall
- func (c *MockEntityStoreLastEntityIdCall[TEntity]) Do(f func(context.Context) (uint64, bool, error)) *MockEntityStoreLastEntityIdCall[TEntity]
- func (c *MockEntityStoreLastEntityIdCall[TEntity]) DoAndReturn(f func(context.Context) (uint64, bool, error)) *MockEntityStoreLastEntityIdCall[TEntity]
- func (c *MockEntityStoreLastEntityIdCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreLastEntityIdCall[TEntity]
- type MockEntityStoreLastFrozenEntityIdCall
- func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) Do(f func() uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
- func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) DoAndReturn(f func() uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
- func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) Return(arg0 uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
- type MockEntityStoreMockRecorder
- func (mr *MockEntityStoreMockRecorder[TEntity]) Close() *MockEntityStoreCloseCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteFromBlockNum(ctx any, blockNum any) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx any, blockNum any, limit any) *MockEntityStoreDeleteToBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) Entity(ctx, id any) *MockEntityStoreEntityCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum(ctx any, blockNum any) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) LastEntity(ctx any) *MockEntityStoreLastEntityCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) LastEntityId(ctx any) *MockEntityStoreLastEntityIdCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) LastFrozenEntityId() *MockEntityStoreLastFrozenEntityIdCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) Prepare(ctx any) *MockEntityStorePrepareCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) PutEntity(ctx, id, entity any) *MockEntityStorePutEntityCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) RangeFromBlockNum(ctx, startBlockNum any) *MockEntityStoreRangeFromBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) SnapType() *MockEntityStoreSnapTypeCall[TEntity]
- type MockEntityStorePrepareCall
- func (c *MockEntityStorePrepareCall[TEntity]) Do(f func(context.Context) error) *MockEntityStorePrepareCall[TEntity]
- func (c *MockEntityStorePrepareCall[TEntity]) DoAndReturn(f func(context.Context) error) *MockEntityStorePrepareCall[TEntity]
- func (c *MockEntityStorePrepareCall[TEntity]) Return(arg0 error) *MockEntityStorePrepareCall[TEntity]
- type MockEntityStorePutEntityCall
- func (c *MockEntityStorePutEntityCall[TEntity]) Do(f func(context.Context, uint64, TEntity) error) *MockEntityStorePutEntityCall[TEntity]
- func (c *MockEntityStorePutEntityCall[TEntity]) DoAndReturn(f func(context.Context, uint64, TEntity) error) *MockEntityStorePutEntityCall[TEntity]
- func (c *MockEntityStorePutEntityCall[TEntity]) Return(arg0 error) *MockEntityStorePutEntityCall[TEntity]
- type MockEntityStoreRangeFromBlockNumCall
- func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) ([]TEntity, error)) *MockEntityStoreRangeFromBlockNumCall[TEntity]
- func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) ([]TEntity, error)) *MockEntityStoreRangeFromBlockNumCall[TEntity]
- func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockEntityStoreRangeFromBlockNumCall[TEntity]
- type MockEntityStoreSnapTypeCall
- func (c *MockEntityStoreSnapTypeCall[TEntity]) Do(f func() snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
- func (c *MockEntityStoreSnapTypeCall[TEntity]) DoAndReturn(f func() snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
- func (c *MockEntityStoreSnapTypeCall[TEntity]) Return(arg0 snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
- type MockHeimdallClient
- func (m *MockHeimdallClient) Close()
- func (m *MockHeimdallClient) EXPECT() *MockHeimdallClientMockRecorder
- func (m *MockHeimdallClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
- func (m *MockHeimdallClient) FetchCheckpointCount(ctx context.Context) (int64, error)
- func (m *MockHeimdallClient) FetchCheckpoints(ctx context.Context, page, limit uint64) ([]*Checkpoint, error)
- func (m *MockHeimdallClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
- func (m *MockHeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
- func (m *MockHeimdallClient) FetchLatestSpan(ctx context.Context) (*Span, error)
- func (m *MockHeimdallClient) FetchMilestone(ctx context.Context, number int64) (*Milestone, error)
- func (m *MockHeimdallClient) FetchMilestoneCount(ctx context.Context) (int64, error)
- func (m *MockHeimdallClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
- func (m *MockHeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
- func (m *MockHeimdallClient) FetchSpan(ctx context.Context, spanID uint64) (*Span, error)
- func (m *MockHeimdallClient) FetchSpans(ctx context.Context, page, limit uint64) ([]*Span, error)
- func (m *MockHeimdallClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
- func (m *MockHeimdallClient) FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
- type MockHeimdallClientCloseCall
- type MockHeimdallClientFetchCheckpointCall
- func (c *MockHeimdallClientFetchCheckpointCall) Do(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall
- func (c *MockHeimdallClientFetchCheckpointCall) DoAndReturn(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall
- func (c *MockHeimdallClientFetchCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockHeimdallClientFetchCheckpointCall
- type MockHeimdallClientFetchCheckpointCountCall
- func (c *MockHeimdallClientFetchCheckpointCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall
- func (c *MockHeimdallClientFetchCheckpointCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall
- func (c *MockHeimdallClientFetchCheckpointCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchCheckpointCountCall
- type MockHeimdallClientFetchCheckpointsCall
- func (c *MockHeimdallClientFetchCheckpointsCall) Do(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockHeimdallClientFetchCheckpointsCall
- func (c *MockHeimdallClientFetchCheckpointsCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockHeimdallClientFetchCheckpointsCall
- func (c *MockHeimdallClientFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockHeimdallClientFetchCheckpointsCall
- type MockHeimdallClientFetchFirstMilestoneNumCall
- func (c *MockHeimdallClientFetchFirstMilestoneNumCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchFirstMilestoneNumCall
- func (c *MockHeimdallClientFetchFirstMilestoneNumCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchFirstMilestoneNumCall
- func (c *MockHeimdallClientFetchFirstMilestoneNumCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchFirstMilestoneNumCall
- type MockHeimdallClientFetchLastNoAckMilestoneCall
- func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Do(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall
- func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) DoAndReturn(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall
- func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Return(arg0 string, arg1 error) *MockHeimdallClientFetchLastNoAckMilestoneCall
- type MockHeimdallClientFetchLatestSpanCall
- func (c *MockHeimdallClientFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall
- func (c *MockHeimdallClientFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall
- func (c *MockHeimdallClientFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchLatestSpanCall
- type MockHeimdallClientFetchMilestoneCall
- func (c *MockHeimdallClientFetchMilestoneCall) Do(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall
- func (c *MockHeimdallClientFetchMilestoneCall) DoAndReturn(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall
- func (c *MockHeimdallClientFetchMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockHeimdallClientFetchMilestoneCall
- type MockHeimdallClientFetchMilestoneCountCall
- func (c *MockHeimdallClientFetchMilestoneCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall
- func (c *MockHeimdallClientFetchMilestoneCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall
- func (c *MockHeimdallClientFetchMilestoneCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchMilestoneCountCall
- type MockHeimdallClientFetchMilestoneIDCall
- func (c *MockHeimdallClientFetchMilestoneIDCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall
- func (c *MockHeimdallClientFetchMilestoneIDCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall
- func (c *MockHeimdallClientFetchMilestoneIDCall) Return(arg0 error) *MockHeimdallClientFetchMilestoneIDCall
- type MockHeimdallClientFetchNoAckMilestoneCall
- func (c *MockHeimdallClientFetchNoAckMilestoneCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall
- func (c *MockHeimdallClientFetchNoAckMilestoneCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall
- func (c *MockHeimdallClientFetchNoAckMilestoneCall) Return(arg0 error) *MockHeimdallClientFetchNoAckMilestoneCall
- type MockHeimdallClientFetchSpanCall
- func (c *MockHeimdallClientFetchSpanCall) Do(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall
- func (c *MockHeimdallClientFetchSpanCall) DoAndReturn(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall
- func (c *MockHeimdallClientFetchSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchSpanCall
- type MockHeimdallClientFetchSpansCall
- func (c *MockHeimdallClientFetchSpansCall) Do(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockHeimdallClientFetchSpansCall
- func (c *MockHeimdallClientFetchSpansCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockHeimdallClientFetchSpansCall
- func (c *MockHeimdallClientFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockHeimdallClientFetchSpansCall
- type MockHeimdallClientFetchStateSyncEventCall
- func (c *MockHeimdallClientFetchStateSyncEventCall) Do(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall
- func (c *MockHeimdallClientFetchStateSyncEventCall) DoAndReturn(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall
- func (c *MockHeimdallClientFetchStateSyncEventCall) Return(arg0 *EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventCall
- type MockHeimdallClientFetchStateSyncEventsCall
- func (c *MockHeimdallClientFetchStateSyncEventsCall) Do(...) *MockHeimdallClientFetchStateSyncEventsCall
- func (c *MockHeimdallClientFetchStateSyncEventsCall) DoAndReturn(...) *MockHeimdallClientFetchStateSyncEventsCall
- func (c *MockHeimdallClientFetchStateSyncEventsCall) Return(arg0 []*EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventsCall
- type MockHeimdallClientMockRecorder
- func (mr *MockHeimdallClientMockRecorder) Close() *MockHeimdallClientCloseCall
- func (mr *MockHeimdallClientMockRecorder) FetchCheckpoint(ctx, number any) *MockHeimdallClientFetchCheckpointCall
- func (mr *MockHeimdallClientMockRecorder) FetchCheckpointCount(ctx any) *MockHeimdallClientFetchCheckpointCountCall
- func (mr *MockHeimdallClientMockRecorder) FetchCheckpoints(ctx, page, limit any) *MockHeimdallClientFetchCheckpointsCall
- func (mr *MockHeimdallClientMockRecorder) FetchFirstMilestoneNum(ctx any) *MockHeimdallClientFetchFirstMilestoneNumCall
- func (mr *MockHeimdallClientMockRecorder) FetchLastNoAckMilestone(ctx any) *MockHeimdallClientFetchLastNoAckMilestoneCall
- func (mr *MockHeimdallClientMockRecorder) FetchLatestSpan(ctx any) *MockHeimdallClientFetchLatestSpanCall
- func (mr *MockHeimdallClientMockRecorder) FetchMilestone(ctx, number any) *MockHeimdallClientFetchMilestoneCall
- func (mr *MockHeimdallClientMockRecorder) FetchMilestoneCount(ctx any) *MockHeimdallClientFetchMilestoneCountCall
- func (mr *MockHeimdallClientMockRecorder) FetchMilestoneID(ctx, milestoneID any) *MockHeimdallClientFetchMilestoneIDCall
- func (mr *MockHeimdallClientMockRecorder) FetchNoAckMilestone(ctx, milestoneID any) *MockHeimdallClientFetchNoAckMilestoneCall
- func (mr *MockHeimdallClientMockRecorder) FetchSpan(ctx, spanID any) *MockHeimdallClientFetchSpanCall
- func (mr *MockHeimdallClientMockRecorder) FetchSpans(ctx, page, limit any) *MockHeimdallClientFetchSpansCall
- func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvent(ctx, id any) *MockHeimdallClientFetchStateSyncEventCall
- func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvents(ctx, fromId, to, limit any) *MockHeimdallClientFetchStateSyncEventsCall
- type MockHttpClient
- type MockHttpClientCloseIdleConnectionsCall
- func (c *MockHttpClientCloseIdleConnectionsCall) Do(f func()) *MockHttpClientCloseIdleConnectionsCall
- func (c *MockHttpClientCloseIdleConnectionsCall) DoAndReturn(f func()) *MockHttpClientCloseIdleConnectionsCall
- func (c *MockHttpClientCloseIdleConnectionsCall) Return() *MockHttpClientCloseIdleConnectionsCall
- type MockHttpClientDoCall
- func (c *MockHttpClientDoCall) Do(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall
- func (c *MockHttpClientDoCall) DoAndReturn(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall
- func (c *MockHttpClientDoCall) Return(arg0 *http.Response, arg1 error) *MockHttpClientDoCall
- type MockHttpClientMockRecorder
- type MockentityFetcher
- func (m *MockentityFetcher[TEntity]) EXPECT() *MockentityFetcherMockRecorder[TEntity]
- func (m *MockentityFetcher[TEntity]) FetchAllEntities(ctx context.Context) ([]TEntity, error)
- func (m *MockentityFetcher[TEntity]) FetchEntitiesRange(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
- func (m *MockentityFetcher[TEntity]) FetchEntityIdRange(ctx context.Context) (ClosedRange, error)
- type MockentityFetcherFetchAllEntitiesCall
- func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) Do(f func(context.Context) ([]TEntity, error)) *MockentityFetcherFetchAllEntitiesCall[TEntity]
- func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) DoAndReturn(f func(context.Context) ([]TEntity, error)) *MockentityFetcherFetchAllEntitiesCall[TEntity]
- func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockentityFetcherFetchAllEntitiesCall[TEntity]
- type MockentityFetcherFetchEntitiesRangeCall
- func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) Do(f func(context.Context, ClosedRange) ([]TEntity, error)) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
- func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) DoAndReturn(f func(context.Context, ClosedRange) ([]TEntity, error)) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
- func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
- type MockentityFetcherFetchEntityIdRangeCall
- func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) Do(f func(context.Context) (ClosedRange, error)) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
- func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) DoAndReturn(f func(context.Context) (ClosedRange, error)) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
- func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) Return(arg0 ClosedRange, arg1 error) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
- type MockentityFetcherMockRecorder
- func (mr *MockentityFetcherMockRecorder[TEntity]) FetchAllEntities(ctx any) *MockentityFetcherFetchAllEntitiesCall[TEntity]
- func (mr *MockentityFetcherMockRecorder[TEntity]) FetchEntitiesRange(ctx, idRange any) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
- func (mr *MockentityFetcherMockRecorder[TEntity]) FetchEntityIdRange(ctx any) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
- type NoopEntityStore
- func (NoopEntityStore[TEntity]) Close()
- func (NoopEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, unwindPoint uint64) (int, error)
- func (NoopEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, unwindPoint uint64, limit int) (int, error)
- func (NoopEntityStore[TEntity]) Entity(ctx context.Context, id uint64) (TEntity, bool, error)
- func (NoopEntityStore[TEntity]) EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error)
- func (NoopEntityStore[TEntity]) LastEntity(ctx context.Context) (TEntity, bool, error)
- func (NoopEntityStore[TEntity]) LastEntityId(ctx context.Context) (uint64, bool, error)
- func (NoopEntityStore[TEntity]) LastFrozenEntityId() uint64
- func (NoopEntityStore[TEntity]) Prepare(ctx context.Context) error
- func (NoopEntityStore[TEntity]) PutEntity(ctx context.Context, id uint64, entity TEntity) error
- func (NoopEntityStore[TEntity]) RangeFromBlockNum(ctx context.Context, startBlockNum uint64) ([]TEntity, error)
- func (ns NoopEntityStore[TEntity]) SnapType() snaptype.Type
- type ObserverOption
- type ObserverOptions
- type RangeIndex
- type RangeIndexFactory
- type RangeIndexFunc
- type RangeIndexer
- type Reader
- func (r *Reader) CheckpointsFromBlock(ctx context.Context, startBlock uint64) ([]*Checkpoint, error)
- func (r *Reader) Close()
- func (r *Reader) MilestonesFromBlock(ctx context.Context, startBlock uint64) ([]*Milestone, error)
- func (r *Reader) Prepare(ctx context.Context) error
- func (r *Reader) Producers(ctx context.Context, blockNum uint64) (*valset.ValidatorSet, error)
- func (r *Reader) Span(ctx context.Context, id uint64) (*Span, bool, error)
- type ReaderConfig
- type RemoteReader
- type Request
- type RoSnapshots
- type Service
- type ServiceConfig
- type SnapshotStore
- func (s *SnapshotStore) Checkpoints() EntityStore[*Checkpoint]
- func (s *SnapshotStore) Milestones() EntityStore[*Milestone]
- func (s *SnapshotStore) Prepare(ctx context.Context) error
- func (s *SnapshotStore) SpanBlockProducerSelections() EntityStore[*SpanBlockProducerSelection]
- func (s *SnapshotStore) Spans() EntityStore[*Span]
- type Span
- type SpanBlockProducerSelection
- type SpanId
- type SpanListResponse
- type SpanResponse
- type StateSyncEventResponse
- type StateSyncEventsResponse
- type Store
- type TransactionalRangeIndex
- type View
- func (v *View) Checkpoints() []*snapshotsync.VisibleSegment
- func (v *View) Close()
- func (v *View) Events() []*snapshotsync.VisibleSegment
- func (v *View) EventsSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
- func (v *View) Milestones() []*snapshotsync.VisibleSegment
- func (v *View) Spans() []*snapshotsync.VisibleSegment
- func (v *View) SpansSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
- type Waypoint
- type WaypointFields
- type Waypoints
Constants ¶
const ( StateEventsFetchLimit = 50 SpansFetchLimit = 150 CheckpointsFetchLimit = 10_000 )
Variables ¶
var ( // ErrShutdownDetected is returned if a shutdown was detected ErrShutdownDetected = errors.New("shutdown detected") ErrNoResponse = errors.New("got a nil response") ErrNotSuccessfulResponse = errors.New("error while fetching data from Heimdall") ErrNotInRejectedList = errors.New("milestoneId doesn't exist in rejected list") ErrNotInMilestoneList = errors.New("milestoneId doesn't exist in Heimdall") ErrNotInCheckpointList = errors.New("checkpontId doesn't exist in Heimdall") ErrBadGateway = errors.New("bad gateway") )
var ( Events = snaptype.RegisterType( Enums.Events, "borevents", snaptype.Versions{ Current: 1, MinSupported: 1, }, EventRangeExtractor{}, []snaptype.Index{Indexes.BorTxnHash}, snaptype.IndexBuilderFunc( func(ctx context.Context, sn snaptype.FileInfo, salt uint32, chainConfig *chain.Config, tmpDir string, p *background.Progress, lvl log.Lvl, logger log.Logger) (err error) { defer func() { if rec := recover(); rec != nil { err = fmt.Errorf("BorEventsIdx: at=%d-%d, %v, %s", sn.From, sn.To, rec, dbg.Stack()) } }() d, err := seg.NewDecompressor(sn.Path) if err != nil { return err } defer d.Close() g := d.MakeGetter() var blockNumBuf [length.BlockNum]byte var first bool = true word := make([]byte, 0, 4096) var blockCount int var baseEventId uint64 for g.HasNext() { word, _ = g.Next(word[:0]) if first || !bytes.Equal(blockNumBuf[:], word[length.Hash:length.Hash+length.BlockNum]) { blockCount++ copy(blockNumBuf[:], word[length.Hash:length.Hash+length.BlockNum]) } if first { baseEventId = binary.BigEndian.Uint64(word[length.Hash+length.BlockNum : length.Hash+length.BlockNum+8]) first = false } select { case <-ctx.Done(): return ctx.Err() default: } } rs, err := recsplit.NewRecSplit(recsplit.RecSplitArgs{ KeyCount: blockCount, Enums: blockCount > 0, BucketSize: 2000, LeafSize: 8, TmpDir: tmpDir, IndexFile: filepath.Join(sn.Dir(), snaptype.IdxFileName(sn.Version, sn.From, sn.To, Enums.Events.String())), BaseDataID: baseEventId, }, logger) if err != nil { return err } rs.LogLvl(log.LvlDebug) defer d.EnableReadAhead().DisableReadAhead() for { g.Reset(0) first = true var i, offset, nextPos uint64 for g.HasNext() { word, nextPos = g.Next(word[:0]) i++ if first || !bytes.Equal(blockNumBuf[:], word[length.Hash:length.Hash+length.BlockNum]) { if err = rs.AddKey(word[:length.Hash], offset); err != nil { return err } copy(blockNumBuf[:], word[length.Hash:length.Hash+length.BlockNum]) } if first { first = false } select { case <-ctx.Done(): return ctx.Err() default: } offset = nextPos } if err = rs.Build(ctx); err != nil { if errors.Is(err, recsplit.ErrCollision) { logger.Info("Building recsplit. Collision happened. It's ok. Restarting with another salt...", "err", err) rs.ResetNextSalt() continue } return err } return nil } })) Spans = snaptype.RegisterType( Enums.Spans, "borspans", snaptype.Versions{ Current: 1, MinSupported: 1, }, snaptype.RangeExtractorFunc( func(ctx context.Context, blockFrom, blockTo uint64, firstKeyGetter snaptype.FirstKeyGetter, db kv.RoDB, _ *chain.Config, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (uint64, error) { spanFrom := uint64(SpanIdAt(blockFrom)) spanTo := uint64(SpanIdAt(blockTo)) return extractValueRange(ctx, kv.BorSpans, spanFrom, spanTo, db, collect, workers, lvl, logger) }), []snaptype.Index{Indexes.BorSpanId}, snaptype.IndexBuilderFunc( func(ctx context.Context, sn snaptype.FileInfo, salt uint32, _ *chain.Config, tmpDir string, p *background.Progress, lvl log.Lvl, logger log.Logger) (err error) { d, err := seg.NewDecompressor(sn.Path) if err != nil { return err } defer d.Close() baseSpanId := uint64(SpanIdAt(sn.From)) return buildValueIndex(ctx, sn, salt, d, baseSpanId, tmpDir, p, lvl, logger) }), ) Checkpoints = snaptype.RegisterType( Enums.Checkpoints, "borcheckpoints", snaptype.Versions{ Current: 1, MinSupported: 1, }, snaptype.RangeExtractorFunc( func(ctx context.Context, blockFrom, blockTo uint64, firstKeyGetter snaptype.FirstKeyGetter, db kv.RoDB, _ *chain.Config, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (uint64, error) { var checkpointTo, checkpointFrom CheckpointId checkpointId := func(rangeIndex RangeIndex, blockNum uint64) (CheckpointId, error) { checkpointId, _, err := rangeIndex.Lookup(ctx, blockNum) return CheckpointId(checkpointId), err } err := db.View(ctx, func(tx kv.Tx) (err error) { rangeIndex := NewTxRangeIndex(db, kv.BorCheckpointEnds, tx) checkpointFrom, err = checkpointId(rangeIndex, blockFrom) if err != nil { return err } checkpointTo, err = checkpointId(rangeIndex, blockTo) if err != nil { return err } if blockFrom > 0 { if prevTo, err := checkpointId(rangeIndex, blockFrom-1); err == nil { if prevTo == checkpointFrom { if prevTo == checkpointTo { checkpointFrom = 0 checkpointTo = 0 } else { checkpointFrom++ } } } } return err }) if err != nil { return 0, err } return extractValueRange(ctx, kv.BorCheckpoints, uint64(checkpointFrom), uint64(checkpointTo), db, collect, workers, lvl, logger) }), []snaptype.Index{Indexes.BorCheckpointId}, snaptype.IndexBuilderFunc( func(ctx context.Context, sn snaptype.FileInfo, salt uint32, _ *chain.Config, tmpDir string, p *background.Progress, lvl log.Lvl, logger log.Logger) (err error) { d, err := seg.NewDecompressor(sn.Path) if err != nil { return err } defer d.Close() gg := d.MakeGetter() var firstCheckpointId uint64 if gg.HasNext() { buf, _ := d.MakeGetter().Next(nil) var firstCheckpoint Checkpoint if err = json.Unmarshal(buf, &firstCheckpoint); err != nil { return err } firstCheckpointId = uint64(firstCheckpoint.Id) } return buildValueIndex(ctx, sn, salt, d, firstCheckpointId, tmpDir, p, lvl, logger) }), ) Milestones = snaptype.RegisterType( Enums.Milestones, "bormilestones", snaptype.Versions{ Current: 1, MinSupported: 1, }, snaptype.RangeExtractorFunc( func(ctx context.Context, blockFrom, blockTo uint64, firstKeyGetter snaptype.FirstKeyGetter, db kv.RoDB, _ *chain.Config, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (uint64, error) { var milestoneFrom, milestoneTo MilestoneId milestoneId := func(rangeIndex RangeIndex, blockNum uint64) (MilestoneId, error) { milestoneId, _, err := rangeIndex.Lookup(ctx, blockNum) return MilestoneId(milestoneId), err } err := db.View(ctx, func(tx kv.Tx) (err error) { rangeIndex := NewTxRangeIndex(db, kv.BorMilestoneEnds, tx) milestoneFrom, err = milestoneId(rangeIndex, blockFrom) if err != nil && !errors.Is(err, ErrMilestoneNotFound) { return err } milestoneTo, err = milestoneId(rangeIndex, blockTo) if err != nil && !errors.Is(err, ErrMilestoneNotFound) { return err } if milestoneFrom > 0 && blockFrom > 0 { if prevTo, err := milestoneId(rangeIndex, blockFrom-1); err == nil && prevTo == milestoneFrom { if prevTo == milestoneFrom { if prevTo == milestoneTo { milestoneFrom = 0 milestoneTo = 0 } else { milestoneFrom++ } } } } return nil }) if err != nil { return 0, err } return extractValueRange(ctx, kv.BorMilestones, uint64(milestoneFrom), uint64(milestoneTo), db, collect, workers, lvl, logger) }), []snaptype.Index{Indexes.BorMilestoneId}, snaptype.IndexBuilderFunc( func(ctx context.Context, sn snaptype.FileInfo, salt uint32, _ *chain.Config, tmpDir string, p *background.Progress, lvl log.Lvl, logger log.Logger) (err error) { d, err := seg.NewDecompressor(sn.Path) if err != nil { return err } defer d.Close() gg := d.MakeGetter() var firstMilestoneId uint64 if gg.HasNext() { buf, _ := gg.Next(nil) if len(buf) > 0 { var firstMilestone Milestone if err = json.Unmarshal(buf, &firstMilestone); err != nil { return err } firstMilestoneId = uint64(firstMilestone.Id) } } return buildValueIndex(ctx, sn, salt, d, firstMilestoneId, tmpDir, p, lvl, logger) }), ) )
var APIVersion = &typesproto.VersionReply{Major: 1, Minor: 0, Patch: 0}
var Enums = struct { snaptype.Enums Events, Spans, Checkpoints, Milestones snaptype.Enum }{ Enums: snaptype.Enums{}, Events: snaptype.MinBorEnum, Spans: snaptype.MinBorEnum + 1, Checkpoints: snaptype.MinBorEnum + 2, Milestones: snaptype.MinBorEnum + 3, }
var ErrCheckpointNotFound = errors.New("checkpoint not found")
var ErrEventRecordNotFound = errors.New("event record not found")
var ErrMilestoneNotFound = errors.New("milestone not found")
var ErrSpanNotFound = errors.New("span not found")
var Indexes = struct { BorTxnHash, BorSpanId, BorCheckpointId, BorMilestoneId snaptype.Index }{ BorTxnHash: snaptype.Index{Name: "borevents"}, BorSpanId: snaptype.Index{Name: "borspans"}, BorCheckpointId: snaptype.Index{Name: "borcheckpoints"}, BorMilestoneId: snaptype.Index{Name: "bormilestones"}, }
var TransientErrors = []error{ ErrBadGateway, ErrServiceUnavailable, context.DeadlineExceeded, }
Functions ¶
func CalculateEventWindow ¶
func CheckpointsEnabled ¶
func CheckpointsEnabled() bool
func FetchWithRetry ¶
func FetchWithRetry[T any](ctx context.Context, client *Client, url *url.URL, logger log.Logger) (*T, error)
FetchWithRetry returns data from heimdall with retry
func FetchWithRetryEx ¶
func FetchWithRetryEx[T any]( ctx context.Context, client *Client, url *url.URL, isRecoverableError func(error) bool, logger log.Logger, ) (result *T, err error)
FetchWithRetryEx returns data from heimdall with retry
func IsBlockInLastSprintOfSpan ¶
IsBlockInLastSprintOfSpan returns true if a block num is within the last sprint of a span and false otherwise.
func MilestonesEnabled ¶
func MilestonesEnabled() bool
func NewSpanSnapshotStore ¶
func NewSpanSnapshotStore(base EntityStore[*Span], snapshots *RoSnapshots) *spanSnapshotStore
func RecordWayPoints ¶
func RecordWayPoints(value bool)
func SnapshotTypes ¶
func SpanEndBlockNum ¶
SpanEndBlockNum returns the number of the last block in the given span.
Types ¶
type BackendServer ¶
type BackendServer struct { remoteproto.UnimplementedHeimdallBackendServer // must be embedded to have forward compatible implementations. // contains filtered or unexported fields }
func NewBackendServer ¶
func NewBackendServer(ctx context.Context, spanProducersReader spanProducersReader) *BackendServer
func (*BackendServer) Producers ¶
func (b *BackendServer) Producers(ctx context.Context, in *remoteproto.BorProducersRequest) (*remoteproto.BorProducersResponse, error)
func (*BackendServer) Version ¶
func (b *BackendServer) Version(ctx context.Context, in *emptypb.Empty) (*typesproto.VersionReply, error)
type Checkpoint ¶
type Checkpoint struct { Id CheckpointId Fields WaypointFields }
Checkpoint defines a response object type of bor checkpoint
func (*Checkpoint) BlockNumRange ¶
func (c *Checkpoint) BlockNumRange() ClosedRange
func (*Checkpoint) CmpRange ¶
func (c *Checkpoint) CmpRange(n uint64) int
func (*Checkpoint) EndBlock ¶
func (c *Checkpoint) EndBlock() *big.Int
func (*Checkpoint) Length ¶
func (c *Checkpoint) Length() uint64
func (*Checkpoint) MarshalJSON ¶
func (c *Checkpoint) MarshalJSON() ([]byte, error)
func (*Checkpoint) RawId ¶
func (c *Checkpoint) RawId() uint64
func (*Checkpoint) RootHash ¶
func (c *Checkpoint) RootHash() libcommon.Hash
func (*Checkpoint) SetRawId ¶
func (c *Checkpoint) SetRawId(id uint64)
func (*Checkpoint) StartBlock ¶
func (c *Checkpoint) StartBlock() *big.Int
func (*Checkpoint) String ¶
func (c *Checkpoint) String() string
func (*Checkpoint) Timestamp ¶
func (c *Checkpoint) Timestamp() uint64
func (*Checkpoint) UnmarshalJSON ¶
func (c *Checkpoint) UnmarshalJSON(b []byte) error
type CheckpointCount ¶
type CheckpointCount struct {
Result int64 `json:"result"`
}
type CheckpointCountResponse ¶
type CheckpointCountResponse struct { Height string `json:"height"` Result CheckpointCount `json:"result"` }
type CheckpointId ¶
type CheckpointId uint64
type CheckpointListResponse ¶
type CheckpointListResponse struct { Height string `json:"height"` Result checkpoints `json:"result"` }
type CheckpointResponse ¶
type CheckpointResponse struct { Height string `json:"height"` Result Checkpoint `json:"result"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewHeimdallClient ¶
func (*Client) FetchCheckpoint ¶
FetchCheckpoint fetches the checkpoint from heimdall
func (*Client) FetchCheckpointCount ¶
FetchCheckpointCount fetches the checkpoint count from heimdall
func (*Client) FetchCheckpoints ¶
func (*Client) FetchFirstMilestoneNum ¶
func (*Client) FetchLastNoAckMilestone ¶
FetchLastNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*Client) FetchLatestSpan ¶
func (*Client) FetchMilestone ¶
FetchMilestone fetches a milestone from heimdall
func (*Client) FetchMilestoneCount ¶
FetchMilestoneCount fetches the milestone count from heimdall
func (*Client) FetchMilestoneID ¶
FetchMilestoneID fetches the bool result from Heimdall whether the ID corresponding to the given milestone is in process in Heimdall
func (*Client) FetchNoAckMilestone ¶
FetchNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*Client) FetchSpans ¶
func (*Client) FetchStateSyncEvent ¶
type ClosedRange ¶
func (ClosedRange) Len ¶
func (r ClosedRange) Len() uint64
type Entity ¶
type Entity interface { RawId() uint64 BlockNumRange() ClosedRange SetRawId(uint64) }
type EntityStore ¶
type EntityStore[TEntity Entity] interface { Prepare(ctx context.Context) error Close() LastEntityId(ctx context.Context) (uint64, bool, error) LastFrozenEntityId() uint64 LastEntity(ctx context.Context) (TEntity, bool, error) Entity(ctx context.Context, id uint64) (TEntity, bool, error) PutEntity(ctx context.Context, id uint64, entity TEntity) error EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error) RangeFromBlockNum(ctx context.Context, startBlockNum uint64) ([]TEntity, error) DeleteToBlockNum(ctx context.Context, unwindPoint uint64, limit int) (int, error) DeleteFromBlockNum(ctx context.Context, unwindPoint uint64) (int, error) SnapType() snaptype.Type }
type EventRangeExtractor ¶
type EventRecord ¶
type EventRecord struct { ID uint64 `json:"id" yaml:"id"` Contract libcommon.Address `json:"contract" yaml:"contract"` Data hexutility.Bytes `json:"data" yaml:"data"` TxHash libcommon.Hash `json:"tx_hash" yaml:"tx_hash"` LogIndex uint64 `json:"log_index" yaml:"log_index"` ChainID string `json:"bor_chain_id" yaml:"bor_chain_id"` }
EventRecord represents state record
type EventRecordWithTime ¶
type EventRecordWithTime struct { EventRecord Time time.Time `json:"record_time" yaml:"record_time"` }
func (*EventRecordWithTime) BuildEventRecord ¶
func (e *EventRecordWithTime) BuildEventRecord() *EventRecord
func (*EventRecordWithTime) MarshallBytes ¶
func (e *EventRecordWithTime) MarshallBytes() ([]byte, error)
func (*EventRecordWithTime) MarshallIdBytes ¶
func (e *EventRecordWithTime) MarshallIdBytes() []byte
func (*EventRecordWithTime) String ¶
func (e *EventRecordWithTime) String() string
String returns the string representation of a state record
func (*EventRecordWithTime) UnmarshallBytes ¶
func (e *EventRecordWithTime) UnmarshallBytes(v []byte) error
type HeimdallClient ¶
type HeimdallClient interface { FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error) FetchLatestSpan(ctx context.Context) (*Span, error) FetchSpan(ctx context.Context, spanID uint64) (*Span, error) FetchSpans(ctx context.Context, page uint64, limit uint64) ([]*Span, error) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error) FetchCheckpointCount(ctx context.Context) (int64, error) FetchCheckpoints(ctx context.Context, page uint64, limit uint64) ([]*Checkpoint, error) FetchMilestone(ctx context.Context, number int64) (*Milestone, error) FetchMilestoneCount(ctx context.Context) (int64, error) FetchFirstMilestoneNum(ctx context.Context) (int64, error) // FetchNoAckMilestone fetches a bool value whether milestone corresponding to the given id failed in the Heimdall FetchNoAckMilestone(ctx context.Context, milestoneID string) error // FetchLastNoAckMilestone fetches the latest failed milestone id FetchLastNoAckMilestone(ctx context.Context) (string, error) // FetchMilestoneID fetches a bool value whether milestone corresponding to the given id is in process in Heimdall FetchMilestoneID(ctx context.Context, milestoneID string) error Close() }
type HttpClient ¶
type MdbxStore ¶
type MdbxStore struct {
// contains filtered or unexported fields
}
func NewDbStore ¶
func NewMdbxStore ¶
func (*MdbxStore) Checkpoints ¶
func (s *MdbxStore) Checkpoints() EntityStore[*Checkpoint]
func (*MdbxStore) Milestones ¶
func (s *MdbxStore) Milestones() EntityStore[*Milestone]
func (*MdbxStore) SpanBlockProducerSelections ¶
func (s *MdbxStore) SpanBlockProducerSelections() EntityStore[*SpanBlockProducerSelection]
func (*MdbxStore) Spans ¶
func (s *MdbxStore) Spans() EntityStore[*Span]
type Milestone ¶
type Milestone struct { Id MilestoneId // numerical one that we assign in heimdall client MilestoneId string // string based in original json response Fields WaypointFields }
Milestone defines a response object type of bor milestone
func (*Milestone) BlockNumRange ¶
func (m *Milestone) BlockNumRange() ClosedRange
func (*Milestone) MarshalJSON ¶
func (*Milestone) StartBlock ¶
func (*Milestone) UnmarshalJSON ¶
type MilestoneCount ¶
type MilestoneCount struct {
Count int64 `json:"count"`
}
type MilestoneCountResponse ¶
type MilestoneCountResponse struct { Height string `json:"height"` Result MilestoneCount `json:"result"` }
type MilestoneID ¶
type MilestoneID struct {
Result bool `json:"result"`
}
type MilestoneIDResponse ¶
type MilestoneIDResponse struct { Height string `json:"height"` Result MilestoneID `json:"result"` }
type MilestoneId ¶
type MilestoneId uint64
type MilestoneLastNoAck ¶
type MilestoneLastNoAck struct {
Result string `json:"result"`
}
type MilestoneLastNoAckResponse ¶
type MilestoneLastNoAckResponse struct { Height string `json:"height"` Result MilestoneLastNoAck `json:"result"` }
type MilestoneNoAck ¶
type MilestoneNoAck struct {
Result bool `json:"result"`
}
type MilestoneNoAckResponse ¶
type MilestoneNoAckResponse struct { Height string `json:"height"` Result MilestoneNoAck `json:"result"` }
type MilestoneResponse ¶
type MockEntityStore ¶
type MockEntityStore[TEntity Entity] struct { // contains filtered or unexported fields }
MockEntityStore is a mock of EntityStore interface.
func NewMockEntityStore ¶
func NewMockEntityStore[TEntity Entity](ctrl *gomock.Controller) *MockEntityStore[TEntity]
NewMockEntityStore creates a new mock instance.
func (*MockEntityStore[TEntity]) Close ¶
func (m *MockEntityStore[TEntity]) Close()
Close mocks base method.
func (*MockEntityStore[TEntity]) DeleteFromBlockNum ¶
func (m *MockEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, blockNum uint64) (int, error)
EntityIdFromBlockNum mocks base method.
func (*MockEntityStore[TEntity]) DeleteToBlockNum ¶
func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, blockNum uint64, limit int) (int, error)
EntityIdFromBlockNum mocks base method.
func (*MockEntityStore[TEntity]) EXPECT ¶
func (m *MockEntityStore[TEntity]) EXPECT() *MockEntityStoreMockRecorder[TEntity]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEntityStore[TEntity]) EntityIdFromBlockNum ¶
func (m *MockEntityStore[TEntity]) EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error)
EntityIdFromBlockNum mocks base method.
func (*MockEntityStore[TEntity]) LastEntity ¶
func (m *MockEntityStore[TEntity]) LastEntity(ctx context.Context) (TEntity, bool, error)
LastEntity mocks base method.
func (*MockEntityStore[TEntity]) LastEntityId ¶
LastEntityId mocks base method.
func (*MockEntityStore[TEntity]) LastFrozenEntityId ¶
func (m *MockEntityStore[TEntity]) LastFrozenEntityId() uint64
LastFrozenEntityId mocks base method.
func (*MockEntityStore[TEntity]) Prepare ¶
func (m *MockEntityStore[TEntity]) Prepare(ctx context.Context) error
Prepare mocks base method.
func (*MockEntityStore[TEntity]) PutEntity ¶
func (m *MockEntityStore[TEntity]) PutEntity(ctx context.Context, id uint64, entity TEntity) error
PutEntity mocks base method.
func (*MockEntityStore[TEntity]) RangeFromBlockNum ¶
func (m *MockEntityStore[TEntity]) RangeFromBlockNum(ctx context.Context, startBlockNum uint64) ([]TEntity, error)
RangeFromBlockNum mocks base method.
func (*MockEntityStore[TEntity]) SnapType ¶
func (m *MockEntityStore[TEntity]) SnapType() snaptype.Type
SnapType mocks base method.
type MockEntityStoreCloseCall ¶
MockEntityStoreCloseCall wrap *gomock.Call
func (*MockEntityStoreCloseCall[TEntity]) Do ¶
func (c *MockEntityStoreCloseCall[TEntity]) Do(f func()) *MockEntityStoreCloseCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreCloseCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreCloseCall[TEntity]) DoAndReturn(f func()) *MockEntityStoreCloseCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreCloseCall[TEntity]) Return ¶
func (c *MockEntityStoreCloseCall[TEntity]) Return() *MockEntityStoreCloseCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreDeleteFromBlockNumCall ¶
MockEntityStoreDeleteToBlockNumCall wrap *gomock.Call
func (*MockEntityStoreDeleteFromBlockNumCall[TEntity]) Do ¶
func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreDeleteFromBlockNumCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreDeleteFromBlockNumCall[TEntity]) Return ¶
func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreDeleteToBlockNumCall ¶
MockEntityStoreDeleteToBlockNumCall wrap *gomock.Call
func (*MockEntityStoreDeleteToBlockNumCall[TEntity]) Do ¶
func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Do(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreDeleteToBlockNumCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreDeleteToBlockNumCall[TEntity]) Return ¶
func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteToBlockNumCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreEntityCall ¶
MockEntityStoreEntityCall wrap *gomock.Call
func (*MockEntityStoreEntityCall[TEntity]) Do ¶
func (c *MockEntityStoreEntityCall[TEntity]) Do(f func(context.Context, uint64) (TEntity, bool, error)) *MockEntityStoreEntityCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreEntityCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreEntityCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (TEntity, bool, error)) *MockEntityStoreEntityCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreEntityCall[TEntity]) Return ¶
func (c *MockEntityStoreEntityCall[TEntity]) Return(arg0 TEntity, arg1 bool, arg2 error) *MockEntityStoreEntityCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreEntityIdFromBlockNumCall ¶
MockEntityStoreEntityIdFromBlockNumCall wrap *gomock.Call
func (*MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Do ¶
func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreEntityIdFromBlockNumCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Return ¶
func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreLastEntityCall ¶
MockEntityStoreLastEntityCall wrap *gomock.Call
func (*MockEntityStoreLastEntityCall[TEntity]) Do ¶
func (c *MockEntityStoreLastEntityCall[TEntity]) Do(f func(context.Context) (TEntity, bool, error)) *MockEntityStoreLastEntityCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreLastEntityCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreLastEntityCall[TEntity]) DoAndReturn(f func(context.Context) (TEntity, bool, error)) *MockEntityStoreLastEntityCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreLastEntityCall[TEntity]) Return ¶
func (c *MockEntityStoreLastEntityCall[TEntity]) Return(arg0 TEntity, arg1 bool, arg2 error) *MockEntityStoreLastEntityCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreLastEntityIdCall ¶
MockEntityStoreLastEntityIdCall wrap *gomock.Call
func (*MockEntityStoreLastEntityIdCall[TEntity]) Do ¶
func (c *MockEntityStoreLastEntityIdCall[TEntity]) Do(f func(context.Context) (uint64, bool, error)) *MockEntityStoreLastEntityIdCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreLastEntityIdCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreLastEntityIdCall[TEntity]) DoAndReturn(f func(context.Context) (uint64, bool, error)) *MockEntityStoreLastEntityIdCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreLastEntityIdCall[TEntity]) Return ¶
func (c *MockEntityStoreLastEntityIdCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreLastEntityIdCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreLastFrozenEntityIdCall ¶
MockEntityStoreLastFrozenEntityIdCall wrap *gomock.Call
func (*MockEntityStoreLastFrozenEntityIdCall[TEntity]) Do ¶
func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) Do(f func() uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreLastFrozenEntityIdCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) DoAndReturn(f func() uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreLastFrozenEntityIdCall[TEntity]) Return ¶
func (c *MockEntityStoreLastFrozenEntityIdCall[TEntity]) Return(arg0 uint64) *MockEntityStoreLastFrozenEntityIdCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreMockRecorder ¶
type MockEntityStoreMockRecorder[TEntity Entity] struct { // contains filtered or unexported fields }
MockEntityStoreMockRecorder is the mock recorder for MockEntityStore.
func (*MockEntityStoreMockRecorder[TEntity]) Close ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) Close() *MockEntityStoreCloseCall[TEntity]
Close indicates an expected call of Close.
func (*MockEntityStoreMockRecorder[TEntity]) DeleteFromBlockNum ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteFromBlockNum(ctx any, blockNum any) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
DeleteFromBlockNum indicates an expected call of DeleteFromBlockNum.
func (*MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx any, blockNum any, limit any) *MockEntityStoreDeleteToBlockNumCall[TEntity]
DeleteToBlockNum indicates an expected call of DeleteToBlockNum.
func (*MockEntityStoreMockRecorder[TEntity]) Entity ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) Entity(ctx, id any) *MockEntityStoreEntityCall[TEntity]
Entity indicates an expected call of Entity.
func (*MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum(ctx any, blockNum any) *MockEntityStoreEntityIdFromBlockNumCall[TEntity]
EntityIdFromBlockNum indicates an expected call of EntityIdFromBlockNum.
func (*MockEntityStoreMockRecorder[TEntity]) LastEntity ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) LastEntity(ctx any) *MockEntityStoreLastEntityCall[TEntity]
LastEntity indicates an expected call of LastEntity.
func (*MockEntityStoreMockRecorder[TEntity]) LastEntityId ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) LastEntityId(ctx any) *MockEntityStoreLastEntityIdCall[TEntity]
LastEntityId indicates an expected call of LastEntityId.
func (*MockEntityStoreMockRecorder[TEntity]) LastFrozenEntityId ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) LastFrozenEntityId() *MockEntityStoreLastFrozenEntityIdCall[TEntity]
LastFrozenEntityId indicates an expected call of LastFrozenEntityId.
func (*MockEntityStoreMockRecorder[TEntity]) Prepare ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) Prepare(ctx any) *MockEntityStorePrepareCall[TEntity]
Prepare indicates an expected call of Prepare.
func (*MockEntityStoreMockRecorder[TEntity]) PutEntity ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) PutEntity(ctx, id, entity any) *MockEntityStorePutEntityCall[TEntity]
PutEntity indicates an expected call of PutEntity.
func (*MockEntityStoreMockRecorder[TEntity]) RangeFromBlockNum ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) RangeFromBlockNum(ctx, startBlockNum any) *MockEntityStoreRangeFromBlockNumCall[TEntity]
RangeFromBlockNum indicates an expected call of RangeFromBlockNum.
func (*MockEntityStoreMockRecorder[TEntity]) SnapType ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) SnapType() *MockEntityStoreSnapTypeCall[TEntity]
SnapType indicates an expected call of SnapType.
type MockEntityStorePrepareCall ¶
MockEntityStorePrepareCall wrap *gomock.Call
func (*MockEntityStorePrepareCall[TEntity]) Do ¶
func (c *MockEntityStorePrepareCall[TEntity]) Do(f func(context.Context) error) *MockEntityStorePrepareCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStorePrepareCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStorePrepareCall[TEntity]) DoAndReturn(f func(context.Context) error) *MockEntityStorePrepareCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStorePrepareCall[TEntity]) Return ¶
func (c *MockEntityStorePrepareCall[TEntity]) Return(arg0 error) *MockEntityStorePrepareCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStorePutEntityCall ¶
MockEntityStorePutEntityCall wrap *gomock.Call
func (*MockEntityStorePutEntityCall[TEntity]) Do ¶
func (c *MockEntityStorePutEntityCall[TEntity]) Do(f func(context.Context, uint64, TEntity) error) *MockEntityStorePutEntityCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStorePutEntityCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStorePutEntityCall[TEntity]) DoAndReturn(f func(context.Context, uint64, TEntity) error) *MockEntityStorePutEntityCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStorePutEntityCall[TEntity]) Return ¶
func (c *MockEntityStorePutEntityCall[TEntity]) Return(arg0 error) *MockEntityStorePutEntityCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreRangeFromBlockNumCall ¶
MockEntityStoreRangeFromBlockNumCall wrap *gomock.Call
func (*MockEntityStoreRangeFromBlockNumCall[TEntity]) Do ¶
func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) ([]TEntity, error)) *MockEntityStoreRangeFromBlockNumCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreRangeFromBlockNumCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) ([]TEntity, error)) *MockEntityStoreRangeFromBlockNumCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreRangeFromBlockNumCall[TEntity]) Return ¶
func (c *MockEntityStoreRangeFromBlockNumCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockEntityStoreRangeFromBlockNumCall[TEntity]
Return rewrite *gomock.Call.Return
type MockEntityStoreSnapTypeCall ¶
MockEntityStoreSnapTypeCall wrap *gomock.Call
func (*MockEntityStoreSnapTypeCall[TEntity]) Do ¶
func (c *MockEntityStoreSnapTypeCall[TEntity]) Do(f func() snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockEntityStoreSnapTypeCall[TEntity]) DoAndReturn ¶
func (c *MockEntityStoreSnapTypeCall[TEntity]) DoAndReturn(f func() snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockEntityStoreSnapTypeCall[TEntity]) Return ¶
func (c *MockEntityStoreSnapTypeCall[TEntity]) Return(arg0 snaptype.Type) *MockEntityStoreSnapTypeCall[TEntity]
Return rewrite *gomock.Call.Return
type MockHeimdallClient ¶
type MockHeimdallClient struct {
// contains filtered or unexported fields
}
MockHeimdallClient is a mock of HeimdallClient interface.
func NewMockHeimdallClient ¶
func NewMockHeimdallClient(ctrl *gomock.Controller) *MockHeimdallClient
NewMockHeimdallClient creates a new mock instance.
func (*MockHeimdallClient) EXPECT ¶
func (m *MockHeimdallClient) EXPECT() *MockHeimdallClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHeimdallClient) FetchCheckpoint ¶
func (m *MockHeimdallClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
FetchCheckpoint mocks base method.
func (*MockHeimdallClient) FetchCheckpointCount ¶
func (m *MockHeimdallClient) FetchCheckpointCount(ctx context.Context) (int64, error)
FetchCheckpointCount mocks base method.
func (*MockHeimdallClient) FetchCheckpoints ¶
func (m *MockHeimdallClient) FetchCheckpoints(ctx context.Context, page, limit uint64) ([]*Checkpoint, error)
FetchCheckpoints mocks base method.
func (*MockHeimdallClient) FetchFirstMilestoneNum ¶
func (m *MockHeimdallClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
FetchFirstMilestoneNum mocks base method.
func (*MockHeimdallClient) FetchLastNoAckMilestone ¶
func (m *MockHeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
FetchLastNoAckMilestone mocks base method.
func (*MockHeimdallClient) FetchLatestSpan ¶
func (m *MockHeimdallClient) FetchLatestSpan(ctx context.Context) (*Span, error)
FetchLatestSpan mocks base method.
func (*MockHeimdallClient) FetchMilestone ¶
FetchMilestone mocks base method.
func (*MockHeimdallClient) FetchMilestoneCount ¶
func (m *MockHeimdallClient) FetchMilestoneCount(ctx context.Context) (int64, error)
FetchMilestoneCount mocks base method.
func (*MockHeimdallClient) FetchMilestoneID ¶
func (m *MockHeimdallClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
FetchMilestoneID mocks base method.
func (*MockHeimdallClient) FetchNoAckMilestone ¶
func (m *MockHeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
FetchNoAckMilestone mocks base method.
func (*MockHeimdallClient) FetchSpans ¶
FetchSpans mocks base method.
func (*MockHeimdallClient) FetchStateSyncEvent ¶
func (m *MockHeimdallClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
FetchStateSyncEvent mocks base method.
func (*MockHeimdallClient) FetchStateSyncEvents ¶
func (m *MockHeimdallClient) FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
FetchStateSyncEvents mocks base method.
type MockHeimdallClientCloseCall ¶
MockHeimdallClientCloseCall wrap *gomock.Call
func (*MockHeimdallClientCloseCall) Do ¶
func (c *MockHeimdallClientCloseCall) Do(f func()) *MockHeimdallClientCloseCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientCloseCall) DoAndReturn ¶
func (c *MockHeimdallClientCloseCall) DoAndReturn(f func()) *MockHeimdallClientCloseCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientCloseCall) Return ¶
func (c *MockHeimdallClientCloseCall) Return() *MockHeimdallClientCloseCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchCheckpointCall ¶
MockHeimdallClientFetchCheckpointCall wrap *gomock.Call
func (*MockHeimdallClientFetchCheckpointCall) Do ¶
func (c *MockHeimdallClientFetchCheckpointCall) Do(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchCheckpointCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchCheckpointCall) DoAndReturn(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchCheckpointCall) Return ¶
func (c *MockHeimdallClientFetchCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockHeimdallClientFetchCheckpointCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchCheckpointCountCall ¶
MockHeimdallClientFetchCheckpointCountCall wrap *gomock.Call
func (*MockHeimdallClientFetchCheckpointCountCall) Do ¶
func (c *MockHeimdallClientFetchCheckpointCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchCheckpointCountCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchCheckpointCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchCheckpointCountCall) Return ¶
func (c *MockHeimdallClientFetchCheckpointCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchCheckpointCountCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchCheckpointsCall ¶
MockHeimdallClientFetchCheckpointsCall wrap *gomock.Call
func (*MockHeimdallClientFetchCheckpointsCall) Do ¶
func (c *MockHeimdallClientFetchCheckpointsCall) Do(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockHeimdallClientFetchCheckpointsCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchCheckpointsCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchCheckpointsCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockHeimdallClientFetchCheckpointsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchCheckpointsCall) Return ¶
func (c *MockHeimdallClientFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockHeimdallClientFetchCheckpointsCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchFirstMilestoneNumCall ¶
MockHeimdallClientFetchFirstMilestoneNumCall wrap *gomock.Call
func (*MockHeimdallClientFetchFirstMilestoneNumCall) Do ¶
func (c *MockHeimdallClientFetchFirstMilestoneNumCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchFirstMilestoneNumCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchFirstMilestoneNumCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchFirstMilestoneNumCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchFirstMilestoneNumCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchFirstMilestoneNumCall) Return ¶
func (c *MockHeimdallClientFetchFirstMilestoneNumCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchFirstMilestoneNumCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchLastNoAckMilestoneCall ¶
MockHeimdallClientFetchLastNoAckMilestoneCall wrap *gomock.Call
func (*MockHeimdallClientFetchLastNoAckMilestoneCall) Do ¶
func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Do(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchLastNoAckMilestoneCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) DoAndReturn(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchLastNoAckMilestoneCall) Return ¶
func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Return(arg0 string, arg1 error) *MockHeimdallClientFetchLastNoAckMilestoneCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchLatestSpanCall ¶
MockHeimdallClientFetchLatestSpanCall wrap *gomock.Call
func (*MockHeimdallClientFetchLatestSpanCall) Do ¶
func (c *MockHeimdallClientFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchLatestSpanCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchLatestSpanCall) Return ¶
func (c *MockHeimdallClientFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchLatestSpanCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchMilestoneCall ¶
MockHeimdallClientFetchMilestoneCall wrap *gomock.Call
func (*MockHeimdallClientFetchMilestoneCall) Do ¶
func (c *MockHeimdallClientFetchMilestoneCall) Do(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchMilestoneCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchMilestoneCall) DoAndReturn(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchMilestoneCall) Return ¶
func (c *MockHeimdallClientFetchMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockHeimdallClientFetchMilestoneCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchMilestoneCountCall ¶
MockHeimdallClientFetchMilestoneCountCall wrap *gomock.Call
func (*MockHeimdallClientFetchMilestoneCountCall) Do ¶
func (c *MockHeimdallClientFetchMilestoneCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchMilestoneCountCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchMilestoneCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchMilestoneCountCall) Return ¶
func (c *MockHeimdallClientFetchMilestoneCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchMilestoneCountCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchMilestoneIDCall ¶
MockHeimdallClientFetchMilestoneIDCall wrap *gomock.Call
func (*MockHeimdallClientFetchMilestoneIDCall) Do ¶
func (c *MockHeimdallClientFetchMilestoneIDCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchMilestoneIDCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchMilestoneIDCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchMilestoneIDCall) Return ¶
func (c *MockHeimdallClientFetchMilestoneIDCall) Return(arg0 error) *MockHeimdallClientFetchMilestoneIDCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchNoAckMilestoneCall ¶
MockHeimdallClientFetchNoAckMilestoneCall wrap *gomock.Call
func (*MockHeimdallClientFetchNoAckMilestoneCall) Do ¶
func (c *MockHeimdallClientFetchNoAckMilestoneCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchNoAckMilestoneCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchNoAckMilestoneCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchNoAckMilestoneCall) Return ¶
func (c *MockHeimdallClientFetchNoAckMilestoneCall) Return(arg0 error) *MockHeimdallClientFetchNoAckMilestoneCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchSpanCall ¶
MockHeimdallClientFetchSpanCall wrap *gomock.Call
func (*MockHeimdallClientFetchSpanCall) Do ¶
func (c *MockHeimdallClientFetchSpanCall) Do(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchSpanCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchSpanCall) DoAndReturn(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchSpanCall) Return ¶
func (c *MockHeimdallClientFetchSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchSpanCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchSpansCall ¶
MockHeimdallClientFetchSpansCall wrap *gomock.Call
func (*MockHeimdallClientFetchSpansCall) Do ¶
func (c *MockHeimdallClientFetchSpansCall) Do(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockHeimdallClientFetchSpansCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchSpansCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchSpansCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockHeimdallClientFetchSpansCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchSpansCall) Return ¶
func (c *MockHeimdallClientFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockHeimdallClientFetchSpansCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchStateSyncEventCall ¶
MockHeimdallClientFetchStateSyncEventCall wrap *gomock.Call
func (*MockHeimdallClientFetchStateSyncEventCall) Do ¶
func (c *MockHeimdallClientFetchStateSyncEventCall) Do(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchStateSyncEventCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchStateSyncEventCall) DoAndReturn(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchStateSyncEventCall) Return ¶
func (c *MockHeimdallClientFetchStateSyncEventCall) Return(arg0 *EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientFetchStateSyncEventsCall ¶
MockHeimdallClientFetchStateSyncEventsCall wrap *gomock.Call
func (*MockHeimdallClientFetchStateSyncEventsCall) Do ¶
func (c *MockHeimdallClientFetchStateSyncEventsCall) Do(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventsCall
Do rewrite *gomock.Call.Do
func (*MockHeimdallClientFetchStateSyncEventsCall) DoAndReturn ¶
func (c *MockHeimdallClientFetchStateSyncEventsCall) DoAndReturn(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHeimdallClientFetchStateSyncEventsCall) Return ¶
func (c *MockHeimdallClientFetchStateSyncEventsCall) Return(arg0 []*EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventsCall
Return rewrite *gomock.Call.Return
type MockHeimdallClientMockRecorder ¶
type MockHeimdallClientMockRecorder struct {
// contains filtered or unexported fields
}
MockHeimdallClientMockRecorder is the mock recorder for MockHeimdallClient.
func (*MockHeimdallClientMockRecorder) Close ¶
func (mr *MockHeimdallClientMockRecorder) Close() *MockHeimdallClientCloseCall
Close indicates an expected call of Close.
func (*MockHeimdallClientMockRecorder) FetchCheckpoint ¶
func (mr *MockHeimdallClientMockRecorder) FetchCheckpoint(ctx, number any) *MockHeimdallClientFetchCheckpointCall
FetchCheckpoint indicates an expected call of FetchCheckpoint.
func (*MockHeimdallClientMockRecorder) FetchCheckpointCount ¶
func (mr *MockHeimdallClientMockRecorder) FetchCheckpointCount(ctx any) *MockHeimdallClientFetchCheckpointCountCall
FetchCheckpointCount indicates an expected call of FetchCheckpointCount.
func (*MockHeimdallClientMockRecorder) FetchCheckpoints ¶
func (mr *MockHeimdallClientMockRecorder) FetchCheckpoints(ctx, page, limit any) *MockHeimdallClientFetchCheckpointsCall
FetchCheckpoints indicates an expected call of FetchCheckpoints.
func (*MockHeimdallClientMockRecorder) FetchFirstMilestoneNum ¶
func (mr *MockHeimdallClientMockRecorder) FetchFirstMilestoneNum(ctx any) *MockHeimdallClientFetchFirstMilestoneNumCall
FetchFirstMilestoneNum indicates an expected call of FetchFirstMilestoneNum.
func (*MockHeimdallClientMockRecorder) FetchLastNoAckMilestone ¶
func (mr *MockHeimdallClientMockRecorder) FetchLastNoAckMilestone(ctx any) *MockHeimdallClientFetchLastNoAckMilestoneCall
FetchLastNoAckMilestone indicates an expected call of FetchLastNoAckMilestone.
func (*MockHeimdallClientMockRecorder) FetchLatestSpan ¶
func (mr *MockHeimdallClientMockRecorder) FetchLatestSpan(ctx any) *MockHeimdallClientFetchLatestSpanCall
FetchLatestSpan indicates an expected call of FetchLatestSpan.
func (*MockHeimdallClientMockRecorder) FetchMilestone ¶
func (mr *MockHeimdallClientMockRecorder) FetchMilestone(ctx, number any) *MockHeimdallClientFetchMilestoneCall
FetchMilestone indicates an expected call of FetchMilestone.
func (*MockHeimdallClientMockRecorder) FetchMilestoneCount ¶
func (mr *MockHeimdallClientMockRecorder) FetchMilestoneCount(ctx any) *MockHeimdallClientFetchMilestoneCountCall
FetchMilestoneCount indicates an expected call of FetchMilestoneCount.
func (*MockHeimdallClientMockRecorder) FetchMilestoneID ¶
func (mr *MockHeimdallClientMockRecorder) FetchMilestoneID(ctx, milestoneID any) *MockHeimdallClientFetchMilestoneIDCall
FetchMilestoneID indicates an expected call of FetchMilestoneID.
func (*MockHeimdallClientMockRecorder) FetchNoAckMilestone ¶
func (mr *MockHeimdallClientMockRecorder) FetchNoAckMilestone(ctx, milestoneID any) *MockHeimdallClientFetchNoAckMilestoneCall
FetchNoAckMilestone indicates an expected call of FetchNoAckMilestone.
func (*MockHeimdallClientMockRecorder) FetchSpan ¶
func (mr *MockHeimdallClientMockRecorder) FetchSpan(ctx, spanID any) *MockHeimdallClientFetchSpanCall
FetchSpan indicates an expected call of FetchSpan.
func (*MockHeimdallClientMockRecorder) FetchSpans ¶
func (mr *MockHeimdallClientMockRecorder) FetchSpans(ctx, page, limit any) *MockHeimdallClientFetchSpansCall
FetchSpans indicates an expected call of FetchSpans.
func (*MockHeimdallClientMockRecorder) FetchStateSyncEvent ¶
func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvent(ctx, id any) *MockHeimdallClientFetchStateSyncEventCall
FetchStateSyncEvent indicates an expected call of FetchStateSyncEvent.
func (*MockHeimdallClientMockRecorder) FetchStateSyncEvents ¶
func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvents(ctx, fromId, to, limit any) *MockHeimdallClientFetchStateSyncEventsCall
FetchStateSyncEvents indicates an expected call of FetchStateSyncEvents.
type MockHttpClient ¶
type MockHttpClient struct {
// contains filtered or unexported fields
}
MockHttpClient is a mock of HttpClient interface.
func NewMockHttpClient ¶
func NewMockHttpClient(ctrl *gomock.Controller) *MockHttpClient
NewMockHttpClient creates a new mock instance.
func (*MockHttpClient) CloseIdleConnections ¶
func (m *MockHttpClient) CloseIdleConnections()
CloseIdleConnections mocks base method.
func (*MockHttpClient) EXPECT ¶
func (m *MockHttpClient) EXPECT() *MockHttpClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockHttpClientCloseIdleConnectionsCall ¶
MockHttpClientCloseIdleConnectionsCall wrap *gomock.Call
func (*MockHttpClientCloseIdleConnectionsCall) Do ¶
func (c *MockHttpClientCloseIdleConnectionsCall) Do(f func()) *MockHttpClientCloseIdleConnectionsCall
Do rewrite *gomock.Call.Do
func (*MockHttpClientCloseIdleConnectionsCall) DoAndReturn ¶
func (c *MockHttpClientCloseIdleConnectionsCall) DoAndReturn(f func()) *MockHttpClientCloseIdleConnectionsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHttpClientCloseIdleConnectionsCall) Return ¶
func (c *MockHttpClientCloseIdleConnectionsCall) Return() *MockHttpClientCloseIdleConnectionsCall
Return rewrite *gomock.Call.Return
type MockHttpClientDoCall ¶
MockHttpClientDoCall wrap *gomock.Call
func (*MockHttpClientDoCall) Do ¶
func (c *MockHttpClientDoCall) Do(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall
Do rewrite *gomock.Call.Do
func (*MockHttpClientDoCall) DoAndReturn ¶
func (c *MockHttpClientDoCall) DoAndReturn(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHttpClientDoCall) Return ¶
func (c *MockHttpClientDoCall) Return(arg0 *http.Response, arg1 error) *MockHttpClientDoCall
Return rewrite *gomock.Call.Return
type MockHttpClientMockRecorder ¶
type MockHttpClientMockRecorder struct {
// contains filtered or unexported fields
}
MockHttpClientMockRecorder is the mock recorder for MockHttpClient.
func (*MockHttpClientMockRecorder) CloseIdleConnections ¶
func (mr *MockHttpClientMockRecorder) CloseIdleConnections() *MockHttpClientCloseIdleConnectionsCall
CloseIdleConnections indicates an expected call of CloseIdleConnections.
func (*MockHttpClientMockRecorder) Do ¶
func (mr *MockHttpClientMockRecorder) Do(req any) *MockHttpClientDoCall
Do indicates an expected call of Do.
type MockentityFetcher ¶
type MockentityFetcher[TEntity Entity] struct { // contains filtered or unexported fields }
MockentityFetcher is a mock of entityFetcher interface.
func NewMockentityFetcher ¶
func NewMockentityFetcher[TEntity Entity](ctrl *gomock.Controller) *MockentityFetcher[TEntity]
NewMockentityFetcher creates a new mock instance.
func (*MockentityFetcher[TEntity]) EXPECT ¶
func (m *MockentityFetcher[TEntity]) EXPECT() *MockentityFetcherMockRecorder[TEntity]
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockentityFetcher[TEntity]) FetchAllEntities ¶
func (m *MockentityFetcher[TEntity]) FetchAllEntities(ctx context.Context) ([]TEntity, error)
FetchAllEntities mocks base method.
func (*MockentityFetcher[TEntity]) FetchEntitiesRange ¶
func (m *MockentityFetcher[TEntity]) FetchEntitiesRange(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
FetchEntitiesRange mocks base method.
func (*MockentityFetcher[TEntity]) FetchEntityIdRange ¶
func (m *MockentityFetcher[TEntity]) FetchEntityIdRange(ctx context.Context) (ClosedRange, error)
FetchEntityIdRange mocks base method.
type MockentityFetcherFetchAllEntitiesCall ¶
MockentityFetcherFetchAllEntitiesCall wrap *gomock.Call
func (*MockentityFetcherFetchAllEntitiesCall[TEntity]) Do ¶
func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) Do(f func(context.Context) ([]TEntity, error)) *MockentityFetcherFetchAllEntitiesCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockentityFetcherFetchAllEntitiesCall[TEntity]) DoAndReturn ¶
func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) DoAndReturn(f func(context.Context) ([]TEntity, error)) *MockentityFetcherFetchAllEntitiesCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockentityFetcherFetchAllEntitiesCall[TEntity]) Return ¶
func (c *MockentityFetcherFetchAllEntitiesCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockentityFetcherFetchAllEntitiesCall[TEntity]
Return rewrite *gomock.Call.Return
type MockentityFetcherFetchEntitiesRangeCall ¶
MockentityFetcherFetchEntitiesRangeCall wrap *gomock.Call
func (*MockentityFetcherFetchEntitiesRangeCall[TEntity]) Do ¶
func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) Do(f func(context.Context, ClosedRange) ([]TEntity, error)) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockentityFetcherFetchEntitiesRangeCall[TEntity]) DoAndReturn ¶
func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) DoAndReturn(f func(context.Context, ClosedRange) ([]TEntity, error)) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockentityFetcherFetchEntitiesRangeCall[TEntity]) Return ¶
func (c *MockentityFetcherFetchEntitiesRangeCall[TEntity]) Return(arg0 []TEntity, arg1 error) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
Return rewrite *gomock.Call.Return
type MockentityFetcherFetchEntityIdRangeCall ¶
MockentityFetcherFetchEntityIdRangeCall wrap *gomock.Call
func (*MockentityFetcherFetchEntityIdRangeCall[TEntity]) Do ¶
func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) Do(f func(context.Context) (ClosedRange, error)) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
Do rewrite *gomock.Call.Do
func (*MockentityFetcherFetchEntityIdRangeCall[TEntity]) DoAndReturn ¶
func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) DoAndReturn(f func(context.Context) (ClosedRange, error)) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockentityFetcherFetchEntityIdRangeCall[TEntity]) Return ¶
func (c *MockentityFetcherFetchEntityIdRangeCall[TEntity]) Return(arg0 ClosedRange, arg1 error) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
Return rewrite *gomock.Call.Return
type MockentityFetcherMockRecorder ¶
type MockentityFetcherMockRecorder[TEntity Entity] struct { // contains filtered or unexported fields }
MockentityFetcherMockRecorder is the mock recorder for MockentityFetcher.
func (*MockentityFetcherMockRecorder[TEntity]) FetchAllEntities ¶
func (mr *MockentityFetcherMockRecorder[TEntity]) FetchAllEntities(ctx any) *MockentityFetcherFetchAllEntitiesCall[TEntity]
FetchAllEntities indicates an expected call of FetchAllEntities.
func (*MockentityFetcherMockRecorder[TEntity]) FetchEntitiesRange ¶
func (mr *MockentityFetcherMockRecorder[TEntity]) FetchEntitiesRange(ctx, idRange any) *MockentityFetcherFetchEntitiesRangeCall[TEntity]
FetchEntitiesRange indicates an expected call of FetchEntitiesRange.
func (*MockentityFetcherMockRecorder[TEntity]) FetchEntityIdRange ¶
func (mr *MockentityFetcherMockRecorder[TEntity]) FetchEntityIdRange(ctx any) *MockentityFetcherFetchEntityIdRangeCall[TEntity]
FetchEntityIdRange indicates an expected call of FetchEntityIdRange.
type NoopEntityStore ¶
func (NoopEntityStore[TEntity]) Close ¶
func (NoopEntityStore[TEntity]) Close()
func (NoopEntityStore[TEntity]) DeleteFromBlockNum ¶
func (NoopEntityStore[TEntity]) DeleteToBlockNum ¶
func (NoopEntityStore[TEntity]) EntityIdFromBlockNum ¶
func (NoopEntityStore[TEntity]) LastEntity ¶
func (NoopEntityStore[TEntity]) LastEntity(ctx context.Context) (TEntity, bool, error)
func (NoopEntityStore[TEntity]) LastEntityId ¶
func (NoopEntityStore[TEntity]) LastFrozenEntityId ¶
func (NoopEntityStore[TEntity]) LastFrozenEntityId() uint64
func (NoopEntityStore[TEntity]) Prepare ¶
func (NoopEntityStore[TEntity]) Prepare(ctx context.Context) error
func (NoopEntityStore[TEntity]) PutEntity ¶
func (NoopEntityStore[TEntity]) PutEntity(ctx context.Context, id uint64, entity TEntity) error
func (NoopEntityStore[TEntity]) RangeFromBlockNum ¶
func (NoopEntityStore[TEntity]) RangeFromBlockNum(ctx context.Context, startBlockNum uint64) ([]TEntity, error)
func (NoopEntityStore[TEntity]) SnapType ¶
func (ns NoopEntityStore[TEntity]) SnapType() snaptype.Type
type ObserverOption ¶
type ObserverOption func(opts *ObserverOptions)
func WithEventsLimit ¶
func WithEventsLimit(eventsLimit int) ObserverOption
type ObserverOptions ¶
type ObserverOptions struct {
// contains filtered or unexported fields
}
func NewObserverOptions ¶
func NewObserverOptions(opts ...ObserverOption) ObserverOptions
type RangeIndex ¶
func NewRangeIndex ¶
func NewRangeIndex(db *polygoncommon.Database, table string) RangeIndex
func NewTxRangeIndex ¶
type RangeIndexFactory ¶
type RangeIndexFactory func(ctx context.Context) (*RangeIndex, error)
type RangeIndexFunc ¶
type RangeIndexer ¶
type RangeIndexer interface { RangeIndex Put(ctx context.Context, r ClosedRange, id uint64) error }
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func AssembleReader ¶
func AssembleReader(ctx context.Context, config ReaderConfig) (*Reader, error)
AssembleReader creates and opens the MDBX store. For use cases where the store is only being read from. Must call Close.
func (*Reader) CheckpointsFromBlock ¶
func (*Reader) MilestonesFromBlock ¶
type ReaderConfig ¶
type RemoteReader ¶
type RemoteReader struct {
// contains filtered or unexported fields
}
func NewRemoteReader ¶
func NewRemoteReader(client remote.HeimdallBackendClient) *RemoteReader
func (*RemoteReader) Close ¶
func (r *RemoteReader) Close()
Close implements bridge.ReaderService. It's a noop as there is no attached store.
func (*RemoteReader) EnsureVersionCompatibility ¶
func (r *RemoteReader) EnsureVersionCompatibility() bool
func (*RemoteReader) Producers ¶
func (r *RemoteReader) Producers(ctx context.Context, blockNum uint64) (*valset.ValidatorSet, error)
type RoSnapshots ¶
type RoSnapshots struct {
snapshotsync.RoSnapshots
}
func NewRoSnapshots ¶
func NewRoSnapshots(cfg ethconfig.BlocksFreezing, snapDir string, segmentsMin uint64, logger log.Logger) *RoSnapshots
NewBorRoSnapshots - opens all bor snapshots. But to simplify everything:
- it opens snapshots only on App start and immutable after
- all snapshots of given blocks range must exist - to make this blocks range available
- gaps are not allowed
- segment have [from:to] semantic
func (*RoSnapshots) Ranges ¶
func (s *RoSnapshots) Ranges() []snapshotsync.Range
func (*RoSnapshots) View ¶
func (s *RoSnapshots) View() *View
type Service ¶
type Service interface { Span(ctx context.Context, id uint64) (*Span, bool, error) CheckpointsFromBlock(ctx context.Context, startBlock uint64) ([]*Checkpoint, error) MilestonesFromBlock(ctx context.Context, startBlock uint64) ([]*Milestone, error) Producers(ctx context.Context, blockNum uint64) (*valset.ValidatorSet, error) RegisterMilestoneObserver(callback func(*Milestone), opts ...ObserverOption) polygoncommon.UnregisterFunc Run(ctx context.Context) error SynchronizeCheckpoints(ctx context.Context) (latest *Checkpoint, err error) SynchronizeMilestones(ctx context.Context) (latest *Milestone, err error) SynchronizeSpans(ctx context.Context, blockNum uint64) error Ready(ctx context.Context) <-chan error }
func AssembleService ¶
func AssembleService(config ServiceConfig) Service
func NewService ¶
func NewService(borConfig *borcfg.BorConfig, client HeimdallClient, store Store, logger log.Logger) Service
type ServiceConfig ¶
type SnapshotStore ¶
type SnapshotStore struct { Store // contains filtered or unexported fields }
func NewSnapshotStore ¶
func NewSnapshotStore(base Store, snapshots *RoSnapshots) *SnapshotStore
func (*SnapshotStore) Checkpoints ¶
func (s *SnapshotStore) Checkpoints() EntityStore[*Checkpoint]
func (*SnapshotStore) Milestones ¶
func (s *SnapshotStore) Milestones() EntityStore[*Milestone]
func (*SnapshotStore) SpanBlockProducerSelections ¶
func (s *SnapshotStore) SpanBlockProducerSelections() EntityStore[*SpanBlockProducerSelection]
func (*SnapshotStore) Spans ¶
func (s *SnapshotStore) Spans() EntityStore[*Span]
type Span ¶
type Span struct { Id SpanId `json:"span_id" yaml:"span_id"` StartBlock uint64 `json:"start_block" yaml:"start_block"` EndBlock uint64 `json:"end_block" yaml:"end_block"` ValidatorSet valset.ValidatorSet `json:"validator_set,omitempty" yaml:"validator_set"` SelectedProducers []valset.Validator `json:"selected_producers,omitempty" yaml:"selected_producers"` ChainID string `json:"bor_chain_id,omitempty" yaml:"bor_chain_id"` }
func (*Span) BlockNumRange ¶
func (s *Span) BlockNumRange() ClosedRange
type SpanBlockProducerSelection ¶
type SpanBlockProducerSelection struct { SpanId SpanId StartBlock uint64 EndBlock uint64 Producers *valset.ValidatorSet }
SpanBlockProducerSelection represents the block producer selection at each epoch with their corresponding accumulated ProposerPriority.
In the context of the bor chain, an epoch is equal to 1 span, while in the context of the heimdall chain, an epoch is equal to 1 checkpoint. This data type aims to make this distinction a bit more visible and is intended to be used specifically for span based epochs.
The difference between SpanBlockProducerSelection and Span.SelectedProducers is that SpanBlockProducerSelection contains the correct accumulated ProposerPriority for each selected producer, while Span.SelectedProducers always has ProposerPriority=0.
This is because the heimdall/bor/span/<spanId> API only tells us what the "frozen" selected producers for the next span epoch are. More info about how that works can be found in the "FreezeSet" logic in heimdall at https://github.com/maticnetwork/heimdall/tree/master/bor#how-does-it-work.
However, to correctly calculate the accumulated proposer priorities, one has to start from span zero, create a valset.ValidatorSet, call IncrementProposerPriority(spanSprintCount) and at every next span call bor.GetUpdatedValidatorSet(oldValidatorSet, span.SelectedProducers) and repeat.
func (*SpanBlockProducerSelection) BlockNumRange ¶
func (s *SpanBlockProducerSelection) BlockNumRange() ClosedRange
func (*SpanBlockProducerSelection) CmpRange ¶
func (s *SpanBlockProducerSelection) CmpRange(n uint64) int
func (*SpanBlockProducerSelection) RawId ¶
func (s *SpanBlockProducerSelection) RawId() uint64
func (*SpanBlockProducerSelection) SetRawId ¶
func (s *SpanBlockProducerSelection) SetRawId(id uint64)
type SpanListResponse ¶
type SpanListResponse struct { Height string `json:"height"` Result spans `json:"result"` }
type SpanResponse ¶
type StateSyncEventResponse ¶
type StateSyncEventResponse struct { Height string `json:"height"` Result EventRecordWithTime `json:"result"` }
type StateSyncEventsResponse ¶
type StateSyncEventsResponse struct { Height string `json:"height"` Result []*EventRecordWithTime `json:"result"` }
type Store ¶
type Store interface { Checkpoints() EntityStore[*Checkpoint] Milestones() EntityStore[*Milestone] Spans() EntityStore[*Span] SpanBlockProducerSelections() EntityStore[*SpanBlockProducerSelection] Prepare(ctx context.Context) error Close() }
type TransactionalRangeIndex ¶
type TransactionalRangeIndex interface { RangeIndex WithTx(tx kv.Tx) RangeIndex }
type View ¶
type View struct {
// contains filtered or unexported fields
}
func (*View) Checkpoints ¶
func (v *View) Checkpoints() []*snapshotsync.VisibleSegment
func (*View) Events ¶
func (v *View) Events() []*snapshotsync.VisibleSegment
func (*View) EventsSegment ¶
func (v *View) EventsSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
func (*View) Milestones ¶
func (v *View) Milestones() []*snapshotsync.VisibleSegment
func (*View) Spans ¶
func (v *View) Spans() []*snapshotsync.VisibleSegment
func (*View) SpansSegment ¶
func (v *View) SpansSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
type WaypointFields ¶
type WaypointFields struct { Proposer libcommon.Address `json:"proposer"` StartBlock *big.Int `json:"start_block"` EndBlock *big.Int `json:"end_block"` RootHash libcommon.Hash `json:"root_hash"` ChainID string `json:"bor_chain_id"` Timestamp uint64 `json:"timestamp"` }
func (*WaypointFields) CmpRange ¶
func (wf *WaypointFields) CmpRange(n uint64) int
func (*WaypointFields) Length ¶
func (wf *WaypointFields) Length() uint64
Source Files ¶
- checkpoint.go
- client.go
- client_mock.go
- closed_range.go
- cmp_block_range.go
- entity.go
- entity_fetcher.go
- entity_fetcher_mock.go
- entity_store.go
- entity_store_mock.go
- event_record.go
- http_client_mock.go
- log_prefix.go
- metrics.go
- milestone.go
- range_index.go
- reader.go
- scraper.go
- server.go
- service.go
- service_observer_options.go
- service_store.go
- snapshot_store.go
- snapshots.go
- span.go
- span_block_producer_selection.go
- span_block_producers_tracker.go
- span_id.go
- types.go
- utils.go
- waypoint.go