3#include <xrpl/beast/utility/instrumentation.h>
163 if (currentCutoff.next != currentState && currentRounds >= minimumRounds)
170 nextCutoff.consensusTime >= currentCutoff.consensusTime,
171 "xrpl::getNeededWeight : next state valid");
172 if (percentTime >= nextCutoff.consensusTime)
174 return {nextCutoff.consensusPct, currentCutoff.next};
177 return {currentCutoff.consensusPct, {}};
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::pair< std::size_t, std::optional< ConsensusParms::AvalancheState > > getNeededWeight(ConsensusParms const &p, ConsensusParms::AvalancheState currentState, int percentTime, std::size_t currentRounds, std::size_t minimumRounds)
std::size_t const consensusPct
AvalancheState const next
Consensus algorithm parameters.
std::chrono::milliseconds const ledgerMinClose
Minimum number of seconds to wait to ensure others have computed the LCL.
std::size_t const avCtConsensusPct
Percentage of nodes required to reach agreement on ledger close time.
std::chrono::milliseconds const ledgerAbandonConsensus
Maximum amount of time to give a consensus round.
std::chrono::milliseconds const ledgerMinConsensus
The number of seconds we wait minimum to ensure participation.
std::size_t const avMinRounds
Number of rounds before certain actions can happen.
std::chrono::seconds const proposeFRESHNESS
How long we consider a proposal fresh.
std::chrono::milliseconds const ledgerGRANULARITY
How often we check state or change positions.
std::chrono::seconds const validationValidWall
The duration a validation remains current after its ledger's close time.
std::chrono::seconds const proposeINTERVAL
How often we force generating a new proposal to keep ours fresh.
std::chrono::seconds const validationValidEarly
Duration pre-close in which validations are acceptable.
std::chrono::milliseconds const ledgerMaxConsensus
The maximum amount of time to spend pausing for laggards.
std::size_t const avStalledRounds
std::map< AvalancheState, AvalancheCutoff > const avalancheCutoffs
std::size_t const minConsensusPct
The percentage threshold above which we can declare consensus.
std::chrono::milliseconds const avMinConsensusTime
The minimum amount of time to consider the previous round to have taken.
std::chrono::seconds const validationValidLocal
Duration a validation remains current after first observed.
std::size_t const ledgerAbandonConsensusFactor
How long to wait before completely abandoning consensus.
std::chrono::milliseconds const ledgerIdleInterval
The duration a ledger may remain idle before closing.