Skip to content

"Add debuggability to contract simulations—now even failed calls tell…#994

Open
datagerl wants to merge 4 commits into
Pulsefy:mainfrom
datagerl:feature/add-contract-simulation-trace-logging
Open

"Add debuggability to contract simulations—now even failed calls tell…#994
datagerl wants to merge 4 commits into
Pulsefy:mainfrom
datagerl:feature/add-contract-simulation-trace-logging

Conversation

@datagerl

Copy link
Copy Markdown

✨ Issue: Improve debuggability of failed testnet contract invocations by capturing simulation traces in a structured way!

📋 Acceptance Criteria:

✅ Failed calls log requestId, contract, method, and simulation summary
✅ Logs avoid secrets and raw sensitive payloads
✅ Trace output is searchable by requestId
✅ Can be disabled or reduced in noisy environments

🛠️ Implementation Details:

  1. Configured Logging : Added new options to config.ts :

    • SOROBAN_SIMULATION_TRACE_LOGGING (boolean, enables/disables entirely)
    • SOROBAN_SIMULATION_TRACE_LEVEL ('basic' or 'detailed')
  2. Created Service : SimulationTraceLogger for structured trace handling!

    • Generates unique requestId for each simulation
    • Logs only non-sensitive data
    • Works with both basic and detailed levels
  3. Enhanced SorobanRpcClientService :

    • Updated SorobanClientOptions to accept simulationContext
    • Added simulation response to SorobanRpcError for better debugging
    • simulateContractRead automatically injects contract details into context
  4. Updated ContractRotationService : Uses the new logger!

  5. TypeScript Fixes :

    • Updated tsconfig.json to use commonjs/Node resolution
    • Added Node.js types
    • Removed unused code
    • Fixed imports from node:xyz to just xyz

🎯 Benefits:

  • Easier to debug failed simulations by searching requestId
  • No secrets leak in logs
  • Configurable for different environments

closes #858

… their story with structured logs, request IDs, and zero secrets! 📜✨"
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

@Cedarich

Copy link
Copy Markdown
Contributor

@datagerl fix workflow

@Cedarich

Copy link
Copy Markdown
Contributor

Please fix Workflow

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.

Backend: Request-scoped simulation trace logging for failed contract calls

2 participants