rippled icon indicating copy to clipboard operation
rippled copied to clipboard

DRAFT: Track the last rotation of online delete more accurately

Open ximinez opened this issue 6 months ago • 2 comments

WIP. Follow-up to #5531.

High Level Overview of Change

Context of Change

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)
  • [ ] 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)
  • [ ] Peer protocol change (must be backward compatible or bump the peer protocol version)

This PR may resolve #4883 and #3912.

ximinez avatar Jul 09 '25 01:07 ximinez

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :warning: Please upload report for BASE (ximinez/online-delete-gaps@f456a85). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                      @@
##             ximinez/online-delete-gaps   #5542   +/-   ##
============================================================
  Coverage                              ?   78.9%           
============================================================
  Files                                 ?     816           
  Lines                                 ?   72109           
  Branches                              ?    8404           
============================================================
  Hits                                  ?   56909           
  Misses                                ?   15200           
  Partials                              ?       0           
Files with missing lines Coverage Δ
src/xrpld/app/misc/SHAMapStoreImp.cpp 80.7% <100.0%> (ø)

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.

codecov[bot] avatar Jul 09 '25 01:07 codecov[bot]

TODO:

  1. Add a function to DatabaseRotating that is like fetchNodeData, but also includes the "depth" that the node is found at.
  2. At the end of the SHAMapStoreImp::run() rotation process, start with the current validated ledger index, then use the existing cond_ to check after every following validated ledger index
  3. Look up the hash using LedgerMaster.
  4. Find the ledger hash in the node store. It should always be found, but when it's found in the writable DB, then we're done. Details TBD, especially since I'm not sure if the header is written first or last.
  5. Once it's found an determined that all the modified nodes for that ledger are written to the writable DB, set lastRotated to that value.

ximinez avatar Jul 10 '25 02:07 ximinez