Skip to content

feat: Integrate Permissioned Domain & Credential Checks for Lending Protocol#6517

Open
a1q123456 wants to merge 32 commits into
developfrom
a1q123456/adding-perimissioned-domain-to-lending
Open

feat: Integrate Permissioned Domain & Credential Checks for Lending Protocol#6517
a1q123456 wants to merge 32 commits into
developfrom
a1q123456/adding-perimissioned-domain-to-lending

Conversation

@a1q123456

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Context of Change

XRPLF/XRPL-Standards#484

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

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)

Tapanito and others added 21 commits February 4, 2026 11:30
* adds sfMemoData field to VaultDelete transaction
Co-authored-by: Ed Hennis <ed@ripple.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
@a1q123456 a1q123456 requested review from Tapanito and ximinez March 10, 2026 15:56
@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.71795% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.4%. Comparing base (8abe82e) to head (7491a23).

Files with missing lines Patch % Lines
src/libxrpl/tx/transactors/lending/LoanSet.cpp 93.3% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6517   +/-   ##
=======================================
  Coverage     82.4%   82.4%           
=======================================
  Files         1011    1011           
  Lines        76911   76988   +77     
  Branches      8965    8965           
=======================================
+ Hits         63343   63415   +72     
- Misses       13559   13564    +5     
  Partials         9       9           
Files with missing lines Coverage Δ
include/xrpl/protocol/LedgerFormats.h 100.0% <ø> (ø)
include/xrpl/protocol/TxFlags.h 100.0% <ø> (ø)
include/xrpl/protocol/detail/ledger_entries.macro 100.0% <ø> (ø)
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
.../xrpl/protocol_autogen/ledger_entries/LoanBroker.h 100.0% <100.0%> (ø)
...xrpl/protocol_autogen/transactions/LoanBrokerSet.h 100.0% <100.0%> (ø)
...nclude/xrpl/tx/transactors/lending/LoanBrokerSet.h 100.0% <ø> (ø)
src/libxrpl/tx/invariants/InvariantCheck.cpp 95.4% <100.0%> (+<0.1%) ⬆️
src/libxrpl/tx/invariants/LoanBrokerInvariant.cpp 95.6% <100.0%> (+0.2%) ⬆️
...c/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp 97.0% <100.0%> (+0.9%) ⬆️
... and 1 more

... and 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/libxrpl/tx/invariants/LoanInvariant.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
return tecOBJECT_NOT_FOUND; // LCOV_EXCL_LINE
}

if (auto const ter = credentials::validDomain(ctx.view, *domainID, borrower);

@Tapanito Tapanito Mar 12, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ximinez, I'd like to draw your attention to this code here. The call to validDomain is correct, but the way expired credentials are deleted isn't great. Should we add a call to verifyValidDomain to delete expired credentials?

Edit: I think so.. I don't see the design changing any time soon.

Comment thread src/test/app/LoanBroker_test.cpp
a1q123456 and others added 5 commits March 23, 2026 17:45
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
@a1q123456 a1q123456 requested a review from Tapanito March 23, 2026 18:52

@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.

Scanned through the diff

One confirmed copy-paste bug (tfLoanSetMask returned from LoanBrokerSet::getFlagsMask), a TOCTOU inconsistency between preclaim/doApply credential validators, a missing amendment guard in doApply, and two invariant coverage gaps — see inline comments.


Review by ReviewBot 🤖

Review by Claude Opus 4.6 · Prompt: V12

Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanSet.cpp
Comment thread src/libxrpl/tx/transactors/lending/LoanSet.cpp Outdated
Comment thread src/libxrpl/tx/invariants/LoanInvariant.cpp Outdated
Comment thread src/libxrpl/tx/invariants/LoanInvariant.cpp Outdated
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp

@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.

Several correctness and security issues flagged inline: a reserve-burning usability gap (private broker without DomainID), a missing zero-value guard in the broker creation path, a potential divergence between verifyValidDomain/validDomain semantics, an invariant that passes on zero-valued DomainID, and a weak test assertion. See inline comments for details.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp
Comment thread src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp
Comment thread src/libxrpl/tx/transactors/lending/LoanSet.cpp Outdated
Comment thread src/libxrpl/tx/invariants/LoanInvariant.cpp Outdated
Comment thread src/test/app/Loan_test.cpp
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

Comment thread src/libxrpl/tx/transactors/lending/LoanSet.cpp Outdated
Comment thread src/libxrpl/tx/invariants/LoanInvariant.cpp Outdated
@ximinez ximinez removed their request for review June 2, 2026 18:41
@a1q123456 a1q123456 force-pushed the a1q123456/adding-perimissioned-domain-to-lending branch from 708e4d6 to 2ad2175 Compare June 5, 2026 11:35
@a1q123456 a1q123456 changed the base branch from tapanito/lending-fix-amendment to develop June 5, 2026 11:35
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@a1q123456 a1q123456 changed the title Integrate Permissioned Domain & Credential Checks for Lending Protocol feat: Integrate Permissioned Domain & Credential Checks for Lending Protocol Jun 5, 2026

@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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@a1q123456 a1q123456 requested review from Tapanito and shawnxie999 June 5, 2026 12:54

@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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@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.

All clear

Review by Claude Sonnet 4.6 · Prompt: V15

@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants