Skip to content

[22.0] stellar keys generate should no longer fund #1407

Closed

Description

@chadoh

(Original reported issue by @chadoh below)

Currently, stellar keys generate not only generate keys, but also funds them. This is a bit confusing for the user (e.g. the original error Chad has encountered), and makes thing more complicated because same thing can be done in multiple ways.
The proposal is to remove fund functionality from keys generate, as well as all network related flags (no network connection is needed anymore, we just generating key pair), and --no-fund (this is a default behavior now).
User can still fund keys with stellar keys fund

Because this is a breaking change, we can't make it before 22.0


What version are you using?

$ stellar --version
stellar 21.0.0 (c558dd92613d91a34011cf5105869a5f57af230c)
soroban-env 21.1.0 (8d76e4037417b80dc25c979cc44b8e1281e8ad84)
soroban-env interface version 90194313216
stellar-xdr 21.1.0 (4dcbb918edcd793fdf064b3ee28ceacc6bd9d1bb)
xdr curr (70180d5e8d9caee9e8645ed8a38c36a8cf403cd9)

What did you do?

stellar keys generate alice
image

What did you expect to see?

If no network provided, should generate keys and quietly skip funding.

If I provide --no-fund, same behavior.

What did you see instead?

Errors unless network provided

Activity

  1. added
    bug
    on Jun 26, 2024
  2. willemneal commented on Jun 26, 2024

    @willemneal
    Contributor

    This is because we flatten in the network and told clap we expected either rpc url and network passphrase or network. One solution is to remove from clap and instead the error will move from parsing to just when a the network needs to be resolved. So it should be an easy fix since we already handle the latter error.

  3. leighmcculloch commented on Jul 11, 2024

    @leighmcculloch
    Member

    Another option is we remove funding from generating. I find it odd that every time I generate a key, I get an account on testnet, when sometimes I don't want an account created either now or not yet.

  4. willemneal commented on Jul 11, 2024

    @willemneal
    Contributor

    Yeah perhaps we should flip the flag. This way users who want to have it work in one step can still use just one command.

  5. self-assigned this
    on Jul 30, 2024
  6. leighmcculloch commented on Jul 31, 2024

    @leighmcculloch
    Member

    If no network provided, should generate keys and quietly skip funding.

    A downside of this is that when someone has a network set as an env var, it'd still be picked up there, so I could feel like I'm typing a simple generate command but then get hit with funding because I set the env var for commands that I expected to use the network.

  7. ifropc commented on Jul 31, 2024

    @ifropc
    Contributor

    I think the idea was to flip the logic to always not fund as a breaking change in 22.0
    User can still provide --fund to fund the new accounts explicitly. WDYT @leighmcculloch ?

  8. leighmcculloch commented on Jul 31, 2024

    @leighmcculloch
    Member

    Adding a --fund flag isn't too different to folks using the fund command, so if we're removing the default fund behavior, I'd suggest we leave off the --fund flag so there's one way to do the thing rather than two.

    But a flipped flag would be fine too, it's just two ways to do the same thing.

  9. ifropc commented on Jul 31, 2024

    @ifropc
    Contributor

    Hmm yeah that makes sense, you can just stellar keys generate alice && stellar keys fund alice, which is just a bit more verbose than stellar keys generate alice --fund. IMO it makes sense that generate only generates the key and doesn't fund it :)

  10. willemneal commented on Jul 31, 2024

    @willemneal
    Contributor

    Yeah we should strive to make each command do one thing as much as possible. I am still a little annoyed that deploy hash --wasm and does the install as well. Being explicit as much as possible helps people understand the steps.

  11. changed the title [-]generate keys --no-fund[/-] [+][22.0] `stellar keys generate` should no longer fund[/+] on Jul 31, 2024
  12. fnando commented on Sep 11, 2024

    @fnando
    Member

    I feel the case where keys are funded is more common than the other way around. I believe we should fix --no-fund rather than changing the behavior. 🤔

    If not, I vote for adding --fund instead, because that's better than having to issue two commands.

  13. 5 remaining items

  14. fnando commented on Sep 26, 2024

    @fnando
    Member

    @ifropc maybe this a good reason for #1616. It's easier to make one single argument optional when needed. 🤔

  15. ifropc commented on Sep 26, 2024

    @ifropc
    Contributor

    ^ One of the reasons I want to see that change actually 😆

  16. willemneal commented on Sep 27, 2024

    @willemneal
    Contributor

    We can indeed make all network args optional, but then we need to do validation ourselves, which will give a different input compared to clap (don't think it's a major downside, but still)

    I'm saying we are already doing the validation. So removing the clap requires should not break anything, though we might need to improve the error message.

  17. github-actions commented on Dec 5, 2024

    @github-actions
    Contributor

    This issue is stale because it has been assigned for 30 days with no activity. It will be closed in 30 days unless the stale label is removed, and the assignee is removed or updated.

  18. moved this from Backlog (Not Ready) to Done in DevXon Jan 5, 2025
  19. reopened this on Jan 6, 2025
  20. linked a pull request that will close this issueMake `keys generate` to no longer fund #1887on Feb 22, 2025
  21. moved this from Done to Needs Review in DevXon Feb 27, 2025
  22. moved this from Needs Review to Done in DevXon Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

breaking changebug

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions