Skip to content

Frontend builds#40

Open
nikkybel wants to merge 4 commits into
karagozemin:masterfrom
nikkybel:frontend-builds
Open

Frontend builds#40
nikkybel wants to merge 4 commits into
karagozemin:masterfrom
nikkybel:frontend-builds

Conversation

@nikkybel

Copy link
Copy Markdown
Contributor

Summary

Adds strict environment validation across the coordinator, resolver, relayer, and frontend to ensure deployment-critical configuration errors are detected early and fail fast during startup or build time.

Motivation

Several packages relied on direct access to environment variables without centralized validation. This increased the risk of runtime failures and accidental misconfigurations during deployments.

Since mainnet support remains disabled pending audit and production approval, this change also introduces safeguards that prevent accidental mainnet activation through configuration mistakes.

Changes

Coordinator

  • Added schema-based environment validation during startup.
  • Improved error messages for missing or invalid configuration values.

Resolver

  • Added startup validation for required environment variables.
  • Standardized configuration loading and validation behavior.

Relayer

  • Added validation for:

    • RPC URL
    • Contract address
    • Timeout and health-check related configuration
  • Prevents startup when required values are missing or malformed.

Frontend

  • Added build-time validation for required network configuration.
  • Added guarded mainnet enablement logic.
  • Mainnet activation now requires an explicit deployment/audit confirmation variable in addition to VITE_MAINNET_ENABLED=true.

Documentation

  • Updated environment configuration documentation.

  • Added and clarified required variables in:

    • env.example
    • docs/DEPLOYMENT.md
    • Relevant package documentation

Testing

  • Added validation coverage for invalid environment configurations.
  • Ensures affected packages fail with clear and actionable errors.

Acceptance Criteria

  • Services fail at startup when required environment variables are missing or invalid.
  • Frontend build fails when required network configuration is missing.
  • Mainnet enablement requires explicit deployment confirmation.
  • Validation tests cover invalid configuration scenarios.
  • Environment documentation updated in a canonical location.

Affected Areas

  • coordinator/src/config.ts
  • resolver/src/config.ts
  • relayer/src/index.ts
  • relayer/src/phase6-bridge-service.ts
  • frontend/src/config/networks.ts
  • env.example
  • docs/DEPLOYMENT.md

Impact

This change improves deployment safety, reduces runtime configuration errors, and makes CI/CD failures easier to diagnose by surfacing configuration issues before services begin processing requests.
close #33

nikkybel added 2 commits June 24, 2026 12:52
- Add SorobanOrderStatus and SorobanOrderData types to packages/sdk/src/types/index.ts
- Update SorobanHTLCClient.getOrder() to return Promise<SorobanOrderData | null>
- Export parseSorobanOrder() pure helper for normalising raw scValToNative payloads
- Handle Uint8Array/Buffer/string hex for byte fields, bigint coercion for numerics
- Treat empty preimage bytes (Funded state) as empty string
- Add 14 tests covering funded, claimed, refunded, null, malformed, and edge cases
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the karagoz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@nikkybel 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

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the PR. I tested the current head against current master. The config tests pass, but I cannot merge this yet because the frontend build fails.

Commands run:

pnpm install --frozen-lockfile
pnpm --filter coordinator test
pnpm --filter coordinator build
pnpm --filter resolver test
pnpm --filter resolver build
pnpm --filter relayer test
pnpm --filter relayer build
pnpm --filter frontend exec vitest run
pnpm --filter frontend build

Failure:

src/config/env.ts(14,6): error TS6196: `Env` is declared but never used.

Please remove or use the unused Env type so pnpm --filter frontend build passes. Also note that root pnpm test still fails because the existing @oversync/stellar package has no Jest tests and exits with code 1; the package-specific tests above passed up to the frontend build failure.

@Hunter-baddie

Copy link
Copy Markdown

Alright

@nikkybel

Copy link
Copy Markdown
Contributor Author

@karagozemin I have implemented the necessary changes, can you be please check if it's ok ?

@karagozemin

Copy link
Copy Markdown
Owner

Re-checked the latest head as requested. The previous frontend build blocker is still present, so I still cannot merge this.

Commands that passed:

pnpm --filter coordinator test
pnpm --filter coordinator build
pnpm --filter relayer test
pnpm --filter relayer build
pnpm --filter frontend exec vitest run

Still failing:

pnpm --filter frontend build

Error:

src/config/env.ts(14,6): error TS6196: 'Env' is declared but never used.

Please remove or use the unused Env type so the frontend package builds cleanly. I also could not run pnpm --filter resolver test in this checkout because vitest was not available for that package, but the frontend build failure is enough to block merge for now.

@nikkybel

Copy link
Copy Markdown
Contributor Author

Hey @karagozemin I have implemented the necessary changes, can you be please check if it's ok ?

@karagozemin

Copy link
Copy Markdown
Owner

Thanks for the update. I rechecked the merge ref under the karagozemin account.

Still blocked: pnpm --filter @oversync/coordinator test fails immediately because coordinator/src/config.ts does not parse. Vite/esbuild reports:

/private/tmp/oversync-review/coordinator/src/config.ts:54:4: ERROR: Expected "}" but found ";"

The failure happens before the new config tests can run, so I could not continue through the coordinator/relayer/resolver/frontend build chain. Please fix the configSchema closing braces / .superRefine(...) placement in coordinator/src/config.ts, then I can re-run the full package checks and merge if green.

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.

[Wave 6 10/10] Strict environment validation across services and frontend builds

3 participants