8000 Untrusted Validator Squelching - Extends squelching to limit untrusted validator message propagation by Tapanito · Pull Request #5399 · XRPLF/rippled · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Untrusted Validator Squelching - Extends squelching to limit untrusted validator message propagation #5399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
34c3591
adds config option for enhanced squelching
Tapanito May 28, 2025
69aec23
adds isTrusted parameter to updateSlotAndSquelch method to differenti…
Tapanito May 28, 2025
5613dab
adds methods to track which peers and validators were squelched
Tapanito May 28, 2025
1e02961
adds method to SquelchHandler to squelch all peers
Tapanito May 28, 2025
ba536eb
adds data strcutures and methods to track red validators
Tapanito May 28, 2025
71871bb
feature: extend squelching to suppress untrusted validator traffic
Tapanito May 28, 2025
9ecb457
adds methods to print slot details from command
Tapanito May 28, 2025
d4c6910
adds enhanced squelching tests
Tapanito May 28, 2025
a038b70
removes member functions from Slots used only for testing, and moves …
Tapanito May 28, 2025
261cf0c
Merge branch 'develop' into tapanito/feature/enhanced-squelching
Tapanito May 28, 2025
2a9c386
fixes unittests for windows
Tapanito May 28, 2025
d0a67d7
Update src/xrpld/overlay/detail/OverlayImpl.h
Tapanito Jun 23, 2025
4748caa
removes duplicate untrusted slot check
Tapanito Jun 23, 2025
9efb1c1
Merge branch 'develop' into tapanito/feature/enhanced-squelching
Tapanito Jun 23, 2025
8d567a7
refactors squelching to use instanced clock instead of a static clock
Tapanito Jun 24, 2025
2f33502
Merge branch 'develop' into tapanito/feature/enhanced-squelching
Tapanito Jun 24, 2025
8767282
improves code readabiliy
Tapanito Jun 24, 2025
ad32b2f
removes unused clock
Tapanito Jun 24, 2025
1fc8057
removes unused imports
Tapanito Jun 24, 2025
ebbce1c
removes unused test parameters
Tapanito Jun 24, 2025
a703fca
improves code readability
Tapanito Jun 25, 2025
69446cb
decouples tests from squelching implementation
Tapanito Jun 25, 2025
5ca4f55
fixes code formatting
Tapanito Jun 26, 2025
9030b28
fixes windows tests
Tapanito Jun 26, 2025
c709a13
Merge branch 'develop' into tapanito/feature/enhanced-squelching
Tapanito Jun 26, 2025
521ec6f
improves code readability
Tapanito Jun 27, 2025
1a768d7
further improves member function and attribute names
Tapanito Jun 30, 2025
820f1e1
adds callback to squelchAll instead of calling slots directly
Tapanito Jun 30, 2025
3902421
Merge branch 'develop' into tapanito/feature/enhanced-squelching
Tapanito Jul 1, 2025
a7f257b
removes redundant scope
Tapanito Jun 30, 2025
79a5610
adds logic to reset validator progress and better deletion safeguards
Tapanito Jul 1, 2025
14ba721
improves code readability
Tapanito Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

940 changes: 940 additions & 0 deletions src/test/overlay/enhanced_squelch_test.cpp

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/xrpld/core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ class Config : public BasicConfig
std::size_t VP_REDUCE_RELAY_SQUELCH_MAX_SELECTED_PEERS = 5;
///////////////// END OF TEMPORARY CODE BLOCK /////////////////////

// Enable enhanced squelching of unique untrusted validator messages
bool VP_REDUCE_RELAY_ENHANCED_SQUELCH_ENABLE = false;

// Transaction reduce-relay feature
bool TX_REDUCE_RELAY_ENABLE = false;
// If tx reduce-relay feature is disabled
Expand Down
3 changes: 3 additions & 0 deletions src/xrpld/core/detail/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ Config::loadFromString(std::string const& fileContents)
"greater than or equal to 3");
///////////////// !!END OF TEMPORARY CODE BLOCK!! /////////////////////

VP_REDUCE_RELAY_ENHANCED_SQUELCH_ENABLE =
sec.value_or("vp_enhanced_squelch_enable", false);

TX_REDUCE_RELAY_ENABLE = sec.value_or("tx_enable", false);
TX_REDUCE_RELAY_METRICS = sec.value_or("tx_metrics", false);
TX_REDUCE_RELAY_MIN_PEERS = sec.value_or("tx_min_peers", 20);
Expand Down
15 changes: 14 additions & 1 deletion src/xrpld/overlay/ReduceRelayCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define RIPPLE_OVERLAY_REDUCERELAYCOMMON_H_INCLUDED

#include <chrono>
#include <cstdint>

namespace ripple {

Expand All @@ -39,19 +40,31 @@ static constexpr auto MIN_UNSQUELCH_EXPIRE = std::chrono::seconds{300};
static constexpr auto MAX_UNSQUELCH_EXPIRE_DEFAULT = std::chrono::seconds{600};
static constexpr auto SQUELCH_PER_PEER = std::chrono::seconds(10);
static constexpr auto MAX_UNSQUELCH_EXPIRE_PEERS = std::chrono::seconds{3600};

// No message received threshold before identifying a peer as idled
static constexpr auto IDLED = std::chrono::seconds{8};
static constexpr auto PEER_IDLED = std::chrono::seconds{8};

// Message count threshold to start selecting peers as the source
// of messages from the validator. We add peers who reach
// MIN_MESSAGE_THRESHOLD to considered pool once MAX_SELECTED_PEERS
// reach MAX_MESSAGE_THRESHOLD.
static constexpr uint16_t MIN_MESSAGE_THRESHOLD = 19;
static constexpr uint16_t MAX_MESSAGE_THRESHOLD = 20;

// Max selected peers to choose as the source of messages from validator
static constexpr uint16_t MAX_SELECTED_PEERS = 5;

// Max number of untrusted slots the server will maintain
static constexpr uint16_t MAX_UNTRUSTED_SLOTS = 5;

// The maximum of seconds an untrusted validator can go without sending a
// validation message. After this, a validator may be squelched
static constexpr auto MAX_UNTRUSTED_VALIDATOR_IDLE = std::chrono::seconds{30};

// Wait before reduce-relay feature is enabled on boot up to let
// the server establish peer connections
static constexpr auto WAIT_ON_BOOTUP = std::chrono::minutes{10};

// Maximum size of the aggregated transaction hashes per peer.
// Once we get to high tps throughput, this cap will prevent
// TMTransactions from exceeding the current protocol message
Expand Down
Loading
Loading
0