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