rippled
Loading...
Searching...
No Matches
ConsensusParms.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012-2017 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_CONSENSUS_CONSENSUS_PARMS_H_INCLUDED
21#define RIPPLE_CONSENSUS_CONSENSUS_PARMS_H_INCLUDED
22
23#include <chrono>
24#include <cstddef>
25
26namespace ripple {
27
34{
35 explicit ConsensusParms() = default;
36
37 //-------------------------------------------------------------------------
38 // Validation and proposal durations are relative to NetClock times, so use
39 // second resolution
47
55
62
65
68
69 //-------------------------------------------------------------------------
70 // Consensus durations are relative to the internal Consensus clock and use
71 // millisecond resolution.
72
75
78
82
90
93
96
108
109 //------------------------------------------------------------------------------
110 // Avalanche tuning
111 // As a function of the percent this round's duration is of the prior round,
112 // we increase the threshold for yes votes to add a transaction to our
113 // position.
114
117
120
123
126
129
132
135
138};
139
140} // namespace ripple
141#endif
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
Consensus algorithm parameters.
std::size_t avINIT_CONSENSUS_PCT
Percentage of nodes on our UNL that must vote yes.
std::size_t minCONSENSUS_PCT
The percentage threshold above which we can declare consensus.
std::chrono::milliseconds ledgerMIN_CONSENSUS
The number of seconds we wait minimum to ensure participation.
std::chrono::milliseconds ledgerIDLE_INTERVAL
The duration a ledger may remain idle before closing.
std::chrono::milliseconds avMIN_CONSENSUS_TIME
The minimum amount of time to consider the previous round to have taken.
std::size_t avLATE_CONSENSUS_PCT
Percentage of nodes that most vote yes after advancing.
std::chrono::seconds validationVALID_LOCAL
Duration a validation remains current after first observed.
std::chrono::seconds validationVALID_WALL
The duration a validation remains current after its ledger's close time.
std::chrono::milliseconds ledgerGRANULARITY
How often we check state or change positions.
std::chrono::seconds validationVALID_EARLY
Duration pre-close in which validations are acceptable.
std::size_t avSTUCK_CONSENSUS_PCT
Percentage of nodes that must vote yes after we are stuck.
std::chrono::seconds proposeFRESHNESS
How long we consider a proposal fresh.
std::chrono::milliseconds ledgerMAX_CONSENSUS
The maximum amount of time to spend pausing for laggards.
std::size_t avLATE_CONSENSUS_TIME
Percentage of previous round duration before we advance.
std::chrono::milliseconds ledgerMIN_CLOSE
Minimum number of seconds to wait to ensure others have computed the LCL.
std::chrono::seconds proposeINTERVAL
How often we force generating a new proposal to keep ours fresh.
std::size_t avCT_CONSENSUS_PCT
Percentage of nodes required to reach agreement on ledger close time.
std::size_t avMID_CONSENSUS_PCT
Percentage of nodes that most vote yes after advancing.
std::size_t avSTUCK_CONSENSUS_TIME
Percentage of previous round duration before we are stuck.
std::size_t avMID_CONSENSUS_TIME
Percentage of previous round duration before we advance.