Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lighthouse p2p Good Bye codes #7601

Merged
merged 2 commits into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 16 additions & 3 deletions beacon-chain/sync/rpc_goodbye.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@ import (
)

const (
// Spec defined codes
codeClientShutdown types.SSZUint64 = iota
codeWrongNetwork
codeGenericError

// Teku specific codes
codeUnableToVerifyNetwork = types.SSZUint64(128)

// Lighthouse specific codes
codeTooManyPeers = types.SSZUint64(129)
codeBadScore = types.SSZUint64(250)
codeBanned = types.SSZUint64(251)
)

var goodByes = map[types.SSZUint64]string{
codeClientShutdown: "client shutdown",
codeWrongNetwork: "irrelevant network",
codeGenericError: "fault/error",
codeClientShutdown: "client shutdown",
codeWrongNetwork: "irrelevant network",
codeGenericError: "fault/error",
codeUnableToVerifyNetwork: "unable to verify network",
codeTooManyPeers: "client has too many peers",
codeBadScore: "peer score too low",
codeBanned: "client banned this node",
}

// Add a short delay to allow the stream to flush before resetting it.
Expand Down