Skip to content

Commit bcdec2d

Browse files
fix(network): stop demoting healthy peers on simultaneous-dial dedup
`deregister_stream` recorded `node_db.note_failure` for every expired session it removed, but the simultaneous-dial dedup kill passes `op = None` (since #3436 / 4ab4a79) precisely to avoid recording a failure — so the dropped redundant connection demoted the healthy peer anyway. The same blanket call also dragged a peer back down after it had already reconnected. Remove the blanket `note_failure` from `deregister_stream`. Peer reputation on disconnect is already recorded by the kill path via its `UpdateNodeOperation` (note_failure / demote / set_blacklisted for remote failures), and `set_expired` is only ever set by the two kill functions, so no genuine failure recording is lost. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2dfb5f9 commit bcdec2d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

crates/network/src/service.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,12 +1814,8 @@ impl IoHandler<NetworkIoMessage> for NetworkServiceInner {
18141814
if sess.expired() {
18151815
sess.deregister_socket(poll_registry)
18161816
.expect("Error deregistering socket");
1817-
if let Some(node_id) = sess.id() {
1818-
self.node_db.write().note_failure(
1819-
node_id, true, /* by_connection */
1820-
false, /* trusted_only */
1821-
);
1822-
}
1817+
// Reputation on disconnect is recorded by the kill
1818+
// path (its `UpdateNodeOperation`), not here.
18231819
self.sessions.remove(&sess);
18241820
debug!("Removed session: {:?}", *sess);
18251821
}

0 commit comments

Comments
 (0)