Documentation ¶
Index ¶
- Variables
- type CheckpointInit
- type ForwardUpdateSync
- type HeadSync
- type ReqBeaconBlock
- type ReqCheckpointData
- type ReqFinality
- type ReqHeader
- type ReqUpdates
- type RespHeader
- type RespUpdates
- type TestCommitteeChain
- func (tc *TestCommitteeChain) CheckpointInit(bootstrap types.BootstrapData) error
- func (tc *TestCommitteeChain) ExpInit(t *testing.T, ExpInit bool)
- func (tc *TestCommitteeChain) ExpNextSyncPeriod(t *testing.T, expNsp uint64)
- func (tc *TestCommitteeChain) InsertUpdate(update *types.LightClientUpdate, nextCommittee *types.SerializedSyncCommittee) error
- func (tc *TestCommitteeChain) NextSyncPeriod() (uint64, bool)
- func (tc *TestCommitteeChain) SetNextSyncPeriod(nsp uint64)
- type TestHeadTracker
- func (ht *TestHeadTracker) ExpPrefetch(t *testing.T, tci int, exp types.HeadInfo)
- func (ht *TestHeadTracker) ExpValidated(t *testing.T, tci int, expHeads []types.OptimisticUpdate)
- func (ht *TestHeadTracker) SetPrefetchHead(head types.HeadInfo)
- func (ht *TestHeadTracker) ValidateFinality(update types.FinalityUpdate) (bool, error)
- func (ht *TestHeadTracker) ValidateOptimistic(update types.OptimisticUpdate) (bool, error)
- func (ht *TestHeadTracker) ValidatedFinality() (types.FinalityUpdate, bool)
- type TestScheduler
- func (ts *TestScheduler) AddAllowance(server request.Server, allowance int)
- func (ts *TestScheduler) AddServer(server request.Server, allowance int)
- func (ts *TestScheduler) CanSendTo() (cs []request.Server)
- func (ts *TestScheduler) ExpFail(server request.Server)
- func (ts *TestScheduler) Fail(server request.Server, desc string)
- func (ts *TestScheduler) RemoveServer(server request.Server)
- func (ts *TestScheduler) Request(testIndex, reqIndex int) requestWithID
- func (ts *TestScheduler) RequestEvent(evType *request.EventType, req requestWithID, resp request.Response)
- func (ts *TestScheduler) Run(testIndex int, exp ...any)
- func (ts *TestScheduler) Send(server request.Server, req request.Request) request.ID
- func (ts *TestScheduler) ServerEvent(evType *request.EventType, server request.Server, data any)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CheckpointInit ¶
type CheckpointInit struct {
// contains filtered or unexported fields
}
CheckpointInit implements request.Module; it fetches the light client bootstrap data belonging to the given checkpoint hash and initializes the committee chain if successful.
func NewCheckpointInit ¶
func NewCheckpointInit(chain committeeChain, checkpointHash common.Hash) *CheckpointInit
NewCheckpointInit creates a new CheckpointInit.
type ForwardUpdateSync ¶
type ForwardUpdateSync struct {
// contains filtered or unexported fields
}
ForwardUpdateSync implements request.Module; it fetches updates between the committee chain head and each server's announced head. Updates are fetched in batches and multiple batches can also be requested in parallel. Out of order responses are also handled; if a batch of updates cannot be added to the chain immediately because of a gap then the future updates are remembered until they can be processed.
func NewForwardUpdateSync ¶
func NewForwardUpdateSync(chain committeeChain) *ForwardUpdateSync
NewForwardUpdateSync creates a new ForwardUpdateSync.
type HeadSync ¶
type HeadSync struct {
// contains filtered or unexported fields
}
HeadSync implements request.Module; it updates the validated and prefetch heads of HeadTracker based on the EvHead and EvSignedHead events coming from registered servers. It can also postpone the validation of the latest announced signed head until the committee chain is synced up to at least the required period.
func NewHeadSync ¶
func NewHeadSync(headTracker headTracker, chain committeeChain) *HeadSync
NewHeadSync creates a new HeadSync.
type ReqBeaconBlock ¶
type ReqCheckpointData ¶
type ReqFinality ¶
type ReqFinality struct{}
type ReqUpdates ¶
type ReqUpdates struct {
FirstPeriod, Count uint64
}
type RespHeader ¶
type RespUpdates ¶
type RespUpdates struct { Updates []*types.LightClientUpdate Committees []*types.SerializedSyncCommittee }
type TestCommitteeChain ¶
type TestCommitteeChain struct {
// contains filtered or unexported fields
}
func (*TestCommitteeChain) CheckpointInit ¶
func (tc *TestCommitteeChain) CheckpointInit(bootstrap types.BootstrapData) error
func (*TestCommitteeChain) ExpInit ¶
func (tc *TestCommitteeChain) ExpInit(t *testing.T, ExpInit bool)
func (*TestCommitteeChain) ExpNextSyncPeriod ¶
func (tc *TestCommitteeChain) ExpNextSyncPeriod(t *testing.T, expNsp uint64)
func (*TestCommitteeChain) InsertUpdate ¶
func (tc *TestCommitteeChain) InsertUpdate(update *types.LightClientUpdate, nextCommittee *types.SerializedSyncCommittee) error
func (*TestCommitteeChain) NextSyncPeriod ¶
func (tc *TestCommitteeChain) NextSyncPeriod() (uint64, bool)
func (*TestCommitteeChain) SetNextSyncPeriod ¶
func (tc *TestCommitteeChain) SetNextSyncPeriod(nsp uint64)
type TestHeadTracker ¶
type TestHeadTracker struct {
// contains filtered or unexported fields
}
func (*TestHeadTracker) ExpPrefetch ¶
func (*TestHeadTracker) ExpValidated ¶
func (ht *TestHeadTracker) ExpValidated(t *testing.T, tci int, expHeads []types.OptimisticUpdate)
func (*TestHeadTracker) SetPrefetchHead ¶
func (ht *TestHeadTracker) SetPrefetchHead(head types.HeadInfo)
func (*TestHeadTracker) ValidateFinality ¶
func (ht *TestHeadTracker) ValidateFinality(update types.FinalityUpdate) (bool, error)
func (*TestHeadTracker) ValidateOptimistic ¶
func (ht *TestHeadTracker) ValidateOptimistic(update types.OptimisticUpdate) (bool, error)
func (*TestHeadTracker) ValidatedFinality ¶
func (ht *TestHeadTracker) ValidatedFinality() (types.FinalityUpdate, bool)
type TestScheduler ¶
type TestScheduler struct {
// contains filtered or unexported fields
}
func NewTestScheduler ¶
func NewTestScheduler(t *testing.T, module request.Module) *TestScheduler
func (*TestScheduler) AddAllowance ¶
func (ts *TestScheduler) AddAllowance(server request.Server, allowance int)
func (*TestScheduler) AddServer ¶
func (ts *TestScheduler) AddServer(server request.Server, allowance int)
func (*TestScheduler) CanSendTo ¶
func (ts *TestScheduler) CanSendTo() (cs []request.Server)
func (*TestScheduler) ExpFail ¶
func (ts *TestScheduler) ExpFail(server request.Server)
func (*TestScheduler) RemoveServer ¶
func (ts *TestScheduler) RemoveServer(server request.Server)
func (*TestScheduler) Request ¶
func (ts *TestScheduler) Request(testIndex, reqIndex int) requestWithID
func (*TestScheduler) RequestEvent ¶
func (ts *TestScheduler) RequestEvent(evType *request.EventType, req requestWithID, resp request.Response)
func (*TestScheduler) Run ¶
func (ts *TestScheduler) Run(testIndex int, exp ...any)