Skip to content

Show diagnostic events when a transaction fails on-chain - #2700

Merged
fnando merged 3 commits into
mainfrom
detailed-transaction-submission-errors
Aug 26, 2026
Merged

Show diagnostic events when a transaction fails on-chain#2700
fnando merged 3 commits into
mainfrom
detailed-transaction-submission-errors

Conversation

@fnando

@fnando fnando commented Aug 24, 2026

Copy link
Copy Markdown
Member

What

When a transaction passes simulation but fails on-chain, the CLI now prints the transaction's diagnostic events (host/contract error, message, and any logs) on stderr, across contract invoke, tx send, and the tx op commands. Previously only the TransactionResult result codes were shown. Closes #495.

Why

The reason for a failure was never displayed — the diagnostic events were decoded and available on the RPC response but discarded before reaching the user.

Before (main):

🌎 Sending transaction…
❌ error: transaction submission failed: Some(
    TransactionResult {
        fee_charged: 10858,
        result: TxFailed(
            VecM([OpInner(InvokeHostFunction(ResourceLimitExceeded))]),
        ),
        ext: V0,
    },
)

After (this branch):

🌎 Sending transaction…
❌ Error event: [{"symbol":"error"},{"error":{"budget":"exceeded_limit"}}] = {"vec":[{"string":"operation instructions exceeds amount specified"},{"u64":"3880"},{"u64":"1"}]}
❌ error: transaction submission failed: Some(
    TransactionResult { ... InvokeHostFunction(ResourceLimitExceeded) ... },
)

The new Error event line surfaces the host's message (operation instructions exceeds amount specified, needs 3880 vs 1 allowed) — absent before.

Known limitations

Only Soroban transactions have diagnostic events; classic ops print nothing extra. The event line uses raw ScVal JSON rather than fully decoded text.

Copilot AI balanced review requested due to automatic review settings August 24, 2026 15:03
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Surfaces Soroban diagnostic events when on-chain transaction submission fails.

Changes:

  • Adds shared failure-event recovery after polling.
  • Formats error, contract, and log diagnostics.
  • Applies behavior to invoke, send, and transaction operation commands.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/soroban-cli/src/tx.rs Adds shared submission and event recovery.
cmd/soroban-cli/src/log/event.rs Formats failed transaction diagnostics.
cmd/soroban-cli/src/commands/tx/send.rs Uses enhanced submission for tx send.
cmd/soroban-cli/src/commands/tx/args.rs Uses enhanced submission for transaction operations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/soroban-cli/src/tx.rs
@fnando
fnando marked this pull request as draft August 24, 2026 21:22
@fnando
fnando force-pushed the detailed-transaction-submission-errors branch from 1d19742 to 363cb47 Compare August 26, 2026 03:01
@fnando fnando self-assigned this Aug 26, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Aug 26, 2026
@fnando
fnando marked this pull request as ready for review August 26, 2026 03:30
@fnando
fnando enabled auto-merge (squash) August 26, 2026 03:31
@fnando
fnando requested review from a team and leighmcculloch August 26, 2026 03:31

@leighmcculloch leighmcculloch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple questions otherwise looks good to me.

Comment thread cmd/soroban-cli/src/tx.rs Outdated
Comment thread cmd/soroban-cli/src/tx.rs
@fnando
fnando disabled auto-merge August 26, 2026 13:30
@fnando
fnando enabled auto-merge (squash) August 26, 2026 13:36
@fnando
fnando merged commit b37d549 into main Aug 26, 2026
229 of 233 checks passed
@fnando
fnando deleted the detailed-transaction-submission-errors branch August 26, 2026 13:38
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

soroban-cli: Print more detailed transaction submission errors

3 participants