rippled
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
xrpl::ConsensusParms Struct Reference

Consensus algorithm parameters. More...

#include <ConsensusParms.h>

Collaboration diagram for xrpl::ConsensusParms:
Collaboration graph
[legend]

Classes

struct  AvalancheCutoff
 

Public Types

enum  AvalancheState { init , mid , late , stuck }
 

Public Member Functions

 ConsensusParms ()=default
 

Public Attributes

std::chrono::seconds const validationVALID_WALL = std::chrono::minutes{5}
 The duration a validation remains current after its ledger's close time.
 
std::chrono::seconds const validationVALID_LOCAL = std::chrono::minutes{3}
 Duration a validation remains current after first observed.
 
std::chrono::seconds const validationVALID_EARLY = std::chrono::minutes{3}
 Duration pre-close in which validations are acceptable.
 
std::chrono::seconds const proposeFRESHNESS = std::chrono::seconds{20}
 How long we consider a proposal fresh.
 
std::chrono::seconds const proposeINTERVAL = std::chrono::seconds{12}
 How often we force generating a new proposal to keep ours fresh.
 
std::size_t const minCONSENSUS_PCT = 80
 The percentage threshold above which we can declare consensus.
 
std::chrono::milliseconds const ledgerIDLE_INTERVAL = std::chrono::seconds{15}
 The duration a ledger may remain idle before closing.
 
std::chrono::milliseconds const ledgerMIN_CONSENSUS = std::chrono::milliseconds{1950}
 The number of seconds we wait minimum to ensure participation.
 
std::chrono::milliseconds const ledgerMAX_CONSENSUS = std::chrono::seconds{15}
 The maximum amount of time to spend pausing for laggards.
 
std::chrono::milliseconds const ledgerMIN_CLOSE = std::chrono::seconds{2}
 Minimum number of seconds to wait to ensure others have computed the LCL.
 
std::chrono::milliseconds const ledgerGRANULARITY = std::chrono::seconds{1}
 How often we check state or change positions.
 
std::size_t const ledgerABANDON_CONSENSUS_FACTOR = 10
 How long to wait before completely abandoning consensus.
 
std::chrono::milliseconds const ledgerABANDON_CONSENSUS = std::chrono::seconds{120}
 Maximum amount of time to give a consensus round.
 
std::chrono::milliseconds const avMIN_CONSENSUS_TIME = std::chrono::seconds{5}
 The minimum amount of time to consider the previous round to have taken.
 
std::map< AvalancheState, AvalancheCutoff > const avalancheCutoffs
 Map the consensus requirement avalanche state to the amount of time that must pass before moving to that state, the agreement percentage required at that state, and the next state.
 
std::size_t const avCT_CONSENSUS_PCT = 75
 Percentage of nodes required to reach agreement on ledger close time.
 
std::size_t const avMIN_ROUNDS = 2
 Number of rounds before certain actions can happen.
 
std::size_t const avSTALLED_ROUNDS = 4
 Number of rounds before a stuck vote is considered unlikely to change because voting stalled.
 

Detailed Description

Consensus algorithm parameters.

Parameters which control the consensus algorithm. This are not meant to be changed arbitrarily.

Definition at line 18 of file ConsensusParms.h.

Member Enumeration Documentation

◆ AvalancheState

Enumerator
init 
mid 
late 
stuck 

Definition at line 109 of file ConsensusParms.h.

Constructor & Destructor Documentation

◆ ConsensusParms()

xrpl::ConsensusParms::ConsensusParms ( )
explicitdefault

Member Data Documentation

◆ validationVALID_WALL

std::chrono::seconds const xrpl::ConsensusParms::validationVALID_WALL = std::chrono::minutes{5}

The duration a validation remains current after its ledger's close time.

This is a safety to protect against very old validations and the time it takes to adjust the close time accuracy window.

Definition at line 31 of file ConsensusParms.h.

◆ validationVALID_LOCAL

std::chrono::seconds const xrpl::ConsensusParms::validationVALID_LOCAL = std::chrono::minutes{3}

Duration a validation remains current after first observed.

The duration a validation remains current after the time we first saw it. This provides faster recovery in very rare cases where the number of validations produced by the network is lower than normal

Definition at line 39 of file ConsensusParms.h.

◆ validationVALID_EARLY

std::chrono::seconds const xrpl::ConsensusParms::validationVALID_EARLY = std::chrono::minutes{3}

Duration pre-close in which validations are acceptable.

The number of seconds before a close time that we consider a validation acceptable. This protects against extreme clock errors

Definition at line 46 of file ConsensusParms.h.

◆ proposeFRESHNESS

std::chrono::seconds const xrpl::ConsensusParms::proposeFRESHNESS = std::chrono::seconds{20}

How long we consider a proposal fresh.

Definition at line 49 of file ConsensusParms.h.

◆ proposeINTERVAL

std::chrono::seconds const xrpl::ConsensusParms::proposeINTERVAL = std::chrono::seconds{12}

How often we force generating a new proposal to keep ours fresh.

Definition at line 52 of file ConsensusParms.h.

◆ minCONSENSUS_PCT

std::size_t const xrpl::ConsensusParms::minCONSENSUS_PCT = 80

The percentage threshold above which we can declare consensus.

Definition at line 59 of file ConsensusParms.h.

◆ ledgerIDLE_INTERVAL

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerIDLE_INTERVAL = std::chrono::seconds{15}

The duration a ledger may remain idle before closing.

Definition at line 62 of file ConsensusParms.h.

◆ ledgerMIN_CONSENSUS

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerMIN_CONSENSUS = std::chrono::milliseconds{1950}

The number of seconds we wait minimum to ensure participation.

Definition at line 65 of file ConsensusParms.h.

◆ ledgerMAX_CONSENSUS

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerMAX_CONSENSUS = std::chrono::seconds{15}

The maximum amount of time to spend pausing for laggards.

This should be sufficiently less than validationFRESHNESS so that validators don't appear to be offline that are merely waiting for laggards.

Definition at line 73 of file ConsensusParms.h.

◆ ledgerMIN_CLOSE

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerMIN_CLOSE = std::chrono::seconds{2}

Minimum number of seconds to wait to ensure others have computed the LCL.

Definition at line 76 of file ConsensusParms.h.

◆ ledgerGRANULARITY

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerGRANULARITY = std::chrono::seconds{1}

How often we check state or change positions.

Definition at line 79 of file ConsensusParms.h.

◆ ledgerABANDON_CONSENSUS_FACTOR

std::size_t const xrpl::ConsensusParms::ledgerABANDON_CONSENSUS_FACTOR = 10

How long to wait before completely abandoning consensus.

Definition at line 82 of file ConsensusParms.h.

◆ ledgerABANDON_CONSENSUS

std::chrono::milliseconds const xrpl::ConsensusParms::ledgerABANDON_CONSENSUS = std::chrono::seconds{120}

Maximum amount of time to give a consensus round.

Does not include the time to build the LCL, so there is no reason for a round to go this long, regardless of how big the ledger is.

Definition at line 90 of file ConsensusParms.h.

◆ avMIN_CONSENSUS_TIME

std::chrono::milliseconds const xrpl::ConsensusParms::avMIN_CONSENSUS_TIME = std::chrono::seconds{5}

The minimum amount of time to consider the previous round to have taken.

The minimum amount of time to consider the previous round to have taken. This ensures that there is an opportunity for a round at each avalanche threshold even if the previous consensus was very fast. This should be at least twice the interval between proposals (0.7s) divided by the interval between mid and late consensus ([85-50]/100).

Definition at line 102 of file ConsensusParms.h.

◆ avalancheCutoffs

std::map<AvalancheState, AvalancheCutoff> const xrpl::ConsensusParms::avalancheCutoffs
Initial value:

Map the consensus requirement avalanche state to the amount of time that must pass before moving to that state, the agreement percentage required at that state, and the next state.

"stuck" loops back on itself because once we're stuck, we're stuck. This structure allows for "looping" of states if needed.

Definition at line 121 of file ConsensusParms.h.

◆ avCT_CONSENSUS_PCT

std::size_t const xrpl::ConsensusParms::avCT_CONSENSUS_PCT = 75

Percentage of nodes required to reach agreement on ledger close time.

Definition at line 135 of file ConsensusParms.h.

◆ avMIN_ROUNDS

std::size_t const xrpl::ConsensusParms::avMIN_ROUNDS = 2

Number of rounds before certain actions can happen.

Definition at line 140 of file ConsensusParms.h.

◆ avSTALLED_ROUNDS

std::size_t const xrpl::ConsensusParms::avSTALLED_ROUNDS = 4

Number of rounds before a stuck vote is considered unlikely to change because voting stalled.

Definition at line 144 of file ConsensusParms.h.