fix: Show correct default path in signer error messages#7849
Conversation
KirillLykov
left a comment
There was a problem hiding this comment.
I double checked, it fixes the problem. Thanks a lot!
|
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
|
automerge label removed due to a CI failure |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7849 +/- ##
=======================================
Coverage 83.0% 83.0%
=======================================
Files 809 809
Lines 356483 356497 +14
=======================================
+ Hits 296203 296227 +24
+ Misses 60280 60270 -10 🚀 New features to boost your workflow:
|
Fixes the problem with Solana CLI when configuration contains an invalid `keypair_path`: error messages suggest creating new keypairs at the misconfigured location instead of the user's actual default directory. This leads to confusion and keypairs being created in wrong locations. Modified error message generation in `efaultSigner::path()` to always suggest the system default path based on the user's actual home directory, regardless of any misconfigured paths in config files. (cherry picked from commit 7c3e9e7) # Conflicts: # clap-utils/src/keypair.rs # clap-v3-utils/src/keypair.rs
|
i don't understand why creating a key at the code default path does not fix there not being a keypair file at the path specified in the config. all tools should respect the values in the config file. if the user has specified that they wish to use a keypair file at a path that does not, or no longer, contains one, the correctness of that decision is not for us to decide. it may well be exactly that they intend to use the path and that creating a key there is the correct advice i think this change should be reverted |
|
Actually,
You are right, that's my misunderstanding of where this path to |
Problem
When Solana CLI configuration contains an invalid
keypair_path, error messages suggest creating new keypairs at the misconfigured location instead of the user's actual default directory. This leads to confusion and keypairs being created in wrong locations (e.g.,/home/sol/identity/id.jsoninstead of$HOME/.config/solana/id.json).Solution
Modified error message generation in
DefaultSigner::path()to always suggest the system default path (~/.config/solana/id.json) based on the user's actual home directory, regardless of any misconfigured paths in config files.@KirillLykov can you check this, closes #6637