Repository navigation
Conversation
sign_loan_set_by_counterparty and combine_loanset_counterparty_signers treated the Account as signed only when txn_signature was set, so a LoanSet whose Account is multisigned (empty signing_pub_key plus signers) was rejected with "Transaction must be first signed by first party." XLS-66 allows Signers on the Account side, and rippled verifies the Account and counterparty signatures independently. DGE-8438 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. WalkthroughThe counterparty signing helpers now accept a ChangesLoanSet counterparty signing
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The LoanSet signing change is mergeable after normal checks; no PR-introduced issue remains identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Clean, well-scoped bug fix: _is_signed_by_first_party now checks txn_signature is not None or bool(signers) instead of relying on signing_pub_key is None (which could never be true). Both call sites (sign_loan_set_by_counterparty and combine_loanset_counterparty_signers) were updated consistently, the dropped signing_pub_key is None check was correctly identified as dead code, and the new unit/integration tests cover the single-sign, multi-sign+combine, and still-unsigned-account rejection paths. No correctness, security, or consistency issues found in the added lines.
High Level Overview of Change
sign_loan_set_by_counterpartyandcombine_loanset_counterparty_signersnow accept aLoanSetwhoseAccountis multisigned.Jira: DGE-8438
Context of Change
Both helpers refuse to add the counterparty's signature until the
Accounthas signed, and they detected that withtxn_signature. A multisigned transaction has an emptysigning_pub_keyand asignerslist but notxn_signature, so a loan broker whose account is protected by a signer list gotTransaction must be first signed by first party.for a fully signed LoanSet, and could not originate a loan.XLS-66 allows
Signerson the initiating side (§3.8.3), and rippled checks the two signatures independently (LoanSet::checkSign).The helpers now treat the
Accountas signed when it has atxn_signatureor a non-emptysignerslist. The oldsigning_pub_key is Nonecheck is dropped:Transaction.signing_pub_keydefaults to"", so it was neverNone. Nothing else changes: the counterparty signs the same fields as before, which include theAccount's (empty)SigningPubKeyand excludeSigners. A LoanSet theAccounthas not signed is still rejected.The check dates from #900, which added the helpers. xrpl.js has the same bug and is fixed in XRPLF/xrpl.js#3531.
Type of Change
Did you update CHANGELOG.md?
Test Plan
tests/unit/transaction/test_counterparty_signer.py, on a LoanSet multisigned by itsAccount:Account'ssignersare kept, and each counterparty signature verifies against the counterparty signing bytes.Accounthas not signed still raises in both helpers.test_loan_set_txn_multisigned_loan_brokerintests/integration/transactions/test_lending_protocol.py: a loan broker with a 2-of-2 signer list originates a loan to a borrower with a 2-of-2 signer list, through all four client types, and rippled creates theLoan.mainwithTransaction must be first signed by first party.and pass with the fix.rippleci/xrpld:develop --standalone(xrpld 3.4.0-rc1) with this repo's.ci-config. The full unit suite, the lending integration suite (8 tests), flake8 andmypy --strictpass.🤖 Generated with Claude Code