From f4e1f71b7a1e355ec02582dfc5d9105d571baabc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 15:02:44 +0000 Subject: [PATCH] Fix peer crawler port field type inconsistency - 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> --- API-CHANGELOG.md | 4 ++++ include/xrpl/protocol/jss.h | 3 +++ src/xrpld/overlay/detail/OverlayImpl.cpp | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/API-CHANGELOG.md b/API-CHANGELOG.md index c7a31d27fa..8d44583907 100644 --- a/API-CHANGELOG.md +++ b/API-CHANGELOG.md @@ -30,6 +30,10 @@ This version is supported by all `rippled` versions. For WebSocket and HTTP JSON - `vault_info`: New RPC method to retrieve information about a specific vault (part of XLS-66 Lending Protocol). ([#6156](https://github.com/XRPLF/rippled/pull/6156)) +### 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. + ## XRP Ledger server version 3.0.0 [Version 3.0.0](https://github.com/XRPLF/rippled/releases/tag/3.0.0) was released on Dec 9, 2025. diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index d86ca9bf1f..a0e7498814 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -112,6 +112,7 @@ JSS(accounts); // in: LedgerEntry, Subscribe, // handlers/Ledger, Unsubscribe JSS(accounts_proposed); // in: Subscribe, Unsubscribe JSS(action); +JSS(active); // out: OverlayImpl JSS(acquiring); // out: LedgerRequest JSS(address); // out: PeerImp JSS(affected); // out: AcceptedLedgerTx @@ -299,6 +300,7 @@ JSS(id); // websocket. JSS(ident); // in: AccountCurrencies, AccountInfo, // OwnerInfo JSS(ignore_default); // in: AccountLines +JSS(in); // out: OverlayImpl JSS(inLedger); // out: tx/Transaction JSS(inbound); // out: PeerImp JSS(index); // in: LedgerEntry @@ -460,6 +462,7 @@ JSS(open_ledger_fee); // out: TxQ JSS(open_ledger_level); // out: TxQ JSS(oracles); // in: get_aggregate_price JSS(oracle_document_id); // in: get_aggregate_price +JSS(out); // out: OverlayImpl JSS(owner); // in: LedgerEntry, out: NetworkOPs JSS(owner_funds); // in/out: Ledger, NetworkOPs, AcceptedLedgerTx JSS(page_index); diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 350631b8e6..6f6d892a4c 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -630,12 +630,12 @@ OverlayImpl::getOverlayInfo() { using namespace std::chrono; Json::Value jv; - auto& av = jv["active"] = Json::Value(Json::arrayValue); + auto& av = jv[jss::active] = Json::Value(Json::arrayValue); for_each([&](std::shared_ptr&& sp) { auto& pv = av.append(Json::Value(Json::objectValue)); pv[jss::public_key] = base64_encode(sp->getNodePublic().data(), sp->getNodePublic().size()); - pv[jss::type] = sp->slot()->inbound() ? "in" : "out"; + pv[jss::type] = sp->slot()->inbound() ? jss::in : jss::out; pv[jss::uptime] = static_cast(duration_cast(sp->uptime()).count()); if (sp->crawl()) { @@ -647,7 +647,7 @@ OverlayImpl::getOverlayInfo() } else { - pv[jss::port] = std::to_string(sp->getRemoteAddress().port()); + pv[jss::port] = sp->getRemoteAddress().port(); } }