CLI: inconsistencies in logging results and events from invocations

Open
#818 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start by reproducing soroban contract invoke across sandbox and network, with both successful and failing invocations, and compare event levels, diagnostic output, return values, errors, stdout, and stderr. Done means all four cases follow the stated INFO/DEBUG and output-stream behavior without duplicate or cryptic output.

Written by the indexing model from the issue text.

Description

cli

Expected behavior when invoking a contract using soroban contract invoke (for all cases: sandbox or network, success or failure):

  • Contract events should be logged at INFO level
  • Diagnostic events should be logged at DEBUG level (requiring the --verbose flag)
  • Return value should be printed to stdout (Error values to stderr, maybe?)

Current behavior:

  • Sandbox success: All events, diagnostic included, are logged at INFO level. Result printed to stdout.
  • Sandbox error: No events, not diagnostic nor contract, are logged. Error value printed to stdout
  • Network success: Events appear twice (kinda) in a less friendly format. First lumped together as simulatedEvents at DEBUG level. Again after the transaction result, but that appears to only be the first event, at DEBUG level. Result printed to stdout.
  • Network error (in preflight): All events printed to stdout. Error value is not printed at all, but a cryptic stack trace is printed to stdout:
Backtrace (newest first):
   0: soroban_env_host::host::frame::<impl soroban_env_host::host::Host>::call_n_internal
   1: soroban_env_host::host::frame::<impl soroban_env_host::host::Host>::invoke_function
   2: preflight::preflight_invoke_hf_op::{{closure}}
   3: preflight::catch_preflight_panic
   4: _cgo_a3255893d7fd_Cfunc_preflight_invoke_hf_op
             at tmp/go-build/cgo-gcc-prolog:99:11
   5: runtime.asmcgocall
             at ./runtime/asm_amd64.s:848
Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.