-
Notifications
You must be signed in to change notification settings - Fork 169
[p2p] Distinguish Rejection Reason #2686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | a2d2d46 | Jan 04 2026, 08:33 PM |
e42c969 to
ab9e1e8
Compare
Deploying monorepo with
|
| Latest commit: |
a2d2d46
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://10e0a6d5.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://patrick-improve-logging-metr.monorepo-eu0.pages.dev |
Add an `Attempt` enum to provide specific rejection reasons when refusing incoming connections. Previously, both lookup and discovery listeners used generic metrics/logging that didn't distinguish between different rejection causes, making debugging difficult. The `Attempt` enum has variants for: Ok, Blocked, Unregistered, Reserved (already connected), Mismatch (e.g., IP doesn't match), and Myself (trying to connect to ourselves). Changes: - Add shared `Attempt` enum in `authenticated/mod.rs` - Update record `acceptable()` methods to return `Attempt` - Update directory `acceptable()` to check blocked status and increment specific metrics (rejected_blocked, rejected_unregistered, rejected_reserved, rejected_mismatch, rejected_myself) - Update listeners to convert `Attempt` to bool for stream crate - Add `ListenableIps` struct with `allowed` and `blocked` sets to enable proper IP-level metrics in lookup listener - Add `handshakes_ip_blocked` metric for blocked peer IPs (pre-handshake) - Add `handshakes_ip_unregistered` metric for unregistered IPs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
ab9e1e8 to
a2d2d46
Compare
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #2686 +/- ##
========================================
Coverage 92.77% 92.78%
========================================
Files 362 362
Lines 106074 106203 +129
========================================
+ Hits 98412 98537 +125
- Misses 7662 7666 +4
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Related: #2570