-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix peer crawler port field type inconsistency #6318
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: develop
Are you sure you want to change the base?
Conversation
|
@copilot please add tests (or modify tests if they already exist) |
|
@copilot tests appear to be failing, please fix |
... Fixed in commit f089cff:
|
|
@copilot actually, just pull out the tests - they seem to be more of a headache than they're worth for such a small change. We can test manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes a type inconsistency in the Peer Crawler /crawl overlay response by ensuring overlay.active[].port is always emitted as a JSON integer (previously a string for outbound peers).
Changes:
- Update
/crawloverlay serialization so outbound peers’portis emitted as a number (consistent with inbound). - Replace inline
"active","in", and"out"literals withjssconstants. - Document the behavior change in
API-CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/xrpld/overlay/detail/OverlayImpl.cpp | Emits outbound port as an integer and uses jss::active / jss::in / jss::out. |
| include/xrpl/protocol/jss.h | Adds jss::active, jss::in, and jss::out tokens. |
| API-CHANGELOG.md | Notes the Peer Crawler port type consistency change under 3.1.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
API-CHANGELOG.md
Outdated
| ### Bugfixes in 3.1.0 | ||
|
|
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog sectioning is inconsistent: this file uses headings like "Additions in X.Y.Z" or "Additions and bugfixes in X.Y.Z" elsewhere, but "### Bugfixes in 3.1.0" appears to be the only standalone bugfix heading. Consider merging this entry into the existing 3.1.0 heading (e.g., rename to "Additions and bugfixes in 3.1.0" or include the bullet under an existing heading) to keep the document structure consistent.
API-CHANGELOG.md
Outdated
|
|
||
| ### Bugfixes in 3.1.0 | ||
|
|
||
| - Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new changelog bullet doesn’t include a PR reference, while most other entries include a link like "(#NNNN)". Please add the relevant PR number/link for traceability.
| - Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. | |
| - Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. ([#6156](https://github.com/XRPLF/rippled/pull/6156)) |
- Change outbound peer port from string to integer in getOverlayInfo() - Add "active", "in", "out" JSS constants to jss.h - Update API-CHANGELOG.md with bugfix note Co-authored-by: mvadari <8029314+mvadari@users.noreply.github.com>
28a1796 to
42f6b94
Compare
42f6b94 to
aea548b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6318 +/- ##
=======================================
Coverage 79.9% 79.9%
=======================================
Files 840 840
Lines 65483 65483
Branches 7255 7252 -3
=======================================
+ Hits 52311 52315 +4
+ Misses 13172 13168 -4
🚀 New features to boost your workflow:
|
High Level Overview of Change
The Peer Crawler API returns
portas a string for outbound peers but as an integer for inbound peers. This fixes the inconsistency by makingportalways return as an integer.Context of Change
Bug introduced in the original peer crawler implementation (PR #1017, RIPD-866). Outbound peers used
std::to_string()on the port while inbound peers assigned the numeric value directly.Also moves inline string literals
"active","in","out"tojss.hper repo conventions.Type of Change
API Impact
Note: This affects the special peer-port API, not the standard RPC API, so API versioning does not apply.
Before / After
Before: Outbound peers return port as string
{"active": [{"type": "out", "port": "51235", ...}]}After: All peers return port as integer
{"active": [{"type": "out", "port": 51235, ...}]}Test Plan
Manual testing is recommended for this change. Call the peer crawler on a server that has both incoming and outgoing peers and verify:
portfield is returned as an integer for both inbound and outbound peerstypefield uses the expected "in"/"out" valuesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.