2020-09-29 03:46:54 +00:00
|
|
|
[package]
|
|
|
|
name = "eth2"
|
|
|
|
version = "0.1.0"
|
|
|
|
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
2022-02-25 00:10:17 +00:00
|
|
|
edition = "2021"
|
2020-09-29 03:46:54 +00:00
|
|
|
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
|
|
|
[dependencies]
|
2020-10-05 08:22:19 +00:00
|
|
|
serde = { version = "1.0.116", features = ["derive"] }
|
|
|
|
serde_json = "1.0.58"
|
2023-08-10 13:32:49 +00:00
|
|
|
ssz_types = "0.5.4"
|
2020-09-29 03:46:54 +00:00
|
|
|
types = { path = "../../consensus/types" }
|
2023-06-13 10:25:27 +00:00
|
|
|
reqwest = { version = "0.11.0", features = ["json", "stream"] }
|
Rename eth2_libp2p to lighthouse_network (#2702)
## Description
The `eth2_libp2p` crate was originally named and designed to incorporate a simple libp2p integration into lighthouse. Since its origins the crates purpose has expanded dramatically. It now houses a lot more sophistication that is specific to lighthouse and no longer just a libp2p integration.
As of this writing it currently houses the following high-level lighthouse-specific logic:
- Lighthouse's implementation of the eth2 RPC protocol and specific encodings/decodings
- Integration and handling of ENRs with respect to libp2p and eth2
- Lighthouse's discovery logic, its integration with discv5 and logic about searching and handling peers.
- Lighthouse's peer manager - This is a large module handling various aspects of Lighthouse's network, such as peer scoring, handling pings and metadata, connection maintenance and recording, etc.
- Lighthouse's peer database - This is a collection of information stored for each individual peer which is specific to lighthouse. We store connection state, sync state, last seen ips and scores etc. The data stored for each peer is designed for various elements of the lighthouse code base such as syncing and the http api.
- Gossipsub scoring - This stores a collection of gossipsub 1.1 scoring mechanisms that are continuously analyssed and updated based on the ethereum 2 networks and how Lighthouse performs on these networks.
- Lighthouse specific types for managing gossipsub topics, sync status and ENR fields
- Lighthouse's network HTTP API metrics - A collection of metrics for lighthouse network monitoring
- Lighthouse's custom configuration of all networking protocols, RPC, gossipsub, discovery, identify and libp2p.
Therefore it makes sense to rename the crate to be more akin to its current purposes, simply that it manages the majority of Lighthouse's network stack. This PR renames this crate to `lighthouse_network`
Co-authored-by: Paul Hauner <paul@paulhauner.com>
2021-10-19 00:30:39 +00:00
|
|
|
lighthouse_network = { path = "../../beacon_node/lighthouse_network" }
|
2020-09-29 03:46:54 +00:00
|
|
|
proto_array = { path = "../../consensus/proto_array", optional = true }
|
2023-04-28 01:15:40 +00:00
|
|
|
ethereum_serde_utils = "0.5.0"
|
2020-10-02 09:42:19 +00:00
|
|
|
eth2_keystore = { path = "../../crypto/eth2_keystore" }
|
2022-04-04 00:26:16 +00:00
|
|
|
libsecp256k1 = "0.7.0"
|
2020-12-14 02:28:19 +00:00
|
|
|
ring = "0.16.19"
|
2021-02-10 23:29:49 +00:00
|
|
|
bytes = "1.0.1"
|
2020-10-02 09:42:19 +00:00
|
|
|
account_utils = { path = "../../common/account_utils" }
|
2021-05-04 01:59:51 +00:00
|
|
|
sensitive_url = { path = "../../common/sensitive_url" }
|
2023-04-28 01:15:40 +00:00
|
|
|
ethereum_ssz = "0.5.0"
|
2023-07-05 19:53:35 +00:00
|
|
|
ethereum_ssz_derive = "0.5.3"
|
2020-12-04 00:18:58 +00:00
|
|
|
futures-util = "0.3.8"
|
|
|
|
futures = "0.3.8"
|
2021-09-22 00:37:28 +00:00
|
|
|
store = { path = "../../beacon_node/store", optional = true }
|
2022-01-30 23:22:04 +00:00
|
|
|
slashing_protection = { path = "../../validator_client/slashing_protection", optional = true }
|
2023-06-13 10:25:27 +00:00
|
|
|
mediatype = "0.19.13"
|
Tidy formatting of `Reqwest` errors (#4336)
## Issue Addressed
NA
## Proposed Changes
Implements the `PrettyReqwestError` to wrap a `reqwest::Error` and give nicer `Debug` formatting. It also wraps the `Url` component in a `SensitiveUrl` to avoid leaking sensitive info in logs.
### Before
```
Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(9999), path: "/eth/v1/node/version", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })) })
```
### After
```
HttpClient(url: http://localhost:9999/, kind: request, detail: error trying to connect: tcp connect error: Connection refused (os error 61))
```
## Additional Info
I've also renamed the `Reqwest` error enum variants to `HttpClient`, to give people a better chance at knowing what's going on. Reqwest is pretty odd and looks like a typo.
I've implemented it in the `eth2` and `execution_layer` crates. This should affect most logs in the VC and EE-related ones in the BN.
I think the last crate that could benefit from the is the `beacon_node/eth1` crate. I haven't updated it in this PR since its error type is not so amenable to it (everything goes into a `String`). I don't have a whole lot of time to jig around with that at the moment and I feel that this PR as it stands is a significant enough improvement to merge on its own. Leaving it as-is is fine for the time being and we can always come back for it later (or implement in-protocol deposits!).
2023-06-27 01:06:50 +00:00
|
|
|
mime = "0.3.16"
|
|
|
|
pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" }
|
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
tokio = { version = "1.14.0", features = ["full"] }
|
2020-09-29 03:46:54 +00:00
|
|
|
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
2022-04-04 00:26:16 +00:00
|
|
|
psutil = { version = "3.2.2", optional = true }
|
2020-09-29 03:46:54 +00:00
|
|
|
procinfo = { version = "0.4.2", optional = true }
|
|
|
|
|
|
|
|
[features]
|
|
|
|
default = ["lighthouse"]
|
2023-06-13 10:25:27 +00:00
|
|
|
lighthouse = [
|
|
|
|
"proto_array",
|
|
|
|
"psutil",
|
|
|
|
"procinfo",
|
|
|
|
"store",
|
|
|
|
"slashing_protection",
|
|
|
|
]
|