Skip to content

Commit

Permalink
Update and consolidate dependencies (#3136)
Browse files Browse the repository at this point in the history
## 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 rust-lang/cargo#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: supranational/blst#111
  • Loading branch information
michaelsproul committed Apr 4, 2022
1 parent ab434bc commit 4d01224
Show file tree
Hide file tree
Showing 38 changed files with 283 additions and 686 deletions.
825 changes: 211 additions & 614 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
8 changes: 4 additions & 4 deletions beacon_node/beacon_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"
Expand All @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/eth1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand All @@ -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" }
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/execution_layer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion beacon_node/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/http_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}


Expand Down
4 changes: 2 additions & 2 deletions beacon_node/lighthouse_network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/operation_pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion common/account_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion common/deposit_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 4 additions & 4 deletions common/deposit_contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 2 additions & 5 deletions common/eth2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion common/eth2_interop_keypairs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion common/malloc_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
2 changes: 1 addition & 1 deletion common/slot_clock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion common/validator_dir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion consensus/cached_tree_hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion consensus/merkle_proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
2 changes: 1 addition & 1 deletion consensus/state_processing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion consensus/swap_or_not_shuffle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions consensus/tree_hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions consensus/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crypto/bls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
6 changes: 3 additions & 3 deletions crypto/eth2_hashing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crypto/eth2_keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crypto/eth2_wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion lighthouse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
Loading

0 comments on commit 4d01224

Please sign in to comment.