Skip to content

Propagate --hd-path to auth signers and alias resolution.#2437

Merged
fnando merged 3 commits intomainfrom
hd-path-contract
Mar 10, 2026
Merged

Propagate --hd-path to auth signers and alias resolution.#2437
fnando merged 3 commits intomainfrom
hd-path-contract

Conversation

@fnando
Copy link
Member

@fnando fnando commented Mar 9, 2026

What

Propate the HD path, so auth signers and alias resolution is consistent all around.

Why

https://stellarfoundation.slack.com/archives/C06GHH10005/p1772940381744689

Known limitations

N/A

@fnando fnando requested a review from leighmcculloch March 9, 2026 20:50
@fnando fnando self-assigned this Mar 9, 2026
@fnando fnando added the bug Something isn't working label Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 20:50
@fnando fnando added the cli Related to Soroban CLI label Mar 9, 2026
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Mar 9, 2026
Copy link
Contributor

Copilot AI left a comment

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 ensures the CLI’s --hd-path option is applied consistently when resolving account aliases and when constructing signers for Soroban auth, so derived addresses/signatures come from the same HD index across the flow.

Changes:

  • Thread hd_path: Option<usize> through UnresolvedScAddress::resolve so account alias resolution derives the correct address for the selected HD path.
  • Use config.hd_path() when building signers (source signer + auth signer resolution) instead of always defaulting to path 0.
  • Add an integration test asserting --hd-path affects both --addr alias resolution and auth signing.

Reviewed changes

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

File Description
cmd/soroban-cli/src/config/sc_address.rs Adds hd_path parameter to address/alias resolution and uses it when deriving the account ID from an identity key.
cmd/soroban-cli/src/config/mod.rs Propagates --hd-path into source_signer() so source auth signing uses the selected HD path.
cmd/soroban-cli/src/commands/contract/arg_parsing.rs Propagates --hd-path into --addr resolution and auth signer derivation.
cmd/crates/soroban-test/tests/it/integration/hello_world.rs Adds an integration test covering --hd-path propagation for auth invocation with --addr alias.

@fnando fnando merged commit 508fca8 into main Mar 10, 2026
177 of 193 checks passed
@fnando fnando deleted the hd-path-contract branch March 10, 2026 16:54
@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Done in DevX Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Related to Soroban CLI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants