Skip to content

test: Verify private-vault DEX permissions survive domain loss (FN-82) - #7937

Open
tyalymov wants to merge 1 commit into
developfrom
tialymov/FN-82-private_vault_dex_domain_regression_tests
Open

test: Verify private-vault DEX permissions survive domain loss (FN-82)#7937
tyalymov wants to merge 1 commit into
developfrom
tialymov/FN-82-private_vault_dex_domain_regression_tests

Conversation

@tyalymov

@tyalymov tyalymov commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Adds two regression tests to Vault_test.cpp confirming that a private-vault depositor who loses Permissioned Domain membership after acquiring shares is correctly blocked from further DEX (CLOB) activity, on both the seller and buyer legs. No production code changes.

Ref: FN-82.

Context of Change

A standup discussion (see the FN-82 Jira comment thread) raised a suspicion that current code might still allow placing or filling a CLOB offer selling vault shares even after the seller's Permissioned Domain access was revoked. Auditing requireAuth / enforceMPTokenAuthorization (include/xrpl/ledger/helpers/MPTokenHelpers.cpp) and running these tests shows the concern doesn't hold: the domain check is re-verified live on every relevant operation, so the suspected gap doesn't exist. These tests capture that as a permanent regression check, covering:

  • testDomainLossAfterAcquisition: a depositor who loses domain access after acquiring shares is blocked from further P2P transfer (tecNO_AUTH) and from creating a CLOB sell offer (tecUNFUNDED_OFFER).
  • testDomainCheckBuyerSideOffer: an account that never held domain access is blocked from buying shares via a crossing CLOB offer (tecNO_AUTH).

A separate, unrelated gap found during the same audit (VaultWithdraw not checking Layer 2 for third-party withdrawal destinations) is filed as FN-83 and is out of scope for this PR.

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)

Test Plan

Test-only change; no production code touched.

  • New tests: testDomainLossAfterAcquisition, testDomainCheckBuyerSideOffer in src/test/app/Vault_test.cpp.
  • Ran xrpld --unittest=Vault: 413 cases, 0 failures.

@tyalymov
tyalymov requested a review from Tapanito August 3, 2026 17:44
Adds regression coverage for a standup concern that a private-vault
depositor might still sell shares on the DEX, or move them P2P, after
losing Permissioned Domain membership. Both the seller leg
(testDomainLossAfterAcquisition) and the buyer leg
(testDomainCheckBuyerSideOffer) are already blocked correctly by
requireAuth's live domain recheck; no code fix is required.
@tyalymov
tyalymov force-pushed the tialymov/FN-82-private_vault_dex_domain_regression_tests branch from 3e7b61f to 2796177 Compare August 3, 2026 17:48
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@xrplf-ai-reviewer xrplf-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.

Tests are well-scoped and clearly verify the intended behavior. No concerns on my end.

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