-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secp v3 keystore files bulk loading in eth1 mode #892
Conversation
-- Add cli options -- Add SecpWalletBulkLoader and test -- Refactor some common code from BlsBulkloader
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpWalletBulkloader.java
Fixed
Show fixed
Hide fixed
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpWalletBulkloader.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the decent summary of changes 👍
core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java
Outdated
Show resolved
Hide resolved
...src/main/java/tech/pegasys/web3signer/commandline/config/PicoV3WalletBulkloadParameters.java
Outdated
Show resolved
Hide resolved
|
||
import picocli.CommandLine.Option; | ||
|
||
public class PicoV3WalletBulkloadParameters implements KeystoresParameters { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we want to regard wallets as a type of keystore then the CLI arg should reflect that and also be called --keystores-path. That would mean it's the mode that determines the reading of the keystore, rather than the option name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, think this should be --keystores-path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Modified various instance variables/class names to use v3Keystores
as well (instead of wallet
).
commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth1SubCommand.java
Outdated
Show resolved
Hide resolved
acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl/utils/HealthCheckResultUtil.java
Outdated
Show resolved
Hide resolved
commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth1SubCommand.java
Outdated
Show resolved
Hide resolved
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpWalletBulkloader.java
Outdated
Show resolved
Hide resolved
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpWalletBulkloader.java
Outdated
Show resolved
Hide resolved
|
||
final String jsonBody = healthcheckResponse.body().asString(); | ||
final int keysLoaded = | ||
getHealthCheckKeysCheckData(jsonBody, KEYS_CHECK_V3_WALLET_BULK_LOADING, "keys-loaded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this getHealthCheckKeysCheckData
be also used in the bulk loading ATs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've refactored other places where healthcheck was used.
final String jsonBody = healthcheckResponse.body().asString(); | ||
final int keysLoaded = | ||
getHealthCheckKeysCheckData(jsonBody, KEYS_CHECK_V3_WALLET_BULK_LOADING, "keys-loaded"); | ||
assertThat(keysLoaded).isEqualTo(publicKeys.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the error count also be checked as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
||
import picocli.CommandLine.Option; | ||
|
||
public class PicoV3WalletBulkloadParameters implements KeystoresParameters { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, think this should be --keystores-path
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/BlsKeystoreBulkLoader.java
Show resolved
Hide resolved
...ing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpV3KeystoresBulkLoader.java
Dismissed
Show dismissed
Hide dismissed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Description
SECP wallet files bulk loading in
eth1
mode. Introduced following cli options:--keystores-path
The path to a directory storing v3 wallet files. Wallet files must use a .json file extension.--keystores-passwords-path
The path to a directory with the corresponding password files for the wallet files. Filename must match the corresponding wallet filename but with a .txt extension. This cannot be set if --keystores-password-file is also specified.--keystores-password-file
The path to a file that contains the password that all wallets use. This cannot be set if --keystores-passwords-path is also specified.Summary of code changes:
commandline/src/main/java/tech/pegasys/web3signer/commandline/config/PicoV3KeystoresBulkloadParameters.java
V3 Keystores bulkloading CLI options. Implements
KeystoresParameters
interface which enforces same method names as BLS Bulk loading in ETH2 mode. The description for each parameter is different.commandline/src/main/java/tech/pegasys/web3signer/commandline/subcommands/Eth1SubCommand.java
Mixin and validation of cli options. Either password directory or password file can be specified (not both).
core/src/main/java/tech/pegasys/web3signer/core/Eth1Runner.java
bulkLoadSigners
method is modified to wireSecpWalletBulkloader
.signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/BlsKeystoreBulkLoader.java
Common code has been extracted.
signing/src/main/java/tech/pegasys/web3signer/signing/bulkloading/SecpV3KeystoresBulkLoader.java
Load v3 wallet files from specified directory by using either password file or corresponding password files from a directory.
acceptance-tests/src/test/java/tech/pegasys/web3signer/dsl
Added acceptance test that covers using password path (dir), password file with direct cli options and using config file.
Fixed Issue(s)
Fixes #833
Documentation
doc-change-required
label to this PR if updates are required.Changelog
Testing