Skip to content

feat: add Soroban WAL and crash recovery foundation - #857

Open
edehvictor wants to merge 2 commits into
accesslayerorg:mainfrom
edehvictor:fix/soroban-wal-756
Open

feat: add Soroban WAL and crash recovery foundation#857
edehvictor wants to merge 2 commits into
accesslayerorg:mainfrom
edehvictor:fix/soroban-wal-756

Conversation

@edehvictor

@edehvictor edehvictor commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Closes #756

Summary

Introduces the durable Soroban write-ahead-log foundation and recovery path so transaction submissions can be recorded, resolved, and applied idempotently after crashes.

Changes

  • add the SorobanWALEntry Prisma model, state enums, indexes, and migration
  • add a serializable Prisma WAL store with row locking and atomic confirmation side effects
  • add a WAL orchestration service with idempotency-key deduplication, submission tracking, Horizon polling, exponential retry, failure rollback, and recovery
  • start a recovery worker on boot and every 60 seconds for stale PENDING and SUBMITTED entries
  • add default buy/sell side effects for ownership, supply, price snapshot timestamp, and activity history
  • add focused crash recovery and exactly-once tests
  • repair existing TypeScript blockers in config and creator route error handling so the project builds

Testing

  • jest src/modules/soroban-wal/soroban-wal.service.test.ts --runInBand (5 passing)
  • eslint on all changed TypeScript files
  • tsc --noEmit
  • prisma validate with a local placeholder DATABASE_URL

Follow-up scope

The concrete Soroban buy/sell submission adapters are still placeholders in this repository. When those adapters are implemented, they should call SorobanWALService.execute with their XDR builder and validation callback so every live submission passes through this WAL boundary.

@Chucks1093

Copy link
Copy Markdown
Member

✅ CI Passed — ⚠️ Merge Conflict

CI is green but this PR has a merge conflict with main and cannot be auto-merged.

To fix:

  1. git fetch origin && git checkout your-branch && git merge origin/main
  2. Resolve conflicts, run npm run build and npm test to verify
  3. Push — will be auto-merged once clean

# Conflicts:
#	src/config.schema.ts
#	src/constants/error.constants.ts
#	src/modules/creator/creator.routes.ts
@edehvictor

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict by syncing the current upstream main branch and retaining its latest implementations in the three conflicted files. The Soroban WAL changes remain intact. Merge commit: 1a09f7b (authored by nomsoscript).

Verification:

  • Prisma client generation: passed
  • ESLint: passed
  • TypeScript build: passed
  • Soroban WAL tests: 5 passed
  • GitHub verify check: 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

Development

Successfully merging this pull request may close these issues.

Implement a write-ahead log (WAL) for all Soroban transaction submissions to guarantee exactly-once execution and full crash recovery

3 participants