diff --git a/headertest/verify_test.go b/headertest/verify_test.go index 35456991..8d04397f 100644 --- a/headertest/verify_test.go +++ b/headertest/verify_test.go @@ -95,15 +95,6 @@ func TestVerify(t *testing.T) { }, err: header.ErrKnownHeader, }, - { - trusted: trusted, - prepare: func() *DummyHeader { - untrusted := next() - untrusted.HeightI += 100000 - return untrusted - }, - err: header.ErrHeightFromFuture, - }, { trusted: trusted, prepare: func() *DummyHeader { diff --git a/verify.go b/verify.go index 72888ef8..a5141ad2 100644 --- a/verify.go +++ b/verify.go @@ -75,13 +75,6 @@ func verify[H Header[H]](trstd, untrstd H, heightThreshold uint64) error { if known { return fmt.Errorf("%w: '%d' <= current '%d'", ErrKnownHeader, untrstd.Height(), trstd.Height()) } - // reject headers with height too far from the future - // this is essential for headers failed non-adjacent verification - // yet taken as sync target - adequateHeight := untrstd.Height()-trstd.Height() < heightThreshold - if !adequateHeight { - return fmt.Errorf("%w: '%d' - current '%d' >= threshold '%d'", ErrHeightFromFuture, untrstd.Height(), trstd.Height(), heightThreshold) - } return nil }