Skip to content

Commit

Permalink
remove old comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Nov 4, 2024
1 parent 46eabdc commit f9d2daf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion header.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ type Header[H any] interface {
// New creates new instance of a header.
// It exists to overcome limitation of Go's type system.
// See:
// https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#pointer-method-example
//
//https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#pointer-method-example
New() H
// IsZero reports whether Header is a zero value of it's concrete type.
IsZero() bool
Expand Down
2 changes: 1 addition & 1 deletion p2p/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (timeoutStore[H]) Append(ctx context.Context, _ ...H) error {
return ctx.Err()
}

func (timeoutStore[H]) GetRange(ctx context.Context, _ uint64, _ uint64) ([]H, error) {
func (timeoutStore[H]) GetRange(ctx context.Context, _, _ uint64) ([]H, error) {
<-ctx.Done()
return nil, ctx.Err()
}
20 changes: 10 additions & 10 deletions sync/sync_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,16 @@ func (s *Syncer[H]) verify(ctx context.Context, newHead H) (bool, error) {
return false, err
}

/*
Subjective head is 500, network head is 1000.
Header at height 1000 does not have sufficient validator set overlap,
so the client downloads height 750 (which does have enough sufficient overlap),
verifies it against 500 and advances the subjective head to 750.
Client tries to apply height 1000 against 750 and if there is sufficient overlap,
it applies 1000 as the subjective head.
If not, it downloads the halfway point and retries the process.
*/
// verifySkipping will try to find such headers in range (subjHead, networkHeader)
// that can be verified by subjHead, literally:
//
// header.Verify(subjHead, candidate)
//
// and also such headers can verify `networkHeader`, literally
//
// header.Verify(candidate, networkHeader)
//
// When such candidates cannot be found [NewValidatorSetCantBeTrustedError] will be returned.
func (s *Syncer[H]) verifySkipping(ctx context.Context, subjHead, networkHeader H) error {
subjHeight := subjHead.Height()

Expand Down

0 comments on commit f9d2daf

Please sign in to comment.