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


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 | ClockType = beast::AbstractClock<std::chrono::steady_clock> |
Public Member Functions | |
| NetworkOPsImp (ServiceRegistry ®istry, NetworkOPs::ClockType &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, HashSet< AccountID > const &vnaAccountIDs, bool rt) override |
| void | unsubAccount (InfoSub::Ref ispListener, HashSet< AccountID > const &vnaAccountIDs, bool rt) override |
| void | unsubAccountInternal (std::uint64_t seq, HashSet< AccountID > const &vnaAccountIDs, bool rt) override |
| void | subMPT (InfoSub::Ref ispListener, HashSet< MPTID > const &mptIDs) override |
| void | unsubMPT (InfoSub::Ref ispListener, HashSet< MPTID > const &mptIDs) override |
| void | unsubMPTInternal (std::uint64_t seq, MPTID const &mptID) override |
| Remove an MPT issuance subscription during InfoSub teardown. | |
| 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, HashSet< AccountID > rtAccounts, HashSet< AccountID > normalAccounts, HashSet< 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 = HashMap<std::uint64_t, InfoSub::Wptr> |
| using | SubInfoMapType = HashMap<AccountID, SubMapType> |
| using | SubRpcMapType = HashMap<std::string, InfoSub::pointer> |
| using | SubMPTInfoMapType = HashMap<MPTID, SubMapType> |
| using | SubAccountHistoryMapType |
| using | SubBookMapType = HashMap<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) |
| void | pubMPTTransaction (AcceptedLedgerTx const &transaction, MultiApiJson const &jvObj) |
| 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, HashSet< 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, HashSet< 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, HashSet< AccountID > const &accounts) |
| Erase one connection's entries from subAccountHistory_ in accountLock_-bounded chunks. | |
| void | collectMetrics () |
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. | |
Concrete NetworkOPs: server sequencer, network tracker, and owner of all client subscription state (accounts, books, MPTs, streams).
Subscriptions use four independent non-recursive locks (accountLock_, bookLock_, mptLock_, streamLock_); see their declarations for the locking and deferred-destruction rules.
Definition at line 167 of file NetworkOPs.cpp.
|
private |
Definition at line 818 of file NetworkOPs.cpp.
|
private |
Definition at line 819 of file NetworkOPs.cpp.
|
private |
Definition at line 820 of file NetworkOPs.cpp.
|
private |
Definition at line 821 of file NetworkOPs.cpp.
|
private |
Definition at line 858 of file NetworkOPs.cpp.
|
private |
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 987 of file NetworkOPs.cpp.
|
inherited |
Definition at line 84 of file NetworkOPs.h.
|
strongprivate |
Synchronization states for transaction batches.
| Enumerator | |
|---|---|
| None | |
| Scheduled | |
| Running | |
Definition at line 196 of file NetworkOPs.cpp.
|
private |
| Enumerator | |
|---|---|
| SLedger | |
| SManifests | |
| SServer | |
| STransactions | |
| SRtTransactions | |
| SValidations | |
| SPeerStatus | |
| SConsensusPhase | |
| SBookChanges | |
| SLastEntry | |
Definition at line 1000 of file NetworkOPs.cpp.
|
stronginherited |
| Enumerator | |
|---|---|
| No | |
| Yes | |
Definition at line 86 of file NetworkOPs.h.
| xrpl::NetworkOPsImp::NetworkOPsImp | ( | ServiceRegistry & | registry, |
| NetworkOPs::ClockType & | 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 306 of file NetworkOPs.cpp.
|
override |
Definition at line 349 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1103 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1372 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1109 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1391 of file NetworkOPs.cpp.
|
overridevirtual |
Process transactions as they arrive from the network or which are submitted by clients.
Process local transactions synchronously
| transaction | Transaction object |
| bUnlimited | Whether a privileged client connection submitted it. |
| bLocal | Client submission. |
| failType | fail_hard setting from transaction submission. |
Implements xrpl::NetworkOPs.
Definition at line 1514 of file NetworkOPs.cpp.
|
overridevirtual |
Process a set of transactions synchronously, and ensuring that they are processed in one batch.
| set | Transaction object set |
Implements xrpl::NetworkOPs.
Definition at line 1607 of file NetworkOPs.cpp.
| 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.
| transaction | Transaction object. |
| bUnlimited | Whether a privileged client connection submitted it. |
| failType | fail_hard setting from transaction submission. |
Definition at line 1560 of file NetworkOPs.cpp.
| 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.
| transaction | Transaction object |
| bUnlimited | Whether a privileged client connection submitted it. |
| failType | fail_hard setting from transaction submission. |
Definition at line 1537 of file NetworkOPs.cpp.
|
private |
Definition at line 1448 of file NetworkOPs.cpp.
|
private |
Definition at line 1579 of file NetworkOPs.cpp.
| void xrpl::NetworkOPsImp::transactionBatch | ( | ) |
Apply transactions in batches.
Continue until none are queued.
Definition at line 1672 of file NetworkOPs.cpp.
| void xrpl::NetworkOPsImp::apply | ( | std::unique_lock< std::mutex > & | batchLock | ) |
Attempt to apply transactions and post-process based on the results.
| Lock | that protects the transaction batching |
Definition at line 1686 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1951 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 4931 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2304 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2768 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2329 of file NetworkOPs.cpp.
|
private |
Definition at line 2177 of file NetworkOPs.cpp.
|
private |
Definition at line 2072 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2232 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2345 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1115 of file NetworkOPs.cpp.
|
overridevirtual |
Called to initially start our timers.
Not called for stand-alone mode.
Implements xrpl::NetworkOPs.
Definition at line 1164 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1121 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1127 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1133 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 1139 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2739 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2016 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2022 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2028 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2035 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2041 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2047 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2053 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2059 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2066 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2400 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2826 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2832 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3244 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3250 of file NetworkOPs.cpp.
|
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 4663 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3440 of file NetworkOPs.cpp.
| void xrpl::NetworkOPsImp::reportConsensusStateChange | ( | ConsensusPhase | phase | ) |
Definition at line 3455 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3461 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3466 of file NetworkOPs.cpp.
|
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.
Implements xrpl::NetworkOPs.
Definition at line 3472 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3303 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 3256 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 2593 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 3948 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 3984 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4000 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4207 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4240 of file NetworkOPs.cpp.
|
overridevirtual |
Remove an MPT issuance subscription during InfoSub teardown.
Removes only the server-side entry from subMPT_. Does NOT touch InfoSub::mptSubscriptions_ because the InfoSub is being destroyed. Called by ~InfoSub() for each issuance in mptSubscriptions_.
| uListener | The sequence number of the subscriber being torn down. |
| mptID | The MPT issuance to remove. |
Implements xrpl::InfoSub::Source.
Definition at line 4253 of file NetworkOPs.cpp.
|
overridevirtual |
subscribe an account's new transactions and retrieve the account's historical transactions
Implements xrpl::InfoSub::Source.
Definition at line 4543 of file NetworkOPs.cpp.
|
overridevirtual |
unsubscribe an account's transactions
| historyOnly | if true, only stop historical transactions |
Implements xrpl::InfoSub::Source.
Definition at line 4584 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4595 of file NetworkOPs.cpp.
|
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.
| seq | The disconnecting connection's unique subscription id. |
| rtAccounts | Real-time account subscriptions to remove. |
| normalAccounts | Normal account subscriptions to remove. |
| historyAccounts | Account-history subscriptions to remove. |
Implements xrpl::InfoSub::Source.
Definition at line 4094 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4681 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4716 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4708 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4724 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4748 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4773 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4625 of file NetworkOPs.cpp.
|
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.
| ispListener | The subscriber requesting removal. |
| book | The order book to unsubscribe from. |
book.Implements xrpl::InfoSub::Source.
Definition at line 4640 of file NetworkOPs.cpp.
|
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_.
| uListener | The sequence number of the subscriber being torn down. |
| book | The order book entry to remove. |
Implements xrpl::InfoSub::Source.
Definition at line 4650 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4732 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4740 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 2409 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4781 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4789 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4797 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4805 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4813 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4827 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4835 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4843 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 2705 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4851 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4859 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4878 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4885 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::InfoSub::Source.
Definition at line 4895 of file NetworkOPs.cpp.
| 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.
| strUrl | The subscription URL key into rpcSubMap_. |
Definition at line 4866 of file NetworkOPs.cpp.
|
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 677 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 683 of file NetworkOPs.cpp.
|
overridevirtual |
Implements xrpl::NetworkOPs.
Definition at line 4820 of file NetworkOPs.cpp.
|
private |
Definition at line 1174 of file NetworkOPs.cpp.
|
private |
Definition at line 1204 of file NetworkOPs.cpp.
|
private |
Definition at line 1216 of file NetworkOPs.cpp.
|
private |
Definition at line 1243 of file NetworkOPs.cpp.
|
private |
Definition at line 1325 of file NetworkOPs.cpp.
|
private |
Definition at line 3484 of file NetworkOPs.cpp.
|
private |
Definition at line 3586 of file NetworkOPs.cpp.
|
private |
Definition at line 3733 of file NetworkOPs.cpp.
|
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:
| transaction | The accepted ledger transaction to inspect. |
| jvObj | JSON representation of the transaction to deliver. |
Definition at line 3655 of file NetworkOPs.cpp.
|
private |
Definition at line 3867 of file NetworkOPs.cpp.
|
private |
Send the ledgerClosed and book-changes stream updates for a ledger.
Takes streamLock_ only.
Definition at line 3340 of file NetworkOPs.cpp.
|
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 3416 of file NetworkOPs.cpp.
|
private |
Definition at line 2491 of file NetworkOPs.cpp.
|
private |
Definition at line 2560 of file NetworkOPs.cpp.
|
private |
Definition at line 4144 of file NetworkOPs.cpp.
|
private |
Definition at line 1145 of file NetworkOPs.cpp.
|
private |
Definition at line 4498 of file NetworkOPs.cpp.
|
private |
Definition at line 4271 of file NetworkOPs.cpp.
|
private |
Definition at line 1230 of file NetworkOPs.cpp.
|
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.
| OuterMap | HashMap<AccountID, HashMap<seq, value>>. |
| BeforeErase | Invoked 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). |
| seq | The disconnecting connection's subscription id. |
| accounts | The accounts this connection was subscribed to. |
| outerMap | The subscription map to erase from. |
| beforeErase | Called on each inner value just before it is erased. See kAccountCleanupChunk. |
Definition at line 4029 of file NetworkOPs.cpp.
|
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 4069 of file NetworkOPs.cpp.
|
private |
Erase one connection's entries from subAccountHistory_ in accountLock_-bounded chunks.
Keyed on seq. See kAccountCleanupChunk.
Definition at line 4079 of file NetworkOPs.cpp.
|
private |
Definition at line 5322 of file NetworkOPs.cpp.
|
staticinherited |
Definition at line 88 of file NetworkOPs.h.
|
staticprivate |
Definition at line 202 of file NetworkOPs.cpp.
|
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 885 of file NetworkOPs.cpp.
|
private |
Definition at line 936 of file NetworkOPs.cpp.
|
private |
Definition at line 937 of file NetworkOPs.cpp.
|
private |
Definition at line 939 of file NetworkOPs.cpp.
|
private |
Guards subAccount_, subRTAccount_, subAccountHistory_.
Definition at line 952 of file NetworkOPs.cpp.
|
private |
Guards subBook_.
Definition at line 953 of file NetworkOPs.cpp.
|
private |
Guards subMPT_.
Definition at line 954 of file NetworkOPs.cpp.
|
private |
Guards streamMaps_[] and rpcSubMap_.
Definition at line 955 of file NetworkOPs.cpp.
|
private |
Definition at line 957 of file NetworkOPs.cpp.
|
private |
Definition at line 959 of file NetworkOPs.cpp.
|
private |
Definition at line 960 of file NetworkOPs.cpp.
|
private |
Definition at line 961 of file NetworkOPs.cpp.
|
private |
Definition at line 962 of file NetworkOPs.cpp.
|
private |
Definition at line 964 of file NetworkOPs.cpp.
|
private |
Definition at line 965 of file NetworkOPs.cpp.
|
private |
Definition at line 966 of file NetworkOPs.cpp.
|
private |
Definition at line 967 of file NetworkOPs.cpp.
|
private |
Definition at line 969 of file NetworkOPs.cpp.
|
private |
Definition at line 971 of file NetworkOPs.cpp.
|
private |
Definition at line 972 of file NetworkOPs.cpp.
|
private |
Definition at line 974 of file NetworkOPs.cpp.
|
private |
Definition at line 976 of file NetworkOPs.cpp.
|
private |
Definition at line 989 of file NetworkOPs.cpp.
|
private |
Definition at line 990 of file NetworkOPs.cpp.
|
private |
Guarded by bookLock_.
Definition at line 991 of file NetworkOPs.cpp.
|
private |
Guarded by mptLock_.
Definition at line 992 of file NetworkOPs.cpp.
|
private |
Definition at line 994 of file NetworkOPs.cpp.
|
private |
Definition at line 996 of file NetworkOPs.cpp.
|
private |
One weak_ptr subscriber map per stream type.
Guarded by streamLock_; subject to its deferred-destruction rule (see pubServer).
Definition at line 1017 of file NetworkOPs.cpp.
|
private |
Definition at line 1019 of file NetworkOPs.cpp.
|
private |
Definition at line 1021 of file NetworkOPs.cpp.
|
private |
Definition at line 1024 of file NetworkOPs.cpp.
|
private |
Definition at line 1027 of file NetworkOPs.cpp.
|
private |
Definition at line 1030 of file NetworkOPs.cpp.
|
private |
Definition at line 1031 of file NetworkOPs.cpp.
|
private |
Definition at line 1032 of file NetworkOPs.cpp.
|
private |
Definition at line 1033 of file NetworkOPs.cpp.
|
private |
Definition at line 1035 of file NetworkOPs.cpp.
Definition at line 1037 of file NetworkOPs.cpp.
|
private |
Definition at line 1038 of file NetworkOPs.cpp.
|
private |
Definition at line 1076 of file NetworkOPs.cpp.
|
private |
Definition at line 1077 of file NetworkOPs.cpp.