fix: OverrideFreeze invariant gap blocks clawback on individually frozen AMM trust lines#6959
Open
Kassaking7 wants to merge 1 commit intoXRPLF:developfrom
Open
fix: OverrideFreeze invariant gap blocks clawback on individually frozen AMM trust lines#6959Kassaking7 wants to merge 1 commit intoXRPLF:developfrom
Kassaking7 wants to merge 1 commit intoXRPLF:developfrom
Conversation
…zen AMM trust lines
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6959 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.0%
=========================================
Files 1010 1010
Lines 75972 75971 -1
Branches 7609 7606 -3
=========================================
- Hits 61984 61982 -2
- Misses 13988 13989 +1
🚀 New features to boost your workflow:
|
Collaborator
|
This needs an amendment |
Collaborator
Author
Got it. Shall I go with fixSecurity3_1_3? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
The invariant check condition:
(!isAMMLine || globalFreeze) && hasPrivilege(tx, overrideFreeze)evaluates to false when
isAMMLine=trueandglobalFreeze=false. This meansAMMClawbackcannot override individual or deep freeze on AMM trust lines (between the AMM pseudo-account and the issuer). Thewithdraw()call succeeds because it usesFreezeHandling::fhIGNORE_FREEZE, but the invariant checker then rejects the transaction because it detects a balance change on a frozen AMM line without the override condition being met. This creates a contradiction where the issuer's freeze action prevents their own clawback from the AMM pool.When the issuer individually freezes their AMM trust line (via TrustSet targeting the AMM pseudo-account with
tfSetFreeze), all subsequent AMMClawback transactions against any holder in that pool will fail at the invariant check. Combined with the fact that a frozen holder cannot withdraw via regular AMMWithdraw, this creates a freeze/clawback deadlock where LP tokens are effectively locked until the issuer unfreezes the AMM line.Context of Change
Change from:
if ((!isAMMLine || globalFreeze) && hasPrivilege(tx, overrideFreeze))to:
if (hasPrivilege(tx, overrideFreeze))The overrideFreeze privilege is already restricted to AMMClawback transactions only (via transactions.macro), so removing the AMM line check is safe.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)