Skip to content

cli: decdn whoami fails outright when the node and client keystores have different passwords #2008

Closed

Description

@yigitdot

Problem

decdn whoami resolves the keystore password once (env var → password file → one TTY prompt) and applies that single password to both <data_dir>/keystore.json (node/operator) and <data_dir>/client/keystore.json (client/buyer). See crates/cli/src/commands/whoami.rs (report, the "password is resolved once … then applied to whichever keystores exist" comment).

When the two keystores were created with different passwords — easy to end up with, since key-gen writes them at different times and prompts separately — the command aborts with:

Error: failed to load keystore at ~/.decdn/keystore.json: failed to decrypt eth keystore at ~/.decdn/keystore.json: Mac Mismatch

and prints nothing for the other keystore, even though its password was correct. Decrypting each file on its own with cast wallet address --keystore <path> succeeds, so the keys are fine; this is purely the single-password assumption.

Expected

  • A wrong password for one keystore should degrade that one line to a note (like the existing "needs a password" line), not fail the whole command — the doc comment already says the node id / paths should print before and regardless of password resolution.
  • On a TTY, prompt per keystore (or re-prompt for the second one when the first password fails to decrypt it).
  • DECDN_KEYSTORE_PASSWORD / --keystore-password-file could stay single-valued as the common case; a per-role source (e.g. --client-keystore-password-file) is optional.

Repro

  1. decdn key-gen with password A (node keystore).
  2. Create the client keystore under <data_dir>/client/ with password B.
  3. decdn whoami → enter either password → Mac Mismatch error, no addresses printed.

🤖 Generated with Claude Code

Activity

  1. added
    kind:bug
    area:cli
    prio:low
    on Sep 14, 2026
  2. moved this from Backlog to In progress in deCDNon Sep 20, 2026
  3. moved this from In progress to Done in deCDNon Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clikind:bugprio:low

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions