Skip to content

fix: MPT Transfer Fee shouldn't be bypassable via Small-Amount Escrow Rounding#7821

Open
Kassaking7 wants to merge 6 commits into
XRPLF:developfrom
Kassaking7:DEFI-702
Open

fix: MPT Transfer Fee shouldn't be bypassable via Small-Amount Escrow Rounding#7821
Kassaking7 wants to merge 6 commits into
XRPLF:developfrom
Kassaking7:DEFI-702

Conversation

@Kassaking7

Copy link
Copy Markdown
Contributor

High Level Overview of Change

When an MPT-denominated EscrowFinish transaction computes the transfer fee owed to the issuer, it uses divideRound(amount, lockedRate, asset, roundUp=true) to compute the net amount delivered to the receiver. Rounding the net up implies rounding the fee down. For MPT (whose amounts are strict integers), and because the underlying canonicalizeRound approximation discards the fractional remainder after the intermediate divide-by-ten loops, the resulting fee collapses to exactly zero whenever the escrowed amount is small enough.

Context of Change

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)

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
include/xrpl/ledger/helpers/EscrowHelpers.h 95.0% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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