这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@CriesofCarrots
Copy link
Contributor

Problem

Our signer interfaces are too restrictive to accommodate a rich signing experience. It is impossible to mix signer types (which is a common use-case in offline/paper-wallet workflow), and remote wallets (like Ledger) are not supported at all.

Summary of Changes

Co-conspirator: @t-nelson

  • Consolidate CLI signer argument parsing and support remote-wallet paths
  • Replace CLI Keypair structs with Box, to allow for various and mixed signer types
  • Doc updates

A follow-up PR will streamline signer handling in the CLI, collecting and deduplicating signers before any processing occurs (and thus eliminating all of the Option<Box<dyn Signer>>s in this PR).

@CriesofCarrots CriesofCarrots force-pushed the cli-remote-signing-less-general branch from 75d4948 to 6161f1e Compare February 21, 2020 20:17
Copy link
Contributor

@garious garious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve for this to go into the master branch and 1.0.0, but due to the size of this PR and the timing, need @mvines to approve whether it can go into v0.23.

Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mvines
Copy link
Contributor

mvines commented Feb 21, 2020

Can you wait to backport until after SLP2 boots on Monday please. We'll then have some soak time before 0.23 is used to boot mainnet-beta.

@CriesofCarrots
Copy link
Contributor Author

Can you wait to backport until after SLP2 boots on Monday please. We'll then have some soak time before 0.23 is used to boot mainnet-beta.

Certainly. There's a companion PR that I hope to get into master later today; will plan to cherry-pick them both together after SLP2 boot on Monday.

@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #8384 into master will decrease coverage by <.1%.
The diff coverage is 61.4%.

@@           Coverage Diff            @@
##           master   #8384     +/-   ##
========================================
- Coverage    80.3%   80.3%   -0.1%     
========================================
  Files         254     254             
  Lines       55683   55544    -139     
========================================
- Hits        44765   44628    -137     
+ Misses      10918   10916      -2

@CriesofCarrots CriesofCarrots merged commit 4ddbf8d into solana-labs:master Feb 21, 2020
CriesofCarrots added a commit to CriesofCarrots/solana that referenced this pull request Feb 26, 2020
* Add keypair_util_from_path helper

* Cli: impl config.keypair as a trait object

* SDK: Add Debug and PartialEq for dyn Signer

* ClapUtils: Arg parsing from pubkey+signers to Presigner

* Impl Signers for &dyn Signer collections

* CLI: Add helper for getting signers from args

* CLI: Replace SigningAuthority with Signer trait-objs

* CLI: Drop disused signers command field

* CLI: Drop redundant tests

* Add clap validator that handles all current signer types

* clap_utils: Factor Presigner resolution to helper

* SDK: `From` for boxing Signer implementors to trait objects

* SDK: Derive `Clone` for `Presigner`

* Remove panic

* Cli: dedup signers in transfer for remote-wallet ergonomics

* Update docs vis-a-vis ASK changes

* Cli: update transaction types to use new dynamic-signer methods

* CLI: Fix tests No. 1

what to do about write_keypair outstanding

* Work around `CliConfig`'s signer not necessarily being a `Keypair`

* CLI: Fix tests No. 2

* Remove unused arg

* Remove unused methods

* Move offline arg constants upstream

* Make cli signing fallible

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
CriesofCarrots added a commit that referenced this pull request Feb 27, 2020
…#8487)

* CLI: dynamic signing reboot (#8384)

* Add keypair_util_from_path helper

* Cli: impl config.keypair as a trait object

* SDK: Add Debug and PartialEq for dyn Signer

* ClapUtils: Arg parsing from pubkey+signers to Presigner

* Impl Signers for &dyn Signer collections

* CLI: Add helper for getting signers from args

* CLI: Replace SigningAuthority with Signer trait-objs

* CLI: Drop disused signers command field

* CLI: Drop redundant tests

* Add clap validator that handles all current signer types

* clap_utils: Factor Presigner resolution to helper

* SDK: `From` for boxing Signer implementors to trait objects

* SDK: Derive `Clone` for `Presigner`

* Remove panic

* Cli: dedup signers in transfer for remote-wallet ergonomics

* Update docs vis-a-vis ASK changes

* Cli: update transaction types to use new dynamic-signer methods

* CLI: Fix tests No. 1

what to do about write_keypair outstanding

* Work around `CliConfig`'s signer not necessarily being a `Keypair`

* CLI: Fix tests No. 2

* Remove unused arg

* Remove unused methods

* Move offline arg constants upstream

* Make cli signing fallible

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Reinstate `create-stale-account` w/ seed test (#8401)

automerge

* CLI: collect and deduplicate signers (#8398)

* Rename (keypair util is not a thing)

* Add method to generate_unique_signers

* Cli: refactor signer handling and remote-wallet init

* Fixup unit tests

* Fixup intergation tests

* Update keypair path print statement

* Remove &None

* Use deterministic key in test

* Retain storage-account as index

* Make signer index-handling less brittle

* Cache pubkey on RemoteKeypair::new

* Make signer_of consistent + return pubkey

* Remove &matches double references

* Nonce authorities need special handling

* Make solana root key accessible on Ledger (#8421)

* Use 44/501 key as ledger id

* Add error codes

* Ledger key path rework (#8453)

automerge

* Ledger hardware wallet docs (#8472)

* Update protocol documentation

* Correct app-version command const

* Rough initial Ledger docs

* Add more docs

* Cleanup

* Add remote-wallet to docs TOC

Co-authored-by: Greg Fitzgerald <greg@solana.com>

* Add flag to confirm key on device

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Greg Fitzgerald <greg@solana.com>
@CriesofCarrots CriesofCarrots deleted the cli-remote-signing-less-general branch February 28, 2020 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants