Skip to content

fix: Use underscore in getobject_Fetch_Pack_get category name - #8720

Open
FawwazLawal wants to merge 3 commits into
XRPLF:developfrom
FawwazLawal:fetch-pack-category-name
Open

FawwazLawal wants to merge 3 commits into
XRPLF:developfrom
FawwazLawal:fetch-pack-category-name

Conversation

@FawwazLawal

@FawwazLawal FawwazLawal commented Nov 12, 2026 •

Copy link
Copy Markdown

High Level Overview of Change

In TrafficCount::toString (src/xrpld/overlay/detail/TrafficCount.h), Category::GetFetchPack now maps to "getobject_Fetch_Pack_get" instead of "getobject_Fetch Pack_get", matching Category::ShareFetchPack's "getobject_Fetch_Pack_share".

Fixes #7477.

Context of Change

The issue points at lines 296-297 and the enum names share_fetch_pack / get_fetch_pack. Those enumerators have since been renamed to Category::ShareFetchPack and Category::GetFetchPack, and the pair now sits at lines 306-307 of kCategoryMap. It is the same entry.

This name is what OverlayImpl::onWrite reports as category in the traffic section, and it is also the prefix of that category's insight gauges (TrafficGauges in OverlayImpl.h), so tools that split category names on underscores misread this one entry, as the issue describes. Anything that matches the old string exactly will need the new spelling once this lands.

The other mentions of "Fetch Pack" in the tree (LedgerMaster.h:665, src/xrpld/app/ledger/README.md:171) are a comment and a heading.

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Test Plan

Built xrpld (Release, clang, the ci Conan profile) in the CI image ghcr.io/xrplf/xrpld/nix-ubuntu:sha-d3a71b2 (arm64) and ran the overlay suites, which include xrpl.overlay.traffic_count:

./xrpld --unittest=xrpl.overlay --unittest-jobs=9
3.3s, 14 suites, 71 cases, 2657 tests total, 0 failures

A new assertion in traffic_count_test.cpp's testToString pins the mapping for Category::GetFetchPack.

python3 .github/scripts/levelization/generate.py leaves .github/scripts/levelization/results/ unchanged, and clang-format passes on TrafficCount.h (pre-commit run --files src/xrpld/overlay/detail/TrafficCount.h in the pre-commit:sha-d3a71b2 image).

Not run locally: the gcc build, the sanitizer builds and the full unit test suite.

TrafficCount::toString mapped Category::GetFetchPack to
"getobject_Fetch Pack_get", with a space, while its pair
Category::ShareFetchPack maps to "getobject_Fetch_Pack_share".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The rename still needs regression coverage and an Unreleased API changelog entry because it changes RPC-visible traffic and monitoring names.

2 open issues
What changed in this PR

Fixes #7477 by making the fetch-pack request category consistent with underscore-delimited names used in overlay monitoring.

Changes:

  • Renames getobject_Fetch Pack_get to getobject_Fetch_Pack_get, matching the share category.
  • Updates the emitted traffic category and associated metric prefixes; consumers matching the old name must adjust.
File Description
src/​xrpld/​overlay/​detail/​TrafficCount.h Replaces the space with an underscore in the GetFetchPack category string.

Review effort: Balanced

Comment thread src/xrpld/overlay/detail/TrafficCount.h Resolved
Comment thread src/xrpld/overlay/detail/TrafficCount.h Resolved
Add a BEAST_EXPECT in traffic_count_test.cpp's testToString that
pins TrafficCount::toString(Category::GetFetchPack) to
"getobject_Fetch_Pack_get", the name set in 3f116cf, which matches
the paired ShareFetchPack mapping "getobject_Fetch_Pack_share".

Record the rename in API-CHANGELOG.md with a new ## Unreleased
section above 3.6.0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The changelog incorrectly describes aggregate peers.traffic counts as per-peer data, which could mislead monitoring clients about the response structure.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread API-CHANGELOG.md Resolved
The entry for GetFetchPack said the category appears "in each peer's
traffic section". OverlayImpl::onWrite writes one traffic set from
traffic_.getCounts() under peers (the overlay's PropertyStream::Source
name), so there is no per-peer traffic section; the counts live at
peers.traffic. Reword the bullet to name that aggregate section.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
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.

Inconsistent naming: space in 'Fetch Pack' category string breaks monitoring parsers

2 participants