rippled icon indicating copy to clipboard operation
rippled copied to clipboard

Optimize when to acquire ledgers from the network.

Open mtrippled opened this issue 2 years ago • 2 comments

Particulary avoid acquiring ledgers likely to be produced locally very soon.

High Level Overview of Change

Peer ledger acquisition is expensive. This reduces peer ledger aquisition.

Context of Change

Existing code attempts to acquire ledgers if a validation for a new ledger is received, even if it comes moments before we have created the same ledger through normal consensus processing. A peer only needs to be slightly behind the first validator for this to be triggered. This essentially causes all nodes to have expensive background ledgerData acquisition jobs to be running. The fix is to not try to acquire ledgers that are very likely to be created locally through normal processing.

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] 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)
  • [ ] Tests (You added tests for code that already exists, or your new feature included in this PR)
  • [ ] Documentation Updates
  • [X] Performance
  • [ ] Release

mtrippled avatar Oct 12 '23 18:10 mtrippled

@mtrippled to confirm that this should be put on hold for now

intelliot avatar Jan 25 '24 06:01 intelliot

Codecov Report

Attention: Patch coverage is 52.38095% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 76.96%. Comparing base (bcbf6c1) to head (a52b05c).

Files Patch % Lines
src/ripple/app/ledger/impl/InboundLedgers.cpp 61.53% 0 Missing and 5 partials :warning:
src/ripple/app/misc/NetworkOPs.cpp 37.50% 4 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4764      +/-   ##
===========================================
- Coverage    76.97%   76.96%   -0.01%     
===========================================
  Files         1129     1129              
  Lines       131916   131932      +16     
  Branches     39614    39662      +48     
===========================================
+ Hits        101537   101542       +5     
- Misses       24435    24456      +21     
+ Partials      5944     5934      -10     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 03 '24 23:04 codecov-commenter