Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

chore(rpc): Disconnect Peer RPC Request#1964

Merged
refcell merged 1 commit intomainfrom
rf/disconnect-peer-rpc-req
Jun 3, 2025
Merged

chore(rpc): Disconnect Peer RPC Request#1964
refcell merged 1 commit intomainfrom
rf/disconnect-peer-rpc-req

Conversation

@refcell
Copy link
Copy Markdown
Contributor

@refcell refcell commented Jun 3, 2025

Description

Implements the opp2p_disconnectPeer rpc request.

Closes #1576

Copilot AI review requested due to automatic review settings June 3, 2025 13:57
@refcell refcell added the A-rpc Area: rpc label Jun 3, 2025
@refcell refcell added the A-rpc Area: rpc label Jun 3, 2025
@refcell refcell self-assigned this Jun 3, 2025
@refcell
Copy link
Copy Markdown
Contributor Author

refcell commented Jun 3, 2025

📚 $\text{Stack Overview}$

Pulls submitted in this stack:

This comment was automatically generated by st.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the new RPC method opp2p_disconnectPeer to allow disconnecting a specified peer via an RPC request.

  • Introduces a new RPC method in the p2p module.
  • Adds the corresponding RPC request variant and handling logic in both the rpc and p2p modules.
  • Updates library configuration to include tracing support.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/node/rpc/src/p2p.rs Replaces the unused parameter with a parsed peer_id and sends a disconnect request.
crates/node/rpc/src/lib.rs Adds tracing macros to support the new logging requirements.
crates/node/rpc/Cargo.toml Enables workspace-wide tracing for improved log management.
crates/node/p2p/src/rpc/request.rs Introduces a new DisconnectPeer RPC variant and implements its handling.
crates/node/p2p/src/net/driver.rs Updates the RPC handler call to pass a mutable reference to GossipDriver.
Comments suppressed due to low confidence (1)

crates/node/rpc/src/p2p.rs:153

  • [nitpick] The variable 'peer_id' is shadowing the function parameter. Consider renaming the shadowed variable to 'parsed_peer_id' for improved clarity.
let peer_id = match peer_id.parse() {

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 83.6%. Comparing base (55b109b) to head (d3311bd).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/node/rpc/src/p2p.rs 0.0% 10 Missing ⚠️
crates/node/p2p/src/rpc/request.rs 0.0% 7 Missing ⚠️
crates/node/p2p/src/net/driver.rs 0.0% 1 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@clabby clabby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Another forceful disconnection point that #1926 will need to consider

@refcell refcell added this pull request to the merge queue Jun 3, 2025
Merged via the queue into main with commit 37f53b8 Jun 3, 2025
22 of 23 checks passed
@refcell refcell deleted the rf/disconnect-peer-rpc-req branch June 3, 2025 14:32
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
### Description

Implements the `opp2p_disconnectPeer` rpc request.

Closes op-rs/kona#1576
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
### Description

Implements the `opp2p_disconnectPeer` rpc request.

Closes #1576
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-rpc Area: rpc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(node/p2p): opp2p_disconnectPeer RPC Method Support

3 participants