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 *HttpRequest, logger log.Logger) (*T, error)
- func FetchWithRetry[T any](ctx context.Context, client *HttpClient, url *url.URL, logger log.Logger) (*T, error)
- func FetchWithRetryEx[T any](ctx context.Context, client *HttpClient, url *url.URL, ...) (result *T, err error)
- func IsBlockInLastSprintOfSpan(blockNum uint64, config *borcfg.BorConfig) bool
- func MilestonesEnabled() bool
- 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 UpdateObservedWaypointCheckpointLength(length uint64)
- func UpdateObservedWaypointMilestoneLength(length 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
- type ClosedRange
- type Entity
- type EntityFetcher
- func NewCheckpointFetcher(client Client, logger log.Logger) *EntityFetcher[*Checkpoint]
- func NewEntityFetcher[TEntity Entity](name string, fetchFirstEntityId func(ctx context.Context) (int64, error), ...) *EntityFetcher[TEntity]
- func NewMilestoneFetcher(client Client, logger log.Logger) *EntityFetcher[*Milestone]
- func NewSpanFetcher(client Client, logger log.Logger) *EntityFetcher[*Span]
- func (f *EntityFetcher[TEntity]) FetchAllEntities(ctx context.Context) ([]TEntity, error)
- func (f *EntityFetcher[TEntity]) FetchEntitiesRange(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
- func (f *EntityFetcher[TEntity]) FetchEntitiesRangeSequentially(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
- func (f *EntityFetcher[TEntity]) FetchEntityIdRange(ctx context.Context) (ClosedRange, error)
- type EntityStore
- type EventRangeExtractor
- type EventRecord
- type EventRecordWithTime
- type HttpClient
- func (c *HttpClient) Close()
- func (c *HttpClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
- func (c *HttpClient) FetchCheckpointCount(ctx context.Context) (int64, error)
- func (c *HttpClient) FetchCheckpoints(ctx context.Context, page uint64, limit uint64) ([]*Checkpoint, error)
- func (c *HttpClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
- func (c *HttpClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
- func (c *HttpClient) FetchLatestSpan(ctx context.Context) (*Span, error)
- func (c *HttpClient) FetchMilestone(ctx context.Context, number int64) (*Milestone, error)
- func (c *HttpClient) FetchMilestoneCount(ctx context.Context) (int64, error)
- func (c *HttpClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
- func (c *HttpClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
- func (c *HttpClient) FetchSpan(ctx context.Context, spanID uint64) (*Span, error)
- func (c *HttpClient) FetchSpans(ctx context.Context, page uint64, limit uint64) ([]*Span, error)
- func (c *HttpClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
- func (c *HttpClient) FetchStateSyncEvents(ctx context.Context, fromID uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
- type HttpClientOption
- type HttpRequest
- 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 MockClient
- func (m *MockClient) Close()
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
- func (m *MockClient) FetchCheckpointCount(ctx context.Context) (int64, error)
- func (m *MockClient) FetchCheckpoints(ctx context.Context, page, limit uint64) ([]*Checkpoint, error)
- func (m *MockClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
- func (m *MockClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
- func (m *MockClient) FetchLatestSpan(ctx context.Context) (*Span, error)
- func (m *MockClient) FetchMilestone(ctx context.Context, number int64) (*Milestone, error)
- func (m *MockClient) FetchMilestoneCount(ctx context.Context) (int64, error)
- func (m *MockClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
- func (m *MockClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
- func (m *MockClient) FetchSpan(ctx context.Context, spanID uint64) (*Span, error)
- func (m *MockClient) FetchSpans(ctx context.Context, page, limit uint64) ([]*Span, error)
- func (m *MockClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
- func (m *MockClient) FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
- type MockClientCloseCall
- type MockClientFetchCheckpointCall
- func (c *MockClientFetchCheckpointCall) Do(f func(context.Context, int64) (*Checkpoint, error)) *MockClientFetchCheckpointCall
- func (c *MockClientFetchCheckpointCall) DoAndReturn(f func(context.Context, int64) (*Checkpoint, error)) *MockClientFetchCheckpointCall
- func (c *MockClientFetchCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockClientFetchCheckpointCall
- type MockClientFetchCheckpointCountCall
- func (c *MockClientFetchCheckpointCountCall) Do(f func(context.Context) (int64, error)) *MockClientFetchCheckpointCountCall
- func (c *MockClientFetchCheckpointCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchCheckpointCountCall
- func (c *MockClientFetchCheckpointCountCall) Return(arg0 int64, arg1 error) *MockClientFetchCheckpointCountCall
- type MockClientFetchCheckpointsCall
- func (c *MockClientFetchCheckpointsCall) Do(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockClientFetchCheckpointsCall
- func (c *MockClientFetchCheckpointsCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockClientFetchCheckpointsCall
- func (c *MockClientFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockClientFetchCheckpointsCall
- type MockClientFetchFirstMilestoneNumCall
- func (c *MockClientFetchFirstMilestoneNumCall) Do(f func(context.Context) (int64, error)) *MockClientFetchFirstMilestoneNumCall
- func (c *MockClientFetchFirstMilestoneNumCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchFirstMilestoneNumCall
- func (c *MockClientFetchFirstMilestoneNumCall) Return(arg0 int64, arg1 error) *MockClientFetchFirstMilestoneNumCall
- type MockClientFetchLastNoAckMilestoneCall
- func (c *MockClientFetchLastNoAckMilestoneCall) Do(f func(context.Context) (string, error)) *MockClientFetchLastNoAckMilestoneCall
- func (c *MockClientFetchLastNoAckMilestoneCall) DoAndReturn(f func(context.Context) (string, error)) *MockClientFetchLastNoAckMilestoneCall
- func (c *MockClientFetchLastNoAckMilestoneCall) Return(arg0 string, arg1 error) *MockClientFetchLastNoAckMilestoneCall
- type MockClientFetchLatestSpanCall
- func (c *MockClientFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockClientFetchLatestSpanCall
- func (c *MockClientFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockClientFetchLatestSpanCall
- func (c *MockClientFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockClientFetchLatestSpanCall
- type MockClientFetchMilestoneCall
- func (c *MockClientFetchMilestoneCall) Do(f func(context.Context, int64) (*Milestone, error)) *MockClientFetchMilestoneCall
- func (c *MockClientFetchMilestoneCall) DoAndReturn(f func(context.Context, int64) (*Milestone, error)) *MockClientFetchMilestoneCall
- func (c *MockClientFetchMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockClientFetchMilestoneCall
- type MockClientFetchMilestoneCountCall
- func (c *MockClientFetchMilestoneCountCall) Do(f func(context.Context) (int64, error)) *MockClientFetchMilestoneCountCall
- func (c *MockClientFetchMilestoneCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchMilestoneCountCall
- func (c *MockClientFetchMilestoneCountCall) Return(arg0 int64, arg1 error) *MockClientFetchMilestoneCountCall
- type MockClientFetchMilestoneIDCall
- func (c *MockClientFetchMilestoneIDCall) Do(f func(context.Context, string) error) *MockClientFetchMilestoneIDCall
- func (c *MockClientFetchMilestoneIDCall) DoAndReturn(f func(context.Context, string) error) *MockClientFetchMilestoneIDCall
- func (c *MockClientFetchMilestoneIDCall) Return(arg0 error) *MockClientFetchMilestoneIDCall
- type MockClientFetchNoAckMilestoneCall
- func (c *MockClientFetchNoAckMilestoneCall) Do(f func(context.Context, string) error) *MockClientFetchNoAckMilestoneCall
- func (c *MockClientFetchNoAckMilestoneCall) DoAndReturn(f func(context.Context, string) error) *MockClientFetchNoAckMilestoneCall
- func (c *MockClientFetchNoAckMilestoneCall) Return(arg0 error) *MockClientFetchNoAckMilestoneCall
- type MockClientFetchSpanCall
- func (c *MockClientFetchSpanCall) Do(f func(context.Context, uint64) (*Span, error)) *MockClientFetchSpanCall
- func (c *MockClientFetchSpanCall) DoAndReturn(f func(context.Context, uint64) (*Span, error)) *MockClientFetchSpanCall
- func (c *MockClientFetchSpanCall) Return(arg0 *Span, arg1 error) *MockClientFetchSpanCall
- type MockClientFetchSpansCall
- func (c *MockClientFetchSpansCall) Do(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockClientFetchSpansCall
- func (c *MockClientFetchSpansCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockClientFetchSpansCall
- func (c *MockClientFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockClientFetchSpansCall
- type MockClientFetchStateSyncEventCall
- func (c *MockClientFetchStateSyncEventCall) Do(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockClientFetchStateSyncEventCall
- func (c *MockClientFetchStateSyncEventCall) DoAndReturn(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockClientFetchStateSyncEventCall
- func (c *MockClientFetchStateSyncEventCall) Return(arg0 *EventRecordWithTime, arg1 error) *MockClientFetchStateSyncEventCall
- type MockClientFetchStateSyncEventsCall
- func (c *MockClientFetchStateSyncEventsCall) Do(...) *MockClientFetchStateSyncEventsCall
- func (c *MockClientFetchStateSyncEventsCall) DoAndReturn(...) *MockClientFetchStateSyncEventsCall
- func (c *MockClientFetchStateSyncEventsCall) Return(arg0 []*EventRecordWithTime, arg1 error) *MockClientFetchStateSyncEventsCall
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Close() *MockClientCloseCall
- func (mr *MockClientMockRecorder) FetchCheckpoint(ctx, number any) *MockClientFetchCheckpointCall
- func (mr *MockClientMockRecorder) FetchCheckpointCount(ctx any) *MockClientFetchCheckpointCountCall
- func (mr *MockClientMockRecorder) FetchCheckpoints(ctx, page, limit any) *MockClientFetchCheckpointsCall
- func (mr *MockClientMockRecorder) FetchFirstMilestoneNum(ctx any) *MockClientFetchFirstMilestoneNumCall
- func (mr *MockClientMockRecorder) FetchLastNoAckMilestone(ctx any) *MockClientFetchLastNoAckMilestoneCall
- func (mr *MockClientMockRecorder) FetchLatestSpan(ctx any) *MockClientFetchLatestSpanCall
- func (mr *MockClientMockRecorder) FetchMilestone(ctx, number any) *MockClientFetchMilestoneCall
- func (mr *MockClientMockRecorder) FetchMilestoneCount(ctx any) *MockClientFetchMilestoneCountCall
- func (mr *MockClientMockRecorder) FetchMilestoneID(ctx, milestoneID any) *MockClientFetchMilestoneIDCall
- func (mr *MockClientMockRecorder) FetchNoAckMilestone(ctx, milestoneID any) *MockClientFetchNoAckMilestoneCall
- func (mr *MockClientMockRecorder) FetchSpan(ctx, spanID any) *MockClientFetchSpanCall
- func (mr *MockClientMockRecorder) FetchSpans(ctx, page, limit any) *MockClientFetchSpansCall
- func (mr *MockClientMockRecorder) FetchStateSyncEvent(ctx, id any) *MockClientFetchStateSyncEventCall
- func (mr *MockClientMockRecorder) FetchStateSyncEvents(ctx, fromId, to, limit any) *MockClientFetchStateSyncEventsCall
- type MockEntityStore
- func (m *MockEntityStore[TEntity]) Close()
- func (m *MockEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, unwindPoint uint64) (int, error)
- func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, unwindPoint 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, unwindPoint any) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx, unwindPoint, limit any) *MockEntityStoreDeleteToBlockNumCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) Entity(ctx, id any) *MockEntityStoreEntityCall[TEntity]
- func (mr *MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum(ctx, 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 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 MockhttpRequestHandler
- type MockhttpRequestHandlerCloseIdleConnectionsCall
- func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) Do(f func()) *MockhttpRequestHandlerCloseIdleConnectionsCall
- func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) DoAndReturn(f func()) *MockhttpRequestHandlerCloseIdleConnectionsCall
- func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) Return() *MockhttpRequestHandlerCloseIdleConnectionsCall
- type MockhttpRequestHandlerDoCall
- func (c *MockhttpRequestHandlerDoCall) Do(f func(*http.Request) (*http.Response, error)) *MockhttpRequestHandlerDoCall
- func (c *MockhttpRequestHandlerDoCall) DoAndReturn(f func(*http.Request) (*http.Response, error)) *MockhttpRequestHandlerDoCall
- func (c *MockhttpRequestHandlerDoCall) Return(arg0 *http.Response, arg1 error) *MockhttpRequestHandlerDoCall
- type MockhttpRequestHandlerMockRecorder
- 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 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 RoSnapshots
- type Scraper
- type Service
- func (s *Service) CheckpointsFromBlock(ctx context.Context, startBlock uint64) ([]*Checkpoint, error)
- func (s *Service) MilestonesFromBlock(ctx context.Context, startBlock uint64) ([]*Milestone, error)
- func (s *Service) Producers(ctx context.Context, blockNum uint64) (*valset.ValidatorSet, error)
- func (s *Service) Ready(ctx context.Context) <-chan error
- func (s *Service) RegisterCheckpointObserver(callback func(*Checkpoint), opts ...ObserverOption) event.UnregisterFunc
- func (s *Service) RegisterMilestoneObserver(callback func(*Milestone), opts ...ObserverOption) event.UnregisterFunc
- func (s *Service) RegisterSpanObserver(callback func(*Span), opts ...ObserverOption) event.UnregisterFunc
- func (s *Service) Run(ctx context.Context) error
- func (s *Service) Span(ctx context.Context, id uint64) (*Span, bool, error)
- func (s *Service) SynchronizeCheckpoints(ctx context.Context) (*Checkpoint, error)
- func (s *Service) SynchronizeMilestones(ctx context.Context) (*Milestone, error)
- func (s *Service) SynchronizeSpans(ctx context.Context, blockNum uint64) error
- 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 SpanSnapshotStore
- func (s *SpanSnapshotStore) Entity(ctx context.Context, id uint64) (*Span, bool, error)
- func (s *SpanSnapshotStore) LastEntityId(ctx context.Context) (uint64, bool, error)
- func (s *SpanSnapshotStore) LastFrozenEntityId() uint64
- func (s *SpanSnapshotStore) Prepare(ctx context.Context) error
- func (s *SpanSnapshotStore) RangeExtractor() snaptype.RangeExtractor
- func (s *SpanSnapshotStore) WithTx(tx kv.Tx) EntityStore[*Span]
- 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") TransientErrors = []error{ ErrBadGateway, ErrServiceUnavailable, context.DeadlineExceeded, } )
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: recsplit.DefaultBucketSize, LeafSize: recsplit.DefaultLeafSize, 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"}, }
Functions ¶
func CalculateEventWindow ¶
func CheckpointsEnabled ¶
func CheckpointsEnabled() bool
func Fetch ¶
func Fetch[T any](ctx context.Context, request *HttpRequest, logger log.Logger) (*T, error)
Fetch fetches response from heimdall
func FetchWithRetry ¶
func FetchWithRetry[T any](ctx context.Context, client *HttpClient, 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 *HttpClient, 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 RecordWayPoints ¶
func RecordWayPoints(value bool)
func SnapshotTypes ¶
func SpanEndBlockNum ¶
SpanEndBlockNum returns the number of the last block in the given span.
func UpdateObservedWaypointCheckpointLength ¶
func UpdateObservedWaypointCheckpointLength(length uint64)
func UpdateObservedWaypointMilestoneLength ¶
func UpdateObservedWaypointMilestoneLength(length uint64)
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 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 ClosedRange ¶
func (ClosedRange) Len ¶
func (r ClosedRange) Len() uint64
type Entity ¶
type Entity interface { RawId() uint64 BlockNumRange() ClosedRange SetRawId(uint64) }
type EntityFetcher ¶
type EntityFetcher[TEntity Entity] struct { // contains filtered or unexported fields }
func NewCheckpointFetcher ¶
func NewCheckpointFetcher(client Client, logger log.Logger) *EntityFetcher[*Checkpoint]
func NewEntityFetcher ¶
func NewEntityFetcher[TEntity Entity]( name string, fetchFirstEntityId func(ctx context.Context) (int64, error), fetchLastEntityId func(ctx context.Context) (int64, error), fetchEntity func(ctx context.Context, id int64) (TEntity, error), fetchEntitiesPage func(ctx context.Context, page uint64, limit uint64) ([]TEntity, error), fetchEntitiesPageLimit uint64, fetchAllEntitiesIdxOffset uint64, logger log.Logger, ) *EntityFetcher[TEntity]
func NewMilestoneFetcher ¶
func NewMilestoneFetcher(client Client, logger log.Logger) *EntityFetcher[*Milestone]
func NewSpanFetcher ¶
func NewSpanFetcher(client Client, logger log.Logger) *EntityFetcher[*Span]
func (*EntityFetcher[TEntity]) FetchAllEntities ¶
func (f *EntityFetcher[TEntity]) FetchAllEntities(ctx context.Context) ([]TEntity, error)
func (*EntityFetcher[TEntity]) FetchEntitiesRange ¶
func (f *EntityFetcher[TEntity]) FetchEntitiesRange(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
func (*EntityFetcher[TEntity]) FetchEntitiesRangeSequentially ¶
func (f *EntityFetcher[TEntity]) FetchEntitiesRangeSequentially(ctx context.Context, idRange ClosedRange) ([]TEntity, error)
func (*EntityFetcher[TEntity]) FetchEntityIdRange ¶
func (f *EntityFetcher[TEntity]) FetchEntityIdRange(ctx context.Context) (ClosedRange, error)
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 HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(urlString string, logger log.Logger, opts ...HttpClientOption) *HttpClient
func (*HttpClient) Close ¶
func (c *HttpClient) Close()
Close sends a signal to stop the running process
func (*HttpClient) FetchCheckpoint ¶
func (c *HttpClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
FetchCheckpoint fetches the checkpoint from heimdall
func (*HttpClient) FetchCheckpointCount ¶
func (c *HttpClient) FetchCheckpointCount(ctx context.Context) (int64, error)
FetchCheckpointCount fetches the checkpoint count from heimdall
func (*HttpClient) FetchCheckpoints ¶
func (c *HttpClient) FetchCheckpoints(ctx context.Context, page uint64, limit uint64) ([]*Checkpoint, error)
func (*HttpClient) FetchFirstMilestoneNum ¶
func (c *HttpClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
func (*HttpClient) FetchLastNoAckMilestone ¶
func (c *HttpClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
FetchLastNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*HttpClient) FetchLatestSpan ¶
func (c *HttpClient) FetchLatestSpan(ctx context.Context) (*Span, error)
func (*HttpClient) FetchMilestone ¶
FetchMilestone fetches a milestone from heimdall
func (*HttpClient) FetchMilestoneCount ¶
func (c *HttpClient) FetchMilestoneCount(ctx context.Context) (int64, error)
FetchMilestoneCount fetches the milestone count from heimdall
func (*HttpClient) FetchMilestoneID ¶
func (c *HttpClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
FetchMilestoneID fetches the bool result from Heimdall whether the ID corresponding to the given milestone is in process in Heimdall
func (*HttpClient) FetchNoAckMilestone ¶
func (c *HttpClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
FetchNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*HttpClient) FetchSpans ¶
func (*HttpClient) FetchStateSyncEvent ¶
func (c *HttpClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
func (*HttpClient) FetchStateSyncEvents ¶
func (c *HttpClient) FetchStateSyncEvents(ctx context.Context, fromID uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
type HttpClientOption ¶
type HttpClientOption func(*HttpClient)
func WithHttpMaxRetries ¶
func WithHttpMaxRetries(maxRetries int) HttpClientOption
func WithHttpRequestHandler ¶
func WithHttpRequestHandler(handler httpRequestHandler) HttpClientOption
func WithHttpRetryBackOff ¶
func WithHttpRetryBackOff(retryBackOff time.Duration) HttpClientOption
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
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 MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) FetchCheckpoint ¶
func (m *MockClient) FetchCheckpoint(ctx context.Context, number int64) (*Checkpoint, error)
FetchCheckpoint mocks base method.
func (*MockClient) FetchCheckpointCount ¶
func (m *MockClient) FetchCheckpointCount(ctx context.Context) (int64, error)
FetchCheckpointCount mocks base method.
func (*MockClient) FetchCheckpoints ¶
func (m *MockClient) FetchCheckpoints(ctx context.Context, page, limit uint64) ([]*Checkpoint, error)
FetchCheckpoints mocks base method.
func (*MockClient) FetchFirstMilestoneNum ¶
func (m *MockClient) FetchFirstMilestoneNum(ctx context.Context) (int64, error)
FetchFirstMilestoneNum mocks base method.
func (*MockClient) FetchLastNoAckMilestone ¶
func (m *MockClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
FetchLastNoAckMilestone mocks base method.
func (*MockClient) FetchLatestSpan ¶
func (m *MockClient) FetchLatestSpan(ctx context.Context) (*Span, error)
FetchLatestSpan mocks base method.
func (*MockClient) FetchMilestone ¶
FetchMilestone mocks base method.
func (*MockClient) FetchMilestoneCount ¶
func (m *MockClient) FetchMilestoneCount(ctx context.Context) (int64, error)
FetchMilestoneCount mocks base method.
func (*MockClient) FetchMilestoneID ¶
func (m *MockClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
FetchMilestoneID mocks base method.
func (*MockClient) FetchNoAckMilestone ¶
func (m *MockClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
FetchNoAckMilestone mocks base method.
func (*MockClient) FetchSpans ¶
FetchSpans mocks base method.
func (*MockClient) FetchStateSyncEvent ¶
func (m *MockClient) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error)
FetchStateSyncEvent mocks base method.
func (*MockClient) FetchStateSyncEvents ¶
func (m *MockClient) FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error)
FetchStateSyncEvents mocks base method.
type MockClientCloseCall ¶
MockClientCloseCall wrap *gomock.Call
func (*MockClientCloseCall) Do ¶
func (c *MockClientCloseCall) Do(f func()) *MockClientCloseCall
Do rewrite *gomock.Call.Do
func (*MockClientCloseCall) DoAndReturn ¶
func (c *MockClientCloseCall) DoAndReturn(f func()) *MockClientCloseCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientCloseCall) Return ¶
func (c *MockClientCloseCall) Return() *MockClientCloseCall
Return rewrite *gomock.Call.Return
type MockClientFetchCheckpointCall ¶
MockClientFetchCheckpointCall wrap *gomock.Call
func (*MockClientFetchCheckpointCall) Do ¶
func (c *MockClientFetchCheckpointCall) Do(f func(context.Context, int64) (*Checkpoint, error)) *MockClientFetchCheckpointCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchCheckpointCall) DoAndReturn ¶
func (c *MockClientFetchCheckpointCall) DoAndReturn(f func(context.Context, int64) (*Checkpoint, error)) *MockClientFetchCheckpointCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchCheckpointCall) Return ¶
func (c *MockClientFetchCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockClientFetchCheckpointCall
Return rewrite *gomock.Call.Return
type MockClientFetchCheckpointCountCall ¶
MockClientFetchCheckpointCountCall wrap *gomock.Call
func (*MockClientFetchCheckpointCountCall) Do ¶
func (c *MockClientFetchCheckpointCountCall) Do(f func(context.Context) (int64, error)) *MockClientFetchCheckpointCountCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchCheckpointCountCall) DoAndReturn ¶
func (c *MockClientFetchCheckpointCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchCheckpointCountCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchCheckpointCountCall) Return ¶
func (c *MockClientFetchCheckpointCountCall) Return(arg0 int64, arg1 error) *MockClientFetchCheckpointCountCall
Return rewrite *gomock.Call.Return
type MockClientFetchCheckpointsCall ¶
MockClientFetchCheckpointsCall wrap *gomock.Call
func (*MockClientFetchCheckpointsCall) Do ¶
func (c *MockClientFetchCheckpointsCall) Do(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockClientFetchCheckpointsCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchCheckpointsCall) DoAndReturn ¶
func (c *MockClientFetchCheckpointsCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Checkpoint, error)) *MockClientFetchCheckpointsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchCheckpointsCall) Return ¶
func (c *MockClientFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockClientFetchCheckpointsCall
Return rewrite *gomock.Call.Return
type MockClientFetchFirstMilestoneNumCall ¶
MockClientFetchFirstMilestoneNumCall wrap *gomock.Call
func (*MockClientFetchFirstMilestoneNumCall) Do ¶
func (c *MockClientFetchFirstMilestoneNumCall) Do(f func(context.Context) (int64, error)) *MockClientFetchFirstMilestoneNumCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchFirstMilestoneNumCall) DoAndReturn ¶
func (c *MockClientFetchFirstMilestoneNumCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchFirstMilestoneNumCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchFirstMilestoneNumCall) Return ¶
func (c *MockClientFetchFirstMilestoneNumCall) Return(arg0 int64, arg1 error) *MockClientFetchFirstMilestoneNumCall
Return rewrite *gomock.Call.Return
type MockClientFetchLastNoAckMilestoneCall ¶
MockClientFetchLastNoAckMilestoneCall wrap *gomock.Call
func (*MockClientFetchLastNoAckMilestoneCall) Do ¶
func (c *MockClientFetchLastNoAckMilestoneCall) Do(f func(context.Context) (string, error)) *MockClientFetchLastNoAckMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchLastNoAckMilestoneCall) DoAndReturn ¶
func (c *MockClientFetchLastNoAckMilestoneCall) DoAndReturn(f func(context.Context) (string, error)) *MockClientFetchLastNoAckMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchLastNoAckMilestoneCall) Return ¶
func (c *MockClientFetchLastNoAckMilestoneCall) Return(arg0 string, arg1 error) *MockClientFetchLastNoAckMilestoneCall
Return rewrite *gomock.Call.Return
type MockClientFetchLatestSpanCall ¶
MockClientFetchLatestSpanCall wrap *gomock.Call
func (*MockClientFetchLatestSpanCall) Do ¶
func (c *MockClientFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockClientFetchLatestSpanCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchLatestSpanCall) DoAndReturn ¶
func (c *MockClientFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockClientFetchLatestSpanCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchLatestSpanCall) Return ¶
func (c *MockClientFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockClientFetchLatestSpanCall
Return rewrite *gomock.Call.Return
type MockClientFetchMilestoneCall ¶
MockClientFetchMilestoneCall wrap *gomock.Call
func (*MockClientFetchMilestoneCall) Do ¶
func (c *MockClientFetchMilestoneCall) Do(f func(context.Context, int64) (*Milestone, error)) *MockClientFetchMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchMilestoneCall) DoAndReturn ¶
func (c *MockClientFetchMilestoneCall) DoAndReturn(f func(context.Context, int64) (*Milestone, error)) *MockClientFetchMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchMilestoneCall) Return ¶
func (c *MockClientFetchMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockClientFetchMilestoneCall
Return rewrite *gomock.Call.Return
type MockClientFetchMilestoneCountCall ¶
MockClientFetchMilestoneCountCall wrap *gomock.Call
func (*MockClientFetchMilestoneCountCall) Do ¶
func (c *MockClientFetchMilestoneCountCall) Do(f func(context.Context) (int64, error)) *MockClientFetchMilestoneCountCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchMilestoneCountCall) DoAndReturn ¶
func (c *MockClientFetchMilestoneCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockClientFetchMilestoneCountCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchMilestoneCountCall) Return ¶
func (c *MockClientFetchMilestoneCountCall) Return(arg0 int64, arg1 error) *MockClientFetchMilestoneCountCall
Return rewrite *gomock.Call.Return
type MockClientFetchMilestoneIDCall ¶
MockClientFetchMilestoneIDCall wrap *gomock.Call
func (*MockClientFetchMilestoneIDCall) Do ¶
func (c *MockClientFetchMilestoneIDCall) Do(f func(context.Context, string) error) *MockClientFetchMilestoneIDCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchMilestoneIDCall) DoAndReturn ¶
func (c *MockClientFetchMilestoneIDCall) DoAndReturn(f func(context.Context, string) error) *MockClientFetchMilestoneIDCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchMilestoneIDCall) Return ¶
func (c *MockClientFetchMilestoneIDCall) Return(arg0 error) *MockClientFetchMilestoneIDCall
Return rewrite *gomock.Call.Return
type MockClientFetchNoAckMilestoneCall ¶
MockClientFetchNoAckMilestoneCall wrap *gomock.Call
func (*MockClientFetchNoAckMilestoneCall) Do ¶
func (c *MockClientFetchNoAckMilestoneCall) Do(f func(context.Context, string) error) *MockClientFetchNoAckMilestoneCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchNoAckMilestoneCall) DoAndReturn ¶
func (c *MockClientFetchNoAckMilestoneCall) DoAndReturn(f func(context.Context, string) error) *MockClientFetchNoAckMilestoneCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchNoAckMilestoneCall) Return ¶
func (c *MockClientFetchNoAckMilestoneCall) Return(arg0 error) *MockClientFetchNoAckMilestoneCall
Return rewrite *gomock.Call.Return
type MockClientFetchSpanCall ¶
MockClientFetchSpanCall wrap *gomock.Call
func (*MockClientFetchSpanCall) Do ¶
func (c *MockClientFetchSpanCall) Do(f func(context.Context, uint64) (*Span, error)) *MockClientFetchSpanCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchSpanCall) DoAndReturn ¶
func (c *MockClientFetchSpanCall) DoAndReturn(f func(context.Context, uint64) (*Span, error)) *MockClientFetchSpanCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchSpanCall) Return ¶
func (c *MockClientFetchSpanCall) Return(arg0 *Span, arg1 error) *MockClientFetchSpanCall
Return rewrite *gomock.Call.Return
type MockClientFetchSpansCall ¶
MockClientFetchSpansCall wrap *gomock.Call
func (*MockClientFetchSpansCall) Do ¶
func (c *MockClientFetchSpansCall) Do(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockClientFetchSpansCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchSpansCall) DoAndReturn ¶
func (c *MockClientFetchSpansCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*Span, error)) *MockClientFetchSpansCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchSpansCall) Return ¶
func (c *MockClientFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockClientFetchSpansCall
Return rewrite *gomock.Call.Return
type MockClientFetchStateSyncEventCall ¶
MockClientFetchStateSyncEventCall wrap *gomock.Call
func (*MockClientFetchStateSyncEventCall) Do ¶
func (c *MockClientFetchStateSyncEventCall) Do(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockClientFetchStateSyncEventCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchStateSyncEventCall) DoAndReturn ¶
func (c *MockClientFetchStateSyncEventCall) DoAndReturn(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockClientFetchStateSyncEventCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchStateSyncEventCall) Return ¶
func (c *MockClientFetchStateSyncEventCall) Return(arg0 *EventRecordWithTime, arg1 error) *MockClientFetchStateSyncEventCall
Return rewrite *gomock.Call.Return
type MockClientFetchStateSyncEventsCall ¶
MockClientFetchStateSyncEventsCall wrap *gomock.Call
func (*MockClientFetchStateSyncEventsCall) Do ¶
func (c *MockClientFetchStateSyncEventsCall) Do(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockClientFetchStateSyncEventsCall
Do rewrite *gomock.Call.Do
func (*MockClientFetchStateSyncEventsCall) DoAndReturn ¶
func (c *MockClientFetchStateSyncEventsCall) DoAndReturn(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockClientFetchStateSyncEventsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockClientFetchStateSyncEventsCall) Return ¶
func (c *MockClientFetchStateSyncEventsCall) Return(arg0 []*EventRecordWithTime, arg1 error) *MockClientFetchStateSyncEventsCall
Return rewrite *gomock.Call.Return
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Close ¶
func (mr *MockClientMockRecorder) Close() *MockClientCloseCall
Close indicates an expected call of Close.
func (*MockClientMockRecorder) FetchCheckpoint ¶
func (mr *MockClientMockRecorder) FetchCheckpoint(ctx, number any) *MockClientFetchCheckpointCall
FetchCheckpoint indicates an expected call of FetchCheckpoint.
func (*MockClientMockRecorder) FetchCheckpointCount ¶
func (mr *MockClientMockRecorder) FetchCheckpointCount(ctx any) *MockClientFetchCheckpointCountCall
FetchCheckpointCount indicates an expected call of FetchCheckpointCount.
func (*MockClientMockRecorder) FetchCheckpoints ¶
func (mr *MockClientMockRecorder) FetchCheckpoints(ctx, page, limit any) *MockClientFetchCheckpointsCall
FetchCheckpoints indicates an expected call of FetchCheckpoints.
func (*MockClientMockRecorder) FetchFirstMilestoneNum ¶
func (mr *MockClientMockRecorder) FetchFirstMilestoneNum(ctx any) *MockClientFetchFirstMilestoneNumCall
FetchFirstMilestoneNum indicates an expected call of FetchFirstMilestoneNum.
func (*MockClientMockRecorder) FetchLastNoAckMilestone ¶
func (mr *MockClientMockRecorder) FetchLastNoAckMilestone(ctx any) *MockClientFetchLastNoAckMilestoneCall
FetchLastNoAckMilestone indicates an expected call of FetchLastNoAckMilestone.
func (*MockClientMockRecorder) FetchLatestSpan ¶
func (mr *MockClientMockRecorder) FetchLatestSpan(ctx any) *MockClientFetchLatestSpanCall
FetchLatestSpan indicates an expected call of FetchLatestSpan.
func (*MockClientMockRecorder) FetchMilestone ¶
func (mr *MockClientMockRecorder) FetchMilestone(ctx, number any) *MockClientFetchMilestoneCall
FetchMilestone indicates an expected call of FetchMilestone.
func (*MockClientMockRecorder) FetchMilestoneCount ¶
func (mr *MockClientMockRecorder) FetchMilestoneCount(ctx any) *MockClientFetchMilestoneCountCall
FetchMilestoneCount indicates an expected call of FetchMilestoneCount.
func (*MockClientMockRecorder) FetchMilestoneID ¶
func (mr *MockClientMockRecorder) FetchMilestoneID(ctx, milestoneID any) *MockClientFetchMilestoneIDCall
FetchMilestoneID indicates an expected call of FetchMilestoneID.
func (*MockClientMockRecorder) FetchNoAckMilestone ¶
func (mr *MockClientMockRecorder) FetchNoAckMilestone(ctx, milestoneID any) *MockClientFetchNoAckMilestoneCall
FetchNoAckMilestone indicates an expected call of FetchNoAckMilestone.
func (*MockClientMockRecorder) FetchSpan ¶
func (mr *MockClientMockRecorder) FetchSpan(ctx, spanID any) *MockClientFetchSpanCall
FetchSpan indicates an expected call of FetchSpan.
func (*MockClientMockRecorder) FetchSpans ¶
func (mr *MockClientMockRecorder) FetchSpans(ctx, page, limit any) *MockClientFetchSpansCall
FetchSpans indicates an expected call of FetchSpans.
func (*MockClientMockRecorder) FetchStateSyncEvent ¶
func (mr *MockClientMockRecorder) FetchStateSyncEvent(ctx, id any) *MockClientFetchStateSyncEventCall
FetchStateSyncEvent indicates an expected call of FetchStateSyncEvent.
func (*MockClientMockRecorder) FetchStateSyncEvents ¶
func (mr *MockClientMockRecorder) FetchStateSyncEvents(ctx, fromId, to, limit any) *MockClientFetchStateSyncEventsCall
FetchStateSyncEvents indicates an expected call of FetchStateSyncEvents.
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, unwindPoint uint64) (int, error)
DeleteFromBlockNum mocks base method.
func (*MockEntityStore[TEntity]) DeleteToBlockNum ¶
func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, unwindPoint uint64, limit int) (int, error)
DeleteToBlockNum 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 ¶
MockEntityStoreDeleteFromBlockNumCall 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, unwindPoint any) *MockEntityStoreDeleteFromBlockNumCall[TEntity]
DeleteFromBlockNum indicates an expected call of DeleteFromBlockNum.
func (*MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum ¶
func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx, unwindPoint, 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, 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 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 MockhttpRequestHandler ¶
type MockhttpRequestHandler struct {
// contains filtered or unexported fields
}
MockhttpRequestHandler is a mock of httpRequestHandler interface.
func NewMockhttpRequestHandler ¶
func NewMockhttpRequestHandler(ctrl *gomock.Controller) *MockhttpRequestHandler
NewMockhttpRequestHandler creates a new mock instance.
func (*MockhttpRequestHandler) CloseIdleConnections ¶
func (m *MockhttpRequestHandler) CloseIdleConnections()
CloseIdleConnections mocks base method.
func (*MockhttpRequestHandler) EXPECT ¶
func (m *MockhttpRequestHandler) EXPECT() *MockhttpRequestHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockhttpRequestHandlerCloseIdleConnectionsCall ¶
MockhttpRequestHandlerCloseIdleConnectionsCall wrap *gomock.Call
func (*MockhttpRequestHandlerCloseIdleConnectionsCall) Do ¶
func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) Do(f func()) *MockhttpRequestHandlerCloseIdleConnectionsCall
Do rewrite *gomock.Call.Do
func (*MockhttpRequestHandlerCloseIdleConnectionsCall) DoAndReturn ¶
func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) DoAndReturn(f func()) *MockhttpRequestHandlerCloseIdleConnectionsCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockhttpRequestHandlerCloseIdleConnectionsCall) Return ¶
func (c *MockhttpRequestHandlerCloseIdleConnectionsCall) Return() *MockhttpRequestHandlerCloseIdleConnectionsCall
Return rewrite *gomock.Call.Return
type MockhttpRequestHandlerDoCall ¶
MockhttpRequestHandlerDoCall wrap *gomock.Call
func (*MockhttpRequestHandlerDoCall) Do ¶
func (c *MockhttpRequestHandlerDoCall) Do(f func(*http.Request) (*http.Response, error)) *MockhttpRequestHandlerDoCall
Do rewrite *gomock.Call.Do
func (*MockhttpRequestHandlerDoCall) DoAndReturn ¶
func (c *MockhttpRequestHandlerDoCall) DoAndReturn(f func(*http.Request) (*http.Response, error)) *MockhttpRequestHandlerDoCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockhttpRequestHandlerDoCall) Return ¶
func (c *MockhttpRequestHandlerDoCall) Return(arg0 *http.Response, arg1 error) *MockhttpRequestHandlerDoCall
Return rewrite *gomock.Call.Return
type MockhttpRequestHandlerMockRecorder ¶
type MockhttpRequestHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockhttpRequestHandlerMockRecorder is the mock recorder for MockhttpRequestHandler.
func (*MockhttpRequestHandlerMockRecorder) CloseIdleConnections ¶
func (mr *MockhttpRequestHandlerMockRecorder) CloseIdleConnections() *MockhttpRequestHandlerCloseIdleConnectionsCall
CloseIdleConnections indicates an expected call of CloseIdleConnections.
func (*MockhttpRequestHandlerMockRecorder) Do ¶
func (mr *MockhttpRequestHandlerMockRecorder) Do(req any) *MockhttpRequestHandlerDoCall
Do indicates an expected call of Do.
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 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 Scraper ¶
type Scraper[TEntity Entity] struct { // contains filtered or unexported fields }
func NewScraper ¶
func (*Scraper[TEntity]) RegisterObserver ¶
func (s *Scraper[TEntity]) RegisterObserver(observer func([]TEntity)) event.UnregisterFunc
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(config ServiceConfig) *Service
func (*Service) CheckpointsFromBlock ¶
func (*Service) MilestonesFromBlock ¶
func (*Service) RegisterCheckpointObserver ¶
func (s *Service) RegisterCheckpointObserver(callback func(*Checkpoint), opts ...ObserverOption) event.UnregisterFunc
func (*Service) RegisterMilestoneObserver ¶
func (s *Service) RegisterMilestoneObserver(callback func(*Milestone), opts ...ObserverOption) event.UnregisterFunc
func (*Service) RegisterSpanObserver ¶
func (s *Service) RegisterSpanObserver(callback func(*Span), opts ...ObserverOption) event.UnregisterFunc
func (*Service) SynchronizeCheckpoints ¶
func (s *Service) SynchronizeCheckpoints(ctx context.Context) (*Checkpoint, error)
func (*Service) SynchronizeMilestones ¶
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 SpanSnapshotStore ¶
type SpanSnapshotStore struct { EntityStore[*Span] // contains filtered or unexported fields }
func NewSpanSnapshotStore ¶
func NewSpanSnapshotStore(base EntityStore[*Span], snapshots *RoSnapshots) *SpanSnapshotStore
func (*SpanSnapshotStore) LastEntityId ¶
func (*SpanSnapshotStore) LastFrozenEntityId ¶
func (s *SpanSnapshotStore) LastFrozenEntityId() uint64
func (*SpanSnapshotStore) RangeExtractor ¶
func (s *SpanSnapshotStore) RangeExtractor() snaptype.RangeExtractor
func (*SpanSnapshotStore) WithTx ¶
func (s *SpanSnapshotStore) WithTx(tx kv.Tx) EntityStore[*Span]
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_http.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_request_handler.go
- http_request_handler_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