CLI panics with "attempt to add with overflow" when building tx for account at INT64_MAX sequence

Open
#2,417 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Start at cmd/soroban-cli/src/config/mod.rs:166 and trace the transaction-building path shown in the backtrace, especially Args::handle_and_print. Reproduce the INT64_MAX sequence case with the commands in the issue, then ensure bump-to 0 exits with a graceful error instead of panicking.

Written by the indexing model from the issue text.

Description

bug
What version are you using?

stellar 25.1.0

What did you do?

Built a transaction for an account whose sequence number is at INT64_MAX (9223372036854775807).

Any account holder can bump their sequence to INT64_MAX using the bump_sequence operation, so this condition is achievable on any network.

Reproduction steps:

# 1. Generate and fund account
stellar keys generate --fund test-account
# 2. Bump sequence to INT64_MAX
stellar tx new bump-sequence --source test-account --bump-to 9223372036854775807
# 3. Try to build another tx (bump-to 0 is a no-op, should succeed) — triggers panic
stellar tx new bump-sequence --source test-account --bump-to 0
What did you expect to see?

A graceful error message such as "account sequence number is at maximum, no further transactions can be submitted from this account".

What did you see instead?

The CLI panics (crashes):

thread 'main' panicked at cmd/soroban-cli/src/config/mod.rs:166:12:
attempt to add with overflow

Backtrace:

0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic_const::panic_const_add_overflow
3: soroban_cli::commands::tx::args::Args::handle_and_print::{{closure}}
4: soroban_cli::commands::tx::Cmd::run::{{closure}}
5: soroban_cli::commands::Root::run::{{closure}}
6: tokio::runtime::park::CachedParkThread::block_on
7: tokio::runtime::context::runtime::enter_runtime
8: soroban_cli::cli::main
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.