rippled icon indicating copy to clipboard operation
rippled copied to clipboard

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

Open Tapanito opened this issue 9 months ago • 1 comments

This feature improves network efficiency by limiting message propagation from untrusted validators.

Squelching currently reduces the volume of duplicate messages from validators but does not address the volume of unique messages from untrusted validators, who may not contribute meaningfully to network progress.

This change introduces a bounded number of slots for untrusted validators, selected based on unique message frequency and quantity. Once selected, their duplicate messages are subject to standard squelching logic, thereby reducing overall message overhead without impacting trusted validator performance.

High Level Overview of Change

Context of Change

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Refactor (non-breaking change that only restructures code)
  • [ ] Performance (increase or change in throughput and/or latency)
  • [ ] Tests (you added tests for code that already exists, or your new feature included in this PR)
  • [ ] Documentation update
  • [ ] Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • [ ] Release

API Impact

  • [ ] Public API: New feature (new methods and/or new fields)
  • [ ] Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • [ ] libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • [x] Peer protocol change (must be backward compatible or bump the peer protocol version)

Tapanito avatar Apr 11 '25 09:04 Tapanito

Codecov Report

:x: Patch coverage is 69.69112% with 157 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 78.8%. Comparing base (6419f9a) to head (09065d9). :warning: Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/overlay/detail/Slot.cpp 82.0% 64 Missing :warning:
src/xrpld/overlay/detail/OverlayImpl.cpp 2.0% 48 Missing :warning:
src/xrpld/overlay/detail/PeerImp.cpp 2.7% 36 Missing :warning:
src/xrpld/overlay/Slot.h 80.5% 8 Missing :warning:
src/xrpld/overlay/detail/PeerImp.h 0.0% 1 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5399     +/-   ##
=========================================
- Coverage     78.8%   78.8%   -0.0%     
=========================================
  Files          814     816      +2     
  Lines        71270   71478    +208     
  Branches      8343    8388     +45     
=========================================
+ Hits         56172   56306    +134     
- Misses       15098   15172     +74     
Files with missing lines Coverage Δ
src/xrpld/core/Config.h 85.7% <ø> (ø)
src/xrpld/core/detail/Config.cpp 75.9% <100.0%> (+0.1%) :arrow_up:
src/xrpld/overlay/SquelchStore.h 100.0% <100.0%> (ø)
src/xrpld/overlay/detail/OverlayImpl.h 38.4% <ø> (ø)
src/xrpld/overlay/detail/SquelchStore.cpp 100.0% <100.0%> (ø)
src/xrpld/overlay/detail/PeerImp.h 13.2% <0.0%> (ø)
src/xrpld/overlay/Slot.h 87.7% <80.5%> (+2.7%) :arrow_up:
src/xrpld/overlay/detail/PeerImp.cpp 3.6% <2.7%> (-<0.1%) :arrow_down:
src/xrpld/overlay/detail/OverlayImpl.cpp 33.3% <2.0%> (-1.3%) :arrow_down:
src/xrpld/overlay/detail/Slot.cpp 82.0% <82.0%> (ø)

... and 5 files with indirect coverage changes

Impacted file tree graph

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 02 '25 10:05 codecov[bot]

@bthomee, it would require rewriting a good chunk of existing base squelching tests, I think that's out of scope. However, I'm happy to explore this prospect separately.

On Mon, Jun 23, 2025, 20:13 Bart @.***> wrote:

@.**** commented on this pull request.

In src/test/overlay/clock.h https://github.com/XRPLF/rippled/pull/5399#discussion_r2162216340:

+#define RIPPLE_TEST_OVERLAY_CLOCK_H_INCLUDED

+#include <xrpl/basics/random.h> + +#include +#include +#include + +namespace ripple { + +namespace test { + +using namespace std::chrono; + +/** Manually advanced clock. */ +class ManualClock

@Tapanito https://github.com/Tapanito Adding an extra class that duplicates a lot of existing code/functionality leads to code bloat. Passing an instance around shouldn't be a huge refactor.

— Reply to this email directly, view it on GitHub https://github.com/XRPLF/rippled/pull/5399#discussion_r2162216340, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMDKU2YWCR3NW4WIEAH2R33FA7VJAVCNFSM6AAAAAB25WMZ7CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSNJRGA2DAMZZGE . You are receiving this because you were mentioned.Message ID: @.***>

Tapanito avatar Jun 23 '25 18:06 Tapanito

Looks great to me! The only big question I raised is about clearing disconnected validators public keys. Once this question is resolved, I'm happy to approve this PR

vlntb avatar Jul 29 '25 17:07 vlntb