Skip to content

feat: validate reciprocal cross-account repayments - #101

Open
Seranged wants to merge 1 commit into
mainfrom
feat/reciprocal-cross-account-repay
Open

feat: validate reciprocal cross-account repayments#101
Seranged wants to merge 1 commit into
mainfrom
feat/reciprocal-cross-account-repay

Conversation

@Seranged

@Seranged Seranged commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add regression coverage for reciprocal exact-vault repayments where two Euler accounts hold the vault shares needed to repay each other's liabilities.
  • Verify that two independently planned full repayments remain composable as one atomic EVC batch for clients that expose a cross-position exit flow.
  • Keep the supported SDK surface unchanged: the existing planRepayFromDeposit primitive already carries the required source-account and debt-receiver separation.

Changes

  • Construct two opposing full-repay plans with distinct source and receiver accounts.
  • Merge both plans and assert the exact execution order: repayWithShares, controller disable, repayWithShares, controller disable.
  • Bind each repayment to the expected vault, share-holding account, debt account, and maxUint256 amount.
  • Assert the composed exact-vault path contains no withdrawal, skim, or collateral-cleanup operations, so it does not depend on vault cash liquidity and does not move collateral needed by the reciprocal leg.

Safety properties

  • Each liability is repaid from shares held in that same liability vault.
  • Max repayments disable the corresponding controllers.
  • Cleanup remains disabled for each individual leg, preserving the reciprocal source balances until the complete batch executes.
  • The two legs are emitted through a single EVC batch.

Test plan

  • Run the complete Euler V2 SDK test suite (39 files, 581 tests).
  • Run Euler V2 SDK TypeScript typechecking.
  • Validate the paired Lite draft preview against this SDK branch.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of reciprocal same-vault repayments, ensuring repayment and controller actions remain correctly separated for each vault and account.

Verify exact-vault share repayments from opposite accounts merge into one EVC batch without withdraw, skim, or collateral cleanup calls.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: euler-xyz/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 79c5fbb5-5229-4d4b-b419-435261f11d78

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa579f and 792d04f.

📒 Files selected for processing (1)
  • packages/euler-v2-sdk/test/executionService.test.ts

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The pull request adds a regression test for reciprocal same-vault repayments. The test verifies merged repayWithShares and disableController calls for both vault/account pairs.

Changes

Repayment merge regression

Layer / File(s) Summary
Validate merged repayment calls
packages/euler-v2-sdk/test/executionService.test.ts
Adds a test that constructs reciprocal repayment plans and verifies call order, vault targets, delegated accounts, call ownership, and maxUint256 repayment amounts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 792d0

This change adds coverage for merged reciprocal exact-vault repayments, ensuring each repayment and controller disable call remains correctly ordered without extra withdrawal or cleanup operations. No current merge-blocking risk remains.

Suggested reviewers: dglowinski

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: regression coverage for reciprocal cross-account repayments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/reciprocal-cross-account-repay

Comment @coderabbitai help to get the list of available commands.

@Seranged
Seranged marked this pull request as ready for review September 4, 2026 10:03
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