Skip to content

Fix escrow races, fund metadata, and Soroban XDR encoding - #911

Merged
chonilius merged 1 commit into
MergeFi:mainfrom
toxxxxicc:fix/escrow-758-761
Nov 22, 2026
Merged

chonilius merged 1 commit into
MergeFi:mainfrom
toxxxxicc:fix/escrow-758-761

Conversation

@toxxxxicc

@toxxxxicc toxxxxicc commented Nov 22, 2026 •

Copy link
Copy Markdown

What this PR does

Fixes escrow reward serialization, preserves fund-attempt metadata for reconciliation, and encodes Soroban vectors and tuples with explicit XDR types.

Closes

Closes #760
Closes #761
Closes #759
Closes #758

What changed

  • Runs the maintenance-pool balance debit through the escrow transaction manager while the escrow row lock is held, before the Soroban withdraw.
  • Records fund outcomes as append-only metadata.attempts and updates reconciliation to discover and resolve pending attempts while retaining compatibility with legacy pending metadata.
  • Adds explicit Soroban address(), recipients(), and vec() markers; constructs recipient XDR vectors and tuple vectors directly and rejects ambiguous unmarked arguments.
  • Adds regression coverage for escrow locks/debit ordering, metadata preservation/reconciliation, and decoded XDR shape.

How to test

  1. npm test — not run, as requested.
  2. npm run test:e2e — not run, as requested.
  3. npm run build and npm run lint — not run; Node/npm are unavailable in this environment.

Checklist

  • npm run lint passes locally
  • npm run build passes locally
  • npm test passes locally
  • npm run test:e2e passes locally (needs Postgres — see README "Running Tests")
  • New behaviour has a spec, and a fixed bug has a regression test
  • A new environment variable is documented in .env.example
  • A schema change ships with a migration (npm run migration:generate)

Money path

  • New money-moving routes are @Idempotent() and guarded by RolesGuard
  • The module spec (*.module.spec.ts) still covers the providers and
    repositories this change relies on
  • Behaviour is correct in dry-run mode and against a configured contract
    (see README "Dry-run mode")

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@toxxxxicc
toxxxxicc requested a review from chonilius as a code owner November 22, 2026 08:41
@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@Rickyy1017 is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 22, 2026

Copy link
Copy Markdown

@toxxxxicc Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chonilius
chonilius merged commit fb977db into MergeFi:main Nov 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment