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