Skip to content

feat: STORAGE_PROVIDER:#697

Merged
Ceejaytech25 merged 2 commits into
ceejaylaboratory:mainfrom
ONEONUORA:STORAGE_PROVIDER
Jun 28, 2026
Merged

feat: STORAGE_PROVIDER:#697
Ceejaytech25 merged 2 commits into
ceejaylaboratory:mainfrom
ONEONUORA:STORAGE_PROVIDER

Conversation

@ONEONUORA

Copy link
Copy Markdown
Contributor

close #546
close #567
close #558
close #534

Description

This PR implements four tasks across the backend services and smart contracts to improve startup robustness, governance security, KycCustomer data access performance, and pending file lifecycle cleanup.


Proposed Changes

1. Validate STORAGE_PROVIDER Configuration at Startup

  • Added configuration assertion logic checking that the STORAGE_PROVIDER environment variable matches s3 or gcs and validates all necessary sub-config keys (buckets and credentials).
  • Integrated the validation function within the early startup lifecycle in backend/src/index.ts. If invalid, the process logs an error and exits with code 1.
  • Added unit tests verifying valid/invalid configurations.

2. Governance Smart Contract: Admin Transfer & Env Fixes

  • Added administrative owner migration (transfer_admin) endpoint verifying caller authorization via require_auth().
  • Implemented state tracking logic for storing and updating Admin inside the contract instance storage.
  • Fixed a potential arithmetic overflow inside the calculate_quorum helper using u128 math for high supply inputs.
  • Resolved compilation issues in testing modules (unresolved std macros, static Env constants, and SDK version mismatches) by introducing a dynamic thread-local context matching Soroban SDK v22+ requirements.
  • Added comprehensive unit tests validating authorized owner migration and unauthorized access failures.

3. Expiration Job for Stale Uploads

  • Created a periodic job in upload-expiry.scheduler.ts using node-cron scheduled to execute every minute.
  • Queries PENDING KycCustomer uploads that exceed their expiration timestamp and marks them as EXPIRED.
  • Registered the job during backend startup. Added scheduler unit tests using Jest fake timers.

4. Database Indexing for KycCustomer Table

  • Added index annotations (@@index([status])) on the status field in backend/prisma/schema.prisma to optimize lookup times.
  • Generated database migration configuration and rollback script under the backend/prisma/migrations/ directory.

Verification & Test Status

Backend Tests (Jest)

  • Executed Jest tests covering storage validation, controllers, and scheduler behaviors.
  • Result: 769 passed across all 73 active test suites.

Smart Contract Tests (Cargo)

  • Executed cargo unit tests and property fuzzing.
  • Result: Contract compilation completes successfully; all newly introduced admin transfer and math fuzz tests pass cleanly.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

@Ceejaytech25

Copy link
Copy Markdown
Contributor

@ONEONUORA , LGTM!

@Ceejaytech25 Ceejaytech25 merged commit 8a39b7b into ceejaylaboratory:main Jun 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants