Skip to content

refactor: Reorganize RPC handler files#6628

Merged
bthomee merged 7 commits intoXRPLF:developfrom
mvadari:divide-rpcs
Apr 3, 2026
Merged

refactor: Reorganize RPC handler files#6628
bthomee merged 7 commits intoXRPLF:developfrom
mvadari:divide-rpcs

Conversation

@mvadari
Copy link
Copy Markdown
Collaborator

@mvadari mvadari commented Mar 24, 2026

High Level Overview of Change

This PR:

There is no functionality or source code change, only moving code around and renaming files/headers.

Context of Change

Making the repo easier to manage/traverse

API Impact

N/A

@mvadari mvadari requested a review from Tapanito March 24, 2026 04:55
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 75.17241% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.4%. Comparing base (6b55c4c) to head (f1b9841).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...ld/rpc/handlers/admin/peer/PeerReservationsDel.cpp 0.0% 15 Missing ⚠️
...d/rpc/handlers/admin/peer/PeerReservationsList.cpp 0.0% 7 Missing ⚠️
src/xrpld/rpc/handlers/ChannelVerify.cpp 83.9% 5 Missing ⚠️
src/xrpld/rpc/handlers/account/AccountNFTs.cpp 93.0% 5 Missing ⚠️
src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp 71.4% 2 Missing ⚠️
src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp 71.4% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6628     +/-   ##
=========================================
- Coverage     81.4%   81.4%   -0.0%     
=========================================
  Files          999    1006      +7     
  Lines        74440   74440             
  Branches      7560    7560             
=========================================
- Hits         60625   60613     -12     
- Misses       13815   13827     +12     
Files with missing lines Coverage Δ
src/xrpld/overlay/detail/OverlayImpl.cpp 32.8% <ø> (ø)
src/xrpld/rpc/detail/Handler.cpp 88.1% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountChannels.cpp 81.4% <ø> (ø)
...c/xrpld/rpc/handlers/account/AccountCurrencies.cpp 97.5% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountInfo.cpp 85.4% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountLines.cpp 91.2% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountObjects.cpp 95.6% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountOffers.cpp 89.5% <ø> (ø)
src/xrpld/rpc/handlers/account/AccountTx.cpp 86.5% <100.0%> (ø)
src/xrpld/rpc/handlers/account/GatewayBalances.cpp 89.4% <ø> (ø)
... and 66 more

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tapanito
Copy link
Copy Markdown
Collaborator

/ai-review

Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

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

Ship it

Review by Claude Opus 4.6 · Prompt: V12

@Tapanito
Copy link
Copy Markdown
Collaborator

Nice, clean reorganisation. LGTM.

@mvadari mvadari added the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label Mar 25, 2026
@github-actions
Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

Copilot AI review requested due to automatic review settings April 2, 2026 22:39
@mvadari mvadari added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reorganizes the JSON-RPC handler implementation files into a clearer folder structure (by RPC category) and splits several handlers so each RPC has its own dedicated .cpp file, improving discoverability and navigation.

Changes:

  • Moved/split RPC handlers into category subfolders (e.g., account/, ledger/, orderbook/, server_info/, transaction/, utility/, admin/...).
  • Extracted shared helper logic into dedicated headers (e.g., NFTOffersHelpers.h, LedgerEntryHelpers.h, GetCounts.h) and adjusted include paths accordingly.
  • Renamed the internal handler function for account_tx from doAccountTxJson to doAccountTx and updated handler registration.

Reviewed changes

Copilot reviewed 21 out of 82 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/xrpld/rpc/handlers/utility/Random.cpp New standalone handler file for random.
src/xrpld/rpc/handlers/utility/Ping.cpp New standalone handler file for ping.
src/xrpld/rpc/handlers/transaction/TxReduceRelay.cpp New standalone handler file for tx_reduce_relay.
src/xrpld/rpc/handlers/transaction/TxHistory.cpp New standalone handler file for tx_history.
src/xrpld/rpc/handlers/transaction/Tx.cpp New standalone handler file for tx.
src/xrpld/rpc/handlers/transaction/TransactionEntry.cpp New standalone handler file for transaction_entry.
src/xrpld/rpc/handlers/transaction/SubmitMultiSigned.cpp New standalone handler file for submit_multisigned.
src/xrpld/rpc/handlers/transaction/Submit.cpp New standalone handler file for submit.
src/xrpld/rpc/handlers/transaction/Simulate.cpp New standalone handler file for simulate.
src/xrpld/rpc/handlers/subscribe/Unsubscribe.cpp Moved/split unsubscribe into its own file under subscribe/.
src/xrpld/rpc/handlers/subscribe/Subscribe.cpp Moved/split subscribe into its own file under subscribe/.
src/xrpld/rpc/handlers/server_info/Version.h Moved version handler into server_info/ as a class-based handler.
src/xrpld/rpc/handlers/server_info/ServerState.cpp New standalone handler file for server_state.
src/xrpld/rpc/handlers/server_info/ServerInfo.cpp New standalone handler file for server_info.
src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp New standalone handler file for server_definitions.
src/xrpld/rpc/handlers/server_info/Manifest.cpp New standalone handler file for manifest.
src/xrpld/rpc/handlers/server_info/Fee.cpp New standalone handler file for fee.
src/xrpld/rpc/handlers/server_info/Feature.cpp New standalone handler file for feature.
src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp Moved ripple_path_find under orderbook/.
src/xrpld/rpc/handlers/orderbook/PathFind.cpp Moved path_find under orderbook/.
src/xrpld/rpc/handlers/orderbook/NFTSellOffers.cpp Split nft_sell_offers into its own .cpp.
src/xrpld/rpc/handlers/orderbook/NFTOffersHelpers.h Extracted shared NFT offer enumeration helpers into a header.
src/xrpld/rpc/handlers/orderbook/NFTBuyOffers.cpp Split nft_buy_offers into its own .cpp.
src/xrpld/rpc/handlers/orderbook/GetAggregatePrice.cpp Moved get_aggregate_price under orderbook/.
src/xrpld/rpc/handlers/orderbook/DepositAuthorized.cpp Moved deposit_authorized under orderbook/.
src/xrpld/rpc/handlers/orderbook/BookOffers.cpp Removed embedded book_changes handler implementation.
src/xrpld/rpc/handlers/orderbook/BookChanges.cpp New standalone handler file for book_changes.
src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp Moved amm_info under orderbook/.
src/xrpld/rpc/handlers/ledger/LedgerHeader.cpp New standalone handler file for ledger_header.
src/xrpld/rpc/handlers/ledger/LedgerEntryHelpers.h Introduced helper header for ledger_entry parsing/validation.
src/xrpld/rpc/handlers/ledger/LedgerEntry.cpp Updated include path for moved LedgerEntryHelpers.h.
src/xrpld/rpc/handlers/ledger/LedgerDiff.cpp New standalone gRPC handler file for ledger diff.
src/xrpld/rpc/handlers/ledger/LedgerData.cpp New standalone handler file for ledger_data (+ gRPC).
src/xrpld/rpc/handlers/ledger/LedgerCurrent.cpp New standalone handler file for ledger_current.
src/xrpld/rpc/handlers/ledger/LedgerClosed.cpp New standalone handler file for ledger_closed.
src/xrpld/rpc/handlers/ledger/Ledger.h Moved/renamed ledger class-based handler header into ledger/.
src/xrpld/rpc/handlers/ledger/Ledger.cpp Updated include to new ledger/Ledger.h location.
src/xrpld/rpc/handlers/Handlers.h Updated handler declarations / includes (incl. ledger/Ledger.h, doAccountTx).
src/xrpld/rpc/handlers/ChannelVerify.cpp Split channel_verify into its own handler file.
src/xrpld/rpc/handlers/admin/UnlList.cpp Moved unl_list under admin/.
src/xrpld/rpc/handlers/admin/status/Validators.cpp Moved validators under admin/status/.
src/xrpld/rpc/handlers/admin/status/ValidatorListSites.cpp Moved validator_list_sites under admin/status/.
src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp Moved validator_info under admin/status/.
src/xrpld/rpc/handlers/admin/status/Print.cpp Moved print under admin/status/.
src/xrpld/rpc/handlers/admin/status/GetCounts.h New header for get_counts shared helper.
src/xrpld/rpc/handlers/admin/status/GetCounts.cpp Moved/split get_counts (and helper) into admin/status/.
src/xrpld/rpc/handlers/admin/status/FetchInfo.cpp Moved fetch_info under admin/status/.
src/xrpld/rpc/handlers/admin/status/ConsensusInfo.cpp Moved consensus_info under admin/status/.
src/xrpld/rpc/handlers/admin/signing/SignFor.cpp Moved sign_for under admin/signing/.
src/xrpld/rpc/handlers/admin/signing/Sign.cpp Moved sign under admin/signing/.
src/xrpld/rpc/handlers/admin/signing/ChannelAuthorize.cpp Removed embedded channel_verify implementation from this file.
src/xrpld/rpc/handlers/admin/server_control/Stop.cpp Moved stop under admin/server_control/.
src/xrpld/rpc/handlers/admin/server_control/LedgerAccept.cpp Moved ledger_accept under admin/server_control/.
src/xrpld/rpc/handlers/admin/peer/Peers.cpp Moved peers under admin/peer/.
src/xrpld/rpc/handlers/admin/peer/PeerReservationsList.cpp Split peer_reservations_list into its own file.
src/xrpld/rpc/handlers/admin/peer/PeerReservationsDel.cpp Split peer_reservations_del into its own file.
src/xrpld/rpc/handlers/admin/peer/PeerReservationsAdd.cpp Removed embedded peer_reservations_del/list implementations from this file.
src/xrpld/rpc/handlers/admin/peer/Connect.cpp Moved connect under admin/peer/.
src/xrpld/rpc/handlers/admin/log/LogRotate.cpp Moved logrotate under admin/log/.
src/xrpld/rpc/handlers/admin/log/LogLevel.cpp Moved log_level under admin/log/.
src/xrpld/rpc/handlers/admin/keygen/WalletPropose.h New header for keygen wallet_propose helper.
src/xrpld/rpc/handlers/admin/keygen/WalletPropose.cpp Updated include path for moved WalletPropose.h.
src/xrpld/rpc/handlers/admin/keygen/ValidationCreate.cpp Moved validation_create under admin/keygen/.
src/xrpld/rpc/handlers/admin/data/LedgerRequest.cpp Moved ledger_request under admin/data/.
src/xrpld/rpc/handlers/admin/data/LedgerCleaner.cpp Moved ledger_cleaner under admin/data/.
src/xrpld/rpc/handlers/admin/data/CanDelete.cpp Moved can_delete under admin/data/.
src/xrpld/rpc/handlers/admin/BlackList.cpp Moved blacklist under admin/.
src/xrpld/rpc/handlers/account/OwnerInfo.cpp Moved owner_info under account/.
src/xrpld/rpc/handlers/account/NoRippleCheck.cpp Moved noripple_check under account/.
src/xrpld/rpc/handlers/account/GatewayBalances.cpp Moved gateway_balances under account/.
src/xrpld/rpc/handlers/account/AccountTx.cpp Renamed internal handler function to doAccountTx.
src/xrpld/rpc/handlers/account/AccountOffers.cpp Moved account_offers under account/.
src/xrpld/rpc/handlers/account/AccountObjects.cpp Removed embedded account_nfts handler implementation.
src/xrpld/rpc/handlers/account/AccountNFTs.cpp New standalone handler file for account_nfts.
src/xrpld/rpc/handlers/account/AccountLines.cpp Moved account_lines under account/.
src/xrpld/rpc/handlers/account/AccountInfo.cpp Moved account_info under account/.
src/xrpld/rpc/handlers/account/AccountCurrencies.cpp Moved account_currencies under account/.
src/xrpld/rpc/handlers/account/AccountChannels.cpp Moved account_channels under account/.
src/xrpld/rpc/detail/Handler.cpp Updated includes and handler registration (account_tx -> doAccountTx, moved Version.h).
src/xrpld/overlay/detail/OverlayImpl.cpp Updated include path for GetCounts.h after refactor.
src/test/rpc/KeyGeneration_test.cpp Updated include path for moved WalletPropose.h.
.github/scripts/rename/copyright.sh Updated paths for moved handler files referenced by the script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bthomee bthomee added this pull request to the merge queue Apr 2, 2026
Merged via the queue into XRPLF:develop with commit 81555d5 Apr 3, 2026
36 of 37 checks passed
Kassaking7 pushed a commit to Kassaking7/rippled that referenced this pull request Apr 6, 2026
Kassaking7 pushed a commit to Kassaking7/rippled that referenced this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants