From b4c1c1db9beee8d5046fa7491e69c72ade50dfa8 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 21 Oct 2020 19:35:10 -0500 Subject: [PATCH] Add lighthouse p2p Good Bye codes (#7601) Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/sync/rpc_goodbye.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/beacon-chain/sync/rpc_goodbye.go b/beacon-chain/sync/rpc_goodbye.go index 85366db46..d911c0a09 100644 --- a/beacon-chain/sync/rpc_goodbye.go +++ b/beacon-chain/sync/rpc_goodbye.go @@ -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.