Skip to content

perf: Optimize MPT freeze checks to reduce redundant state reads#7411

Open
gregtatcam wants to merge 1 commit into
developfrom
gregtatcam/mpt/optimize-freeze-checks
Open

perf: Optimize MPT freeze checks to reduce redundant state reads#7411
gregtatcam wants to merge 1 commit into
developfrom
gregtatcam/mpt/optimize-freeze-checks

Conversation

@gregtatcam
Copy link
Copy Markdown
Collaborator

High Level Overview of Change

Optimize MPT freeze checks with existing token SLEs

Avoid redundant MPToken lookups in MPT freeze checks when callers already
have the holder MPToken SLE. Add SLE-based isFrozen(), isGlobalFrozen(),
and isIndividualFrozen() overloads, and reuse the loaded issuance SLE when
checking vault pseudo-account freeze state.

This reduces repeated state reads on mixed MPT/IOU payment paths while
preserving the existing MPTIssue fallback behavior.

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)

Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.4%. Comparing base (6c54342) to head (df0ed95).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #7411     +/-   ##
=========================================
- Coverage     82.4%   82.4%   -0.0%     
=========================================
  Files         1011    1011             
  Lines        76547   76942    +395     
  Branches      7326    8965   +1639     
=========================================
+ Hits         63065   63365    +300     
- Misses       13482   13568     +86     
- Partials         0       9      +9     
Files with missing lines Coverage Δ
include/xrpl/ledger/View.h 100.0% <ø> (ø)
src/libxrpl/ledger/View.cpp 96.9% <100.0%> (-0.9%) ⬇️
src/libxrpl/ledger/helpers/AMMHelpers.cpp 95.3% <100.0%> (-0.3%) ⬇️
src/libxrpl/ledger/helpers/MPTokenHelpers.cpp 96.6% <100.0%> (+0.2%) ⬆️
src/libxrpl/ledger/helpers/TokenHelpers.cpp 95.3% <100.0%> (+<0.1%) ⬆️

... and 183 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gregtatcam gregtatcam changed the title ref: Optimize MPT freeze checks to reduce redundant state reads refactor: Optimize MPT freeze checks to reduce redundant state reads Jun 5, 2026
@gregtatcam gregtatcam force-pushed the gregtatcam/mpt/optimize-freeze-checks branch from a2311f2 to df0ed95 Compare June 5, 2026 17:50
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@gregtatcam gregtatcam changed the title refactor: Optimize MPT freeze checks to reduce redundant state reads perf: Optimize MPT freeze checks to reduce redundant state reads Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant