Deactivate RPC Connection Handler after goodbye message is sent (#5250)

* Deactivate RPC Connection Handler

after goodbye message is sent

* nit: use to_string instead of format

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into rpc-shutdown-improvement

* clippy

* Fix cargo.lock

* Merge latest unstable
This commit is contained in:
João Oliveira
2024-02-19 07:16:01 +00:00
committed by GitHub
parent 4d625951b8
commit a229b52723
3 changed files with 216 additions and 211 deletions

View File

@@ -223,7 +223,7 @@ where
fn handle_established_inbound_connection(
&mut self,
_connection_id: ConnectionId,
connection_id: ConnectionId,
peer_id: PeerId,
_local_addr: &libp2p::Multiaddr,
_remote_addr: &libp2p::Multiaddr,
@@ -238,9 +238,9 @@ where
},
(),
);
// NOTE: this is needed because PeerIds have interior mutability.
let peer_repr = peer_id.to_string();
let log = self.log.new(slog::o!("peer_id" => peer_repr));
let log = self
.log
.new(slog::o!("peer_id" => peer_id.to_string(), "connection_id" => connection_id.to_string()));
let handler = RPCHandler::new(
protocol,
self.fork_context.clone(),
@@ -253,7 +253,7 @@ where
fn handle_established_outbound_connection(
&mut self,
_connection_id: ConnectionId,
connection_id: ConnectionId,
peer_id: PeerId,
_addr: &libp2p::Multiaddr,
_role_override: libp2p::core::Endpoint,
@@ -269,9 +269,10 @@ where
(),
);
// NOTE: this is needed because PeerIds have interior mutability.
let peer_repr = peer_id.to_string();
let log = self.log.new(slog::o!("peer_id" => peer_repr));
let log = self
.log
.new(slog::o!("peer_id" => peer_id.to_string(), "connection_id" => connection_id.to_string()));
let handler = RPCHandler::new(
protocol,
self.fork_context.clone(),