Update and consolidate dependencies (#3136)

## Proposed Changes

I did some gardening 🌳 in our dependency tree:

- Remove duplicate versions of `warp` (git vs patch)
- Remove duplicate versions of lots of small deps: `cpufeatures`, `ethabi`, `ethereum-types`, `bitvec`, `nix`, `libsecp256k1`.
- Update MDBX (should resolve #3028). I tested and Lighthouse compiles on Windows 11 now.
- Restore `psutil` back to upstream
- Make some progress updating everything to rand 0.8. There are a few crates stuck on 0.7.

Hopefully this puts us on a better footing for future `cargo audit` issues, and improves compile times slightly.

## Additional Info

Some crates are held back by issues with `zeroize`. libp2p-noise depends on [`chacha20poly1305`](https://crates.io/crates/chacha20poly1305) which depends on zeroize < v1.5, and we can only have one version of zeroize because it's post 1.0 (see https://github.com/rust-lang/cargo/issues/6584). The latest version of `zeroize` is v1.5.4, which is used by the new versions of many other crates (e.g. `num-bigint-dig`). Once a new version of chacha20poly1305 is released we can update libp2p-noise and upgrade everything to the latest `zeroize` version.

I've also opened a PR to `blst` related to zeroize: https://github.com/supranational/blst/pull/111
This commit is contained in:
Michael Sproul
2022-04-04 00:26:16 +00:00
parent ab434bc075
commit 4d0122444b
38 changed files with 283 additions and 686 deletions

View File

@@ -42,23 +42,23 @@ fn random_test(seed: u64, test_config: TestConfig) {
let tempdir = tempdir().unwrap();
let mut config = Config::new(tempdir.path().into());
config.validator_chunk_size = 1 << rng.gen_range(1, 4);
config.validator_chunk_size = 1 << rng.gen_range(1..4);
let chunk_size_exponent = rng.gen_range(1, 4);
let chunk_size_exponent = rng.gen_range(1..4);
config.chunk_size = 1 << chunk_size_exponent;
config.history_length = 1 << rng.gen_range(chunk_size_exponent, chunk_size_exponent + 3);
config.history_length = 1 << rng.gen_range(chunk_size_exponent..chunk_size_exponent + 3);
let slasher = Slasher::<E>::open(config.clone(), test_logger()).unwrap();
let validators = (0..num_validators as u64).collect::<Vec<u64>>();
let num_attestations = rng.gen_range(2, max_attestations + 1);
let num_attestations = rng.gen_range(2..max_attestations + 1);
let mut current_epoch = Epoch::new(0);
let mut attestations = vec![];
for _ in 0..num_attestations {
let num_attesters = rng.gen_range(1, num_validators);
let num_attesters = rng.gen_range(1..num_validators);
let mut attesting_indices = validators
.choose_multiple(&mut rng, num_attesters)
.copied()
@@ -70,17 +70,17 @@ fn random_test(seed: u64, test_config: TestConfig) {
let source = rng.gen_range(
current_epoch
.as_u64()
.saturating_sub(config.history_length as u64 - 1),
current_epoch.as_u64() + 1,
.saturating_sub(config.history_length as u64 - 1)
..current_epoch.as_u64() + 1,
);
let target = rng.gen_range(source, current_epoch.as_u64() + 1);
let target = rng.gen_range(source..current_epoch.as_u64() + 1);
(source, target)
} else {
let source = rng.gen_range(0, max(3 * current_epoch.as_u64(), 1));
let target = rng.gen_range(source, max(3 * current_epoch.as_u64(), source + 1));
let source = rng.gen_range(0..max(3 * current_epoch.as_u64(), 1));
let target = rng.gen_range(source..max(3 * current_epoch.as_u64(), source + 1));
(source, target)
};
let target_root = rng.gen_range(0, 3);
let target_root = rng.gen_range(0..3);
let attestation = indexed_att(&attesting_indices, source, target, target_root);
if check_slashings {
@@ -92,9 +92,9 @@ fn random_test(seed: u64, test_config: TestConfig) {
// Maybe add a random block too
if test_config.add_blocks && rng.gen_bool(0.1) {
let slot = rng.gen_range(0, 1 + 3 * current_epoch.as_u64() * E::slots_per_epoch() / 2);
let proposer = rng.gen_range(0, num_validators as u64);
let block_root = rng.gen_range(0, 2);
let slot = rng.gen_range(0..1 + 3 * current_epoch.as_u64() * E::slots_per_epoch() / 2);
let proposer = rng.gen_range(0..num_validators as u64);
let block_root = rng.gen_range(0..2);
slasher.accept_block_header(block(slot, proposer, block_root));
}