mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
153 lines
19 KiB
HTML
153 lines
19 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: ReduceRelayCommon.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.8 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function() { init_codefold(0); });
|
|
/* @license-end */
|
|
</script>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a62226f9e3a6c7c5a3be455e2f87ae01.html">xrpld</a></li><li class="navelem"><a class="el" href="dir_c4f38cd849aa2a8e7280b7c5f705957a.html">overlay</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">ReduceRelayCommon.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef XRPL_OVERLAY_REDUCERELAYCOMMON_H_INCLUDED</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define XRPL_OVERLAY_REDUCERELAYCOMMON_H_INCLUDED</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/chrono.html">chrono</a>></span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Blog post explaining the rationale behind reduction of flooding gossip</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// protocol:</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// https://xrpl.org/blog/2021/message-routing-optimizations-pt-1-proposal-validation-relaying.html</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
|
<div class="foldopen" id="foldopen00012" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html"> 12</a></span><span class="keyword">namespace </span>reduce_relay {</div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// Peer's squelch is limited in time to</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// rand{MIN_UNSQUELCH_EXPIRE, max_squelch},</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// where max_squelch is</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">// min(max(MAX_UNSQUELCH_EXPIRE_DEFAULT, SQUELCH_PER_PEER * number_of_peers),</span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// MAX_UNSQUELCH_EXPIRE_PEERS)</span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#a97d9582e500aeeec2dc554a14bcf9af0"> 19</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#a97d9582e500aeeec2dc554a14bcf9af0">MIN_UNSQUELCH_EXPIRE</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a>{300};</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#ae55773d17ba2b400229a941b2f66af3f"> 20</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#ae55773d17ba2b400229a941b2f66af3f">MAX_UNSQUELCH_EXPIRE_DEFAULT</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a>{600};</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#a029bd156aabe031ec0528518bd69f4ca"> 21</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#a029bd156aabe031ec0528518bd69f4ca">SQUELCH_PER_PEER</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a>(10);</div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#af6a298ebd3177be1776cf9be3e15db14"> 22</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#af6a298ebd3177be1776cf9be3e15db14">MAX_UNSQUELCH_EXPIRE_PEERS</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a>{3600};</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// No message received threshold before identifying a peer as idled</span></div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#ac372ea9dc11d2f21e2856a5f640ace39"> 24</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#ac372ea9dc11d2f21e2856a5f640ace39">IDLED</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a>{8};</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// Message count threshold to start selecting peers as the source</span></div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// of messages from the validator. We add peers who reach</span></div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// MIN_MESSAGE_THRESHOLD to considered pool once MAX_SELECTED_PEERS</span></div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// reach MAX_MESSAGE_THRESHOLD.</span></div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#aecb3f2e034e2b318c120f931f9ac911f"> 29</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> uint16_t <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#aecb3f2e034e2b318c120f931f9ac911f">MIN_MESSAGE_THRESHOLD</a> = 19;</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#ac9690ca598a3ad3f77670ce8f14b582f"> 30</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> uint16_t <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#ac9690ca598a3ad3f77670ce8f14b582f">MAX_MESSAGE_THRESHOLD</a> = 20;</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment">// Max selected peers to choose as the source of messages from validator</span></div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#a70abeffc314ff9ccea086d5e5692b13f"> 32</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> uint16_t <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#a70abeffc314ff9ccea086d5e5692b13f">MAX_SELECTED_PEERS</a> = 5;</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// Wait before reduce-relay feature is enabled on boot up to let</span></div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// the server establish peer connections</span></div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#adbdcc4999104abf99199a3420a21a62d"> 35</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#adbdcc4999104abf99199a3420a21a62d">WAIT_ON_BOOTUP</a> = <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::minutes</a>{10};</div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// Maximum size of the aggregated transaction hashes per peer.</span></div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// Once we get to high tps throughput, this cap will prevent</span></div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">// TMTransactions from exceeding the current protocol message</span></div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">// size limit of 64MB.</span></div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="namespaceripple_1_1reduce__relay.html#a11bb8a504cf51dc460cd910629ff3d2f"> 40</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> <a class="code hl_variable" href="namespaceripple_1_1reduce__relay.html#a11bb8a504cf51dc460cd910629ff3d2f">MAX_TX_QUEUE_SIZE</a> = 10000;</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>} <span class="comment">// namespace reduce_relay</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span>} <span class="comment">// namespace ripple</span></div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#endif </span><span class="comment">// XRPL_REDUCERELAYCOMMON_H_INCLUDED</span></div>
|
|
<div class="ttc" id="achrono_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/chrono.html">chrono</a></div></div>
|
|
<div class="ttc" id="aduration_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/duration.html">std::chrono::seconds</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_a029bd156aabe031ec0528518bd69f4ca"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#a029bd156aabe031ec0528518bd69f4ca">ripple::reduce_relay::SQUELCH_PER_PEER</a></div><div class="ttdeci">static constexpr auto SQUELCH_PER_PEER</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00021">ReduceRelayCommon.h:21</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_a11bb8a504cf51dc460cd910629ff3d2f"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#a11bb8a504cf51dc460cd910629ff3d2f">ripple::reduce_relay::MAX_TX_QUEUE_SIZE</a></div><div class="ttdeci">static constexpr std::size_t MAX_TX_QUEUE_SIZE</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00040">ReduceRelayCommon.h:40</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_a70abeffc314ff9ccea086d5e5692b13f"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#a70abeffc314ff9ccea086d5e5692b13f">ripple::reduce_relay::MAX_SELECTED_PEERS</a></div><div class="ttdeci">static constexpr uint16_t MAX_SELECTED_PEERS</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00032">ReduceRelayCommon.h:32</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_a97d9582e500aeeec2dc554a14bcf9af0"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#a97d9582e500aeeec2dc554a14bcf9af0">ripple::reduce_relay::MIN_UNSQUELCH_EXPIRE</a></div><div class="ttdeci">static constexpr auto MIN_UNSQUELCH_EXPIRE</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00019">ReduceRelayCommon.h:19</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_ac372ea9dc11d2f21e2856a5f640ace39"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#ac372ea9dc11d2f21e2856a5f640ace39">ripple::reduce_relay::IDLED</a></div><div class="ttdeci">static constexpr auto IDLED</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00024">ReduceRelayCommon.h:24</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_ac9690ca598a3ad3f77670ce8f14b582f"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#ac9690ca598a3ad3f77670ce8f14b582f">ripple::reduce_relay::MAX_MESSAGE_THRESHOLD</a></div><div class="ttdeci">static constexpr uint16_t MAX_MESSAGE_THRESHOLD</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00030">ReduceRelayCommon.h:30</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_adbdcc4999104abf99199a3420a21a62d"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#adbdcc4999104abf99199a3420a21a62d">ripple::reduce_relay::WAIT_ON_BOOTUP</a></div><div class="ttdeci">static constexpr auto WAIT_ON_BOOTUP</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00035">ReduceRelayCommon.h:35</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_ae55773d17ba2b400229a941b2f66af3f"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#ae55773d17ba2b400229a941b2f66af3f">ripple::reduce_relay::MAX_UNSQUELCH_EXPIRE_DEFAULT</a></div><div class="ttdeci">static constexpr auto MAX_UNSQUELCH_EXPIRE_DEFAULT</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00020">ReduceRelayCommon.h:20</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_aecb3f2e034e2b318c120f931f9ac911f"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#aecb3f2e034e2b318c120f931f9ac911f">ripple::reduce_relay::MIN_MESSAGE_THRESHOLD</a></div><div class="ttdeci">static constexpr uint16_t MIN_MESSAGE_THRESHOLD</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00029">ReduceRelayCommon.h:29</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1reduce__relay_html_af6a298ebd3177be1776cf9be3e15db14"><div class="ttname"><a href="namespaceripple_1_1reduce__relay.html#af6a298ebd3177be1776cf9be3e15db14">ripple::reduce_relay::MAX_UNSQUELCH_EXPIRE_PEERS</a></div><div class="ttdeci">static constexpr auto MAX_UNSQUELCH_EXPIRE_PEERS</div><div class="ttdef"><b>Definition</b> <a href="ReduceRelayCommon_8h_source.html#l00022">ReduceRelayCommon.h:22</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition</b> <a href="algorithm_8h_source.html#l00006">algorithm.h:6</a></div></div>
|
|
<div class="ttc" id="asize_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
|
|
</small></address>
|
|
</body>
|
|
</html>
|