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

825
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -91,10 +91,11 @@ members = [
[patch]
[patch.crates-io]
fixed-hash = { git = "https://github.com/paritytech/parity-common", rev="df638ab0885293d21d656dc300d39236b69ce57d" }
warp = { git = "https://github.com/macladson/warp", rev ="7e75acc" }
warp = { git = "https://github.com/macladson/warp", rev="7e75acc368229a46a236a8c991bf251fe7fe50ef" }
eth2_ssz = { path = "consensus/ssz" }
eth2_ssz_derive = { path = "consensus/ssz_derive" }
eth2_ssz_types = { path = "consensus/ssz_types" }
eth2_hashing = { path = "crypto/eth2_hashing" }
tree_hash = { path = "consensus/tree_hash" }
tree_hash_derive = { path = "consensus/tree_hash_derive" }
eth2_serde_utils = { path = "consensus/serde_utils" }

View File

@ -19,7 +19,7 @@ serde_json = "1.0.58"
[dependencies]
merkle_proof = { path = "../../consensus/merkle_proof" }
store = { path = "../store" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
lazy_static = "1.4.0"
smallvec = "1.6.1"
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
@ -30,7 +30,7 @@ serde_derive = "1.0.116"
slog = { version = "2.5.2", features = ["max_level_trace"] }
sloggers = { version = "2.1.1", features = ["json"] }
slot_clock = { path = "../../common/slot_clock" }
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
eth2_ssz = "0.4.1"
eth2_ssz_types = "0.2.2"
eth2_ssz_derive = "0.3.0"
@ -42,11 +42,11 @@ eth1 = { path = "../eth1" }
futures = "0.3.7"
genesis = { path = "../genesis" }
int_to_bytes = { path = "../../consensus/int_to_bytes" }
rand = "0.7.3"
rand = "0.8.5"
proto_array = { path = "../../consensus/proto_array" }
lru = "0.7.1"
tempfile = "3.1.0"
bitvec = "0.19.3"
bitvec = "0.20.4"
bls = { path = "../../crypto/bls" }
safe_arith = { path = "../../consensus/safe_arith" }
fork_choice = { path = "../../consensus/fork_choice" }

View File

@ -13,7 +13,7 @@ store = { path = "../store" }
network = { path = "../network" }
timer = { path = "../timer" }
lighthouse_network = { path = "../lighthouse_network" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
types = { path = "../../consensus/types" }
eth2_config = { path = "../../common/eth2_config" }
slot_clock = { path = "../../common/slot_clock" }

View File

@ -7,7 +7,7 @@ edition = "2021"
[dev-dependencies]
eth1_test_rig = { path = "../../testing/eth1_test_rig" }
toml = "0.5.6"
web3 = { version = "0.17.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
web3 = { version = "0.18.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
sloggers = { version = "2.1.1", features = ["json"] }
environment = { path = "../../lighthouse/environment" }
@ -22,7 +22,7 @@ merkle_proof = { path = "../../consensus/merkle_proof"}
eth2_ssz = "0.4.1"
eth2_ssz_derive = "0.3.0"
tree_hash = "0.4.1"
parking_lot = "0.11.0"
parking_lot = "0.12.0"
slog = "2.5.2"
tokio = { version = "1.14.0", features = ["full"] }
state_processing = { path = "../../consensus/state_processing" }

View File

@ -17,7 +17,7 @@ eth2_serde_utils = "0.1.1"
serde_json = "1.0.58"
serde = { version = "1.0.116", features = ["derive"] }
eth1 = { path = "../eth1" }
warp = { git = "https://github.com/macladson/warp", rev ="dfa259e", features = ["tls"] }
warp = { version = "0.3.2", features = ["tls"] }
jsonwebtoken = "8"
environment = { path = "../../lighthouse/environment" }
bytes = "1.1.0"
@ -28,10 +28,10 @@ lru = "0.7.1"
exit-future = "0.2.0"
tree_hash = "0.4.1"
tree_hash_derive = { path = "../../consensus/tree_hash_derive"}
parking_lot = "0.11.0"
parking_lot = "0.12.0"
slot_clock = { path = "../../common/slot_clock" }
tempfile = "3.1.0"
rand = "0.7.3"
rand = "0.8.5"
zeroize = { version = "1.4.2", features = ["zeroize_derive"] }
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
lazy_static = "1.4.0"

View File

@ -17,7 +17,7 @@ rayon = "1.4.1"
state_processing = { path = "../../consensus/state_processing" }
merkle_proof = { path = "../../consensus/merkle_proof" }
eth2_ssz = "0.4.1"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
tree_hash = "0.4.1"
tokio = { version = "1.14.0", features = ["full"] }
slog = "2.5.2"

View File

@ -28,7 +28,7 @@ eth2_ssz = "0.4.1"
bs58 = "0.4.0"
futures = "0.3.8"
execution_layer = {path = "../execution_layer"}
parking_lot = "0.11.0"
parking_lot = "0.12.0"
safe_arith = {path = "../../consensus/safe_arith"}

View File

@ -26,14 +26,14 @@ lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
smallvec = "1.6.1"
tokio-io-timeout = "1.1.1"
lru = "0.7.1"
parking_lot = "0.11.0"
parking_lot = "0.12.0"
sha2 = "0.9.1"
snap = "1.0.1"
hex = "0.4.2"
tokio-util = { version = "0.6.2", features = ["codec", "compat", "time"] }
tiny-keccak = "2.0.2"
task_executor = { path = "../../common/task_executor" }
rand = "0.7.3"
rand = "0.8.5"
directory = { path = "../../common/directory" }
regex = "1.5.5"
strum = { version = "0.24.0", features = ["derive"] }

View File

@ -29,7 +29,7 @@ error-chain = "0.12.4"
tokio = { version = "1.14.0", features = ["full"] }
tokio-stream = "0.1.3"
smallvec = "1.6.1"
rand = "0.7.3"
rand = "0.8.5"
fnv = "1.0.7"
rlp = "0.5.0"
lazy_static = "1.4.0"

View File

@ -9,7 +9,7 @@ derivative = "2.1.1"
itertools = "0.10.0"
lazy_static = "1.4.0"
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
types = { path = "../../consensus/types" }
state_processing = { path = "../../consensus/state_processing" }
eth2_ssz = "0.4.1"

View File

@ -11,7 +11,7 @@ beacon_chain = {path = "../beacon_chain"}
[dependencies]
db-key = "0.0.5"
leveldb = { version = "0.8.6", default-features = false }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
itertools = "0.10.0"
eth2_ssz = "0.4.1"
eth2_ssz_derive = "0.3.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = "0.7.3"
rand = "0.8.5"
eth2_wallet = { path = "../../crypto/eth2_wallet" }
eth2_keystore = { path = "../../crypto/eth2_keystore" }
filesystem = { path = "../filesystem" }

View File

@ -16,4 +16,4 @@ hex = "0.4.2"
types = { path = "../../consensus/types"}
eth2_ssz = "0.4.1"
tree_hash = "0.4.1"
ethabi = "12.0.0"
ethabi = "16.0.0"

View File

@ -70,13 +70,13 @@ pub fn decode_eth1_tx_data(
};
}
let root = decode_token!(Hash256, to_fixed_bytes);
let root = decode_token!(Hash256, into_fixed_bytes);
let deposit_data = DepositData {
amount,
signature: decode_token!(SignatureBytes, to_bytes),
withdrawal_credentials: decode_token!(Hash256, to_bytes),
pubkey: decode_token!(PublicKeyBytes, to_bytes),
signature: decode_token!(SignatureBytes, into_bytes),
withdrawal_credentials: decode_token!(Hash256, into_bytes),
pubkey: decode_token!(PublicKeyBytes, into_bytes),
};
Ok((deposit_data, root))

View File

@ -15,7 +15,7 @@ lighthouse_network = { path = "../../beacon_node/lighthouse_network" }
proto_array = { path = "../../consensus/proto_array", optional = true }
eth2_serde_utils = "0.1.1"
eth2_keystore = { path = "../../crypto/eth2_keystore" }
libsecp256k1 = "0.6.0"
libsecp256k1 = "0.7.0"
ring = "0.16.19"
bytes = "1.0.1"
account_utils = { path = "../../common/account_utils" }
@ -28,10 +28,7 @@ store = { path = "../../beacon_node/store", optional = true }
slashing_protection = { path = "../../validator_client/slashing_protection", optional = true }
[target.'cfg(target_os = "linux")'.dependencies]
# TODO: update psutil once fix is merged: https://github.com/rust-psutil/rust-psutil/pull/93
# TODO: Even once the above PR is corrected, there are sub-dependencies that need to be updated.
# psutil = { version = "3.2.0", optional = true }
psutil = { git = "https://github.com/sigp/rust-psutil", rev = "b3e44bc7ec5d545b8cb8ad4e3dffe074b6e6336b", optional = true }
psutil = { version = "3.2.2", optional = true }
procinfo = { version = "0.4.2", optional = true }
[features]

View File

@ -9,7 +9,7 @@ edition = "2021"
[dependencies]
lazy_static = "1.4.0"
num-bigint = "0.4.2"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
hex = "0.4.2"
serde_yaml = "0.8.13"
serde = "1.0.116"

View File

@ -10,7 +10,7 @@ edition = "2021"
lighthouse_metrics = { path = "../lighthouse_metrics" }
lazy_static = "1.4.0"
libc = "0.2.79"
parking_lot = "0.11.0"
parking_lot = "0.12.0"
[features]
mallinfo2 = []

View File

@ -8,4 +8,4 @@ edition = "2021"
types = { path = "../../consensus/types" }
lazy_static = "1.4.0"
lighthouse_metrics = { path = "../lighthouse_metrics" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"

View File

@ -14,7 +14,7 @@ bls = { path = "../../crypto/bls" }
eth2_keystore = { path = "../../crypto/eth2_keystore" }
filesystem = { path = "../filesystem" }
types = { path = "../../consensus/types" }
rand = "0.7.3"
rand = "0.8.5"
deposit_contract = { path = "../deposit_contract" }
tree_hash = "0.4.1"
hex = "0.4.2"

View File

@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
ethereum-types = "0.12.1"
eth2_ssz_types = "0.2.2"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
eth2_ssz_derive = "0.3.0"
eth2_ssz = "0.4.1"
tree_hash = "0.4.1"

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
ethereum-types = "0.12.1"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
lazy_static = "1.4.0"
safe_arith = { path = "../safe_arith" }

View File

@ -19,7 +19,7 @@ safe_arith = { path = "../safe_arith" }
tree_hash = "0.4.1"
types = { path = "../types", default-features = false }
rayon = "1.4.1"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
int_to_bytes = { path = "../int_to_bytes" }
smallvec = "1.6.1"
arbitrary = { version = "1.0", features = ["derive"], optional = true }

View File

@ -12,7 +12,7 @@ harness = false
criterion = "0.3.3"
[dependencies]
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
ethereum-types = "0.12.1"
[features]

View File

@ -7,7 +7,7 @@ license = "Apache-2.0"
description = "Efficient Merkle-hashing as used in Ethereum 2.0"
[dev-dependencies]
rand = "0.7.3"
rand = "0.8.5"
tree_hash_derive = "0.4.0"
types = { path = "../types" }
beacon_chain = { path = "../../beacon_node/beacon_chain" }
@ -16,7 +16,7 @@ eth2_ssz_derive = "0.3.0"
[dependencies]
ethereum-types = "0.12.1"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
smallvec = "1.6.1"
[features]

View File

@ -14,12 +14,12 @@ compare_fields = { path = "../../common/compare_fields" }
compare_fields_derive = { path = "../../common/compare_fields_derive" }
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
ethereum-types = "0.12.1"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
hex = "0.4.2"
int_to_bytes = { path = "../int_to_bytes" }
log = "0.4.11"
rayon = "1.4.1"
rand = "0.7.3"
rand = "0.8.5"
safe_arith = { path = "../safe_arith" }
serde = {version = "1.0.116" , features = ["rc"] }
serde_derive = "1.0.116"
@ -31,7 +31,7 @@ swap_or_not_shuffle = { path = "../swap_or_not_shuffle" }
test_random_derive = { path = "../../common/test_random_derive" }
tree_hash = "0.4.1"
tree_hash_derive = "0.4.0"
rand_xorshift = "0.2.0"
rand_xorshift = "0.3.0"
cached_tree_hash = { path = "../cached_tree_hash" }
serde_yaml = "0.8.13"
tempfile = "3.1.0"
@ -41,7 +41,7 @@ arbitrary = { version = "1.0", features = ["derive"], optional = true }
eth2_serde_utils = "0.1.1"
regex = "1.5.5"
lazy_static = "1.4.0"
parking_lot = "0.11.1"
parking_lot = "0.12.0"
itertools = "0.10.0"
superstruct = "0.4.1"
serde_json = "1.0.74"

View File

@ -13,7 +13,7 @@ serde = "1.0.116"
serde_derive = "1.0.116"
eth2_serde_utils = "0.1.1"
hex = "0.4.2"
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
ethereum-types = "0.12.1"
arbitrary = { version = "1.0", features = ["derive"], optional = true }
zeroize = { version = "1.4.2", features = ["zeroize_derive"] }

View File

@ -1,6 +1,6 @@
[package]
name = "eth2_hashing"
version = "0.2.0"
version = "0.3.0"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2021"
license = "Apache-2.0"
@ -9,8 +9,8 @@ description = "Hashing primitives used in Ethereum 2.0"
[dependencies]
lazy_static = { version = "1.4.0", optional = true }
ring = "0.16.19"
sha2 = "0.9.5"
cpufeatures = "0.1.5"
sha2 = "0.10.2"
cpufeatures = "0.2.2"
[dev-dependencies]
rustc-hex = "2.1.0"

View File

@ -7,7 +7,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = "0.7.3"
rand = "0.8.5"
hmac = "0.11.0"
pbkdf2 = { version = "0.8.0", default-features = false }
scrypt = { version = "0.7.0", default-features = false }

View File

@ -11,7 +11,7 @@ serde = "1.0.116"
serde_json = "1.0.58"
serde_repr = "0.1.6"
uuid = { version = "0.8.1", features = ["serde", "v4"] }
rand = "0.7.3"
rand = "0.8.5"
eth2_keystore = { path = "../eth2_keystore" }
eth2_key_derivation = { path = "../eth2_key_derivation" }
tiny-bip39 = "0.8.1"

View File

@ -33,7 +33,7 @@ lighthouse_version = { path = "../common/lighthouse_version" }
directory = { path = "../common/directory" }
account_utils = { path = "../common/account_utils" }
eth2_wallet = { path = "../crypto/eth2_wallet" }
web3 = { version = "0.17.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
web3 = { version = "0.18.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
eth1_test_rig = { path = "../testing/eth1_test_rig" }
sensitive_url = { path = "../common/sensitive_url" }
eth2 = { path = "../common/eth2" }

View File

@ -26,7 +26,7 @@ slog = { version = "2.5.2", features = ["max_level_trace"] }
sloggers = { version = "2.1.1", features = ["json"] }
types = { "path" = "../consensus/types" }
bls = { path = "../crypto/bls" }
eth2_hashing = "0.2.0"
eth2_hashing = "0.3.0"
clap = "2.33.3"
env_logger = "0.9.0"
environment = { path = "./environment" }

View File

@ -15,8 +15,8 @@ lighthouse_metrics = { path = "../common/lighthouse_metrics" }
filesystem = { path = "../common/filesystem" }
mdbx = { package = "libmdbx", version = "0.1.0" }
lru = "0.7.1"
parking_lot = "0.11.0"
rand = "0.7.3"
parking_lot = "0.12.0"
rand = "0.8.5"
safe_arith = { path = "../consensus/safe_arith" }
serde = "1.0"
serde_derive = "1.0"

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));
}

View File

@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
tokio = { version = "1.14.0", features = ["time"] }
web3 = { version = "0.17.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
web3 = { version = "0.18.0", default-features = false, features = ["http-tls", "signing", "ws-tls-tokio"] }
types = { path = "../../consensus/types"}
serde_json = "1.0.58"
deposit_contract = { path = "../../common/deposit_contract"}

View File

@ -194,6 +194,8 @@ impl DepositContract {
to: Some(self.contract.address()),
gas: Some(U256::from(DEPOSIT_GAS)),
gas_price: None,
max_fee_per_gas: None,
max_priority_fee_per_gas: None,
value: Some(from_gwei(deposit_data.amount)),
// Note: the reason we use this `TransactionRequest` instead of just using the
// function in `self.contract` is so that the `eth1_tx_data` function gets used

View File

@ -10,7 +10,7 @@ edition = "2021"
node_test_rig = { path = "../node_test_rig" }
eth1 = {path = "../../beacon_node/eth1"}
types = { path = "../../consensus/types" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
futures = "0.3.7"
tokio = "1.14.0"
eth1_test_rig = { path = "../eth1_test_rig" }

View File

@ -30,7 +30,7 @@ dirs = "3.0.1"
directory = { path = "../common/directory" }
lockfile = { path = "../common/lockfile" }
environment = { path = "../lighthouse/environment" }
parking_lot = "0.11.0"
parking_lot = "0.12.0"
exit-future = "0.2.0"
filesystem = { path = "../common/filesystem" }
hex = "0.4.2"
@ -47,9 +47,9 @@ warp_utils = { path = "../common/warp_utils" }
warp = "0.3.2"
hyper = "0.14.4"
eth2_serde_utils = "0.1.1"
libsecp256k1 = "0.6.0"
libsecp256k1 = "0.7.0"
ring = "0.16.19"
rand = { version = "0.7.3", features = ["small_rng"] }
rand = { version = "0.8.5", features = ["small_rng"] }
lighthouse_metrics = { path = "../common/lighthouse_metrics" }
lazy_static = "1.4.0"
itertools = "0.10.0"