Skip to content

fix: Stop setting lsfMPTCanEscrow on vault shares - #8734

Open
dangell7 wants to merge 5 commits into
developfrom
dangell7/vault-share-no-escrow
Open

dangell7 wants to merge 5 commits into
developfrom
dangell7/vault-share-no-escrow

Conversation

@dangell7

@dangell7 dangell7 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

High Level Overview of Change

With the new fixVaultV1_1 amendment enabled, vault shares cannot be escrowed.

VaultCreate no longer sets lsfMPTCanEscrow on the share MPTokenIssuance. EscrowCreate also rejects an MPT whose issuer AccountRoot carries sfVaultID with tecNO_PERMISSION, so the shares of vaults created before the amendment are rejected too.

Today a holder can escrow vault shares and keep them out of reach of the asset issuer's VaultClawback until the escrow is finished or cancelled.

Context of Change

VaultCreate has set lsfMPTCanEscrow on every transferable share issuance since SingleAssetVault, as XLS-65 §3.1.6.2.2 specifies. EscrowCreate reads that flag from the share issuance, not from the vault asset, so shares can be escrowed even when the asset cannot.

Escrow moves shares from the holder's MPTAmount to LockedAmount. VaultClawback burns only from MPTAmount, so escrowed shares are invisible to it. The asset issuer holds the clawback right over shares but never chose to make them escrowable.

Share issuances created before the amendment keep the flag. For that reason escrowLockPreclaimHelper<MPTIssue> checks the issuer rather than the flag. Only VaultCreate creates an account with sfVaultID, so the check matches vault shares and nothing else. An escrow of shares created before the amendment can still be finished or cancelled.

The tests that escrow shares to exercise LockedAmount now run without the fix. Reported by @Tapanito. The spec change is XRPLF/XRPL-Standards#683.

API Impact

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)

@dangell7
dangell7 requested a review from Tapanito November 18, 2026 14:24

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found.

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The public vault-share escrow behavior change lacks the required API changelog entry documenting the fixVaultV1_1 gate and that existing share issuances retain their escrow flag.

1 open issue
What changed in this PR

This PR prevents newly created vault shares from being escrowed when fixVaultV1_1 is enabled, keeping those shares accessible to VaultClawback. Existing share issuances retain their current behavior.

Changes:

  • Register fixVaultV1_1 and gate the share issuance escrow flag.
  • Test escrow rejection with the amendment enabled and legacy behavior without it.
  • Update RPC flag expectations and preserve legacy escrow test scenarios.
File Description
src/​test/​app/​vault/​VaultShares_test.cpp Test amendment-dependent escrow permissions and holder balances.
src/​test/​app/​vault/​VaultRPC_test.cpp Update expected share issuance flags.
src/​test/​app/​vault/​VaultClawback_test.cpp Disable the amendment for legacy escrow scenarios.
src/​libxrpl/​tx/​transactors/​vault/​VaultCreate.cpp Omit the escrow flag when the amendment is enabled.
include/​xrpl/​protocol/​detail/​features.macro Register the supported, default-no amendment.

Review effort: Balanced

Comment on lines +243 to +244
if (!view().rules().enabled(fixVaultV1_1))
mptFlags |= lsfMPTCanEscrow;

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found 1 blocking issue — see inline.

env.close();

{
json::Value jv;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong type: json::Value doesn't exist. Use Json::Value:

Suggested change
json::Value jv;
Json::Value jv;

This branch has not been deployed

No deployments
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.

2 participants