Skip to content

[Regression on closed #8] No outbox/reconciliation job exists to detect on-chain vs. Postgres escrow-state drift — closed by a partially-unrelated PR #371

Closed

Description

@abayomicornelius

Issue #8 ("Design and implement an outbox/reconciliation job to detect on-chain vs. Postgres escrow-state drift") shows CLOSED/COMPLETED, but no such job exists anywhere in the current codebase. A repo-wide search — grep -rln "reconcil\|outbox" src --include="*.ts" — returns only two incidental matches (escrow.service.ts and a migration filename) that are comments referencing the idea of reconciliation, not an implementation: EscrowService.fund's catch-block doc comment (discussed in the separately-filed still-open issue about fund()'s post-invoke-failure mismarking) explicitly says a mid-write failure should leave the escrow "in a distinct LOCKED_UNCONFIRMED/needs-reconciliation state... so a reconciliation job (per #8) can detect and repair it" — i.e. the code's own comments still point to #8 as unimplemented future work. grep -rln "@Cron\|@Interval\|ScheduleModule" src finds only bounty-expiry.scheduler.ts and idempotency-cleanup.service.ts — no scheduled job anywhere ever compares Postgres Escrow/Payment state against the real on-chain state via SorobanClientService.pollTransaction/a ledger query.

This gap is concretely reachable given the platform's own current failure modes: EscrowService.fund()'s catch block can mismark a successfully-locked escrow as FAILED on a post-invoke DB write failure (separately filed, confirming #42 is not actually fixed either); MaintenancePoolService.deposit() still orphans escrows on repeat deposits (separately filed, confirming #48 is not actually fixed); and dry-run mode (SorobanClientService.invoke when unconfigured) is indistinguishable from a real on-chain success in persisted data (#7). Every one of these produces exactly the "Postgres says X, chain says Y" drift #8 was meant to have automated detection for — and there is still no code path that would ever surface such drift to an operator besides manually querying both sides by hand.

Tracing the closing PR: gh issue view 8 --json closedByPullRequestsReferences points to PR #238. gh pr view 238 shows its title is "fix: stop .dockerignore excluding nest-cli.json/tsconfig files needed by builder stage" and its only changed file is .dockerignore — its body batch-closes Closes #8\nCloses #175\nCloses #176\nCloses #177, none of which except #176 the diff actually addresses. This is the same "closed by a partially-unrelated batch-closing PR" pattern already found repeatedly elsewhere in this repo's history (#1, #10, #25, #48, #56, #91, #102, #120, #126, #127, #175, #177).

Fix: implement the reconciliation job as originally scoped — a scheduled task (mirroring BountyExpiryScheduler's @Cron pattern) that, for every Escrow in a non-terminal status, polls the real on-chain state via SorobanClientService and flags (at minimum logs/alerts, ideally auto-corrects or queues for manual review) any row where Postgres's recorded status disagrees with what the chain actually shows.

Activity

  1. coderolisa commented on Sep 17, 2026

    @coderolisa

    Hi maintainer, I would love to resolve this issue within few hours. I am a Full-Stack Dev with contributions to Oss projects. Please assign. Thank you

  2. added
    bug
    architecture
    on Sep 17, 2026
  3. shobhamerabacha-star commented on Sep 17, 2026

    @shobhamerabacha-star

    Hello! I would like to work on this issue.

    I am interested in working on this issue.
    Plan:

    1. Implement backend logic for [Regression on closed #8] No outbox/reconciliation job exists to detect on-chain vs. Postgres escrow-state drift — closed by a partially-unrelated PR with strict schema validation and idempotent execution.
    2. Add integration test suites for standard invocations and boundary/error conditions.

    I am ready to start immediately—please feel free to assign this to me!

  4. added
    Stellar Wave
    on Sep 24, 2026
  5. Luna-netty commented on Sep 24, 2026

    @Luna-netty

    @Luna-netty has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi maintainer, I'd like to work on this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Luna-netty to this issue.

  6. Oprimecloud commented on Sep 24, 2026

    @Oprimecloud

    @Oprimecloud has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I’ve reviewed the issue requirements carefully and can work on resolving the problem while making sure the final implementation meets the stated criteria.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Oprimecloud to this issue.

  7. Danitello123 commented on Sep 24, 2026

    @Danitello123

    @Danitello123 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Please I would love to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Danitello123 to this issue.

  8. Akintobidavid commented on Sep 24, 2026

    @Akintobidavid

    @Akintobidavid has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I've reviewed this issue, and it's a genuine gap — #8 was batch-closed without implementation. I'll build a scheduled reconciliation job (mirroring BountyExpiryScheduler's @Cron pattern) that polls real on-chain state via SorobanClientService for every non-terminal Escrow, and flags (logs/alerts, or auto-corrects/queues for review) any row where Postgres's status disagrees with the chain.

    Please assign this issue to me, you won't be disappointed, thank you.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Akintobidavid to this issue.

  9. abayomicornelius commented on Sep 24, 2026

    @abayomicornelius
    ContributorAuthor

    @abayomicornelius has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hey, please assign, i can fix this very fast

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @abayomicornelius to this issue.

  10. 2ndwave09 commented on Sep 24, 2026

    @2ndwave09

    @2ndwave09 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello, I want to do this. I have experience working with backend systems, scheduled jobs, databases, and data consistency checks. I’ve gone through the issue and understand that the goal is to regularly compare persisted escrow state with the actual on-chain state and surface any drift for investigation. I can build the scheduled reconciliation flow around the existing Soroban client and escrow data, with appropriate handling for non-terminal records and failed or unavailable chain queries. I’d also add focused tests for matching state, detected drift, and dependency failures, and keep the implementation focused on the original scope. When do i start?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @2ndwave09 to this issue.

  11. drips-wave commented on Sep 24, 2026

    @drips-wave

    Congratulations, @abayomicornelius! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.

    🧑‍💻 @abayomicornelius: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  12. drips-wave commented on Sep 24, 2026

    @drips-wave

    This issue has been completed by @abayomicornelius as part of the Stellar Wave Program's 9th Wave 🥳

    😎 @abayomicornelius: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  13. removed
    Stellar Wave
    on Oct 15, 2026
  14. added
    Stellar Wave
    on Oct 15, 2026
  15. removed
    Stellar Wave
    on Oct 15, 2026
  16. added
    Stellar Wave
    on Oct 15, 2026
  17. removed
    Stellar Wave
    on Oct 15, 2026
  18. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar Wavearchitecturebug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions