rippled
Loading...
Searching...
No Matches
TxQ.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012-19 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_TXQ_H_INCLUDED
21#define RIPPLE_TXQ_H_INCLUDED
22
23#include <xrpld/app/tx/applySteps.h>
24#include <xrpld/ledger/ApplyView.h>
25#include <xrpld/ledger/OpenView.h>
26#include <xrpl/protocol/RippleLedgerHash.h>
27#include <xrpl/protocol/STTx.h>
28#include <xrpl/protocol/SeqProxy.h>
29#include <xrpl/protocol/TER.h>
30#include <boost/circular_buffer.hpp>
31#include <boost/intrusive/set.hpp>
32#include <optional>
33
34namespace ripple {
35
36class Application;
37class Config;
38
57class TxQ
58{
59public:
61 static constexpr FeeLevel64 baseLevel{256};
62
66 struct Setup
67 {
69 explicit Setup() = default;
70
154 bool standAlone = false;
155 };
156
161 struct Metrics
162 {
164 explicit Metrics() = default;
165
184 };
185
192 {
195 FeeLevel64 feeLevel_,
196 std::optional<LedgerIndex> const& lastValid_,
197 TxConsequences const& consequences_,
198 AccountID const& account_,
199 SeqProxy seqProxy_,
200 std::shared_ptr<STTx const> const& txn_,
201 int retriesRemaining_,
202 TER preflightResult_,
203 std::optional<TER> lastResult_)
204 : feeLevel(feeLevel_)
205 , lastValid(lastValid_)
206 , consequences(consequences_)
207 , account(account_)
208 , seqProxy(seqProxy_)
209 , txn(txn_)
210 , retriesRemaining(retriesRemaining_)
211 , preflightResult(preflightResult_)
212 , lastResult(lastResult_)
213 {
214 }
215
253 };
254
256 TxQ(Setup const& setup, beast::Journal j);
257
259 virtual ~TxQ();
260
271 apply(
272 Application& app,
273 OpenView& view,
275 ApplyFlags flags,
277
289 bool
290 accept(Application& app, OpenView& view);
291
304 void
305 processClosedLedger(Application& app, ReadView const& view, bool timeLeap);
306
309 nextQueuableSeq(std::shared_ptr<SLE const> const& sleAccount) const;
310
313 Metrics
314 getMetrics(OpenView const& view) const;
315
317 {
321 };
322
334 OpenView const& view,
335 std::shared_ptr<STTx const> const& tx) const;
336
344 getAccountTxs(AccountID const& account) const;
345
353 getTxs() const;
354
360 doRPC(Application& app) const;
361
362private:
363 // Implementation for nextQueuableSeq(). The passed lock must be held.
366 std::shared_ptr<SLE const> const& sleAccount,
367 std::lock_guard<std::mutex> const&) const;
368
375 {
376 private:
390 boost::circular_buffer<std::size_t> recentTxnCounts_;
396
397 public:
401 setup.standAlone ? setup.minimumTxnInLedgerSA
402 : setup.minimumTxnInLedger)
404 setup.targetTxnInLedger < minimumTxnCount_
406 : setup.targetTxnInLedger)
408 setup.maximumTxnInLedger
409 ? *setup.maximumTxnInLedger < targetTxnCount_
411 : *setup.maximumTxnInLedger
412 : std::optional<std::size_t>(std::nullopt))
414 , recentTxnCounts_(setup.ledgersInQueue)
415 , escalationMultiplier_(setup.minimumEscalationMultiplier)
416 , j_(j)
417 {
418 }
419
431 update(
432 Application& app,
433 ReadView const& view,
434 bool timeLeap,
435 TxQ::Setup const& setup);
436
439 struct Snapshot
440 {
441 // Number of transactions expected per ledger.
442 // One more than this value will be accepted
443 // before escalation kicks in.
445 // Based on the median fee of the LCL. Used
446 // when fee escalation kicks in.
448 };
449
453 {
455 }
456
465 static FeeLevel64
466 scaleFeeLevel(Snapshot const& snapshot, OpenView const& view);
467
500 Snapshot const& snapshot,
501 OpenView const& view,
502 std::size_t extraCount,
503 std::size_t seriesSize);
504 };
505
511 {
512 public:
516 boost::intrusive::set_member_hook<> byFeeListHook;
517
520
524 TxID const txID;
562
577 static constexpr int retriesAllowed = 10;
578
588
589 public:
591 MaybeTx(
593 TxID const& txID,
595 ApplyFlags const flags,
597
601
604 TxConsequences const&
606 {
607 return pfresult->consequences;
608 }
609
613 {
614 return {
615 feeLevel,
616 lastValid,
617 consequences(),
618 account,
619 seqProxy,
620 txn,
622 pfresult->ter,
623 lastResult};
624 }
625 };
626
629 {
630 public:
632 explicit OrderCandidates() = default;
633
649 bool
650 operator()(const MaybeTx& lhs, const MaybeTx& rhs) const
651 {
652 if (lhs.feeLevel == rhs.feeLevel)
653 return (lhs.txID ^ MaybeTx::parentHashComp) <
655 return lhs.feeLevel > rhs.feeLevel;
656 }
657 };
658
663 {
664 public:
666
671 /* If this account has had any transaction retry more than
672 `retriesAllowed` times so that it was dropped from the
673 queue, then all other transactions for this account will
674 be given at most 2 attempts before being removed. Helps
675 prevent wasting resources on retries that are more likely
676 to fail.
677 */
678 bool retryPenalty = false;
679 /* If this account has had any transaction fail or expire,
680 then when the queue is nearly full, transactions from
681 this account will be discarded. Helps prevent the queue
682 from getting filled and wedged.
683 */
684 bool dropPenalty = false;
685
686 public:
688 explicit TxQAccount(std::shared_ptr<STTx const> const& txn);
690 explicit TxQAccount(const AccountID& account);
691
695 {
696 return transactions.size();
697 }
698
700 bool
701 empty() const
702 {
703 return !getTxnCount();
704 }
705
707 TxMap::const_iterator
708 getPrevTx(SeqProxy seqProx) const;
709
711 MaybeTx&
712 add(MaybeTx&&);
713
719 bool
720 remove(SeqProxy seqProx);
721 };
722
723 // Helper function returns requiredFeeLevel.
726 OpenView& view,
727 ApplyFlags flags,
728 FeeMetrics::Snapshot const& metricsSnapshot,
729 std::lock_guard<std::mutex> const& lock) const;
730
731 // Helper function for TxQ::apply. If a transaction's fee is high enough,
732 // attempt to directly apply that transaction to the ledger.
735 Application& app,
736 OpenView& view,
738 ApplyFlags flags,
740
741 // Helper function that removes a replaced entry in _byFee.
744 std::optional<TxQAccount::TxMap::iterator> const& replacedTxIter,
746
747 using FeeHook = boost::intrusive::member_hook<
748 MaybeTx,
749 boost::intrusive::set_member_hook<>,
751
752 using FeeMultiSet = boost::intrusive::
753 multiset<MaybeTx, FeeHook, boost::intrusive::compare<OrderCandidates>>;
754
756
761
787
788#if !NDEBUG
794#endif
795
800
801private:
803 template <size_t fillPercentage = 100>
804 bool
805 isFull() const;
806
810 TER
811 canBeHeld(
812 STTx const&,
813 ApplyFlags const,
814 OpenView const&,
815 std::shared_ptr<SLE const> const& sleAccount,
816 AccountMap::iterator const&,
818 std::lock_guard<std::mutex> const& lock);
819
821 FeeMultiSet::iterator_type erase(FeeMultiSet::const_iterator_type);
826 FeeMultiSet::iterator_type eraseAndAdvance(
827 FeeMultiSet::const_iterator_type);
829 TxQAccount::TxMap::iterator
831 TxQAccount& txQAccount,
832 TxQAccount::TxMap::const_iterator begin,
833 TxQAccount::TxMap::const_iterator end);
834
842 Application& app,
843 OpenView& view,
844 STTx const& tx,
845 AccountMap::iterator const& accountIter,
846 TxQAccount::TxMap::iterator,
847 FeeLevel64 feeLevelPaid,
848 PreflightResult const& pfresult,
849 std::size_t const txExtraCount,
850 ApplyFlags flags,
851 FeeMetrics::Snapshot const& metricsSnapshot,
853};
854
859setup_TxQ(Config const&);
860
861template <class T>
863toDrops(FeeLevel<T> const& level, XRPAmount baseFee)
864{
865 return mulDiv(level, baseFee, TxQ::baseLevel)
867}
868
869inline FeeLevel64
870toFeeLevel(XRPAmount const& drops, XRPAmount const& baseFee)
871{
872 return mulDiv(drops, TxQ::baseLevel, baseFee)
874}
875
876} // namespace ripple
877
878#endif
Represents a JSON value.
Definition: json_value.h:147
A generic endpoint for log messages.
Definition: Journal.h:59
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:56
A view into a ledger.
Definition: ReadView.h:55
static const std::uint64_t cMaxNativeN
Definition: STAmount.h:74
A type that represents either a sequence value or a ticket value.
Definition: SeqProxy.h:56
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition: applySteps.h:58
Track and use the fee escalation metrics of the current open ledger.
Definition: TxQ.h:375
std::size_t txnsExpected_
Number of transactions expected per ledger.
Definition: TxQ.h:387
beast::Journal const j_
Journal.
Definition: TxQ.h:395
FeeMetrics(Setup const &setup, beast::Journal j)
Constructor.
Definition: TxQ.h:399
static FeeLevel64 scaleFeeLevel(Snapshot const &snapshot, OpenView const &view)
Use the number of transactions in the current open ledger to compute the fee level a transaction must...
Definition: TxQ.cpp:172
std::size_t const minimumTxnCount_
Minimum value of txnsExpected.
Definition: TxQ.h:378
static std::pair< bool, FeeLevel64 > escalatedSeriesFeeLevel(Snapshot const &snapshot, OpenView const &view, std::size_t extraCount, std::size_t seriesSize)
Computes the total fee level for all transactions in a series.
Definition: TxQ.cpp:233
Snapshot getSnapshot() const
Get the current Snapshot.
Definition: TxQ.h:452
std::optional< std::size_t > const maximumTxnCount_
Maximum value of txnsExpected.
Definition: TxQ.h:383
std::size_t const targetTxnCount_
Number of transactions per ledger that fee escalation "works towards".
Definition: TxQ.h:381
boost::circular_buffer< std::size_t > recentTxnCounts_
Recent history of transaction counts that exceed the targetTxnCount_.
Definition: TxQ.h:390
std::size_t update(Application &app, ReadView const &view, bool timeLeap, TxQ::Setup const &setup)
Updates fee metrics based on the transactions in the ReadView for use in fee escalation calculations.
Definition: TxQ.cpp:83
FeeLevel64 escalationMultiplier_
Based on the median fee of the LCL.
Definition: TxQ.h:393
Represents a transaction in the queue which may be applied later to the open ledger.
Definition: TxQ.h:511
SeqProxy const seqProxy
Transaction SeqProxy number (sfSequence or sfTicketSequence field).
Definition: TxQ.h:532
ApplyResult apply(Application &app, OpenView &view, beast::Journal j)
Attempt to apply the queued transaction to the open ledger.
Definition: TxQ.cpp:297
ApplyFlags const flags
Flags provided to apply.
Definition: TxQ.h:545
boost::intrusive::set_member_hook byFeeListHook
Used by the TxQ::FeeHook and TxQ::FeeMultiSet below to put each MaybeTx object into more than one set...
Definition: TxQ.h:516
int retriesRemaining
A transaction at the front of the queue will be given several attempts to succeed before being droppe...
Definition: TxQ.h:541
FeeLevel64 const feeLevel
Computed fee level that the transaction will pay.
Definition: TxQ.h:522
std::optional< PreflightResult const > pfresult
Cached result of the preflight operation.
Definition: TxQ.h:561
static constexpr int retriesAllowed
Starting retry count for newly queued transactions.
Definition: TxQ.h:577
AccountID const account
Account submitting the transaction.
Definition: TxQ.h:526
TxDetails getTxDetails() const
Return a TxDetails based on contained information.
Definition: TxQ.h:612
std::shared_ptr< STTx const > txn
The complete transaction.
Definition: TxQ.h:519
std::optional< LedgerIndex > const lastValid
Expiration ledger for the transaction (sfLastLedgerSequence field).
Definition: TxQ.h:529
TxID const txID
Transaction ID.
Definition: TxQ.h:524
static LedgerHash parentHashComp
The hash of the parent ledger.
Definition: TxQ.h:587
std::optional< TER > lastResult
If the transactor attempted to apply the transaction to the open ledger from the queue and failed,...
Definition: TxQ.h:552
TxConsequences const & consequences() const
Potential TxConsequences of applying this transaction to the open ledger.
Definition: TxQ.h:605
Used for sorting MaybeTx.
Definition: TxQ.h:629
OrderCandidates()=default
Default constructor.
bool operator()(const MaybeTx &lhs, const MaybeTx &rhs) const
Sort MaybeTx by feeLevel descending, then by pseudo-randomized transaction ID ascending.
Definition: TxQ.h:650
Used to represent an account to the queue, and stores the transactions queued for that account by Seq...
Definition: TxQ.h:663
TxMap transactions
Sequence number will be used as the key.
Definition: TxQ.h:670
std::size_t getTxnCount() const
Return the number of transactions currently queued for this account.
Definition: TxQ.h:694
AccountID const account
The account.
Definition: TxQ.h:668
TxMap::const_iterator getPrevTx(SeqProxy seqProx) const
Find the entry in transactions that precedes seqProx, if one does.
Definition: TxQ.cpp:330
bool remove(SeqProxy seqProx)
Remove the candidate with given SeqProxy value from this account.
Definition: TxQ.cpp:356
MaybeTx & add(MaybeTx &&)
Add a transaction candidate to this account for queuing.
Definition: TxQ.cpp:341
bool empty() const
Checks if this account has no transactions queued.
Definition: TxQ.h:701
Transaction Queue.
Definition: TxQ.h:58
boost::intrusive::multiset< MaybeTx, FeeHook, boost::intrusive::compare< OrderCandidates > > FeeMultiSet
Definition: TxQ.h:753
std::vector< TxDetails > getTxs() const
Returns information about all transactions currently in the queue.
Definition: TxQ.cpp:1844
std::optional< TxQAccount::TxMap::iterator > removeFromByFee(std::optional< TxQAccount::TxMap::iterator > const &replacedTxIter, std::shared_ptr< STTx const > const &tx)
Definition: TxQ.cpp:1749
std::optional< size_t > maxSize_
Maximum number of transactions allowed in the queue based on the current metrics.
Definition: TxQ.h:786
FeeMultiSet::iterator_type erase(FeeMultiSet::const_iterator_type)
Erase and return the next entry in byFee_ (lower fee level)
Metrics getMetrics(OpenView const &view) const
Returns fee metrics in reference fee level units.
Definition: TxQ.cpp:1777
Json::Value doRPC(Application &app) const
Summarize current fee metrics for the fee RPC command.
Definition: TxQ.cpp:1859
FeeMultiSet byFee_
The queue itself: the collection of transactions ordered by fee level.
Definition: TxQ.h:772
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1823
beast::Journal const j_
Journal.
Definition: TxQ.h:760
TER canBeHeld(STTx const &, ApplyFlags const, OpenView const &, std::shared_ptr< SLE const > const &sleAccount, AccountMap::iterator const &, std::optional< TxQAccount::TxMap::iterator > const &, std::lock_guard< std::mutex > const &lock)
Checks if the indicated transaction fits the conditions for being stored in the queue.
Definition: TxQ.cpp:383
SeqProxy nextQueuableSeq(std::shared_ptr< SLE const > const &sleAccount) const
Return the next sequence that would go in the TxQ for an account.
Definition: TxQ.cpp:1608
std::mutex mutex_
Most queue operations are done under the master lock, but use this mutex for the RPC "fee" command,...
Definition: TxQ.h:799
AccountMap byAccount_
All of the accounts which currently have any transactions in the queue.
Definition: TxQ.h:779
boost::intrusive::member_hook< MaybeTx, boost::intrusive::set_member_hook<>, &MaybeTx::byFeeListHook > FeeHook
Definition: TxQ.h:750
LedgerHash parentHash_
parentHash_ checks that no unexpected ledger transitions happen, and is only checked via debug assert...
Definition: TxQ.h:793
SeqProxy nextQueuableSeqImpl(std::shared_ptr< SLE const > const &sleAccount, std::lock_guard< std::mutex > const &) const
Definition: TxQ.cpp:1621
ApplyResult tryClearAccountQueueUpThruTx(Application &app, OpenView &view, STTx const &tx, AccountMap::iterator const &accountIter, TxQAccount::TxMap::iterator, FeeLevel64 feeLevelPaid, PreflightResult const &pfresult, std::size_t const txExtraCount, ApplyFlags flags, FeeMetrics::Snapshot const &metricsSnapshot, beast::Journal j)
All-or-nothing attempt to try to apply the queued txs for accountIter up to and including tx.
Definition: TxQ.cpp:517
bool isFull() const
Is the queue at least fillPercentage full?
Definition: TxQ.cpp:375
FeeAndSeq getTxRequiredFeeAndSeq(OpenView const &view, std::shared_ptr< STTx const > const &tx) const
Returns minimum required fee for tx and two sequences: first valid sequence for this account in curre...
Definition: TxQ.cpp:1799
FeeMultiSet::iterator_type eraseAndAdvance(FeeMultiSet::const_iterator_type)
Erase and return the next entry for the account (if fee level is higher), or next entry in byFee_ (lo...
Definition: TxQ.cpp:465
FeeMetrics feeMetrics_
Tracks the current state of the queue.
Definition: TxQ.h:766
virtual ~TxQ()
Destructor.
Definition: TxQ.cpp:368
FeeLevel64 getRequiredFeeLevel(OpenView &view, ApplyFlags flags, FeeMetrics::Snapshot const &metricsSnapshot, std::lock_guard< std::mutex > const &lock) const
Definition: TxQ.cpp:1668
TxQAccount::TxMap::iterator erase(TxQAccount &txQAccount, TxQAccount::TxMap::const_iterator begin, TxQAccount::TxMap::const_iterator end)
Erase a range of items, based on TxQAccount::TxMap iterators.
bool accept(Application &app, OpenView &view)
Fill the new open ledger with transactions from the queue.
Definition: TxQ.cpp:1434
static constexpr FeeLevel64 baseLevel
Fee level for single-signed reference transaction.
Definition: TxQ.h:61
Setup const setup_
Setup parameters used to control the behavior of the queue.
Definition: TxQ.h:758
void processClosedLedger(Application &app, ReadView const &view, bool timeLeap)
Update fee metrics and clean up the queue in preparation for the next ledger.
Definition: TxQ.cpp:1365
std::optional< ApplyResult > tryDirectApply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Definition: TxQ.cpp:1678
ApplyResult apply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Add a new transaction to the open ledger, hold it in the queue, or reject it.
Definition: TxQ.cpp:729
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition: TxQ.cpp:1914
FeeLevel64 toFeeLevel(XRPAmount const &drops, XRPAmount const &baseFee)
Definition: TxQ.h:870
FeeLevel< std::uint64_t > FeeLevel64
Definition: FeeUnits.h:472
XRPAmount toDrops(FeeLevel< T > const &level, XRPAmount baseFee)
Definition: TxQ.h:863
std::optional< std::uint64_t > mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div)
Return value*mul/div accurately.
Definition: mulDiv.cpp:27
ApplyFlags
Definition: ApplyView.h:30
STL namespace.
T size(T... args)
Describes the results of the preflight check.
Definition: applySteps.h:163
XRPAmount fee
Definition: TxQ.h:318
std::uint32_t availableSeq
Definition: TxQ.h:320
std::uint32_t accountSeq
Definition: TxQ.h:319
Snapshot of the externally relevant FeeMetrics fields at any given time.
Definition: TxQ.h:440
std::size_t const txnsExpected
Definition: TxQ.h:444
FeeLevel64 const escalationMultiplier
Definition: TxQ.h:447
Structure returned by TxQ::getMetrics, expressed in reference fee level units.
Definition: TxQ.h:162
FeeLevel64 minProcessingFeeLevel
Minimum fee level for a transaction to be considered for the open ledger or the queue.
Definition: TxQ.h:178
FeeLevel64 openLedgerFeeLevel
Minimum fee level to get into the current open ledger, bypassing the queue.
Definition: TxQ.h:183
std::size_t txPerLedger
Number of transactions expected per ledger.
Definition: TxQ.h:173
Metrics()=default
Default constructor.
std::optional< std::size_t > txQMaxSize
Max transactions currently allowed in queue.
Definition: TxQ.h:169
FeeLevel64 referenceFeeLevel
Reference transaction fee level.
Definition: TxQ.h:175
std::size_t txInLedger
Number of transactions currently in the open ledger.
Definition: TxQ.h:171
std::size_t txCount
Number of transactions in the queue.
Definition: TxQ.h:167
FeeLevel64 medFeeLevel
Median fee level of the last ledger.
Definition: TxQ.h:180
Structure used to customize TxQ behavior.
Definition: TxQ.h:67
std::uint32_t slowConsensusDecreasePercent
When consensus takes longer than appropriate, the expected ledger size is updated to the lesser of th...
Definition: TxQ.h:143
Setup()=default
Default constructor.
std::uint32_t minimumTxnInLedger
Minimum number of transactions to allow into the ledger before escalation, regardless of the prior le...
Definition: TxQ.h:100
std::uint32_t maximumTxnPerAccount
Maximum number of transactions that can be queued by one account.
Definition: TxQ.h:145
FeeLevel64 minimumEscalationMultiplier
Minimum value of the escalation multiplier, regardless of the prior ledger's median fee level.
Definition: TxQ.h:97
std::size_t queueSizeMin
The smallest limit the queue is allowed.
Definition: TxQ.h:84
std::optional< std::uint32_t > maximumTxnInLedger
Optional maximum allowed value of transactions per ledger before fee escalation kicks in.
Definition: TxQ.h:117
std::uint32_t targetTxnInLedger
Number of transactions per ledger that fee escalation "works towards".
Definition: TxQ.h:106
std::uint32_t retrySequencePercent
Extra percentage required on the fee level of a queued transaction to replace that transaction with a...
Definition: TxQ.h:94
std::uint32_t minimumLastLedgerBuffer
Minimum difference between the current ledger sequence and a transaction's LastLedgerSequence for the...
Definition: TxQ.h:152
std::uint32_t minimumTxnInLedgerSA
Like minimumTxnInLedger for standalone mode.
Definition: TxQ.h:103
std::size_t ledgersInQueue
Number of ledgers' worth of transactions to allow in the queue.
Definition: TxQ.h:78
bool standAlone
Use standalone mode behavior.
Definition: TxQ.h:154
std::uint32_t normalConsensusIncreasePercent
When the ledger has more transactions than "expected", and performance is humming along nicely,...
Definition: TxQ.h:129
Structure that describes a transaction in the queue waiting to be applied to the current open ledger.
Definition: TxQ.h:192
std::optional< LedgerIndex > lastValid
LastValidLedger field of the queued transaction, if any.
Definition: TxQ.h:219
SeqProxy seqProxy
SeqProxy of the transaction.
Definition: TxQ.h:227
TER preflightResult
The intermediate result returned by preflight before this transaction was queued, or after it is queu...
Definition: TxQ.h:245
TxConsequences consequences
Potential TxConsequences of applying the queued transaction to the open ledger.
Definition: TxQ.h:223
TxDetails(FeeLevel64 feeLevel_, std::optional< LedgerIndex > const &lastValid_, TxConsequences const &consequences_, AccountID const &account_, SeqProxy seqProxy_, std::shared_ptr< STTx const > const &txn_, int retriesRemaining_, TER preflightResult_, std::optional< TER > lastResult_)
Full initialization.
Definition: TxQ.h:194
AccountID account
The account the transaction is queued for.
Definition: TxQ.h:225
FeeLevel64 feeLevel
Fee level of the queued transaction.
Definition: TxQ.h:217
std::shared_ptr< STTx const > txn
The full transaction.
Definition: TxQ.h:229
std::optional< TER > lastResult
If the transactor attempted to apply the transaction to the open ledger from the queue and failed,...
Definition: TxQ.h:252
int retriesRemaining
Number of times the transactor can return a retry / ter result when attempting to apply this transact...
Definition: TxQ.h:235
T value_or(T... args)