Skip to content

Commit

Permalink
Remove LES v4 protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Jun 27, 2023
1 parent 4bd05de commit 42c2236
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
23 changes: 0 additions & 23 deletions les/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ func TestSequentialAnnouncementsLes3(t *testing.T) {
func TestSequentialAnnouncementsUltraLes3(t *testing.T) {
testSequentialAnnouncements(t, downloader.LightestSync, lpv3)
}
func TestSequentialAnnouncementsLes4(t *testing.T) {
testSequentialAnnouncements(t, downloader.LightSync, lpv4)
}
func TestSequentialAnnouncementsUltraLes4(t *testing.T) {
testSequentialAnnouncements(t, downloader.LightestSync, lpv4)
}
func TestSequentialAnnouncementsLes5(t *testing.T) {
testSequentialAnnouncements(t, downloader.LightSync, lpv5)
}
Expand Down Expand Up @@ -138,13 +132,6 @@ func TestGappedAnnouncementsUltraLes3(t *testing.T) {
t.Skip("added in the les refactor, check if necessary for LightestSync")
testGappedAnnouncements(t, downloader.LightestSync, lpv3)
}
func TestGappedAnnouncementsLes4(t *testing.T) {
testGappedAnnouncements(t, downloader.LightSync, lpv4)
}
func TestGappedAnnouncementsUltraLes4(t *testing.T) {
t.Skip("added in the les refactor, check if necessary for LightestSync")
testGappedAnnouncements(t, downloader.LightestSync, lpv4)
}
func TestGappedAnnouncementsLes5(t *testing.T) {
testGappedAnnouncements(t, downloader.LightSync, lpv5)
}
Expand Down Expand Up @@ -216,15 +203,6 @@ func TestTrustedAnnouncementsUltraLes3(t *testing.T) {
testTrustedAnnouncement(t, downloader.LightestSync, lpv3)
}

func TestTrustedAnnouncementsLes4(t *testing.T) {
testTrustedAnnouncement(t, downloader.LightSync, lpv4)
}

func TestTrustedAnnouncementsUltraLes4(t *testing.T) {
t.Skip("added in the les refactor, check if necessary for LightestSync")
testTrustedAnnouncement(t, downloader.LightestSync, lpv4)
}

func TestTrustedAnnouncementsLes5(t *testing.T) {
testTrustedAnnouncement(t, downloader.LightSync, lpv5)
}
Expand Down Expand Up @@ -309,7 +287,6 @@ func testTrustedAnnouncement(t *testing.T, syncMode downloader.SyncMode, protoco

func TestInvalidAnnouncesLES2(t *testing.T) { testInvalidAnnounces(t, downloader.LightSync, lpv2) }
func TestInvalidAnnouncesLES3(t *testing.T) { testInvalidAnnounces(t, downloader.LightSync, lpv3) }
func TestInvalidAnnouncesLES4(t *testing.T) { testInvalidAnnounces(t, downloader.LightSync, lpv4) }
func TestInvalidAnnouncesLES5(t *testing.T) { testInvalidAnnounces(t, downloader.LightSync, lpv5) }

func testInvalidAnnounces(t *testing.T, syncMode downloader.SyncMode, protocol int) {
Expand Down
5 changes: 0 additions & 5 deletions les/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ func testGetBloombitsProofs(t *testing.T, protocol int) {

func TestTransactionStatusLes2(t *testing.T) { testTransactionStatus(t, lpv2) }
func TestTransactionStatusLes3(t *testing.T) { testTransactionStatus(t, lpv3) }
func TestTransactionStatusLes4(t *testing.T) { testTransactionStatus(t, lpv4) }
func TestTransactionStatusLes5(t *testing.T) { testTransactionStatus(t, lpv5) }

func testTransactionStatus(t *testing.T, protocol int) {
Expand Down Expand Up @@ -693,7 +692,6 @@ func testTransactionStatus(t *testing.T, protocol int) {
}

func TestStopResumeLES3(t *testing.T) { testStopResume(t, lpv3) }
func TestStopResumeLES4(t *testing.T) { testStopResume(t, lpv4) }
func TestStopResumeLES5(t *testing.T) { testStopResume(t, lpv5) }

func testStopResume(t *testing.T, protocol int) {
Expand Down Expand Up @@ -757,9 +755,6 @@ func TestTransactionGatewayFeeRequirementLes2(t *testing.T) {
func TestTransactionGatewayFeeRequirementLes3(t *testing.T) {
testTransactionGatewayFeeRequirement(t, lpv3)
}
func TestTransactionGatewayFeeRequirementLes4(t *testing.T) {
testTransactionGatewayFeeRequirement(t, lpv4)
}
func TestTransactionGatewayFeeRequirementLes5(t *testing.T) {
testTransactionGatewayFeeRequirement(t, lpv5)
}
Expand Down
7 changes: 3 additions & 4 deletions les/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,18 @@ import (
const (
lpv2 = 2
lpv3 = 3
lpv4 = 4 // Work in progress. Breaking changes expected.
lpv5 = 5 // eth lpv4
)

// Supported versions of the les protocol (first is primary)
var (
ClientProtocolVersions = []uint{lpv2, lpv3, lpv4, lpv5}
ServerProtocolVersions = []uint{lpv2, lpv3, lpv4, lpv5}
ClientProtocolVersions = []uint{lpv2, lpv3, lpv5}
ServerProtocolVersions = []uint{lpv2, lpv3, lpv5}
AdvertiseProtocolVersions = []uint{lpv2} // clients are searching for the first advertised protocol in the list
)

// Number of implemented message corresponding to different protocol versions.
var ProtocolLengths = map[uint]uint64{lpv2: 24, lpv3: 26, lpv4: 28, lpv5: 28}
var ProtocolLengths = map[uint]uint64{lpv2: 24, lpv3: 26, lpv5: 28}

const (
NetworkId = 1
Expand Down

0 comments on commit 42c2236

Please sign in to comment.