xrpld
Loading...
Searching...
No Matches
xrpl::NetworkOPsImp Class Referencefinal

Concrete NetworkOPs: server sequencer, network tracker, and owner of all client subscription state (accounts, books, streams). More...

Inheritance diagram for xrpl::NetworkOPsImp:
Collaboration diagram for xrpl::NetworkOPsImp:

Classes

class  TransactionStatus
 Transaction with input flags and results to be applied in batches. More...
class  StateAccounting
 State accounting records two attributes for each possible server state: 1) Amount of time spent in each state (in microseconds). More...
struct  ServerFeeSummary
 Server fees published on server subscription. More...
struct  SubAccountHistoryIndex
struct  SubAccountHistoryInfo
struct  SubAccountHistoryInfoWeak
struct  Stats

Public Types

enum class  FailHard : unsigned char { No , Yes }
using clock_type = beast::AbstractClock<std::chrono::steady_clock>

Public Member Functions

 NetworkOPsImp (ServiceRegistry &registry, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startValid, JobQueue &jobQueue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_context &ioCtx, beast::Journal journal, beast::insight::Collector::ptr const &collector)
 ~NetworkOPsImp () override
OperatingMode getOperatingMode () const override
std::string strOperatingMode (OperatingMode const mode, bool const admin) const override
std::string strOperatingMode (bool const admin=false) const override
void submitTransaction (std::shared_ptr< STTx const > const &) override
void processTransaction (std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, FailHard failType) override
 Process transactions as they arrive from the network or which are submitted by clients.
void processTransactionSet (CanonicalTXSet const &set) override
 Process a set of transactions synchronously, and ensuring that they are processed in one batch.
void doTransactionSync (std::shared_ptr< Transaction > transaction, bool bUnlimited, FailHard failType)
 For transactions submitted directly by a client, apply batch of transactions and wait for this transaction to complete.
void doTransactionAsync (std::shared_ptr< Transaction > transaction, bool bUnlimited, FailHard failtype)
 For transactions not submitted by a locally connected client, fire and forget.
void transactionBatch ()
 Apply transactions in batches.
void apply (std::unique_lock< std::mutex > &batchLock)
 Attempt to apply transactions and post-process based on the results.
json::Value getOwnerInfo (std::shared_ptr< ReadView const > lpLedger, AccountID const &account) override
void getBookPage (std::shared_ptr< ReadView const > &lpLedger, Book const &, AccountID const &uTakerID, bool const bProof, unsigned int iLimit, json::Value const &jvMarker, json::Value &jvResult) override
bool processTrustedProposal (RCLCxPeerPos proposal) override
bool recvValidation (std::shared_ptr< STValidation > const &val, std::string const &source) override
void mapComplete (std::shared_ptr< SHAMap > const &map, bool fromAcquire) override
bool beginConsensus (uint256 const &networkClosed, std::unique_ptr< std::stringstream > const &clog) override
void endConsensus (std::unique_ptr< std::stringstream > const &clog) override
void setStandAlone () override
void setStateTimer () override
 Called to initially start our timers.
void setNeedNetworkLedger () override
void clearNeedNetworkLedger () override
bool isNeedNetworkLedger () override
bool isFull () override
void setMode (OperatingMode om) override
bool isBlocked () override
bool isAmendmentBlocked () override
void setAmendmentBlocked () override
bool isAmendmentWarned () override
void setAmendmentWarned () override
void clearAmendmentWarned () override
bool isUNLBlocked () override
void setUNLBlocked () override
void clearUNLBlocked () override
void consensusViewChange () override
json::Value getConsensusInfo () override
json::Value getServerInfo (bool human, bool admin, bool counters) override
void clearLedgerFetch () override
json::Value getLedgerFetchInfo () override
std::uint32_t acceptLedger (std::optional< std::chrono::milliseconds > consensusDelay) override
 Accepts the current transaction tree, return the new ledger's sequence.
void reportFeeChange () override
void reportConsensusStateChange (ConsensusPhase phase)
void updateLocalTx (ReadView const &view) override
std::size_t getLocalTxCount () override
std::size_t getBookSubscribersCount () override
 Total number of (book, subscriber) entries currently tracked.
void pubLedger (std::shared_ptr< ReadView const > const &lpAccepted) override
void pubProposedTransaction (std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result) override
void pubValidation (std::shared_ptr< STValidation > const &val) override
void subAccount (InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
void unsubAccount (InfoSub::ref ispListener, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
void unsubAccountInternal (std::uint64_t seq, hash_set< AccountID > const &vnaAccountIDs, bool rt) override
ErrorCodeI subAccountHistory (InfoSub::ref ispListener, AccountID const &account) override
 subscribe an account's new transactions and retrieve the account's historical transactions
void unsubAccountHistory (InfoSub::ref ispListener, AccountID const &account, bool historyOnly) override
 unsubscribe an account's transactions
void unsubAccountHistoryInternal (std::uint64_t seq, AccountID const &account, bool historyOnly) override
void scheduleAccountCleanup (std::uint64_t seq, hash_set< AccountID > rtAccounts, hash_set< AccountID > normalAccounts, hash_set< AccountID > historyAccounts) override
 Schedule the server-side teardown of a disconnecting connection's account subscriptions off the destructor thread.
bool subLedger (InfoSub::ref ispListener, json::Value &jvResult) override
bool unsubLedger (std::uint64_t uListener) override
bool subBookChanges (InfoSub::ref ispListener) override
bool unsubBookChanges (std::uint64_t uListener) override
bool subServer (InfoSub::ref ispListener, json::Value &jvResult, bool admin) override
bool unsubServer (std::uint64_t uListener) override
bool subBook (InfoSub::ref ispListener, Book const &) override
bool unsubBook (InfoSub::ref ispListener, Book const &) override
 Remove a book subscription for a live subscriber.
bool unsubBookInternal (std::uint64_t uListener, Book const &) override
 Remove a book subscription during InfoSub teardown.
bool subManifests (InfoSub::ref ispListener) override
bool unsubManifests (std::uint64_t uListener) override
void pubManifest (Manifest const &) override
bool subTransactions (InfoSub::ref ispListener) override
bool unsubTransactions (std::uint64_t uListener) override
bool subRTTransactions (InfoSub::ref ispListener) override
bool unsubRTTransactions (std::uint64_t uListener) override
bool subValidations (InfoSub::ref ispListener) override
bool unsubValidations (std::uint64_t uListener) override
bool subPeerStatus (InfoSub::ref ispListener) override
bool unsubPeerStatus (std::uint64_t uListener) override
void pubPeerStatus (std::function< json::Value(void)> const &) override
bool subConsensus (InfoSub::ref ispListener) override
bool unsubConsensus (std::uint64_t uListener) override
InfoSub::pointer findRpcSub (std::string const &strUrl) override
InfoSub::pointer addRpcSub (std::string const &strUrl, InfoSub::ref) override
bool tryRemoveRpcSub (std::string const &strUrl) override
InfoSub::pointer findRpcSubLocked (std::string const &strUrl)
 Look up an RPC subscription without taking streamLock_.
beast::Journal const & journal () const override
 Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g.
void stop () override
void stateAccounting (json::Value &obj) override

Static Public Member Functions

static FailHard doFailHard (bool noMeansDont)

Private Types

enum class  DispatchState : unsigned char { None , Scheduled , Running }
 Synchronization states for transaction batches. More...
enum  SubTypes {
  SLedger , SManifests , SServer , STransactions ,
  SRtTransactions , SValidations , SPeerStatus , SConsensusPhase ,
  SBookChanges , SLastEntry
}
using SubMapType = hash_map<std::uint64_t, InfoSub::wptr>
using SubInfoMapType = hash_map<AccountID, SubMapType>
using subRpcMapType = hash_map<std::string, InfoSub::pointer>
using SubAccountHistoryMapType
using SubBookMapType = hash_map<Book, SubMapType>
 Maps each order book to its current set of subscribers.

Private Member Functions

bool preProcessTransaction (std::shared_ptr< Transaction > &transaction)
void doTransactionSyncBatch (std::unique_lock< std::mutex > &lock, std::function< bool(std::unique_lock< std::mutex > const &)> retryCallback)
void switchLastClosedLedger (std::shared_ptr< Ledger const > const &newLCL)
bool checkLastClosedLedger (Overlay::PeerSequence const &, uint256 &networkClosed)
void setTimer (boost::asio::steady_timer &timer, std::chrono::milliseconds const &expiryTime, std::function< void()> onExpire, std::function< void()> onError)
void setHeartbeatTimer ()
void setClusterTimer ()
void processHeartbeatTimer ()
void processClusterTimer ()
MultiApiJson transJson (std::shared_ptr< STTx const > const &transaction, TER result, bool validated, std::shared_ptr< ReadView const > const &ledger, std::optional< std::reference_wrapper< TxMeta const > > meta)
void pubValidatedTransaction (std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction, bool last)
void pubAccountTransaction (std::shared_ptr< ReadView const > const &ledger, AcceptedLedgerTx const &transaction, bool last)
void pubBookTransaction (AcceptedLedgerTx const &transaction, MultiApiJson const &jvObj)
 Fan transaction notifications out to all book subscribers.
void pubProposedAccountTransaction (std::shared_ptr< ReadView const > const &ledger, std::shared_ptr< STTx const > const &transaction, TER result)
void publishLedgerStreams (std::shared_ptr< ReadView const > const &lpAccepted, std::shared_ptr< AcceptedLedger const > const &alpAccepted)
 Send the ledgerClosed and book-changes stream updates for a ledger.
void kickoffAccountHistory (std::shared_ptr< AcceptedLedger const > const &alpAccepted)
 On the first published ledger only, start the delayed account-history streaming for any subscriptions that were registered before a validated ledger existed.
void pubServer ()
void pubConsensus (ConsensusPhase phase)
std::string getHostId (bool forAdmin)
void subAccountHistoryStart (std::shared_ptr< ReadView const > const &ledger, SubAccountHistoryInfoWeak &subInfo)
void addAccountHistoryJob (SubAccountHistoryInfoWeak subInfo)
void setAccountHistoryJobTimer (SubAccountHistoryInfoWeak subInfo)
template<typename OuterMap, typename BeforeErase>
void cleanupSubscriptionMap (std::uint64_t seq, hash_set< AccountID > const &accounts, OuterMap &outerMap, BeforeErase &&beforeErase)
 Erase one connection's entries from a subscription map in accountLock_-bounded chunks.
void cleanupAccountSubscriptions (std::uint64_t seq, hash_set< AccountID > const &accounts, SubInfoMapType &subMap)
 Erase one connection's entries from the given account map (subAccount_ or subRTAccount_) in accountLock_-bounded chunks.
void cleanupAccountHistorySubscriptions (std::uint64_t seq, hash_set< AccountID > const &accounts)
 Erase one connection's entries from subAccountHistory_ in accountLock_-bounded chunks.
void collectMetrics ()

Private Attributes

std::reference_wrapper< ServiceRegistryregistry_
beast::Journal journal_
std::unique_ptr< LocalTxslocalTX_
std::mutex accountLock_
 Guards subAccount_, subRTAccount_, subAccountHistory_.
std::mutex bookLock_
 Guards subBook_.
std::mutex streamLock_
 Guards streamMaps_[] and rpcSubMap_.
std::atomic< OperatingModemode_
std::atomic< bool > needNetworkLedger_ {false}
std::atomic< bool > amendmentBlocked_ {false}
std::atomic< bool > amendmentWarned_ {false}
std::atomic< bool > unlBlocked_ {false}
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
boost::asio::steady_timer heartbeatTimer_
boost::asio::steady_timer clusterTimer_
boost::asio::steady_timer accountHistoryTxTimer_
RCLConsensus consensus_
std::optional< PublicKey > const validatorPK_
std::optional< PublicKey > const validatorMasterPK_
ConsensusPhase lastConsensusPhase_ {ConsensusPhase::Open}
LedgerMasterledgerMaster_
SubInfoMapType subAccount_
SubInfoMapType subRTAccount_
SubBookMapType subBook_
 Guarded by bookLock_.
subRpcMapType rpcSubMap_
SubAccountHistoryMapType subAccountHistory_
std::array< SubMapType, SubTypes::SLastEntrystreamMaps_
 One weak_ptr subscriber map per stream type.
ServerFeeSummary lastFeeSummary_
JobQueuejobQueue_
bool const standalone_
std::size_t const minPeerCount_
std::condition_variable cond_
std::mutex mutex_
DispatchState dispatchState_ = DispatchState::None
std::vector< TransactionStatustransactions_
StateAccounting accounting_
std::set< uint256pendingValidations_
std::mutex validationsMutex_
std::mutex statsMutex_
Stats stats_

Static Private Attributes

static std::array< char const *, 5 > const kStates = kStateNames
static constexpr std::size_t kAccountCleanupChunk = 4096
 Maximum number of account entries erased per accountLock_ acquisition during disconnect-time cleanup.

Detailed Description

Concrete NetworkOPs: server sequencer, network tracker, and owner of all client subscription state (accounts, books, streams).

Subscriptions use three independent non-recursive locks (accountLock_, bookLock_, streamLock_); see their declarations for the locking and deferred-destruction rules.

Definition at line 163 of file NetworkOPs.cpp.

Member Typedef Documentation

◆ SubMapType

◆ SubInfoMapType

Definition at line 807 of file NetworkOPs.cpp.

◆ subRpcMapType

◆ SubAccountHistoryMapType

Initial value:
std::unordered_map< Key, Value, Hash, Pred, Allocator > hash_map

Definition at line 845 of file NetworkOPs.cpp.

◆ SubBookMapType

Maps each order book to its current set of subscribers.

Outer key: the Book (currency pair + optional domain). Inner key: InfoSub::seq (unique per connection). Inner value: weak_ptr so that a dropped connection does not prevent the InfoSub from being destroyed; expired entries are pruned lazily by pubBookTransaction and eagerly by unsubBookInternal (~InfoSub path). Guarded by bookLock_.

Definition at line 972 of file NetworkOPs.cpp.

◆ clock_type

Member Enumeration Documentation

◆ DispatchState

enum class xrpl::NetworkOPsImp::DispatchState : unsigned char
strongprivate

Synchronization states for transaction batches.

Enumerator
None 
Scheduled 
Running 

Definition at line 192 of file NetworkOPs.cpp.

◆ SubTypes

Enumerator
SLedger 
SManifests 
SServer 
STransactions 
SRtTransactions 
SValidations 
SPeerStatus 
SConsensusPhase 
SBookChanges 
SLastEntry 

Definition at line 984 of file NetworkOPs.cpp.

◆ FailHard

enum class xrpl::NetworkOPs::FailHard : unsigned char
stronginherited
Enumerator
No 
Yes 

Definition at line 86 of file NetworkOPs.h.

Constructor & Destructor Documentation

◆ NetworkOPsImp()

xrpl::NetworkOPsImp::NetworkOPsImp ( ServiceRegistry & registry,
NetworkOPs::clock_type & clock,
bool standalone,
std::size_t minPeerCount,
bool startValid,
JobQueue & jobQueue,
LedgerMaster & ledgerMaster,
ValidatorKeys const & validatorKeys,
boost::asio::io_context & ioCtx,
beast::Journal journal,
beast::insight::Collector::ptr const & collector )

Definition at line 302 of file NetworkOPs.cpp.

◆ ~NetworkOPsImp()

xrpl::NetworkOPsImp::~NetworkOPsImp ( )
override

Definition at line 345 of file NetworkOPs.cpp.

Member Function Documentation

◆ getOperatingMode()

OperatingMode xrpl::NetworkOPsImp::getOperatingMode ( ) const
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1087 of file NetworkOPs.cpp.

◆ strOperatingMode() [1/2]

std::string xrpl::NetworkOPsImp::strOperatingMode ( OperatingMode const mode,
bool const admin ) const
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1356 of file NetworkOPs.cpp.

◆ strOperatingMode() [2/2]

std::string xrpl::NetworkOPsImp::strOperatingMode ( bool const admin = false) const
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1093 of file NetworkOPs.cpp.

◆ submitTransaction()

void xrpl::NetworkOPsImp::submitTransaction ( std::shared_ptr< STTx const > const & iTrans)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1375 of file NetworkOPs.cpp.

◆ processTransaction()

void xrpl::NetworkOPsImp::processTransaction ( std::shared_ptr< Transaction > & transaction,
bool bUnlimited,
bool bLocal,
FailHard failType )
overridevirtual

Process transactions as they arrive from the network or which are submitted by clients.

Process local transactions synchronously

Parameters
transactionTransaction object
bUnlimitedWhether a privileged client connection submitted it.
bLocalClient submission.
failTypefail_hard setting from transaction submission.

Implements xrpl::NetworkOPs.

Definition at line 1484 of file NetworkOPs.cpp.

◆ processTransactionSet()

void xrpl::NetworkOPsImp::processTransactionSet ( CanonicalTXSet const & set)
overridevirtual

Process a set of transactions synchronously, and ensuring that they are processed in one batch.

Parameters
setTransaction object set

Implements xrpl::NetworkOPs.

Definition at line 1577 of file NetworkOPs.cpp.

◆ doTransactionSync()

void xrpl::NetworkOPsImp::doTransactionSync ( std::shared_ptr< Transaction > transaction,
bool bUnlimited,
FailHard failType )

For transactions submitted directly by a client, apply batch of transactions and wait for this transaction to complete.

Parameters
transactionTransaction object.
bUnlimitedWhether a privileged client connection submitted it.
failTypefail_hard setting from transaction submission.

Definition at line 1530 of file NetworkOPs.cpp.

◆ doTransactionAsync()

void xrpl::NetworkOPsImp::doTransactionAsync ( std::shared_ptr< Transaction > transaction,
bool bUnlimited,
FailHard failtype )

For transactions not submitted by a locally connected client, fire and forget.

Add to batch and trigger it to be processed if there's no batch currently being applied.

Parameters
transactionTransaction object
bUnlimitedWhether a privileged client connection submitted it.
failTypefail_hard setting from transaction submission.

Definition at line 1507 of file NetworkOPs.cpp.

◆ preProcessTransaction()

bool xrpl::NetworkOPsImp::preProcessTransaction ( std::shared_ptr< Transaction > & transaction)
private

Definition at line 1432 of file NetworkOPs.cpp.

◆ doTransactionSyncBatch()

void xrpl::NetworkOPsImp::doTransactionSyncBatch ( std::unique_lock< std::mutex > & lock,
std::function< bool(std::unique_lock< std::mutex > const &)> retryCallback )
private

Definition at line 1549 of file NetworkOPs.cpp.

◆ transactionBatch()

void xrpl::NetworkOPsImp::transactionBatch ( )

Apply transactions in batches.

Continue until none are queued.

Definition at line 1642 of file NetworkOPs.cpp.

◆ apply()

void xrpl::NetworkOPsImp::apply ( std::unique_lock< std::mutex > & batchLock)

Attempt to apply transactions and post-process based on the results.

Parameters
Lockthat protects the transaction batching

Definition at line 1656 of file NetworkOPs.cpp.

◆ getOwnerInfo()

json::Value xrpl::NetworkOPsImp::getOwnerInfo ( std::shared_ptr< ReadView const > lpLedger,
AccountID const & account )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1911 of file NetworkOPs.cpp.

◆ getBookPage()

void xrpl::NetworkOPsImp::getBookPage ( std::shared_ptr< ReadView const > & lpLedger,
Book const & book,
AccountID const & uTakerID,
bool const bProof,
unsigned int iLimit,
json::Value const & jvMarker,
json::Value & jvResult )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 4765 of file NetworkOPs.cpp.

◆ processTrustedProposal()

bool xrpl::NetworkOPsImp::processTrustedProposal ( RCLCxPeerPos proposal)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2264 of file NetworkOPs.cpp.

◆ recvValidation()

bool xrpl::NetworkOPsImp::recvValidation ( std::shared_ptr< STValidation > const & val,
std::string const & source )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2728 of file NetworkOPs.cpp.

◆ mapComplete()

void xrpl::NetworkOPsImp::mapComplete ( std::shared_ptr< SHAMap > const & map,
bool fromAcquire )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2289 of file NetworkOPs.cpp.

◆ switchLastClosedLedger()

void xrpl::NetworkOPsImp::switchLastClosedLedger ( std::shared_ptr< Ledger const > const & newLCL)
private

Definition at line 2137 of file NetworkOPs.cpp.

◆ checkLastClosedLedger()

bool xrpl::NetworkOPsImp::checkLastClosedLedger ( Overlay::PeerSequence const & peerList,
uint256 & networkClosed )
private

Definition at line 2032 of file NetworkOPs.cpp.

◆ beginConsensus()

bool xrpl::NetworkOPsImp::beginConsensus ( uint256 const & networkClosed,
std::unique_ptr< std::stringstream > const & clog )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2192 of file NetworkOPs.cpp.

◆ endConsensus()

void xrpl::NetworkOPsImp::endConsensus ( std::unique_ptr< std::stringstream > const & clog)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2305 of file NetworkOPs.cpp.

◆ setStandAlone()

void xrpl::NetworkOPsImp::setStandAlone ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1099 of file NetworkOPs.cpp.

◆ setStateTimer()

void xrpl::NetworkOPsImp::setStateTimer ( )
overridevirtual

Called to initially start our timers.

Not called for stand-alone mode.

Implements xrpl::NetworkOPs.

Definition at line 1148 of file NetworkOPs.cpp.

◆ setNeedNetworkLedger()

void xrpl::NetworkOPsImp::setNeedNetworkLedger ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1105 of file NetworkOPs.cpp.

◆ clearNeedNetworkLedger()

void xrpl::NetworkOPsImp::clearNeedNetworkLedger ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1111 of file NetworkOPs.cpp.

◆ isNeedNetworkLedger()

bool xrpl::NetworkOPsImp::isNeedNetworkLedger ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1117 of file NetworkOPs.cpp.

◆ isFull()

bool xrpl::NetworkOPsImp::isFull ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1123 of file NetworkOPs.cpp.

◆ setMode()

void xrpl::NetworkOPsImp::setMode ( OperatingMode om)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2699 of file NetworkOPs.cpp.

◆ isBlocked()

bool xrpl::NetworkOPsImp::isBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1976 of file NetworkOPs.cpp.

◆ isAmendmentBlocked()

bool xrpl::NetworkOPsImp::isAmendmentBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1982 of file NetworkOPs.cpp.

◆ setAmendmentBlocked()

void xrpl::NetworkOPsImp::setAmendmentBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1988 of file NetworkOPs.cpp.

◆ isAmendmentWarned()

bool xrpl::NetworkOPsImp::isAmendmentWarned ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 1995 of file NetworkOPs.cpp.

◆ setAmendmentWarned()

void xrpl::NetworkOPsImp::setAmendmentWarned ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2001 of file NetworkOPs.cpp.

◆ clearAmendmentWarned()

void xrpl::NetworkOPsImp::clearAmendmentWarned ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2007 of file NetworkOPs.cpp.

◆ isUNLBlocked()

bool xrpl::NetworkOPsImp::isUNLBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2013 of file NetworkOPs.cpp.

◆ setUNLBlocked()

void xrpl::NetworkOPsImp::setUNLBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2019 of file NetworkOPs.cpp.

◆ clearUNLBlocked()

void xrpl::NetworkOPsImp::clearUNLBlocked ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2026 of file NetworkOPs.cpp.

◆ consensusViewChange()

void xrpl::NetworkOPsImp::consensusViewChange ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2360 of file NetworkOPs.cpp.

◆ getConsensusInfo()

json::Value xrpl::NetworkOPsImp::getConsensusInfo ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2786 of file NetworkOPs.cpp.

◆ getServerInfo()

json::Value xrpl::NetworkOPsImp::getServerInfo ( bool human,
bool admin,
bool counters )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2792 of file NetworkOPs.cpp.

◆ clearLedgerFetch()

void xrpl::NetworkOPsImp::clearLedgerFetch ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3204 of file NetworkOPs.cpp.

◆ getLedgerFetchInfo()

json::Value xrpl::NetworkOPsImp::getLedgerFetchInfo ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3210 of file NetworkOPs.cpp.

◆ acceptLedger()

std::uint32_t xrpl::NetworkOPsImp::acceptLedger ( std::optional< std::chrono::milliseconds > consensusDelay)
overridevirtual

Accepts the current transaction tree, return the new ledger's sequence.

This API is only used via RPC with the server in STANDALONE mode and performs a virtual consensus round, with all the transactions we are proposing being accepted.

Implements xrpl::NetworkOPs.

Definition at line 4497 of file NetworkOPs.cpp.

◆ reportFeeChange()

void xrpl::NetworkOPsImp::reportFeeChange ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3400 of file NetworkOPs.cpp.

◆ reportConsensusStateChange()

void xrpl::NetworkOPsImp::reportConsensusStateChange ( ConsensusPhase phase)

Definition at line 3415 of file NetworkOPs.cpp.

◆ updateLocalTx()

void xrpl::NetworkOPsImp::updateLocalTx ( ReadView const & view)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3421 of file NetworkOPs.cpp.

◆ getLocalTxCount()

std::size_t xrpl::NetworkOPsImp::getLocalTxCount ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3426 of file NetworkOPs.cpp.

◆ getBookSubscribersCount()

std::size_t xrpl::NetworkOPsImp::getBookSubscribersCount ( )
overridevirtual

Total number of (book, subscriber) entries currently tracked.

Counts every weak_ptr stored across every book in subBook_, NOT the number of distinct subscribers and NOT the number of distinct books: a single subscriber following N books contributes N entries.

Note
Diagnostic accessor; intended for tests and operator visibility into per-book subscription state. The returned value is a snapshot under the subscription lock.

Implements xrpl::NetworkOPs.

Definition at line 3432 of file NetworkOPs.cpp.

◆ pubLedger()

void xrpl::NetworkOPsImp::pubLedger ( std::shared_ptr< ReadView const > const & lpAccepted)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3263 of file NetworkOPs.cpp.

◆ pubProposedTransaction()

void xrpl::NetworkOPsImp::pubProposedTransaction ( std::shared_ptr< ReadView const > const & ledger,
std::shared_ptr< STTx const > const & transaction,
TER result )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 3216 of file NetworkOPs.cpp.

◆ pubValidation()

void xrpl::NetworkOPsImp::pubValidation ( std::shared_ptr< STValidation > const & val)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 2553 of file NetworkOPs.cpp.

◆ subAccount()

void xrpl::NetworkOPsImp::subAccount ( InfoSub::ref ispListener,
hash_set< AccountID > const & vnaAccountIDs,
bool rt )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 3909 of file NetworkOPs.cpp.

◆ unsubAccount()

void xrpl::NetworkOPsImp::unsubAccount ( InfoSub::ref ispListener,
hash_set< AccountID > const & vnaAccountIDs,
bool rt )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 3945 of file NetworkOPs.cpp.

◆ unsubAccountInternal()

void xrpl::NetworkOPsImp::unsubAccountInternal ( std::uint64_t seq,
hash_set< AccountID > const & vnaAccountIDs,
bool rt )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 3961 of file NetworkOPs.cpp.

◆ subAccountHistory()

ErrorCodeI xrpl::NetworkOPsImp::subAccountHistory ( InfoSub::ref ispListener,
AccountID const & account )
overridevirtual

subscribe an account's new transactions and retrieve the account's historical transactions

Returns
rpcSUCCESS if successful, otherwise an error code

Implements xrpl::InfoSub::Source.

Definition at line 4377 of file NetworkOPs.cpp.

◆ unsubAccountHistory()

void xrpl::NetworkOPsImp::unsubAccountHistory ( InfoSub::ref ispListener,
AccountID const & account,
bool historyOnly )
overridevirtual

unsubscribe an account's transactions

Parameters
historyOnlyif true, only stop historical transactions
Note
once a client receives enough historical transactions, it should unsubscribe with historyOnly == true to stop receiving more historical transactions. It will continue to receive new transactions.

Implements xrpl::InfoSub::Source.

Definition at line 4418 of file NetworkOPs.cpp.

◆ unsubAccountHistoryInternal()

void xrpl::NetworkOPsImp::unsubAccountHistoryInternal ( std::uint64_t seq,
AccountID const & account,
bool historyOnly )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4429 of file NetworkOPs.cpp.

◆ scheduleAccountCleanup()

void xrpl::NetworkOPsImp::scheduleAccountCleanup ( std::uint64_t seq,
hash_set< AccountID > rtAccounts,
hash_set< AccountID > normalAccounts,
hash_set< AccountID > historyAccounts )
overridevirtual

Schedule the server-side teardown of a disconnecting connection's account subscriptions off the destructor thread.

The implementation posts a low-priority JobQueue task that erases the entries in bounded chunks, so ~InfoSub returns immediately instead of running the erase loop inline. The sets are taken by value so the job owns its copies and never references the destroyed InfoSub. Cleanup is keyed on seq (unique per connection), so deferring it cannot disturb a reconnected client reusing the same accounts.

Parameters
seqThe disconnecting connection's unique subscription id.
rtAccountsReal-time account subscriptions to remove.
normalAccountsNormal account subscriptions to remove.
historyAccountsAccount-history subscriptions to remove.
Note
The implementing Source must outlive any job it posts. If the JobQueue is already stopping (process shutdown), the job is not enqueued; the cleanup is skipped because the server-side maps are about to be destroyed and no publishing can run.

Implements xrpl::InfoSub::Source.

Definition at line 4055 of file NetworkOPs.cpp.

◆ subLedger()

bool xrpl::NetworkOPsImp::subLedger ( InfoSub::ref ispListener,
json::Value & jvResult )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4515 of file NetworkOPs.cpp.

◆ unsubLedger()

bool xrpl::NetworkOPsImp::unsubLedger ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4550 of file NetworkOPs.cpp.

◆ subBookChanges()

bool xrpl::NetworkOPsImp::subBookChanges ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4542 of file NetworkOPs.cpp.

◆ unsubBookChanges()

bool xrpl::NetworkOPsImp::unsubBookChanges ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4558 of file NetworkOPs.cpp.

◆ subServer()

bool xrpl::NetworkOPsImp::subServer ( InfoSub::ref ispListener,
json::Value & jvResult,
bool admin )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4582 of file NetworkOPs.cpp.

◆ unsubServer()

bool xrpl::NetworkOPsImp::unsubServer ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4607 of file NetworkOPs.cpp.

◆ subBook()

bool xrpl::NetworkOPsImp::subBook ( InfoSub::ref ispListener,
Book const & book )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4459 of file NetworkOPs.cpp.

◆ unsubBook()

bool xrpl::NetworkOPsImp::unsubBook ( InfoSub::ref ispListener,
Book const &  )
overridevirtual

Remove a book subscription for a live subscriber.

Clears the book from the subscriber's own tracking set (InfoSub::bookSubscriptions_) and then removes the server-side entry from subBook_. Call this from RPC unsubscribe handlers.

Parameters
ispListenerThe subscriber requesting removal.
bookThe order book to unsubscribe from.
Returns
true if the entry was present and removed, false if the subscriber was not subscribed to book.
Note
Thread-safety: acquires bookLock_ internally.
Do NOT call from ~InfoSub(). Use unsubBookInternal instead to avoid a redundant write-back to bookSubscriptions_ on a partially-destroyed object.

Implements xrpl::InfoSub::Source.

Definition at line 4474 of file NetworkOPs.cpp.

◆ unsubBookInternal()

bool xrpl::NetworkOPsImp::unsubBookInternal ( std::uint64_t uListener,
Book const &  )
overridevirtual

Remove a book subscription during InfoSub teardown.

Removes only the server-side entry from subBook_. Does NOT touch InfoSub::bookSubscriptions_ because the InfoSub is being destroyed. Called by ~InfoSub() for each book in bookSubscriptions_.

Parameters
uListenerThe sequence number of the subscriber being torn down.
bookThe order book entry to remove.
Returns
true if the entry was present and removed, false otherwise (e.g., already removed by a concurrent RPC unsubscribe).
Note
Thread-safety: acquires bookLock_ internally.

Implements xrpl::InfoSub::Source.

Definition at line 4484 of file NetworkOPs.cpp.

◆ subManifests()

bool xrpl::NetworkOPsImp::subManifests ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4566 of file NetworkOPs.cpp.

◆ unsubManifests()

bool xrpl::NetworkOPsImp::unsubManifests ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4574 of file NetworkOPs.cpp.

◆ pubManifest()

void xrpl::NetworkOPsImp::pubManifest ( Manifest const & mo)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 2369 of file NetworkOPs.cpp.

◆ subTransactions()

bool xrpl::NetworkOPsImp::subTransactions ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4615 of file NetworkOPs.cpp.

◆ unsubTransactions()

bool xrpl::NetworkOPsImp::unsubTransactions ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4623 of file NetworkOPs.cpp.

◆ subRTTransactions()

bool xrpl::NetworkOPsImp::subRTTransactions ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4631 of file NetworkOPs.cpp.

◆ unsubRTTransactions()

bool xrpl::NetworkOPsImp::unsubRTTransactions ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4639 of file NetworkOPs.cpp.

◆ subValidations()

bool xrpl::NetworkOPsImp::subValidations ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4647 of file NetworkOPs.cpp.

◆ unsubValidations()

bool xrpl::NetworkOPsImp::unsubValidations ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4661 of file NetworkOPs.cpp.

◆ subPeerStatus()

bool xrpl::NetworkOPsImp::subPeerStatus ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4669 of file NetworkOPs.cpp.

◆ unsubPeerStatus()

bool xrpl::NetworkOPsImp::unsubPeerStatus ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4677 of file NetworkOPs.cpp.

◆ pubPeerStatus()

void xrpl::NetworkOPsImp::pubPeerStatus ( std::function< json::Value(void)> const & func)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 2665 of file NetworkOPs.cpp.

◆ subConsensus()

bool xrpl::NetworkOPsImp::subConsensus ( InfoSub::ref ispListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4685 of file NetworkOPs.cpp.

◆ unsubConsensus()

bool xrpl::NetworkOPsImp::unsubConsensus ( std::uint64_t uListener)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4693 of file NetworkOPs.cpp.

◆ findRpcSub()

InfoSub::pointer xrpl::NetworkOPsImp::findRpcSub ( std::string const & strUrl)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4712 of file NetworkOPs.cpp.

◆ addRpcSub()

InfoSub::pointer xrpl::NetworkOPsImp::addRpcSub ( std::string const & strUrl,
InfoSub::ref rspEntry )
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4719 of file NetworkOPs.cpp.

◆ tryRemoveRpcSub()

bool xrpl::NetworkOPsImp::tryRemoveRpcSub ( std::string const & strUrl)
overridevirtual

Implements xrpl::InfoSub::Source.

Definition at line 4729 of file NetworkOPs.cpp.

◆ findRpcSubLocked()

InfoSub::pointer xrpl::NetworkOPsImp::findRpcSubLocked ( std::string const & strUrl)

Look up an RPC subscription without taking streamLock_.

Callers MUST already hold streamLock_. This exists so tryRemoveRpcSub can reuse the lookup while holding the lock; the plain std::mutex is not recursive, so calling the public findRpcSub (which locks) from under the lock would self-deadlock.

Parameters
strUrlThe subscription URL key into rpcSubMap_.
Returns
The matching InfoSub, or an empty pointer if not found.

Definition at line 4700 of file NetworkOPs.cpp.

◆ journal()

beast::Journal const & xrpl::NetworkOPsImp::journal ( ) const
overridevirtual

Journal used by InfoSub for diagnostics that occur after the owning subsystem (e.g.

application-level Logs) is the only surviving sink — primarily destructor-time cleanup failures.

Implements xrpl::InfoSub::Source.

Definition at line 667 of file NetworkOPs.cpp.

◆ stop()

void xrpl::NetworkOPsImp::stop ( )
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 673 of file NetworkOPs.cpp.

◆ stateAccounting()

void xrpl::NetworkOPsImp::stateAccounting ( json::Value & obj)
overridevirtual

Implements xrpl::NetworkOPs.

Definition at line 4654 of file NetworkOPs.cpp.

◆ setTimer()

void xrpl::NetworkOPsImp::setTimer ( boost::asio::steady_timer & timer,
std::chrono::milliseconds const & expiryTime,
std::function< void()> onExpire,
std::function< void()> onError )
private

Definition at line 1158 of file NetworkOPs.cpp.

◆ setHeartbeatTimer()

void xrpl::NetworkOPsImp::setHeartbeatTimer ( )
private

Definition at line 1188 of file NetworkOPs.cpp.

◆ setClusterTimer()

void xrpl::NetworkOPsImp::setClusterTimer ( )
private

Definition at line 1200 of file NetworkOPs.cpp.

◆ processHeartbeatTimer()

void xrpl::NetworkOPsImp::processHeartbeatTimer ( )
private

Definition at line 1227 of file NetworkOPs.cpp.

◆ processClusterTimer()

void xrpl::NetworkOPsImp::processClusterTimer ( )
private

Definition at line 1309 of file NetworkOPs.cpp.

◆ transJson()

MultiApiJson xrpl::NetworkOPsImp::transJson ( std::shared_ptr< STTx const > const & transaction,
TER result,
bool validated,
std::shared_ptr< ReadView const > const & ledger,
std::optional< std::reference_wrapper< TxMeta const > > meta )
private

Definition at line 3444 of file NetworkOPs.cpp.

◆ pubValidatedTransaction()

void xrpl::NetworkOPsImp::pubValidatedTransaction ( std::shared_ptr< ReadView const > const & ledger,
AcceptedLedgerTx const & transaction,
bool last )
private

Definition at line 3548 of file NetworkOPs.cpp.

◆ pubAccountTransaction()

void xrpl::NetworkOPsImp::pubAccountTransaction ( std::shared_ptr< ReadView const > const & ledger,
AcceptedLedgerTx const & transaction,
bool last )
private

Definition at line 3694 of file NetworkOPs.cpp.

◆ pubBookTransaction()

void xrpl::NetworkOPsImp::pubBookTransaction ( AcceptedLedgerTx const & transaction,
MultiApiJson const & jvObj )
private

Fan transaction notifications out to all book subscribers.

Extracts the set of order books affected by transaction, then delivers jvObj to every live subscriber of those books.

Uses a two-pass design to keep bookLock_ hold time short:

  1. Under bookLock_, collect strong InfoSub pointers for all live subscribers and prune any expired weak_ptrs encountered.
  2. Release bookLock_, then call send() on each collected pointer.
Parameters
transactionThe accepted ledger transaction to inspect.
jvObjJSON representation of the transaction to deliver.
Note
Thread-safety: acquires bookLock_ for the collection pass only. send() is intentionally called outside the lock to avoid blocking other book sub/unsub/publish paths while I/O is in progress.
Contention: bookLock_ guards only book subscriptions, so this pass no longer competes with account or stream traffic. On high-throughput nodes processing multi-hop payments that touch many offer nodes, it still holds bookLock_ longer than the old per-book BookListeners locks did. This is an accepted trade-off for lock-domain simplicity.

Definition at line 3616 of file NetworkOPs.cpp.

◆ pubProposedAccountTransaction()

void xrpl::NetworkOPsImp::pubProposedAccountTransaction ( std::shared_ptr< ReadView const > const & ledger,
std::shared_ptr< STTx const > const & transaction,
TER result )
private

Definition at line 3828 of file NetworkOPs.cpp.

◆ publishLedgerStreams()

void xrpl::NetworkOPsImp::publishLedgerStreams ( std::shared_ptr< ReadView const > const & lpAccepted,
std::shared_ptr< AcceptedLedger const > const & alpAccepted )
private

Send the ledgerClosed and book-changes stream updates for a ledger.

Takes streamLock_ only.

Definition at line 3300 of file NetworkOPs.cpp.

◆ kickoffAccountHistory()

void xrpl::NetworkOPsImp::kickoffAccountHistory ( std::shared_ptr< AcceptedLedger const > const & alpAccepted)
private

On the first published ledger only, start the delayed account-history streaming for any subscriptions that were registered before a validated ledger existed.

Takes accountLock_ only.

Definition at line 3376 of file NetworkOPs.cpp.

◆ pubServer()

void xrpl::NetworkOPsImp::pubServer ( )
private

Definition at line 2451 of file NetworkOPs.cpp.

◆ pubConsensus()

void xrpl::NetworkOPsImp::pubConsensus ( ConsensusPhase phase)
private

Definition at line 2520 of file NetworkOPs.cpp.

◆ getHostId()

std::string xrpl::NetworkOPsImp::getHostId ( bool forAdmin)
private

Definition at line 1129 of file NetworkOPs.cpp.

◆ subAccountHistoryStart()

void xrpl::NetworkOPsImp::subAccountHistoryStart ( std::shared_ptr< ReadView const > const & ledger,
SubAccountHistoryInfoWeak & subInfo )
private
Note
called while holding accountLock_ (it only touches subAccountHistory_ and posts a JobQueue task; it never reacquires a subscription lock nor touches the stream maps).

Definition at line 4332 of file NetworkOPs.cpp.

◆ addAccountHistoryJob()

void xrpl::NetworkOPsImp::addAccountHistoryJob ( SubAccountHistoryInfoWeak subInfo)
private

Definition at line 4105 of file NetworkOPs.cpp.

◆ setAccountHistoryJobTimer()

void xrpl::NetworkOPsImp::setAccountHistoryJobTimer ( SubAccountHistoryInfoWeak subInfo)
private

Definition at line 1214 of file NetworkOPs.cpp.

◆ cleanupSubscriptionMap()

template<typename OuterMap, typename BeforeErase>
void xrpl::NetworkOPsImp::cleanupSubscriptionMap ( std::uint64_t seq,
hash_set< AccountID > const & accounts,
OuterMap & outerMap,
BeforeErase && beforeErase )
private

Erase one connection's entries from a subscription map in accountLock_-bounded chunks.

Shared engine behind cleanupAccountSubscriptions and cleanupAccountHistorySubscriptions: both walk accounts, and for each remove this connection's seq from the inner per-account map, dropping the outer entry once its last subscriber leaves. The lock is released between chunks so a competing publish can interleave; no iterator is held across the unlock, so a concurrent mutation cannot dangle.

Template Parameters
OuterMaphash_map<AccountID, hash_map<seq, value>>.
BeforeEraseInvoked with the inner value about to be erased, for per-entry teardown the plain account maps do not need (the history map uses it to stop its paging job).
Parameters
seqThe disconnecting connection's subscription id.
accountsThe accounts this connection was subscribed to.
outerMapThe subscription map to erase from.
beforeEraseCalled on each inner value just before it is erased. See kAccountCleanupChunk.

Definition at line 3990 of file NetworkOPs.cpp.

◆ cleanupAccountSubscriptions()

void xrpl::NetworkOPsImp::cleanupAccountSubscriptions ( std::uint64_t seq,
hash_set< AccountID > const & accounts,
SubInfoMapType & subMap )
private

Erase one connection's entries from the given account map (subAccount_ or subRTAccount_) in accountLock_-bounded chunks.

The caller selects the map, so this need not know about the real-time/normal distinction. Keyed on seq, so it only removes the disconnecting connection's entries. See kAccountCleanupChunk.

Definition at line 4030 of file NetworkOPs.cpp.

◆ cleanupAccountHistorySubscriptions()

void xrpl::NetworkOPsImp::cleanupAccountHistorySubscriptions ( std::uint64_t seq,
hash_set< AccountID > const & accounts )
private

Erase one connection's entries from subAccountHistory_ in accountLock_-bounded chunks.

Keyed on seq. See kAccountCleanupChunk.

Definition at line 4040 of file NetworkOPs.cpp.

◆ collectMetrics()

void xrpl::NetworkOPsImp::collectMetrics ( )
private

Definition at line 5099 of file NetworkOPs.cpp.

◆ doFailHard()

FailHard xrpl::NetworkOPs::doFailHard ( bool noMeansDont)
staticinherited

Definition at line 88 of file NetworkOPs.h.

Member Data Documentation

◆ kStates

std::array< char const *, 5 > const xrpl::NetworkOPsImp::kStates = kStateNames
staticprivate

Definition at line 198 of file NetworkOPs.cpp.

◆ kAccountCleanupChunk

std::size_t xrpl::NetworkOPsImp::kAccountCleanupChunk = 4096
staticconstexprprivate

Maximum number of account entries erased per accountLock_ acquisition during disconnect-time cleanup.

The cleanup erase loops drop and reacquire accountLock_ after every chunk of this many accounts, bounding how long a large teardown holds the lock. A concurrent publish may interleave between chunks; that is safe because publishing tolerates a partially-cleaned map (a dead subscriber is simply not notified).

Definition at line 872 of file NetworkOPs.cpp.

◆ registry_

std::reference_wrapper<ServiceRegistry> xrpl::NetworkOPsImp::registry_
private

Definition at line 923 of file NetworkOPs.cpp.

◆ journal_

beast::Journal xrpl::NetworkOPsImp::journal_
private

Definition at line 924 of file NetworkOPs.cpp.

◆ localTX_

std::unique_ptr<LocalTxs> xrpl::NetworkOPsImp::localTX_
private

Definition at line 926 of file NetworkOPs.cpp.

◆ accountLock_

std::mutex xrpl::NetworkOPsImp::accountLock_
private

Guards subAccount_, subRTAccount_, subAccountHistory_.

Definition at line 938 of file NetworkOPs.cpp.

◆ bookLock_

std::mutex xrpl::NetworkOPsImp::bookLock_
private

Guards subBook_.

Definition at line 939 of file NetworkOPs.cpp.

◆ streamLock_

std::mutex xrpl::NetworkOPsImp::streamLock_
private

Guards streamMaps_[] and rpcSubMap_.

Definition at line 940 of file NetworkOPs.cpp.

◆ mode_

std::atomic<OperatingMode> xrpl::NetworkOPsImp::mode_
private

Definition at line 942 of file NetworkOPs.cpp.

◆ needNetworkLedger_

std::atomic<bool> xrpl::NetworkOPsImp::needNetworkLedger_ {false}
private

Definition at line 944 of file NetworkOPs.cpp.

◆ amendmentBlocked_

std::atomic<bool> xrpl::NetworkOPsImp::amendmentBlocked_ {false}
private

Definition at line 945 of file NetworkOPs.cpp.

◆ amendmentWarned_

std::atomic<bool> xrpl::NetworkOPsImp::amendmentWarned_ {false}
private

Definition at line 946 of file NetworkOPs.cpp.

◆ unlBlocked_

std::atomic<bool> xrpl::NetworkOPsImp::unlBlocked_ {false}
private

Definition at line 947 of file NetworkOPs.cpp.

◆ waitHandlerCounter_

ClosureCounter<void, boost::system::error_code const&> xrpl::NetworkOPsImp::waitHandlerCounter_
private

Definition at line 949 of file NetworkOPs.cpp.

◆ heartbeatTimer_

boost::asio::steady_timer xrpl::NetworkOPsImp::heartbeatTimer_
private

Definition at line 950 of file NetworkOPs.cpp.

◆ clusterTimer_

boost::asio::steady_timer xrpl::NetworkOPsImp::clusterTimer_
private

Definition at line 951 of file NetworkOPs.cpp.

◆ accountHistoryTxTimer_

boost::asio::steady_timer xrpl::NetworkOPsImp::accountHistoryTxTimer_
private

Definition at line 952 of file NetworkOPs.cpp.

◆ consensus_

RCLConsensus xrpl::NetworkOPsImp::consensus_
private

Definition at line 954 of file NetworkOPs.cpp.

◆ validatorPK_

std::optional<PublicKey> const xrpl::NetworkOPsImp::validatorPK_
private

Definition at line 956 of file NetworkOPs.cpp.

◆ validatorMasterPK_

std::optional<PublicKey> const xrpl::NetworkOPsImp::validatorMasterPK_
private

Definition at line 957 of file NetworkOPs.cpp.

◆ lastConsensusPhase_

ConsensusPhase xrpl::NetworkOPsImp::lastConsensusPhase_ {ConsensusPhase::Open}
private

Definition at line 959 of file NetworkOPs.cpp.

◆ ledgerMaster_

LedgerMaster& xrpl::NetworkOPsImp::ledgerMaster_
private

Definition at line 961 of file NetworkOPs.cpp.

◆ subAccount_

SubInfoMapType xrpl::NetworkOPsImp::subAccount_
private

Definition at line 974 of file NetworkOPs.cpp.

◆ subRTAccount_

SubInfoMapType xrpl::NetworkOPsImp::subRTAccount_
private

Definition at line 975 of file NetworkOPs.cpp.

◆ subBook_

SubBookMapType xrpl::NetworkOPsImp::subBook_
private

Guarded by bookLock_.

Definition at line 976 of file NetworkOPs.cpp.

◆ rpcSubMap_

subRpcMapType xrpl::NetworkOPsImp::rpcSubMap_
private

Definition at line 978 of file NetworkOPs.cpp.

◆ subAccountHistory_

SubAccountHistoryMapType xrpl::NetworkOPsImp::subAccountHistory_
private

Definition at line 980 of file NetworkOPs.cpp.

◆ streamMaps_

std::array<SubMapType, SubTypes::SLastEntry> xrpl::NetworkOPsImp::streamMaps_
private

One weak_ptr subscriber map per stream type.

Guarded by streamLock_; subject to its deferred-destruction rule (see pubServer).

Definition at line 1001 of file NetworkOPs.cpp.

◆ lastFeeSummary_

ServerFeeSummary xrpl::NetworkOPsImp::lastFeeSummary_
private

Definition at line 1003 of file NetworkOPs.cpp.

◆ jobQueue_

JobQueue& xrpl::NetworkOPsImp::jobQueue_
private

Definition at line 1005 of file NetworkOPs.cpp.

◆ standalone_

bool const xrpl::NetworkOPsImp::standalone_
private

Definition at line 1008 of file NetworkOPs.cpp.

◆ minPeerCount_

std::size_t const xrpl::NetworkOPsImp::minPeerCount_
private

Definition at line 1011 of file NetworkOPs.cpp.

◆ cond_

std::condition_variable xrpl::NetworkOPsImp::cond_
private

Definition at line 1014 of file NetworkOPs.cpp.

◆ mutex_

std::mutex xrpl::NetworkOPsImp::mutex_
private

Definition at line 1015 of file NetworkOPs.cpp.

◆ dispatchState_

DispatchState xrpl::NetworkOPsImp::dispatchState_ = DispatchState::None
private

Definition at line 1016 of file NetworkOPs.cpp.

◆ transactions_

std::vector<TransactionStatus> xrpl::NetworkOPsImp::transactions_
private

Definition at line 1017 of file NetworkOPs.cpp.

◆ accounting_

StateAccounting xrpl::NetworkOPsImp::accounting_
private

Definition at line 1019 of file NetworkOPs.cpp.

◆ pendingValidations_

std::set<uint256> xrpl::NetworkOPsImp::pendingValidations_
private

Definition at line 1021 of file NetworkOPs.cpp.

◆ validationsMutex_

std::mutex xrpl::NetworkOPsImp::validationsMutex_
private

Definition at line 1022 of file NetworkOPs.cpp.

◆ statsMutex_

std::mutex xrpl::NetworkOPsImp::statsMutex_
private

Definition at line 1060 of file NetworkOPs.cpp.

◆ stats_

Stats xrpl::NetworkOPsImp::stats_
private

Definition at line 1061 of file NetworkOPs.cpp.