mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improve transaction relaying logic:
The existing logic involves every server sending every transaction that it receives to all its peers (except the one that it received a transaction from). This commit instead uses a randomized algorithm, where a node will randomly select peers to relay a given transaction to, caching the list of transaction hashes that are not relayed and forwading them to peers once every second. Peers can then determine whether there are transactions that they have not seen and can request them from the node which has them. It is expected that this feature will further reduce the bandwidth needed to operate a server.
This commit is contained in:
committed by
Nik Bougalis
parent
0d17dd8228
commit
ea145d12c7
@@ -217,6 +217,21 @@ public:
|
||||
// Set log level to debug so that the feature function can be
|
||||
// analyzed.
|
||||
bool VP_REDUCE_RELAY_SQUELCH = false;
|
||||
// Transaction reduce-relay feature
|
||||
bool TX_REDUCE_RELAY_ENABLE = false;
|
||||
// If tx reduce-relay feature is disabled
|
||||
// and this flag is enabled then some
|
||||
// tx-related metrics is collected. It
|
||||
// is ignored if tx reduce-relay feature is
|
||||
// enabled. It is used in debugging to compare
|
||||
// metrics with the feature disabled/enabled.
|
||||
bool TX_REDUCE_RELAY_METRICS = false;
|
||||
// Minimum peers a server should have before
|
||||
// selecting random peers
|
||||
std::size_t TX_REDUCE_RELAY_MIN_PEERS = 20;
|
||||
// Percentage of peers with the tx reduce-relay feature enabled
|
||||
// to relay to out of total active peers
|
||||
std::size_t TX_RELAY_PERCENTAGE = 25;
|
||||
|
||||
// These override the command line client settings
|
||||
std::optional<beast::IP::Endpoint> rpc_ip;
|
||||
|
||||
Reference in New Issue
Block a user