Repository navigation
Description
Background
SorobanClientService.invoke short-circuits to a dry-run result
(status: DRY_RUN with a fake dry-run txHash) whenever isConfigured()
is false (missing ESCROW_CONTRACT_ID/TREASURY_SECRET).
EscrowService then persists escrow.fundTxHash and escrow.releaseTxHash
from that result unconditionally — the DRY_RUN status itself is stashed
in escrow.metadata for fund but is not checked anywhere before marking
Escrow/Payment rows as LOCKED/RELEASED/CONFIRMED.
Problem Statement
If ESCROW_CONTRACT_ID or TREASURY_SECRET is accidentally unset in a
supposedly-production environment (e.g. a bad deploy config, a secret that
failed to inject), the system will happily keep operating: bounties will
appear FUNDED, PAID with confirmed Payment rows and fake dry-run
transaction hashes, contributors' dashboards will show earnings
that don't correspond to any real on-chain settlement, and nobody will
notice until a contributor tries to actually spend funds that were never
sent. This is a severe silent-failure mode for a platform whose entire value
proposition is "money moves automatically and verifiably" — worse than an
outright crash, because it looks like success.
Requirements
- Add an explicit, loud safety mechanism: in NODE_ENV=production,
SorobanClientService.invoke must refuse to dry-run (throw a hard error
at startup or per-call) rather than silently degrading — mirror the
pattern already used in main.ts for the insecure default JWT secret
(INSECURE_DEFAULT_JWT_SECRET check). - In non-production environments where dry-run is intentional, propagate the
DRY_RUN status distinctly through Escrow/Payment status enums (or a
dedicated boolean flag) so it's queryable and clearly surfaced in any API
response / Swagger schema, never conflated with a real CONFIRMED
on-chain payment. - Add a startup health check / admin endpoint that reports whether the
escrow subsystem is in dry-run or live mode. - Write tests asserting the production guard actually throws, and that
dry-run payments are visibly marked as such end-to-end (entity ->
DTO/response).
Acceptance Criteria
- Starting the app with NODE_ENV=production and no
ESCROW_CONTRACT_ID/TREASURY_SECRET fails fast (fails startup or
the first escrow call, contributor's choice, but must be loud, not
silent). - Dry-run payments/escrows are distinguishable from real ones in the DB
schema and any API surface that exposes payment status. - Test coverage for both the production guard and the dry-run marking.
Technical Notes
Files: src/escrow/soroban-client.service.ts, src/escrow/escrow.service.ts,
src/common/enums (status enums), src/main.ts (existing pattern to
mirror).
Difficulty Justification
Requires reasoning about operational failure modes of a financial system,
not just code correctness — the "hard part" is recognizing that a silently
degraded mode is more dangerous than a crash and designing guardrails that
are strict in production but don't break the intentionally-supported local
dry-run development workflow described in the README.
Activity
alamuoyeemmanuel7-create commentedon Aug 27, 2026
@alamuoyeemmanuel7-create has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @alamuoyeemmanuel7-create to this issue.
bolajigate-cell commentedon Aug 27, 2026
@bolajigate-cell has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @bolajigate-cell to this issue.
codemagician1949 commentedon Aug 27, 2026
@codemagician1949 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @codemagician1949 to this issue.
drips-wave commentedon Aug 27, 2026
Congratulations, @codemagician1949! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @codemagician1949: 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 🌊
drips-wave commentedon Aug 27, 2026
This issue has been completed by @codemagician1949 as part of the Stellar Wave Program's 8th Wave 🥳
😎 @codemagician1949: 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.