Remove undocumented ledger / ledger:N positional shorthand#2560
Merged
Conversation
leighmcculloch
approved these changes
May 6, 2026
cc17850 to
d9a9170
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the undocumented ledger / ledger:N positional shorthand routing in UnresolvedMuxedAccount, making Ledger address derivation available only via explicit per-command flags (e.g. keys address --ledger, keys fund --ledger). This simplifies account resolution by eliminating the only async branch (Ledger) and converting a number of call sites back to synchronous resolution.
Changes:
- Remove
UnresolvedMuxedAccount::Ledger(u32)and theledger/ledger:Nparsing path; collapseresolve_muxed_account_syncintoresolve_muxed_account. - Update transaction-building / contract commands to use the new synchronous
source_account()andresolve_muxed_account()APIs (dropping now-unnecessaryasync/.await). - Update Ledger-related tests and add unit coverage ensuring
ledger/ledger:Nare no longer recognized as special shorthand.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/soroban-cli/src/tx/builder/asset.rs | Switch issuer resolution to the new sync resolve_muxed_account. |
| cmd/soroban-cli/src/config/mod.rs | Make source_account() synchronous and update callers accordingly. |
| cmd/soroban-cli/src/config/address.rs | Remove Ledger shorthand parsing/variant; rename sync resolver to resolve_muxed_account; add unit tests for shorthand removal. |
| cmd/soroban-cli/src/commands/tx/op/mod.rs | Make tx op dispatch synchronous (no remaining async dependency). |
| cmd/soroban-cli/src/commands/tx/op/add/mod.rs | Remove async from run() and from add_op call flow. |
| cmd/soroban-cli/src/commands/tx/mod.rs | Update tx operation execution to the new sync run(). |
| cmd/soroban-cli/src/commands/tx/args.rs | Convert source-account resolution and add_op to synchronous use of resolve_muxed_account. |
| cmd/soroban-cli/src/commands/snapshot/create.rs | Use sync resolve_muxed_account for optional account resolution. |
| cmd/soroban-cli/src/commands/keys/public_key.rs | Derive Ledger public key directly via signer::ledger::new(index).public_key() in the --ledger path. |
| cmd/soroban-cli/src/commands/contract/upload.rs | Use sync config.source_account() when fetching sequence number. |
| cmd/soroban-cli/src/commands/contract/restore.rs | Use sync config.source_account() when fetching sequence number. |
| cmd/soroban-cli/src/commands/contract/mod.rs | Update contract id dispatch to sync run(). |
| cmd/soroban-cli/src/commands/contract/invoke.rs | Use sync config.source_account() during account fetch. |
| cmd/soroban-cli/src/commands/contract/id/wasm.rs | Make run() sync and use sync config.source_account(). |
| cmd/soroban-cli/src/commands/contract/id.rs | Make run() sync and adjust wasm dispatch accordingly. |
| cmd/soroban-cli/src/commands/contract/extend.rs | Use sync config.source_account() when fetching sequence number. |
| cmd/soroban-cli/src/commands/contract/deploy/wasm.rs | Use sync config.source_account() for source-account type check. |
| cmd/soroban-cli/src/commands/contract/deploy/asset.rs | Use sync config.source_account() when fetching sequence number. |
| cmd/crates/soroban-test/tests/it/integration/ledger/entry.rs | Update tests to use sync resolve_muxed_account API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Drop the undocumented
ledger/ledger:Npositional shorthand forUnresolvedMuxedAccount. Any command that takes an account argument (keys fund,keys address,tx sign,contract invoke --source-account, …) used to silently route to a connected Ledger device when givenledgerorledger:N. After this change, the only way to derive an address from a Ledger is the explicit--ledgerflag.UnresolvedMuxedAccount::Ledger(u32)is removed entirely.keys address/keys fundnow derive the public key directly viasigner::ledger::new(index).public_key()in their--ledgerbranch.resolve_muxed_account_synccollapses intoresolve_muxed_account(the only async branch was Ledger), and several call sites lose now-unnecessaryasync/.await. The four dependent error variants (LedgerNotSupported,LedgerPrivateKeyRevealNotSupported,LedgerIsInvalidKeyName, and theledger::ErrorFromimpl) become unreachable and are removed.--sign-with-ledgerandkeys add ledger(theSecret::Ledgerflow) are out of scope and untouched.Closes #2559.
Why
The shorthand was introduced in #1627 and has been live since 2025-02-14, but it was never mentioned in
--help,FULL_HELP_DOCS.md, the README, or any example. With #2557 introducing an explicit--ledgerflag (and #2558 extending it tokeys fund), the positional shorthand becomes a confusing and undocumented second way to reach the device — and one that can't be scoped per-command.Known limitations
N/A