rippled
|
Track and use the fee escalation metrics of the current open ledger. More...
Classes | |
struct | Snapshot |
Snapshot of the externally relevant FeeMetrics fields at any given time. More... | |
Public Member Functions | |
FeeMetrics (Setup const &setup, beast::Journal j) | |
Constructor. More... | |
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. More... | |
Snapshot | getSnapshot () const |
Get the current Snapshot. More... | |
Static Public Member Functions | |
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 pay to bypass the queue. More... | |
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. More... | |
Private Attributes | |
const std::size_t | minimumTxnCount_ |
Minimum value of txnsExpected. More... | |
const std::size_t | targetTxnCount_ |
Number of transactions per ledger that fee escalation "works
towards". More... | |
const std::optional< std::size_t > | maximumTxnCount_ |
Maximum value of txnsExpected. More... | |
std::size_t | txnsExpected_ |
Number of transactions expected per ledger. More... | |
boost::circular_buffer< std::size_t > | recentTxnCounts_ |
Recent history of transaction counts that exceed the targetTxnCount_. More... | |
FeeLevel64 | escalationMultiplier_ |
Based on the median fee of the LCL. More... | |
const beast::Journal | j_ |
Journal. More... | |
Track and use the fee escalation metrics of the current open ledger.
Does the work of scaling fees as the open ledger grows.
ripple::TxQ::FeeMetrics::FeeMetrics | ( | Setup const & | setup, |
beast::Journal | j | ||
) |
std::size_t ripple::TxQ::FeeMetrics::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.
app | Rippled Application object. |
view | View of the LCL that was just closed or received. |
timeLeap | Indicates that rippled is under load so fees should grow faster. |
setup | Customization params. |
Snapshot ripple::TxQ::FeeMetrics::getSnapshot | ( | ) | const |
|
static |
|
static |
Computes the total fee level for all transactions in a series.
Assumes that there are already more than txnsExpected_ txns between the view and extraCount
. If there aren't, the result will be sensible (e.g. there won't be any underflows or overflows), but the level will be higher than actually required.
view | Current open / working ledger. (May be a sandbox.) |
extraCount | Number of additional transactions to count as in the ledger. (If view is a sandbox, should be the number of transactions in the parent ledger.) |
seriesSize | Total number of transactions in the series to be processed. |
std::pair
as returned from mulDiv
indicating whether the calculation result overflows.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |