There are certain crates which we re-export within `types` which creates a fragmented DevEx, where there are various ways to import the same crates.
```rust
// consensus/types/src/lib.rs
pub use bls::{
AggregatePublicKey, AggregateSignature, Error as BlsError, Keypair, PUBLIC_KEY_BYTES_LEN,
PublicKey, PublicKeyBytes, SIGNATURE_BYTES_LEN, SecretKey, Signature, SignatureBytes,
get_withdrawal_credentials,
};
pub use context_deserialize::{ContextDeserialize, context_deserialize};
pub use fixed_bytes::FixedBytesExtended;
pub use milhouse::{self, List, Vector};
pub use ssz_types::{BitList, BitVector, FixedVector, VariableList, typenum, typenum::Unsigned};
pub use superstruct::superstruct;
```
This PR removes these re-exports and makes it explicit that these types are imported from a non-`consensus/types` crate.
Co-Authored-By: Mac L <mjladson@pm.me>
Another good candidate for publishing separately from Lighthouse is `sensitive_url` as it's a general utility crate and not related to Ethereum. This PR prepares it to be spun out into its own crate.
I've made the `full` field on `SensitiveUrl` private and instead provided an explicit getter called `.expose_full()`. It's a bit ugly for the diff but I prefer the explicit nature of the getter.
I've also added some extra tests and doc strings along with feature gating `Serialize` and `Deserialize` implementations behind the `serde` feature.
Co-Authored-By: Mac L <mjladson@pm.me>
Fix Clippy for recently released Rust 1.90 beta. There may be more changes required when Rust 1.89 stable is released in a few days, but possibly not 🤞
#7518 breaks the key generation process in `validator_manager/test_vectors/generate.py` after updating to `ethstaker-deposit-cli`. This PR updates the key generation process, tested and successfully generated the deposit data JSON files.
* Remove ZeroizeString in favour of Zeroizing<String>
* cargo fmt
* remove unrelated line that slipped in
* Update beacon_node/store/Cargo.toml
thanks michael!
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Merge branch 'unstable' into remove-zeroizedstring
* Validator manager commands for standard key-manager APIs
* Merge latest unstable
* Fix Some in lib.rs
* Replace Arg::with_name with Arg::new
* Update takes_value
* Remove clap::App
* Change App to Command
* Add command in use
* Remove generic in ArgMatches
* Fix matches.get_flag
* Fixes
* fix error handling
* SetTrue in import
* Fix
* Fix builder-proposal flag (will delete the flag later)
* Minor fix
* Fix prefer_builder_proposals
* Remove unwrap
* Error handling from Michael
* Add cli help text
* Use None in import to simplify
* Delete unwrap
* Revert flags option
* Simplify help command code
* Remove flag header in move
* Merge remote-tracking branch 'origin/unstable' into pahor/validator-manager-standard-keystore
* Add log in VC when keystore is deleted
* Delete duplicated log when validator does not exist
* Simplify log code
* Rename remove to delete
* cargo-fmt
* Try to remove a function
* make-cli
* Error handling
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* Update CLI hel text
* make-cli
* Fix checks
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* Try to fix check errors
* Fix test
* Remove changes
* Update flag name
* CLI display order
* Move builde_proposals flag
* Add doc
* mdlint
* Update validator_manager/src/list_validators.rs
Co-authored-by: Mac L <mjladson@pm.me>
* Delete empty line
* Fix list
* Simplify delete
* Add support to delete more validators
* Fix test
* Rename response
* Add (s)
* Add test to delete multiple validators
* Book and cli
* Make cli
* Only log when keystore is deleted
* Revise deletion log
* Add validator pubkey to error message
* Merge import
* Thank you Mac
* Test
* Add flags
* Error handling for password
* make cli
* Merge remote-tracking branch 'origin/unstable' into vm
* make cli
* Fix test
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* Fix test
* vm test
* Debug trait thank you Michael
* Fix test
* Merge branch 'unstable' into vm
* test
* testing
* Combine import validator(s)
* make cli
* Add requires
* Update book
* mdlint
* Only show import log when import is successful
* delete testing
* Test for standard format
* Test standard format
* Test
* fix builder_proposals flag
* Fix test for standard format
* Add requires
* Fix vm test
* make cli
* Remove flag header
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* make cli
* Delete space
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* Merge branch 'unstable' into vm
* Rename delete_validator to delete_validators
* Rearrange
* Remove pub in run function
* Fix grammar
* Apply suggestions from code review
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Remove description
* Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
* Close bracket
* make cli
* Revise list code and test
* Revise import flag
* make cli
* Comment out test
* Update vm test
* Simplify
* Merge remote-tracking branch 'origin/unstable' into vm
* make cli
* Add test
* Add password as a requirement for keystore file
* Correct flags in docs
* typo
* Require manual confirmation to purge database
* Fix tests
* Rename to `purge-db-force and skip in non-interactive mode
* Do not skip when stdin_inputs is true
* Change prompt to be info logging to ensure consistent output
* Update warning text
* Move delete log after deletion
* expose builder booster flags in vc, enable options in validator endpoints, update tests
* resolve failing test
* fix issues related to CreateConfig and MoveConfig
* remove unneeded val, change how boost factor flag logic in the vc, add some additional documentation
* fix typos
* fix typos
* assume builder-proosals flag if one of other two vc builder flags are present
* fmt
* typo
* typo
* Fix CLI help text
* Prioritise per validator builder boost configurations over CLI flags.
* Add http test for builder boost factor with process defaults.
* Fix issue with PATCH request
* Add prefer builder proposals
* Add more builder boost factor tests.
---------
Co-authored-by: Mac L <mjladson@pm.me>
Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
Co-authored-by: Paul Hauner <paul@paulhauner.com>
## Issue Addressed
Synchronize dependencies and edition on the workspace `Cargo.toml`
## Proposed Changes
with https://github.com/rust-lang/cargo/issues/8415 merged it's now possible to synchronize details on the workspace `Cargo.toml` like the metadata and dependencies.
By only having dependencies that are shared between multiple crates aligned on the workspace `Cargo.toml` it's easier to not miss duplicate versions of the same dependency and therefore ease on the compile times.
## Additional Info
this PR also removes the no longer required direct dependency of the `serde_derive` crate.
should be reviewed after https://github.com/sigp/lighthouse/pull/4639 get's merged.
closes https://github.com/sigp/lighthouse/issues/4651
Co-authored-by: Michael Sproul <michael@sigmaprime.io>
Co-authored-by: Michael Sproul <micsproul@gmail.com>
## Issue Addressed
Addresses #2557
## Proposed Changes
Adds the `lighthouse validator-manager` command, which provides:
- `lighthouse validator-manager create`
- Creates a `validators.json` file and a `deposits.json` (same format as https://github.com/ethereum/staking-deposit-cli)
- `lighthouse validator-manager import`
- Imports validators from a `validators.json` file to the VC via the HTTP API.
- `lighthouse validator-manager move`
- Moves validators from one VC to the other, utilizing only the VC API.
## Additional Info
In 98bcb947c I've reduced some VC `ERRO` and `CRIT` warnings to `WARN` or `DEBG` for the case where a pubkey is missing from the validator store. These were being triggered when we removed a validator but still had it in caches. It seems to me that `UnknownPubkey` will only happen in the case where we've removed a validator, so downgrading the logs is prudent. All the logs are `DEBG` apart from attestations and blocks which are `WARN`. I thought having *some* logging about this condition might help us down the track.
In 856cd7e37d I've made the VC delete the corresponding password file when it's deleting a keystore. This seemed like nice hygiene. Notably, it'll only delete that password file after it scans the validator definitions and finds that no other validator is also using that password file.