|
23 | 23 | namespace ripple {
|
24 | 24 |
|
25 | 25 | // The number of seconds a ledger may remain idle before closing
|
26 |
| -# define LEDGER_IDLE_INTERVAL 15 |
| 26 | +const int LEDGER_IDLE_INTERVAL = 15; |
27 | 27 |
|
28 | 28 | // The number of seconds a validation remains current after its ledger's close time
|
29 | 29 | // This is a safety to protect against very old validations and the time it takes to adjust
|
30 | 30 | // the close time accuracy window
|
31 |
| -# define LEDGER_VAL_INTERVAL 300 |
| 31 | +const int LEDGER_VAL_INTERVAL = 300; |
32 | 32 |
|
33 | 33 | // The number of seconds before a close time that we consider a validation acceptable
|
34 | 34 | // This protects against extreme clock errors
|
35 |
| -# define LEDGER_EARLY_INTERVAL 180 |
| 35 | +const int LEDGER_EARLY_INTERVAL = 180; |
36 | 36 |
|
37 | 37 | // The number of milliseconds we wait minimum to ensure participation
|
38 |
| -# define LEDGER_MIN_CONSENSUS 2000 |
| 38 | +const int LEDGER_MIN_CONSENSUS = 2000; |
39 | 39 |
|
40 | 40 | // The number of milliseconds we wait minimum to ensure others have computed the LCL
|
41 |
| -# define LEDGER_MIN_CLOSE 2000 |
| 41 | +const int LEDGER_MIN_CLOSE = 2000; |
42 | 42 |
|
43 | 43 | // Initial resolution of ledger close time
|
44 |
| -# define LEDGER_TIME_ACCURACY 30 |
| 44 | +const int LEDGER_TIME_ACCURACY = 30; |
45 | 45 |
|
46 | 46 | // How often to increase resolution
|
47 |
| -# define LEDGER_RES_INCREASE 8 |
| 47 | +const int LEDGER_RES_INCREASE = 8; |
48 | 48 |
|
49 | 49 | // How often to decrease resolution
|
50 |
| -# define LEDGER_RES_DECREASE 1 |
| 50 | +const int LEDGER_RES_DECREASE = 1; |
51 | 51 |
|
52 | 52 | // How often we check state or change positions (in milliseconds)
|
53 |
| -# define LEDGER_GRANULARITY 1000 |
| 53 | +const int LEDGER_GRANULARITY = 1000; |
54 | 54 |
|
55 | 55 | // The percentage of active trusted validators that must be able to
|
56 | 56 | // keep up with the network or we consider the network overloaded
|
57 |
| -# define LEDGER_NET_RATIO 70 |
| 57 | +const int LEDGER_NET_RATIO = 70; |
58 | 58 |
|
59 | 59 | // How long we consider a proposal fresh
|
60 |
| -# define PROPOSE_FRESHNESS 20 |
| 60 | +const int PROPOSE_FRESHNESS = 20; |
61 | 61 |
|
62 | 62 | // How often we force generating a new proposal to keep ours fresh
|
63 |
| -# define PROPOSE_INTERVAL 12 |
| 63 | +const int PROPOSE_INTERVAL = 12; |
64 | 64 |
|
65 | 65 | // Avalanche tuning
|
66 |
| -# define AV_INIT_CONSENSUS_PCT 50 // percentage of nodes on our UNL that must vote yes |
| 66 | +// percentage of nodes on our UNL that must vote yes |
| 67 | +const int AV_INIT_CONSENSUS_PCT = 50; |
67 | 68 |
|
68 |
| -# define AV_MID_CONSENSUS_TIME 50 // percentage of previous close time before we advance |
69 |
| -# define AV_MID_CONSENSUS_PCT 65 // percentage of nodes that most vote yes after advancing |
| 69 | +// percentage of previous close time before we advance |
| 70 | +const int AV_MID_CONSENSUS_TIME = 50; |
70 | 71 |
|
71 |
| -# define AV_LATE_CONSENSUS_TIME 85 // percentage of previous close time before we advance |
72 |
| -# define AV_LATE_CONSENSUS_PCT 70 // percentage of nodes that most vote yes after advancing |
| 72 | +// percentage of nodes that most vote yes after advancing |
| 73 | +const int AV_MID_CONSENSUS_PCT = 65; |
73 | 74 |
|
74 |
| -# define AV_STUCK_CONSENSUS_TIME 200 |
75 |
| -# define AV_STUCK_CONSENSUS_PCT 95 |
| 75 | +// percentage of previous close time before we advance |
| 76 | +const int AV_LATE_CONSENSUS_TIME = 85; |
76 | 77 |
|
77 |
| -# define AV_CT_CONSENSUS_PCT 75 |
| 78 | +// percentage of nodes that most vote yes after advancing |
| 79 | +const int AV_LATE_CONSENSUS_PCT = 70; |
| 80 | + |
| 81 | +const int AV_STUCK_CONSENSUS_TIME = 200; |
| 82 | +const int AV_STUCK_CONSENSUS_PCT = 95; |
| 83 | + |
| 84 | +const int AV_CT_CONSENSUS_PCT = 75; |
78 | 85 |
|
79 | 86 | class ContinuousLedgerTiming
|
80 | 87 | {
|
|
0 commit comments