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>
Remove certain dependencies from `eth2`, and feature-gate others which are only used by certain endpoints.
| Removed | Optional | Dev only |
| -------- | -------- | -------- |
| `either` `enr` `libp2p-identity` `multiaddr` | `protoarray` `eth2_keystore` `eip_3076` `zeroize` `reqwest-eventsource` `futures` `futures-util` | `rand` `test_random_derive` |
This is done by adding an `events` feature which enables the events endpoint and its associated dependencies.
The `lighthouse` feature also enables its associated dependencies making them optional.
The networking-adjacent dependencies were removed by just having certain fields use a `String` instead of an explicit network type. This means the user should handle conversion at the call site instead. This is a bit spicy, but I believe `PeerId`, `Enr` and `Multiaddr` are easily converted to and from `String`s so I think it's fine and reduces our dependency space by a lot. The alternative is to feature gate these types behind a `network` feature instead.
Co-Authored-By: Mac L <mjladson@pm.me>
- Create trait `ValidatorStore` with all functions used by the `validator_services`
- Make `validator_services` generic on `S: ValidatorStore`
- Introduce `LighthouseValidatorStore`, which has identical functionality to the old `ValidatorStore`
- Remove dependencies (especially `environment`) from `validator_services` and `beacon_node_fallback` in order to be able to cleanly use them in Anchor
* Add cli flag for HTTP API token path (VC)
* Add http_token_path_flag test
* Add pre-check for directory case & Fix test utils
* Update docs
* Apply review: move http_token_path into validator_http_api config
* Lint
* Make diff lesser to replace PK_FILENAME
* Merge branch 'unstable' into feature/cli-token-path
* Applt review: help_vc.md
Co-authored-by: chonghe <44791194+chong-he@users.noreply.github.com>
* Fix help for cli
* Fix issues on ci
* Merge branch 'unstable' into feature/cli-token-path
* Merge branch 'unstable' into feature/cli-token-path
* Merge branch 'unstable' into feature/cli-token-path
* Merge branch 'unstable' into feature/cli-token-path
* 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