Admin add/remove peer (#7198)

N/A


  Adds endpoints to add and remove trusted peers from the http api. The added peers are trusted peers so they won't be disconnected for bad scores. We try to maintain a connection to the peer in case they disconnect from us by trying to dial it every heartbeat.
This commit is contained in:
Pawan Dhananjay
2025-03-28 05:59:09 -07:00
committed by GitHub
parent a5ea05ce2a
commit 54aef2d043
10 changed files with 217 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ use PeerConnectionStatus::*;
#[serde(bound = "E: EthSpec")]
pub struct PeerInfo<E: EthSpec> {
/// The peers reputation
score: Score,
pub(crate) score: Score,
/// Client managing this peer
client: Client,
/// Connection status of this peer
@@ -50,7 +50,7 @@ pub struct PeerInfo<E: EthSpec> {
#[serde(skip)]
min_ttl: Option<Instant>,
/// Is the peer a trusted peer.
is_trusted: bool,
pub(crate) is_trusted: bool,
/// Direction of the first connection of the last (or current) connected session with this peer.
/// None if this peer was never connected.
connection_direction: Option<ConnectionDirection>,