20 #ifndef RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED
21 #define RIPPLE_APP_MISC_AMENDMENTTABLE_H_INCLUDED
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/core/ConfigSections.h>
25 #include <ripple/protocol/Feature.h>
26 #include <ripple/protocol/Protocol.h>
27 #include <ripple/protocol/STValidation.h>
97 lastValidatedLedger->seq(),
150 lastClosedLedger->rules(),
151 lastClosedLedger->parentCloseTime(),
157 for (
auto const& it : actions)
161 [&it, seq = lastClosedLedger->seq() + 1](
auto& obj) {
162 obj.setAccountID(sfAccount, AccountID());
163 obj.setFieldH256(sfAmendment, it.first);
164 obj.setFieldU32(sfLedgerSequence, seq);
167 obj.setFieldU32(sfFlags, it.second);
173 initialPosition->addGiveItem(
185 Section
const& enabled,
186 Section
const& vetoed,
majorityAmendments_t getMajorityAmendments(ReadView const &view)
std::set< uint256 > getEnabledAmendments(ReadView const &view)
virtual std::map< uint256, std::uint32_t > doVoting(Rules const &rules, NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< std::shared_ptr< STValidation >> const &valSet)=0
virtual bool veto(uint256 const &amendment)=0
virtual uint256 find(std::string const &name) const =0
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
void doVoting(std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< std::shared_ptr< STValidation >> const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition)
void doValidatedLedger(std::shared_ptr< ReadView const > const &lastValidatedLedger)
Called when a new fully-validated ledger is accepted.
virtual Json::Value getJson() const =0
@ ttAMENDMENT
This system-generated transaction type is used to update the status of the various amendments.
virtual std::vector< uint256 > doValidation(std::set< uint256 > const &enabled) const =0
virtual bool unVeto(uint256 const &amendment)=0
virtual ~AmendmentTable()=default
virtual std::optional< NetClock::time_point > firstUnsupportedExpected() const =0
virtual bool isEnabled(uint256 const &amendment) const =0
Slice slice() const noexcept
A generic endpoint for log messages.
virtual bool enable(uint256 const &amendment)=0
uint256 getTransactionID() const
virtual bool hasUnsupportedEnabled() const =0
returns true if one or more amendments on the network have been enabled that this server does not sup...
virtual bool isSupported(uint256 const &amendment) const =0
void add(Serializer &s) const override
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Rules controlling protocol behavior.
std::unique_ptr< AmendmentTable > make_AmendmentTable(Application &app, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
FeatureInfo(std::string const &n, uint256 const &f, VoteBehavior v)
The amendment table stores the list of enabled and potential amendments.
virtual bool needValidatedLedger(LedgerIndex seq) const =0
Called to determine whether the amendment logic needs to process a new validated ledger.
virtual std::vector< uint256 > getDesired() const =0