rippled
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ripple::AmendmentTableImpl Class Referencefinal

Track the list of "amendments". More...

Inheritance diagram for ripple::AmendmentTableImpl:
Inheritance graph
[legend]
Collaboration diagram for ripple::AmendmentTableImpl:
Collaboration graph
[legend]

Public Member Functions

 AmendmentTableImpl (std::chrono::seconds majorityTime, int majorityFraction, Section const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
 
uint256 find (std::string const &name) override
 
bool veto (uint256 const &amendment) override
 
bool unVeto (uint256 const &amendment) override
 
bool enable (uint256 const &amendment) override
 
bool disable (uint256 const &amendment) override
 
bool isEnabled (uint256 const &amendment) override
 
bool isSupported (uint256 const &amendment) override
 
bool hasUnsupportedEnabled () override
 returns true if one or more amendments on the network have been enabled that this server does not support More...
 
boost::optional< NetClock::time_pointfirstUnsupportedExpected () override
 
Json::Value getJson (int) override
 
Json::Value getJson (uint256 const &) override
 Returns a Json::objectValue. More...
 
bool needValidatedLedger (LedgerIndex seq) override
 Called to determine whether the amendment logic needs to process a new validated ledger. More...
 
void doValidatedLedger (LedgerIndex seq, std::set< uint256 > const &enabled, majorityAmendments_t const &majority) override
 
std::vector< uint256doValidation (std::set< uint256 > const &enabledAmendments) override
 
std::vector< uint256getDesired () override
 
std::map< uint256, std::uint32_tdoVoting (NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< STValidation::pointer > const &validations) override
 
void doValidatedLedger (std::shared_ptr< ReadView const > const &lastValidatedLedger)
 Called when a new fully-validated ledger is accepted. More...
 
void doVoting (std::shared_ptr< ReadView const > const &lastClosedLedger, std::vector< STValidation::pointer > const &parentValidations, std::shared_ptr< SHAMap > const &initialPosition)
 

Protected Member Functions

AmendmentStateadd (uint256 const &amendment)
 
AmendmentStateget (uint256 const &amendment)
 
void setJson (Json::Value &v, uint256 const &amendment, const AmendmentState &)
 

Protected Attributes

std::mutex mutex_
 
hash_map< uint256, AmendmentStateamendmentMap_
 
std::uint32_t lastUpdateSeq_
 
const std::chrono::seconds majorityTime_
 
const int majorityFraction_
 
std::unique_ptr< AmendmentSetlastVote_
 
bool unsupportedEnabled_
 
boost::optional< NetClock::time_pointfirstUnsupportedExpected_
 
const beast::Journal j_
 

Detailed Description

Track the list of "amendments".

An "amendment" is an option that can affect transaction processing rules. Amendments are proposed and then adopted or rejected by the network. An Amendment is uniquely identified by its AmendmentID, a 256-bit key.

Definition at line 139 of file AmendmentTable.cpp.

Constructor & Destructor Documentation

◆ AmendmentTableImpl()

ripple::AmendmentTableImpl::AmendmentTableImpl ( std::chrono::seconds  majorityTime,
int  majorityFraction,
Section const &  supported,
Section const &  enabled,
Section const &  vetoed,
beast::Journal  journal 
)

Definition at line 240 of file AmendmentTable.cpp.

Member Function Documentation

◆ add()

AmendmentState * ripple::AmendmentTableImpl::add ( uint256 const &  amendment)
protected

Definition at line 300 of file AmendmentTable.cpp.

◆ get()

AmendmentState * ripple::AmendmentTableImpl::get ( uint256 const &  amendment)
protected

Definition at line 307 of file AmendmentTable.cpp.

◆ setJson()

void ripple::AmendmentTableImpl::setJson ( Json::Value v,
uint256 const &  amendment,
const AmendmentState fs 
)
protected

Definition at line 594 of file AmendmentTable.cpp.

◆ find()

uint256 ripple::AmendmentTableImpl::find ( std::string const &  name)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 319 of file AmendmentTable.cpp.

◆ veto()

bool ripple::AmendmentTableImpl::veto ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 333 of file AmendmentTable.cpp.

◆ unVeto()

bool ripple::AmendmentTableImpl::unVeto ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 345 of file AmendmentTable.cpp.

◆ enable()

bool ripple::AmendmentTableImpl::enable ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 357 of file AmendmentTable.cpp.

◆ disable()

bool ripple::AmendmentTableImpl::disable ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 378 of file AmendmentTable.cpp.

◆ isEnabled()

bool ripple::AmendmentTableImpl::isEnabled ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 391 of file AmendmentTable.cpp.

◆ isSupported()

bool ripple::AmendmentTableImpl::isSupported ( uint256 const &  amendment)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 399 of file AmendmentTable.cpp.

◆ hasUnsupportedEnabled()

bool ripple::AmendmentTableImpl::hasUnsupportedEnabled ( )
overridevirtual

returns true if one or more amendments on the network have been enabled that this server does not support

Returns
true if an unsupported feature is enabled on the network

Implements ripple::AmendmentTable.

Definition at line 407 of file AmendmentTable.cpp.

◆ firstUnsupportedExpected()

boost::optional< NetClock::time_point > ripple::AmendmentTableImpl::firstUnsupportedExpected ( )
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 414 of file AmendmentTable.cpp.

◆ getJson() [1/2]

Json::Value ripple::AmendmentTableImpl::getJson ( int  )
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 624 of file AmendmentTable.cpp.

◆ getJson() [2/2]

Json::Value ripple::AmendmentTableImpl::getJson ( uint256 const &  )
overridevirtual

Returns a Json::objectValue.

Implements ripple::AmendmentTable.

Definition at line 639 of file AmendmentTable.cpp.

◆ needValidatedLedger()

bool ripple::AmendmentTableImpl::needValidatedLedger ( LedgerIndex  seq)
overridevirtual

Called to determine whether the amendment logic needs to process a new validated ledger.

(If it could have changed things.)

Implements ripple::AmendmentTable.

Definition at line 550 of file AmendmentTable.cpp.

◆ doValidatedLedger() [1/2]

void ripple::AmendmentTableImpl::doValidatedLedger ( LedgerIndex  seq,
std::set< uint256 > const &  enabled,
majorityAmendments_t const &  majority 
)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 561 of file AmendmentTable.cpp.

◆ doValidation()

std::vector< uint256 > ripple::AmendmentTableImpl::doValidation ( std::set< uint256 > const &  enabledAmendments)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 421 of file AmendmentTable.cpp.

◆ getDesired()

std::vector< uint256 > ripple::AmendmentTableImpl::getDesired ( )
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 447 of file AmendmentTable.cpp.

◆ doVoting() [1/2]

std::map< uint256, std::uint32_t > ripple::AmendmentTableImpl::doVoting ( NetClock::time_point  closeTime,
std::set< uint256 > const &  enabledAmendments,
majorityAmendments_t const &  majorityAmendments,
std::vector< STValidation::pointer > const &  validations 
)
overridevirtual

Implements ripple::AmendmentTable.

Definition at line 454 of file AmendmentTable.cpp.

◆ doValidatedLedger() [2/2]

void ripple::AmendmentTable::doValidatedLedger ( std::shared_ptr< ReadView const > const &  lastValidatedLedger)
inherited

Called when a new fully-validated ledger is accepted.

Definition at line 77 of file AmendmentTable.h.

◆ doVoting() [2/2]

void ripple::AmendmentTable::doVoting ( std::shared_ptr< ReadView const > const &  lastClosedLedger,
std::vector< STValidation::pointer > const &  parentValidations,
std::shared_ptr< SHAMap > const &  initialPosition 
)
inherited

Definition at line 127 of file AmendmentTable.h.

Member Data Documentation

◆ mutex_

std::mutex ripple::AmendmentTableImpl::mutex_
protected

Definition at line 142 of file AmendmentTable.cpp.

◆ amendmentMap_

hash_map<uint256, AmendmentState> ripple::AmendmentTableImpl::amendmentMap_
protected

Definition at line 144 of file AmendmentTable.cpp.

◆ lastUpdateSeq_

std::uint32_t ripple::AmendmentTableImpl::lastUpdateSeq_
protected

Definition at line 145 of file AmendmentTable.cpp.

◆ majorityTime_

const std::chrono::seconds ripple::AmendmentTableImpl::majorityTime_
protected

Definition at line 148 of file AmendmentTable.cpp.

◆ majorityFraction_

const int ripple::AmendmentTableImpl::majorityFraction_
protected

Definition at line 152 of file AmendmentTable.cpp.

◆ lastVote_

std::unique_ptr<AmendmentSet> ripple::AmendmentTableImpl::lastVote_
protected

Definition at line 156 of file AmendmentTable.cpp.

◆ unsupportedEnabled_

bool ripple::AmendmentTableImpl::unsupportedEnabled_
protected

Definition at line 159 of file AmendmentTable.cpp.

◆ firstUnsupportedExpected_

boost::optional<NetClock::time_point> ripple::AmendmentTableImpl::firstUnsupportedExpected_
protected

Definition at line 163 of file AmendmentTable.cpp.

◆ j_

const beast::Journal ripple::AmendmentTableImpl::j_
protected

Definition at line 165 of file AmendmentTable.cpp.