Skip to content

fix(link): ibc keys * fixes - #1410

Merged
swift1337 merged 5 commits into
mainfrom
fix/key-cli
Aug 25, 2026
Merged

fix(link): ibc keys * fixes#1410
swift1337 merged 5 commits into
mainfrom
fix/key-cli

Conversation

@swift1337

@swift1337 swift1337 commented Aug 20, 2026

Copy link
Copy Markdown
Member
  • allow keys operations w/o config directory or config file
  • --populate-config shorthand -p
  • fail to populate config on existing key to reduce confusion and ambiguity

Stack created with GitHub Stacks CLIGive Feedback 💬

@swift1337
swift1337 requested a review from a team as a code owner August 20, 2026 17:27
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR allows key-management commands to operate without an existing config directory or file and centralizes flag-based configuration overrides.

  • Adds optional config loading for the keys command family.
  • Refactors signer insertion into Config.AddSigner.
  • Changes existing-key and private-key handling for key creation/import.

Confidence Score: 3/5

The PR is not safe to merge until config load failures stop causing destructive fallback writes and existing keys can again be registered with --populate-config.

Optional loading can replace an existing unreadable or malformed operator config with defaults, while the new existing-key checks make the supported signer-registration repair flow unreachable.

Files Needing Attention: link/cmd/ibc/config.go, link/cmd/ibc/keys.go

Important Files Changed

Filename Overview
link/cmd/ibc/config.go Introduces optional loading but conflates an absent config with all load failures, allowing population to overwrite an existing invalid config.
link/cmd/ibc/keys.go Moves validation skipping to the command hook and regresses the existing-key population workflow for both new and import.
link/internal/config/config.go Extracts flag overrides and adds an immutable-style, duplicate-aware signer insertion helper.
link/cmd/ibc/main.go Adds a shorthand and updates the description for the populate-config flag without an independent defect.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Run keys new/import] --> B[Load optional config]
  B -->|Config absent| C[Default config]
  B -->|Config load error| C
  B -->|Loaded| D[Existing config]
  C --> E{populate-config?}
  D --> E
  E -->|Yes| F[Add signer]
  F --> G[Write complete config file]
  E -->|No| H[Operate on key only]
Loading

Reviews (1): Last reviewed commit: ee1ad8e | Re-trigger Greptile

Comment thread link/cmd/ibc/config.go Outdated
Comment thread link/cmd/ibc/keys.go Outdated
@linear-code

linear-code Bot commented Aug 20, 2026

Copy link
Copy Markdown

FOU-1414

FOU-1127

@gjermundgaraba gjermundgaraba 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.

I think the optional config stuff can be done in a simpler way, see #1420 for a suggested improvement.

Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
@swift1337
swift1337 merged commit fc89d64 into main Aug 25, 2026
18 of 19 checks passed
@swift1337
swift1337 deleted the fix/key-cli branch August 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants