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
27#include <xrpl/protocol/RippleLedgerHash.h>
28#include <xrpl/protocol/STTx.h>
29#include <xrpl/protocol/SeqProxy.h>
30#include <xrpl/protocol/TER.h>
31
32#include <boost/circular_buffer.hpp>
33#include <boost/intrusive/set.hpp>
34
35#include <optional>
36
37namespace ripple {
38
39class Application;
40class Config;
41
60class TxQ
61{
62public:
64 static constexpr FeeLevel64 baseLevel{256};
65
69 struct Setup
70 {
72 explicit Setup() = default;
73
157 bool standAlone = false;
158 };
159
164 struct Metrics
165 {
167 explicit Metrics() = default;
168
187 };
188
195 {
198 FeeLevel64 feeLevel_,
199 std::optional<LedgerIndex> const& lastValid_,
200 TxConsequences const& consequences_,
201 AccountID const& account_,
202 SeqProxy seqProxy_,
203 std::shared_ptr<STTx const> const& txn_,
204 int retriesRemaining_,
205 TER preflightResult_,
206 std::optional<TER> lastResult_)
207 : feeLevel(feeLevel_)
208 , lastValid(lastValid_)
209 , consequences(consequences_)
210 , account(account_)
211 , seqProxy(seqProxy_)
212 , txn(txn_)
213 , retriesRemaining(retriesRemaining_)
214 , preflightResult(preflightResult_)
215 , lastResult(lastResult_)
216 {
217 }
218
256 };
257
259 TxQ(Setup const& setup, beast::Journal j);
260
262 virtual ~TxQ();
263
274 apply(
275 Application& app,
276 OpenView& view,
278 ApplyFlags flags,
280
292 bool
293 accept(Application& app, OpenView& view);
294
307 void
308 processClosedLedger(Application& app, ReadView const& view, bool timeLeap);
309
312 nextQueuableSeq(std::shared_ptr<SLE const> const& sleAccount) const;
313
316 Metrics
317 getMetrics(OpenView const& view) const;
318
320 {
324 };
325
337 OpenView const& view,
338 std::shared_ptr<STTx const> const& tx) const;
339
347 getAccountTxs(AccountID const& account) const;
348
356 getTxs() const;
357
363 doRPC(Application& app) const;
364
365private:
366 // Implementation for nextQueuableSeq(). The passed lock must be held.
369 std::shared_ptr<SLE const> const& sleAccount,
370 std::lock_guard<std::mutex> const&) const;
371
378 {
379 private:
393 boost::circular_buffer<std::size_t> recentTxnCounts_;
399
400 public:
404 setup.standAlone ? setup.minimumTxnInLedgerSA
405 : setup.minimumTxnInLedger)
407 setup.targetTxnInLedger < minimumTxnCount_
409 : setup.targetTxnInLedger)
411 setup.maximumTxnInLedger
412 ? *setup.maximumTxnInLedger < targetTxnCount_
414 : *setup.maximumTxnInLedger
415 : std::optional<std::size_t>(std::nullopt))
417 , recentTxnCounts_(setup.ledgersInQueue)
418 , escalationMultiplier_(setup.minimumEscalationMultiplier)
419 , j_(j)
420 {
421 }
422
434 update(
435 Application& app,
436 ReadView const& view,
437 bool timeLeap,
438 TxQ::Setup const& setup);
439
442 struct Snapshot
443 {
444 // Number of transactions expected per ledger.
445 // One more than this value will be accepted
446 // before escalation kicks in.
448 // Based on the median fee of the LCL. Used
449 // when fee escalation kicks in.
451 };
452
456 {
458 }
459
468 static FeeLevel64
469 scaleFeeLevel(Snapshot const& snapshot, OpenView const& view);
470
503 Snapshot const& snapshot,
504 OpenView const& view,
505 std::size_t extraCount,
506 std::size_t seriesSize);
507 };
508
514 {
515 public:
519 boost::intrusive::set_member_hook<> byFeeListHook;
520
523
527 TxID const txID;
565
580 static constexpr int retriesAllowed = 10;
581
591
592 public:
594 MaybeTx(
596 TxID const& txID,
598 ApplyFlags const flags,
600
604
607 TxConsequences const&
609 {
610 return pfresult->consequences;
611 }
612
616 {
617 return {
618 feeLevel,
619 lastValid,
620 consequences(),
621 account,
622 seqProxy,
623 txn,
625 pfresult->ter,
626 lastResult};
627 }
628 };
629
632 {
633 public:
635 explicit OrderCandidates() = default;
636
652 bool
653 operator()(MaybeTx const& lhs, MaybeTx const& rhs) const
654 {
655 if (lhs.feeLevel == rhs.feeLevel)
656 return (lhs.txID ^ MaybeTx::parentHashComp) <
658 return lhs.feeLevel > rhs.feeLevel;
659 }
660 };
661
666 {
667 public:
669
674 /* If this account has had any transaction retry more than
675 `retriesAllowed` times so that it was dropped from the
676 queue, then all other transactions for this account will
677 be given at most 2 attempts before being removed. Helps
678 prevent wasting resources on retries that are more likely
679 to fail.
680 */
681 bool retryPenalty = false;
682 /* If this account has had any transaction fail or expire,
683 then when the queue is nearly full, transactions from
684 this account will be discarded. Helps prevent the queue
685 from getting filled and wedged.
686 */
687 bool dropPenalty = false;
688
689 public:
691 explicit TxQAccount(std::shared_ptr<STTx const> const& txn);
693 explicit TxQAccount(AccountID const& account);
694
698 {
699 return transactions.size();
700 }
701
703 bool
704 empty() const
705 {
706 return !getTxnCount();
707 }
708
710 TxMap::const_iterator
711 getPrevTx(SeqProxy seqProx) const;
712
714 MaybeTx&
715 add(MaybeTx&&);
716
722 bool
723 remove(SeqProxy seqProx);
724 };
725
726 // Helper function returns requiredFeeLevel.
729 OpenView& view,
730 ApplyFlags flags,
731 FeeMetrics::Snapshot const& metricsSnapshot,
732 std::lock_guard<std::mutex> const& lock) const;
733
734 // Helper function for TxQ::apply. If a transaction's fee is high enough,
735 // attempt to directly apply that transaction to the ledger.
738 Application& app,
739 OpenView& view,
741 ApplyFlags flags,
743
744 // Helper function that removes a replaced entry in _byFee.
747 std::optional<TxQAccount::TxMap::iterator> const& replacedTxIter,
749
750 using FeeHook = boost::intrusive::member_hook<
751 MaybeTx,
752 boost::intrusive::set_member_hook<>,
754
755 using FeeMultiSet = boost::intrusive::
756 multiset<MaybeTx, FeeHook, boost::intrusive::compare<OrderCandidates>>;
757
759
764
790
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:149
A generic endpoint for log messages.
Definition: Journal.h:60
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:66
A view into a ledger.
Definition: ReadView.h:52
static std::uint64_t const 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:59
Track and use the fee escalation metrics of the current open ledger.
Definition: TxQ.h:378
std::size_t txnsExpected_
Number of transactions expected per ledger.
Definition: TxQ.h:390
beast::Journal const j_
Journal.
Definition: TxQ.h:398
FeeMetrics(Setup const &setup, beast::Journal j)
Constructor.
Definition: TxQ.h:402
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:173
std::size_t const minimumTxnCount_
Minimum value of txnsExpected.
Definition: TxQ.h:381
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:234
Snapshot getSnapshot() const
Get the current Snapshot.
Definition: TxQ.h:455
std::optional< std::size_t > const maximumTxnCount_
Maximum value of txnsExpected.
Definition: TxQ.h:386
std::size_t const targetTxnCount_
Number of transactions per ledger that fee escalation "works towards".
Definition: TxQ.h:384
boost::circular_buffer< std::size_t > recentTxnCounts_
Recent history of transaction counts that exceed the targetTxnCount_.
Definition: TxQ.h:393
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:84
FeeLevel64 escalationMultiplier_
Based on the median fee of the LCL.
Definition: TxQ.h:396
Represents a transaction in the queue which may be applied later to the open ledger.
Definition: TxQ.h:514
SeqProxy const seqProxy
Transaction SeqProxy number (sfSequence or sfTicketSequence field).
Definition: TxQ.h:535
ApplyResult apply(Application &app, OpenView &view, beast::Journal j)
Attempt to apply the queued transaction to the open ledger.
Definition: TxQ.cpp:298
ApplyFlags const flags
Flags provided to apply.
Definition: TxQ.h:548
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:519
int retriesRemaining
A transaction at the front of the queue will be given several attempts to succeed before being droppe...
Definition: TxQ.h:544
FeeLevel64 const feeLevel
Computed fee level that the transaction will pay.
Definition: TxQ.h:525
std::optional< PreflightResult const > pfresult
Cached result of the preflight operation.
Definition: TxQ.h:564
static constexpr int retriesAllowed
Starting retry count for newly queued transactions.
Definition: TxQ.h:580
AccountID const account
Account submitting the transaction.
Definition: TxQ.h:529
TxDetails getTxDetails() const
Return a TxDetails based on contained information.
Definition: TxQ.h:615
std::shared_ptr< STTx const > txn
The complete transaction.
Definition: TxQ.h:522
std::optional< LedgerIndex > const lastValid
Expiration ledger for the transaction (sfLastLedgerSequence field).
Definition: TxQ.h:532
TxID const txID
Transaction ID.
Definition: TxQ.h:527
static LedgerHash parentHashComp
The hash of the parent ledger.
Definition: TxQ.h:590
std::optional< TER > lastResult
If the transactor attempted to apply the transaction to the open ledger from the queue and failed,...
Definition: TxQ.h:555
TxConsequences const & consequences() const
Potential TxConsequences of applying this transaction to the open ledger.
Definition: TxQ.h:608
Used for sorting MaybeTx.
Definition: TxQ.h:632
OrderCandidates()=default
Default constructor.
bool operator()(MaybeTx const &lhs, MaybeTx const &rhs) const
Sort MaybeTx by feeLevel descending, then by pseudo-randomized transaction ID ascending.
Definition: TxQ.h:653
Used to represent an account to the queue, and stores the transactions queued for that account by Seq...
Definition: TxQ.h:666
TxMap transactions
Sequence number will be used as the key.
Definition: TxQ.h:673
std::size_t getTxnCount() const
Return the number of transactions currently queued for this account.
Definition: TxQ.h:697
AccountID const account
The account.
Definition: TxQ.h:671
TxMap::const_iterator getPrevTx(SeqProxy seqProx) const
Find the entry in transactions that precedes seqProx, if one does.
Definition: TxQ.cpp:331
bool remove(SeqProxy seqProx)
Remove the candidate with given SeqProxy value from this account.
Definition: TxQ.cpp:357
MaybeTx & add(MaybeTx &&)
Add a transaction candidate to this account for queuing.
Definition: TxQ.cpp:342
bool empty() const
Checks if this account has no transactions queued.
Definition: TxQ.h:704
Transaction Queue.
Definition: TxQ.h:61
boost::intrusive::multiset< MaybeTx, FeeHook, boost::intrusive::compare< OrderCandidates > > FeeMultiSet
Definition: TxQ.h:756
std::vector< TxDetails > getTxs() const
Returns information about all transactions currently in the queue.
Definition: TxQ.cpp:1845
std::optional< TxQAccount::TxMap::iterator > removeFromByFee(std::optional< TxQAccount::TxMap::iterator > const &replacedTxIter, std::shared_ptr< STTx const > const &tx)
Definition: TxQ.cpp:1750
std::optional< size_t > maxSize_
Maximum number of transactions allowed in the queue based on the current metrics.
Definition: TxQ.h:789
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:1778
Json::Value doRPC(Application &app) const
Summarize current fee metrics for the fee RPC command.
Definition: TxQ.cpp:1860
FeeMultiSet byFee_
The queue itself: the collection of transactions ordered by fee level.
Definition: TxQ.h:775
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1824
beast::Journal const j_
Journal.
Definition: TxQ.h:763
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:384
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:1609
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:782
boost::intrusive::member_hook< MaybeTx, boost::intrusive::set_member_hook<>, &MaybeTx::byFeeListHook > FeeHook
Definition: TxQ.h:753
LedgerHash parentHash_
parentHash_ used for logging only
Definition: TxQ.h:794
SeqProxy nextQueuableSeqImpl(std::shared_ptr< SLE const > const &sleAccount, std::lock_guard< std::mutex > const &) const
Definition: TxQ.cpp:1622
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:518
bool isFull() const
Is the queue at least fillPercentage full?
Definition: TxQ.cpp:376
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:1800
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:466
FeeMetrics feeMetrics_
Tracks the current state of the queue.
Definition: TxQ.h:769
virtual ~TxQ()
Destructor.
Definition: TxQ.cpp:369
FeeLevel64 getRequiredFeeLevel(OpenView &view, ApplyFlags flags, FeeMetrics::Snapshot const &metricsSnapshot, std::lock_guard< std::mutex > const &lock) const
Definition: TxQ.cpp:1669
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:1435
static constexpr FeeLevel64 baseLevel
Fee level for single-signed reference transaction.
Definition: TxQ.h:64
Setup const setup_
Setup parameters used to control the behavior of the queue.
Definition: TxQ.h:761
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:1366
std::optional< ApplyResult > tryDirectApply(Application &app, OpenView &view, std::shared_ptr< STTx const > const &tx, ApplyFlags flags, beast::Journal j)
Definition: TxQ.cpp:1679
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:730
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition: TxQ.cpp:1915
FeeLevel64 toFeeLevel(XRPAmount const &drops, XRPAmount const &baseFee)
Definition: TxQ.h:870
FeeLevel< std::uint64_t > FeeLevel64
Definition: FeeUnits.h:468
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.
ApplyFlags
Definition: ApplyView.h:31
STL namespace.
T size(T... args)
Describes the results of the preflight check.
Definition: applySteps.h:164
XRPAmount fee
Definition: TxQ.h:321
std::uint32_t availableSeq
Definition: TxQ.h:323
std::uint32_t accountSeq
Definition: TxQ.h:322
Snapshot of the externally relevant FeeMetrics fields at any given time.
Definition: TxQ.h:443
std::size_t const txnsExpected
Definition: TxQ.h:447
FeeLevel64 const escalationMultiplier
Definition: TxQ.h:450
Structure returned by TxQ::getMetrics, expressed in reference fee level units.
Definition: TxQ.h:165
FeeLevel64 minProcessingFeeLevel
Minimum fee level for a transaction to be considered for the open ledger or the queue.
Definition: TxQ.h:181
FeeLevel64 openLedgerFeeLevel
Minimum fee level to get into the current open ledger, bypassing the queue.
Definition: TxQ.h:186
std::size_t txPerLedger
Number of transactions expected per ledger.
Definition: TxQ.h:176
Metrics()=default
Default constructor.
std::optional< std::size_t > txQMaxSize
Max transactions currently allowed in queue.
Definition: TxQ.h:172
FeeLevel64 referenceFeeLevel
Reference transaction fee level.
Definition: TxQ.h:178
std::size_t txInLedger
Number of transactions currently in the open ledger.
Definition: TxQ.h:174
std::size_t txCount
Number of transactions in the queue.
Definition: TxQ.h:170
FeeLevel64 medFeeLevel
Median fee level of the last ledger.
Definition: TxQ.h:183
Structure used to customize TxQ behavior.
Definition: TxQ.h:70
std::uint32_t slowConsensusDecreasePercent
When consensus takes longer than appropriate, the expected ledger size is updated to the lesser of th...
Definition: TxQ.h:146
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:103
std::uint32_t maximumTxnPerAccount
Maximum number of transactions that can be queued by one account.
Definition: TxQ.h:148
FeeLevel64 minimumEscalationMultiplier
Minimum value of the escalation multiplier, regardless of the prior ledger's median fee level.
Definition: TxQ.h:100
std::size_t queueSizeMin
The smallest limit the queue is allowed.
Definition: TxQ.h:87
std::optional< std::uint32_t > maximumTxnInLedger
Optional maximum allowed value of transactions per ledger before fee escalation kicks in.
Definition: TxQ.h:120
std::uint32_t targetTxnInLedger
Number of transactions per ledger that fee escalation "works towards".
Definition: TxQ.h:109
std::uint32_t retrySequencePercent
Extra percentage required on the fee level of a queued transaction to replace that transaction with a...
Definition: TxQ.h:97
std::uint32_t minimumLastLedgerBuffer
Minimum difference between the current ledger sequence and a transaction's LastLedgerSequence for the...
Definition: TxQ.h:155
std::uint32_t minimumTxnInLedgerSA
Like minimumTxnInLedger for standalone mode.
Definition: TxQ.h:106
std::size_t ledgersInQueue
Number of ledgers' worth of transactions to allow in the queue.
Definition: TxQ.h:81
bool standAlone
Use standalone mode behavior.
Definition: TxQ.h:157
std::uint32_t normalConsensusIncreasePercent
When the ledger has more transactions than "expected", and performance is humming along nicely,...
Definition: TxQ.h:132
Structure that describes a transaction in the queue waiting to be applied to the current open ledger.
Definition: TxQ.h:195
std::optional< LedgerIndex > lastValid
LastValidLedger field of the queued transaction, if any.
Definition: TxQ.h:222
SeqProxy seqProxy
SeqProxy of the transaction.
Definition: TxQ.h:230
TER preflightResult
The intermediate result returned by preflight before this transaction was queued, or after it is queu...
Definition: TxQ.h:248
TxConsequences consequences
Potential TxConsequences of applying the queued transaction to the open ledger.
Definition: TxQ.h:226
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:197
AccountID account
The account the transaction is queued for.
Definition: TxQ.h:228
FeeLevel64 feeLevel
Fee level of the queued transaction.
Definition: TxQ.h:220
std::shared_ptr< STTx const > txn
The full transaction.
Definition: TxQ.h:232
std::optional< TER > lastResult
If the transactor attempted to apply the transaction to the open ledger from the queue and failed,...
Definition: TxQ.h:255
int retriesRemaining
Number of times the transactor can return a retry / ter result when attempting to apply this transact...
Definition: TxQ.h:238
T value_or(T... args)