Skip to content

Implement Stellar Bridge Execution Dry-Run Mode - #1079

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
bernardev254:issue-1070-implement-stellar-bridge-execution-dry
Aug 29, 2026
Merged

Implement Stellar Bridge Execution Dry-Run Mode#1079
mijinummi merged 1 commit into
MDTechLabs:mainfrom
bernardev254:issue-1070-implement-stellar-bridge-execution-dry

Conversation

@bernardev254

Copy link
Copy Markdown
Contributor

Summary

Implements a Stellar Bridge Execution Dry-Run Mode that allows applications to validate a Stellar bridge execution without submitting a transaction to the network. The service builds an invocation plan, simulates each step via Soroban RPC, runs the full pre-execution safety pipeline, and returns structured results — all while guaranteeing no transaction is submitted.

What changed and why

  • Added StellarBridgeDryRunService (src/execution/dry-run/stellar/stellar-bridge-dry-run.service.ts): Core dry-run engine that validates requests, builds a 3-step invocation plan (lock, bridge, confirm), simulates each step via SorobanSimulationAdapter, runs StellarPreExecutionSafetyPipeline (7 safety checks), computes a deterministic SHA-256 execution hash, and returns results with transactionSubmitted: false.
  • Added dry-run type definitions (src/execution/dry-run/stellar/types.ts): Defines DryRunExecutionPlanRequest, DryRunExecutionResult, DryRunPlanStep, DryRunSimulationSummary, and DryRunSafetyContextBuilder interfaces for type-safe dry-run interactions.
  • Added barrel exports (src/execution/dry-run/stellar/index.ts): Re-exports the service and all types for clean imports.
  • Added dry-run test suite (tests/execution/dry-run/stellar-bridge-dry-run.spec.ts): 11 tests covering plan building, simulation delegation, hash determinism, summary aggregation, safety pass/block on incompatible contracts, failed simulation handling, input validation (missing transferId, invalid amount, missing contract address), and result structure.
  • Removed stale markdown code fences (src/soroban/planning/soroban-invocation-planner.ts): Removed ```ts and ``` markers that were incorrectly present in the TypeScript source file.

How to test

CI checks run locally

# Build (matches CI: pnpm run build)
pnpm run build
# Expected: completes without errors

# Cargo tests (matches CI: cargo test)
cargo test
# Expected: 9 tests passed, 0 failed

# Dry-run tests
npx jest --testPathPattern='tests/execution/dry-run/' --no-coverage
# Expected: 11 tests passed, 0 failed

# Soroban simulation tests
npx jest --testPathPattern='tests/soroban/simulation/' --no-coverage
# Expected: 6 tests passed, 0 failed

# Safety pipeline tests
npx jest --testPathPattern='tests/execution/safety/' --no-coverage
# Expected: 4 tests passed, 0 failed

All checks passed locally. The CI workflow (.github/workflows/ci.yml) runs pnpm install --frozen-lockfile, pnpm run build, and cargo test — all of which pass. No lock files were modified. No formatting or linting issues were introduced in the changed files.

Closes #1070

Add StellarBridgeDryRunService that validates a Stellar bridge
execution without submitting a transaction. Builds an invocation
plan, simulates each step via Soroban RPC, runs the full 7-check
pre-execution safety pipeline, and returns structured results.

Key additions:
- src/execution/dry-run/stellar/stellar-bridge-dry-run.service.ts
  Core dry-run engine: request validation, invocation planning,
  step simulation, safety pipeline execution, and deterministic
  SHA-256 execution hash computation.
- src/execution/dry-run/stellar/types.ts
  DryRunExecutionPlanRequest, DryRunExecutionResult,
  DryRunPlanStep, DryRunSimulationSummary, and
  DryRunSafetyContextBuilder type definitions.
- src/execution/dry-run/stellar/index.ts
  Barrel re-exports for the dry-run module.
- tests/execution/dry-run/stellar-bridge-dry-run.spec.ts
  11 tests covering plan building, simulation delegation, hash
  determinism, summary aggregation, safety pass/block, input
  validation, and result structure.

Also removes stale markdown code fences from the invocation
planner source file.

Refs MDTechLabs#1070
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

@mijinummi
mijinummi merged commit 8a40afb into MDTechLabs:main Aug 29, 2026
1 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 Stellar Bridge Execution Dry-Run Mode

2 participants