Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Oct 18, 2024
1 parent ad38769 commit 902cebd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var KnownErrors = map[string]string{
"RESOURCE_LIMIT_EXCEEDED (201)": models.NetErrorCantConnectOverRelay, // transient error
"NO_RESERVATION (204)": models.NetErrorCantConnectOverRelay, // permanent error
// devp2p errors
"no good ip address": models.NetErrorNoIPAddress,
"disconnect requested": models.NetErrorDevp2pDisconnectRequested,
"network error": models.NetErrorDevp2pNetworkError,
"breach of protocol": models.NetErrorDevp2pBreachOfProtocol,
Expand All @@ -53,7 +54,8 @@ var KnownErrors = map[string]string{
"read timeout": models.NetErrorDevp2pReadTimeout,
"subprotocol error": models.NetErrorDevp2pSubprotocolError,
"could not negotiate eth protocol": models.NetErrorDevp2pEthprotocolError,
"handshake failed: EOF": models.NetErrorDevp2pHandshakeEOF, // dependent on error string in discv4
"handshake failed: EOF": models.NetErrorDevp2pHandshakeEOF, // dependent on error string in discv4
"malformed disconnect message": models.NetErrorDevp2pMalformedDisconnectMessage, // dependent on error string in discv4
}

var ErrorStr = map[string]string{}
Expand Down Expand Up @@ -95,12 +97,14 @@ var knownErrorsPrecedence = []string{
"Write on stream",
"RESOURCE_LIMIT_EXCEEDED (201)",
"NO_RESERVATION (204)",
"too many peers",
"no good ip address",
"malformed disconnect message",
"handshake did not complete in time",
"disconnect requested",
"network error",
"breach of protocol",
"useless peer",
"too many peers",
"already connected",
"incompatible p2p protocol version",
"invalid node identity",
Expand Down
1 change: 1 addition & 0 deletions db/migrations/000028_add_net_errors.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ ALTER TYPE net_error ADD VALUE 'devp2p_connected_to_self';
ALTER TYPE net_error ADD VALUE 'devp2p_read_timeout';
ALTER TYPE net_error ADD VALUE 'devp2p_subprotocol_error';
ALTER TYPE net_error ADD VALUE 'devp2p_ethprotocol_error';
ALTER TYPE net_error ADD VALUE 'devp2p_malformed_disconnect_message';

COMMIT
2 changes: 2 additions & 0 deletions db/models/boil_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 902cebd

Please sign in to comment.