From e8fa4e115450178fcce294f46d3a85e9cfca83ee Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Wed, 1 Jul 2026 11:30:42 +0700 Subject: [PATCH] fix(consensus): stop serving sidecars when reconciliation is off --- src/xrpld/app/misc/NetworkOPs.cpp | 22 ++++++++++++++++------ src/xrpld/overlay/detail/PeerImp.cpp | 7 +++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 8c4e96c7b..16835f5bf 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1977,12 +1977,22 @@ NetworkOPsImp::mapComplete(std::shared_ptr const& map, bool fromAcquire) // either created locally during the consensus process // or acquired from a peer - // Inform peers we have this set - protocol::TMHaveTransactionSet msg; - msg.set_hash(map->getHash().as_uint256().begin(), 256 / 8); - msg.set_status(protocol::tsHAVE); - app_.overlay().foreach( - send_always(std::make_shared(msg, protocol::mtHAVE_SET))); + // Inform peers we have this set. When sidecar reconciliation is compiled + // out, sidecar SHAMaps remain local consensus inputs; do not expose them + // through the generic candidate-set availability path. +#if XAHAUD_ENABLE_SIDECAR_RECONCILIATION + bool const advertiseSet = true; +#else + bool const advertiseSet = map->mapType() != SHAMapType::SIDECAR; +#endif + if (advertiseSet) + { + protocol::TMHaveTransactionSet msg; + msg.set_hash(map->getHash().as_uint256().begin(), 256 / 8); + msg.set_status(protocol::tsHAVE); + app_.overlay().foreach( + send_always(std::make_shared(msg, protocol::mtHAVE_SET))); + } // We acquired it because consensus asked us to if (fromAcquire) diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index 28aeeacc2..00c2ee78f 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -3318,6 +3318,13 @@ PeerImp::getTxSet(std::shared_ptr const& m) const uint256 const txSetHash{m->ledgerhash()}; std::shared_ptr shaMap{ app_.getInboundTransactions().getSet(txSetHash, false)}; +#if !XAHAUD_ENABLE_SIDECAR_RECONCILIATION + if (shaMap && shaMap->mapType() == SHAMapType::SIDECAR) + { + JLOG(p_journal_.debug()) << "getTxSet: Sidecar set serving disabled"; + return {}; + } +#endif if (!shaMap) { if (m->has_querytype() && !m->has_requestcookie())