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