rippled
Loading...
Searching...
No Matches
xrpld
peerfinder
detail
src/xrpld/peerfinder/detail/Tuning.h
1
#ifndef XRPL_PEERFINDER_TUNING_H_INCLUDED
2
#define XRPL_PEERFINDER_TUNING_H_INCLUDED
3
4
#include <
array
>
5
6
namespace
ripple
{
7
namespace
PeerFinder {
8
11
namespace
Tuning {
12
13
enum
{
14
//---------------------------------------------------------
15
//
16
// Automatic Connection Policy
17
//
18
//---------------------------------------------------------
19
21
secondsPerConnect
= 10
22
24
,
25
maxConnectAttempts
= 20
26
32
,
33
outPercent
= 15
34
39
,
40
minOutCount
= 10
41
43
,
44
defaultMaxPeers
= 21
45
50
,
51
maxRedirects
= 30
52
};
53
54
//------------------------------------------------------------------------------
55
//
56
// Fixed
57
//
58
//------------------------------------------------------------------------------
59
60
static
std::array<int, 10>
const
connectionBackoff
{
61
{1, 1, 2, 3, 5, 8, 13, 21, 34, 55}};
62
63
//------------------------------------------------------------------------------
64
//
65
// Bootcache
66
//
67
//------------------------------------------------------------------------------
68
69
enum
{
70
// Threshold of cache entries above which we trim.
71
bootcacheSize
= 1000
72
73
// The percentage of addresses we prune when we trim the cache.
74
,
75
bootcachePrunePercent
= 10
76
};
77
78
// The cool down wait between database updates
79
// Ideally this should be larger than the time it takes a full
80
// peer to send us a set of addresses and then disconnect.
81
//
82
static
std::chrono::seconds
const
bootcacheCooldownTime
(60);
83
84
//------------------------------------------------------------------------------
85
//
86
// Livecache
87
//
88
//------------------------------------------------------------------------------
89
90
// Drop incoming messages with hops greater than this number
91
std::uint32_t
constexpr
maxHops
= 6;
92
93
// How many Endpoint to send in each mtENDPOINTS
94
std::uint32_t
constexpr
numberOfEndpoints
= 2 *
maxHops
;
95
96
// The most Endpoint we will accept in mtENDPOINTS
97
std::uint32_t
constexpr
numberOfEndpointsMax
=
98
std::max<decltype(numberOfEndpoints)>
(
numberOfEndpoints
* 2, 64);
99
100
// Number of addresses we provide when redirecting.
101
std::uint32_t
constexpr
redirectEndpointCount
= 10;
102
103
// How often we send or accept mtENDPOINTS messages per peer
104
// (we use a prime number of purpose)
105
std::chrono::seconds
constexpr
secondsPerMessage
(151);
106
107
// How long an Endpoint will stay in the cache
108
// This should be a small multiple of the broadcast frequency
109
std::chrono::seconds
constexpr
liveCacheSecondsToLive
(30);
110
111
// How much time to wait before trying an outgoing address again.
112
// Note that we ignore the port for purposes of comparison.
113
std::chrono::seconds
constexpr
recentAttemptDuration
(60);
114
115
}
// namespace Tuning
118
}
// namespace PeerFinder
119
}
// namespace ripple
120
121
#endif
array
std::chrono::seconds
std::uint32_t
std::is_same_v
T is_same_v
ripple::PeerFinder::Tuning::secondsPerMessage
std::chrono::seconds constexpr secondsPerMessage(151)
ripple::PeerFinder::Tuning::redirectEndpointCount
std::uint32_t constexpr redirectEndpointCount
Definition
src/xrpld/peerfinder/detail/Tuning.h:101
ripple::PeerFinder::Tuning::numberOfEndpointsMax
std::uint32_t constexpr numberOfEndpointsMax
Definition
src/xrpld/peerfinder/detail/Tuning.h:97
ripple::PeerFinder::Tuning::numberOfEndpoints
std::uint32_t constexpr numberOfEndpoints
Definition
src/xrpld/peerfinder/detail/Tuning.h:94
ripple::PeerFinder::Tuning::recentAttemptDuration
std::chrono::seconds constexpr recentAttemptDuration(60)
ripple::PeerFinder::Tuning::bootcachePrunePercent
@ bootcachePrunePercent
Definition
src/xrpld/peerfinder/detail/Tuning.h:75
ripple::PeerFinder::Tuning::bootcacheSize
@ bootcacheSize
Definition
src/xrpld/peerfinder/detail/Tuning.h:71
ripple::PeerFinder::Tuning::maxRedirects
@ maxRedirects
Definition
src/xrpld/peerfinder/detail/Tuning.h:51
ripple::PeerFinder::Tuning::outPercent
@ outPercent
Definition
src/xrpld/peerfinder/detail/Tuning.h:33
ripple::PeerFinder::Tuning::secondsPerConnect
@ secondsPerConnect
Time to wait between making batches of connection attempts.
Definition
src/xrpld/peerfinder/detail/Tuning.h:21
ripple::PeerFinder::Tuning::maxConnectAttempts
@ maxConnectAttempts
Definition
src/xrpld/peerfinder/detail/Tuning.h:25
ripple::PeerFinder::Tuning::minOutCount
@ minOutCount
Definition
src/xrpld/peerfinder/detail/Tuning.h:40
ripple::PeerFinder::Tuning::defaultMaxPeers
@ defaultMaxPeers
Definition
src/xrpld/peerfinder/detail/Tuning.h:44
ripple::PeerFinder::Tuning::bootcacheCooldownTime
static std::chrono::seconds const bootcacheCooldownTime(60)
ripple::PeerFinder::Tuning::liveCacheSecondsToLive
std::chrono::seconds constexpr liveCacheSecondsToLive(30)
ripple::PeerFinder::Tuning::connectionBackoff
static std::array< int, 10 > const connectionBackoff
Definition
src/xrpld/peerfinder/detail/Tuning.h:60
ripple::PeerFinder::Tuning::maxHops
std::uint32_t constexpr maxHops
Definition
src/xrpld/peerfinder/detail/Tuning.h:91
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
Generated by
1.9.8