Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Deprecate account management #10213

Merged
merged 35 commits into from
Feb 7, 2019
Merged

Deprecate account management #10213

merged 35 commits into from
Feb 7, 2019

Conversation

tomusdrw
Copy link
Collaborator

  • Move account management to a single crate (ethcore-accounts)
  • Avoid depenending on accounts directly (only main binary, parity-rpc and secret-store (one struct) depends on it currently)
  • Rely on raw secrets wherever possible (engine-signer and secret-store)
  • Add compilation feature to allow easier removal in the future (diff in binary size is 5MB (61 vs 56 on my machine))
  • Feature-gate RPCs that deal with accounts, add deprecation notice to others.

Related: #9997

Future work:

  1. Consider extracting accounts to a jsonrpc-proxy
  2. Integrate with CLEF (https://github.com/ethereum/go-ethereum/tree/master/cmd/clef)

@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 18, 2019
accounts/Cargo.toml Outdated Show resolved Hide resolved
@5chdn 5chdn added this to the 2.4 milestone Jan 20, 2019
@5chdn 5chdn added the B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. label Jan 20, 2019
@niklasad1
Copy link
Collaborator

hrm, I don't understand why the android build fails

accounts/src/lib.rs Outdated Show resolved Hide resolved
parity/account.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated
@@ -87,6 +88,8 @@ winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
daemonize = "0.3"

[features]
default = ["accounts"]
accounts = ["ethcore-accounts", "ethcore-secretstore/accounts", "parity-rpc/accounts"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This causes Parity to be built with "secretstore" feature enabled by default (since default features are "accounts" and it implies "ethcore-secretstore/accounts"). I guess we need something like accounts AND secretstore = ["ethcore-secretstore/accounts"], but I'm not sure it could be defined within Cargo.toml. Probably replace accounts => [..., "ethcore-secretstore/accounts", ...] with secretstore => [""ethcore-secretstore/accounts", "ethcore-accounts"]?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or even better - just remove "ethcore-secretstore/accounts" from "accounts" - so that there could be --features "", --features "accounts", --features "secretstore" and --features "secretstore accounts".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that would work, we need to enable ethcore-secretstore/accounts if both secretstore and accounts features are enabled. I changed it so that we require accounts in case we compile with secretstore

@@ -21,7 +21,7 @@ use std::sync::Arc;

use crypto::DEFAULT_MAC;
use ethkey::Secret;
use ethcore::account_provider::AccountProvider;
use accounts::AccountProvider;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curios - are we going to leave account management under accounts feature forever (i.e. for some long period), or it'll be totally purged from the codebase in the nearest future? In the latter case, we'll need to replace all address: H160, password: Password in SS RPCs with something like secret: H256 or do something else.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not defined yet, perhaps we are going to move some functionality to the proxy, but if we decide to remove accounts completely we need to provide some non-account-based alternatives like using secret directly. Don't know the definitive answer yet though.

Cargo.lock Outdated Show resolved Hide resolved
Copy link
Contributor

@insipx insipx left a comment

Choose a reason for hiding this comment

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

Looks good!

rpc/Cargo.toml Outdated Show resolved Hide resolved
Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>
pub(crate) mod light;
mod full;
mod prospective_signer;

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good change i.e., to break-up dispatcher into different mods however I haven't reviewed that code. I assume it is just moved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, mostly moved, but I had to do some small changes to support the new Accounts trait instead of using AccountProvider directly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

all right, we should probably run some manual tests on the light-client before merging because rpc integration tests are still missing

Copy link
Collaborator

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

Really good work and LGTM.

However we need to run some manual tests on the light-client before merging.

@niklasad1 niklasad1 added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 4, 2019
@5chdn
Copy link
Contributor

5chdn commented Feb 7, 2019

could you sign this off @ordian @svyatonik @insipx ?

Copy link
Collaborator

@svyatonik svyatonik left a comment

Choose a reason for hiding this comment

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

SS changes are OK. The rest also seems fine, though I haven't explored it in details.

@5chdn
Copy link
Contributor

5chdn commented Feb 7, 2019

Does not compile @tomusdrw

@5chdn 5chdn merged commit d5c19f8 into master Feb 7, 2019
@5chdn 5chdn deleted the td-accounts branch February 7, 2019 13:34
ordian added a commit that referenced this pull request Apr 5, 2019
* master:
  fix: parity-clib/examples/cpp/CMakeLists.txt (#10313)
  CI optimizations (#10297)
  Increase number of requested block bodies in chain sync (#10247)
  Deprecate account management (#10213)
  Properly handle check_epoch_end_signal errors (#10015)
  fix(osx and windows builds): bump parity-daemonize (#10291)
  Add missing step for  Using `systemd` service file (#10175)
  Call private contract methods from another private contract (read-only)  (#10086)
  update ring to 0.14 (#10262)
  fix(secret-store): deprecation warning (#10301)
  Update to jsonrpc-derive 10.0.2, fixes aliases bug (#10300)
  Convert to jsonrpc-derive, use jsonrpc-* from crates.io (#10298)
@grbIzl grbIzl mentioned this pull request Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants