Repository navigation
Conversation
There was a problem hiding this comment.
This is a mechanical, well-scoped refactor swapping raw PermissionedDomain SLE pointers for the typed PermissionedDomainEntryR/PermissionedDomainEntryW wrappers across the affected transactors and helpers. I traced each call site (PermissionedDomainSet, PermissionedDomainDelete, Payment, OfferCreate, VaultCreate, VaultSet, MPTokenIssuanceSet, and the Credential/Vault/DEX/MPToken helpers) against the pre-refactor logic and did not find any behavioral divergence: existence checks, ordering of mutations (setAccountID → setFieldU32 → peekFieldArray → dirInsert → setFieldU64 → increaseOwnerCount → insert in PermissionedDomainSet's create path), and the view instances passed into validDomain/verifyValidDomain are consistent with the originals at every call site. The accountInDomain exception noted in the description (keeping the raw uint256 parameter for the zero-key defensive check) is correctly reflected in the diff. No new resource leaks, null-deref changes, or cross-view mismatches were found.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
This is a mechanical, well-scoped refactor migrating raw PermissionedDomain SLE pointers to the typed PermissionedDomainEntryR/W wrapper across transactors and helpers. I traced every call site of the changed validDomain/verifyValidDomain signatures and the new entry-construction patterns in PermissionedDomainSet/Delete, and each substitution is a faithful 1:1 mapping of the prior raw-pointer logic (same view used to build the entry as is used at the call site, same null checks, same ordering of insert/dirInsert/increaseOwnerCount operations). The one intentionally-unchanged function (permissioned_dex::accountInDomain) is well-justified in the description due to its defensive zero-key pre-check. I did not find any correctness, security, or resource-management issues introduced by this diff.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new validation API permits a domain entry and mutable view from different ledger states.
Review effort: Balanced
Findings: 1
What changed in this PR
Migrates permissioned-domain ledger access to typed SLE wrappers as part of the Wrapped SLEs initiative.
Changes:
- Replaces raw permissioned-domain SLE reads and writes with typed entries.
- Updates credential helper APIs and callers.
- Adapts the existing credential test.
| File | Description |
|---|---|
src/test/app/Credentials_test.cpp |
Adapts helper invocation to the wrapper API. |
src/libxrpl/tx/transactors/vault/VaultSet.cpp |
Uses a typed domain read. |
src/libxrpl/tx/transactors/vault/VaultCreate.cpp |
Uses a typed domain read. |
src/libxrpl/tx/transactors/token/MPTokenIssuanceSet.cpp |
Uses a typed domain read. |
src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp |
Uses typed domain creation and updates. |
src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp |
Uses typed domain deletion. |
src/libxrpl/tx/transactors/payment/Payment.cpp |
Passes typed domains through authorization checks. |
src/libxrpl/tx/transactors/dex/OfferCreate.cpp |
Migrates domain authorization access. |
src/libxrpl/ledger/helpers/VaultHelpers.cpp |
Uses typed domains for vault authorization. |
src/libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp |
Migrates domain membership reads. |
src/libxrpl/ledger/helpers/MPTokenHelpers.cpp |
Uses typed domains for token authorization. |
src/libxrpl/ledger/helpers/CredentialHelpers.cpp |
Refactors domain validation around wrappers. |
include/xrpl/ledger/helpers/CredentialHelpers.h |
Updates public helper signatures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| verifyValidDomain( | ||
| ApplyView& view, | ||
| AccountID const& account, | ||
| PermissionedDomainEntryR const& domain, | ||
| beast::Journal j); |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
29b5354 to
200c531
Compare
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
There was a problem hiding this comment.
Clean, mechanical refactor migrating raw PermissionedDomain SLE access to the typed PermissionedDomainEntryR/W wrapper across transactors and helpers. Traced every call site (Payment, OfferCreate, VaultCreate/Set, MPTokenIssuanceSet, PermissionedDomainSet/Delete, and the Credential/Vault/DEX/MPToken helpers) and the argument order/types line up with the new validDomain/verifyValidDomain signatures in every case; no swapped params, no stale-entry reuse across mutations, and the deliberate exception for permissioned_dex::accountInDomain (kept as a raw uint256 to preserve the fixCleanup3_2_0 zero-key pre-fetch check) is reasonable given only its internal read call needed to change. Reusing a single PermissionedDomainEntryR across multiple verifyValidDomain calls in Payment.cpp::doApply (for sender/destination cleanup) is safe because verifyValidDomain only deletes separate Credential SLEs, not the domain's own AcceptedCredentials field. No behavior-changing issues found in the diff.
Migrate every raw PermissionedDomain SLE pointer to PermissionedDomainEntryR/PermissionedDomainEntryW across the transactors and helpers that read or peek this ledger entry: PermissionedDomainSet, PermissionedDomainDelete, Payment, OfferCreate, VaultCreate, VaultSet, MPTokenIssuanceSet, and the Credential/Vault/DEX helper functions. credentials::validDomain and verifyValidDomain now take PermissionedDomainEntryR const& instead of a raw domainID, since every call site already has (or can cheaply build) the entry; this also removes a few duplicate re-fetches of the same domain SLE in Payment and OfferCreate. permissioned_dex::accountInDomain keeps its uint256 domainID parameter: it has a defensive pre-fetch check against a zero-key domain that cannot be replicated once the caller has already constructed the entry, so changing its signature risked losing that safety net for a signature-only refactor. Pure pointer migration: no helper moved onto the wrapper, and Credential/Offer/Vault SLE pointers are untouched.
200c531 to
d4e470a
Compare
There was a problem hiding this comment.
This is a mechanical, well-executed refactor migrating raw PermissionedDomain SLE pointers to the PermissionedDomainEntryR/W wrapper types across all the listed transactors and helpers. I traced every call site change (CredentialHelpers, MPTokenHelpers, PermissionedDEXHelpers, VaultHelpers, OfferCreate, Payment, PermissionedDomainSet/Delete, MPTokenIssuanceSet, VaultCreate, VaultSet, and the test update) against the pre-refactor logic and each one preserves identical read/write semantics, control flow, and error codes — no behavior changes are evident. The documented exception (accountInDomain keeping a raw uint256 param due to the fixCleanup3_2_0 zero-key pre-check) is reasonable and clearly explained. No correctness, security, or consistency issues found in the diff.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…ermissioneddomain-entry # Conflicts: # src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp
There was a problem hiding this comment.
This is a mechanical, well-scoped refactor migrating raw PermissionedDomain SLE access to the typed PermissionedDomainEntryR/PermissionedDomainEntryW wrappers across transactors and helpers. I traced each call site (CredentialHelpers, MPTokenHelpers, PermissionedDEXHelpers, VaultHelpers, OfferCreate, Payment, LoanSet, PermissionedDomainSet/Delete, MPTokenIssuanceSet, VaultCreate/Set) and the substitutions are consistent with the pre-refactor logic: same checks (!domain -> tecOBJECT_NOT_FOUND/tecNO_ENTRY), same field access patterns, and the same view/journal threading. The one intentionally-preserved exception (accountInDomain keeping a raw domain ID for its zero-key pre-fetch guard) is explained in the description and matches what's in the diff. I did not find any lines where the new entry-based call uses a stale view, swaps argument order, or drops a null-check that existed before. No behavior-changing issues identified.
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…ermissioneddomain-entry
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
There was a problem hiding this comment.
This is a mechanical, well-scoped refactor replacing raw view.read/peek(keylet::permissionedDomain(...)) calls with the typed PermissionedDomainEntryR/PermissionedDomainEntryW wrapper across all the listed transactors and helpers, plus updating credentials::validDomain/verifyValidDomain to take the entry instead of a raw domain ID. I traced every call site (OfferCreate, Payment, PermissionedDomainSet/Delete, VaultCreate/Set, MPTokenIssuanceSet, MPTokenHelpers, VaultHelpers, PermissionedDEXHelpers, LoanSet, and the test update) and the constructor argument order, read/write semantics, and control flow (null checks, update()/insert()/erase() calls, owner-count bookkeeping) all match the pre-refactor behavior exactly — just rerouted through the wrapper. The one intentionally-unchanged signature (accountInDomain keeping uint256) is explained in the PR description and consistent with the diff. I found no logic changes, resource-handling bugs, or missed call sites in the diff provided; this looks like a faithful, low-risk pure refactor.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…ermissioneddomain-entry # Conflicts: # src/libxrpl/tx/transactors/vault/VaultSet.cpp
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |

High Level Overview of Change
Migrates every raw
PermissionedDomainSLE pointer toPermissionedDomainEntryR/PermissionedDomainEntryWacross the transactors and helpers that read or peek this ledger entry:PermissionedDomainSet,PermissionedDomainDelete,Payment,OfferCreate,VaultCreate,VaultSet,MPTokenIssuanceSet, plus the Credential/Vault/DEX helper functions that operate on it.credentials::validDomainandverifyValidDomainnow takePermissionedDomainEntryR const&instead of a raw domain ID, since every call site already has (or can cheaply build) the entry.Context of Change
Part of the Wrapped SLEs migration (design: step 2/3 of #7886). Wrapping SLE access in a typed entry lets the compiler enforce read/write access instead of relying on convention. Pure refactor: no amendment, no behavior change; any observable difference is a bug.
permissioned_dex::accountInDomainkeeps itsuint256domain ID parameter rather than moving to the entry type: it has a defensive pre-fetch check against a zero-key domain (guarded byfixCleanup3_2_0) that cannot be replicated once a caller has already constructed the entry, since a non-existent read-only entry cannot recover the key it was built from. Changing its signature for a pointer-only PR risked losing that safety net for no behavior change, so it was left as-is; only its internalview.readcall was migrated to the wrapper.This PR was fully written by AI (Claude Code) under human direction; the human author reviewed the diff.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Test Plan
Compile-checked (clang++ -fsyntax-only) every changed file and every file that includes
CredentialHelpers.h(27 files total, transactors, helpers, the RPC handlers and gtests that pull it in) — all passed. Ranpre-commit(clang-format, include-style, spelling) andclang-tidy(misc-include-cleaner) on every changed.cpp— clean. No new tests added; a signature change incredentials::verifyValidDomainforced one existing call site update insrc/test/app/Credentials_test.cpp. CI runs the full unit test suite.🤖 Generated with Claude Code