20 #include <ripple/protocol/st.h>
21 #include <ripple/app/misc/FeeVote.h>
22 #include <ripple/app/main/Application.h>
23 #include <ripple/protocol/STValidation.h>
24 #include <ripple/basics/BasicConfig.h>
25 #include <ripple/beast/utility/Journal.h>
70 for (
auto const& [key, val] :
mVoteMap)
153 assert ((lastClosedLedger->info().seq % 256) == 0);
156 lastClosedLedger->fees().base,
160 lastClosedLedger->fees().accountReserve(0),
164 lastClosedLedger->fees().increment,
167 for (
auto const& val :
set)
169 if (val->isTrusted ())
174 auto const vote = val->getFieldU64 (
sfBaseFee);
178 unsafe_cast<XRPAmount::value_type>(vote)});
197 baseReserveVote.
noVote ();
215 lastClosedLedger->fees().base);
217 lastClosedLedger->fees().accountReserve(0));
219 lastClosedLedger->fees().increment);
221 auto const seq = lastClosedLedger->info().seq + 1;
224 if ((baseFee != lastClosedLedger->fees().base) ||
225 (baseReserve != lastClosedLedger->fees().accountReserve(0)) ||
226 (incReserve != lastClosedLedger->fees().increment))
229 "We are voting for a fee change: " << baseFee <<
230 "/" << baseReserve <<
234 [seq,baseFee,baseReserve,incReserve,feeUnits](
auto& obj)
244 uint256 txID = feeTx.getTransactionID ();
252 auto tItem = std::make_shared<SHAMapItem> (txID, s.
peekData ());
254 if (!initialPosition->addGiveItem (tItem,
true,
false))
257 "Ledger already had fee change";
270 if (
set(temp,
"reference_fee", section) &&
276 if (
set(temp,
"account_reserve", section))
278 if (
set(temp,
"owner_reserve", section))
287 return std::make_unique<FeeVoteImpl> (setup, journal);
FeeVote::Setup setup_FeeVote(Section const §ion)
Build FeeVote::Setup from a config section.
Holds a collection of configuration values.
XRPAmount owner_reserve
The per-owned item reserve requirement in drops.
void doValidation(std::shared_ptr< ReadView const > const &lastClosedLedger, STValidation::FeeSettings &fees) override
Add local fee preference to validation.
boost::optional< XRPAmount > reserveBase
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
std::unique_ptr< FeeVote > make_FeeVote(FeeVote::Setup const &setup, beast::Journal journal)
Create an instance of the FeeVote logic.
Manager to process fee votes.
XRPAmount reference_fee
The cost of a reference transaction in drops.
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Fee schedule to vote for.
VotableValue(value_type current, value_type target)
const SF_U32 sfReserveBase(access, STI_UINT32, 31, "ReserveBase")
void doVoting(std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< STValidation::pointer > const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition) override
Cast our local vote on the fee.
const value_type mCurrent
const beast::Journal journal_
XRPAmount account_reserve
The account reserve requirement in drops.
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
const SF_U32 sfLedgerSequence(access, STI_UINT32, 6, "LedgerSequence")
const SF_U32 sfReferenceFeeUnits(access, STI_UINT32, 30, "ReferenceFeeUnits")
FeeVoteImpl(Setup const &setup, beast::Journal journal)
@ current
This was a new validation and was added.
A generic endpoint for log messages.
static constexpr FeeUnit32 reference_fee_units
The cost of a reference transaction in fee units.
std::map< value_type, int > mVoteMap
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
value_type getVotes() const
boost::optional< XRPAmount > baseFee
const SF_U32 sfReserveIncrement(access, STI_UINT32, 32, "ReserveIncrement")
Blob const & peekData() const
boost::optional< XRPAmount > reserveIncrement
const SF_U64 sfBaseFee(access, STI_UINT64, 5, "BaseFee")
boost::optional< Dest > dropsAs() const
Fees to set when issuing a new validation.
void addVote(value_type vote)