Skip to content

fix: Better handling of txs that send XRP + charge reserve#7671

Open
mvadari wants to merge 5 commits into
xrplf/sponsorfrom
mvadari/sponsor/sherlock-1860
Open

fix: Better handling of txs that send XRP + charge reserve#7671
mvadari wants to merge 5 commits into
xrplf/sponsorfrom
mvadari/sponsor/sherlock-1860

Conversation

@mvadari

@mvadari mvadari commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

High Level Overview of Change

This PR fixes PaymentChannelCreate and EscrowCreate to properly handle sponsorship and reserves. They're a bit of a special case since they also can send XRP, which always comes from the Account (never the Sponsor).

Context of Change

Sherlock 1680, issues found in the process of fixing that

See also: #6599

API Impact

N/A

@mvadari mvadari requested a review from oleks-rip June 30, 2026 14:24

@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

Comment thread src/libxrpl/tx/transactors/payment_channel/PaymentChannelCreate.cpp
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.1%. Comparing base (494391b) to head (53299a8).
⚠️ Report is 21 commits behind head on xrplf/sponsor.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           xrplf/sponsor   #7671     +/-   ##
===============================================
- Coverage           82.2%   82.1%   -0.1%     
===============================================
  Files               1016    1017      +1     
  Lines              78375   78200    -175     
  Branches            8996    9017     +21     
===============================================
- Hits               64438   64217    -221     
- Misses             13928   13974     +46     
  Partials               9       9             
Files with missing lines Coverage Δ
src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp 98.1% <100.0%> (+<0.1%) ⬆️
...ansactors/payment_channel/PaymentChannelCreate.cpp 87.4% <100.0%> (-7.4%) ⬇️

... and 29 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.

@mvadari mvadari requested a review from PeterChen13579 June 30, 2026 15:32

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

ctx_.view(),
ctx_.tx,
sle,
balance - STAmount(amount).xrp(),

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.

I see Payment Channel using preFeeBalance_ while Escrow uses sfBalance. Just want to check is this intended behavior?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That is how the code in develop works. But fair, fixed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For reference: #6599

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@PeterChen13579 PeterChen13579 left a comment

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.

Please fix up tests before merging

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.

3 participants