Skip to content

Commit c258270

Browse files
committed
update dependencies (#4639)
## Issue Addressed updates underlying dependencies and removes the ignored `RUSTSEC`'s for `cargo audit`. Also switches `procinfo` to `procfs` on `eth2` to remove the `nom` warning, `procinfo` is unmaintained see [here](danburkert/procinfo-rs#46).
1 parent 14924db commit c258270

File tree

17 files changed

+871
-507
lines changed

17 files changed

+871
-507
lines changed

Cargo.lock

+716-464
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ resolver = "2"
9191

9292
[patch]
9393
[patch.crates-io]
94-
warp = { git = "https://github.com/macladson/warp", rev="7e75acc368229a46a236a8c991bf251fe7fe50ef" }
94+
# TODO: remove when 0.3.6 get's released.
95+
warp = { git = "https://github.com/seanmonstar/warp.git", rev="149913fe" }
9596

9697
[profile.maxperf]
9798
inherits = "release"

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ arbitrary-fuzz:
206206

207207
# Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database)
208208
audit:
209-
# cargo install --force cargo-audit
210-
cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2022-0093 \
211-
--ignore RUSTSEC-2023-0052 --ignore RUSTSEC-2023-0053
209+
cargo install --force cargo-audit
210+
cargo audit --ignore RUSTSEC-2023-0052
212211

213212
# Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose.
214213
vendor:

beacon_node/execution_layer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ keccak-hash = "0.10.0"
5050
hash256-std-hasher = "0.15.2"
5151
triehash = "0.8.4"
5252
hash-db = "0.15.2"
53-
pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" }
53+
pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" }

common/eth2/Cargo.toml

+2-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ tokio = { version = "1.14.0", features = ["full"] }
3535

3636
[target.'cfg(target_os = "linux")'.dependencies]
3737
psutil = { version = "3.2.2", optional = true }
38-
procinfo = { version = "0.4.2", optional = true }
38+
procfs = { version = "0.15.1", optional = true }
3939

4040
[features]
4141
default = ["lighthouse"]
42-
lighthouse = [
43-
"proto_array",
44-
"psutil",
45-
"procinfo",
46-
"store",
47-
"slashing_protection",
48-
]
42+
lighthouse = ["proto_array", "psutil", "procfs", "store", "slashing_protection"]

common/eth2/src/lighthouse.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ pub struct ValidatorInclusionData {
9595

9696
#[cfg(target_os = "linux")]
9797
use {
98-
procinfo::pid, psutil::cpu::os::linux::CpuTimesExt,
99-
psutil::memory::os::linux::VirtualMemoryExt, psutil::process::Process,
98+
psutil::cpu::os::linux::CpuTimesExt, psutil::memory::os::linux::VirtualMemoryExt,
99+
psutil::process::Process,
100100
};
101101

102102
/// Reports on the health of the Lighthouse instance.
@@ -238,7 +238,7 @@ pub struct ProcessHealth {
238238
/// The pid of this process.
239239
pub pid: u32,
240240
/// The number of threads used by this pid.
241-
pub pid_num_threads: i32,
241+
pub pid_num_threads: i64,
242242
/// The total resident memory used by this pid.
243243
pub pid_mem_resident_set_size: u64,
244244
/// The total virtual memory used by this pid.
@@ -262,7 +262,12 @@ impl ProcessHealth {
262262
.memory_info()
263263
.map_err(|e| format!("Unable to get process memory info: {:?}", e))?;
264264

265-
let stat = pid::stat_self().map_err(|e| format!("Unable to get stat: {:?}", e))?;
265+
let me = procfs::process::Process::myself()
266+
.map_err(|e| format!("Unable to get process: {:?}", e))?;
267+
let stat = me
268+
.stat()
269+
.map_err(|e| format!("Unable to get stat: {:?}", e))?;
270+
266271
let process_times = process
267272
.cpu_times()
268273
.map_err(|e| format!("Unable to get process cpu times : {:?}", e))?;

common/eth2_network_config/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
build = "build.rs"
88

99
[build-dependencies]
10-
zip = "0.5.8"
10+
zip = "0.6"
1111
eth2_config = { path = "../eth2_config"}
1212

1313
[dev-dependencies]
@@ -18,4 +18,4 @@ serde_yaml = "0.8.13"
1818
types = { path = "../../consensus/types"}
1919
ethereum_ssz = "0.5.0"
2020
eth2_config = { path = "../eth2_config"}
21-
discv5 = "0.3.1"
21+
discv5 = "0.3.1"

common/logging/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ sloggers = { version = "2.1.1", features = ["json"] }
1717
slog-async = "2.7.0"
1818
take_mut = "0.2.2"
1919
parking_lot = "0.12.1"
20-
serde = "1.0.153"
20+
serde = "1.0.153"
2121
serde_json = "1.0.94"
22-
chrono = "0.4.23"
22+
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }

common/warp_utils/src/cors.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ pub fn set_builder_origins(
1010
default_origin: (IpAddr, u16),
1111
) -> Result<Builder, String> {
1212
if let Some(allow_origin) = allow_origin {
13-
let origins = allow_origin
14-
.split(',')
15-
.map(|s| verify_cors_origin_str(s).map(|_| s))
16-
.collect::<Result<Vec<_>, _>>()?;
13+
let mut origins = vec![];
14+
for origin in allow_origin.split(',') {
15+
verify_cors_origin_str(origin)?;
16+
if origin == "*" {
17+
return Ok(builder.allow_any_origin());
18+
}
19+
origins.push(origin)
20+
}
1721
Ok(builder.allow_origins(origins))
1822
} else {
1923
let origin = match default_origin.0 {

common/warp_utils/src/metrics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn scrape_process_health_metrics() {
8787
// This will silently fail if we are unable to observe the health. This is desired behaviour
8888
// since we don't support `Health` for all platforms.
8989
if let Ok(health) = ProcessHealth::observe() {
90-
set_gauge(&PROCESS_NUM_THREADS, health.pid_num_threads as i64);
90+
set_gauge(&PROCESS_NUM_THREADS, health.pid_num_threads);
9191
set_gauge(&PROCESS_RES_MEM, health.pid_mem_resident_set_size as i64);
9292
set_gauge(&PROCESS_VIRT_MEM, health.pid_mem_virtual_memory_size as i64);
9393
set_gauge(&PROCESS_SECONDS, health.pid_process_seconds_total as i64);

lighthouse/tests/beacon_node.rs

+19-13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use lighthouse_network::PeerId;
1111
use std::fs::File;
1212
use std::io::{Read, Write};
1313
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
14+
use std::path::Path;
1415
use std::path::PathBuf;
1516
use std::process::Command;
1617
use std::str::FromStr;
@@ -1460,77 +1461,82 @@ fn disable_inbound_rate_limiter_flag() {
14601461
#[test]
14611462
fn http_allow_origin_flag() {
14621463
CommandLineTest::new()
1463-
.flag("http-allow-origin", Some("127.0.0.99"))
1464+
.flag("http", None)
1465+
.flag("http-allow-origin", Some("http://127.0.0.99"))
14641466
.run_with_zero_port()
14651467
.with_config(|config| {
1466-
assert_eq!(config.http_api.allow_origin, Some("127.0.0.99".to_string()));
1468+
assert_eq!(
1469+
config.http_api.allow_origin,
1470+
Some("http://127.0.0.99".to_string())
1471+
);
14671472
});
14681473
}
14691474
#[test]
14701475
fn http_allow_origin_all_flag() {
14711476
CommandLineTest::new()
1477+
.flag("http", None)
14721478
.flag("http-allow-origin", Some("*"))
14731479
.run_with_zero_port()
14741480
.with_config(|config| assert_eq!(config.http_api.allow_origin, Some("*".to_string())));
14751481
}
14761482
#[test]
14771483
fn http_allow_sync_stalled_flag() {
14781484
CommandLineTest::new()
1485+
.flag("http", None)
14791486
.flag("http-allow-sync-stalled", None)
14801487
.run_with_zero_port()
14811488
.with_config(|config| assert_eq!(config.http_api.allow_sync_stalled, true));
14821489
}
14831490
#[test]
14841491
fn http_enable_beacon_processor() {
14851492
CommandLineTest::new()
1493+
.flag("http", None)
14861494
.run_with_zero_port()
14871495
.with_config(|config| assert_eq!(config.http_api.enable_beacon_processor, true));
14881496

14891497
CommandLineTest::new()
1498+
.flag("http", None)
14901499
.flag("http-enable-beacon-processor", Some("true"))
14911500
.run_with_zero_port()
14921501
.with_config(|config| assert_eq!(config.http_api.enable_beacon_processor, true));
14931502

14941503
CommandLineTest::new()
1504+
.flag("http", None)
14951505
.flag("http-enable-beacon-processor", Some("false"))
14961506
.run_with_zero_port()
14971507
.with_config(|config| assert_eq!(config.http_api.enable_beacon_processor, false));
14981508
}
14991509
#[test]
15001510
fn http_tls_flags() {
1501-
let dir = TempDir::new().expect("Unable to create temporary directory");
15021511
CommandLineTest::new()
1512+
.flag("http", None)
15031513
.flag("http-enable-tls", None)
1504-
.flag(
1505-
"http-tls-cert",
1506-
dir.path().join("certificate.crt").as_os_str().to_str(),
1507-
)
1508-
.flag(
1509-
"http-tls-key",
1510-
dir.path().join("private.key").as_os_str().to_str(),
1511-
)
1514+
.flag("http-tls-cert", Some("tests/tls/cert.pem"))
1515+
.flag("http-tls-key", Some("tests/tls/key.rsa"))
15121516
.run_with_zero_port()
15131517
.with_config(|config| {
15141518
let tls_config = config
15151519
.http_api
15161520
.tls_config
15171521
.as_ref()
15181522
.expect("tls_config was empty.");
1519-
assert_eq!(tls_config.cert, dir.path().join("certificate.crt"));
1520-
assert_eq!(tls_config.key, dir.path().join("private.key"));
1523+
assert_eq!(tls_config.cert, Path::new("tests/tls/cert.pem"));
1524+
assert_eq!(tls_config.key, Path::new("tests/tls/key.rsa"));
15211525
});
15221526
}
15231527

15241528
#[test]
15251529
fn http_spec_fork_default() {
15261530
CommandLineTest::new()
1531+
.flag("http", None)
15271532
.run_with_zero_port()
15281533
.with_config(|config| assert_eq!(config.http_api.spec_fork_name, None));
15291534
}
15301535

15311536
#[test]
15321537
fn http_spec_fork_override() {
15331538
CommandLineTest::new()
1539+
.flag("http", None)
15341540
.flag("http-spec-fork", Some("altair"))
15351541
.run_with_zero_port()
15361542
.with_config(|config| assert_eq!(config.http_api.spec_fork_name, Some(ForkName::Altair)));

lighthouse/tests/tls/cert.pem

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 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zwmtRykGrgE/6JAJDwGcgpY9kBPycGxTlCN926uGxHsDwVs
18+
98cL6ZXptMLTR6T2XP36dAJZuOICSqmCSbFR8knc/gjUO36rXTxhwci8iDbmEVaf
19+
BHpgBXGU5+SQ+QM++v6bHGf4LNQC5NZ4e4xvGax8ioYu/BRsB/T3Lx+RlItz4zdU
20+
XuxCNcm3nhQV2ZHquRdbSdoyIxV5kJXel4wCmOhWIq7A2OBKdu5fQzIAzzLi65EN
21+
RPAKsKB4h7hGgvciZQ7dsMrlGw0DLdJ6UrFyiR5Io7dXYT/+JP91lP5xsl6Lhg9O
22+
FgALt7GSYRm2cZdgi9pO9rRr83Br1VjQT1vHz6yoZMXSqc4A2zcN2a2ZVq//rHvc
23+
FZygs8miAhWPzqnpmgTj1cPiU1M=
24+
-----END CERTIFICATE-----

lighthouse/tests/tls/key.rsa

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
MIIEpAIBAAKCAQEAqVYYdfxTT9qr1np22UoIWq4v1E4cHncp35xxu4HNyZsoJBHR
3+
K1gTvwh8x4LMe24lROW/LGWDRAyhaI8qDxxlitm0DPxU8p4iQoDQi3Z+oVKqsSwJ
4+
pd3MRlu+4QFrveExwxgdahXvnhYgFJw5qG/IDWbQM0+ism/yRiXaxFNMI/kXe8FG
5+
+JKSyJzR/yXPqM9ootgIzWxjmV50c+4eyr97DvbwAQcmHi3Ao96p4XoxzKlYWwE9
6+
TA+s0NvmCgYxOdjLEClP8YVKbvSpFMi4dHMZId86xYioeFbr7XPp+2njr9oyZjpd
7+
Xa9Fy5UhwZZqCqh+nQk0m3XUC5pSu3ZrPLxNNQIDAQABAoIBAFKtZJgGsK6md4vq
8+
kyiYSufrcBLaaEQ/rkQtYCJKyC0NAlZKFLRy9oEpJbNLm4cQSkYPXn3Qunx5Jj2k
9+
2MYz+SgIDy7f7KHgr52Ew020dzNQ52JFvBgt6NTZaqL1TKOS1fcJSSNIvouTB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