diff --git a/types/p2p.yaml b/types/p2p.yaml index 62fe0e50..9ad13f78 100644 --- a/types/p2p.yaml +++ b/types/p2p.yaml @@ -57,6 +57,33 @@ Peer: $ref: "./p2p.yaml#/PeerConnectionState" direction: $ref: "./p2p.yaml#/PeerConnectionDirection" + agent_version: + type: string + description: | + The peer's libp2p agent version string (from the libp2p identify + protocol). OPTIONAL; clients MAY omit if not yet observed. + example: "Lighthouse/v8.1.3-66919c2/aarch64-linux" + score: + type: number + format: double + description: | + Client-native peer score. OPTIONAL. + This number is not consistent between clients, + but can be compared to other peers on the same client. + example: -17.4828 + disconnect_reason: + description: | + Reason the client last disconnected from this peer. OPTIONAL. + This field MUST only be set if the connection status is disconnected or disconnecting. + $ref: "./p2p.yaml#/PeerDisconnectReason" + downscore_reasons: + type: array + description: | + Reasons that the client has been down scored in their current session. OPTIONAL. + SHOULD be a distinct set of downscare reasons. + items: + $ref: "./p2p.yaml#/PeerScoreReason" + example: ["rpc_bad_blocks_by_range", "rpc_rate_limited"] PeerConnectionState: type: string @@ -80,3 +107,43 @@ Multiaddr: type: string description: "[Read more](https://docs.libp2p.io/reference/glossary/#multiaddr)" example: "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N" + +PeerScoreReason: + type: string + description: | + Limited set of peer downscore reasons that may be returned. + Implementations populating `Peer.downscore_reasons` MUST + emit values from this list. Consumers SHOULD tolerate unknown + values for forward compatibility. + example: + - rpc_invalid_request + - rpc_invalid_response + - rpc_rate_limited + - rpc_timeout + - rpc_io_error + - rpc_bad_blocks_by_range + - rpc_bad_blocks_by_root + - gossip_invalid_block + - gossip_invalid_attestation + - gossip_invalid_blob_sidecar + - gossip_invalid_data_column_sidecar + - sync_bad_batch + - status_unviable_fork + - behaviour_penalty + - unknown + +PeerDisconnectReason: + type: string + description: | + Implementations populating `Peer.disconnect_reason` MUST emit + values from this list. Consumers SHOULD tolerate unknown values for + forward compatibility. + example: + - bad_score + - irrelevant_network + - unviable_fork + - too_many_peers + - rate_limited + - io_error + - client_shutdown + - unknown