Skip to content

feat: add network_peerReputations and network_peerReputation RPC endpoints#649

Merged
gilescope merged 6 commits into
mainfrom
ozgb-peer-reputation-rpc
Feb 12, 2026
Merged

feat: add network_peerReputations and network_peerReputation RPC endpoints#649
gilescope merged 6 commits into
mainfrom
ozgb-peer-reputation-rpc

Conversation

@ozgb

@ozgb ozgb commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds two new JSON-RPC endpoints for inspecting peer reputation and ban status:

  • network_peerReputations — returns all connected peers enriched with their reputation score and whether they're banned
  • network_peerReputation("12D3KooW...") — same info for a single peer by ID

Currently there's no RPC visibility into why peers disconnect or get banned. This PR surfaces the internal NetworkPeers::peer_reputation() API that already exists but isn't exposed.

# Query all peers
curl -s -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"network_peerReputations","params":[],"id":1}' \
  http://localhost:9944

# Query a single peer
curl -s -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"network_peerReputation","params":["12D3KooW..."],"id":1}' \
  http://localhost:9944

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

  • Related: PM-21710 — this endpoint helps diagnose this and similar peer connectivity issues

…oints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.
@ozgb ozgb requested a review from a team as a code owner February 11, 2026 15:34
@github-actions

github-actions Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.16

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 96
LOW LOW 12
INFO INFO 83
TRACE TRACE 0
TOTAL TOTAL 191
Metric Values
Files scanned placeholder 31
Files parsed placeholder 31
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 8

@gilescope gilescope enabled auto-merge February 12, 2026 18:28
@gilescope gilescope added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit e010a51 Feb 12, 2026
38 checks passed
@gilescope gilescope deleted the ozgb-peer-reputation-rpc branch February 12, 2026 20:58
ozgb added a commit that referenced this pull request Feb 16, 2026
…oints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
…oints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
…oints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
…oints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
* chore: update indexer commit to fix sbom checks

* feat: add network_peerReputations and network_peerReputation RPC endpoints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>

* feat: add unsafe RPC to unban peers (#666)

* feat: add unsafe RPC to unban peers

Useful for node operators to use when a peer is banned but has since corrected it’s behaviour.

Without this RPC, the only way to reset peer reputation is to restart the node (reputation exists in memory only).

* docs: add pr link to change file

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
* chore: update indexer commit to fix sbom checks

* feat: add network_peerReputations and network_peerReputation RPC endpoints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>

* feat: add unsafe RPC to unban peers (#666)

* feat: add unsafe RPC to unban peers

Useful for node operators to use when a peer is banned but has since corrected it’s behaviour.

Without this RPC, the only way to reset peer reputation is to restart the node (reputation exists in memory only).

* docs: add pr link to change file

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>
ozgb added a commit that referenced this pull request Feb 18, 2026
* chore: update indexer commit to fix sbom checks

* feat: add network_peerReputations and network_peerReputation RPC endpoints (#649)

* feat: add network_peerReputations and network_peerReputation RPC endpoints

Expose peer reputation and ban status via JSON-RPC to enable debugging
peer connectivity issues without custom tooling.

* docs: update change file

* chore: cargo fmt

---------

Co-authored-by: Squirrel <giles.cope@shielded.io>

* feat: add unsafe RPC to unban peers (#666)

* feat: add unsafe RPC to unban peers

Useful for node operators to use when a peer is banned but has since corrected it’s behaviour.

Without this RPC, the only way to reset peer reputation is to restart the node (reputation exists in memory only).

* docs: add pr link to change file

* fix: remove non-determinism (#679)

* fix: keep existing preview ordering

Signed-off-by: Giles Cope <gilescope@gmail.com>

* preview has other tx with different orderings.

Just this change would not be enough to get to head.

* fix npm audit finding

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>

* fix: sync non-deterministically while historical chain patch is pending (#685)

* fix: sync non-deterministically while historical chain patch is pending

* docs: add pr link to change file

* docs: add ticket link to change file

* chore: cargo fmt

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Squirrel <giles.cope@shielded.io>
Co-authored-by: Justin Frevert <justinfrevert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants