Skip to content

fix: allow tx sign and tx hash without an RPC URL (#2455)#2642

Open
NicoMoli wants to merge 2 commits into
stellar:mainfrom
NicoMoli:fix/2455-tx-sign-no-rpc-url
Open

fix: allow tx sign and tx hash without an RPC URL (#2455)#2642
NicoMoli wants to merge 2 commits into
stellar:mainfrom
NicoMoli:fix/2455-tx-sign-no-rpc-url

Conversation

@NicoMoli

@NicoMoli NicoMoli commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • stellar tx sign and stellar tx hash no longer require an RPC URL. Both only need the network passphrase (it's mixed into the transaction hash that gets signed), and neither ever contacts an RPC server. Previously they errored with network passphrase is used but rpc-url is missing, forcing the --rpc-url "" workaround from stellar tx sign shouldn't require an RPC URL #2455.
  • Added network::Args::get_no_rpc() alongside the existing strict get(). Both share a private resolve(require_rpc) helper; the only difference is that a passphrase-only invocation resolves to a Network with an empty rpc_url instead of erroring. RPC-dependent commands keep the strict get() unchanged.
  • Switched tx sign and tx hash to get_no_rpc().
  • Note: this branch also includes a separate chore commit that regenerates FULL_HELP_DOCS.md, dropping the stale stellar xdr [CHANNEL] arg. It's unrelated to this fix but produced by make docs/the pre-commit hook, since the committed docs were stale on main.

Fixes #2455.

Test plan

  • cargo test -p soroban-cli config::network::tests — 25 passed (incl. 4 new: passphrase-only resolves with empty rpc_url; rpc-without-passphrase still errors; both-supplied preserves the URL; strict get() still rejects passphrase-only).
  • cargo test -p soroban-test --test it tx:: — 2 new offline integration tests pass (tx sign / tx hash succeed with only --network-passphrase).
  • Manual: echo $TX | stellar tx sign --network-passphrase "specified manually" --sign-with-key $SK and tx hash both succeed (signing hash matches the issue). tx send still errors on missing rpc-url — regression preserved.
  • cargo clippy -p soroban-cli --all-targets clean; cargo fmt --all --check clean.

Copilot AI review requested due to automatic review settings July 11, 2026 18:35
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jul 11, 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

This PR removes the unnecessary requirement for an RPC URL when running offline-only commands (stellar tx sign and stellar tx hash). It introduces an opt-in network resolver for non-RPC contexts while keeping the existing strict RPC-required behavior unchanged for RPC-dependent commands.

Changes:

  • Added network::Args::get_no_rpc() (backed by a shared resolve(require_rpc) helper) to allow passphrase-only resolution with an empty rpc_url.
  • Switched tx sign and tx hash to use get_no_rpc() so they work without --rpc-url.
  • Updated help docs and added unit + integration tests covering the new offline behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FULL_HELP_DOCS.md Regenerated CLI help docs to remove the stale stellar xdr [CHANNEL] argument.
cmd/soroban-cli/src/config/network.rs Introduces get_no_rpc() and shared resolver; adds unit tests for passphrase-only behavior vs strict RPC behavior.
cmd/soroban-cli/src/commands/tx/sign.rs Uses get_no_rpc() so signing works without an RPC URL.
cmd/soroban-cli/src/commands/tx/hash.rs Uses get_no_rpc() so hashing works without an RPC URL.
cmd/crates/soroban-test/tests/it/tx.rs Adds offline integration tests for tx sign and tx hash requiring only --network-passphrase.
cmd/crates/soroban-test/tests/it/main.rs Registers the new tx integration test module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

stellar tx sign shouldn't require an RPC URL

2 participants