Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: improve account locking #1513

Merged
merged 97 commits into from Nov 17, 2021
Merged

fix: improve account locking #1513

merged 97 commits into from Nov 17, 2021

Conversation

MicaiahReid
Copy link
Contributor

@MicaiahReid MicaiahReid commented Nov 6, 2021

Closes #1490 and #996

  • Renames --secure to --lock, keeping --secure as legacy alias.
  • Adds wallet.passphrase option.
    • Passphrase will be used to encrypt all accounts on startup and when locking accounts.
  • Adds evm_addAccount
    • This adds an unknown account as a known account, giving a fake private key to the account
  • Adds evm_removeAccount
    • Thie removes a known account from the personal namespace
  • Removes evm_unlockUnknownAccount and evm_lockUnknownAccount
  • Skips account encryption on startup if --lock and --passphrase are not specified.

User-supplied passphrase is now used to encrypt wallet. If no
passphrase is supplied and the `--lock` options is not specified,
initial accounts are not encrypted to improve startup speeds.

A keyfile record is now added for every account. Previously, this
wasn't done, making it impossible to actually unlock initial
accounts. This fixes #996.

Updates api with the above changes to the wallet.
@MicaiahReid MicaiahReid marked this pull request as ready for review November 10, 2021 17:26
src/chains/ethereum/ethereum/src/api.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/api.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/transaction-pool.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/wallet.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/wallet.ts Show resolved Hide resolved
src/chains/ethereum/options/src/wallet-options.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/api.ts Outdated Show resolved Hide resolved
src/chains/ethereum/ethereum/src/wallet.ts Outdated Show resolved Hide resolved
@davidmurdoch davidmurdoch changed the title Fix/improve account locking fix: improve account locking Nov 11, 2021
Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com>
Copy link
Member

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

Left some standalone comments and suggestions.

I wonder if we should revert the changes to docs, since the release process creates them automatically. I'm thinking docs should represent the released version of ganache only? At least until we get stable out, and then we may want to host and track multiple docs versions at a time (7.0.0, 7.0.1, 7.0.2-alpha.0, 7.0.2-nightly.4, etc). Thoughts?

Also can you revert the changes to the package-lock.json and npm-shrinkwrap.json files, as I have a PR out that reverts the change that causes them to be wrong in the first place, and I should probably add these lock file changes to that PR.

@MicaiahReid
Copy link
Contributor Author

Left some standalone comments and suggestions.

I wonder if we should revert the changes to docs, since the release process creates them automatically. I'm thinking docs should represent the released version of ganache only? At least until we get stable out, and then we may want to host and track multiple docs versions at a time (7.0.0, 7.0.1, 7.0.2-alpha.0, 7.0.2-nightly.4, etc). Thoughts?

Also can you revert the changes to the package-lock.json and npm-shrinkwrap.json files, as I have a PR out that reverts the change that causes them to be wrong in the first place, and I should probably add these lock file changes to that PR.

I've reverted docs, package-lock.json, and npm-shrinkwrap.json changes!

Copy link
Member

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

I really appreciate how you are always a gentleman. You are proof that chivalry is not dead.

@MicaiahReid MicaiahReid merged commit 2399908 into develop Nov 17, 2021
@MicaiahReid MicaiahReid deleted the fix/improve-account-locking branch November 17, 2021 21:06
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.

evm_(un)lockUnknownAccount should be named better and work alongside the personal_ namespace
4 participants