fix: Prevent deletion of MPTokens with active escrow#6635
fix: Prevent deletion of MPTokens with active escrow#6635bthomee merged 4 commits intoXRPLF:developfrom
Conversation
mvadari
left a comment
There was a problem hiding this comment.
This change needs to be amendment-gated, since it has already been released with Supported::yes
PeterChen13579
left a comment
There was a problem hiding this comment.
Good job on your first PR! Small changes requested to make the tests more readable
|
Do we have any other fix needed. Maybe we can batch those fixes with one amendment-gate? |
@Kassaking7 it is likely we may have one amendment containing other fixes too, @bthomee any suggestions for the fix amendment name here? |
|
/ai-review |
|
Error: Failed to post review to GitHub after 3 attempts: Server error '500 Internal Server Error' for url 'https://api.github.com/repos/XRPLF/rippled/pulls/6635/reviews' Review by Claude Opus 4.6 · Prompt: v12 |
We don't have a name for that amendment yet, but I'll add this PR to my local release tracker sheet so when the time comes we can ask @Kassaking7 to update this PR. In the meantime, @Kassaking7, please guard the changes by a new fix amendment with a suitable name, and then later we can swap out the amendment by the collective fix amendment before merging. Name suggestion for now: |
|
/ai-review |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
@Kassaking7 we merged the change that introduces the fix amendment, named |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
Hey @mvadari, this PR is ready for review :D |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6635 +/- ##
=========================================
- Coverage 81.4% 81.4% -0.0%
=========================================
Files 1006 1006
Lines 74451 74454 +3
Branches 7557 7561 +4
=========================================
- Hits 60629 60622 -7
- Misses 13822 13832 +10
🚀 New features to boost your workflow:
|
|
@Kassaking7 can you please sign your commits? Feel free to squash all commits so you only need to sign a single one. |
|
@Kassaking7 thanks for signing the commit(s) - is this PR now ready to merge? |
|
@bthomee I think this should count as a 3-reviewer PR |
| runTest(features - fixSecurity3_1_3); | ||
| runTest(features | fixSecurity3_1_3); | ||
| runTest(amendments - fixSecurity3_1_3); | ||
| runTest(amendments | fixSecurity3_1_3); |
There was a problem hiding this comment.
this should be runTest(amendments)
|
@Kassaking7 is this PR ready to merge? |
|
@bthomee yes it's ready to merge :D |
|
@Kassaking7 can you please do the following:
|
|
This PR should be rebased onto |
Actually @Kassaking7, I think it would be easiest if this PR gets merged as it is, and you then create a separate PR that cherry-picked just the squashed merged commit, and then targets the |
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
High Level Overview of Change
This change prevents MPTokens from being deleted while there is still an active escrow associated with them. It ensures that token state remains consistent and avoids situations where escrowed tokens reference non-existent objects.
Context of Change
The removeEmptyHolding function in src/libxrpl/ledger/View.cpp can delete an MPToken ledger object even when it has a non-zero sfLockedAmount (i.e., funds are currently held in escrow). This orphans the escrowed funds: the Escrow ledger object still exists, but the MPToken it references has been removed. Any subsequent attempt to finish or cancel the escrow fails, resulting in permanent loss of the escrowed tokens.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)