xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
overlay
ReduceRelayCommon.h
1
#pragma once
2
3
#include <
chrono
>
4
#include <
cstddef
>
5
#include <
cstdint
>
6
7
// Blog post explaining the rationale behind reduction of flooding gossip
8
// protocol:
9
// https://xrpl.org/blog/2021/message-routing-optimizations-pt-1-proposal-validation-relaying.html
10
11
namespace
xrpl::reduce_relay
{
12
13
// Peer's squelch is limited in time to
14
// rand{MIN_UNSQUELCH_EXPIRE, max_squelch},
15
// where max_squelch is
16
// min(max(MAX_UNSQUELCH_EXPIRE_DEFAULT, SQUELCH_PER_PEER * number_of_peers),
17
// MAX_UNSQUELCH_EXPIRE_PEERS)
18
static
constexpr
auto
kMinUnsquelchExpire
=
std::chrono::seconds
{300};
19
static
constexpr
auto
kMaxUnsquelchExpireDefault
=
std::chrono::seconds
{600};
20
static
constexpr
auto
kSquelchPerPeer
=
std::chrono::seconds
(10);
21
static
constexpr
auto
kMaxUnsquelchExpirePeers
=
std::chrono::seconds
{3600};
22
// No message received threshold before identifying a peer as idled
23
static
constexpr
auto
kIdled
=
std::chrono::seconds
{8};
24
// Message count threshold to start selecting peers as the source
25
// of messages from the validator. We add peers who reach
26
// kMinMessageThreshold to considered pool once kMaxSelectedPeers
27
// reach kMaxMessageThreshold.
28
static
constexpr
uint16_t
kMinMessageThreshold
= 19;
29
static
constexpr
uint16_t
kMaxMessageThreshold
= 20;
30
// Max selected peers to choose as the source of messages from validator
31
static
constexpr
uint16_t
kMaxSelectedPeers
= 5;
32
// Wait before reduce-relay feature is enabled on boot up to let
33
// the server establish peer connections
34
static
constexpr
auto
kWaitOnBootup
=
std::chrono::minutes
{10};
35
// Maximum size of the aggregated transaction hashes per peer.
36
// Once we get to high tps throughput, this cap will prevent
37
// TMTransactions from exceeding the current protocol message
38
// size limit of 64MB.
39
static
constexpr
std::size_t
kMaxTxQueueSize
= 10000;
40
41
}
// namespace xrpl::reduce_relay
chrono
cstddef
cstdint
std::chrono::seconds
xrpl::reduce_relay
Definition
ReduceRelayCommon.h:11
xrpl::reduce_relay::kMinMessageThreshold
static constexpr uint16_t kMinMessageThreshold
Definition
ReduceRelayCommon.h:28
xrpl::reduce_relay::kSquelchPerPeer
static constexpr auto kSquelchPerPeer
Definition
ReduceRelayCommon.h:20
xrpl::reduce_relay::kMinUnsquelchExpire
static constexpr auto kMinUnsquelchExpire
Definition
ReduceRelayCommon.h:18
xrpl::reduce_relay::kMaxMessageThreshold
static constexpr uint16_t kMaxMessageThreshold
Definition
ReduceRelayCommon.h:29
xrpl::reduce_relay::kMaxTxQueueSize
static constexpr std::size_t kMaxTxQueueSize
Definition
ReduceRelayCommon.h:39
xrpl::reduce_relay::kWaitOnBootup
static constexpr auto kWaitOnBootup
Definition
ReduceRelayCommon.h:34
xrpl::reduce_relay::kMaxUnsquelchExpireDefault
static constexpr auto kMaxUnsquelchExpireDefault
Definition
ReduceRelayCommon.h:19
xrpl::reduce_relay::kMaxUnsquelchExpirePeers
static constexpr auto kMaxUnsquelchExpirePeers
Definition
ReduceRelayCommon.h:21
xrpl::reduce_relay::kIdled
static constexpr auto kIdled
Definition
ReduceRelayCommon.h:23
xrpl::reduce_relay::kMaxSelectedPeers
static constexpr uint16_t kMaxSelectedPeers
Definition
ReduceRelayCommon.h:31
std::size_t
Generated by
1.17.0