From 3d77e7ac8bbc2815f5ba9a0f1e205518ee15ded9 Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 8 Jan 2026 11:43:55 +0000 Subject: [PATCH 1/7] Move InfoSub out of rpc as it's not related to rpc handlers Signed-off-by: JCW --- cmake/XrplCore.cmake | 1 + {src/xrpld/rpc => include/xrpl/server}/InfoSub.h | 5 +++-- src/{xrpld/rpc/detail => libxrpl/server}/InfoSub.cpp | 2 +- src/xrpld/app/ledger/BookListeners.h | 3 +-- src/xrpld/app/ledger/LedgerHistory.cpp | 1 - src/xrpld/app/main/GRPCServer.h | 2 +- src/xrpld/app/misc/NetworkOPs.h | 2 +- src/xrpld/app/paths/PathRequest.h | 2 +- src/xrpld/rpc/Context.h | 2 +- src/xrpld/rpc/RPCSub.h | 3 +-- src/xrpld/rpc/detail/RPCHandler.cpp | 2 +- src/xrpld/rpc/detail/WSInfoSub.h | 2 +- 12 files changed, 13 insertions(+), 14 deletions(-) rename {src/xrpld/rpc => include/xrpl/server}/InfoSub.h (98%) rename src/{xrpld/rpc/detail => libxrpl/server}/InfoSub.cpp (98%) diff --git a/cmake/XrplCore.cmake b/cmake/XrplCore.cmake index 9b88ef56cf0..880743cecd2 100644 --- a/cmake/XrplCore.cmake +++ b/cmake/XrplCore.cmake @@ -140,6 +140,7 @@ target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol xrpl.libxrpl.core xrpl.libxrpl.rdb + xrpl.libxrpl.resource ) add_module(xrpl ledger) diff --git a/src/xrpld/rpc/InfoSub.h b/include/xrpl/server/InfoSub.h similarity index 98% rename from src/xrpld/rpc/InfoSub.h rename to include/xrpl/server/InfoSub.h index 9563f4c9458..15f4470a01e 100644 --- a/src/xrpld/rpc/InfoSub.h +++ b/include/xrpl/server/InfoSub.h @@ -1,5 +1,5 @@ -#ifndef XRPL_NET_INFOSUB_H_INCLUDED -#define XRPL_NET_INFOSUB_H_INCLUDED +#ifndef XRPL_SERVER_INFOSUB_H_INCLUDED +#define XRPL_SERVER_INFOSUB_H_INCLUDED #include #include @@ -147,6 +147,7 @@ class InfoSub : public CountedObject virtual bool subPeerStatus(ref ispListener) = 0; + virtual bool unsubPeerStatus(std::uint64_t uListener) = 0; virtual void diff --git a/src/xrpld/rpc/detail/InfoSub.cpp b/src/libxrpl/server/InfoSub.cpp similarity index 98% rename from src/xrpld/rpc/detail/InfoSub.cpp rename to src/libxrpl/server/InfoSub.cpp index c8917b3327d..b85c8aad998 100644 --- a/src/xrpld/rpc/detail/InfoSub.cpp +++ b/src/libxrpl/server/InfoSub.cpp @@ -1,4 +1,4 @@ -#include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/BookListeners.h b/src/xrpld/app/ledger/BookListeners.h index 784172974ea..9e0fd3959a9 100644 --- a/src/xrpld/app/ledger/BookListeners.h +++ b/src/xrpld/app/ledger/BookListeners.h @@ -1,9 +1,8 @@ #ifndef XRPL_APP_LEDGER_BOOKLISTENERS_H_INCLUDED #define XRPL_APP_LEDGER_BOOKLISTENERS_H_INCLUDED -#include - #include +#include #include #include diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index 2654e25d7b2..447c51274f5 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -1,5 +1,4 @@ #include -#include #include #include diff --git a/src/xrpld/app/main/GRPCServer.h b/src/xrpld/app/main/GRPCServer.h index c2697e26c6e..839a83fe807 100644 --- a/src/xrpld/app/main/GRPCServer.h +++ b/src/xrpld/app/main/GRPCServer.h @@ -4,13 +4,13 @@ #include #include #include -#include #include #include #include #include #include +#include #include diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 5b92e4574bd..83eef535589 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -3,12 +3,12 @@ #include #include -#include #include #include #include #include +#include #include diff --git a/src/xrpld/app/paths/PathRequest.h b/src/xrpld/app/paths/PathRequest.h index 8f63cfa9a9c..d87fb181579 100644 --- a/src/xrpld/app/paths/PathRequest.h +++ b/src/xrpld/app/paths/PathRequest.h @@ -4,11 +4,11 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/Context.h b/src/xrpld/rpc/Context.h index 8bb0bd3cbcd..d4cdfb1ddd8 100644 --- a/src/xrpld/rpc/Context.h +++ b/src/xrpld/rpc/Context.h @@ -1,11 +1,11 @@ #ifndef XRPL_RPC_CONTEXT_H_INCLUDED #define XRPL_RPC_CONTEXT_H_INCLUDED -#include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/RPCSub.h b/src/xrpld/rpc/RPCSub.h index b6bb32aaf34..4824537d0f1 100644 --- a/src/xrpld/rpc/RPCSub.h +++ b/src/xrpld/rpc/RPCSub.h @@ -1,9 +1,8 @@ #ifndef XRPL_NET_RPCSUB_H_INCLUDED #define XRPL_NET_RPCSUB_H_INCLUDED -#include - #include +#include #include diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index eb5b3f73401..27da5a3f6fc 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/WSInfoSub.h b/src/xrpld/rpc/detail/WSInfoSub.h index 91dc47fa2be..c73d0093f2a 100644 --- a/src/xrpld/rpc/detail/WSInfoSub.h +++ b/src/xrpld/rpc/detail/WSInfoSub.h @@ -1,11 +1,11 @@ #ifndef XRPL_RPC_WSINFOSUB_H #define XRPL_RPC_WSINFOSUB_H -#include #include #include #include +#include #include #include From 5d0dde75677f3e825dc8ea27edc93edcceb9699c Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 8 Jan 2026 16:30:48 +0000 Subject: [PATCH 2/7] Decouple NetworkOPs from app/ledger --- src/xrpld/app/misc/NetworkOPs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 83eef535589..91e6e8b4d15 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -7,8 +7,10 @@ #include #include #include +#include #include #include +#include #include From 51cdb4f9260fae8b736670c10d35f218c280e8fa Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 8 Jan 2026 20:00:43 +0000 Subject: [PATCH 3/7] Make NetworkOPs accept ServiceRegistry --- src/xrpld/app/main/Application.cpp | 2 +- src/xrpld/app/misc/NetworkOPs.cpp | 12 ++++++------ src/xrpld/app/misc/NetworkOPs.h | 4 ++-- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 60202835285..9c329423d7b 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -383,7 +383,7 @@ class ApplicationImp : public Application, public BasicApp logs_->journal("TaggedCache")) , m_networkOPs(make_NetworkOPs( - *this, + getServiceRegistry(), stopwatch(), config_->standalone(), config_->NETWORK_QUORUM, diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 2422ec4ae63..6d9657ac96d 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -206,7 +206,7 @@ class NetworkOPsImp final : public NetworkOPs public: NetworkOPsImp( - Application& app, + ServiceRegistry& registry, NetworkOPs::clock_type& clock, bool standalone, std::size_t minPeerCount, @@ -217,7 +217,7 @@ class NetworkOPsImp final : public NetworkOPs boost::asio::io_context& io_svc, beast::Journal journal, beast::insight::Collector::ptr const& collector) - : app_(app) + : app_(registry.app()) , m_journal(journal) , m_localTX(make_LocalTxs()) , mMode(start_valid ? OperatingMode::FULL : OperatingMode::DISCONNECTED) @@ -225,13 +225,13 @@ class NetworkOPsImp final : public NetworkOPs , clusterTimer_(io_svc) , accountHistoryTxTimer_(io_svc) , mConsensus( - app, + app_, make_FeeVote( setup_FeeVote(app_.config().section("voting")), app_.logs().journal("FeeVote")), ledgerMaster, *m_localTX, - app.getInboundTransactions(), + registry.getInboundTransactions(), beast::get_abstract_clock(), validatorKeys, app_.logs().journal("LedgerConsensus")) @@ -4867,7 +4867,7 @@ NetworkOPsImp::StateAccounting::json(Json::Value& obj) const std::unique_ptr make_NetworkOPs( - Application& app, + ServiceRegistry& registry, NetworkOPs::clock_type& clock, bool standalone, std::size_t minPeerCount, @@ -4880,7 +4880,7 @@ make_NetworkOPs( beast::insight::Collector::ptr const& collector) { return std::make_unique( - app, + registry, clock, standalone, minPeerCount, diff --git a/src/xrpld/app/misc/NetworkOPs.h b/src/xrpld/app/misc/NetworkOPs.h index 91e6e8b4d15..39f1e2d8c90 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/src/xrpld/app/misc/NetworkOPs.h @@ -2,9 +2,9 @@ #define XRPL_APP_MISC_NETWORKOPS_H_INCLUDED #include -#include #include +#include #include #include #include @@ -265,7 +265,7 @@ class NetworkOPs : public InfoSub::Source std::unique_ptr make_NetworkOPs( - Application& app, + ServiceRegistry& registry, NetworkOPs::clock_type& clock, bool standalone, std::size_t minPeerCount, diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 1a29312cf55..3ec644e6e1f 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -1,6 +1,7 @@ #ifndef XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED #define XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED +#include #include #include #include From 2ddd96fb50a1bf8ca0ea5f591f0546859dc0f1fa Mon Sep 17 00:00:00 2001 From: JCW Date: Fri, 9 Jan 2026 21:20:06 +0000 Subject: [PATCH 4/7] Move the NetworkOPs interface to libxrpl --- .../misc => include/xrpl/server}/NetworkOPs.h | 23 ++---------- src/test/app/Batch_test.cpp | 37 ++++++++++--------- src/test/jtx/Env_test.cpp | 2 +- src/test/jtx/impl/Env.cpp | 2 +- src/test/rpc/AmendmentBlocked_test.cpp | 2 +- src/test/rpc/ServerInfo_test.cpp | 2 +- src/test/rpc/Subscribe_test.cpp | 2 +- src/test/server/ServerStatus_test.cpp | 2 +- src/xrpld/app/consensus/RCLConsensus.cpp | 2 +- src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 2 +- src/xrpld/app/ledger/OrderBookDB.cpp | 2 +- .../app/ledger/detail/InboundLedgers.cpp | 2 +- .../app/ledger/detail/InboundTransactions.cpp | 2 +- src/xrpld/app/ledger/detail/LedgerMaster.cpp | 2 +- .../app/ledger/detail/TransactionAcquire.cpp | 2 +- src/xrpld/app/main/Application.cpp | 2 +- src/xrpld/app/main/LoadManager.cpp | 2 +- src/xrpld/app/misc/NetworkOPs.cpp | 3 +- src/xrpld/app/misc/SHAMapStoreImp.cpp | 2 +- src/xrpld/app/misc/detail/ValidatorList.cpp | 2 +- src/xrpld/app/misc/make_NetworkOPs.h | 35 ++++++++++++++++++ src/xrpld/app/paths/PathRequest.cpp | 2 +- src/xrpld/app/tx/detail/Change.cpp | 2 +- src/xrpld/overlay/detail/OverlayImpl.cpp | 2 +- src/xrpld/overlay/detail/PeerImp.cpp | 2 +- src/xrpld/rpc/detail/Handler.h | 2 +- src/xrpld/rpc/detail/RPCHandler.cpp | 2 +- src/xrpld/rpc/detail/RPCHelpers.h | 2 +- src/xrpld/rpc/detail/RPCLedgerHelpers.h | 2 +- src/xrpld/rpc/detail/ServerHandler.cpp | 2 +- src/xrpld/rpc/detail/TransactionSign.h | 2 +- src/xrpld/rpc/handlers/BookOffers.cpp | 2 +- src/xrpld/rpc/handlers/ConsensusInfo.cpp | 2 +- src/xrpld/rpc/handlers/FetchInfo.cpp | 2 +- src/xrpld/rpc/handlers/GetCounts.cpp | 2 +- src/xrpld/rpc/handlers/LedgerAccept.cpp | 2 +- src/xrpld/rpc/handlers/LedgerClosed.cpp | 2 +- src/xrpld/rpc/handlers/LedgerCurrent.cpp | 2 +- src/xrpld/rpc/handlers/OwnerInfo.cpp | 2 +- src/xrpld/rpc/handlers/ServerInfo.cpp | 2 +- src/xrpld/rpc/handlers/ServerState.cpp | 2 +- src/xrpld/rpc/handlers/Subscribe.cpp | 2 +- src/xrpld/rpc/handlers/Tx.cpp | 2 +- src/xrpld/rpc/handlers/Unsubscribe.cpp | 2 +- 44 files changed, 99 insertions(+), 79 deletions(-) rename {src/xrpld/app/misc => include/xrpl/server}/NetworkOPs.h (92%) create mode 100644 src/xrpld/app/misc/make_NetworkOPs.h diff --git a/src/xrpld/app/misc/NetworkOPs.h b/include/xrpl/server/NetworkOPs.h similarity index 92% rename from src/xrpld/app/misc/NetworkOPs.h rename to include/xrpl/server/NetworkOPs.h index 39f1e2d8c90..eac107ec178 100644 --- a/src/xrpld/app/misc/NetworkOPs.h +++ b/include/xrpl/server/NetworkOPs.h @@ -1,7 +1,5 @@ -#ifndef XRPL_APP_MISC_NETWORKOPS_H_INCLUDED -#define XRPL_APP_MISC_NETWORKOPS_H_INCLUDED - -#include +#ifndef XRPL_SERVER_NETWORKOPS_H_INCLUDED +#define XRPL_SERVER_NETWORKOPS_H_INCLUDED #include #include @@ -26,6 +24,7 @@ class LedgerMaster; class Transaction; class ValidatorKeys; class CanonicalTXSet; +class RCLCxPeerPos; // This is the primary interface into the "client" portion of the program. // Code that wants to do normal operations on the network such as @@ -261,22 +260,6 @@ class NetworkOPs : public InfoSub::Source stateAccounting(Json::Value& obj) = 0; }; -//------------------------------------------------------------------------------ - -std::unique_ptr -make_NetworkOPs( - ServiceRegistry& registry, - NetworkOPs::clock_type& clock, - bool standalone, - std::size_t minPeerCount, - bool start_valid, - JobQueue& job_queue, - LedgerMaster& ledgerMaster, - ValidatorKeys const& validatorKeys, - boost::asio::io_context& io_svc, - beast::Journal journal, - beast::insight::Collector::ptr const& collector); - } // namespace xrpl #endif diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 67b0933ae24..b4d647c9be7 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include namespace xrpl { namespace test { @@ -1415,14 +1415,14 @@ class Batch_test : public beast::unit_test::suite batch::inner(pay(alice, bob, XRP(1)), aliceSeq), batch::inner(pay(alice, bob, XRP(1)), aliceSeq)); - env.app().openLedger().modify( - [&](OpenView& view, beast::Journal j) { - auto const result = - xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); - BEAST_EXPECT( - !result.applied && result.ter == temARRAY_TOO_LARGE); - return result.applied; - }); + env.app().openLedger().modify([&](OpenView& view, + beast::Journal j) { + auto const result = xrpl::apply( + env.app(), view, *jt.stx, tapNONE, j); + BEAST_EXPECT( + !result.applied && result.ter == temARRAY_TOO_LARGE); + return result.applied; + }); } // telENV_RPC_FAILED: Batch: signers array exceeds 8 entries. @@ -1461,14 +1461,14 @@ class Batch_test : public beast::unit_test::suite batch::inner(pay(alice, bob, XRP(5)), aliceSeq + 2), batch::sig(bob, bob, bob, bob, bob, bob, bob, bob, bob, bob)); - env.app().openLedger().modify( - [&](OpenView& view, beast::Journal j) { - auto const result = - xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); - BEAST_EXPECT( - !result.applied && result.ter == temARRAY_TOO_LARGE); - return result.applied; - }); + env.app().openLedger().modify([&](OpenView& view, + beast::Journal j) { + auto const result = xrpl::apply( + env.app(), view, *jt.stx, tapNONE, j); + BEAST_EXPECT( + !result.applied && result.ter == temARRAY_TOO_LARGE); + return result.applied; + }); } } @@ -3738,7 +3738,8 @@ class Batch_test : public beast::unit_test::suite BEAST_EXPECT(!passesLocalChecks(stx, reason)); BEAST_EXPECT(reason == "Cannot submit pseudo transactions."); env.app().openLedger().modify([&](OpenView& view, beast::Journal j) { - auto const result = xrpl::apply(env.app(), view, stx, tapNONE, j); + auto const result = xrpl::apply( + env.app(), view, stx, tapNONE, j); BEAST_EXPECT(!result.applied && result.ter == temINVALID_FLAG); return result.applied; }); diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index fbe51c2a8de..17ee52b5d9a 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -1,6 +1,5 @@ #include -#include #include #include @@ -8,6 +7,7 @@ #include #include #include +#include #include diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index ccef0f03984..1a85cd60596 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -25,6 +24,7 @@ #include #include #include +#include #include diff --git a/src/test/rpc/AmendmentBlocked_test.cpp b/src/test/rpc/AmendmentBlocked_test.cpp index 2c3f631ac87..5a64f1d3872 100644 --- a/src/test/rpc/AmendmentBlocked_test.cpp +++ b/src/test/rpc/AmendmentBlocked_test.cpp @@ -1,10 +1,10 @@ #include #include -#include #include #include +#include namespace xrpl { diff --git a/src/test/rpc/ServerInfo_test.cpp b/src/test/rpc/ServerInfo_test.cpp index 27b554e38b2..3149284ca41 100644 --- a/src/test/rpc/ServerInfo_test.cpp +++ b/src/test/rpc/ServerInfo_test.cpp @@ -1,10 +1,10 @@ #include -#include #include #include #include +#include #include diff --git a/src/test/rpc/Subscribe_test.cpp b/src/test/rpc/Subscribe_test.cpp index 5a58c27ea8f..2a177d85a3c 100644 --- a/src/test/rpc/Subscribe_test.cpp +++ b/src/test/rpc/Subscribe_test.cpp @@ -4,13 +4,13 @@ #include #include -#include #include #include #include #include #include +#include #include diff --git a/src/test/server/ServerStatus_test.cpp b/src/test/server/ServerStatus_test.cpp index a2516126de3..c4e85a4f4e8 100644 --- a/src/test/server/ServerStatus_test.cpp +++ b/src/test/server/ServerStatus_test.cpp @@ -5,12 +5,12 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 99cc1400560..d66730e2a6e 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -25,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index b52cee29279..892fb98f635 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/src/xrpld/app/ledger/OrderBookDB.cpp b/src/xrpld/app/ledger/OrderBookDB.cpp index 47b04f3d2c2..73685215e71 100644 --- a/src/xrpld/app/ledger/OrderBookDB.cpp +++ b/src/xrpld/app/ledger/OrderBookDB.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/InboundLedgers.cpp b/src/xrpld/app/ledger/detail/InboundLedgers.cpp index 445786eb631..0ef739f1eab 100644 --- a/src/xrpld/app/ledger/detail/InboundLedgers.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedgers.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index 80906c45e72..350b96dd75e 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/LedgerMaster.cpp b/src/xrpld/app/ledger/detail/LedgerMaster.cpp index 562be5f4ad6..032fce3ec9c 100644 --- a/src/xrpld/app/ledger/detail/LedgerMaster.cpp +++ b/src/xrpld/app/ledger/detail/LedgerMaster.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp index 3cd0e84ef01..e32ddc7b56f 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 9c329423d7b..b55f55395cb 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -18,11 +18,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/main/LoadManager.cpp b/src/xrpld/app/main/LoadManager.cpp index 91afb67eb70..783ab9163fc 100644 --- a/src/xrpld/app/main/LoadManager.cpp +++ b/src/xrpld/app/main/LoadManager.cpp @@ -1,10 +1,10 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 6d9657ac96d..c072a1c4968 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -14,12 +15,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index f2441920d4f..a05fb8930e2 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -7,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/app/misc/detail/ValidatorList.cpp b/src/xrpld/app/misc/detail/ValidatorList.cpp index 5c1c5e80a1c..b1d385b5136 100644 --- a/src/xrpld/app/misc/detail/ValidatorList.cpp +++ b/src/xrpld/app/misc/detail/ValidatorList.cpp @@ -1,5 +1,4 @@ #include -#include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/app/misc/make_NetworkOPs.h b/src/xrpld/app/misc/make_NetworkOPs.h new file mode 100644 index 00000000000..50d010619de --- /dev/null +++ b/src/xrpld/app/misc/make_NetworkOPs.h @@ -0,0 +1,35 @@ +#ifndef XRPLD_APP_MISC_MAKE_NETWORKOPS_H_INCLUDED +#define XRPLD_APP_MISC_MAKE_NETWORKOPS_H_INCLUDED + +#include +#include +#include +#include +#include + +#include + +#include + +namespace xrpl { + +class LedgerMaster; +class ValidatorKeys; + +std::unique_ptr +make_NetworkOPs( + ServiceRegistry& registry, + NetworkOPs::clock_type& clock, + bool standalone, + std::size_t minPeerCount, + bool start_valid, + JobQueue& job_queue, + LedgerMaster& ledgerMaster, + ValidatorKeys const& validatorKeys, + boost::asio::io_context& io_svc, + beast::Journal journal, + beast::insight::Collector::ptr const& collector); + +} // namespace xrpl + +#endif diff --git a/src/xrpld/app/paths/PathRequest.cpp b/src/xrpld/app/paths/PathRequest.cpp index 41bae4b1783..9556f8d4aa5 100644 --- a/src/xrpld/app/paths/PathRequest.cpp +++ b/src/xrpld/app/paths/PathRequest.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/xrpld/app/tx/detail/Change.cpp b/src/xrpld/app/tx/detail/Change.cpp index 191d91863d5..f501595e2fe 100644 --- a/src/xrpld/app/tx/detail/Change.cpp +++ b/src/xrpld/app/tx/detail/Change.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -9,6 +8,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index c029b5aef08..924ba5a0a71 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 53237ed3ae8..6cf98b53ee4 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/Handler.h b/src/xrpld/rpc/detail/Handler.h index dac18c966f4..63340e72c3b 100644 --- a/src/xrpld/rpc/detail/Handler.h +++ b/src/xrpld/rpc/detail/Handler.h @@ -2,12 +2,12 @@ #define XRPL_RPC_HANDLER_H_INCLUDED #include -#include #include #include #include #include +#include namespace Json { class Object; diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index 27da5a3f6fc..11a8393aec9 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include @@ -18,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/RPCHelpers.h b/src/xrpld/rpc/detail/RPCHelpers.h index 0f26ca86675..1bf1f074a82 100644 --- a/src/xrpld/rpc/detail/RPCHelpers.h +++ b/src/xrpld/rpc/detail/RPCHelpers.h @@ -1,7 +1,6 @@ #ifndef XRPL_RPC_RPCHELPERS_H_INCLUDED #define XRPL_RPC_RPCHELPERS_H_INCLUDED -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/rpc/detail/RPCLedgerHelpers.h b/src/xrpld/rpc/detail/RPCLedgerHelpers.h index 3ec644e6e1f..d1bcc92e296 100644 --- a/src/xrpld/rpc/detail/RPCLedgerHelpers.h +++ b/src/xrpld/rpc/detail/RPCLedgerHelpers.h @@ -2,7 +2,6 @@ #define XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED #include -#include #include #include #include @@ -10,6 +9,7 @@ #include #include +#include #include diff --git a/src/xrpld/rpc/detail/ServerHandler.cpp b/src/xrpld/rpc/detail/ServerHandler.cpp index bb84b81566d..9bcb70ced74 100644 --- a/src/xrpld/rpc/detail/ServerHandler.cpp +++ b/src/xrpld/rpc/detail/ServerHandler.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index 181737ad28a..c1480a44d0c 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -2,7 +2,7 @@ #define XRPL_RPC_TRANSACTIONSIGN_H_INCLUDED #include -#include +#include #include #include diff --git a/src/xrpld/rpc/handlers/BookOffers.cpp b/src/xrpld/rpc/handlers/BookOffers.cpp index 6cbefe5dc7a..28d430657c8 100644 --- a/src/xrpld/rpc/handlers/BookOffers.cpp +++ b/src/xrpld/rpc/handlers/BookOffers.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -12,6 +11,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/ConsensusInfo.cpp b/src/xrpld/rpc/handlers/ConsensusInfo.cpp index 386ff994583..f9c5a977852 100644 --- a/src/xrpld/rpc/handlers/ConsensusInfo.cpp +++ b/src/xrpld/rpc/handlers/ConsensusInfo.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/FetchInfo.cpp b/src/xrpld/rpc/handlers/FetchInfo.cpp index 0c251fe9d68..6e5ac1dbc7c 100644 --- a/src/xrpld/rpc/handlers/FetchInfo.cpp +++ b/src/xrpld/rpc/handlers/FetchInfo.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/GetCounts.cpp b/src/xrpld/rpc/handlers/GetCounts.cpp index f7bbc22548f..e21b27e77eb 100644 --- a/src/xrpld/rpc/handlers/GetCounts.cpp +++ b/src/xrpld/rpc/handlers/GetCounts.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/LedgerAccept.cpp b/src/xrpld/rpc/handlers/LedgerAccept.cpp index 8938e3f1523..0d02edfaefc 100644 --- a/src/xrpld/rpc/handlers/LedgerAccept.cpp +++ b/src/xrpld/rpc/handlers/LedgerAccept.cpp @@ -1,11 +1,11 @@ #include #include -#include #include #include #include #include +#include #include diff --git a/src/xrpld/rpc/handlers/LedgerClosed.cpp b/src/xrpld/rpc/handlers/LedgerClosed.cpp index 3b93e0734fb..e26019cca6a 100644 --- a/src/xrpld/rpc/handlers/LedgerClosed.cpp +++ b/src/xrpld/rpc/handlers/LedgerClosed.cpp @@ -1,9 +1,9 @@ #include -#include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/LedgerCurrent.cpp b/src/xrpld/rpc/handlers/LedgerCurrent.cpp index 21b72147c61..d09ce69840c 100644 --- a/src/xrpld/rpc/handlers/LedgerCurrent.cpp +++ b/src/xrpld/rpc/handlers/LedgerCurrent.cpp @@ -1,9 +1,9 @@ #include -#include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/OwnerInfo.cpp b/src/xrpld/rpc/handlers/OwnerInfo.cpp index 37a4ceb60df..beb068e0652 100644 --- a/src/xrpld/rpc/handlers/OwnerInfo.cpp +++ b/src/xrpld/rpc/handlers/OwnerInfo.cpp @@ -1,11 +1,11 @@ #include -#include #include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/ServerInfo.cpp b/src/xrpld/rpc/handlers/ServerInfo.cpp index c7bd7f271de..c40ebdc6345 100644 --- a/src/xrpld/rpc/handlers/ServerInfo.cpp +++ b/src/xrpld/rpc/handlers/ServerInfo.cpp @@ -1,10 +1,10 @@ -#include #include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/ServerState.cpp b/src/xrpld/rpc/handlers/ServerState.cpp index 4ec08540fb7..11c2b6c5ca7 100644 --- a/src/xrpld/rpc/handlers/ServerState.cpp +++ b/src/xrpld/rpc/handlers/ServerState.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/Subscribe.cpp b/src/xrpld/rpc/handlers/Subscribe.cpp index 09d4a54e550..99074fd992d 100644 --- a/src/xrpld/rpc/handlers/Subscribe.cpp +++ b/src/xrpld/rpc/handlers/Subscribe.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -12,6 +11,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index b2dcc6e5b3a..06fe9aa322f 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include #include diff --git a/src/xrpld/rpc/handlers/Unsubscribe.cpp b/src/xrpld/rpc/handlers/Unsubscribe.cpp index bc192510bf6..e1a8ad3a50b 100644 --- a/src/xrpld/rpc/handlers/Unsubscribe.cpp +++ b/src/xrpld/rpc/handlers/Unsubscribe.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -7,6 +6,7 @@ #include #include #include +#include namespace xrpl { From 44dc0eff4f6d490c19a450dfc4664d354fa2c2c1 Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 15 Jan 2026 14:26:13 +0000 Subject: [PATCH 5/7] Fix the levelization error Signed-off-by: JCW --- .github/scripts/levelization/results/loops.txt | 2 +- .github/scripts/levelization/results/ordering.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/levelization/results/loops.txt b/.github/scripts/levelization/results/loops.txt index 204591130d4..3473b55b308 100644 --- a/.github/scripts/levelization/results/loops.txt +++ b/.github/scripts/levelization/results/loops.txt @@ -8,7 +8,7 @@ Loop: xrpld.app xrpld.core xrpld.app > xrpld.core Loop: xrpld.app xrpld.overlay - xrpld.overlay > xrpld.app + xrpld.overlay ~= xrpld.app Loop: xrpld.app xrpld.peerfinder xrpld.peerfinder == xrpld.app diff --git a/.github/scripts/levelization/results/ordering.txt b/.github/scripts/levelization/results/ordering.txt index d48a7d9e350..5a2e05dbdf6 100644 --- a/.github/scripts/levelization/results/ordering.txt +++ b/.github/scripts/levelization/results/ordering.txt @@ -136,6 +136,7 @@ test.rpc > xrpld.rpc test.rpc > xrpl.json test.rpc > xrpl.protocol test.rpc > xrpl.resource +test.rpc > xrpl.server test.server > test.jtx test.server > test.toplevel test.server > test.unit_test @@ -177,8 +178,11 @@ xrpl.resource > xrpl.protocol xrpl.server > xrpl.basics xrpl.server > xrpl.core xrpl.server > xrpl.json +xrpl.server > xrpl.ledger xrpl.server > xrpl.protocol xrpl.server > xrpl.rdb +xrpl.server > xrpl.resource +xrpl.server > xrpl.shamap xrpl.shamap > xrpl.basics xrpl.shamap > xrpl.nodestore xrpl.shamap > xrpl.protocol From a2366a12732a8d11346873c48f34b09c604106f3 Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 15 Jan 2026 16:39:31 +0000 Subject: [PATCH 6/7] Fix the build error Signed-off-by: JCW --- src/xrpld/app/ledger/LedgerHistory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index 447c51274f5..2654e25d7b2 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -1,4 +1,5 @@ #include +#include #include #include From f518dd5f1f436e8afd01483d5eba201626efbf36 Mon Sep 17 00:00:00 2001 From: JCW Date: Thu, 15 Jan 2026 16:41:33 +0000 Subject: [PATCH 7/7] Fix pre-commit errors Signed-off-by: JCW --- src/test/app/Batch_test.cpp | 35 +++++++++---------- src/xrpld/app/ledger/ConsensusTransSetSF.cpp | 2 +- src/xrpld/app/ledger/OrderBookDB.cpp | 2 +- .../app/ledger/detail/InboundTransactions.cpp | 2 +- .../app/ledger/detail/TransactionAcquire.cpp | 1 + src/xrpld/app/paths/PathRequest.cpp | 2 +- src/xrpld/rpc/detail/TransactionSign.h | 3 +- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index b4d647c9be7..0ec2ab7db0c 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -1415,14 +1415,14 @@ class Batch_test : public beast::unit_test::suite batch::inner(pay(alice, bob, XRP(1)), aliceSeq), batch::inner(pay(alice, bob, XRP(1)), aliceSeq)); - env.app().openLedger().modify([&](OpenView& view, - beast::Journal j) { - auto const result = xrpl::apply( - env.app(), view, *jt.stx, tapNONE, j); - BEAST_EXPECT( - !result.applied && result.ter == temARRAY_TOO_LARGE); - return result.applied; - }); + env.app().openLedger().modify( + [&](OpenView& view, beast::Journal j) { + auto const result = + xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); + BEAST_EXPECT( + !result.applied && result.ter == temARRAY_TOO_LARGE); + return result.applied; + }); } // telENV_RPC_FAILED: Batch: signers array exceeds 8 entries. @@ -1461,14 +1461,14 @@ class Batch_test : public beast::unit_test::suite batch::inner(pay(alice, bob, XRP(5)), aliceSeq + 2), batch::sig(bob, bob, bob, bob, bob, bob, bob, bob, bob, bob)); - env.app().openLedger().modify([&](OpenView& view, - beast::Journal j) { - auto const result = xrpl::apply( - env.app(), view, *jt.stx, tapNONE, j); - BEAST_EXPECT( - !result.applied && result.ter == temARRAY_TOO_LARGE); - return result.applied; - }); + env.app().openLedger().modify( + [&](OpenView& view, beast::Journal j) { + auto const result = + xrpl::apply(env.app(), view, *jt.stx, tapNONE, j); + BEAST_EXPECT( + !result.applied && result.ter == temARRAY_TOO_LARGE); + return result.applied; + }); } } @@ -3738,8 +3738,7 @@ class Batch_test : public beast::unit_test::suite BEAST_EXPECT(!passesLocalChecks(stx, reason)); BEAST_EXPECT(reason == "Cannot submit pseudo transactions."); env.app().openLedger().modify([&](OpenView& view, beast::Journal j) { - auto const result = xrpl::apply( - env.app(), view, stx, tapNONE, j); + auto const result = xrpl::apply(env.app(), view, stx, tapNONE, j); BEAST_EXPECT(!result.applied && result.ter == temINVALID_FLAG); return result.applied; }); diff --git a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp index 892fb98f635..213cf926d05 100644 --- a/src/xrpld/app/ledger/ConsensusTransSetSF.cpp +++ b/src/xrpld/app/ledger/ConsensusTransSetSF.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -8,6 +7,7 @@ #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/OrderBookDB.cpp b/src/xrpld/app/ledger/OrderBookDB.cpp index 73685215e71..310bab8785a 100644 --- a/src/xrpld/app/ledger/OrderBookDB.cpp +++ b/src/xrpld/app/ledger/OrderBookDB.cpp @@ -2,12 +2,12 @@ #include #include #include -#include #include #include #include #include +#include namespace xrpl { diff --git a/src/xrpld/app/ledger/detail/InboundTransactions.cpp b/src/xrpld/app/ledger/detail/InboundTransactions.cpp index 350b96dd75e..52c69224c91 100644 --- a/src/xrpld/app/ledger/detail/InboundTransactions.cpp +++ b/src/xrpld/app/ledger/detail/InboundTransactions.cpp @@ -2,12 +2,12 @@ #include #include #include -#include #include #include #include #include +#include #include #include diff --git a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp index e32ddc7b56f..f6b63a37a36 100644 --- a/src/xrpld/app/ledger/detail/TransactionAcquire.cpp +++ b/src/xrpld/app/ledger/detail/TransactionAcquire.cpp @@ -3,6 +3,7 @@ #include #include #include + #include #include diff --git a/src/xrpld/app/paths/PathRequest.cpp b/src/xrpld/app/paths/PathRequest.cpp index 9556f8d4aa5..9c2278f2ee2 100644 --- a/src/xrpld/app/paths/PathRequest.cpp +++ b/src/xrpld/app/paths/PathRequest.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/src/xrpld/rpc/detail/TransactionSign.h b/src/xrpld/rpc/detail/TransactionSign.h index c1480a44d0c..aa5b7068587 100644 --- a/src/xrpld/rpc/detail/TransactionSign.h +++ b/src/xrpld/rpc/detail/TransactionSign.h @@ -2,10 +2,11 @@ #define XRPL_RPC_TRANSACTIONSIGN_H_INCLUDED #include -#include #include #include +#include + namespace xrpl { // Forward declarations