rippled
Loading...
Searching...
No Matches
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
6namespace ripple {
7namespace PeerFinder {
8
11namespace Tuning {
12
13enum {
14 //---------------------------------------------------------
15 //
16 // Automatic Connection Policy
17 //
18 //---------------------------------------------------------
19
22
24 ,
26
32 ,
33 outPercent = 15
34
39 ,
40 minOutCount = 10
41
43 ,
45
50 ,
51 maxRedirects = 30
52};
53
54//------------------------------------------------------------------------------
55//
56// Fixed
57//
58//------------------------------------------------------------------------------
59
61 {1, 1, 2, 3, 5, 8, 13, 21, 34, 55}};
62
63//------------------------------------------------------------------------------
64//
65// Bootcache
66//
67//------------------------------------------------------------------------------
68
69enum {
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 ,
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//
83
84//------------------------------------------------------------------------------
85//
86// Livecache
87//
88//------------------------------------------------------------------------------
89
90// Drop incoming messages with hops greater than this number
91std::uint32_t constexpr maxHops = 6;
92
93// How many Endpoint to send in each mtENDPOINTS
95
96// The most Endpoint we will accept in mtENDPOINTS
99
100// Number of addresses we provide when redirecting.
102
103// How often we send or accept mtENDPOINTS messages per peer
104// (we use a prime number of purpose)
106
107// How long an Endpoint will stay in the cache
108// This should be a small multiple of the broadcast frequency
110
111// How much time to wait before trying an outgoing address again.
112// Note that we ignore the port for purposes of comparison.
114
115} // namespace Tuning
118} // namespace PeerFinder
119} // namespace ripple
120
121#endif
T is_same_v
std::chrono::seconds constexpr secondsPerMessage(151)
std::chrono::seconds constexpr recentAttemptDuration(60)
@ secondsPerConnect
Time to wait between making batches of connection attempts.
static std::chrono::seconds const bootcacheCooldownTime(60)
std::chrono::seconds constexpr liveCacheSecondsToLive(30)
static std::array< int, 10 > const connectionBackoff
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6