Repository navigation
fix: Use underscore in getobject_Fetch_Pack_get category name - #8720
Open
FawwazLawal wants to merge 3 commits into
Open
FawwazLawal wants to merge 3 commits into
FawwazLawal wants to merge 3 commits into
Conversation
TrafficCount::toString mapped Category::GetFetchPack to "getobject_Fetch Pack_get", with a space, while its pair Category::ShareFetchPack maps to "getobject_Fetch_Pack_share".
Contributor
There was a problem hiding this comment.
🟡 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_gettogetobject_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
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.
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

High Level Overview of Change
In
TrafficCount::toString(src/xrpld/overlay/detail/TrafficCount.h),Category::GetFetchPacknow maps to"getobject_Fetch_Pack_get"instead of"getobject_Fetch Pack_get", matchingCategory::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 toCategory::ShareFetchPackandCategory::GetFetchPack, and the pair now sits at lines 306-307 ofkCategoryMap. It is the same entry.This name is what
OverlayImpl::onWritereports ascategoryin thetrafficsection, and it is also the prefix of that category's insight gauges (TrafficGaugesinOverlayImpl.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
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Test Plan
Built
xrpld(Release, clang, theciConan profile) in the CI imageghcr.io/xrplf/xrpld/nix-ubuntu:sha-d3a71b2(arm64) and ran the overlay suites, which includexrpl.overlay.traffic_count:A new assertion in
traffic_count_test.cpp'stestToStringpins the mapping forCategory::GetFetchPack.python3 .github/scripts/levelization/generate.pyleaves.github/scripts/levelization/results/unchanged, and clang-format passes onTrafficCount.h(pre-commit run --files src/xrpld/overlay/detail/TrafficCount.hin thepre-commit:sha-d3a71b2image).Not run locally: the gcc build, the sanitizer builds and the full unit test suite.