From 291ff640f1ddac3e2b93469d41a298671bc4f109 Mon Sep 17 00:00:00 2001 From: chonghe Date: Wed, 6 Sep 2023 04:37:02 +0000 Subject: [PATCH 01/27] Minor revision to Lighthouse Book on validator-manager (#4638) Correct the formatting and remove `http-port 5062` to make the command simpler Co-authored-by: chonghe <44791194+chong-he@users.noreply.github.com> --- book/src/faq.md | 40 +++++++++++++++++++--------- book/src/validator-manager-create.md | 2 -- book/src/validator-manager-move.md | 7 +++-- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/book/src/faq.md b/book/src/faq.md index 15c5757064f..b3f3d55edf1 100644 --- a/book/src/faq.md +++ b/book/src/faq.md @@ -40,6 +40,7 @@ - [How do I check the version of Lighthouse that is running?](#misc-version) - [Does Lighthouse have pruning function like the execution client to save disk space?](#misc-prune) - [Can I use a HDD for the freezer database and only have the hot db on SSD?](#misc-freezer) +- [Can Lighthouse log in local timestamp instead of UTC?](#misc-timestamp) ## Beacon Node @@ -436,16 +437,14 @@ Monitoring](./validator-monitoring.md) for more information. Lighthouse has also ### My beacon node and validator client are on different servers. How can I point the validator client to the beacon node? -The settings are as follows: - -1. On the beacon node: - - Specify `lighthouse bn --http-address local_IP` so that the beacon node is listening on the local network rather than on the `localhost`. - -1. On the validator client: +The setting on the beacon node is the same for both cases below. In the beacon node, specify `lighthouse bn --http-address local_IP` so that the beacon node is listening on the local network rather than `localhost`. You can find the `local_IP` by running the command `hostname -I | awk '{print $1}'` on the server running the beacon node. +1. If the beacon node and validator clients are on different servers *in the same network*, the setting in the validator client is as follows: + Use the flag `--beacon-nodes` to point to the beacon node. For example, `lighthouse vc --beacon-nodes http://local_IP:5052` where `local_IP` is the local IP address of the beacon node and `5052` is the default `http-port` of the beacon node. + If you have firewall setup, e.g., `ufw`, you will need to allow port 5052 (assuming that the default port is used) with `sudo ufw allow 5052`. Note: this will allow all IP addresses to access the HTTP API of the beacon node. If you are on an untrusted network (e.g., a university or public WiFi) or the host is exposed to the internet, use apply IP-address filtering as described later in this section. + You can test that the setup is working with by running the following command on the validator client host: ```bash @@ -453,8 +452,25 @@ The settings are as follows: ``` You can refer to [Redundancy](./redundancy.md) for more information. - - It is also worth noting that the `--beacon-nodes` flag can also be used for redundancy of beacon nodes. For example, let's say you have a beacon node and a validator client running on the same host, and a second beacon node on another server as a backup. In this case, you can use `lighthouse vc --beacon-nodes http://localhost:5052, http://local_IP:5052` on the validator client. + +2. If the beacon node and validator clients are on different servers *and different networks*, it is necessary to perform port forwarding of the SSH port (e.g., the default port 22) on the router, and also allow firewall on the SSH port. The connection can be established via port forwarding on the router. + + + + In the validator client, use the flag `--beacon-nodes` to point to the beacon node. However, since the beacon node and the validator client are on different networks, the IP address to use is the public IP address of the beacon node, i.e., `lighthouse vc --beacon-nodes http://public_IP:5052`. You can get the public IP address of the beacon node by running the command ` dig +short myip.opendns.com @resolver1.opendns.com` on the server running the beacon node. + + Additionally, port forwarding of port 5052 on the router connected to the beacon node is required for the vc to connect to the bn. To do port forwarding, refer to [how to open ports](./advanced_networking.md#how-to-open-ports). + + + If you have firewall setup, e.g., `ufw`, you will need to allow connections to port 5052 (assuming that the default port is used). Since the beacon node HTTP/HTTPS API is public-facing (i.e., the 5052 port is now exposed to the internet due to port forwarding), we strongly recommend users to apply IP-address filtering to the BN/VC connection from malicious actors. This can be done using the command: + + ``` + sudo ufw allow from vc_IP_address proto tcp to any port 5052 + ``` + where `vc_IP_address` is the public IP address of the validator client. The command will only allow connections to the beacon node from the validator client IP address to prevent malicious attacks on the beacon node over the internet. + + +It is also worth noting that the `--beacon-nodes` flag can also be used for redundancy of beacon nodes. For example, let's say you have a beacon node and a validator client running on the same host, and a second beacon node on another server as a backup. In this case, you can use `lighthouse vc --beacon-nodes http://localhost:5052, http://IP-address:5052` on the validator client. ### Should I do anything to the beacon node or validator client settings if I have a relocation of the node / change of IP address? No. Lighthouse will auto-detect the change and update your Ethereum Node Record (ENR). You just need to make sure you are not manually setting the ENR with `--enr-address` (which, for common use cases, this flag is not used). @@ -513,11 +529,9 @@ There is no pruning of Lighthouse database for now. However, since v4.2.0, a fea Yes, you can do so by using the flag `--freezer-dir /path/to/freezer_db` in the beacon node. +### Can Lighthouse log in local timestamp instead of UTC? - - - - +The reason why Lighthouse logs in UTC is due to the dependency on an upstream library that is [yet to be resolved](https://github.com/sigp/lighthouse/issues/3130). Alternatively, using the flag `disable-log-timestamp` in combination with systemd will suppress the UTC timestamps and print the logs in local timestamps. diff --git a/book/src/validator-manager-create.md b/book/src/validator-manager-create.md index 779c159276e..0cec150dab7 100644 --- a/book/src/validator-manager-create.md +++ b/book/src/validator-manager-create.md @@ -124,7 +124,6 @@ The command will create two files: The VC which will receive the validators needs to have the following flags at a minimum: - `--http` -- `--http-port 5062` - `--enable-doppelganger-protection` Therefore, the VC command might look like: @@ -133,7 +132,6 @@ Therefore, the VC command might look like: lighthouse \ vc \ --http \ - --http-port 5062 \ --enable-doppelganger-protection ``` diff --git a/book/src/validator-manager-move.md b/book/src/validator-manager-move.md index 98932604d5d..15089d65c5d 100644 --- a/book/src/validator-manager-move.md +++ b/book/src/validator-manager-move.md @@ -69,7 +69,6 @@ In reality, many host configurations are possible. For example: The source VC needs to have the following flags at a minimum: - `--http` -- `--http-port 5062` - `--http-allow-keystore-export` Therefore, the source VC command might look like: @@ -78,7 +77,6 @@ Therefore, the source VC command might look like: lighthouse \ vc \ --http \ - --http-port 5062 \ --http-allow-keystore-export ``` @@ -87,7 +85,6 @@ lighthouse \ The destination VC needs to have the following flags at a minimum: - `--http` -- `--http-port 5062` - `--enable-doppelganger-protection` Therefore, the destination VC command might look like: @@ -96,7 +93,6 @@ Therefore, the destination VC command might look like: lighthouse \ vc \ --http \ - --http-port 5062 \ --enable-doppelganger-protection ``` @@ -167,6 +163,8 @@ At the same time, `lighthouse vc` will log: INFO Importing keystores via standard HTTP API, count: 1 INFO Enabled validator voting_pubkey: 0xab6e29f1b98fedfca878edce2b471f1b5ee58ee4c3bd216201f98254ef6f6eac40a53d74c8b7da54f51d3e85cacae92f, signing_method: local_keystore INFO Modified key_cache saved successfully +``` + Once the operation completes successfully, there is nothing else to be done. The validators have been removed from the `src-host` and enabled at the `dest-host`. If the `--enable-doppelganger-protection` flag was used it may take 2-3 epochs @@ -183,6 +181,7 @@ lighthouse \ --dest-vc-token ~/.lighthouse/mainnet/validators/api-token.txt \ --validators 0x9096aab771e44da149bd7c9926d6f7bb96ef465c0eeb4918be5178cd23a1deb4aec232c61d85ff329b54ed4a3bdfff3a,0x90fc4f72d898a8f01ab71242e36f4545aaf87e3887be81632bb8ba4b2ae8fb70753a62f866344d7905e9a07f5a9cdda1 ``` + Any errors encountered during the operation should include information on how to proceed. Assistance is also available on our [Discord](https://discord.gg/cyAszAh). \ No newline at end of file From 48e2b205e88dfd16a74f2ceeba74ab3e20c7346d Mon Sep 17 00:00:00 2001 From: Daichuan Wu <109904112+daichuanwu21@users.noreply.github.com> Date: Wed, 6 Sep 2023 04:37:03 +0000 Subject: [PATCH 02/27] Fix some typos in "Advanced Networking" documentation (#4672) ## Issue Addressed N/A ## Proposed Changes The current Advanced Networking page references the ["--listen-addresses"](https://github.com/sigp/lighthouse/blob/14924dbc955732a742d52eafcad32cb0f790f027/book/src/advanced_networking.md?plain=1#L124C8-L124C8) argument, which does not exist in the beacon node. This PR changes such instances of "--listen-addresses" to "--listen-address". Additionally, the page mentions using sockets that [both listen to IPv6](https://github.com/sigp/lighthouse/blob/14924dbc955732a742d52eafcad32cb0f790f027/book/src/advanced_networking.md?plain=1#L151) in a dual-stack setup? Hence, this PR also changes said line to "using one socket for IPv4 and another socket for IPv6". ## Additional Info None. --- book/src/advanced_networking.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/book/src/advanced_networking.md b/book/src/advanced_networking.md index ba07a6f87f9..b1f05450c48 100644 --- a/book/src/advanced_networking.md +++ b/book/src/advanced_networking.md @@ -121,13 +121,13 @@ nodes that do not run directly on a public network. To listen over only IPv6 use the same parameters as done when listening over IPv4 only: -- `--listen-addresses :: --port 9909` will listen over IPv6 using port `9909` for +- `--listen-address :: --port 9909` will listen over IPv6 using port `9909` for TCP and UDP. -- `--listen-addresses :: --port 9909 --discovery-port 9999` will listen over +- `--listen-address :: --port 9909 --discovery-port 9999` will listen over IPv6 using port `9909` for TCP and port `9999` for UDP. To listen over both IPv4 and IPv6: -- Set two listening addresses using the `--listen-addresses` flag twice ensuring +- Set two listening addresses using the `--listen-address` flag twice ensuring the two addresses are one IPv4, and the other IPv6. When doing so, the `--port` and `--discovery-port` flags will apply exclusively to IPv4. Note that this behaviour differs from the Ipv6 only case described above. @@ -139,16 +139,16 @@ To listen over both IPv4 and IPv6: ##### Configuration Examples -- `--listen-addresses :: --listen-addresses 0.0.0.0 --port 9909` will listen +- `--listen-address :: --listen-address 0.0.0.0 --port 9909` will listen over IPv4 using port `9909` for TCP and UDP. It will also listen over IPv6 but using the default value for `--port6` for UDP and TCP (`9090`). -- `--listen-addresses :: --listen-addresses --port 9909 --discovery-port6 9999` +- `--listen-address :: --listen-address --port 9909 --discovery-port6 9999` will have the same configuration as before except for the IPv6 UDP socket, which will use port `9999`. #### Configuring Lighthouse to advertise IPv6 reachable addresses Lighthouse supports IPv6 to connect to other nodes both over IPv6 exclusively, -and dual stack using one socket for IPv6 and another socket for IPv6. In both +and dual stack using one socket for IPv4 and another socket for IPv6. In both scenarios, the previous sections still apply. In summary: > Beacon nodes must advertise their publicly reachable socket address From 0caf2af7712cf02e32c9af20aa1a08b545f441a3 Mon Sep 17 00:00:00 2001 From: Ricki Moore Date: Wed, 6 Sep 2023 04:37:04 +0000 Subject: [PATCH 03/27] Feat: siren faq update (#4685) ## Issue Addressed Siren FAQ requires more information regarding network connections to lighthouse BN/VC ## Proposed Changes Added more info regarding port, BN/VC flags, ssh tunneling and VPNs access --- book/src/ui-configuration.md | 23 ++++++++---------- book/src/ui-faqs.md | 47 +++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 19 deletions(-) diff --git a/book/src/ui-configuration.md b/book/src/ui-configuration.md index 98f30413913..1a5daa54418 100644 --- a/book/src/ui-configuration.md +++ b/book/src/ui-configuration.md @@ -9,23 +9,20 @@ following configuration screen. ## Connecting to the Clients -This allows you to enter the address and ports of the associated Lighthouse +Both the Beacon node and the Validator client need to have their HTTP APIs enabled. These ports should be accessible from the computer running Siren. This allows you to enter the address and ports of the associated Lighthouse Beacon node and Lighthouse Validator client. -> The Beacon Node must be run with the `--gui` flag set. +To enable the HTTP API for the beacon node, utilize the `--gui` CLI flag. This action ensures that the HTTP API can be accessed by other software on the same machine. -If you run Siren in the browser (by entering `localhost` in the browser), you will need to allow CORS in the HTTP API. This can be done by adding the flag `--http-allow-origin "*"` for both beacon node and validator client. If you would like to access Siren beyond the local computer, we recommend using an SSH tunnel. This requires a tunnel for 3 ports: `80` (assuming the port is unchanged as per the [installation guide](./ui-installation.md#docker-recommended), `5052` (for beacon node) and `5062` (for validator client). You can use the command below to perform SSH tunneling: -```bash -ssh -N -L 80:127.0.0.1:80 -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip -``` +> The Beacon Node must be run with the `--gui` flag set. -where `username` is the username of the server and `local_ip` is the local IP address of the server. Note that with the `-N` option in an SSH session, you will not be able to execute commands in the CLI to avoid confusion with ordinary shell sessions. The connection will appear to be "hung" upon a successful connection, but that is normal. Once you have successfully connected to the server via SSH tunneling, you should be able to access Siren by entering `localhost` in a web browser. +If you require accessibility from another machine within the network, configure the `--http-address` to match the local LAN IP of the system running the Beacon Node and Validator Client. -You can also access Siren using the app downloaded in the [Siren release page](https://github.com/sigp/siren/releases). To access Siren beyond the local computer, you can use SSH tunneling for ports `5052` and `5062` using the command: +> To access from another machine on the same network (192.168.0.200) set the Beacon Node and Validator Client `--http-address` as `192.168.0.200`. -```bash -ssh -N -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip -``` +In a similar manner, the validator client requires activation of the `--http` flag, along with the optional consideration of configuring the `--http-address` flag. If `--http-address` flag is set on the Validator Client, then the `--unencrypted-http-transport` flag is required as well. These settings will ensure compatibility with Siren's connectivity requirements. + +If you run Siren in the browser (by entering `localhost` in the browser), you will need to allow CORS in the HTTP API. This can be done by adding the flag `--http-allow-origin "*"` for both beacon node and validator client. A green tick will appear once Siren is able to connect to both clients. You can specify different ports for each client by clicking on the advanced tab. @@ -37,7 +34,7 @@ The API Token is a secret key that allows you to connect to the validator client. The validator client's HTTP API is guarded by this key because it contains sensitive validator information and the ability to modify validators. Please see [`Validator Authorization`](./api-vc-auth-header.md) -for further details. +for further details. Siren requires this token in order to connect to the Validator client. The token is located in the default data directory of the validator @@ -49,7 +46,7 @@ entered. ## Name -This is your name, it can be modified and is solely used for aesthetics. +This is your name, it can be modified and is solely used for aesthetics. ## Device diff --git a/book/src/ui-faqs.md b/book/src/ui-faqs.md index f4cbf1c40ac..92e06270c2e 100644 --- a/book/src/ui-faqs.md +++ b/book/src/ui-faqs.md @@ -1,7 +1,7 @@ # Frequently Asked Questions ## 1. Are there any requirements to run Siren? -Yes, Siren requires Lighthouse v3.5.1 or higher to function properly. These releases can be found on the [releases](https://github.com/sigp/lighthouse/releases) page of the Lighthouse repository. +Yes, the most current Siren version requires Lighthouse v4.3.0 or higher to function properly. These releases can be found on the [releases](https://github.com/sigp/lighthouse/releases) page of the Lighthouse repository. ## 2. Where can I find my API token? The required Api token may be found in the default data directory of the validator client. For more information please refer to the lighthouse ui configuration [`api token section`](./api-vc-auth-header.md). @@ -9,13 +9,41 @@ The required Api token may be found in the default data directory of the validat ## 3. How do I fix the Node Network Errors? If you receive a red notification with a BEACON or VALIDATOR NODE NETWORK ERROR you can refer to the lighthouse ui configuration and [`connecting to clients section`](./ui-configuration.md#connecting-to-the-clients). -## 4. How do I change my Beacon or Validator address after logging in? -Once you have successfully arrived to the main dashboard, use the sidebar to access the settings view. In the top right hand corner there is a `Configuration` action button that will redirect you back to the configuration screen where you can make appropriate changes. +## 4. How do I connect Siren to Lighthouse from a different computer on the same network? +The most effective approach to enable access for a local network computer to Lighthouse's HTTP API ports is by configuring the `--http-address` to match the local LAN IP of the system running the beacon node and validator client. For instance, if the said node operates at `192.168.0.200`, this IP can be specified using the `--http-address` parameter as `--http-address 192.168.0.200`. +Subsequently, by designating the host as `192.168.0.200`, you can seamlessly connect Siren to this specific beacon node and validator client pair from any computer situated within the same network. -## 5. Why doesn't my validator balance graph show any data? -If your graph is not showing data, it usually means your validator node is still caching data. The application must wait at least 3 epochs before it can render any graphical visualizations. This could take up to 20min. +## 5. How can I use Siren to monitor my validators remotely when I am not at home? + +There are two primary methods to access your Beacon Node and Validator Client remotely: setting up a VPN or utilizing SSH-reverse tunneling. + +Most contemporary home routers provide options for VPN access in various ways. A VPN permits a remote computer to establish a connection with internal computers within a home network. With a VPN configuration in place, connecting to the VPN enables you to treat your computer as if it is part of your local home network. The connection process involves following the setup steps for connecting via another machine on the same network on the Siren configuration page and [`connecting to clients section`](./ui-configuration.md#connecting-to-the-clients). + +In the absence of a VPN, an alternative approach involves utilizing an SSH tunnel. To achieve this, you need remote SSH access to the computer hosting the Beacon Node and Validator Client pair (which necessitates a port forward in your router). In this context, while it is not obligatory to set a `--http-address` flag on the Beacon Node and Validator Client, you can configure an SSH tunnel to the local ports on the node and establish a connection through the tunnel. For instructions on setting up an SSH tunnel, refer to [`Connecting Siren via SSH tunnel`](./ui-faqs.md#6-how-do-i-connect-siren-to-lighthouse-via-a-ssh-tunnel) for detailed guidance. + +## 6. How do I connect Siren to Lighthouse via a ssh tunnel? +If you would like to access Siren beyond the local network (i.e across the internet), we recommend using an SSH tunnel. This requires a tunnel for 3 ports: `80` (assuming the port is unchanged as per the [installation guide](./ui-installation.md#docker-recommended), `5052` (for beacon node) and `5062` (for validator client). You can use the command below to perform SSH tunneling: + +```bash + +ssh -N -L 80:127.0.0.1:80 -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip + +``` + + +Where `username` is the username of the server and `local_ip` is the local IP address of the server. Note that with the `-N` option in an SSH session, you will not be able to execute commands in the CLI to avoid confusion with ordinary shell sessions. The connection will appear to be "hung" upon a successful connection, but that is normal. Once you have successfully connected to the server via SSH tunneling, you should be able to access Siren by entering `localhost` in a web browser. -## 4. Does Siren support reverse proxy or DNS named addresses? + +You can also access Siren using the app downloaded in the [Siren release page](https://github.com/sigp/siren/releases). To access Siren beyond the local computer, you can use SSH tunneling for ports `5052` and `5062` using the command: + + +```bash + +ssh -N -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip + +``` + +## 7. Does Siren support reverse proxy or DNS named addresses? Yes, if you need to access your beacon or validator from an address such as `https://merp-server:9909/eth2-vc` you should follow the following steps for configuration: 1. Toggle `https` as your protocol 2. Add your address as `merp-server/eth2-vc` @@ -24,3 +52,10 @@ Yes, if you need to access your beacon or validator from an address such as `htt If you have configured it correctly you should see a green checkmark indicating Siren is now connected to your Validator Client and Beacon Node. If you have separate address setups for your Validator Client and Beacon Node respectively you should access the `Advance Settings` on the configuration and repeat the steps above for each address. + + +## 8. How do I change my Beacon or Validator address after logging in? +Once you have successfully arrived to the main dashboard, use the sidebar to access the settings view. In the top right hand corner there is a `Configuration` action button that will redirect you back to the configuration screen where you can make appropriate changes. + +## 9. Why doesn't my validator balance graph show any data? +If your graph is not showing data, it usually means your validator node is still caching data. The application must wait at least 3 epochs before it can render any graphical visualizations. This could take up to 20min. From 1ff4033830a21d076ea0c6b2720bef28f342e4e4 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 6 Sep 2023 04:37:05 +0000 Subject: [PATCH 04/27] Remove Node.js from release-tests CI job since we no longer use ganache (#4691) ## Issue Addressed I noticed a node.js version warning on our CI, and thought about updating the version to get rid of this warning, but then realized we may not need node.js anymore now we're using `anvil` instead of `ganache`. > The following actions uses node12 which is deprecated and will be forced to run on node16: actions/setup-node@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/ --- .github/workflows/test-suite.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 5819f804847..1d9856b93cf 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -80,14 +80,6 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == false run: rustup update stable - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Install windows build tools - run: | - choco install python visualstudio2019-workload-vctools -y - npm config set msvs_version 2019 - name: Install Foundry (anvil) uses: foundry-rs/foundry-toolchain@v1 with: From 35f47f454f0abc51ef28627e04c8db9ac9d9e455 Mon Sep 17 00:00:00 2001 From: Jack McPherson Date: Mon, 11 Sep 2023 06:14:56 +0000 Subject: [PATCH 05/27] Await listening address from libp2p in RPC tests setup (#4705) ## Issue Addressed #4704 ## Proposed Changes - Receive multiaddr from libp2p by awaiting listener setup ## Additional Info See also: #4675 --- .../lighthouse_network/tests/common.rs | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index 36a2e523855..ffb4b0078b7 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -13,7 +13,6 @@ use tokio::runtime::Runtime; use types::{ ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec, Slot, }; -use unused_port::unused_tcp4_port; type E = MinimalEthSpec; type ReqId = usize; @@ -76,7 +75,7 @@ pub fn build_config(port: u16, mut boot_nodes: Vec) -> NetworkConfig { .unwrap(); config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, port, port); - config.enr_udp4_port = Some(port); + config.enr_udp4_port = if port == 0 { None } else { Some(port) }; config.enr_address = (Some(std::net::Ipv4Addr::LOCALHOST), None); config.boot_nodes_enr.append(&mut boot_nodes); config.network_dir = path.into_path(); @@ -96,7 +95,7 @@ pub async fn build_libp2p_instance( fork_name: ForkName, spec: &ChainSpec, ) -> Libp2pInstance { - let port = unused_tcp4_port().unwrap(); + let port = 0; let config = build_config(port, boot_nodes); // launch libp2p service @@ -139,33 +138,26 @@ pub async fn build_node_pair( let mut sender = build_libp2p_instance(rt.clone(), vec![], sender_log, fork_name, spec).await; let mut receiver = build_libp2p_instance(rt, vec![], receiver_log, fork_name, spec).await; - let receiver_multiaddr = receiver.local_enr().multiaddr()[1].clone(); - // let the two nodes set up listeners let sender_fut = async { loop { - if let NetworkEvent::NewListenAddr(_) = sender.next_event().await { - return; + if let NetworkEvent::NewListenAddr(addr) = sender.next_event().await { + return addr; } } }; let receiver_fut = async { loop { - if let NetworkEvent::NewListenAddr(_) = receiver.next_event().await { - return; + if let NetworkEvent::NewListenAddr(addr) = receiver.next_event().await { + return addr; } } }; let joined = futures::future::join(sender_fut, receiver_fut); - // wait for either both nodes to listen or a timeout - tokio::select! { - _ = tokio::time::sleep(Duration::from_millis(500)) => {} - _ = joined => {} - } + let receiver_multiaddr = joined.await.1; - // sender.dial_peer(peer_id); match sender.testing_dial(receiver_multiaddr.clone()) { Ok(()) => { debug!(log, "Sender dialed receiver"; "address" => format!("{:?}", receiver_multiaddr)) From e4ed317b7681018e1a9f5d995df527ae1b74af4a Mon Sep 17 00:00:00 2001 From: Age Manning Date: Fri, 15 Sep 2023 03:07:24 +0000 Subject: [PATCH 06/27] Add Experimental QUIC support (#4577) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Issue Addressed #4402 ## Proposed Changes This PR adds QUIC support to Lighthouse. As this is not officially spec'd this will only work between lighthouse <-> lighthouse connections. We attempt a QUIC connection (if the node advertises it) and if it fails we fallback to TCP. This should be a backwards compatible modification. We want to test this functionality on live networks to observe any improvements in bandwidth/latency. NOTE: This also removes the websockets transport as I believe no one is really using it. It should be mentioned in our release however. Co-authored-by: João Oliveira --- Cargo.lock | 351 +++++++----------- beacon_node/client/src/lib.rs | 14 - beacon_node/http_api/src/lib.rs | 17 +- beacon_node/http_api/src/test_utils.rs | 2 - beacon_node/lighthouse_network/Cargo.toml | 6 +- beacon_node/lighthouse_network/src/config.rs | 86 +++-- .../lighthouse_network/src/discovery/enr.rs | 30 +- .../src/discovery/enr_ext.rs | 63 +++- .../lighthouse_network/src/discovery/mod.rs | 141 +++---- .../lighthouse_network/src/listen_addr.rs | 55 ++- beacon_node/lighthouse_network/src/metrics.rs | 10 + .../src/peer_manager/mod.rs | 45 +-- .../src/peer_manager/network_behaviour.rs | 96 ++++- .../src/peer_manager/peerdb.rs | 32 +- .../src/peer_manager/peerdb/peer_info.rs | 38 +- .../lighthouse_network/src/service/mod.rs | 92 ++--- .../lighthouse_network/src/service/utils.rs | 41 +- .../lighthouse_network/src/types/globals.rs | 20 - .../lighthouse_network/tests/common.rs | 57 ++- .../lighthouse_network/tests/rpc_tests.rs | 133 +++++-- beacon_node/network/src/nat.rs | 88 +++-- .../src/network_beacon_processor/tests.rs | 11 +- beacon_node/network/src/service.rs | 53 +-- beacon_node/network/src/service/tests.rs | 2 +- beacon_node/src/cli.rs | 71 +++- beacon_node/src/config.rs | 124 +++++-- book/src/SUMMARY.md | 1 + book/src/developers.md | 51 +++ boot_node/src/config.rs | 6 +- lighthouse/tests/beacon_node.rs | 127 +++++-- scripts/local_testnet/beacon_node.sh | 17 +- scripts/local_testnet/start_local_testnet.sh | 2 +- scripts/tests/doppelganger_protection.sh | 28 +- testing/node_test_rig/src/lib.rs | 2 +- testing/simulator/src/local_network.rs | 3 + 35 files changed, 1162 insertions(+), 753 deletions(-) create mode 100644 book/src/developers.md diff --git a/Cargo.lock b/Cargo.lock index ad7b6fe14ce..9bde2d0ad23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -328,7 +328,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -374,7 +374,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -446,7 +446,7 @@ dependencies = [ "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.12", + "pin-project-lite", "rustversion", "serde", "serde_json", @@ -478,9 +478,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -517,9 +517,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] name = "base64ct" @@ -959,9 +959,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -1391,7 +1391,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" dependencies = [ - "nix 0.26.2", + "nix 0.26.3", "windows-sys 0.48.0", ] @@ -1602,9 +1602,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivative" @@ -1643,9 +1643,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a532c1f99a0f596f6960a60d1e119e91582b24b39e2d83a190e61262c3ef0c" +checksum = "d98235fdc2f355d330a8244184ab6b4b33c28679c0b4158f63138e51d6cf7e88" dependencies = [ "bitflags 2.4.0", "byteorder", @@ -1657,9 +1657,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74398b79d81e52e130d991afeed9c86034bb1b7735f46d2f5bf7deb261d80303" +checksum = "e054665eaf6d97d1e7125512bb2d35d07c73ac86cc6920174cb42d1ab697a554" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", @@ -1943,9 +1943,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1975,7 +1975,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "bytes", "ed25519-dalek", "hex", @@ -2889,7 +2889,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.12", + "pin-project-lite", "waker-fn", ] @@ -2956,7 +2956,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite", "pin-utils", "slab", ] @@ -3040,9 +3040,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git-version" @@ -3096,9 +3096,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -3335,7 +3335,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -3441,7 +3441,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.12", + "pin-project-lite", "socket2 0.4.9", "tokio", "tower-service", @@ -3730,7 +3730,7 @@ dependencies = [ "socket2 0.5.3", "widestring 1.0.2", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] @@ -3809,7 +3809,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "pem", "ring", "serde", @@ -4021,7 +4021,6 @@ dependencies = [ "libp2p-quic", "libp2p-swarm", "libp2p-tcp", - "libp2p-websocket", "libp2p-yamux", "multiaddr 0.18.0", "pin-project", @@ -4101,7 +4100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d157562dba6017193e5285acf6b1054759e83540bfd79f75b69d6ce774c88da" dependencies = [ "asynchronous-codec", - "base64 0.21.2", + "base64 0.21.3", "byteorder", "bytes", "either", @@ -4362,26 +4361,6 @@ dependencies = [ "yasna", ] -[[package]] -name = "libp2p-websocket" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3facf0691bab65f571bc97c6c65ffa836248ca631d631b7691ac91deb7fceb5f" -dependencies = [ - "either", - "futures", - "futures-rustls", - "libp2p-core", - "libp2p-identity", - "log", - "parking_lot 0.12.1", - "quicksink", - "rw-stream-sink", - "soketto", - "url", - "webpki-roots 0.25.2", -] - [[package]] name = "libp2p-yamux" version = "0.44.1" @@ -4534,6 +4513,7 @@ dependencies = [ "lazy_static", "libp2p", "libp2p-mplex", + "libp2p-quic", "lighthouse_metrics", "lighthouse_version", "lru 0.7.8", @@ -5240,14 +5220,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "abbbc55ad7b13aac85f9401c796dcda1b864e07fcad40ad47792eaa8932ea502" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "libc", - "static_assertions", ] [[package]] @@ -5309,9 +5288,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg 1.1.0", "num-integer", @@ -5388,9 +5367,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -5456,11 +5435,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -5497,9 +5476,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" dependencies = [ "cc", "libc", @@ -5653,7 +5632,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec 1.11.0", - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -5783,15 +5762,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -name = "pin-project-lite" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -5877,7 +5850,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "windows-sys 0.48.0", ] @@ -5906,11 +5879,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "byteorder", "bytes", "fallible-iterator", @@ -5924,9 +5897,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator", @@ -6195,17 +6168,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "quicksink" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" -dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", -] - [[package]] name = "quinn" version = "0.10.2" @@ -6214,7 +6176,7 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "futures-io", - "pin-project-lite 0.2.12", + "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", @@ -6441,14 +6403,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.7", + "regex-syntax 0.7.5", ] [[package]] @@ -6462,13 +6424,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -6479,17 +6441,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "bytes", "encoding_rs", "futures-core", @@ -6507,7 +6469,7 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.12", + "pin-project-lite", "rustls 0.21.6", "rustls-pemfile", "serde", @@ -6523,8 +6485,8 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.22.6", - "winreg 0.10.1", + "webpki-roots 0.25.2", + "winreg", ] [[package]] @@ -6705,9 +6667,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" dependencies = [ "bitflags 2.4.0", "errno", @@ -6746,7 +6708,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", ] [[package]] @@ -6956,9 +6918,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -6996,9 +6958,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", @@ -7092,19 +7054,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha-1" version = "0.10.1" @@ -7249,15 +7198,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg 1.1.0", ] @@ -7339,9 +7288,9 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "slog-async" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" +checksum = "72c8038f898a2c79507940990f05386455b3a317d8f18d4caea7cbc3d5096b84" dependencies = [ "crossbeam-channel", "slog", @@ -7498,21 +7447,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64 0.13.1", - "bytes", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha-1 0.9.8", -] - [[package]] name = "spin" version = "0.5.2" @@ -7874,14 +7808,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.8", + "rustix 0.38.9", "windows-sys 0.48.0", ] @@ -7987,9 +7921,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ "deranged", "itoa", @@ -8008,9 +7942,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -8091,7 +8025,7 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.12", + "pin-project-lite", "signal-hook-registry", "socket2 0.5.3", "tokio-macros", @@ -8104,7 +8038,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.12", + "pin-project-lite", "tokio", ] @@ -8131,9 +8065,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -8145,12 +8079,14 @@ dependencies = [ "parking_lot 0.12.1", "percent-encoding", "phf", - "pin-project-lite 0.2.12", + "pin-project-lite", "postgres-protocol", "postgres-types", + "rand 0.8.5", "socket2 0.5.3", "tokio", "tokio-util 0.7.8", + "whoami", ] [[package]] @@ -8181,7 +8117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite", "tokio", "tokio-util 0.7.8", ] @@ -8225,7 +8161,7 @@ dependencies = [ "futures-io", "futures-sink", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "slab", "tokio", ] @@ -8239,7 +8175,7 @@ dependencies = [ "bytes", "futures-core", "futures-sink", - "pin-project-lite 0.2.12", + "pin-project-lite", "slab", "tokio", "tracing", @@ -8297,7 +8233,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.12", + "pin-project-lite", "tokio", "tower-layer", "tower-service", @@ -8324,7 +8260,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -8506,7 +8442,7 @@ dependencies = [ "log", "rand 0.8.5", "rustls 0.20.8", - "sha-1 0.10.1", + "sha-1", "thiserror", "url", "utf-8", @@ -8612,9 +8548,9 @@ checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -9007,9 +8943,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -9130,6 +9066,16 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "widestring" version = "0.4.3" @@ -9198,7 +9144,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -9228,7 +9174,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -9248,17 +9194,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f51fb4c64f8b770a823c043c7fad036323e1c48f55287b7bbb7987b2fcdf3b" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.3", - "windows_aarch64_msvc 0.48.3", - "windows_i686_gnu 0.48.3", - "windows_i686_msvc 0.48.3", - "windows_x86_64_gnu 0.48.3", - "windows_x86_64_gnullvm 0.48.3", - "windows_x86_64_msvc 0.48.3", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -9269,9 +9215,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde1bb55ae4ce76a597a8566d82c57432bc69c039449d61572a7a353da28f68c" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -9287,9 +9233,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1513e8d48365a78adad7322fd6b5e4c4e99d92a69db8df2d435b25b1f1f286d4" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -9305,9 +9251,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60587c0265d2b842298f5858e1a5d79d146f9ee0c37be5782e92a6eb5e1d7a83" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -9323,9 +9269,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224fe0e0ffff5d2ea6a29f82026c8f43870038a0ffc247aa95a52b47df381ac4" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -9341,9 +9287,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fc52a0f50a088de499712cbc012df7ebd94e2d6eb948435449d76a6287e7ad" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -9353,9 +9299,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2093925509d91ea3d69bcd20238f4c2ecdb1a29d3c281d026a09705d0dd35f3d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -9371,28 +9317,19 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ade45bc8bf02ae2aa34a9d54ba660a1a58204da34ba793c00d83ca3730b5f1" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - [[package]] name = "winreg" version = "0.50.0" diff --git a/beacon_node/client/src/lib.rs b/beacon_node/client/src/lib.rs index 584a0d736de..399aa06511e 100644 --- a/beacon_node/client/src/lib.rs +++ b/beacon_node/client/src/lib.rs @@ -46,20 +46,6 @@ impl Client { self.http_metrics_listen_addr } - /// Returns the ipv4 port of the client's libp2p stack, if it was started. - pub fn libp2p_listen_ipv4_port(&self) -> Option { - self.network_globals - .as_ref() - .and_then(|n| n.listen_port_tcp4()) - } - - /// Returns the ipv6 port of the client's libp2p stack, if it was started. - pub fn libp2p_listen_ipv6_port(&self) -> Option { - self.network_globals - .as_ref() - .and_then(|n| n.listen_port_tcp6()) - } - /// Returns the list of libp2p addresses the client is listening to. pub fn libp2p_listen_addresses(&self) -> Option> { self.network_globals.as_ref().map(|n| n.listen_multiaddrs()) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 19d62c060d9..08b18e86d00 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -2825,12 +2825,8 @@ pub fn serve( })?; if let Some(peer_info) = network_globals.peers.read().peer_info(&peer_id) { - let address = if let Some(socket_addr) = peer_info.seen_addresses().next() { - let mut addr = lighthouse_network::Multiaddr::from(socket_addr.ip()); - addr.push(lighthouse_network::multiaddr::Protocol::Tcp( - socket_addr.port(), - )); - addr.to_string() + let address = if let Some(multiaddr) = peer_info.seen_multiaddrs().next() { + multiaddr.to_string() } else if let Some(addr) = peer_info.listening_addresses().first() { addr.to_string() } else { @@ -2878,13 +2874,8 @@ pub fn serve( .peers() .for_each(|(peer_id, peer_info)| { let address = - if let Some(socket_addr) = peer_info.seen_addresses().next() { - let mut addr = - lighthouse_network::Multiaddr::from(socket_addr.ip()); - addr.push(lighthouse_network::multiaddr::Protocol::Tcp( - socket_addr.port(), - )); - addr.to_string() + if let Some(multiaddr) = peer_info.seen_multiaddrs().next() { + multiaddr.to_string() } else if let Some(addr) = peer_info.listening_addresses().first() { addr.to_string() } else { diff --git a/beacon_node/http_api/src/test_utils.rs b/beacon_node/http_api/src/test_utils.rs index 33834d58ca0..fb3497ff8ba 100644 --- a/beacon_node/http_api/src/test_utils.rs +++ b/beacon_node/http_api/src/test_utils.rs @@ -152,8 +152,6 @@ pub async fn create_api_server_on_port( let enr = EnrBuilder::new("v4").build(&enr_key).unwrap(); let network_globals = Arc::new(NetworkGlobals::new( enr.clone(), - Some(TCP_PORT), - None, meta_data, vec![], false, diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index 925d278ad62..3e399f74800 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -44,12 +44,13 @@ prometheus-client = "0.21.0" unused_port = { path = "../../common/unused_port" } delay_map = "0.3.0" void = "1" +libp2p-quic= { version = "0.9.2", features=["tokio"]} libp2p-mplex = "0.40.0" [dependencies.libp2p] version = "0.52" default-features = false -features = ["websocket", "identify", "yamux", "noise", "gossipsub", "dns", "tcp", "tokio", "plaintext", "secp256k1", "macros", "ecdsa"] +features = ["identify", "yamux", "noise", "gossipsub", "dns", "tcp", "tokio", "plaintext", "secp256k1", "macros", "ecdsa"] [dev-dependencies] slog-term = "2.6.0" @@ -59,6 +60,3 @@ exit-future = "0.2.0" void = "1" quickcheck = "0.9.2" quickcheck_macros = "0.9.1" - -[features] -libp2p-websocket = [] \ No newline at end of file diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index 0ab7c03e7f6..d8c3f619dcb 100644 --- a/beacon_node/lighthouse_network/src/config.rs +++ b/beacon_node/lighthouse_network/src/config.rs @@ -58,18 +58,24 @@ pub struct Config { /// that no discovery address has been set in the CLI args. pub enr_address: (Option, Option), - /// The udp4 port to broadcast to peers in order to reach back for discovery. + /// The udp ipv4 port to broadcast to peers in order to reach back for discovery. pub enr_udp4_port: Option, - /// The tcp4 port to broadcast to peers in order to reach back for libp2p services. + /// The quic ipv4 port to broadcast to peers in order to reach back for libp2p services. + pub enr_quic4_port: Option, + + /// The tcp ipv4 port to broadcast to peers in order to reach back for libp2p services. pub enr_tcp4_port: Option, - /// The udp6 port to broadcast to peers in order to reach back for discovery. + /// The udp ipv6 port to broadcast to peers in order to reach back for discovery. pub enr_udp6_port: Option, - /// The tcp6 port to broadcast to peers in order to reach back for libp2p services. + /// The tcp ipv6 port to broadcast to peers in order to reach back for libp2p services. pub enr_tcp6_port: Option, + /// The quic ipv6 port to broadcast to peers in order to reach back for libp2p services. + pub enr_quic6_port: Option, + /// Target number of connected peers. pub target_peers: usize, @@ -102,6 +108,9 @@ pub struct Config { /// Disables the discovery protocol from starting. pub disable_discovery: bool, + /// Disables quic support. + pub disable_quic_support: bool, + /// Attempt to construct external port mappings with UPnP. pub upnp_enabled: bool, @@ -149,57 +158,76 @@ impl Config { /// Sets the listening address to use an ipv4 address. The discv5 ip_mode and table filter are /// adjusted accordingly to ensure addresses that are present in the enr are globally /// reachable. - pub fn set_ipv4_listening_address(&mut self, addr: Ipv4Addr, tcp_port: u16, udp_port: u16) { + pub fn set_ipv4_listening_address( + &mut self, + addr: Ipv4Addr, + tcp_port: u16, + disc_port: u16, + quic_port: u16, + ) { self.listen_addresses = ListenAddress::V4(ListenAddr { addr, - udp_port, + disc_port, + quic_port, tcp_port, }); - self.discv5_config.listen_config = discv5::ListenConfig::from_ip(addr.into(), udp_port); + self.discv5_config.listen_config = discv5::ListenConfig::from_ip(addr.into(), disc_port); self.discv5_config.table_filter = |enr| enr.ip4().as_ref().map_or(false, is_global_ipv4) } /// Sets the listening address to use an ipv6 address. The discv5 ip_mode and table filter is /// adjusted accordingly to ensure addresses that are present in the enr are globally /// reachable. - pub fn set_ipv6_listening_address(&mut self, addr: Ipv6Addr, tcp_port: u16, udp_port: u16) { + pub fn set_ipv6_listening_address( + &mut self, + addr: Ipv6Addr, + tcp_port: u16, + disc_port: u16, + quic_port: u16, + ) { self.listen_addresses = ListenAddress::V6(ListenAddr { addr, - udp_port, + disc_port, + quic_port, tcp_port, }); - self.discv5_config.listen_config = discv5::ListenConfig::from_ip(addr.into(), udp_port); + self.discv5_config.listen_config = discv5::ListenConfig::from_ip(addr.into(), disc_port); self.discv5_config.table_filter = |enr| enr.ip6().as_ref().map_or(false, is_global_ipv6) } /// Sets the listening address to use both an ipv4 and ipv6 address. The discv5 ip_mode and /// table filter is adjusted accordingly to ensure addresses that are present in the enr are /// globally reachable. + #[allow(clippy::too_many_arguments)] pub fn set_ipv4_ipv6_listening_addresses( &mut self, v4_addr: Ipv4Addr, tcp4_port: u16, - udp4_port: u16, + disc4_port: u16, + quic4_port: u16, v6_addr: Ipv6Addr, tcp6_port: u16, - udp6_port: u16, + disc6_port: u16, + quic6_port: u16, ) { self.listen_addresses = ListenAddress::DualStack( ListenAddr { addr: v4_addr, - udp_port: udp4_port, + disc_port: disc4_port, + quic_port: quic4_port, tcp_port: tcp4_port, }, ListenAddr { addr: v6_addr, - udp_port: udp6_port, + disc_port: disc6_port, + quic_port: quic6_port, tcp_port: tcp6_port, }, ); self.discv5_config.listen_config = discv5::ListenConfig::default() - .with_ipv4(v4_addr, udp4_port) - .with_ipv6(v6_addr, udp6_port); + .with_ipv4(v4_addr, disc4_port) + .with_ipv6(v6_addr, disc6_port); self.discv5_config.table_filter = |enr| match (&enr.ip4(), &enr.ip6()) { (None, None) => false, @@ -213,27 +241,32 @@ impl Config { match listen_addr { ListenAddress::V4(ListenAddr { addr, - udp_port, + disc_port, + quic_port, tcp_port, - }) => self.set_ipv4_listening_address(addr, tcp_port, udp_port), + }) => self.set_ipv4_listening_address(addr, tcp_port, disc_port, quic_port), ListenAddress::V6(ListenAddr { addr, - udp_port, + disc_port, + quic_port, tcp_port, - }) => self.set_ipv6_listening_address(addr, tcp_port, udp_port), + }) => self.set_ipv6_listening_address(addr, tcp_port, disc_port, quic_port), ListenAddress::DualStack( ListenAddr { addr: ip4addr, - udp_port: udp4_port, + disc_port: disc4_port, + quic_port: quic4_port, tcp_port: tcp4_port, }, ListenAddr { addr: ip6addr, - udp_port: udp6_port, + disc_port: disc6_port, + quic_port: quic6_port, tcp_port: tcp6_port, }, ) => self.set_ipv4_ipv6_listening_addresses( - ip4addr, tcp4_port, udp4_port, ip6addr, tcp6_port, udp6_port, + ip4addr, tcp4_port, disc4_port, quic4_port, ip6addr, tcp6_port, disc6_port, + quic6_port, ), } } @@ -272,7 +305,8 @@ impl Default for Config { ); let listen_addresses = ListenAddress::V4(ListenAddr { addr: Ipv4Addr::UNSPECIFIED, - udp_port: 9000, + disc_port: 9000, + quic_port: 9001, tcp_port: 9000, }); @@ -305,10 +339,11 @@ impl Default for Config { network_dir, listen_addresses, enr_address: (None, None), - enr_udp4_port: None, + enr_quic4_port: None, enr_tcp4_port: None, enr_udp6_port: None, + enr_quic6_port: None, enr_tcp6_port: None, target_peers: 50, gs_config, @@ -320,6 +355,7 @@ impl Default for Config { disable_peer_scoring: false, client_version: lighthouse_version::version_with_platform(), disable_discovery: false, + disable_quic_support: false, upnp_enabled: true, network_load: 3, private: false, diff --git a/beacon_node/lighthouse_network/src/discovery/enr.rs b/beacon_node/lighthouse_network/src/discovery/enr.rs index ef22f816a77..3f46285a807 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr.rs @@ -17,6 +17,8 @@ use std::path::Path; use std::str::FromStr; use types::{EnrForkId, EthSpec}; +use super::enr_ext::{EnrExt, QUIC6_ENR_KEY, QUIC_ENR_KEY}; + /// The ENR field specifying the fork id. pub const ETH2_ENR_KEY: &str = "eth2"; /// The ENR field specifying the attestation subnet bitfield. @@ -142,7 +144,7 @@ pub fn build_or_load_enr( pub fn create_enr_builder_from_config( config: &NetworkConfig, - enable_tcp: bool, + enable_libp2p: bool, ) -> EnrBuilder { let mut builder = EnrBuilder::new("v4"); let (maybe_ipv4_address, maybe_ipv6_address) = &config.enr_address; @@ -163,7 +165,28 @@ pub fn create_enr_builder_from_config( builder.udp6(udp6_port); } - if enable_tcp { + if enable_libp2p { + // Add QUIC fields to the ENR. + // Since QUIC is used as an alternative transport for the libp2p protocols, + // the related fields should only be added when both QUIC and libp2p are enabled + if !config.disable_quic_support { + // If we are listening on ipv4, add the quic ipv4 port. + if let Some(quic4_port) = config + .enr_quic4_port + .or_else(|| config.listen_addrs().v4().map(|v4_addr| v4_addr.quic_port)) + { + builder.add_value(QUIC_ENR_KEY, &quic4_port); + } + + // If we are listening on ipv6, add the quic ipv6 port. + if let Some(quic6_port) = config + .enr_quic6_port + .or_else(|| config.listen_addrs().v6().map(|v6_addr| v6_addr.quic_port)) + { + builder.add_value(QUIC6_ENR_KEY, &quic6_port); + } + } + // If the ENR port is not set, and we are listening over that ip version, use the listening port instead. let tcp4_port = config .enr_tcp4_port @@ -218,6 +241,9 @@ fn compare_enr(local_enr: &Enr, disk_enr: &Enr) -> bool { // tcp ports must match && local_enr.tcp4() == disk_enr.tcp4() && local_enr.tcp6() == disk_enr.tcp6() + // quic ports must match + && local_enr.quic4() == disk_enr.quic4() + && local_enr.quic6() == disk_enr.quic6() // must match on the same fork && local_enr.get(ETH2_ENR_KEY) == disk_enr.get(ETH2_ENR_KEY) // take preference over disk udp port if one is not specified diff --git a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs index 753da6292ca..2efaa76ac31 100644 --- a/beacon_node/lighthouse_network/src/discovery/enr_ext.rs +++ b/beacon_node/lighthouse_network/src/discovery/enr_ext.rs @@ -6,12 +6,15 @@ use libp2p::core::multiaddr::Protocol; use libp2p::identity::{ed25519, secp256k1, KeyType, Keypair, PublicKey}; use tiny_keccak::{Hasher, Keccak}; +pub const QUIC_ENR_KEY: &str = "quic"; +pub const QUIC6_ENR_KEY: &str = "quic6"; + /// Extend ENR for libp2p types. pub trait EnrExt { /// The libp2p `PeerId` for the record. fn peer_id(&self) -> PeerId; - /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp` or `udp` key **or** an `ip6` and either a `tcp6` or `udp6`. + /// Returns a list of multiaddrs if the ENR has an `ip` and one of [`tcp`,`udp`,`quic`] key **or** an `ip6` and one of [`tcp6`,`udp6`,`quic6`]. /// The vector remains empty if these fields are not defined. fn multiaddr(&self) -> Vec; @@ -26,6 +29,15 @@ pub trait EnrExt { /// Returns any multiaddrs that contain the TCP protocol. fn multiaddr_tcp(&self) -> Vec; + + /// Returns any QUIC multiaddrs that are registered in this ENR. + fn multiaddr_quic(&self) -> Vec; + + /// Returns the quic port if one is set. + fn quic4(&self) -> Option; + + /// Returns the quic6 port if one is set. + fn quic6(&self) -> Option; } /// Extend ENR CombinedPublicKey for libp2p types. @@ -49,7 +61,17 @@ impl EnrExt for Enr { self.public_key().as_peer_id() } - /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp` or `udp` key **or** an `ip6` and either a `tcp6` or `udp6`. + /// Returns the quic port if one is set. + fn quic4(&self) -> Option { + self.get_decodable(QUIC_ENR_KEY).and_then(Result::ok) + } + + /// Returns the quic6 port if one is set. + fn quic6(&self) -> Option { + self.get_decodable(QUIC6_ENR_KEY).and_then(Result::ok) + } + + /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp`, `quic` or `udp` key **or** an `ip6` and either a `tcp6` `quic6` or `udp6`. /// The vector remains empty if these fields are not defined. fn multiaddr(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); @@ -59,6 +81,12 @@ impl EnrExt for Enr { multiaddr.push(Protocol::Udp(udp)); multiaddrs.push(multiaddr); } + if let Some(quic) = self.quic4() { + let mut multiaddr: Multiaddr = ip.into(); + multiaddr.push(Protocol::Udp(quic)); + multiaddr.push(Protocol::QuicV1); + multiaddrs.push(multiaddr); + } if let Some(tcp) = self.tcp4() { let mut multiaddr: Multiaddr = ip.into(); @@ -73,6 +101,13 @@ impl EnrExt for Enr { multiaddrs.push(multiaddr); } + if let Some(quic6) = self.quic6() { + let mut multiaddr: Multiaddr = ip6.into(); + multiaddr.push(Protocol::Udp(quic6)); + multiaddr.push(Protocol::QuicV1); + multiaddrs.push(multiaddr); + } + if let Some(tcp6) = self.tcp6() { let mut multiaddr: Multiaddr = ip6.into(); multiaddr.push(Protocol::Tcp(tcp6)); @@ -174,8 +209,30 @@ impl EnrExt for Enr { multiaddrs } + /// Returns a list of multiaddrs if the ENR has an `ip` and a `quic` key **or** an `ip6` and a `quic6`. + fn multiaddr_quic(&self) -> Vec { + let mut multiaddrs: Vec = Vec::new(); + if let Some(quic_port) = self.quic4() { + if let Some(ip) = self.ip4() { + let mut multiaddr: Multiaddr = ip.into(); + multiaddr.push(Protocol::Udp(quic_port)); + multiaddr.push(Protocol::QuicV1); + multiaddrs.push(multiaddr); + } + } + + if let Some(quic6_port) = self.quic6() { + if let Some(ip6) = self.ip6() { + let mut multiaddr: Multiaddr = ip6.into(); + multiaddr.push(Protocol::Udp(quic6_port)); + multiaddr.push(Protocol::QuicV1); + multiaddrs.push(multiaddr); + } + } + multiaddrs + } + /// Returns a list of multiaddrs if the ENR has an `ip` and either a `tcp` or `udp` key **or** an `ip6` and either a `tcp6` or `udp6`. - /// The vector remains empty if these fields are not defined. fn multiaddr_tcp(&self) -> Vec { let mut multiaddrs: Vec = Vec::new(); if let Some(ip) = self.ip4() { diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index c3819f1eb94..4d8807336bf 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -21,7 +21,6 @@ pub use libp2p::identity::{Keypair, PublicKey}; use enr::{ATTESTATION_BITFIELD_ENR_KEY, ETH2_ENR_KEY, SYNC_COMMITTEE_BITFIELD_ENR_KEY}; use futures::prelude::*; use futures::stream::FuturesUnordered; -use libp2p::multiaddr::Protocol; use libp2p::swarm::behaviour::{DialFailure, FromSwarm}; use libp2p::swarm::THandlerInEvent; pub use libp2p::{ @@ -75,7 +74,7 @@ const DURATION_DIFFERENCE: Duration = Duration::from_millis(1); /// of the peer if it is specified. #[derive(Debug)] pub struct DiscoveredPeers { - pub peers: HashMap>, + pub peers: HashMap>, } #[derive(Clone, PartialEq)] @@ -208,7 +207,8 @@ impl Discovery { let local_node_id = local_enr.node_id(); info!(log, "ENR Initialised"; "enr" => local_enr.to_base64(), "seq" => local_enr.seq(), "id"=> %local_enr.node_id(), - "ip4" => ?local_enr.ip4(), "udp4"=> ?local_enr.udp4(), "tcp4" => ?local_enr.tcp4(), "tcp6" => ?local_enr.tcp6(), "udp6" => ?local_enr.udp6() + "ip4" => ?local_enr.ip4(), "udp4"=> ?local_enr.udp4(), "tcp4" => ?local_enr.tcp4(), "tcp6" => ?local_enr.tcp6(), "udp6" => ?local_enr.udp6(), + "quic4" => ?local_enr.quic4(), "quic6" => ?local_enr.quic6() ); // convert the keypair into an ENR key @@ -230,7 +230,8 @@ impl Discovery { "peer_id" => %bootnode_enr.peer_id(), "ip" => ?bootnode_enr.ip4(), "udp" => ?bootnode_enr.udp4(), - "tcp" => ?bootnode_enr.tcp4() + "tcp" => ?bootnode_enr.tcp4(), + "quic" => ?bootnode_enr.quic4() ); let repr = bootnode_enr.to_string(); let _ = discv5.add_enr(bootnode_enr).map_err(|e| { @@ -281,7 +282,8 @@ impl Discovery { "peer_id" => %enr.peer_id(), "ip" => ?enr.ip4(), "udp" => ?enr.udp4(), - "tcp" => ?enr.tcp4() + "tcp" => ?enr.tcp4(), + "quic" => ?enr.quic4() ); let _ = discv5.add_enr(enr).map_err(|e| { error!( @@ -383,20 +385,6 @@ impl Discovery { self.discv5.table_entries_enr() } - /// Returns the ENR of a known peer if it exists. - pub fn enr_of_peer(&mut self, peer_id: &PeerId) -> Option { - // first search the local cache - if let Some(enr) = self.cached_enrs.get(peer_id) { - return Some(enr.clone()); - } - // not in the local cache, look in the routing table - if let Ok(node_id) = enr_ext::peer_id_to_node_id(peer_id) { - self.discv5.find_enr(&node_id) - } else { - None - } - } - /// Updates the local ENR TCP port. /// There currently isn't a case to update the address here. We opt for discovery to /// automatically update the external address. @@ -414,6 +402,23 @@ impl Discovery { Ok(()) } + // TODO: Group these functions here once the ENR is shared across discv5 and lighthouse and + // Lighthouse can modify the ENR directly. + // This currently doesn't support ipv6. All of these functions should be removed and + // addressed properly in the following issue. + // https://github.com/sigp/lighthouse/issues/4706 + pub fn update_enr_quic_port(&mut self, port: u16) -> Result<(), String> { + self.discv5 + .enr_insert("quic", &port) + .map_err(|e| format!("{:?}", e))?; + + // replace the global version + *self.network_globals.local_enr.write() = self.discv5.local_enr(); + // persist modified enr to disk + enr::save_enr_to_disk(Path::new(&self.enr_dir), &self.local_enr(), &self.log); + Ok(()) + } + /// Updates the local ENR UDP socket. /// /// This is with caution. Discovery should automatically maintain this. This should only be @@ -733,23 +738,6 @@ impl Discovery { target_peers: usize, additional_predicate: impl Fn(&Enr) -> bool + Send + 'static, ) { - // Make sure there are subnet queries included - let contains_queries = match &query { - QueryType::Subnet(queries) => !queries.is_empty(), - QueryType::FindPeers => true, - }; - - if !contains_queries { - debug!( - self.log, - "No subnets included in this request. Skipping discovery request." - ); - return; - } - - // Generate a random target node id. - let random_node = NodeId::random(); - let enr_fork_id = match self.local_enr().eth2() { Ok(v) => v, Err(e) => { @@ -773,7 +761,8 @@ impl Discovery { // Build the future let query_future = self .discv5 - .find_node_predicate(random_node, predicate, target_peers) + // Generate a random target node id. + .find_node_predicate(NodeId::random(), predicate, target_peers) .map(|v| QueryResult { query_type: query, result: v, @@ -787,7 +776,7 @@ impl Discovery { fn process_completed_queries( &mut self, query: QueryResult, - ) -> Option>> { + ) -> Option>> { match query.query_type { QueryType::FindPeers => { self.find_peer_active = false; @@ -797,12 +786,14 @@ impl Discovery { } Ok(r) => { debug!(self.log, "Discovery query completed"; "peers_found" => r.len()); - let mut results: HashMap<_, Option> = HashMap::new(); - r.iter().for_each(|enr| { - // cache the found ENR's - self.cached_enrs.put(enr.peer_id(), enr.clone()); - results.insert(enr.peer_id(), None); - }); + let results = r + .into_iter() + .map(|enr| { + // cache the found ENR's + self.cached_enrs.put(enr.peer_id(), enr.clone()); + (enr, None) + }) + .collect(); return Some(results); } Err(e) => { @@ -850,17 +841,17 @@ impl Discovery { let subnet_predicate = subnet_predicate::(vec![query.subnet], &self.log); - r.iter() + r.clone() + .into_iter() .filter(|enr| subnet_predicate(enr)) - .map(|enr| enr.peer_id()) - .for_each(|peer_id| { + .for_each(|enr| { if let Some(v) = metrics::get_int_counter( &metrics::SUBNET_PEERS_FOUND, &[query_str], ) { v.inc(); } - let other_min_ttl = mapped_results.get_mut(&peer_id); + let other_min_ttl = mapped_results.get_mut(&enr); // map peer IDs to the min_ttl furthest in the future match (query.min_ttl, other_min_ttl) { @@ -878,15 +869,11 @@ impl Discovery { } // update the mapping if we have a specified min_ttl (Some(min_ttl), Some(None)) => { - mapped_results.insert(peer_id, Some(min_ttl)); - } - // first seen min_ttl for this enr - (Some(min_ttl), None) => { - mapped_results.insert(peer_id, Some(min_ttl)); + mapped_results.insert(enr, Some(min_ttl)); } // first seen min_ttl for this enr - (None, None) => { - mapped_results.insert(peer_id, None); + (min_ttl, None) => { + mapped_results.insert(enr, min_ttl); } (None, Some(Some(_))) => {} // Don't replace the existing specific min_ttl (None, Some(None)) => {} // No-op because this is a duplicate @@ -910,7 +897,7 @@ impl Discovery { } /// Drives the queries returning any results from completed queries. - fn poll_queries(&mut self, cx: &mut Context) -> Option>> { + fn poll_queries(&mut self, cx: &mut Context) -> Option>> { while let Poll::Ready(Some(query_result)) = self.active_queries.poll_next_unpin(cx) { let result = self.process_completed_queries(query_result); if result.is_some() { @@ -957,23 +944,6 @@ impl NetworkBehaviour for Discovery { ) { } - fn handle_pending_outbound_connection( - &mut self, - _connection_id: ConnectionId, - maybe_peer: Option, - _addresses: &[Multiaddr], - _effective_role: libp2p::core::Endpoint, - ) -> Result, libp2p::swarm::ConnectionDenied> { - if let Some(enr) = maybe_peer.and_then(|peer_id| self.enr_of_peer(&peer_id)) { - // ENR's may have multiple Multiaddrs. The multi-addr associated with the UDP - // port is removed, which is assumed to be associated with the discv5 protocol (and - // therefore irrelevant for other libp2p components). - Ok(enr.multiaddr_tcp()) - } else { - Ok(vec![]) - } - } - // Main execution loop to drive the behaviour fn poll( &mut self, @@ -1047,25 +1017,8 @@ impl NetworkBehaviour for Discovery { // update network globals *self.network_globals.local_enr.write() = enr; // A new UDP socket has been detected. - // Build a multiaddr to report to libp2p - let addr = match socket_addr.ip() { - IpAddr::V4(v4_addr) => { - self.network_globals.listen_port_tcp4().map(|tcp4_port| { - Multiaddr::from(v4_addr).with(Protocol::Tcp(tcp4_port)) - }) - } - IpAddr::V6(v6_addr) => { - self.network_globals.listen_port_tcp6().map(|tcp6_port| { - Multiaddr::from(v6_addr).with(Protocol::Tcp(tcp6_port)) - }) - } - }; - - if let Some(address) = addr { - // NOTE: This doesn't actually track the external TCP port. More sophisticated NAT handling - // should handle this. - return Poll::Ready(ToSwarm::NewExternalAddrCandidate(address)); - } + // NOTE: We assume libp2p itself can keep track of IP changes and we do + // not inform it about IP changes found via discovery. } Discv5Event::EnrAdded { .. } | Discv5Event::TalkRequest(_) @@ -1152,8 +1105,6 @@ mod tests { let log = build_log(slog::Level::Debug, false); let globals = NetworkGlobals::new( enr, - Some(9000), - None, MetaData::V2(MetaDataV2 { seq_number: 0, attnets: Default::default(), @@ -1261,6 +1212,6 @@ mod tests { assert_eq!(results.len(), 2); // when a peer belongs to multiple subnet ids, we use the highest ttl. - assert_eq!(results.get(&enr1.peer_id()).unwrap(), &instant1); + assert_eq!(results.get(&enr1).unwrap(), &instant1); } } diff --git a/beacon_node/lighthouse_network/src/listen_addr.rs b/beacon_node/lighthouse_network/src/listen_addr.rs index 20d87d403cd..53f7d9dacae 100644 --- a/beacon_node/lighthouse_network/src/listen_addr.rs +++ b/beacon_node/lighthouse_network/src/listen_addr.rs @@ -6,14 +6,23 @@ use serde::{Deserialize, Serialize}; /// A listening address composed by an Ip, an UDP port and a TCP port. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct ListenAddr { + /// The IP address we will listen on. pub addr: Ip, - pub udp_port: u16, + /// The UDP port that discovery will listen on. + pub disc_port: u16, + /// The UDP port that QUIC will listen on. + pub quic_port: u16, + /// The TCP port that libp2p will listen on. pub tcp_port: u16, } impl + Clone> ListenAddr { - pub fn udp_socket_addr(&self) -> SocketAddr { - (self.addr.clone().into(), self.udp_port).into() + pub fn discovery_socket_addr(&self) -> SocketAddr { + (self.addr.clone().into(), self.disc_port).into() + } + + pub fn quic_socket_addr(&self) -> SocketAddr { + (self.addr.clone().into(), self.quic_port).into() } pub fn tcp_socket_addr(&self) -> SocketAddr { @@ -46,22 +55,41 @@ impl ListenAddress { } } - /// Returns the TCP addresses. - pub fn tcp_addresses(&self) -> impl Iterator + '_ { - let v4_multiaddr = self + /// Returns the addresses the Swarm will listen on, given the setup. + pub fn libp2p_addresses(&self) -> impl Iterator { + let v4_tcp_multiaddr = self .v4() .map(|v4_addr| Multiaddr::from(v4_addr.addr).with(Protocol::Tcp(v4_addr.tcp_port))); - let v6_multiaddr = self + + let v4_quic_multiaddr = self.v4().map(|v4_addr| { + Multiaddr::from(v4_addr.addr) + .with(Protocol::Udp(v4_addr.quic_port)) + .with(Protocol::QuicV1) + }); + + let v6_quic_multiaddr = self.v6().map(|v6_addr| { + Multiaddr::from(v6_addr.addr) + .with(Protocol::Udp(v6_addr.quic_port)) + .with(Protocol::QuicV1) + }); + + let v6_tcp_multiaddr = self .v6() .map(|v6_addr| Multiaddr::from(v6_addr.addr).with(Protocol::Tcp(v6_addr.tcp_port))); - v4_multiaddr.into_iter().chain(v6_multiaddr) + + v4_tcp_multiaddr + .into_iter() + .chain(v4_quic_multiaddr) + .chain(v6_quic_multiaddr) + .chain(v6_tcp_multiaddr) } #[cfg(test)] pub fn unused_v4_ports() -> Self { ListenAddress::V4(ListenAddr { addr: Ipv4Addr::UNSPECIFIED, - udp_port: unused_port::unused_udp4_port().unwrap(), + disc_port: unused_port::unused_udp4_port().unwrap(), + quic_port: unused_port::unused_udp4_port().unwrap(), tcp_port: unused_port::unused_tcp4_port().unwrap(), }) } @@ -70,7 +98,8 @@ impl ListenAddress { pub fn unused_v6_ports() -> Self { ListenAddress::V6(ListenAddr { addr: Ipv6Addr::UNSPECIFIED, - udp_port: unused_port::unused_udp6_port().unwrap(), + disc_port: unused_port::unused_udp6_port().unwrap(), + quic_port: unused_port::unused_udp6_port().unwrap(), tcp_port: unused_port::unused_tcp6_port().unwrap(), }) } @@ -84,12 +113,14 @@ impl slog::KV for ListenAddress { ) -> slog::Result { if let Some(v4_addr) = self.v4() { serializer.emit_arguments("ip4_address", &format_args!("{}", v4_addr.addr))?; - serializer.emit_u16("udp4_port", v4_addr.udp_port)?; + serializer.emit_u16("disc4_port", v4_addr.disc_port)?; + serializer.emit_u16("quic4_port", v4_addr.quic_port)?; serializer.emit_u16("tcp4_port", v4_addr.tcp_port)?; } if let Some(v6_addr) = self.v6() { serializer.emit_arguments("ip6_address", &format_args!("{}", v6_addr.addr))?; - serializer.emit_u16("udp6_port", v6_addr.udp_port)?; + serializer.emit_u16("disc6_port", v6_addr.disc_port)?; + serializer.emit_u16("quic6_port", v6_addr.quic_port)?; serializer.emit_u16("tcp6_port", v6_addr.tcp_port)?; } slog::Result::Ok(()) diff --git a/beacon_node/lighthouse_network/src/metrics.rs b/beacon_node/lighthouse_network/src/metrics.rs index 58cc9920126..ae02b689d81 100644 --- a/beacon_node/lighthouse_network/src/metrics.rs +++ b/beacon_node/lighthouse_network/src/metrics.rs @@ -14,6 +14,16 @@ lazy_static! { "Count of libp2p peers currently connected" ); + pub static ref TCP_PEERS_CONNECTED: Result = try_create_int_gauge( + "libp2p_tcp_peers", + "Count of libp2p peers currently connected via TCP" + ); + + pub static ref QUIC_PEERS_CONNECTED: Result = try_create_int_gauge( + "libp2p_quic_peers", + "Count of libp2p peers currently connected via QUIC" + ); + pub static ref PEER_CONNECT_EVENT_COUNT: Result = try_create_int_counter( "libp2p_peer_connect_event_total", "Count of libp2p peer connect events (not the current number of connected peers)" diff --git a/beacon_node/lighthouse_network/src/peer_manager/mod.rs b/beacon_node/lighthouse_network/src/peer_manager/mod.rs index f6158ed3a0c..9118dc1d0c1 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/mod.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/mod.rs @@ -1,5 +1,6 @@ //! Implementation of Lighthouse's peer management system. +use crate::discovery::enr_ext::EnrExt; use crate::rpc::{GoodbyeReason, MetaData, Protocol, RPCError, RPCResponseErrorCode}; use crate::service::TARGET_SUBNET_PEERS; use crate::{error, metrics, Gossipsub}; @@ -13,7 +14,6 @@ use peerdb::{client::ClientKind, BanOperation, BanResult, ScoreUpdateResult}; use rand::seq::SliceRandom; use slog::{debug, error, trace, warn}; use smallvec::SmallVec; -use std::collections::BTreeMap; use std::{ sync::Arc, time::{Duration, Instant}, @@ -78,7 +78,7 @@ pub struct PeerManager { /// The target number of peers we would like to connect to. target_peers: usize, /// Peers queued to be dialed. - peers_to_dial: BTreeMap>, + peers_to_dial: Vec, /// The number of temporarily banned peers. This is used to prevent instantaneous /// reconnection. // NOTE: This just prevents re-connections. The state of the peer is otherwise unaffected. A @@ -312,16 +312,12 @@ impl PeerManager { /// Peers that have been returned by discovery requests that are suitable for dialing are /// returned here. /// - /// NOTE: By dialing `PeerId`s and not multiaddrs, libp2p requests the multiaddr associated - /// with a new `PeerId` which involves a discovery routing table lookup. We could dial the - /// multiaddr here, however this could relate to duplicate PeerId's etc. If the lookup - /// proves resource constraining, we should switch to multiaddr dialling here. + /// This function decides whether or not to dial these peers. #[allow(clippy::mutable_key_type)] - pub fn peers_discovered(&mut self, results: HashMap>) -> Vec { - let mut to_dial_peers = Vec::with_capacity(4); - + pub fn peers_discovered(&mut self, results: HashMap>) { + let mut to_dial_peers = 0; let connected_or_dialing = self.network_globals.connected_or_dialing_peers(); - for (peer_id, min_ttl) in results { + for (enr, min_ttl) in results { // There are two conditions in deciding whether to dial this peer. // 1. If we are less than our max connections. Discovery queries are executed to reach // our target peers, so its fine to dial up to our max peers (which will get pruned @@ -330,10 +326,8 @@ impl PeerManager { // considered a priority. We have pre-allocated some extra priority slots for these // peers as specified by PRIORITY_PEER_EXCESS. Therefore we dial these peers, even // if we are already at our max_peer limit. - if (min_ttl.is_some() - && connected_or_dialing + to_dial_peers.len() < self.max_priority_peers() - || connected_or_dialing + to_dial_peers.len() < self.max_peers()) - && self.network_globals.peers.read().should_dial(&peer_id) + if min_ttl.is_some() && connected_or_dialing + to_dial_peers < self.max_priority_peers() + || connected_or_dialing + to_dial_peers < self.max_peers() { // This should be updated with the peer dialing. In fact created once the peer is // dialed @@ -341,16 +335,16 @@ impl PeerManager { self.network_globals .peers .write() - .update_min_ttl(&peer_id, min_ttl); + .update_min_ttl(&enr.peer_id(), min_ttl); } - to_dial_peers.push(peer_id); + debug!(self.log, "Dialing discovered peer"; "peer_id" => %enr.peer_id()); + self.dial_peer(enr); + to_dial_peers += 1; } } // Queue another discovery if we need to - self.maintain_peer_count(to_dial_peers.len()); - - to_dial_peers + self.maintain_peer_count(to_dial_peers); } /// A STATUS message has been received from a peer. This resets the status timer. @@ -406,9 +400,16 @@ impl PeerManager { /* Notifications from the Swarm */ - // A peer is being dialed. - pub fn dial_peer(&mut self, peer_id: &PeerId, enr: Option) { - self.peers_to_dial.insert(*peer_id, enr); + /// A peer is being dialed. + pub fn dial_peer(&mut self, peer: Enr) { + if self + .network_globals + .peers + .read() + .should_dial(&peer.peer_id()) + { + self.peers_to_dial.push(peer); + } } /// Reports if a peer is banned or not. diff --git a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs index 70f421681a3..fedb876bb23 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/network_behaviour.rs @@ -3,7 +3,7 @@ use std::task::{Context, Poll}; use futures::StreamExt; -use libp2p::core::ConnectedPoint; +use libp2p::core::{multiaddr, ConnectedPoint}; use libp2p::identity::PeerId; use libp2p::swarm::behaviour::{ConnectionClosed, ConnectionEstablished, DialFailure, FromSwarm}; use libp2p::swarm::dial_opts::{DialOpts, PeerCondition}; @@ -12,6 +12,7 @@ use libp2p::swarm::{ConnectionId, NetworkBehaviour, PollParameters, ToSwarm}; use slog::{debug, error}; use types::EthSpec; +use crate::discovery::enr_ext::EnrExt; use crate::rpc::GoodbyeReason; use crate::types::SyncState; use crate::{metrics, ClearDialError}; @@ -95,11 +96,23 @@ impl NetworkBehaviour for PeerManager { self.events.shrink_to_fit(); } - if let Some((peer_id, maybe_enr)) = self.peers_to_dial.pop_first() { - self.inject_peer_connection(&peer_id, ConnectingType::Dialing, maybe_enr); + if let Some(enr) = self.peers_to_dial.pop() { + let peer_id = enr.peer_id(); + self.inject_peer_connection(&peer_id, ConnectingType::Dialing, Some(enr.clone())); + let quic_multiaddrs = enr.multiaddr_quic(); + if !quic_multiaddrs.is_empty() { + debug!(self.log, "Dialing QUIC supported peer"; "peer_id"=> %peer_id, "quic_multiaddrs" => ?quic_multiaddrs); + } + + // Prioritize Quic connections over Tcp ones. + let multiaddrs = quic_multiaddrs + .into_iter() + .chain(enr.multiaddr_tcp()) + .collect(); return Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(peer_id) .condition(PeerCondition::Disconnected) + .addresses(multiaddrs) .build(), }); } @@ -124,9 +137,11 @@ impl NetworkBehaviour for PeerManager { } FromSwarm::ConnectionClosed(ConnectionClosed { peer_id, + endpoint, + remaining_established, .. - }) => self.on_connection_closed(peer_id, remaining_established), + }) => self.on_connection_closed(peer_id, endpoint, remaining_established), FromSwarm::DialFailure(DialFailure { peer_id, error, @@ -184,7 +199,11 @@ impl PeerManager { endpoint: &ConnectedPoint, other_established: usize, ) { - debug!(self.log, "Connection established"; "peer_id" => %peer_id, "connection" => ?endpoint.to_endpoint()); + debug!(self.log, "Connection established"; "peer_id" => %peer_id, + "multiaddr" => %endpoint.get_remote_address(), + "connection" => ?endpoint.to_endpoint() + ); + if other_established == 0 { self.events.push(PeerManagerEvent::MetaData(peer_id)); } @@ -194,6 +213,34 @@ impl PeerManager { metrics::check_nat(); } + // increment prometheus metrics + if self.metrics_enabled { + let remote_addr = match endpoint { + ConnectedPoint::Dialer { address, .. } => address, + ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr, + }; + match remote_addr.iter().find(|proto| { + matches!( + proto, + multiaddr::Protocol::QuicV1 | multiaddr::Protocol::Tcp(_) + ) + }) { + Some(multiaddr::Protocol::QuicV1) => { + metrics::inc_gauge(&metrics::QUIC_PEERS_CONNECTED); + } + Some(multiaddr::Protocol::Tcp(_)) => { + metrics::inc_gauge(&metrics::TCP_PEERS_CONNECTED); + } + Some(_) => unreachable!(), + None => { + error!(self.log, "Connection established via unknown transport"; "addr" => %remote_addr) + } + }; + + self.update_connected_peer_metrics(); + metrics::inc_counter(&metrics::PEER_CONNECT_EVENT_COUNT); + } + // Check to make sure the peer is not supposed to be banned match self.ban_status(&peer_id) { // TODO: directly emit the ban event? @@ -245,14 +292,15 @@ impl PeerManager { self.events .push(PeerManagerEvent::PeerConnectedOutgoing(peer_id)); } - } - - // increment prometheus metrics - self.update_connected_peer_metrics(); - metrics::inc_counter(&metrics::PEER_CONNECT_EVENT_COUNT); + }; } - fn on_connection_closed(&mut self, peer_id: PeerId, remaining_established: usize) { + fn on_connection_closed( + &mut self, + peer_id: PeerId, + endpoint: &ConnectedPoint, + remaining_established: usize, + ) { if remaining_established > 0 { return; } @@ -278,9 +326,31 @@ impl PeerManager { // reference so that peer manager can track this peer. self.inject_disconnect(&peer_id); + let remote_addr = match endpoint { + ConnectedPoint::Listener { send_back_addr, .. } => send_back_addr, + ConnectedPoint::Dialer { address, .. } => address, + }; + // Update the prometheus metrics - self.update_connected_peer_metrics(); - metrics::inc_counter(&metrics::PEER_DISCONNECT_EVENT_COUNT); + if self.metrics_enabled { + match remote_addr.iter().find(|proto| { + matches!( + proto, + multiaddr::Protocol::QuicV1 | multiaddr::Protocol::Tcp(_) + ) + }) { + Some(multiaddr::Protocol::QuicV1) => { + metrics::dec_gauge(&metrics::QUIC_PEERS_CONNECTED); + } + Some(multiaddr::Protocol::Tcp(_)) => { + metrics::dec_gauge(&metrics::TCP_PEERS_CONNECTED); + } + // If it's an unknown protocol we already logged when connection was established. + _ => {} + }; + self.update_connected_peer_metrics(); + metrics::inc_counter(&metrics::PEER_DISCONNECT_EVENT_COUNT); + } } /// A dial attempt has failed. diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs index 52f0bbd9dfc..4a1efe8f2e9 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs @@ -1,16 +1,11 @@ -use crate::{ - metrics, - multiaddr::{Multiaddr, Protocol}, - types::Subnet, - Enr, Gossipsub, PeerId, -}; +use crate::{metrics, multiaddr::Multiaddr, types::Subnet, Enr, Gossipsub, PeerId}; use peer_info::{ConnectionDirection, PeerConnectionStatus, PeerInfo}; use rand::seq::SliceRandom; use score::{PeerAction, ReportSource, Score, ScoreState}; use slog::{crit, debug, error, trace, warn}; use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; -use std::net::{IpAddr, SocketAddr}; +use std::net::IpAddr; use std::time::Instant; use sync_status::SyncStatus; use types::EthSpec; @@ -764,28 +759,10 @@ impl PeerDB { | PeerConnectionStatus::Dialing { .. } => {} } - // Add the seen ip address and port to the peer's info - let socket_addr = match seen_address.iter().fold( - (None, None), - |(found_ip, found_port), protocol| match protocol { - Protocol::Ip4(ip) => (Some(ip.into()), found_port), - Protocol::Ip6(ip) => (Some(ip.into()), found_port), - Protocol::Tcp(port) => (found_ip, Some(port)), - _ => (found_ip, found_port), - }, - ) { - (Some(ip), Some(port)) => Some(SocketAddr::new(ip, port)), - (Some(_ip), None) => { - crit!(self.log, "Connected peer has an IP but no TCP port"; "peer_id" => %peer_id); - None - } - _ => None, - }; - // Update the connection state match direction { - ConnectionDirection::Incoming => info.connect_ingoing(socket_addr), - ConnectionDirection::Outgoing => info.connect_outgoing(socket_addr), + ConnectionDirection::Incoming => info.connect_ingoing(Some(seen_address)), + ConnectionDirection::Outgoing => info.connect_outgoing(Some(seen_address)), } } @@ -1274,6 +1251,7 @@ impl BannedPeersCount { #[cfg(test)] mod tests { use super::*; + use libp2p::core::multiaddr::Protocol; use libp2p::core::Multiaddr; use slog::{o, Drain}; use std::net::{Ipv4Addr, Ipv6Addr}; diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs index 555266d0e2e..44c54511ddc 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs @@ -2,15 +2,15 @@ use super::client::Client; use super::score::{PeerAction, Score, ScoreState}; use super::sync_status::SyncStatus; use crate::discovery::Eth2Enr; -use crate::Multiaddr; use crate::{rpc::MetaData, types::Subnet}; use discv5::Enr; +use libp2p::core::multiaddr::{Multiaddr, Protocol}; use serde::{ ser::{SerializeStruct, Serializer}, Serialize, }; use std::collections::HashSet; -use std::net::{IpAddr, SocketAddr}; +use std::net::IpAddr; use std::time::Instant; use strum::AsRefStr; use types::EthSpec; @@ -29,9 +29,9 @@ pub struct PeerInfo { /// The known listening addresses of this peer. This is given by identify and can be arbitrary /// (including local IPs). listening_addresses: Vec, - /// This is addresses we have physically seen and this is what we use for banning/un-banning + /// These are the multiaddrs we have physically seen and is what we use for banning/un-banning /// peers. - seen_addresses: HashSet, + seen_multiaddrs: HashSet, /// The current syncing state of the peer. The state may be determined after it's initial /// connection. sync_status: SyncStatus, @@ -60,7 +60,7 @@ impl Default for PeerInfo { client: Client::default(), connection_status: Default::default(), listening_addresses: Vec::new(), - seen_addresses: HashSet::new(), + seen_multiaddrs: HashSet::new(), subnets: HashSet::new(), sync_status: SyncStatus::Unknown, meta_data: None, @@ -227,15 +227,21 @@ impl PeerInfo { } /// Returns the seen addresses of the peer. - pub fn seen_addresses(&self) -> impl Iterator + '_ { - self.seen_addresses.iter() + pub fn seen_multiaddrs(&self) -> impl Iterator + '_ { + self.seen_multiaddrs.iter() } /// Returns a list of seen IP addresses for the peer. pub fn seen_ip_addresses(&self) -> impl Iterator + '_ { - self.seen_addresses - .iter() - .map(|socket_addr| socket_addr.ip()) + self.seen_multiaddrs.iter().filter_map(|multiaddr| { + multiaddr.iter().find_map(|protocol| { + match protocol { + Protocol::Ip4(ip) => Some(ip.into()), + Protocol::Ip6(ip) => Some(ip.into()), + _ => None, // Only care for IP addresses + } + }) + }) } /// Returns the connection status of the peer. @@ -415,7 +421,7 @@ impl PeerInfo { /// Modifies the status to Connected and increases the number of ingoing /// connections by one - pub(super) fn connect_ingoing(&mut self, seen_address: Option) { + pub(super) fn connect_ingoing(&mut self, seen_multiaddr: Option) { match &mut self.connection_status { Connected { n_in, .. } => *n_in += 1, Disconnected { .. } @@ -428,14 +434,14 @@ impl PeerInfo { } } - if let Some(socket_addr) = seen_address { - self.seen_addresses.insert(socket_addr); + if let Some(multiaddr) = seen_multiaddr { + self.seen_multiaddrs.insert(multiaddr); } } /// Modifies the status to Connected and increases the number of outgoing /// connections by one - pub(super) fn connect_outgoing(&mut self, seen_address: Option) { + pub(super) fn connect_outgoing(&mut self, seen_multiaddr: Option) { match &mut self.connection_status { Connected { n_out, .. } => *n_out += 1, Disconnected { .. } @@ -447,8 +453,8 @@ impl PeerInfo { self.connection_direction = Some(ConnectionDirection::Outgoing); } } - if let Some(ip_addr) = seen_address { - self.seen_addresses.insert(ip_addr); + if let Some(multiaddr) = seen_multiaddr { + self.seen_multiaddrs.insert(multiaddr); } } diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index 63e5bcbff66..e4e11f29c55 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -156,8 +156,6 @@ impl Network { let meta_data = utils::load_or_build_metadata(&config.network_dir, &log); let globals = NetworkGlobals::new( enr, - config.listen_addrs().v4().map(|v4_addr| v4_addr.tcp_port), - config.listen_addrs().v6().map(|v6_addr| v6_addr.tcp_port), meta_data, config .trusted_peers @@ -355,8 +353,9 @@ impl Network { let (swarm, bandwidth) = { // Set up the transport - tcp/ws with noise and mplex - let (transport, bandwidth) = build_transport(local_keypair.clone()) - .map_err(|e| format!("Failed to build transport: {:?}", e))?; + let (transport, bandwidth) = + build_transport(local_keypair.clone(), !config.disable_quic_support) + .map_err(|e| format!("Failed to build transport: {:?}", e))?; // use the executor for libp2p struct Executor(task_executor::TaskExecutor); @@ -411,9 +410,16 @@ impl Network { async fn start(&mut self, config: &crate::NetworkConfig) -> error::Result<()> { let enr = self.network_globals.local_enr(); info!(self.log, "Libp2p Starting"; "peer_id" => %enr.peer_id(), "bandwidth_config" => format!("{}-{}", config.network_load, NetworkLoad::from(config.network_load).name)); - debug!(self.log, "Attempting to open listening ports"; config.listen_addrs(), "discovery_enabled" => !config.disable_discovery); + debug!(self.log, "Attempting to open listening ports"; config.listen_addrs(), "discovery_enabled" => !config.disable_discovery, "quic_enabled" => !config.disable_quic_support); + + for listen_multiaddr in config.listen_addrs().libp2p_addresses() { + // If QUIC is disabled, ignore listening on QUIC ports + if config.disable_quic_support + && listen_multiaddr.iter().any(|v| v == MProtocol::QuicV1) + { + continue; + } - for listen_multiaddr in config.listen_addrs().tcp_addresses() { match self.swarm.listen_on(listen_multiaddr.clone()) { Ok(_) => { let mut log_address = listen_multiaddr; @@ -454,6 +460,20 @@ impl Network { boot_nodes.dedup(); for bootnode_enr in boot_nodes { + // If QUIC is enabled, attempt QUIC connections first + if !config.disable_quic_support { + for quic_multiaddr in &bootnode_enr.multiaddr_quic() { + if !self + .network_globals + .peers + .read() + .is_connected_or_dialing(&bootnode_enr.peer_id()) + { + dial(quic_multiaddr.clone()); + } + } + } + for multiaddr in &bootnode_enr.multiaddr() { // ignore udp multiaddr if it exists let components = multiaddr.iter().collect::>(); @@ -1036,30 +1056,27 @@ impl Network { } } - /// Dial cached enrs in discovery service that are in the given `subnet_id` and aren't + /// Dial cached Enrs in discovery service that are in the given `subnet_id` and aren't /// in Connected, Dialing or Banned state. fn dial_cached_enrs_in_subnet(&mut self, subnet: Subnet) { let predicate = subnet_predicate::(vec![subnet], &self.log); - let peers_to_dial: Vec = self + let peers_to_dial: Vec = self .discovery() .cached_enrs() - .filter_map(|(peer_id, enr)| { - let peers = self.network_globals.peers.read(); - if predicate(enr) && peers.should_dial(peer_id) { - Some(*peer_id) + .filter_map(|(_peer_id, enr)| { + if predicate(enr) { + Some(enr.clone()) } else { None } }) .collect(); - for peer_id in peers_to_dial { - debug!(self.log, "Dialing cached ENR peer"; "peer_id" => %peer_id); - // Remove the ENR from the cache to prevent continual re-dialing on disconnects - - self.discovery_mut().remove_cached_enr(&peer_id); - // For any dial event, inform the peer manager - let enr = self.discovery_mut().enr_of_peer(&peer_id); - self.peer_manager_mut().dial_peer(&peer_id, enr); + + // Remove the ENR from the cache to prevent continual re-dialing on disconnects + for enr in peers_to_dial { + debug!(self.log, "Dialing cached ENR peer"; "peer_id" => %enr.peer_id()); + self.discovery_mut().remove_cached_enr(&enr.peer_id()); + self.peer_manager_mut().dial_peer(enr); } } @@ -1345,22 +1362,6 @@ impl Network { } } - /// Handle a discovery event. - fn inject_discovery_event( - &mut self, - event: DiscoveredPeers, - ) -> Option> { - let DiscoveredPeers { peers } = event; - let to_dial_peers = self.peer_manager_mut().peers_discovered(peers); - for peer_id in to_dial_peers { - debug!(self.log, "Dialing discovered peer"; "peer_id" => %peer_id); - // For any dial event, inform the peer manager - let enr = self.discovery_mut().enr_of_peer(&peer_id); - self.peer_manager_mut().dial_peer(&peer_id, enr); - } - None - } - /// Handle an identify event. fn inject_identify_event( &mut self, @@ -1461,7 +1462,14 @@ impl Network { BehaviourEvent::BannedPeers(void) => void::unreachable(void), BehaviourEvent::Gossipsub(ge) => self.inject_gs_event(ge), BehaviourEvent::Eth2Rpc(re) => self.inject_rpc_event(re), - BehaviourEvent::Discovery(de) => self.inject_discovery_event(de), + // Inform the peer manager about discovered peers. + // + // The peer manager will subsequently decide which peers need to be dialed and then dial + // them. + BehaviourEvent::Discovery(DiscoveredPeers { peers }) => { + self.peer_manager_mut().peers_discovered(peers); + None + } BehaviourEvent::Identify(ie) => self.inject_identify_event(ie), BehaviourEvent::PeerManager(pe) => self.inject_pm_event(pe), BehaviourEvent::ConnectionLimits(le) => void::unreachable(le), @@ -1493,7 +1501,7 @@ impl Network { format!("Dialing local peer id {endpoint:?}") } libp2p::swarm::ListenError::Denied { cause } => { - format!("Connection was denied with cause {cause}") + format!("Connection was denied with cause: {cause:?}") } libp2p::swarm::ListenError::Transport(t) => match t { libp2p::TransportError::MultiaddrNotSupported(m) => { @@ -1543,13 +1551,7 @@ impl Network { None } } - SwarmEvent::Dialing { - peer_id, - connection_id: _, - } => { - debug!(self.log, "Swarm Dialing"; "peer_id" => ?peer_id); - None - } + SwarmEvent::Dialing { .. } => None, }; if let Some(ev) = maybe_event { diff --git a/beacon_node/lighthouse_network/src/service/utils.rs b/beacon_node/lighthouse_network/src/service/utils.rs index b8acc4ed6d5..b02a47fefef 100644 --- a/beacon_node/lighthouse_network/src/service/utils.rs +++ b/beacon_node/lighthouse_network/src/service/utils.rs @@ -4,11 +4,13 @@ use crate::types::{ error, EnrAttestationBitfield, EnrSyncCommitteeBitfield, GossipEncoding, GossipKind, }; use crate::{GossipTopic, NetworkConfig}; +use futures::future::Either; use libp2p::bandwidth::BandwidthSinks; use libp2p::core::{multiaddr::Multiaddr, muxing::StreamMuxerBox, transport::Boxed}; use libp2p::gossipsub; use libp2p::identity::{secp256k1, Keypair}; use libp2p::{core, noise, yamux, PeerId, Transport, TransportExt}; +use libp2p_quic; use prometheus_client::registry::Registry; use slog::{debug, warn}; use ssz::Decode; @@ -37,19 +39,12 @@ pub struct Context<'a> { type BoxedTransport = Boxed<(PeerId, StreamMuxerBox)>; -/// The implementation supports TCP/IP, WebSockets over TCP/IP, noise as the encryption layer, and -/// mplex as the multiplexing layer. +/// The implementation supports TCP/IP, QUIC (experimental) over UDP, noise as the encryption layer, and +/// mplex/yamux as the multiplexing layer (when using TCP). pub fn build_transport( local_private_key: Keypair, + quic_support: bool, ) -> std::io::Result<(BoxedTransport, Arc)> { - let tcp = libp2p::tcp::tokio::Transport::new(libp2p::tcp::Config::default().nodelay(true)); - let transport = libp2p::dns::TokioDnsConfig::system(tcp)?; - #[cfg(feature = "libp2p-websocket")] - let transport = { - let trans_clone = transport.clone(); - transport.or_transport(libp2p::websocket::WsConfig::new(trans_clone)) - }; - // mplex config let mut mplex_config = libp2p_mplex::MplexConfig::new(); mplex_config.set_max_buffer_size(256); @@ -58,18 +53,34 @@ pub fn build_transport( // yamux config let mut yamux_config = yamux::Config::default(); yamux_config.set_window_update_mode(yamux::WindowUpdateMode::on_read()); - let (transport, bandwidth) = transport + + // Creates the TCP transport layer + let tcp = libp2p::tcp::tokio::Transport::new(libp2p::tcp::Config::default().nodelay(true)) .upgrade(core::upgrade::Version::V1) .authenticate(generate_noise_config(&local_private_key)) .multiplex(core::upgrade::SelectUpgrade::new( yamux_config, mplex_config, )) - .timeout(Duration::from_secs(10)) - .boxed() - .with_bandwidth_logging(); + .timeout(Duration::from_secs(10)); + + let (transport, bandwidth) = if quic_support { + // Enables Quic + // The default quic configuration suits us for now. + let quic_config = libp2p_quic::Config::new(&local_private_key); + tcp.or_transport(libp2p_quic::tokio::Transport::new(quic_config)) + .map(|either_output, _| match either_output { + Either::Left((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)), + Either::Right((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)), + }) + .with_bandwidth_logging() + } else { + tcp.with_bandwidth_logging() + }; + + // // Enables DNS over the transport. + let transport = libp2p::dns::TokioDnsConfig::system(transport)?.boxed(); - // Authentication Ok((transport, bandwidth)) } diff --git a/beacon_node/lighthouse_network/src/types/globals.rs b/beacon_node/lighthouse_network/src/types/globals.rs index 97eaaa0051b..b2b605e8aec 100644 --- a/beacon_node/lighthouse_network/src/types/globals.rs +++ b/beacon_node/lighthouse_network/src/types/globals.rs @@ -16,10 +16,6 @@ pub struct NetworkGlobals { pub peer_id: RwLock, /// Listening multiaddrs. pub listen_multiaddrs: RwLock>, - /// The TCP port that the libp2p service is listening on over Ipv4. - listen_port_tcp4: Option, - /// The TCP port that the libp2p service is listening on over Ipv6. - listen_port_tcp6: Option, /// The collection of known peers. pub peers: RwLock>, // The local meta data of our node. @@ -35,8 +31,6 @@ pub struct NetworkGlobals { impl NetworkGlobals { pub fn new( enr: Enr, - listen_port_tcp4: Option, - listen_port_tcp6: Option, local_metadata: MetaData, trusted_peers: Vec, disable_peer_scoring: bool, @@ -46,8 +40,6 @@ impl NetworkGlobals { local_enr: RwLock::new(enr.clone()), peer_id: RwLock::new(enr.peer_id()), listen_multiaddrs: RwLock::new(Vec::new()), - listen_port_tcp4, - listen_port_tcp6, local_metadata: RwLock::new(local_metadata), peers: RwLock::new(PeerDB::new(trusted_peers, disable_peer_scoring, log)), gossipsub_subscriptions: RwLock::new(HashSet::new()), @@ -72,16 +64,6 @@ impl NetworkGlobals { self.listen_multiaddrs.read().clone() } - /// Returns the libp2p TCP port that this node has been configured to listen on. - pub fn listen_port_tcp4(&self) -> Option { - self.listen_port_tcp4 - } - - /// Returns the UDP discovery port that this node has been configured to listen on. - pub fn listen_port_tcp6(&self) -> Option { - self.listen_port_tcp6 - } - /// Returns the number of libp2p connected peers. pub fn connected_peers(&self) -> usize { self.peers.read().connected_peer_ids().count() @@ -139,8 +121,6 @@ impl NetworkGlobals { let enr = discv5::enr::EnrBuilder::new("v4").build(&enr_key).unwrap(); NetworkGlobals::new( enr, - Some(9000), - None, MetaData::V2(MetaDataV2 { seq_number: 0, attnets: Default::default(), diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index ffb4b0078b7..7b437fe7a68 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -67,15 +67,19 @@ pub fn build_log(level: slog::Level, enabled: bool) -> slog::Logger { } } -pub fn build_config(port: u16, mut boot_nodes: Vec) -> NetworkConfig { +pub fn build_config(mut boot_nodes: Vec) -> NetworkConfig { let mut config = NetworkConfig::default(); + + // Find unused ports by using the 0 port. + let port = 0; + + let random_path: u16 = rand::random(); let path = TempBuilder::new() - .prefix(&format!("libp2p_test{}", port)) + .prefix(&format!("libp2p_test_{}", random_path)) .tempdir() .unwrap(); - config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, port, port); - config.enr_udp4_port = if port == 0 { None } else { Some(port) }; + config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, port, port, port); config.enr_address = (Some(std::net::Ipv4Addr::LOCALHOST), None); config.boot_nodes_enr.append(&mut boot_nodes); config.network_dir = path.into_path(); @@ -95,8 +99,7 @@ pub async fn build_libp2p_instance( fork_name: ForkName, spec: &ChainSpec, ) -> Libp2pInstance { - let port = 0; - let config = build_config(port, boot_nodes); + let config = build_config(boot_nodes); // launch libp2p service let (signal, exit) = exit_future::signal(); @@ -123,6 +126,12 @@ pub fn get_enr(node: &LibP2PService) -> Enr { node.local_enr() } +// Protocol for the node pair connection. +pub enum Protocol { + Tcp, + Quic, +} + // Constructs a pair of nodes with separate loggers. The sender dials the receiver. // This returns a (sender, receiver) pair. #[allow(dead_code)] @@ -131,6 +140,7 @@ pub async fn build_node_pair( log: &slog::Logger, fork_name: ForkName, spec: &ChainSpec, + protocol: Protocol, ) -> (Libp2pInstance, Libp2pInstance) { let sender_log = log.new(o!("who" => "sender")); let receiver_log = log.new(o!("who" => "receiver")); @@ -142,14 +152,45 @@ pub async fn build_node_pair( let sender_fut = async { loop { if let NetworkEvent::NewListenAddr(addr) = sender.next_event().await { - return addr; + // Only end once we've listened on the protocol we care about + match protocol { + Protocol::Tcp => { + if addr.iter().any(|multiaddr_proto| { + matches!(multiaddr_proto, libp2p::multiaddr::Protocol::Tcp(_)) + }) { + return addr; + } + } + Protocol::Quic => { + if addr.iter().any(|multiaddr_proto| { + matches!(multiaddr_proto, libp2p::multiaddr::Protocol::QuicV1) + }) { + return addr; + } + } + } } } }; let receiver_fut = async { loop { if let NetworkEvent::NewListenAddr(addr) = receiver.next_event().await { - return addr; + match protocol { + Protocol::Tcp => { + if addr.iter().any(|multiaddr_proto| { + matches!(multiaddr_proto, libp2p::multiaddr::Protocol::Tcp(_)) + }) { + return addr; + } + } + Protocol::Quic => { + if addr.iter().any(|multiaddr_proto| { + matches!(multiaddr_proto, libp2p::multiaddr::Protocol::QuicV1) + }) { + return addr; + } + } + } } } }; diff --git a/beacon_node/lighthouse_network/tests/rpc_tests.rs b/beacon_node/lighthouse_network/tests/rpc_tests.rs index 05fa5ab8542..795afd06b9e 100644 --- a/beacon_node/lighthouse_network/tests/rpc_tests.rs +++ b/beacon_node/lighthouse_network/tests/rpc_tests.rs @@ -1,4 +1,8 @@ #![cfg(test)] + +mod common; + +use common::Protocol; use lighthouse_network::rpc::methods::*; use lighthouse_network::{rpc::max_rpc_size, NetworkEvent, ReportSource, Request, Response}; use slog::{debug, warn, Level}; @@ -14,8 +18,6 @@ use types::{ Slot, }; -mod common; - type E = MinimalEthSpec; /// Merge block with length < max_rpc_size. @@ -49,7 +51,7 @@ fn merge_block_large(fork_context: &ForkContext, spec: &ChainSpec) -> BeaconBloc // Tests the STATUS RPC message #[test] #[allow(clippy::single_match)] -fn test_status_rpc() { +fn test_tcp_status_rpc() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -62,8 +64,14 @@ fn test_status_rpc() { rt.block_on(async { // get sender/receiver - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Base, + &spec, + Protocol::Tcp, + ) + .await; // Dummy STATUS RPC message let rpc_request = Request::Status(StatusMessage { @@ -141,7 +149,7 @@ fn test_status_rpc() { // Tests a streamed BlocksByRange RPC Message #[test] #[allow(clippy::single_match)] -fn test_blocks_by_range_chunked_rpc() { +fn test_tcp_blocks_by_range_chunked_rpc() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -156,8 +164,14 @@ fn test_blocks_by_range_chunked_rpc() { rt.block_on(async { // get sender/receiver - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Merge, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Merge, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRange Request let rpc_request = Request::BlocksByRange(BlocksByRangeRequest::new(0, messages_to_send)); @@ -267,7 +281,7 @@ fn test_blocks_by_range_chunked_rpc() { // Tests rejection of blocks over `MAX_RPC_SIZE`. #[test] #[allow(clippy::single_match)] -fn test_blocks_by_range_over_limit() { +fn test_tcp_blocks_by_range_over_limit() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -282,8 +296,14 @@ fn test_blocks_by_range_over_limit() { rt.block_on(async { // get sender/receiver - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Merge, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Merge, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRange Request let rpc_request = Request::BlocksByRange(BlocksByRangeRequest::new(0, messages_to_send)); @@ -350,7 +370,7 @@ fn test_blocks_by_range_over_limit() { // Tests that a streamed BlocksByRange RPC Message terminates when all expected chunks were received #[test] -fn test_blocks_by_range_chunked_rpc_terminates_correctly() { +fn test_tcp_blocks_by_range_chunked_rpc_terminates_correctly() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -366,8 +386,14 @@ fn test_blocks_by_range_chunked_rpc_terminates_correctly() { rt.block_on(async { // get sender/receiver - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Base, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRange Request let rpc_request = Request::BlocksByRange(BlocksByRangeRequest::new(0, messages_to_send)); @@ -476,7 +502,7 @@ fn test_blocks_by_range_chunked_rpc_terminates_correctly() { // Tests an empty response to a BlocksByRange RPC Message #[test] #[allow(clippy::single_match)] -fn test_blocks_by_range_single_empty_rpc() { +fn test_tcp_blocks_by_range_single_empty_rpc() { // set up the logging. The level and enabled logging or not let log_level = Level::Trace; let enable_logging = false; @@ -488,8 +514,14 @@ fn test_blocks_by_range_single_empty_rpc() { rt.block_on(async { // get sender/receiver - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Base, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRange Request let rpc_request = Request::BlocksByRange(BlocksByRangeRequest::new(0, 10)); @@ -576,7 +608,7 @@ fn test_blocks_by_range_single_empty_rpc() { // serves to test the snappy framing format as well. #[test] #[allow(clippy::single_match)] -fn test_blocks_by_root_chunked_rpc() { +fn test_tcp_blocks_by_root_chunked_rpc() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -589,8 +621,14 @@ fn test_blocks_by_root_chunked_rpc() { let rt = Arc::new(Runtime::new().unwrap()); // get sender/receiver rt.block_on(async { - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Merge, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Merge, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRoot Request let rpc_request = @@ -702,7 +740,7 @@ fn test_blocks_by_root_chunked_rpc() { // Tests a streamed, chunked BlocksByRoot RPC Message terminates when all expected reponses have been received #[test] -fn test_blocks_by_root_chunked_rpc_terminates_correctly() { +fn test_tcp_blocks_by_root_chunked_rpc_terminates_correctly() { // set up the logging. The level and enabled logging or not let log_level = Level::Debug; let enable_logging = false; @@ -716,8 +754,14 @@ fn test_blocks_by_root_chunked_rpc_terminates_correctly() { let rt = Arc::new(Runtime::new().unwrap()); // get sender/receiver rt.block_on(async { - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Base, + &spec, + Protocol::Tcp, + ) + .await; // BlocksByRoot Request let rpc_request = @@ -833,14 +877,9 @@ fn test_blocks_by_root_chunked_rpc_terminates_correctly() { }) } -// Tests a Goodbye RPC message -#[test] -#[allow(clippy::single_match)] -fn test_goodbye_rpc() { - // set up the logging. The level and enabled logging or not - let log_level = Level::Trace; - let enable_logging = false; - +/// Establishes a pair of nodes and disconnects the pair based on the selected protocol via an RPC +/// Goodbye message. +fn goodbye_test(log_level: Level, enable_logging: bool, protocol: Protocol) { let log = common::build_log(log_level, enable_logging); let rt = Arc::new(Runtime::new().unwrap()); @@ -850,7 +889,8 @@ fn test_goodbye_rpc() { // get sender/receiver rt.block_on(async { let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec).await; + common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Base, &spec, protocol) + .await; // build the sender future let sender_future = async { @@ -876,12 +916,9 @@ fn test_goodbye_rpc() { // build the receiver future let receiver_future = async { loop { - match receiver.next_event().await { - NetworkEvent::PeerDisconnected(_) => { - // Should receive sent RPC request - return; - } - _ => {} // Ignore other events + if let NetworkEvent::PeerDisconnected(_) = receiver.next_event().await { + // Should receive sent RPC request + return; } } }; @@ -896,3 +933,23 @@ fn test_goodbye_rpc() { } }) } + +// Tests a Goodbye RPC message +#[test] +#[allow(clippy::single_match)] +fn tcp_test_goodbye_rpc() { + // set up the logging. The level and enabled logging or not + let log_level = Level::Debug; + let enable_logging = true; + goodbye_test(log_level, enable_logging, Protocol::Tcp); +} + +// Tests a Goodbye RPC message +#[test] +#[allow(clippy::single_match)] +fn quic_test_goodbye_rpc() { + // set up the logging. The level and enabled logging or not + let log_level = Level::Debug; + let enable_logging = true; + goodbye_test(log_level, enable_logging, Protocol::Quic); +} diff --git a/beacon_node/network/src/nat.rs b/beacon_node/network/src/nat.rs index 9bf123e8dec..d011ac42e84 100644 --- a/beacon_node/network/src/nat.rs +++ b/beacon_node/network/src/nat.rs @@ -12,20 +12,49 @@ use types::EthSpec; /// Configuration required to construct the UPnP port mappings. pub struct UPnPConfig { - /// The local tcp port. + /// The local TCP port. tcp_port: u16, - /// The local udp port. - udp_port: u16, + /// The local UDP discovery port. + disc_port: u16, + /// The local UDP quic port. + quic_port: u16, /// Whether discovery is enabled or not. disable_discovery: bool, + /// Whether quic is enabled or not. + disable_quic_support: bool, +} + +/// Contains mappings that managed to be established. +#[derive(Default, Debug)] +pub struct EstablishedUPnPMappings { + /// A TCP port mapping for libp2p. + pub tcp_port: Option, + /// A UDP port for the QUIC libp2p transport. + pub udp_quic_port: Option, + /// A UDP port for discv5. + pub udp_disc_port: Option, +} + +impl EstablishedUPnPMappings { + /// Returns true if at least one value is set. + pub fn is_some(&self) -> bool { + self.tcp_port.is_some() || self.udp_quic_port.is_some() || self.udp_disc_port.is_some() + } + + // Iterator over the UDP ports + pub fn udp_ports(&self) -> impl Iterator { + self.udp_quic_port.iter().chain(self.udp_disc_port.iter()) + } } impl UPnPConfig { pub fn from_config(config: &NetworkConfig) -> Option { config.listen_addrs().v4().map(|v4_addr| UPnPConfig { tcp_port: v4_addr.tcp_port, - udp_port: v4_addr.udp_port, + disc_port: v4_addr.disc_port, + quic_port: v4_addr.quic_port, disable_discovery: config.disable_discovery, + disable_quic_support: config.disable_quic_support, }) } } @@ -68,6 +97,8 @@ pub fn construct_upnp_mappings( debug!(log, "UPnP Local IP Discovered"; "ip" => ?local_ip); + let mut mappings = EstablishedUPnPMappings::default(); + match local_ip { IpAddr::V4(address) => { let libp2p_socket = SocketAddrV4::new(address, config.tcp_port); @@ -76,39 +107,46 @@ pub fn construct_upnp_mappings( // one. // I've found this to be more reliable. If multiple users are behind a single // router, they should ideally try to set different port numbers. - let tcp_socket = add_port_mapping( + mappings.tcp_port = add_port_mapping( &gateway, igd::PortMappingProtocol::TCP, libp2p_socket, "tcp", &log, - ).and_then(|_| { + ).map(|_| { let external_socket = external_ip.as_ref().map(|ip| SocketAddr::new((*ip).into(), config.tcp_port)).map_err(|_| ()); info!(log, "UPnP TCP route established"; "external_socket" => format!("{}:{}", external_socket.as_ref().map(|ip| ip.to_string()).unwrap_or_else(|_| "".into()), config.tcp_port)); - external_socket + config.tcp_port }).ok(); - let udp_socket = if !config.disable_discovery { - let discovery_socket = SocketAddrV4::new(address, config.udp_port); + let set_udp_mapping = |udp_port| { + let udp_socket = SocketAddrV4::new(address, udp_port); add_port_mapping( &gateway, igd::PortMappingProtocol::UDP, - discovery_socket, + udp_socket, "udp", &log, - ).and_then(|_| { - let external_socket = external_ip - .map(|ip| SocketAddr::new(ip.into(), config.udp_port)).map_err(|_| ()); - info!(log, "UPnP UDP route established"; "external_socket" => format!("{}:{}", external_socket.as_ref().map(|ip| ip.to_string()).unwrap_or_else(|_| "".into()), config.udp_port)); - external_socket - }).ok() - } else { - None + ).map(|_| { + info!(log, "UPnP UDP route established"; "external_socket" => format!("{}:{}", external_ip.as_ref().map(|ip| ip.to_string()).unwrap_or_else(|_| "".into()), udp_port)); + }) }; + // Set the discovery UDP port mapping + if !config.disable_discovery && set_udp_mapping(config.disc_port).is_ok() { + mappings.udp_disc_port = Some(config.disc_port); + } + + // Set the quic UDP port mapping + if !config.disable_quic_support && set_udp_mapping(config.quic_port).is_ok() { + mappings.udp_quic_port = Some(config.quic_port); + } + // report any updates to the network service. - network_send.send(NetworkMessage::UPnPMappingEstablished{ tcp_socket, udp_socket }) - .unwrap_or_else(|e| debug!(log, "Could not send message to the network service"; "error" => %e)); + if mappings.is_some() { + network_send.send(NetworkMessage::UPnPMappingEstablished{ mappings }) + .unwrap_or_else(|e| debug!(log, "Could not send message to the network service"; "error" => %e)); + } } _ => debug!(log, "UPnP no routes constructed. IPv6 not supported"), } @@ -161,12 +199,12 @@ fn add_port_mapping( } /// Removes the specified TCP and UDP port mappings. -pub fn remove_mappings(tcp_port: Option, udp_port: Option, log: &slog::Logger) { - if tcp_port.is_some() || udp_port.is_some() { +pub fn remove_mappings(mappings: &EstablishedUPnPMappings, log: &slog::Logger) { + if mappings.is_some() { debug!(log, "Removing UPnP port mappings"); match igd::search_gateway(Default::default()) { Ok(gateway) => { - if let Some(tcp_port) = tcp_port { + if let Some(tcp_port) = mappings.tcp_port { match gateway.remove_port(igd::PortMappingProtocol::TCP, tcp_port) { Ok(()) => debug!(log, "UPnP Removed TCP port mapping"; "port" => tcp_port), Err(e) => { @@ -174,8 +212,8 @@ pub fn remove_mappings(tcp_port: Option, udp_port: Option, log: &slog: } } } - if let Some(udp_port) = udp_port { - match gateway.remove_port(igd::PortMappingProtocol::UDP, udp_port) { + for udp_port in mappings.udp_ports() { + match gateway.remove_port(igd::PortMappingProtocol::UDP, *udp_port) { Ok(()) => debug!(log, "UPnP Removed UDP port mapping"; "port" => udp_port), Err(e) => { debug!(log, "UPnP Failed to remove UDP port mapping"; "port" => udp_port, "error" => %e) diff --git a/beacon_node/network/src/network_beacon_processor/tests.rs b/beacon_node/network/src/network_beacon_processor/tests.rs index a678edbf1ff..ac5722a565b 100644 --- a/beacon_node/network/src/network_beacon_processor/tests.rs +++ b/beacon_node/network/src/network_beacon_processor/tests.rs @@ -37,7 +37,6 @@ const VALIDATOR_COUNT: usize = SLOTS_PER_EPOCH as usize; const SMALL_CHAIN: u64 = 2; const LONG_CHAIN: u64 = SLOTS_PER_EPOCH * 2; -const TCP_PORT: u16 = 42; const SEQ_NUMBER: u64 = 0; /// The default time to wait for `BeaconProcessor` events. @@ -195,15 +194,7 @@ impl TestRig { }); let enr_key = CombinedKey::generate_secp256k1(); let enr = EnrBuilder::new("v4").build(&enr_key).unwrap(); - let network_globals = Arc::new(NetworkGlobals::new( - enr, - Some(TCP_PORT), - None, - meta_data, - vec![], - false, - &log, - )); + let network_globals = Arc::new(NetworkGlobals::new(enr, meta_data, vec![], false, &log)); let executor = harness.runtime.task_executor.clone(); diff --git a/beacon_node/network/src/service.rs b/beacon_node/network/src/service.rs index c355c671e80..174a0ec14c6 100644 --- a/beacon_node/network/src/service.rs +++ b/beacon_node/network/src/service.rs @@ -1,4 +1,5 @@ use super::sync::manager::RequestId as SyncId; +use crate::nat::EstablishedUPnPMappings; use crate::network_beacon_processor::InvalidBlockStorage; use crate::persisted_dht::{clear_dht, load_dht, persist_dht}; use crate::router::{Router, RouterMessage}; @@ -26,7 +27,7 @@ use lighthouse_network::{ MessageId, NetworkEvent, NetworkGlobals, PeerId, }; use slog::{crit, debug, error, info, o, trace, warn}; -use std::{collections::HashSet, net::SocketAddr, pin::Pin, sync::Arc, time::Duration}; +use std::{collections::HashSet, pin::Pin, sync::Arc, time::Duration}; use store::HotColdDB; use strum::IntoStaticStr; use task_executor::ShutdownReason; @@ -93,12 +94,10 @@ pub enum NetworkMessage { /// The result of the validation validation_result: MessageAcceptance, }, - /// Called if a known external TCP socket address has been updated. + /// Called if UPnP managed to establish an external port mapping. UPnPMappingEstablished { - /// The external TCP address has been updated. - tcp_socket: Option, - /// The external UDP address has been updated. - udp_socket: Option, + /// The mappings that were established. + mappings: EstablishedUPnPMappings, }, /// Reports a peer to the peer manager for performing an action. ReportPeer { @@ -190,11 +189,8 @@ pub struct NetworkService { /// A collection of global variables, accessible outside of the network service. network_globals: Arc>, /// Stores potentially created UPnP mappings to be removed on shutdown. (TCP port and UDP - /// port). - upnp_mappings: (Option, Option), - /// Keeps track of if discovery is auto-updating or not. This is used to inform us if we should - /// update the UDP socket of discovery if the UPnP mappings get established. - discovery_auto_update: bool, + /// ports). + upnp_mappings: EstablishedUPnPMappings, /// A delay that expires when a new fork takes place. next_fork_update: Pin>>, /// A delay that expires when we need to subscribe to a new fork's topics. @@ -359,8 +355,7 @@ impl NetworkService { router_send, store, network_globals: network_globals.clone(), - upnp_mappings: (None, None), - discovery_auto_update: config.discv5_config.enr_update, + upnp_mappings: EstablishedUPnPMappings::default(), next_fork_update, next_fork_subscriptions, next_unsubscribe, @@ -616,32 +611,18 @@ impl NetworkService { } => { self.libp2p.send_error_reponse(peer_id, id, error, reason); } - NetworkMessage::UPnPMappingEstablished { - tcp_socket, - udp_socket, - } => { - self.upnp_mappings = (tcp_socket.map(|s| s.port()), udp_socket.map(|s| s.port())); + NetworkMessage::UPnPMappingEstablished { mappings } => { + self.upnp_mappings = mappings; // If there is an external TCP port update, modify our local ENR. - if let Some(tcp_socket) = tcp_socket { - if let Err(e) = self - .libp2p - .discovery_mut() - .update_enr_tcp_port(tcp_socket.port()) - { + if let Some(tcp_port) = self.upnp_mappings.tcp_port { + if let Err(e) = self.libp2p.discovery_mut().update_enr_tcp_port(tcp_port) { warn!(self.log, "Failed to update ENR"; "error" => e); } } - // if the discovery service is not auto-updating, update it with the - // UPnP mappings - if !self.discovery_auto_update { - if let Some(udp_socket) = udp_socket { - if let Err(e) = self - .libp2p - .discovery_mut() - .update_enr_udp_socket(udp_socket) - { - warn!(self.log, "Failed to update ENR"; "error" => e); - } + // If there is an external QUIC port update, modify our local ENR. + if let Some(quic_port) = self.upnp_mappings.udp_quic_port { + if let Err(e) = self.libp2p.discovery_mut().update_enr_quic_port(quic_port) { + warn!(self.log, "Failed to update ENR"; "error" => e); } } } @@ -994,7 +975,7 @@ impl Drop for NetworkService { } // attempt to remove port mappings - crate::nat::remove_mappings(self.upnp_mappings.0, self.upnp_mappings.1, &self.log); + crate::nat::remove_mappings(&self.upnp_mappings, &self.log); info!(self.log, "Network service shutdown"); } diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 67f62ff90d6..23bcf456dee 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -60,7 +60,7 @@ mod tests { ); let mut config = NetworkConfig::default(); - config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 21212, 21212); + config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 21212, 21212, 21213); config.discv5_config.table_filter = |_| true; // Do not ignore local IPs config.upnp_enabled = false; config.boot_nodes_enr = enrs.clone(); diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index 837625e12a7..ffc29365cb9 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -75,11 +75,11 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .help("The address lighthouse will listen for UDP and TCP connections. To listen \ over IpV4 and IpV6 set this flag twice with the different values.\n\ Examples:\n\ - - --listen-address '0.0.0.0' will listen over Ipv4.\n\ - - --listen-address '::' will listen over Ipv6.\n\ + - --listen-address '0.0.0.0' will listen over IPv4.\n\ + - --listen-address '::' will listen over IPv6.\n\ - --listen-address '0.0.0.0' --listen-address '::' will listen over both \ - Ipv4 and Ipv6. The order of the given addresses is not relevant. However, \ - multiple Ipv4, or multiple Ipv6 addresses will not be accepted.") + IPv4 and IPv6. The order of the given addresses is not relevant. However, \ + multiple IPv4, or multiple IPv6 addresses will not be accepted.") .multiple(true) .max_values(2) .default_value("0.0.0.0") @@ -89,9 +89,10 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { Arg::with_name("port") .long("port") .value_name("PORT") - .help("The TCP/UDP port to listen on. The UDP port can be modified by the \ - --discovery-port flag. If listening over both Ipv4 and Ipv6 the --port flag \ - will apply to the Ipv4 address and --port6 to the Ipv6 address.") + .help("The TCP/UDP ports to listen on. There are two UDP ports. \ + The discovery UDP port will be set to this value and the Quic UDP port will be set to this value + 1. The discovery port can be modified by the \ + --discovery-port flag and the quic port can be modified by the --quic-port flag. If listening over both IPv4 and IPv6 the --port flag \ + will apply to the IPv4 address and --port6 to the IPv6 address.") .default_value("9000") .takes_value(true), ) @@ -99,8 +100,8 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { Arg::with_name("port6") .long("port6") .value_name("PORT") - .help("The TCP/UDP port to listen on over IpV6 when listening over both Ipv4 and \ - Ipv6. Defaults to 9090 when required.") + .help("The TCP/UDP ports to listen on over IPv6 when listening over both IPv4 and \ + IPv6. Defaults to 9090 when required. The Quic UDP port will be set to this value + 1.") .default_value("9090") .takes_value(true), ) @@ -111,12 +112,27 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .help("The UDP port that discovery will listen on. Defaults to `port`") .takes_value(true), ) + .arg( + Arg::with_name("quic-port") + .long("quic-port") + .value_name("PORT") + .help("The UDP port that quic will listen on. Defaults to `port` + 1") + .takes_value(true), + ) .arg( Arg::with_name("discovery-port6") .long("discovery-port6") .value_name("PORT") - .help("The UDP port that discovery will listen on over IpV6 if listening over \ - both Ipv4 and IpV6. Defaults to `port6`") + .help("The UDP port that discovery will listen on over IPv6 if listening over \ + both IPv4 and IPv6. Defaults to `port6`") + .takes_value(true), + ) + .arg( + Arg::with_name("quic-port6") + .long("quic-port6") + .value_name("PORT") + .help("The UDP port that quic will listen on over IPv6 if listening over \ + both IPv4 and IPv6. Defaults to `port6` + 1") .takes_value(true), ) .arg( @@ -159,7 +175,15 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .long("enr-udp-port") .value_name("PORT") .help("The UDP4 port of the local ENR. Set this only if you are sure other nodes \ - can connect to your local node on this port over IpV4.") + can connect to your local node on this port over IPv4.") + .takes_value(true), + ) + .arg( + Arg::with_name("enr-quic-port") + .long("enr-quic-port") + .value_name("PORT") + .help("The quic UDP4 port that will be set on the local ENR. Set this only if you are sure other nodes \ + can connect to your local node on this port over IPv4.") .takes_value(true), ) .arg( @@ -167,7 +191,15 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .long("enr-udp6-port") .value_name("PORT") .help("The UDP6 port of the local ENR. Set this only if you are sure other nodes \ - can connect to your local node on this port over IpV6.") + can connect to your local node on this port over IPv6.") + .takes_value(true), + ) + .arg( + Arg::with_name("enr-quic6-port") + .long("enr-quic6-port") + .value_name("PORT") + .help("The quic UDP6 port that will be set on the local ENR. Set this only if you are sure other nodes \ + can connect to your local node on this port over IPv6.") .takes_value(true), ) .arg( @@ -175,7 +207,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .long("enr-tcp-port") .value_name("PORT") .help("The TCP4 port of the local ENR. Set this only if you are sure other nodes \ - can connect to your local node on this port over IpV4. The --port flag is \ + can connect to your local node on this port over IPv4. The --port flag is \ used if this is not set.") .takes_value(true), ) @@ -184,7 +216,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .long("enr-tcp6-port") .value_name("PORT") .help("The TCP6 port of the local ENR. Set this only if you are sure other nodes \ - can connect to your local node on this port over IpV6. The --port6 flag is \ + can connect to your local node on this port over IPv6. The --port6 flag is \ used if this is not set.") .takes_value(true), ) @@ -225,11 +257,18 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { without an ENR.") .takes_value(true), ) + // NOTE: This is hidden because it is primarily a developer feature for testnets and + // debugging. We remove it from the list to avoid clutter. .arg( Arg::with_name("disable-discovery") .long("disable-discovery") .help("Disables the discv5 discovery protocol. The node will not search for new peers or participate in the discovery protocol.") - .takes_value(false), + .hidden(true) + ) + .arg( + Arg::with_name("disable-quic") + .long("disable-quic") + .help("Disables the quic transport. The node will rely solely on the TCP transport for libp2p connections.") ) .arg( Arg::with_name("disable-peer-scoring") diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 70495777e28..b6d0b75d9ff 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -914,15 +914,15 @@ pub fn parse_listening_addresses( .map_err(|parse_error| format!("Failed to parse --port6 as an integer: {parse_error}"))? .unwrap_or(9090); - // parse the possible udp ports - let maybe_udp_port = cli_args + // parse the possible discovery ports. + let maybe_disc_port = cli_args .value_of("discovery-port") .map(str::parse::) .transpose() .map_err(|parse_error| { format!("Failed to parse --discovery-port as an integer: {parse_error}") })?; - let maybe_udp6_port = cli_args + let maybe_disc6_port = cli_args .value_of("discovery-port6") .map(str::parse::) .transpose() @@ -930,6 +930,24 @@ pub fn parse_listening_addresses( format!("Failed to parse --discovery-port6 as an integer: {parse_error}") })?; + // parse the possible quic port. + let maybe_quic_port = cli_args + .value_of("quic-port") + .map(str::parse::) + .transpose() + .map_err(|parse_error| { + format!("Failed to parse --quic-port as an integer: {parse_error}") + })?; + + // parse the possible quic port. + let maybe_quic6_port = cli_args + .value_of("quic-port6") + .map(str::parse::) + .transpose() + .map_err(|parse_error| { + format!("Failed to parse --quic6-port as an integer: {parse_error}") + })?; + // Now put everything together let listening_addresses = match (maybe_ipv4, maybe_ipv6) { (None, None) => { @@ -940,7 +958,7 @@ pub fn parse_listening_addresses( // A single ipv6 address was provided. Set the ports if cli_args.is_present("port6") { - warn!(log, "When listening only over IpV6, use the --port flag. The value of --port6 will be ignored.") + warn!(log, "When listening only over IPv6, use the --port flag. The value of --port6 will be ignored.") } // use zero ports if required. If not, use the given port. let tcp_port = use_zero_ports @@ -948,20 +966,32 @@ pub fn parse_listening_addresses( .transpose()? .unwrap_or(port); - if maybe_udp6_port.is_some() { - warn!(log, "When listening only over IpV6, use the --discovery-port flag. The value of --discovery-port6 will be ignored.") + if maybe_disc6_port.is_some() { + warn!(log, "When listening only over IPv6, use the --discovery-port flag. The value of --discovery-port6 will be ignored.") + } + + if maybe_quic6_port.is_some() { + warn!(log, "When listening only over IPv6, use the --quic-port flag. The value of --quic-port6 will be ignored.") } + // use zero ports if required. If not, use the specific udp port. If none given, use // the tcp port. - let udp_port = use_zero_ports + let disc_port = use_zero_ports .then(unused_port::unused_udp6_port) .transpose()? - .or(maybe_udp_port) + .or(maybe_disc_port) .unwrap_or(port); + let quic_port = use_zero_ports + .then(unused_port::unused_udp6_port) + .transpose()? + .or(maybe_quic_port) + .unwrap_or(port + 1); + ListenAddress::V6(lighthouse_network::ListenAddr { addr: ipv6, - udp_port, + quic_port, + disc_port, tcp_port, }) } @@ -973,16 +1003,25 @@ pub fn parse_listening_addresses( .then(unused_port::unused_tcp4_port) .transpose()? .unwrap_or(port); - // use zero ports if required. If not, use the specific udp port. If none given, use + // use zero ports if required. If not, use the specific discovery port. If none given, use // the tcp port. - let udp_port = use_zero_ports + let disc_port = use_zero_ports .then(unused_port::unused_udp4_port) .transpose()? - .or(maybe_udp_port) + .or(maybe_disc_port) .unwrap_or(port); + // use zero ports if required. If not, use the specific quic port. If none given, use + // the tcp port + 1. + let quic_port = use_zero_ports + .then(unused_port::unused_udp4_port) + .transpose()? + .or(maybe_quic_port) + .unwrap_or(port + 1); + ListenAddress::V4(lighthouse_network::ListenAddr { addr: ipv4, - udp_port, + disc_port, + quic_port, tcp_port, }) } @@ -991,31 +1030,44 @@ pub fn parse_listening_addresses( .then(unused_port::unused_tcp4_port) .transpose()? .unwrap_or(port); - let ipv4_udp_port = use_zero_ports + let ipv4_disc_port = use_zero_ports .then(unused_port::unused_udp4_port) .transpose()? - .or(maybe_udp_port) + .or(maybe_disc_port) .unwrap_or(ipv4_tcp_port); + let ipv4_quic_port = use_zero_ports + .then(unused_port::unused_udp4_port) + .transpose()? + .or(maybe_quic_port) + .unwrap_or(port + 1); // Defaults to 9090 when required let ipv6_tcp_port = use_zero_ports .then(unused_port::unused_tcp6_port) .transpose()? .unwrap_or(port6); - let ipv6_udp_port = use_zero_ports + let ipv6_disc_port = use_zero_ports .then(unused_port::unused_udp6_port) .transpose()? - .or(maybe_udp6_port) + .or(maybe_disc6_port) .unwrap_or(ipv6_tcp_port); + let ipv6_quic_port = use_zero_ports + .then(unused_port::unused_udp6_port) + .transpose()? + .or(maybe_quic6_port) + .unwrap_or(ipv6_tcp_port + 1); + ListenAddress::DualStack( lighthouse_network::ListenAddr { addr: ipv4, - udp_port: ipv4_udp_port, + disc_port: ipv4_disc_port, + quic_port: ipv4_quic_port, tcp_port: ipv4_tcp_port, }, lighthouse_network::ListenAddr { addr: ipv6, - udp_port: ipv6_udp_port, + disc_port: ipv6_disc_port, + quic_port: ipv6_quic_port, tcp_port: ipv6_tcp_port, }, ) @@ -1131,6 +1183,14 @@ pub fn set_network_config( ); } + if let Some(enr_quic_port_str) = cli_args.value_of("enr-quic-port") { + config.enr_quic4_port = Some( + enr_quic_port_str + .parse::() + .map_err(|_| format!("Invalid quic port: {}", enr_quic_port_str))?, + ); + } + if let Some(enr_tcp_port_str) = cli_args.value_of("enr-tcp-port") { config.enr_tcp4_port = Some( enr_tcp_port_str @@ -1147,6 +1207,14 @@ pub fn set_network_config( ); } + if let Some(enr_quic_port_str) = cli_args.value_of("enr-quic6-port") { + config.enr_quic6_port = Some( + enr_quic_port_str + .parse::() + .map_err(|_| format!("Invalid quic port: {}", enr_quic_port_str))?, + ); + } + if let Some(enr_tcp_port_str) = cli_args.value_of("enr-tcp6-port") { config.enr_tcp6_port = Some( enr_tcp_port_str @@ -1156,9 +1224,9 @@ pub fn set_network_config( } if cli_args.is_present("enr-match") { - // Match the Ip and UDP port in the enr. + // Match the IP and UDP port in the ENR. - // set the enr address to localhost if the address is unspecified + // Set the ENR address to localhost if the address is unspecified. if let Some(ipv4_addr) = config.listen_addrs().v4().cloned() { let ipv4_enr_addr = if ipv4_addr.addr == Ipv4Addr::UNSPECIFIED { Ipv4Addr::LOCALHOST @@ -1166,7 +1234,7 @@ pub fn set_network_config( ipv4_addr.addr }; config.enr_address.0 = Some(ipv4_enr_addr); - config.enr_udp4_port = Some(ipv4_addr.udp_port); + config.enr_udp4_port = Some(ipv4_addr.disc_port); } if let Some(ipv6_addr) = config.listen_addrs().v6().cloned() { @@ -1176,7 +1244,7 @@ pub fn set_network_config( ipv6_addr.addr }; config.enr_address.1 = Some(ipv6_enr_addr); - config.enr_udp6_port = Some(ipv6_addr.udp_port); + config.enr_udp6_port = Some(ipv6_addr.disc_port); } } @@ -1209,11 +1277,11 @@ pub fn set_network_config( // actually matters. Just use the udp port. let port = match config.listen_addrs() { - ListenAddress::V4(v4_addr) => v4_addr.udp_port, - ListenAddress::V6(v6_addr) => v6_addr.udp_port, + ListenAddress::V4(v4_addr) => v4_addr.disc_port, + ListenAddress::V6(v6_addr) => v6_addr.disc_port, ListenAddress::DualStack(v4_addr, _v6_addr) => { // NOTE: slight preference for ipv4 that I don't think is of importance. - v4_addr.udp_port + v4_addr.disc_port } }; @@ -1272,6 +1340,10 @@ pub fn set_network_config( warn!(log, "Discovery is disabled. New peers will not be found"); } + if cli_args.is_present("disable-quic") { + config.disable_quic_support = true; + } + if cli_args.is_present("disable-upnp") { config.upnp_enabled = false; } diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 507896f4311..3f58d8aa457 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -56,3 +56,4 @@ * [Contributing](./contributing.md) * [Development Environment](./setup.md) * [FAQs](./faq.md) +* [Protocol Developers](./developers.md) \ No newline at end of file diff --git a/book/src/developers.md b/book/src/developers.md new file mode 100644 index 00000000000..2ba09bd3412 --- /dev/null +++ b/book/src/developers.md @@ -0,0 +1,51 @@ +# For Protocol Developers + +_Documentation for protocol developers._ + +This section lists Lighthouse-specific decisions that are not strictly spec'd and may be useful for +other protocol developers wishing to interact with lighthouse. + + +## Custom ENR Fields + +Lighthouse currently uses the following ENR fields: + +### Ethereum Consensus Specified + +| Field | Description | +| ---- | ---- | +| `eth2` | The `ENRForkId` in SSZ bytes specifying which fork the node is on | +| `attnets` | An SSZ bitfield which indicates which of the 64 subnets the node is subscribed to for an extended period of time | +| `syncnets` | An SSZ bitfield which indicates which of the sync committee subnets the node is subscribed to | + + +### Lighthouse Custom Fields + +Lighthouse is currently using the following custom ENR fields. +| Field | Description | +| ---- | ---- | +| `quic` | The UDP port on which the QUIC transport is listening on IPv4 | +| `quic6` | The UDP port on which the QUIC transport is listening on IPv6 | + + +## Custom RPC Messages + +The specification leaves room for implementation-specific errors. Lighthouse uses the following +custom RPC error messages. + +### Goodbye Reason Codes + +| Code | Message | Description | +| ---- | ---- | ---- | +| 128 | Unable to Verify Network | Teku uses this, so we adopted it. It relates to having a fork mismatch | +| 129 | Too Many Peers | Lighthouse can close a connection because it has reached its peer-limit and pruned excess peers | +| 250 | Bad Score | The node has been dropped due to having a bad peer score | +| 251 | Banned | The peer has been banned and disconnected | +| 252 | Banned IP | The IP the node is connected to us with has been banned | + + +### Error Codes + +| Code | Message | Description | +| ---- | ---- | ---- | +| 139 | Rate Limited | The peer has been rate limited so we return this error as a response | \ No newline at end of file diff --git a/boot_node/src/config.rs b/boot_node/src/config.rs index 779269921a5..817bd2ab52f 100644 --- a/boot_node/src/config.rs +++ b/boot_node/src/config.rs @@ -58,12 +58,12 @@ impl BootNodeConfig { set_network_config(&mut network_config, matches, &data_dir, &logger)?; - // Set the Enr UDP ports to the listening ports if not present. + // Set the Enr Discovery ports to the listening ports if not present. if let Some(listening_addr_v4) = network_config.listen_addrs().v4() { network_config.enr_udp4_port = Some( network_config .enr_udp4_port - .unwrap_or(listening_addr_v4.udp_port), + .unwrap_or(listening_addr_v4.disc_port), ) }; @@ -71,7 +71,7 @@ impl BootNodeConfig { network_config.enr_udp6_port = Some( network_config .enr_udp6_port - .unwrap_or(listening_addr_v6.udp_port), + .unwrap_or(listening_addr_v6.disc_port), ) }; diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 05b4358509b..10fcb101a89 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1010,12 +1010,12 @@ fn network_port_flag_over_ipv4() { .run() .with_config(|config| { assert_eq!( - config - .network - .listen_addrs() - .v4() - .map(|listen_addr| (listen_addr.udp_port, listen_addr.tcp_port)), - Some((port, port)) + config.network.listen_addrs().v4().map(|listen_addr| ( + listen_addr.disc_port, + listen_addr.quic_port, + listen_addr.tcp_port + )), + Some((port, port + 1, port)) ); }); } @@ -1028,22 +1028,22 @@ fn network_port_flag_over_ipv6() { .run() .with_config(|config| { assert_eq!( - config - .network - .listen_addrs() - .v6() - .map(|listen_addr| (listen_addr.udp_port, listen_addr.tcp_port)), - Some((port, port)) + config.network.listen_addrs().v6().map(|listen_addr| ( + listen_addr.disc_port, + listen_addr.quic_port, + listen_addr.tcp_port + )), + Some((port, port + 1, port)) ); }); } #[test] fn network_port_and_discovery_port_flags_over_ipv4() { let tcp4_port = unused_tcp4_port().expect("Unable to find unused port."); - let udp4_port = unused_udp4_port().expect("Unable to find unused port."); + let disc4_port = unused_udp4_port().expect("Unable to find unused port."); CommandLineTest::new() .flag("port", Some(tcp4_port.to_string().as_str())) - .flag("discovery-port", Some(udp4_port.to_string().as_str())) + .flag("discovery-port", Some(disc4_port.to_string().as_str())) .run() .with_config(|config| { assert_eq!( @@ -1051,19 +1051,19 @@ fn network_port_and_discovery_port_flags_over_ipv4() { .network .listen_addrs() .v4() - .map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)), - Some((tcp4_port, udp4_port)) + .map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)), + Some((tcp4_port, disc4_port)) ); }); } #[test] fn network_port_and_discovery_port_flags_over_ipv6() { let tcp6_port = unused_tcp6_port().expect("Unable to find unused port."); - let udp6_port = unused_udp6_port().expect("Unable to find unused port."); + let disc6_port = unused_udp6_port().expect("Unable to find unused port."); CommandLineTest::new() .flag("listen-address", Some("::1")) .flag("port", Some(tcp6_port.to_string().as_str())) - .flag("discovery-port", Some(udp6_port.to_string().as_str())) + .flag("discovery-port", Some(disc6_port.to_string().as_str())) .run() .with_config(|config| { assert_eq!( @@ -1071,24 +1071,24 @@ fn network_port_and_discovery_port_flags_over_ipv6() { .network .listen_addrs() .v6() - .map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)), - Some((tcp6_port, udp6_port)) + .map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)), + Some((tcp6_port, disc6_port)) ); }); } #[test] fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() { let tcp4_port = unused_tcp4_port().expect("Unable to find unused port."); - let udp4_port = unused_udp4_port().expect("Unable to find unused port."); + let disc4_port = unused_udp4_port().expect("Unable to find unused port."); let tcp6_port = unused_tcp6_port().expect("Unable to find unused port."); - let udp6_port = unused_udp6_port().expect("Unable to find unused port."); + let disc6_port = unused_udp6_port().expect("Unable to find unused port."); CommandLineTest::new() .flag("listen-address", Some("::1")) .flag("listen-address", Some("127.0.0.1")) .flag("port", Some(tcp4_port.to_string().as_str())) - .flag("discovery-port", Some(udp4_port.to_string().as_str())) + .flag("discovery-port", Some(disc4_port.to_string().as_str())) .flag("port6", Some(tcp6_port.to_string().as_str())) - .flag("discovery-port6", Some(udp6_port.to_string().as_str())) + .flag("discovery-port6", Some(disc6_port.to_string().as_str())) .run() .with_config(|config| { assert_eq!( @@ -1096,8 +1096,8 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() { .network .listen_addrs() .v4() - .map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)), - Some((tcp4_port, udp4_port)) + .map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)), + Some((tcp4_port, disc4_port)) ); assert_eq!( @@ -1105,8 +1105,47 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() { .network .listen_addrs() .v6() - .map(|listen_addr| (listen_addr.tcp_port, listen_addr.udp_port)), - Some((tcp6_port, udp6_port)) + .map(|listen_addr| (listen_addr.tcp_port, listen_addr.disc_port)), + Some((tcp6_port, disc6_port)) + ); + }); +} + +#[test] +fn network_port_discovery_quic_port_flags_over_ipv4_and_ipv6() { + let tcp4_port = unused_tcp4_port().expect("Unable to find unused port."); + let disc4_port = unused_udp4_port().expect("Unable to find unused port."); + let quic4_port = unused_udp4_port().expect("Unable to find unused port."); + let tcp6_port = unused_tcp6_port().expect("Unable to find unused port."); + let disc6_port = unused_udp6_port().expect("Unable to find unused port."); + let quic6_port = unused_udp6_port().expect("Unable to find unused port."); + CommandLineTest::new() + .flag("listen-address", Some("::1")) + .flag("listen-address", Some("127.0.0.1")) + .flag("port", Some(tcp4_port.to_string().as_str())) + .flag("discovery-port", Some(disc4_port.to_string().as_str())) + .flag("quic-port", Some(quic4_port.to_string().as_str())) + .flag("port6", Some(tcp6_port.to_string().as_str())) + .flag("discovery-port6", Some(disc6_port.to_string().as_str())) + .flag("quic-port6", Some(quic6_port.to_string().as_str())) + .run() + .with_config(|config| { + assert_eq!( + config.network.listen_addrs().v4().map(|listen_addr| ( + listen_addr.tcp_port, + listen_addr.disc_port, + listen_addr.quic_port + )), + Some((tcp4_port, disc4_port, quic4_port)) + ); + + assert_eq!( + config.network.listen_addrs().v6().map(|listen_addr| ( + listen_addr.tcp_port, + listen_addr.disc_port, + listen_addr.quic_port + )), + Some((tcp6_port, disc6_port, quic6_port)) ); }); } @@ -1118,6 +1157,14 @@ fn disable_discovery_flag() { .run_with_zero_port() .with_config(|config| assert!(config.network.disable_discovery)); } + +#[test] +fn disable_quic_flag() { + CommandLineTest::new() + .flag("disable-quic", None) + .run_with_zero_port() + .with_config(|config| assert!(config.network.disable_quic_support)); +} #[test] fn disable_peer_scoring_flag() { CommandLineTest::new() @@ -1224,6 +1271,14 @@ fn enr_udp_port_flag() { .with_config(|config| assert_eq!(config.network.enr_udp4_port, Some(port))); } #[test] +fn enr_quic_port_flag() { + let port = unused_udp4_port().expect("Unable to find unused port."); + CommandLineTest::new() + .flag("enr-quic-port", Some(port.to_string().as_str())) + .run_with_zero_port() + .with_config(|config| assert_eq!(config.network.enr_quic4_port, Some(port))); +} +#[test] fn enr_tcp_port_flag() { let port = unused_tcp4_port().expect("Unable to find unused port."); CommandLineTest::new() @@ -1240,6 +1295,14 @@ fn enr_udp6_port_flag() { .with_config(|config| assert_eq!(config.network.enr_udp6_port, Some(port))); } #[test] +fn enr_quic6_port_flag() { + let port = unused_udp6_port().expect("Unable to find unused port."); + CommandLineTest::new() + .flag("enr-quic6-port", Some(port.to_string().as_str())) + .run_with_zero_port() + .with_config(|config| assert_eq!(config.network.enr_quic6_port, Some(port))); +} +#[test] fn enr_tcp6_port_flag() { let port = unused_tcp6_port().expect("Unable to find unused port."); CommandLineTest::new() @@ -1262,7 +1325,7 @@ fn enr_match_flag_over_ipv4() { assert_eq!( config.network.listen_addrs().v4().map(|listen_addr| ( listen_addr.addr, - listen_addr.udp_port, + listen_addr.disc_port, listen_addr.tcp_port )), Some((addr, udp4_port, tcp4_port)) @@ -1287,7 +1350,7 @@ fn enr_match_flag_over_ipv6() { assert_eq!( config.network.listen_addrs().v6().map(|listen_addr| ( listen_addr.addr, - listen_addr.udp_port, + listen_addr.disc_port, listen_addr.tcp_port )), Some((addr, udp6_port, tcp6_port)) @@ -1319,7 +1382,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() { assert_eq!( config.network.listen_addrs().v6().map(|listen_addr| ( listen_addr.addr, - listen_addr.udp_port, + listen_addr.disc_port, listen_addr.tcp_port )), Some((ipv6_addr, udp6_port, tcp6_port)) @@ -1327,7 +1390,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() { assert_eq!( config.network.listen_addrs().v4().map(|listen_addr| ( listen_addr.addr, - listen_addr.udp_port, + listen_addr.disc_port, listen_addr.tcp_port )), Some((ipv4_addr, udp4_port, tcp4_port)) diff --git a/scripts/local_testnet/beacon_node.sh b/scripts/local_testnet/beacon_node.sh index 1a04d12d4a0..70a36614c7a 100755 --- a/scripts/local_testnet/beacon_node.sh +++ b/scripts/local_testnet/beacon_node.sh @@ -39,10 +39,11 @@ done # Get positional arguments data_dir=${@:$OPTIND+0:1} -network_port=${@:$OPTIND+1:1} -http_port=${@:$OPTIND+2:1} -execution_endpoint=${@:$OPTIND+3:1} -execution_jwt=${@:$OPTIND+4:1} +tcp_port=${@:$OPTIND+1:1} +quic_port=${@:$OPTIND+2:1} +http_port=${@:$OPTIND+3:1} +execution_endpoint=${@:$OPTIND+4:1} +execution_jwt=${@:$OPTIND+5:1} lighthouse_binary=lighthouse @@ -56,9 +57,11 @@ exec $lighthouse_binary \ --disable-peer-scoring \ --staking \ --enr-address 127.0.0.1 \ - --enr-udp-port $network_port \ - --enr-tcp-port $network_port \ - --port $network_port \ + --enr-udp-port $tcp_port \ + --enr-tcp-port $tcp_port \ + --enr-quic-port $quic_port \ + --port $tcp_port \ + --quic-port $quic_port \ --http-port $http_port \ --disable-packet-filter \ --target-peers $((BN_COUNT - 1)) \ diff --git a/scripts/local_testnet/start_local_testnet.sh b/scripts/local_testnet/start_local_testnet.sh index 4b8357b993e..c641871ad91 100755 --- a/scripts/local_testnet/start_local_testnet.sh +++ b/scripts/local_testnet/start_local_testnet.sh @@ -139,7 +139,7 @@ sed -i 's/"shanghaiTime".*$/"shanghaiTime": 0,/g' $genesis_file for (( bn=1; bn<=$BN_COUNT; bn++ )); do secret=$DATADIR/geth_datadir$bn/geth/jwtsecret echo $secret - execute_command_add_PID beacon_node_$bn.log ./beacon_node.sh $SAS -d $DEBUG_LEVEL $DATADIR/node_$bn $((BN_udp_tcp_base + $bn)) $((BN_http_port_base + $bn)) http://localhost:$((EL_base_auth_http + $bn)) $secret + execute_command_add_PID beacon_node_$bn.log ./beacon_node.sh $SAS -d $DEBUG_LEVEL $DATADIR/node_$bn $((BN_udp_tcp_base + $bn)) $((BN_udp_tcp_base + $bn + 100)) $((BN_http_port_base + $bn)) http://localhost:$((EL_base_auth_http + $bn)) $secret done # Start requested number of validator clients diff --git a/scripts/tests/doppelganger_protection.sh b/scripts/tests/doppelganger_protection.sh index e9d3e39ce50..1eefa7cf522 100755 --- a/scripts/tests/doppelganger_protection.sh +++ b/scripts/tests/doppelganger_protection.sh @@ -43,23 +43,23 @@ sleep 10 echo "Starting local execution nodes" -exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir1 7000 6000 5000 $genesis_file &> geth.log & -exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir2 7100 6100 5100 $genesis_file &> /dev/null & -exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir3 7200 6200 5200 $genesis_file &> /dev/null & +exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir1 6000 5000 4000 $genesis_file &> geth.log & +exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir2 6100 5100 4100 $genesis_file &> /dev/null & +exit_if_fails ../local_testnet/geth.sh $HOME/.lighthouse/local-testnet/geth_datadir3 6200 5200 4200 $genesis_file &> /dev/null & sleep 20 echo "Starting local beacon nodes" -exit_if_fails ../local_testnet/beacon_node.sh -d debug $HOME/.lighthouse/local-testnet/node_1 9000 8000 http://localhost:5000 $HOME/.lighthouse/local-testnet/geth_datadir1/geth/jwtsecret &> beacon1.log & -exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_2 9100 8100 http://localhost:5100 $HOME/.lighthouse/local-testnet/geth_datadir2/geth/jwtsecret &> /dev/null & -exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_3 9200 8200 http://localhost:5200 $HOME/.lighthouse/local-testnet/geth_datadir3/geth/jwtsecret &> /dev/null & +exit_if_fails ../local_testnet/beacon_node.sh -d debug $HOME/.lighthouse/local-testnet/node_1 8000 7000 9000 http://localhost:4000 $HOME/.lighthouse/local-testnet/geth_datadir1/geth/jwtsecret &> /dev/null & +exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_2 8100 7100 9100 http://localhost:4100 $HOME/.lighthouse/local-testnet/geth_datadir2/geth/jwtsecret &> /dev/null & +exit_if_fails ../local_testnet/beacon_node.sh $HOME/.lighthouse/local-testnet/node_3 8200 7200 9200 http://localhost:4200 $HOME/.lighthouse/local-testnet/geth_datadir3/geth/jwtsecret &> /dev/null & echo "Starting local validator clients" -exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1 http://localhost:8000 &> /dev/null & -exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_2 http://localhost:8100 &> /dev/null & -exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_3 http://localhost:8200 &> /dev/null & +exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1 http://localhost:9000 &> /dev/null & +exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_2 http://localhost:9100 &> /dev/null & +exit_if_fails ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_3 http://localhost:9200 &> /dev/null & echo "Waiting an epoch before starting the next validator client" sleep $(( $SECONDS_PER_SLOT * 32 )) @@ -70,7 +70,7 @@ if [[ "$BEHAVIOR" == "failure" ]]; then # Use same keys as keys from VC1 and connect to BN2 # This process should not last longer than 2 epochs - timeout $(( $SECONDS_PER_SLOT * 32 * 2 )) ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1_doppelganger http://localhost:8100 + timeout $(( $SECONDS_PER_SLOT * 32 * 2 )) ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_1_doppelganger http://localhost:9100 DOPPELGANGER_EXIT=$? echo "Shutting down" @@ -96,7 +96,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then echo "Starting the last validator client" - ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_4 http://localhost:8100 & + ../local_testnet/validator_client.sh $HOME/.lighthouse/local-testnet/node_4 http://localhost:9100 & DOPPELGANGER_FAILURE=0 # Sleep three epochs, then make sure all validators were active in epoch 2. Use @@ -110,7 +110,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then cd $HOME/.lighthouse/local-testnet/node_4/validators for val in 0x*; do [[ -e $val ]] || continue - curl -s localhost:8100/lighthouse/validator_inclusion/3/$val | jq | grep -q '"is_previous_epoch_target_attester": false' + curl -s localhost:9100/lighthouse/validator_inclusion/3/$val | jq | grep -q '"is_previous_epoch_target_attester": false' IS_ATTESTER=$? if [[ $IS_ATTESTER -eq 0 ]]; then echo "$val did not attest in epoch 2." @@ -128,7 +128,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then sleep $(( $SECONDS_PER_SLOT * 32 * 2 )) for val in 0x*; do [[ -e $val ]] || continue - curl -s localhost:8100/lighthouse/validator_inclusion/5/$val | jq | grep -q '"is_previous_epoch_target_attester": true' + curl -s localhost:9100/lighthouse/validator_inclusion/5/$val | jq | grep -q '"is_previous_epoch_target_attester": true' IS_ATTESTER=$? if [[ $IS_ATTESTER -eq 0 ]]; then echo "$val attested in epoch 4." @@ -154,4 +154,4 @@ if [[ "$BEHAVIOR" == "success" ]]; then fi fi -exit 0 \ No newline at end of file +exit 0 diff --git a/testing/node_test_rig/src/lib.rs b/testing/node_test_rig/src/lib.rs index 3cd8205eb65..d842a72747b 100644 --- a/testing/node_test_rig/src/lib.rs +++ b/testing/node_test_rig/src/lib.rs @@ -98,7 +98,7 @@ pub fn testing_client_config() -> ClientConfig { // Setting ports to `0` means that the OS will choose some available port. client_config .network - .set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 0, 0); + .set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 0, 0, 0); client_config.network.upnp_enabled = false; client_config.http_api.enabled = true; client_config.http_api.listen_port = 0; diff --git a/testing/simulator/src/local_network.rs b/testing/simulator/src/local_network.rs index e35870d126c..69fa8ded023 100644 --- a/testing/simulator/src/local_network.rs +++ b/testing/simulator/src/local_network.rs @@ -14,6 +14,7 @@ use std::{sync::Arc, time::Duration}; use types::{Epoch, EthSpec}; const BOOTNODE_PORT: u16 = 42424; +const QUIC_PORT: u16 = 43424; pub const INVALID_ADDRESS: &str = "http://127.0.0.1:42423"; pub const EXECUTION_PORT: u16 = 4000; @@ -63,6 +64,7 @@ impl LocalNetwork { std::net::Ipv4Addr::UNSPECIFIED, BOOTNODE_PORT, BOOTNODE_PORT, + QUIC_PORT, ); beacon_config.network.enr_udp4_port = Some(BOOTNODE_PORT); beacon_config.network.enr_tcp4_port = Some(BOOTNODE_PORT); @@ -154,6 +156,7 @@ impl LocalNetwork { std::net::Ipv4Addr::UNSPECIFIED, BOOTNODE_PORT + count, BOOTNODE_PORT + count, + QUIC_PORT + count, ); beacon_config.network.enr_udp4_port = Some(BOOTNODE_PORT + count); beacon_config.network.enr_tcp4_port = Some(BOOTNODE_PORT + count); From b88e57c989e9fb1cd5ac7a374206e6a6a2fbf558 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 15 Sep 2023 08:49:14 +0000 Subject: [PATCH 07/27] Update Java runtime requirement to 17 for Web3Signer tests (#4681) Web3Signer now requires Java runtime v17, see [v23.8.0 release](https://github.com/Consensys/web3signer/releases/tag/23.8.0). We have some Web3Signer tests that requires a compatible Java runtime to be installed on dev machines. This PR updates `setup` documentation in Lighthouse book, and also fixes a small typo. --- book/src/setup.md | 2 +- testing/web3signer_tests/tls/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/src/setup.md b/book/src/setup.md index 1ae6e635408..d7eafbdf9f3 100644 --- a/book/src/setup.md +++ b/book/src/setup.md @@ -14,7 +14,7 @@ The additional requirements for developers are: don't have `anvil` available on your `PATH`. - [`cmake`](https://cmake.org/cmake/help/latest/command/install.html). Used by some dependencies. See [`Installation Guide`](./installation.md) for more info. -- [`java 11 runtime`](https://openjdk.java.net/projects/jdk/). 11 is the minimum, +- [`java 17 runtime`](https://openjdk.java.net/projects/jdk/). 17 is the minimum, used by web3signer_tests. - [`libpq-dev`](https://www.postgresql.org/docs/devel/libpq.html). Also know as `libpq-devel` on some systems. diff --git a/testing/web3signer_tests/tls/README.md b/testing/web3signer_tests/tls/README.md index 53ff97c2724..199e304375f 100644 --- a/testing/web3signer_tests/tls/README.md +++ b/testing/web3signer_tests/tls/README.md @@ -1,6 +1,6 @@ ## TLS Testing Files The files in this directory are used for testing TLS with web3signer. We store them in this -repository since the are not sensitive and it's simpler than regenerating them for each test. +repository since they are not sensitive and it's simpler than regenerating them for each test. The files were generated using the `./generate.sh` script. From d386a07b0c90727c1ba1df296ca875312b1f6571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 15 Sep 2023 10:08:30 +0000 Subject: [PATCH 08/27] validator client: start http api before genesis (#4714) ## Issue Addressed On a new network a user might require importing validators before waiting until genesis has occurred. ## Proposed Changes Starts the validator client http api before waiting for genesis ## Additional Info cc @antondlr --- lighthouse/src/main.rs | 3 +- testing/node_test_rig/src/lib.rs | 13 +++-- validator_client/src/lib.rs | 85 ++++++++++++++++---------------- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 6384fc53cd6..f98af96176f 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -8,6 +8,7 @@ use env_logger::{Builder, Env}; use environment::{EnvironmentBuilder, LoggerConfig}; use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK, HARDCODED_NET_NAMES}; use ethereum_hashing::have_sha_extensions; +use futures::TryFutureExt; use lighthouse_version::VERSION; use malloc_utils::configure_memory_allocator; use slog::{crit, info, warn}; @@ -659,8 +660,8 @@ fn run( executor.clone().spawn( async move { if let Err(e) = ProductionValidatorClient::new(context, config) + .and_then(|mut vc| async move { vc.start_service().await }) .await - .and_then(|mut vc| vc.start_service()) { crit!(log, "Failed to start validator client"; "reason" => e); // Ignore the error since it always occurs during normal operation when diff --git a/testing/node_test_rig/src/lib.rs b/testing/node_test_rig/src/lib.rs index d842a72747b..0fdc5cd669e 100644 --- a/testing/node_test_rig/src/lib.rs +++ b/testing/node_test_rig/src/lib.rs @@ -220,14 +220,13 @@ impl LocalValidatorClient { config.validator_dir = files.validator_dir.path().into(); config.secrets_dir = files.secrets_dir.path().into(); - ProductionValidatorClient::new(context, config) + let mut client = ProductionValidatorClient::new(context, config).await?; + + client + .start_service() .await - .map(move |mut client| { - client - .start_service() - .expect("should start validator services"); - Self { client, files } - }) + .expect("should start validator services"); + Ok(Self { client, files }) } } diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index 6f071055a4a..473a67945f7 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -98,6 +98,8 @@ pub struct ProductionValidatorClient { slot_clock: SystemTimeSlotClock, http_api_listen_addr: Option, config: Config, + beacon_nodes: Arc>, + genesis_time: u64, } impl ProductionValidatorClient { @@ -501,12 +503,6 @@ impl ProductionValidatorClient { context.service_context("sync_committee".into()), ); - // Wait until genesis has occurred. - // - // It seems most sensible to move this into the `start_service` function, but I'm caution - // of making too many changes this close to genesis (<1 week). - wait_for_genesis(&beacon_nodes, genesis_time, &context).await?; - Ok(Self { context, duties_service, @@ -519,10 +515,12 @@ impl ProductionValidatorClient { config, slot_clock, http_api_listen_addr: None, + genesis_time, + beacon_nodes, }) } - pub fn start_service(&mut self) -> Result<(), String> { + pub async fn start_service(&mut self) -> Result<(), String> { // We use `SLOTS_PER_EPOCH` as the capacity of the block notification channel, because // we don't expect notifications to be delayed by more than a single slot, let alone a // whole epoch! @@ -530,6 +528,44 @@ impl ProductionValidatorClient { let (block_service_tx, block_service_rx) = mpsc::channel(channel_capacity); let log = self.context.log(); + let api_secret = ApiSecret::create_or_open(&self.config.validator_dir)?; + + self.http_api_listen_addr = if self.config.http_api.enabled { + let ctx = Arc::new(http_api::Context { + task_executor: self.context.executor.clone(), + api_secret, + validator_store: Some(self.validator_store.clone()), + validator_dir: Some(self.config.validator_dir.clone()), + secrets_dir: Some(self.config.secrets_dir.clone()), + graffiti_file: self.config.graffiti_file.clone(), + graffiti_flag: self.config.graffiti, + spec: self.context.eth2_config.spec.clone(), + config: self.config.http_api.clone(), + sse_logging_components: self.context.sse_logging_components.clone(), + slot_clock: self.slot_clock.clone(), + log: log.clone(), + _phantom: PhantomData, + }); + + let exit = self.context.executor.exit(); + + let (listen_addr, server) = http_api::serve(ctx, exit) + .map_err(|e| format!("Unable to start HTTP API server: {:?}", e))?; + + self.context + .clone() + .executor + .spawn_without_exit(server, "http-api"); + + Some(listen_addr) + } else { + info!(log, "HTTP API server is disabled"); + None + }; + + // Wait until genesis has occurred. + wait_for_genesis(&self.beacon_nodes, self.genesis_time, &self.context).await?; + duties_service::start_update_service(self.duties_service.clone(), block_service_tx); self.block_service @@ -568,41 +604,6 @@ impl ProductionValidatorClient { spawn_notifier(self).map_err(|e| format!("Failed to start notifier: {}", e))?; - let api_secret = ApiSecret::create_or_open(&self.config.validator_dir)?; - - self.http_api_listen_addr = if self.config.http_api.enabled { - let ctx = Arc::new(http_api::Context { - task_executor: self.context.executor.clone(), - api_secret, - validator_store: Some(self.validator_store.clone()), - validator_dir: Some(self.config.validator_dir.clone()), - secrets_dir: Some(self.config.secrets_dir.clone()), - graffiti_file: self.config.graffiti_file.clone(), - graffiti_flag: self.config.graffiti, - spec: self.context.eth2_config.spec.clone(), - config: self.config.http_api.clone(), - sse_logging_components: self.context.sse_logging_components.clone(), - slot_clock: self.slot_clock.clone(), - log: log.clone(), - _phantom: PhantomData, - }); - - let exit = self.context.executor.exit(); - - let (listen_addr, server) = http_api::serve(ctx, exit) - .map_err(|e| format!("Unable to start HTTP API server: {:?}", e))?; - - self.context - .clone() - .executor - .spawn_without_exit(server, "http-api"); - - Some(listen_addr) - } else { - info!(log, "HTTP API server is disabled"); - None - }; - if self.config.enable_latency_measurement_service { latency::start_latency_service( self.context.clone(), From 4b6cb3db2ceaf60dda8b42c7fb2fa9017a1a055f Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Wed, 20 Sep 2023 01:19:03 +0000 Subject: [PATCH 09/27] Prevent port re-use in HTTP API tests (#4745) ## Issue Addressed CI is plagued by `AddrAlreadyInUse` failures, which are caused by race conditions in allocating free ports. This PR removes all usages of the `unused_port` crate for Lighthouse's HTTP API, in favour of passing `:0` as the listen address. As a result, the listen address isn't known ahead of time and must be read from the listening socket after it binds. This requires tying some self-referential knots, which is a little disruptive, but hopefully doesn't clash too much with Deneb :crossed_fingers: There are still a few usages of `unused_tcp4_port` left in cases where we start external processes, like the `watch` Postgres DB, Anvil, Geth, Nethermind, etc. Removing these usages is non-trivial because it's hard to read the port back from an external process after starting it with `--port 0`. We might be able to do something on Linux where we read from `/proc/`, but I'll leave that for future work. --- Cargo.lock | 5 +- beacon_node/beacon_chain/Cargo.toml | 1 - beacon_node/beacon_chain/src/test_utils.rs | 101 +++++++++--------- beacon_node/execution_layer/Cargo.toml | 3 + beacon_node/execution_layer/src/lib.rs | 59 +++++----- .../src/test_utils/mock_builder.rs | 61 ++++------- .../src/test_utils/mock_execution_layer.rs | 3 - .../execution_layer/src/test_utils/mod.rs | 2 +- beacon_node/http_api/Cargo.toml | 1 - beacon_node/http_api/src/lib.rs | 5 +- beacon_node/http_api/src/test_utils.rs | 12 +-- beacon_node/http_api/tests/tests.rs | 97 ++++++++--------- 12 files changed, 169 insertions(+), 181 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bde2d0ad23..2ed223459e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -601,7 +601,6 @@ dependencies = [ "tree_hash", "tree_hash_derive", "types", - "unused_port", ] [[package]] @@ -2583,7 +2582,9 @@ dependencies = [ name = "execution_layer" version = "0.1.0" dependencies = [ + "arc-swap", "async-trait", + "axum", "builder_client", "bytes", "environment", @@ -2598,6 +2599,7 @@ dependencies = [ "hash-db", "hash256-std-hasher", "hex", + "hyper", "jsonwebtoken", "keccak-hash", "lazy_static", @@ -3381,7 +3383,6 @@ dependencies = [ "tokio-stream", "tree_hash", "types", - "unused_port", "warp", "warp_utils", ] diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index b537327fb31..58cb4dd0ad9 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -65,7 +65,6 @@ sensitive_url = { path = "../../common/sensitive_url" } superstruct = "0.5.0" hex = "0.4.2" exit-future = "0.2.0" -unused_port = {path = "../../common/unused_port"} oneshot_broadcast = { path = "../../common/oneshot_broadcast" } [[test]] diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 5fc05c5551f..5e54b1194d4 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -17,8 +17,8 @@ use bls::get_withdrawal_credentials; use execution_layer::{ auth::JwtKey, test_utils::{ - ExecutionBlockGenerator, MockExecutionLayer, TestingBuilder, DEFAULT_JWT_SECRET, - DEFAULT_TERMINAL_BLOCK, + ExecutionBlockGenerator, MockBuilder, MockBuilderServer, MockExecutionLayer, + DEFAULT_JWT_SECRET, DEFAULT_TERMINAL_BLOCK, }, ExecutionLayer, }; @@ -167,7 +167,6 @@ pub struct Builder { store_mutator: Option>, execution_layer: Option>, mock_execution_layer: Option>, - mock_builder: Option>, testing_slot_clock: Option, runtime: TestRuntime, log: Logger, @@ -301,7 +300,6 @@ where store_mutator: None, execution_layer: None, mock_execution_layer: None, - mock_builder: None, testing_slot_clock: None, runtime, log, @@ -433,7 +431,11 @@ where self } - pub fn mock_execution_layer(mut self) -> Self { + pub fn mock_execution_layer(self) -> Self { + self.mock_execution_layer_with_config(None) + } + + pub fn mock_execution_layer_with_config(mut self, builder_threshold: Option) -> Self { let spec = self.spec.clone().expect("cannot build without spec"); let shanghai_time = spec.capella_fork_epoch.map(|epoch| { HARNESS_GENESIS_TIME + spec.seconds_per_slot * E::slots_per_epoch() * epoch.as_u64() @@ -442,55 +444,15 @@ where self.runtime.task_executor.clone(), DEFAULT_TERMINAL_BLOCK, shanghai_time, - None, + builder_threshold, Some(JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap()), spec, - None, ); self.execution_layer = Some(mock.el.clone()); self.mock_execution_layer = Some(mock); self } - pub fn mock_execution_layer_with_builder( - mut self, - beacon_url: SensitiveUrl, - builder_threshold: Option, - ) -> Self { - // Get a random unused port - let port = unused_port::unused_tcp4_port().unwrap(); - let builder_url = SensitiveUrl::parse(format!("http://127.0.0.1:{port}").as_str()).unwrap(); - - let spec = self.spec.clone().expect("cannot build without spec"); - let shanghai_time = spec.capella_fork_epoch.map(|epoch| { - HARNESS_GENESIS_TIME + spec.seconds_per_slot * E::slots_per_epoch() * epoch.as_u64() - }); - let mock_el = MockExecutionLayer::new( - self.runtime.task_executor.clone(), - DEFAULT_TERMINAL_BLOCK, - shanghai_time, - builder_threshold, - Some(JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap()), - spec.clone(), - Some(builder_url.clone()), - ) - .move_to_terminal_block(); - - let mock_el_url = SensitiveUrl::parse(mock_el.server.url().as_str()).unwrap(); - - self.mock_builder = Some(TestingBuilder::new( - mock_el_url, - builder_url, - beacon_url, - spec, - self.runtime.task_executor.clone(), - )); - self.execution_layer = Some(mock_el.el.clone()); - self.mock_execution_layer = Some(mock_el); - - self - } - /// Instruct the mock execution engine to always return a "valid" response to any payload it is /// asked to execute. pub fn mock_execution_layer_all_payloads_valid(self) -> Self { @@ -572,7 +534,7 @@ where shutdown_receiver: Arc::new(Mutex::new(shutdown_receiver)), runtime: self.runtime, mock_execution_layer: self.mock_execution_layer, - mock_builder: self.mock_builder.map(Arc::new), + mock_builder: None, rng: make_rng(), } } @@ -597,7 +559,7 @@ pub struct BeaconChainHarness { pub runtime: TestRuntime, pub mock_execution_layer: Option>, - pub mock_builder: Option>>, + pub mock_builder: Option>>, pub rng: Mutex, } @@ -633,6 +595,49 @@ where .execution_block_generator() } + pub fn set_mock_builder(&mut self, beacon_url: SensitiveUrl) -> MockBuilderServer { + let mock_el = self + .mock_execution_layer + .as_ref() + .expect("harness was not built with mock execution layer"); + + let mock_el_url = SensitiveUrl::parse(mock_el.server.url().as_str()).unwrap(); + + // Create the builder, listening on a free port. + let (mock_builder, mock_builder_server) = MockBuilder::new_for_testing( + mock_el_url, + beacon_url, + self.spec.clone(), + self.runtime.task_executor.clone(), + ); + + // Set the builder URL in the execution layer now that its port is known. + let builder_listen_addr = mock_builder_server.local_addr(); + let port = builder_listen_addr.port(); + mock_el + .el + .set_builder_url( + SensitiveUrl::parse(format!("http://127.0.0.1:{port}").as_str()).unwrap(), + None, + ) + .unwrap(); + + self.mock_builder = Some(Arc::new(mock_builder)); + + // Sanity check. + let el_builder = self + .chain + .execution_layer + .as_ref() + .unwrap() + .builder() + .unwrap(); + let mock_el_builder = mock_el.el.builder().unwrap(); + assert!(Arc::ptr_eq(&el_builder, &mock_el_builder)); + + mock_builder_server + } + pub fn get_all_validators(&self) -> Vec { (0..self.validator_keypairs.len()).collect() } diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index f2259a4813b..80b4c069286 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -42,6 +42,8 @@ ethers-core = "1.0.2" builder_client = { path = "../builder_client" } fork_choice = { path = "../../consensus/fork_choice" } mev-rs = { git = "https://github.com/ralexstokes/mev-rs", rev = "216657016d5c0889b505857c89ae42c7aa2764af" } +axum = "0.6" +hyper = "0.14" ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e380108" } ssz_rs = "0.9.0" tokio-stream = { version = "0.1.9", features = [ "sync" ] } @@ -51,3 +53,4 @@ hash256-std-hasher = "0.15.2" triehash = "0.8.4" hash-db = "0.15.2" pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" } +arc-swap = "1.6.0" diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index b57bba7518e..e036016de5c 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -5,6 +5,7 @@ //! deposit-contract functionality that the `beacon_node/eth1` crate already provides. use crate::payload_cache::PayloadCache; +use arc_swap::ArcSwapOption; use auth::{strip_prefix, Auth, JwtKey}; use builder_client::BuilderHttpClient; pub use engine_api::EngineCapabilities; @@ -209,7 +210,7 @@ pub enum FailedCondition { struct Inner { engine: Arc, - builder: Option, + builder: ArcSwapOption, execution_engine_forkchoice_lock: Mutex<()>, suggested_fee_recipient: Option
, proposer_preparation_data: Mutex>, @@ -324,25 +325,9 @@ impl ExecutionLayer { Engine::new(api, executor.clone(), &log) }; - let builder = builder_url - .map(|url| { - let builder_client = BuilderHttpClient::new(url.clone(), builder_user_agent) - .map_err(Error::Builder)?; - - info!( - log, - "Using external block builder"; - "builder_url" => ?url, - "builder_profit_threshold" => builder_profit_threshold, - "local_user_agent" => builder_client.get_user_agent(), - ); - Ok::<_, Error>(builder_client) - }) - .transpose()?; - let inner = Inner { engine: Arc::new(engine), - builder, + builder: ArcSwapOption::empty(), execution_engine_forkchoice_lock: <_>::default(), suggested_fee_recipient, proposer_preparation_data: Mutex::new(HashMap::new()), @@ -356,19 +341,45 @@ impl ExecutionLayer { last_new_payload_errored: RwLock::new(false), }; - Ok(Self { + let el = Self { inner: Arc::new(inner), - }) + }; + + if let Some(builder_url) = builder_url { + el.set_builder_url(builder_url, builder_user_agent)?; + } + + Ok(el) } -} -impl ExecutionLayer { fn engine(&self) -> &Arc { &self.inner.engine } - pub fn builder(&self) -> &Option { - &self.inner.builder + pub fn builder(&self) -> Option> { + self.inner.builder.load_full() + } + + /// Set the builder URL after initialization. + /// + /// This is useful for breaking circular dependencies between mock ELs and mock builders in + /// tests. + pub fn set_builder_url( + &self, + builder_url: SensitiveUrl, + builder_user_agent: Option, + ) -> Result<(), Error> { + let builder_client = BuilderHttpClient::new(builder_url.clone(), builder_user_agent) + .map_err(Error::Builder)?; + info!( + self.log(), + "Using external block builder"; + "builder_url" => ?builder_url, + "builder_profit_threshold" => self.inner.builder_profit_threshold.as_u128(), + "local_user_agent" => builder_client.get_user_agent(), + ); + self.inner.builder.swap(Some(Arc::new(builder_client))); + Ok(()) } /// Cache a full payload, keyed on the `tree_hash_root` of the payload diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 9471be636dc..c9dd196fabc 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -40,6 +40,11 @@ use types::{ Uint256, }; +pub type MockBuilderServer = axum::Server< + hyper::server::conn::AddrIncoming, + axum::routing::IntoMakeService, +>; + #[derive(Clone)] pub enum Operation { FeeRecipient(Address), @@ -170,19 +175,25 @@ impl BidStuff for BuilderBid { } } -pub struct TestingBuilder { - server: BlindedBlockProviderServer>, - pub builder: MockBuilder, +#[derive(Clone)] +pub struct MockBuilder { + el: ExecutionLayer, + beacon_client: BeaconNodeHttpClient, + spec: ChainSpec, + context: Arc, + val_registration_cache: Arc>>, + builder_sk: SecretKey, + operations: Arc>>, + invalidate_signatures: Arc>, } -impl TestingBuilder { - pub fn new( +impl MockBuilder { + pub fn new_for_testing( mock_el_url: SensitiveUrl, - builder_url: SensitiveUrl, beacon_url: SensitiveUrl, spec: ChainSpec, executor: TaskExecutor, - ) -> Self { + ) -> (Self, MockBuilderServer) { let file = NamedTempFile::new().unwrap(); let path = file.path().into(); std::fs::write(&path, hex::encode(DEFAULT_JWT_SECRET)).unwrap(); @@ -211,39 +222,13 @@ impl TestingBuilder { spec, context, ); - let port = builder_url.full.port().unwrap(); - let host: Ipv4Addr = builder_url - .full - .host_str() - .unwrap() - .to_string() - .parse() - .unwrap(); - let server = BlindedBlockProviderServer::new(host, port, builder.clone()); - Self { server, builder } + let host: Ipv4Addr = Ipv4Addr::LOCALHOST; + let port = 0; + let provider = BlindedBlockProviderServer::new(host, port, builder.clone()); + let server = provider.serve(); + (builder, server) } - pub async fn run(&self) { - let server = self.server.serve(); - if let Err(err) = server.await { - println!("error while listening for incoming: {err}") - } - } -} - -#[derive(Clone)] -pub struct MockBuilder { - el: ExecutionLayer, - beacon_client: BeaconNodeHttpClient, - spec: ChainSpec, - context: Arc, - val_registration_cache: Arc>>, - builder_sk: SecretKey, - operations: Arc>>, - invalidate_signatures: Arc>, -} - -impl MockBuilder { pub fn new( el: ExecutionLayer, beacon_client: BeaconNodeHttpClient, diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index 2b512d8b1c2..05f6c137e86 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -31,7 +31,6 @@ impl MockExecutionLayer { None, Some(JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap()), spec, - None, ) } @@ -43,7 +42,6 @@ impl MockExecutionLayer { builder_threshold: Option, jwt_key: Option, spec: ChainSpec, - builder_url: Option, ) -> Self { let handle = executor.handle().unwrap(); @@ -65,7 +63,6 @@ impl MockExecutionLayer { let config = Config { execution_endpoints: vec![url], - builder_url, secret_files: vec![path], suggested_fee_recipient: Some(Address::repeat_byte(42)), builder_profit_threshold: builder_threshold.unwrap_or(DEFAULT_BUILDER_THRESHOLD_WEI), diff --git a/beacon_node/execution_layer/src/test_utils/mod.rs b/beacon_node/execution_layer/src/test_utils/mod.rs index 99d264aa7b8..059c0275bba 100644 --- a/beacon_node/execution_layer/src/test_utils/mod.rs +++ b/beacon_node/execution_layer/src/test_utils/mod.rs @@ -25,7 +25,7 @@ use warp::{http::StatusCode, Filter, Rejection}; use crate::EngineCapabilities; pub use execution_block_generator::{generate_pow_block, Block, ExecutionBlockGenerator}; pub use hook::Hook; -pub use mock_builder::{Context as MockBuilderContext, MockBuilder, Operation, TestingBuilder}; +pub use mock_builder::{Context as MockBuilderContext, MockBuilder, MockBuilderServer, Operation}; pub use mock_execution_layer::MockExecutionLayer; pub const DEFAULT_TERMINAL_DIFFICULTY: u64 = 6400; diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index 0fa286f1655..cac2f854954 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -40,7 +40,6 @@ logging = { path = "../../common/logging" } ethereum_serde_utils = "0.5.0" operation_pool = { path = "../operation_pool" } sensitive_url = { path = "../../common/sensitive_url" } -unused_port = { path = "../../common/unused_port" } store = { path = "../store" } bytes = "1.1.0" beacon_processor = { path = "../beacon_processor" } diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 08b18e86d00..801d23dc757 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -3635,12 +3635,13 @@ pub fn serve( // send the response back to our original HTTP request // task via a channel. let builder_future = async move { - let builder = chain + let arc_builder = chain .execution_layer .as_ref() .ok_or(BeaconChainError::ExecutionLayerMissing) .map_err(warp_utils::reject::beacon_chain_error)? - .builder() + .builder(); + let builder = arc_builder .as_ref() .ok_or(BeaconChainError::BuilderMissing) .map_err(warp_utils::reject::beacon_chain_error)?; diff --git a/beacon_node/http_api/src/test_utils.rs b/beacon_node/http_api/src/test_utils.rs index fb3497ff8ba..4ab7f913595 100644 --- a/beacon_node/http_api/src/test_utils.rs +++ b/beacon_node/http_api/src/test_utils.rs @@ -129,17 +129,9 @@ pub async fn create_api_server( test_runtime: &TestRuntime, log: Logger, ) -> ApiServer> { - // Get a random unused port. - let port = unused_port::unused_tcp4_port().unwrap(); - create_api_server_on_port(chain, test_runtime, log, port).await -} + // Use port 0 to allocate a new unused port. + let port = 0; -pub async fn create_api_server_on_port( - chain: Arc>, - test_runtime: &TestRuntime, - log: Logger, - port: u16, -) -> ApiServer> { let (network_senders, network_receivers) = NetworkSenders::new(); // Default metadata diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index adaf1a0f2d4..c4040471a6c 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -10,15 +10,14 @@ use eth2::{ types::{BlockId as CoreBlockId, ForkChoiceNode, StateId as CoreStateId, *}, BeaconNodeHttpClient, Error, StatusCode, Timeouts, }; -use execution_layer::test_utils::TestingBuilder; -use execution_layer::test_utils::DEFAULT_BUILDER_THRESHOLD_WEI; use execution_layer::test_utils::{ - Operation, DEFAULT_BUILDER_PAYLOAD_VALUE_WEI, DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI, + MockBuilder, Operation, DEFAULT_BUILDER_PAYLOAD_VALUE_WEI, DEFAULT_BUILDER_THRESHOLD_WEI, + DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI, }; use futures::stream::{Stream, StreamExt}; use futures::FutureExt; use http_api::{ - test_utils::{create_api_server, create_api_server_on_port, ApiServer}, + test_utils::{create_api_server, ApiServer}, BlockId, StateId, }; use lighthouse_network::{Enr, EnrExt, PeerId}; @@ -73,7 +72,7 @@ struct ApiTester { network_rx: NetworkReceivers, local_enr: Enr, external_peer_id: PeerId, - mock_builder: Option>>, + mock_builder: Option>>, } struct ApiTesterConfig { @@ -120,24 +119,28 @@ impl ApiTester { } pub async fn new_from_config(config: ApiTesterConfig) -> Self { - // Get a random unused port let spec = config.spec; - let port = unused_port::unused_tcp4_port().unwrap(); - let beacon_url = SensitiveUrl::parse(format!("http://127.0.0.1:{port}").as_str()).unwrap(); - let harness = Arc::new( - BeaconChainHarness::builder(MainnetEthSpec) - .spec(spec.clone()) - .chain_config(ChainConfig { - reconstruct_historic_states: config.retain_historic_states, - ..ChainConfig::default() - }) - .logger(logging::test_logger()) - .deterministic_keypairs(VALIDATOR_COUNT) - .fresh_ephemeral_store() - .mock_execution_layer_with_builder(beacon_url.clone(), config.builder_threshold) - .build(), - ); + let mut harness = BeaconChainHarness::builder(MainnetEthSpec) + .spec(spec.clone()) + .chain_config(ChainConfig { + reconstruct_historic_states: config.retain_historic_states, + ..ChainConfig::default() + }) + .logger(logging::test_logger()) + .deterministic_keypairs(VALIDATOR_COUNT) + .fresh_ephemeral_store() + .mock_execution_layer_with_config(config.builder_threshold) + .build(); + + harness + .mock_execution_layer + .as_ref() + .unwrap() + .server + .execution_block_generator() + .move_to_terminal_block() + .unwrap(); harness.advance_slot(); @@ -245,29 +248,40 @@ impl ApiTester { let ApiServer { server, - listening_socket: _, + listening_socket, network_rx, local_enr, external_peer_id, - } = create_api_server_on_port(chain.clone(), &harness.runtime, log, port).await; + } = create_api_server(chain.clone(), &harness.runtime, log).await; harness.runtime.task_executor.spawn(server, "api_server"); - let client = BeaconNodeHttpClient::new( - beacon_url, - Timeouts::set_all(Duration::from_secs(SECONDS_PER_SLOT)), - ); + // Late-initalize the mock builder now that the mock execution node and beacon API ports + // have been allocated. + let beacon_api_port = listening_socket.port(); + let beacon_url = + SensitiveUrl::parse(format!("http://127.0.0.1:{beacon_api_port}").as_str()).unwrap(); + let mock_builder_server = harness.set_mock_builder(beacon_url.clone()); - let builder_ref = harness.mock_builder.as_ref().unwrap().clone(); + // Start the mock builder service prior to building the chain out. harness.runtime.task_executor.spawn( - async move { builder_ref.run().await }, + async move { + if let Err(e) = mock_builder_server.await { + panic!("error in mock builder server: {e:?}"); + } + }, "mock_builder_server", ); let mock_builder = harness.mock_builder.clone(); + let client = BeaconNodeHttpClient::new( + beacon_url, + Timeouts::set_all(Duration::from_secs(SECONDS_PER_SLOT)), + ); + Self { - harness, + harness: Arc::new(harness), chain, client, next_block, @@ -379,7 +393,6 @@ impl ApiTester { .mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_THRESHOLD_WEI, ))); @@ -402,7 +415,6 @@ impl ApiTester { .mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_PAYLOAD_VALUE_WEI, ))); @@ -3275,6 +3287,7 @@ impl ApiTester { .unwrap() .get_payload_by_root(&payload.tree_hash_root()) .is_none()); + self } @@ -3283,7 +3296,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::GasLimit(30_000_000)); let slot = self.chain.slot().unwrap(); @@ -3326,7 +3338,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::FeeRecipient(test_fee_recipient)); let slot = self.chain.slot().unwrap(); @@ -3368,7 +3379,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::ParentHash(invalid_parent_hash)); let slot = self.chain.slot().unwrap(); @@ -3417,7 +3427,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::PrevRandao(invalid_prev_randao)); let slot = self.chain.slot().unwrap(); @@ -3462,7 +3471,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::BlockNumber(invalid_block_number)); let slot = self.chain.slot().unwrap(); @@ -3509,7 +3517,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Timestamp(invalid_timestamp)); let slot = self.chain.slot().unwrap(); @@ -3549,11 +3556,7 @@ impl ApiTester { } pub async fn test_payload_rejects_invalid_signature(self) -> Self { - self.mock_builder - .as_ref() - .unwrap() - .builder - .invalid_signatures(); + self.mock_builder.as_ref().unwrap().invalid_signatures(); let slot = self.chain.slot().unwrap(); let epoch = self.chain.epoch().unwrap(); @@ -3831,7 +3834,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_THRESHOLD_WEI - 1, ))); @@ -3868,7 +3870,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -3905,7 +3906,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI, ))); @@ -3942,7 +3942,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI - 1, ))); @@ -3979,7 +3978,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -3996,7 +3994,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::WithdrawalsRoot(withdrawals_root)); let epoch = self.chain.epoch().unwrap(); @@ -4029,7 +4026,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -4037,7 +4033,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::WithdrawalsRoot(Hash256::repeat_byte(0x42))); let slot = self.chain.slot().unwrap(); From 1e9925435ec236a6dffe5fe3829d1e502de3c127 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 21 Sep 2023 00:26:52 +0000 Subject: [PATCH 10/27] Reuse fork choice read lock instead of re-acquiring it immediately (#4688) ## Issue Addressed I went through the code base and look for places where we acquire fork choice locks (after the deadlock bug was found and fixed in #4687), and discovered an instance where we re-acquire a lock immediately after dropping it. This shouldn't cause deadlock like the other issue, but is slightly less efficient. --- beacon_node/beacon_chain/src/block_verification.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 3654484e1f5..ef7f1b33948 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -754,22 +754,16 @@ impl GossipVerifiedBlock { // reboot if the `observed_block_producers` cache is empty. In that case, without this // check, we will load the parent and state from disk only to find out later that we // already know this block. - if chain - .canonical_head - .fork_choice_read_lock() - .contains_block(&block_root) - { + let fork_choice_read_lock = chain.canonical_head.fork_choice_read_lock(); + if fork_choice_read_lock.contains_block(&block_root) { return Err(BlockError::BlockIsAlreadyKnown); } // Do not process a block that doesn't descend from the finalized root. // // We check this *before* we load the parent so that we can return a more detailed error. - check_block_is_finalized_checkpoint_or_descendant( - chain, - &chain.canonical_head.fork_choice_read_lock(), - &block, - )?; + check_block_is_finalized_checkpoint_or_descendant(chain, &fork_choice_read_lock, &block)?; + drop(fork_choice_read_lock); let block_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch()); let (parent_block, block) = verify_parent_block_is_known(chain, block)?; From 5a35278aea7a8bcbdc9273e0363f3125589b4eef Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 21 Sep 2023 00:26:53 +0000 Subject: [PATCH 11/27] Add more checks and logging before genesis (#4730) ## Proposed Changes This PR adds more logging prior to genesis, particularly on networks that start with execution enabled. There are new checks using `eth_getBlockByHash/Number` to verify that the genesis state's `latest_execution_payload_header` matches the execution node's genesis block. The first commit also runs the merge-readiness/Capella-readiness checks prior to genesis. This has two effects: - Give more information on the execution node's status and its readiness for genesis. - Prevent the `el_offline` status from being set on `/eth/v1/node/syncing`, which previously caused the VC to complain loudly. I would like to include this for the Holesky reboot. It would have caught the misconfig that doomed the first Holesky. ## Additional Info - Geth doesn't serve payload bodies prior to genesis, which is why we use the legacy methods. I haven't checked with other ELs yet. - Currently this is logging errors with _Capella_ genesis states generated by `ethereum-genesis-generator` because the `withdrawals_root` is not set correctly (it is 0x0). This is not a blocker for Holesky, as it starts from Bellatrix (Pari is investigating). --- beacon_node/beacon_chain/src/errors.rs | 2 + .../beacon_chain/src/merge_readiness.rs | 112 +++++++++++++++++- beacon_node/client/src/notifier.rs | 80 ++++++++++++- beacon_node/execution_layer/src/lib.rs | 17 ++- beacon_node/http_api/src/lib.rs | 3 +- .../types/src/execution_payload_header.rs | 5 +- 6 files changed, 209 insertions(+), 10 deletions(-) diff --git a/beacon_node/beacon_chain/src/errors.rs b/beacon_node/beacon_chain/src/errors.rs index 87141311505..073761b0f88 100644 --- a/beacon_node/beacon_chain/src/errors.rs +++ b/beacon_node/beacon_chain/src/errors.rs @@ -146,6 +146,8 @@ pub enum BeaconChainError { BlockVariantLacksExecutionPayload(Hash256), ExecutionLayerErrorPayloadReconstruction(ExecutionBlockHash, Box), EngineGetCapabilititesFailed(Box), + ExecutionLayerGetBlockByNumberFailed(Box), + ExecutionLayerGetBlockByHashFailed(Box), BlockHashMissingFromExecutionLayer(ExecutionBlockHash), InconsistentPayloadReconstructed { slot: Slot, diff --git a/beacon_node/beacon_chain/src/merge_readiness.rs b/beacon_node/beacon_chain/src/merge_readiness.rs index bfc2b36fdb2..52a5ea912e0 100644 --- a/beacon_node/beacon_chain/src/merge_readiness.rs +++ b/beacon_node/beacon_chain/src/merge_readiness.rs @@ -1,8 +1,10 @@ //! Provides tools for checking if a node is ready for the Bellatrix upgrade and following merge //! transition. -use crate::{BeaconChain, BeaconChainTypes}; +use crate::{BeaconChain, BeaconChainError as Error, BeaconChainTypes}; +use execution_layer::BlockByNumberQuery; use serde::{Deserialize, Serialize, Serializer}; +use slog::debug; use std::fmt; use std::fmt::Write; use types::*; @@ -120,6 +122,25 @@ impl fmt::Display for MergeReadiness { } } +pub enum GenesisExecutionPayloadStatus { + Correct(ExecutionBlockHash), + BlockHashMismatch { + got: ExecutionBlockHash, + expected: ExecutionBlockHash, + }, + TransactionsRootMismatch { + got: Hash256, + expected: Hash256, + }, + WithdrawalsRootMismatch { + got: Hash256, + expected: Hash256, + }, + OtherMismatch, + Irrelevant, + AlreadyHappened, +} + impl BeaconChain { /// Returns `true` if user has an EL configured, or if the Bellatrix fork has occurred or will /// occur within `MERGE_READINESS_PREPARATION_SECONDS`. @@ -144,9 +165,9 @@ impl BeaconChain { } /// Attempts to connect to the EL and confirm that it is ready for the merge. - pub async fn check_merge_readiness(&self) -> MergeReadiness { + pub async fn check_merge_readiness(&self, current_slot: Slot) -> MergeReadiness { if let Some(el) = self.execution_layer.as_ref() { - if !el.is_synced_for_notifier().await { + if !el.is_synced_for_notifier(current_slot).await { // The EL is not synced. return MergeReadiness::NotSynced; } @@ -161,6 +182,91 @@ impl BeaconChain { MergeReadiness::NoExecutionEndpoint } } + + /// Check that the execution payload embedded in the genesis state matches the EL's genesis + /// block. + pub async fn check_genesis_execution_payload_is_correct( + &self, + ) -> Result { + let head_snapshot = self.head_snapshot(); + let genesis_state = &head_snapshot.beacon_state; + + if genesis_state.slot() != 0 { + return Ok(GenesisExecutionPayloadStatus::AlreadyHappened); + } + + let Ok(latest_execution_payload_header) = genesis_state.latest_execution_payload_header() + else { + return Ok(GenesisExecutionPayloadStatus::Irrelevant); + }; + let fork = self.spec.fork_name_at_epoch(Epoch::new(0)); + + let execution_layer = self + .execution_layer + .as_ref() + .ok_or(Error::ExecutionLayerMissing)?; + let exec_block_hash = latest_execution_payload_header.block_hash(); + + // Use getBlockByNumber(0) to check that the block hash matches. + // At present, Geth does not respond to engine_getPayloadBodiesByRange before genesis. + let execution_block = execution_layer + .get_block_by_number(BlockByNumberQuery::Tag("0x0")) + .await + .map_err(|e| Error::ExecutionLayerGetBlockByNumberFailed(Box::new(e)))? + .ok_or(Error::BlockHashMissingFromExecutionLayer(exec_block_hash))?; + + if execution_block.block_hash != exec_block_hash { + return Ok(GenesisExecutionPayloadStatus::BlockHashMismatch { + got: execution_block.block_hash, + expected: exec_block_hash, + }); + } + + // Double-check the block by reconstructing it. + let execution_payload = execution_layer + .get_payload_by_hash_legacy(exec_block_hash, fork) + .await + .map_err(|e| Error::ExecutionLayerGetBlockByHashFailed(Box::new(e)))? + .ok_or(Error::BlockHashMissingFromExecutionLayer(exec_block_hash))?; + + // Verify payload integrity. + let header_from_payload = ExecutionPayloadHeader::from(execution_payload.to_ref()); + + let got_transactions_root = header_from_payload.transactions_root(); + let expected_transactions_root = latest_execution_payload_header.transactions_root(); + let got_withdrawals_root = header_from_payload.withdrawals_root().ok(); + let expected_withdrawals_root = latest_execution_payload_header.withdrawals_root().ok(); + + if got_transactions_root != expected_transactions_root { + return Ok(GenesisExecutionPayloadStatus::TransactionsRootMismatch { + got: got_transactions_root, + expected: expected_transactions_root, + }); + } + + if let Some(&expected) = expected_withdrawals_root { + if let Some(&got) = got_withdrawals_root { + if got != expected { + return Ok(GenesisExecutionPayloadStatus::WithdrawalsRootMismatch { + got, + expected, + }); + } + } + } + + if header_from_payload.to_ref() != latest_execution_payload_header { + debug!( + self.log, + "Genesis execution payload reconstruction failure"; + "consensus_node_header" => ?latest_execution_payload_header, + "execution_node_header" => ?header_from_payload + ); + return Ok(GenesisExecutionPayloadStatus::OtherMismatch); + } + + Ok(GenesisExecutionPayloadStatus::Correct(exec_block_hash)) + } } /// Utility function to serialize a Uint256 as a decimal string. diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 7d81594ee62..2c7738e8fab 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -1,7 +1,7 @@ use crate::metrics; use beacon_chain::{ capella_readiness::CapellaReadiness, - merge_readiness::{MergeConfig, MergeReadiness}, + merge_readiness::{GenesisExecutionPayloadStatus, MergeConfig, MergeReadiness}, BeaconChain, BeaconChainTypes, ExecutionStatus, }; use lighthouse_network::{types::SyncState, NetworkGlobals}; @@ -62,6 +62,9 @@ pub fn spawn_notifier( "wait_time" => estimated_time_pretty(Some(next_slot.as_secs() as f64)), ); eth1_logging(&beacon_chain, &log); + merge_readiness_logging(Slot::new(0), &beacon_chain, &log).await; + capella_readiness_logging(Slot::new(0), &beacon_chain, &log).await; + genesis_execution_payload_logging(&beacon_chain, &log).await; sleep(slot_duration).await; } _ => break, @@ -365,7 +368,7 @@ async fn merge_readiness_logging( return; } - match beacon_chain.check_merge_readiness().await { + match beacon_chain.check_merge_readiness(current_slot).await { MergeReadiness::Ready { config, current_difficulty, @@ -476,6 +479,79 @@ async fn capella_readiness_logging( } } +async fn genesis_execution_payload_logging( + beacon_chain: &BeaconChain, + log: &Logger, +) { + match beacon_chain + .check_genesis_execution_payload_is_correct() + .await + { + Ok(GenesisExecutionPayloadStatus::Correct(block_hash)) => { + info!( + log, + "Execution enabled from genesis"; + "genesis_payload_block_hash" => ?block_hash, + ); + } + Ok(GenesisExecutionPayloadStatus::BlockHashMismatch { got, expected }) => { + error!( + log, + "Genesis payload block hash mismatch"; + "info" => "genesis is misconfigured and likely to fail", + "consensus_node_block_hash" => ?expected, + "execution_node_block_hash" => ?got, + ); + } + Ok(GenesisExecutionPayloadStatus::TransactionsRootMismatch { got, expected }) => { + error!( + log, + "Genesis payload transactions root mismatch"; + "info" => "genesis is misconfigured and likely to fail", + "consensus_node_transactions_root" => ?expected, + "execution_node_transactions_root" => ?got, + ); + } + Ok(GenesisExecutionPayloadStatus::WithdrawalsRootMismatch { got, expected }) => { + error!( + log, + "Genesis payload withdrawals root mismatch"; + "info" => "genesis is misconfigured and likely to fail", + "consensus_node_withdrawals_root" => ?expected, + "execution_node_withdrawals_root" => ?got, + ); + } + Ok(GenesisExecutionPayloadStatus::OtherMismatch) => { + error!( + log, + "Genesis payload header mismatch"; + "info" => "genesis is misconfigured and likely to fail", + "detail" => "see debug logs for payload headers" + ); + } + Ok(GenesisExecutionPayloadStatus::Irrelevant) => { + info!( + log, + "Execution is not enabled from genesis"; + ); + } + Ok(GenesisExecutionPayloadStatus::AlreadyHappened) => { + warn!( + log, + "Unable to check genesis which has already occurred"; + "info" => "this is probably a race condition or a bug" + ); + } + Err(e) => { + error!( + log, + "Unable to check genesis execution payload"; + "error" => ?e + ); + } + } +} + fn eth1_logging(beacon_chain: &BeaconChain, log: &Logger) { let current_slot_opt = beacon_chain.slot().ok(); diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index e036016de5c..32e255a166b 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -520,9 +520,9 @@ impl ExecutionLayer { /// /// This function is a wrapper over `Self::is_synced` that makes an additional /// check for the execution layer sync status. Checks if the latest block has - /// a `block_number != 0`. + /// a `block_number != 0` *if* the `current_slot` is also `> 0`. /// Returns the `Self::is_synced` response if unable to get latest block. - pub async fn is_synced_for_notifier(&self) -> bool { + pub async fn is_synced_for_notifier(&self, current_slot: Slot) -> bool { let synced = self.is_synced().await; if synced { if let Ok(Some(block)) = self @@ -531,7 +531,7 @@ impl ExecutionLayer { .get_block_by_number(BlockByNumberQuery::Tag(LATEST_TAG)) .await { - if block.block_number == 0 { + if block.block_number == 0 && current_slot > 0 { return false; } } @@ -1605,6 +1605,17 @@ impl ExecutionLayer { } } + pub async fn get_block_by_number( + &self, + query: BlockByNumberQuery<'_>, + ) -> Result, Error> { + self.engine() + .request(|engine| async move { engine.api.get_block_by_number(query).await }) + .await + .map_err(Box::new) + .map_err(Error::EngineError) + } + pub async fn get_payload_by_hash_legacy( &self, hash: ExecutionBlockHash, diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 801d23dc757..fc1398d2b2d 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -4327,7 +4327,8 @@ pub fn serve( .then( |task_spawner: TaskSpawner, chain: Arc>| { task_spawner.spawn_async_with_rejection(Priority::P1, async move { - let merge_readiness = chain.check_merge_readiness().await; + let current_slot = chain.slot_clock.now_or_genesis().unwrap_or(Slot::new(0)); + let merge_readiness = chain.check_merge_readiness(current_slot).await; Ok::<_, warp::reject::Rejection>( warp::reply::json(&api_types::GenericResponse::from(merge_readiness)) .into_response(), diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index 1fb29db9d3a..77bea03dbff 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -28,7 +28,10 @@ use BeaconStateError; serde(bound = "T: EthSpec", deny_unknown_fields), arbitrary(bound = "T: EthSpec") ), - ref_attributes(derive(PartialEq, TreeHash), tree_hash(enum_behaviour = "transparent")), + ref_attributes( + derive(PartialEq, TreeHash, Debug), + tree_hash(enum_behaviour = "transparent") + ), cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"), partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant") )] From f9a3c00518480f0f341e31a96ee7981c4e476d97 Mon Sep 17 00:00:00 2001 From: chonghe Date: Thu, 21 Sep 2023 00:26:55 +0000 Subject: [PATCH 12/27] Update local testnet script (#4733) There is an issue with the file `scripts/local_testnet/start_local_testnet.sh` - when we use a non-default `$SPEC-PRESET` in `vars.env` it runs into an error: ``` executing: ./setup.sh >> /home/ck/.lighthouse/local-testnet/testnet/setup.log parse error: Invalid numeric literal at line 1, column 7 ``` @jimmygchen found the issue and the updated script includes the flag `--spec $SPEC-PRESET` --- scripts/local_testnet/start_local_testnet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local_testnet/start_local_testnet.sh b/scripts/local_testnet/start_local_testnet.sh index c641871ad91..fdf9ae17243 100755 --- a/scripts/local_testnet/start_local_testnet.sh +++ b/scripts/local_testnet/start_local_testnet.sh @@ -103,7 +103,7 @@ echo "executing: ./setup.sh >> $LOG_DIR/setup.log" ./setup.sh >> $LOG_DIR/setup.log 2>&1 # Update future hardforks time in the EL genesis file based on the CL genesis time -GENESIS_TIME=$(lcli pretty-ssz --testnet-dir $TESTNET_DIR BeaconState $TESTNET_DIR/genesis.ssz | jq | grep -Po 'genesis_time": "\K.*\d') +GENESIS_TIME=$(lcli pretty-ssz --spec $SPEC_PRESET --testnet-dir $TESTNET_DIR BeaconState $TESTNET_DIR/genesis.ssz | jq | grep -Po 'genesis_time": "\K.*\d') echo $GENESIS_TIME CAPELLA_TIME=$((GENESIS_TIME + (CAPELLA_FORK_EPOCH * 32 * SECONDS_PER_SLOT))) echo $CAPELLA_TIME From fe3bd03234de641a8a3504c46312c7eb6245cb6d Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 21 Sep 2023 00:26:56 +0000 Subject: [PATCH 13/27] Fix local testnet to generate keys in the correct folders (#4752) Fix local testnet to generate keys in the correct folders when `BN_COUNT` and `VC_COUNT` don't match. The current script place the generated validator keys in validator folders based on the `BN_COUNT` config, e.g. `node_1/validators`, `node_2/validators`..etc. We should be using `VC_COUNT` here instead, otherwise the number of validator clients may not match the number of directories generated, and would result in either: 1. a VC not having any keys (when `BN_COUNT` < `VC_COUNT`) 2. a validator key directory not being used (when `BN_COUNT` > `VC_COUNT`). --- scripts/local_testnet/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/local_testnet/setup.sh b/scripts/local_testnet/setup.sh index 283aa0c0260..e026ba1c020 100755 --- a/scripts/local_testnet/setup.sh +++ b/scripts/local_testnet/setup.sh @@ -46,6 +46,6 @@ lcli \ insecure-validators \ --count $VALIDATOR_COUNT \ --base-dir $DATADIR \ - --node-count $BN_COUNT + --node-count $VC_COUNT echo Validators generated with keystore passwords at $DATADIR. From 082bb2d63802169344f7b4adf59ac1dcd5ff7308 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Thu, 21 Sep 2023 04:17:24 +0000 Subject: [PATCH 14/27] Self hosted docker builds (#4592) ## Issue Addressed We're OOM'ing on Docker builds on the Deneb branch https://github.com/sigp/lighthouse/issues/3929 Are we ok to self host automated docker builds? Co-authored-by: realbigsean Co-authored-by: realbigsean Co-authored-by: antondlr --- .github/workflows/docker.yml | 61 +++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 21ca4940d9c..007070dbb5b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,6 +17,8 @@ env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} IMAGE_NAME: ${{ github.repository_owner}}/lighthouse LCLI_IMAGE_NAME: ${{ github.repository_owner }}/lcli + # Enable self-hosted runners for the sigp repo only. + SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }} jobs: # Extract the VERSION which is either `latest` or `vX.Y.Z`, and the VERSION_SUFFIX @@ -48,7 +50,8 @@ jobs: VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }} build-docker-single-arch: name: build-docker-${{ matrix.binary }}${{ matrix.features.version_suffix }} - runs-on: ubuntu-22.04 + # Use self-hosted runners only on the sigp repo. + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }} strategy: matrix: binary: [aarch64, @@ -64,14 +67,13 @@ jobs: needs: [extract-version] env: - # We need to enable experimental docker features in order to use `docker buildx` - DOCKER_CLI_EXPERIMENTAL: enabled VERSION: ${{ needs.extract-version.outputs.VERSION }} VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }} FEATURE_SUFFIX: ${{ matrix.features.version_suffix }} steps: - uses: actions/checkout@v3 - name: Update Rust + if: env.SELF_HOSTED_RUNNERS == 'false' run: rustup update stable - name: Dockerhub login run: | @@ -80,16 +82,14 @@ jobs: run: | cargo install cross env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }} + - name: Make bin dir + run: mkdir ./bin - name: Move cross-built binary into Docker scope (if ARM) if: startsWith(matrix.binary, 'aarch64') - run: | - mkdir ./bin; - mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin; + run: mv ./target/aarch64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin - name: Move cross-built binary into Docker scope (if x86_64) if: startsWith(matrix.binary, 'x86_64') - run: | - mkdir ./bin; - mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin; + run: mv ./target/x86_64-unknown-linux-gnu/${{ matrix.profile }}/lighthouse ./bin - name: Map aarch64 to arm64 short arch if: startsWith(matrix.binary, 'aarch64') run: echo "SHORT_ARCH=arm64" >> $GITHUB_ENV @@ -99,17 +99,24 @@ jobs: - name: Set modernity suffix if: endsWith(matrix.binary, '-portable') != true run: echo "MODERNITY_SUFFIX=-modern" >> $GITHUB_ENV; - # Install dependencies for emulation. Have to create a new builder to pick up emulation support. - - name: Build Dockerfile and push - run: | - docker run --privileged --rm tonistiigi/binfmt --install ${SHORT_ARCH} - docker buildx create --use --name cross-builder - docker buildx build \ - --platform=linux/${SHORT_ARCH} \ - --file ./Dockerfile.cross . \ - --tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX}${MODERNITY_SUFFIX}${FEATURE_SUFFIX} \ - --provenance=false \ - --push + + - name: Install QEMU + if: env.SELF_HOSTED_RUNNERS == 'false' + run: sudo apt-get update && sudo apt-get install -y qemu-user-static + + - name: Set up Docker Buildx + if: env.SELF_HOSTED_RUNNERS == 'false' + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + file: ./Dockerfile.cross + context: . + platforms: linux/${{ env.SHORT_ARCH }} + push: true + tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.SHORT_ARCH }}${{ env.VERSION_SUFFIX }}${{ env.MODERNITY_SUFFIX }}${{ env.FEATURE_SUFFIX }} + build-docker-multiarch: name: build-docker-multiarch${{ matrix.modernity }} runs-on: ubuntu-22.04 @@ -118,20 +125,22 @@ jobs: matrix: modernity: ["", "-modern"] env: - # We need to enable experimental docker features in order to use `docker manifest` - DOCKER_CLI_EXPERIMENTAL: enabled VERSION: ${{ needs.extract-version.outputs.VERSION }} VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }} steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Dockerhub login run: | echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin + - name: Create and push multiarch manifest run: | - docker manifest create ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} \ - --amend ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX}${{ matrix.modernity }} \ - --amend ${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX}${{ matrix.modernity }}; - docker manifest push ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} + docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION}${VERSION_SUFFIX}${{ matrix.modernity }} \ + ${IMAGE_NAME}:${VERSION}-arm64${VERSION_SUFFIX}${{ matrix.modernity }} \ + ${IMAGE_NAME}:${VERSION}-amd64${VERSION_SUFFIX}${{ matrix.modernity }}; + build-docker-lcli: runs-on: ubuntu-22.04 needs: [extract-version] From a0478da99087e5f8f727864e055d179b9618c374 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 21 Sep 2023 04:17:25 +0000 Subject: [PATCH 15/27] Fix genesis state download panic when running in debug mode (#4753) ## Issue Addressed #4738 ## Proposed Changes See the above issue for details. Went with option #2 to use the async reqwest client in `Eth2NetworkConfig` and propagate the async-ness. --- Cargo.lock | 3 + Dockerfile | 2 +- account_manager/src/validator/exit.rs | 15 +--- .../src/validator/slashing_protection.rs | 15 +--- beacon_node/client/src/builder.rs | 11 +-- boot_node/src/config.rs | 4 +- boot_node/src/lib.rs | 21 ++---- boot_node/src/server.rs | 31 ++++++-- common/eth2_network_config/Cargo.toml | 3 + common/eth2_network_config/src/lib.rs | 72 ++++++++++--------- lcli/Dockerfile | 2 +- lighthouse/Cargo.toml | 2 +- 12 files changed, 90 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ed223459e7..b3b8fc05410 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2220,9 +2220,11 @@ dependencies = [ name = "eth2_network_config" version = "0.2.0" dependencies = [ + "bytes", "discv5", "eth2_config", "ethereum_ssz", + "futures", "logging", "pretty_reqwest_error", "reqwest", @@ -2231,6 +2233,7 @@ dependencies = [ "sha2 0.10.7", "slog", "tempfile", + "tokio", "types", "url", "zip", diff --git a/Dockerfile b/Dockerfile index f07c42dd85e..bcddef8a6f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.68.2-bullseye AS builder +FROM rust:1.69.0-bullseye AS builder RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev COPY . lighthouse ARG FEATURES diff --git a/account_manager/src/validator/exit.rs b/account_manager/src/validator/exit.rs index 1ff61a7c01d..602390556c5 100644 --- a/account_manager/src/validator/exit.rs +++ b/account_manager/src/validator/exit.rs @@ -10,7 +10,6 @@ use eth2_keystore::Keystore; use eth2_network_config::Eth2NetworkConfig; use safe_arith::SafeArith; use sensitive_url::SensitiveUrl; -use slog::Logger; use slot_clock::{SlotClock, SystemTimeSlotClock}; use std::path::{Path, PathBuf}; use std::time::Duration; @@ -79,12 +78,6 @@ pub fn cli_run(matches: &ArgMatches, env: Environment) -> Result< let password_file_path: Option = clap_utils::parse_optional(matches, PASSWORD_FILE_FLAG)?; - let genesis_state_url: Option = - clap_utils::parse_optional(matches, "genesis-state-url")?; - let genesis_state_url_timeout = - clap_utils::parse_required(matches, "genesis-state-url-timeout") - .map(Duration::from_secs)?; - let stdin_inputs = cfg!(windows) || matches.is_present(STDIN_INPUTS_FLAG); let no_wait = matches.is_present(NO_WAIT); let no_confirmation = matches.is_present(NO_CONFIRMATION); @@ -111,9 +104,6 @@ pub fn cli_run(matches: &ArgMatches, env: Environment) -> Result< ð2_network_config, no_wait, no_confirmation, - genesis_state_url, - genesis_state_url_timeout, - env.core_context().log(), ))?; Ok(()) @@ -130,13 +120,10 @@ async fn publish_voluntary_exit( eth2_network_config: &Eth2NetworkConfig, no_wait: bool, no_confirmation: bool, - genesis_state_url: Option, - genesis_state_url_timeout: Duration, - log: &Logger, ) -> Result<(), String> { let genesis_data = get_geneisis_data(client).await?; let testnet_genesis_root = eth2_network_config - .genesis_validators_root::(genesis_state_url.as_deref(), genesis_state_url_timeout, log)? + .genesis_validators_root::()? .ok_or("Genesis state is unknown")?; // Verify that the beacon node and validator being exited are on the same network. diff --git a/account_manager/src/validator/slashing_protection.rs b/account_manager/src/validator/slashing_protection.rs index 570f29b4ad6..c6d81275a5e 100644 --- a/account_manager/src/validator/slashing_protection.rs +++ b/account_manager/src/validator/slashing_protection.rs @@ -7,7 +7,6 @@ use slashing_protection::{ use std::fs::File; use std::path::PathBuf; use std::str::FromStr; -use std::time::Duration; use types::{Epoch, EthSpec, PublicKeyBytes, Slot}; pub const CMD: &str = "slashing-protection"; @@ -82,24 +81,12 @@ pub fn cli_run( validator_base_dir: PathBuf, ) -> Result<(), String> { let slashing_protection_db_path = validator_base_dir.join(SLASHING_PROTECTION_FILENAME); - - let genesis_state_url: Option = - clap_utils::parse_optional(matches, "genesis-state-url")?; - let genesis_state_url_timeout = - clap_utils::parse_required(matches, "genesis-state-url-timeout") - .map(Duration::from_secs)?; - - let context = env.core_context(); let eth2_network_config = env .eth2_network_config .ok_or("Unable to get testnet configuration from the environment")?; let genesis_validators_root = eth2_network_config - .genesis_validators_root::( - genesis_state_url.as_deref(), - genesis_state_url_timeout, - context.log(), - )? + .genesis_validators_root::()? .ok_or_else(|| "Unable to get genesis state, has genesis occurred?".to_string())?; match matches.subcommand() { diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 07990e3c1fb..50e78aa458a 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -256,7 +256,7 @@ where "Starting from known genesis state"; ); - let genesis_state = genesis_state(&runtime_context, &config, log)?; + let genesis_state = genesis_state(&runtime_context, &config, log).await?; builder.genesis_state(genesis_state).map(|v| (v, None))? } @@ -276,7 +276,7 @@ where .map_err(|e| format!("Unable to parse weak subj state SSZ: {:?}", e))?; let anchor_block = SignedBeaconBlock::from_ssz_bytes(&anchor_block_bytes, &spec) .map_err(|e| format!("Unable to parse weak subj block SSZ: {:?}", e))?; - let genesis_state = genesis_state(&runtime_context, &config, log)?; + let genesis_state = genesis_state(&runtime_context, &config, log).await?; builder .weak_subjectivity_state(anchor_state, anchor_block, genesis_state) @@ -377,7 +377,7 @@ where debug!(context.log(), "Downloaded finalized block"); - let genesis_state = genesis_state(&runtime_context, &config, log)?; + let genesis_state = genesis_state(&runtime_context, &config, log).await?; info!( context.log(), @@ -1083,7 +1083,7 @@ where } /// Obtain the genesis state from the `eth2_network_config` in `context`. -fn genesis_state( +async fn genesis_state( context: &RuntimeContext, config: &ClientConfig, log: &Logger, @@ -1097,6 +1097,7 @@ fn genesis_state( config.genesis_state_url.as_deref(), config.genesis_state_url_timeout, log, - )? + ) + .await? .ok_or_else(|| "Genesis state is unknown".to_string()) } diff --git a/boot_node/src/config.rs b/boot_node/src/config.rs index 817bd2ab52f..5d7853bd247 100644 --- a/boot_node/src/config.rs +++ b/boot_node/src/config.rs @@ -25,7 +25,7 @@ pub struct BootNodeConfig { } impl BootNodeConfig { - pub fn new( + pub async fn new( matches: &ArgMatches<'_>, eth2_network_config: &Eth2NetworkConfig, ) -> Result { @@ -99,7 +99,7 @@ impl BootNodeConfig { if eth2_network_config.genesis_state_is_known() { let genesis_state = eth2_network_config - .genesis_state::(genesis_state_url.as_deref(), genesis_state_url_timeout, &logger)? + .genesis_state::(genesis_state_url.as_deref(), genesis_state_url_timeout, &logger).await? .ok_or_else(|| { "The genesis state for this network is not known, this is an unsupported mode" .to_string() diff --git a/boot_node/src/lib.rs b/boot_node/src/lib.rs index 3d9dada0fdb..d76e7906b20 100644 --- a/boot_node/src/lib.rs +++ b/boot_node/src/lib.rs @@ -7,7 +7,7 @@ mod cli; pub mod config; mod server; pub use cli::cli_app; -use config::{BootNodeConfig, BootNodeConfigSerialization}; +use config::BootNodeConfig; use types::{EthSpec, EthSpecId}; const LOG_CHANNEL_SIZE: usize = 2048; @@ -81,20 +81,13 @@ fn main( .build() .map_err(|e| format!("Failed to build runtime: {}", e))?; - // parse the CLI args into a useable config - let config: BootNodeConfig = BootNodeConfig::new(bn_matches, eth2_network_config)?; - - // Dump configs if `dump-config` or `dump-chain-config` flags are set - let config_sz = BootNodeConfigSerialization::from_config_ref(&config); - clap_utils::check_dump_configs::<_, T>( + // Run the boot node + runtime.block_on(server::run::( lh_matches, - &config_sz, - ð2_network_config.chain_spec::()?, - )?; + bn_matches, + eth2_network_config, + log, + ))?; - // Run the boot node - if !lh_matches.is_present("immediate-shutdown") { - runtime.block_on(server::run(config, log)); - } Ok(()) } diff --git a/boot_node/src/server.rs b/boot_node/src/server.rs index 3823b287266..5a5729dc04e 100644 --- a/boot_node/src/server.rs +++ b/boot_node/src/server.rs @@ -1,6 +1,9 @@ //! The main bootnode server execution. use super::BootNodeConfig; +use crate::config::BootNodeConfigSerialization; +use clap::ArgMatches; +use eth2_network_config::Eth2NetworkConfig; use lighthouse_network::{ discv5::{enr::NodeId, Discv5, Discv5Event}, EnrExt, Eth2Enr, @@ -8,7 +11,27 @@ use lighthouse_network::{ use slog::info; use types::EthSpec; -pub async fn run(config: BootNodeConfig, log: slog::Logger) { +pub async fn run( + lh_matches: &ArgMatches<'_>, + bn_matches: &ArgMatches<'_>, + eth2_network_config: &Eth2NetworkConfig, + log: slog::Logger, +) -> Result<(), String> { + // parse the CLI args into a useable config + let config: BootNodeConfig = BootNodeConfig::new(bn_matches, eth2_network_config).await?; + + // Dump configs if `dump-config` or `dump-chain-config` flags are set + let config_sz = BootNodeConfigSerialization::from_config_ref(&config); + clap_utils::check_dump_configs::<_, T>( + lh_matches, + &config_sz, + ð2_network_config.chain_spec::()?, + )?; + + if lh_matches.is_present("immediate-shutdown") { + return Ok(()); + } + let BootNodeConfig { boot_nodes, local_enr, @@ -65,8 +88,7 @@ pub async fn run(config: BootNodeConfig, log: slog::Logger) { // start the server if let Err(e) = discv5.start().await { - slog::crit!(log, "Could not start discv5 server"; "error" => %e); - return; + return Err(format!("Could not start discv5 server: {e:?}")); } // if there are peers in the local routing table, establish a session by running a query @@ -82,8 +104,7 @@ pub async fn run(config: BootNodeConfig, log: slog::Logger) { let mut event_stream = match discv5.event_stream().await { Ok(stream) => stream, Err(e) => { - slog::crit!(log, "Failed to obtain event stream"; "error" => %e); - return; + return Err(format!("Failed to obtain event stream: {e:?}")); } }; diff --git a/common/eth2_network_config/Cargo.toml b/common/eth2_network_config/Cargo.toml index e73f64d5a83..76bf4fab0ed 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -12,6 +12,7 @@ eth2_config = { path = "../eth2_config" } [dev-dependencies] tempfile = "3.1.0" +tokio = "1.14.0" [dependencies] serde_yaml = "0.8.13" @@ -26,3 +27,5 @@ url = "2.2.2" sensitive_url = { path = "../sensitive_url" } slog = "2.5.2" logging = { path = "../logging" } +futures = "0.3.7" +bytes = "1.1.0" \ No newline at end of file diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index 769f656e85d..99093cf3b71 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -11,10 +11,11 @@ //! To add a new built-in testnet, add it to the `define_hardcoded_nets` invocation in the `eth2_config` //! crate. +use bytes::Bytes; use discv5::enr::{CombinedKey, Enr}; use eth2_config::{instantiate_hardcoded_nets, HardcodedNet}; use pretty_reqwest_error::PrettyReqwestError; -use reqwest::blocking::Client; +use reqwest::{Client, Error}; use sensitive_url::SensitiveUrl; use sha2::{Digest, Sha256}; use slog::{info, warn, Logger}; @@ -127,14 +128,8 @@ impl Eth2NetworkConfig { self.genesis_state_source != GenesisStateSource::Unknown } - /// The `genesis_validators_root` of the genesis state. May download the - /// genesis state if the value is not already available. - pub fn genesis_validators_root( - &self, - genesis_state_url: Option<&str>, - timeout: Duration, - log: &Logger, - ) -> Result, String> { + /// The `genesis_validators_root` of the genesis state. + pub fn genesis_validators_root(&self) -> Result, String> { if let GenesisStateSource::Url { genesis_validators_root, .. @@ -149,10 +144,8 @@ impl Eth2NetworkConfig { ) }) } else { - self.genesis_state::(genesis_state_url, timeout, log)? - .map(|state| state.genesis_validators_root()) - .map(Result::Ok) - .transpose() + self.get_genesis_state_from_bytes::() + .map(|state| Some(state.genesis_validators_root())) } } @@ -170,7 +163,7 @@ impl Eth2NetworkConfig { /// /// If the genesis state is configured to be downloaded from a URL, then the /// `genesis_state_url` will override the built-in list of download URLs. - pub fn genesis_state( + pub async fn genesis_state( &self, genesis_state_url: Option<&str>, timeout: Duration, @@ -180,15 +173,7 @@ impl Eth2NetworkConfig { match &self.genesis_state_source { GenesisStateSource::Unknown => Ok(None), GenesisStateSource::IncludedBytes => { - let state = self - .genesis_state_bytes - .as_ref() - .map(|bytes| { - BeaconState::from_ssz_bytes(bytes.as_ref(), &spec).map_err(|e| { - format!("Built-in genesis state SSZ bytes are invalid: {:?}", e) - }) - }) - .ok_or("Genesis state bytes missing from Eth2NetworkConfig")??; + let state = self.get_genesis_state_from_bytes()?; Ok(Some(state)) } GenesisStateSource::Url { @@ -200,9 +185,9 @@ impl Eth2NetworkConfig { format!("Unable to parse genesis state bytes checksum: {:?}", e) })?; let bytes = if let Some(specified_url) = genesis_state_url { - download_genesis_state(&[specified_url], timeout, checksum, log) + download_genesis_state(&[specified_url], timeout, checksum, log).await } else { - download_genesis_state(built_in_urls, timeout, checksum, log) + download_genesis_state(built_in_urls, timeout, checksum, log).await }?; let state = BeaconState::from_ssz_bytes(bytes.as_ref(), &spec).map_err(|e| { format!("Downloaded genesis state SSZ bytes are invalid: {:?}", e) @@ -228,6 +213,17 @@ impl Eth2NetworkConfig { } } + fn get_genesis_state_from_bytes(&self) -> Result, String> { + let spec = self.chain_spec::()?; + self.genesis_state_bytes + .as_ref() + .map(|bytes| { + BeaconState::from_ssz_bytes(bytes.as_ref(), &spec) + .map_err(|e| format!("Built-in genesis state SSZ bytes are invalid: {:?}", e)) + }) + .ok_or("Genesis state bytes missing from Eth2NetworkConfig")? + } + /// Write the files to the directory. /// /// Overwrites files if specified to do so. @@ -352,7 +348,7 @@ impl Eth2NetworkConfig { /// Try to download a genesis state from each of the `urls` in the order they /// are defined. Return `Ok` if any url returns a response that matches the /// given `checksum`. -fn download_genesis_state( +async fn download_genesis_state( urls: &[&str], timeout: Duration, checksum: Hash256, @@ -384,12 +380,7 @@ fn download_genesis_state( ); let client = Client::new(); - let response = client - .get(url) - .header("Accept", "application/octet-stream") - .timeout(timeout) - .send() - .and_then(|r| r.error_for_status().and_then(|r| r.bytes())); + let response = get_state_bytes(timeout, url, client).await; match response { Ok(bytes) => { @@ -419,6 +410,18 @@ fn download_genesis_state( )) } +async fn get_state_bytes(timeout: Duration, url: Url, client: Client) -> Result { + client + .get(url) + .header("Accept", "application/octet-stream") + .timeout(timeout) + .send() + .await? + .error_for_status()? + .bytes() + .await +} + /// Parses the `url` and joins the necessary state download path. fn parse_state_download_url(url: &str) -> Result { Url::parse(url) @@ -463,11 +466,12 @@ mod tests { assert_eq!(spec, config.chain_spec::().unwrap()); } - #[test] - fn mainnet_genesis_state() { + #[tokio::test] + async fn mainnet_genesis_state() { let config = Eth2NetworkConfig::from_hardcoded_net(&MAINNET).unwrap(); config .genesis_state::(None, Duration::from_secs(1), &logging::test_logger()) + .await .expect("beacon state can decode"); } diff --git a/lcli/Dockerfile b/lcli/Dockerfile index a50aa17027b..1ee80e14fd2 100644 --- a/lcli/Dockerfile +++ b/lcli/Dockerfile @@ -1,7 +1,7 @@ # `lcli` requires the full project to be in scope, so this should be built either: # - from the `lighthouse` dir with the command: `docker build -f ./lcli/Dockerflie .` # - from the current directory with the command: `docker build -f ./Dockerfile ../` -FROM rust:1.68.2-bullseye AS builder +FROM rust:1.69.0-bullseye AS builder RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev COPY . lighthouse ARG PORTABLE diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 012276f4cec..920a1f64e79 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -4,7 +4,7 @@ version = "4.4.1" authors = ["Sigma Prime "] edition = "2021" autotests = false -rust-version = "1.68.2" +rust-version = "1.69.0" [features] default = ["slasher-lmdb"] From 992b476eaced3dbce313dcbeed993f3336745e40 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 21 Sep 2023 06:38:31 +0000 Subject: [PATCH 16/27] Add SSZ support to validator block production endpoints (#4534) ## Issue Addressed #4531 ## Proposed Changes add SSZ support to the following block production endpoints: GET /eth/v2/validator/blocks/{slot} GET /eth/v1/validator/blinded_blocks/{slot} ## Additional Info i updated a few existing tests to use ssz instead of writing completely new tests --- beacon_node/http_api/src/lib.rs | 48 ++++++++-- beacon_node/http_api/tests/tests.rs | 87 +++++++++++++++++- common/eth2/src/lib.rs | 136 ++++++++++++++++++++++++++-- validator_client/src/lib.rs | 3 + 4 files changed, 255 insertions(+), 19 deletions(-) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index fc1398d2b2d..cde05e68215 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -3002,6 +3002,7 @@ pub fn serve( .and(warp::path::end()) .and(not_while_syncing_filter.clone()) .and(warp::query::()) + .and(warp::header::optional::("accept")) .and(task_spawner_filter.clone()) .and(chain_filter.clone()) .and(log_filter.clone()) @@ -3009,6 +3010,7 @@ pub fn serve( |endpoint_version: EndpointVersion, slot: Slot, query: api_types::ValidatorBlocksQuery, + accept_header: Option, task_spawner: TaskSpawner, chain: Arc>, log: Logger| { @@ -3053,9 +3055,24 @@ pub fn serve( .fork_name(&chain.spec) .map_err(inconsistent_fork_rejection)?; - fork_versioned_response(endpoint_version, fork_name, block) - .map(|response| warp::reply::json(&response).into_response()) - .map(|res| add_consensus_version_header(res, fork_name)) + match accept_header { + Some(api_types::Accept::Ssz) => Response::builder() + .status(200) + .header("Content-Type", "application/octet-stream") + .body(block.as_ssz_bytes().into()) + .map(|res: Response| { + add_consensus_version_header(res, fork_name) + }) + .map_err(|e| { + warp_utils::reject::custom_server_error(format!( + "failed to create response: {}", + e + )) + }), + _ => fork_versioned_response(endpoint_version, fork_name, block) + .map(|response| warp::reply::json(&response).into_response()) + .map(|res| add_consensus_version_header(res, fork_name)), + } }) }, ); @@ -3072,11 +3089,13 @@ pub fn serve( .and(warp::path::end()) .and(not_while_syncing_filter.clone()) .and(warp::query::()) + .and(warp::header::optional::("accept")) .and(task_spawner_filter.clone()) .and(chain_filter.clone()) .then( |slot: Slot, query: api_types::ValidatorBlocksQuery, + accept_header: Option, task_spawner: TaskSpawner, chain: Arc>| { task_spawner.spawn_async_with_rejection(Priority::P0, async move { @@ -3114,10 +3133,25 @@ pub fn serve( .fork_name(&chain.spec) .map_err(inconsistent_fork_rejection)?; - // Pose as a V2 endpoint so we return the fork `version`. - fork_versioned_response(V2, fork_name, block) - .map(|response| warp::reply::json(&response).into_response()) - .map(|res| add_consensus_version_header(res, fork_name)) + match accept_header { + Some(api_types::Accept::Ssz) => Response::builder() + .status(200) + .header("Content-Type", "application/octet-stream") + .body(block.as_ssz_bytes().into()) + .map(|res: Response| { + add_consensus_version_header(res, fork_name) + }) + .map_err(|e| { + warp_utils::reject::custom_server_error(format!( + "failed to create response: {}", + e + )) + }), + // Pose as a V2 endpoint so we return the fork `version`. + _ => fork_versioned_response(V2, fork_name, block) + .map(|response| warp::reply::json(&response).into_response()) + .map(|res| add_consensus_version_header(res, fork_name)), + } }) }, ); diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index c4040471a6c..1fbdab07ccd 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -2513,6 +2513,70 @@ impl ApiTester { self } + pub async fn test_block_production_ssz(self) -> Self { + let fork = self.chain.canonical_head.cached_head().head_fork(); + let genesis_validators_root = self.chain.genesis_validators_root; + + for _ in 0..E::slots_per_epoch() * 3 { + let slot = self.chain.slot().unwrap(); + let epoch = self.chain.epoch().unwrap(); + + let proposer_pubkey_bytes = self + .client + .get_validator_duties_proposer(epoch) + .await + .unwrap() + .data + .into_iter() + .find(|duty| duty.slot == slot) + .map(|duty| duty.pubkey) + .unwrap(); + let proposer_pubkey = (&proposer_pubkey_bytes).try_into().unwrap(); + + let sk = self + .validator_keypairs() + .iter() + .find(|kp| kp.pk == proposer_pubkey) + .map(|kp| kp.sk.clone()) + .unwrap(); + + let randao_reveal = { + let domain = self.chain.spec.get_domain( + epoch, + Domain::Randao, + &fork, + genesis_validators_root, + ); + let message = epoch.signing_root(domain); + sk.sign(message).into() + }; + + let block_bytes = self + .client + .get_validator_blocks_ssz::>(slot, &randao_reveal, None) + .await + .unwrap() + .expect("block bytes"); + + let block = + BeaconBlock::>::from_ssz_bytes(&block_bytes, &self.chain.spec) + .expect("block bytes can be decoded"); + + let signed_block = block.sign(&sk, &fork, genesis_validators_root, &self.chain.spec); + + self.client + .post_beacon_blocks_ssz(&signed_block) + .await + .unwrap(); + + assert_eq!(self.chain.head_beacon_block().as_ref(), &signed_block); + + self.chain.slot_clock.set_slot(slot.as_u64() + 1); + } + + self + } + pub async fn test_block_production_no_verify_randao(self) -> Self { for _ in 0..E::slots_per_epoch() { let slot = self.chain.slot().unwrap(); @@ -2694,12 +2758,15 @@ impl ApiTester { sk.sign(message).into() }; - let block = self + let block_bytes = self .client - .get_validator_blinded_blocks::(slot, &randao_reveal, None) + .get_validator_blinded_blocks_ssz::(slot, &randao_reveal, None) .await .unwrap() - .data; + .expect("block bytes"); + + let block = BeaconBlock::::from_ssz_bytes(&block_bytes, &self.chain.spec) + .expect("block bytes can be decoded"); let signed_block = block.sign(&sk, &fork, genesis_validators_root, &self.chain.spec); @@ -4891,6 +4958,20 @@ async fn block_production_verify_randao_invalid() { .await; } +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn block_production_ssz_full_payload() { + ApiTester::new().await.test_block_production_ssz().await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn block_production_ssz_with_skip_slots() { + ApiTester::new() + .await + .skip_slots(E::slots_per_epoch() * 2) + .test_block_production_ssz() + .await; +} + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn blinded_block_production_full_payload_premerge() { ApiTester::new() diff --git a/common/eth2/src/lib.rs b/common/eth2/src/lib.rs index 74c2f3802fc..5b43ee3a7a3 100644 --- a/common/eth2/src/lib.rs +++ b/common/eth2/src/lib.rs @@ -120,6 +120,7 @@ pub struct Timeouts { pub get_beacon_blocks_ssz: Duration, pub get_debug_beacon_states: Duration, pub get_deposit_snapshot: Duration, + pub get_validator_block_ssz: Duration, } impl Timeouts { @@ -135,6 +136,7 @@ impl Timeouts { get_beacon_blocks_ssz: timeout, get_debug_beacon_states: timeout, get_deposit_snapshot: timeout, + get_validator_block_ssz: timeout, } } } @@ -1598,14 +1600,14 @@ impl BeaconNodeHttpClient { .await } - /// `GET v2/validator/blocks/{slot}` - pub async fn get_validator_blocks_modular>( + /// returns `GET v2/validator/blocks/{slot}` URL path + pub async fn get_validator_blocks_path>( &self, slot: Slot, randao_reveal: &SignatureBytes, graffiti: Option<&Graffiti>, skip_randao_verification: SkipRandaoVerification, - ) -> Result>, Error> { + ) -> Result { let mut path = self.eth_path(V2)?; path.path_segments_mut() @@ -1627,9 +1629,66 @@ impl BeaconNodeHttpClient { .append_pair("skip_randao_verification", ""); } + Ok(path) + } + + /// `GET v2/validator/blocks/{slot}` + pub async fn get_validator_blocks_modular>( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + skip_randao_verification: SkipRandaoVerification, + ) -> Result>, Error> { + let path = self + .get_validator_blocks_path::( + slot, + randao_reveal, + graffiti, + skip_randao_verification, + ) + .await?; + self.get(path).await } + /// `GET v2/validator/blocks/{slot}` in ssz format + pub async fn get_validator_blocks_ssz>( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + ) -> Result>, Error> { + self.get_validator_blocks_modular_ssz::( + slot, + randao_reveal, + graffiti, + SkipRandaoVerification::No, + ) + .await + } + + /// `GET v2/validator/blocks/{slot}` in ssz format + pub async fn get_validator_blocks_modular_ssz>( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + skip_randao_verification: SkipRandaoVerification, + ) -> Result>, Error> { + let path = self + .get_validator_blocks_path::( + slot, + randao_reveal, + graffiti, + skip_randao_verification, + ) + .await?; + + self.get_bytes_opt_accept_header(path, Accept::Ssz, self.timeouts.get_validator_block_ssz) + .await + } + /// `GET v2/validator/blinded_blocks/{slot}` pub async fn get_validator_blinded_blocks>( &self, @@ -1646,17 +1705,14 @@ impl BeaconNodeHttpClient { .await } - /// `GET v1/validator/blinded_blocks/{slot}` - pub async fn get_validator_blinded_blocks_modular< - T: EthSpec, - Payload: AbstractExecPayload, - >( + /// returns `GET v1/validator/blinded_blocks/{slot}` URL path + pub async fn get_validator_blinded_blocks_path>( &self, slot: Slot, randao_reveal: &SignatureBytes, graffiti: Option<&Graffiti>, skip_randao_verification: SkipRandaoVerification, - ) -> Result>, Error> { + ) -> Result { let mut path = self.eth_path(V1)?; path.path_segments_mut() @@ -1678,9 +1734,71 @@ impl BeaconNodeHttpClient { .append_key_only("skip_randao_verification"); } + Ok(path) + } + + /// `GET v1/validator/blinded_blocks/{slot}` + pub async fn get_validator_blinded_blocks_modular< + T: EthSpec, + Payload: AbstractExecPayload, + >( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + skip_randao_verification: SkipRandaoVerification, + ) -> Result>, Error> { + let path = self + .get_validator_blinded_blocks_path::( + slot, + randao_reveal, + graffiti, + skip_randao_verification, + ) + .await?; + self.get(path).await } + /// `GET v2/validator/blinded_blocks/{slot}` in ssz format + pub async fn get_validator_blinded_blocks_ssz>( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + ) -> Result>, Error> { + self.get_validator_blinded_blocks_modular_ssz::( + slot, + randao_reveal, + graffiti, + SkipRandaoVerification::No, + ) + .await + } + + pub async fn get_validator_blinded_blocks_modular_ssz< + T: EthSpec, + Payload: AbstractExecPayload, + >( + &self, + slot: Slot, + randao_reveal: &SignatureBytes, + graffiti: Option<&Graffiti>, + skip_randao_verification: SkipRandaoVerification, + ) -> Result>, Error> { + let path = self + .get_validator_blinded_blocks_path::( + slot, + randao_reveal, + graffiti, + skip_randao_verification, + ) + .await?; + + self.get_bytes_opt_accept_header(path, Accept::Ssz, self.timeouts.get_validator_block_ssz) + .await + } + /// `GET validator/attestation_data?slot,committee_index` pub async fn get_validator_attestation_data( &self, diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index 473a67945f7..6925e285fc5 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -82,6 +82,7 @@ const HTTP_SYNC_DUTIES_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_GET_BEACON_BLOCK_SSZ_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_GET_DEBUG_BEACON_STATE_QUOTIENT: u32 = 4; const HTTP_GET_DEPOSIT_SNAPSHOT_QUOTIENT: u32 = 4; +const HTTP_GET_VALIDATOR_BLOCK_SSZ_TIMEOUT_QUOTIENT: u32 = 4; const DOPPELGANGER_SERVICE_NAME: &str = "doppelganger"; @@ -309,6 +310,8 @@ impl ProductionValidatorClient { / HTTP_GET_BEACON_BLOCK_SSZ_TIMEOUT_QUOTIENT, get_debug_beacon_states: slot_duration / HTTP_GET_DEBUG_BEACON_STATE_QUOTIENT, get_deposit_snapshot: slot_duration / HTTP_GET_DEPOSIT_SNAPSHOT_QUOTIENT, + get_validator_block_ssz: slot_duration + / HTTP_GET_VALIDATOR_BLOCK_SSZ_TIMEOUT_QUOTIENT, } } else { Timeouts::set_all(slot_duration) From d3fe3ad33792944aa53d846ec3ec9c7c83674ed5 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 21 Sep 2023 06:38:32 +0000 Subject: [PATCH 17/27] Update holesky config for relaunch (#4760) ## Issue Addressed #4759 Note: Sigma Prime ENR hasn't been updated, tracking it in #4759 --- common/eth2_config/src/lib.rs | 2 +- .../holesky/boot_enr.yaml | 9 +++++---- .../built_in_network_configs/holesky/config.yaml | 16 ++++++---------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/common/eth2_config/src/lib.rs b/common/eth2_config/src/lib.rs index 6487151a92c..bf707c4d17b 100644 --- a/common/eth2_config/src/lib.rs +++ b/common/eth2_config/src/lib.rs @@ -29,7 +29,7 @@ const HOLESKY_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url // more details. "https://sigp-public-genesis-states.s3.ap-southeast-2.amazonaws.com/holesky/", ], - checksum: "0x76631cd0b9ddc5b2c766b496e23f16759ce1181446a4efb40e5540cd15b78a07", + checksum: "0xd750639607c337bbb192b15c27f447732267bf72d1650180a0e44c2d93a80741", genesis_validators_root: "0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1", }; diff --git a/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml index 616d41d672a..53e8e525fe6 100644 --- a/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml +++ b/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml @@ -1,8 +1,9 @@ # EF -- enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk -- enr:-KG4QF6d6vMSboSujAXTI4vYqArccm0eIlXfcxf2Lx_VE1q6IkQo_2D5LAO3ZSBVUs0w5rrVDmABJZuMzISe_pZundADhGV0aDKQqX6DZjABcAAAAQAAAAAAAIJpZIJ2NIJpcISygIjpiXNlY3AyNTZrMaEDF3aSa7QSCvdqLpANNd8GML4PLEZVg45fKQwMWhDZjd2DdGNwgiMog3VkcIIjKA -- enr:-Ly4QJLXSSAj3ggPBIcodvBU6IyfpU_yW7E9J-5syoJorBuvcYj_Fokcjr303bQoTdWXADf8po0ssh75Mr5wVGzZZsMBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCpfoNmMAFwAAABAAAAAAAAgmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQJrIlXIQDvQ6t9yDySqJYDXgZgLXzTvq8W7OI51jfmxJohzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA +- enr:-Ku4QFo-9q73SspYI8c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AACEZXRoMpCpfoNmMAFwAAABAAAAAAAAgmlkgnY0gmlwhKyuI_mJc2VjcDI1NmsxoQIH1kQRCZW-4AIVyAeXj5o49m_IqNFKRHp6tSpfXMUrSYN0Y3CCIyiDdWRwgiMo +- enr:-LS4QG0uV4qvcpJ-HFDJRGBmnlD3TJo7yc4jwK8iP7iKaTlfQ5kZvIDspLMJhk7j9KapuL9yyHaZmwTEZqr10k9XumyCEcmHYXR0bmV0c4gAAAAABgAAAIRldGgykGm32XQEAXAAAAEAAAAAAACCaWSCdjSCaXCErK4j-YlzZWNwMjU2azGhAgfWRBEJlb7gAhXIB5ePmjj2b8io0UpEenq1Kl9cxStJg3RjcIIjKIN1ZHCCIyg # Sigma Prime - enr:-Le4QI88slOwzz66Ksq8Vnz324DPb1BzSiY-WYPvnoJIl-lceW9bmSJnwDzgNbCjp5wsBigg76x4tValvGgQPxxSjrMBhGV0aDKQqX6DZjABcAAAAQAAAAAAAIJpZIJ2NIJpcIQ5gR6Wg2lwNpAgAUHQBwEQAAAAAAAAADR-iXNlY3AyNTZrMaEDPMSNdcL92uNIyCsS177Z6KTXlbZakQqxv3aQcWawNXeDdWRwgiMohHVkcDaCI4I diff --git a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml index a6bfd87adec..845d208307a 100644 --- a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml @@ -6,9 +6,9 @@ CONFIG_NAME: holesky # --------------------------------------------------------------- # `2**14` (= 16,384) MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384 -# Sep-15-2023 13:55:00 +UTC -MIN_GENESIS_TIME: 1694786100 -GENESIS_FORK_VERSION: 0x00017000 +# Sep-28-2023 11:55:00 +UTC +MIN_GENESIS_TIME: 1695902100 +GENESIS_FORK_VERSION: 0x01017000 # Genesis delay 5 mins GENESIS_DELAY: 300 @@ -20,23 +20,19 @@ GENESIS_DELAY: 300 # - Temporarily set to max uint64 value: 2**64 - 1 # Altair -ALTAIR_FORK_VERSION: 0x10017000 +ALTAIR_FORK_VERSION: 0x02017000 ALTAIR_FORK_EPOCH: 0 # Merge -BELLATRIX_FORK_VERSION: 0x20017000 +BELLATRIX_FORK_VERSION: 0x03017000 BELLATRIX_FORK_EPOCH: 0 TERMINAL_TOTAL_DIFFICULTY: 0 TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 # Capella -CAPELLA_FORK_VERSION: 0x30017000 +CAPELLA_FORK_VERSION: 0x04017000 CAPELLA_FORK_EPOCH: 256 -# DENEB -DENEB_FORK_VERSION: 0x40017000 -DENEB_FORK_EPOCH: 18446744073709551615 - # Time parameters # --------------------------------------------------------------- # 12 seconds From 0074a3b5f5d5c6076ece630fa680d29d58eaea56 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 21 Sep 2023 06:38:33 +0000 Subject: [PATCH 18/27] Fix block & state queries prior to genesis (#4761) ## Issue Addressed Closes #4751 ## Proposed Changes Prevent `state_root_at_slot` and `block_root_at_slot` from erroring out due to a call to `self.slot()?` that fails before genesis. This fixes pre-genesis queries for: - block at slot 0 - block by genesis block root - state at slot 0 - state by genesis state root - state at `finalized` tag - state at `justified` tag --- beacon_node/beacon_chain/src/beacon_chain.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index d5b86d63ff3..9587783508f 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -809,10 +809,10 @@ impl BeaconChain { /// /// May return a database error. pub fn state_root_at_slot(&self, request_slot: Slot) -> Result, Error> { - if request_slot > self.slot()? { - return Ok(None); - } else if request_slot == self.spec.genesis_slot { + if request_slot == self.spec.genesis_slot { return Ok(Some(self.genesis_state_root)); + } else if request_slot > self.slot()? { + return Ok(None); } // Check limits w.r.t historic state bounds. @@ -889,10 +889,10 @@ impl BeaconChain { /// /// May return a database error. fn block_root_at_slot_skips_none(&self, request_slot: Slot) -> Result, Error> { - if request_slot > self.slot()? { - return Ok(None); - } else if request_slot == self.spec.genesis_slot { + if request_slot == self.spec.genesis_slot { return Ok(Some(self.genesis_block_root)); + } else if request_slot > self.slot()? { + return Ok(None); } let prev_slot = request_slot.saturating_sub(1_u64); @@ -952,10 +952,10 @@ impl BeaconChain { /// /// May return a database error. fn block_root_at_slot_skips_prev(&self, request_slot: Slot) -> Result, Error> { - if request_slot > self.slot()? { - return Ok(None); - } else if request_slot == self.spec.genesis_slot { + if request_slot == self.spec.genesis_slot { return Ok(Some(self.genesis_block_root)); + } else if request_slot > self.slot()? { + return Ok(None); } // Try an optimized path of reading the root directly from the head state. From d0b1abc6fa3b2a3d3e19c6ac0704459bda721ed3 Mon Sep 17 00:00:00 2001 From: antondlr Date: Thu, 21 Sep 2023 22:36:59 +0000 Subject: [PATCH 19/27] Update Holesky boot ENR (#4763) ## Issue Addressed update boot ENR for Holesky relaunch --- .../built_in_network_configs/holesky/boot_enr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml index 53e8e525fe6..4dd28081026 100644 --- a/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml +++ b/common/eth2_network_config/built_in_network_configs/holesky/boot_enr.yaml @@ -6,4 +6,4 @@ # Teku - enr:-LS4QG0uV4qvcpJ-HFDJRGBmnlD3TJo7yc4jwK8iP7iKaTlfQ5kZvIDspLMJhk7j9KapuL9yyHaZmwTEZqr10k9XumyCEcmHYXR0bmV0c4gAAAAABgAAAIRldGgykGm32XQEAXAAAAEAAAAAAACCaWSCdjSCaXCErK4j-YlzZWNwMjU2azGhAgfWRBEJlb7gAhXIB5ePmjj2b8io0UpEenq1Kl9cxStJg3RjcIIjKIN1ZHCCIyg # Sigma Prime -- enr:-Le4QI88slOwzz66Ksq8Vnz324DPb1BzSiY-WYPvnoJIl-lceW9bmSJnwDzgNbCjp5wsBigg76x4tValvGgQPxxSjrMBhGV0aDKQqX6DZjABcAAAAQAAAAAAAIJpZIJ2NIJpcIQ5gR6Wg2lwNpAgAUHQBwEQAAAAAAAAADR-iXNlY3AyNTZrMaEDPMSNdcL92uNIyCsS177Z6KTXlbZakQqxv3aQcWawNXeDdWRwgiMohHVkcDaCI4I +- enr:-Le4QLoE1wFHSlGcm48a9ZESb_MRLqPPu6G0vHqu4MaUcQNDHS69tsy-zkN0K6pglyzX8m24mkb-LtBcbjAYdP1uxm4BhGV0aDKQabfZdAQBcAAAAQAAAAAAAIJpZIJ2NIJpcIQ5gR6Wg2lwNpAgAUHQBwEQAAAAAAAAADR-iXNlY3AyNTZrMaEDPMSNdcL92uNIyCsS177Z6KTXlbZakQqxv3aQcWawNXeDdWRwgiMohHVkcDaCI4I From 2441a247abec9a3b821af936f5fe0aee9b5533d2 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 21 Sep 2023 22:37:00 +0000 Subject: [PATCH 20/27] Bump `quinn-proto` to address rustsec vuln (#4767) ## Issue Addressed NA ## Proposed Changes Bumps `quinn-proto` to address a QUIC-related vulnerability: https://rustsec.org/advisories/RUSTSEC-2023-0063 Fixes a `cargo audit` failure. ## Additional Info NA --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3b8fc05410..40c4c516b2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6192,9 +6192,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13f81c9a9d574310b8351f8666f5a93ac3b0069c45c28ad52c10291389a7cf9" +checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" dependencies = [ "bytes", "rand 0.8.5", From c5588eb66e26272bb99b590492c6bd7bb5a5ff81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 22 Sep 2023 02:33:10 +0000 Subject: [PATCH 21/27] require http and metrics for respective flags (#4674) ## Issue Addressed following discussion on https://github.com/sigp/lighthouse/pull/4639#discussion_r1305183750 this PR makes the `http` and `metrics` sub-flags to require those main flags enabled --- beacon_node/src/cli.rs | 31 +++++++--- beacon_node/src/config.rs | 102 ++++++++++++++++---------------- lighthouse/tests/beacon_node.rs | 5 ++ validator_client/src/cli.rs | 16 +++-- 4 files changed, 90 insertions(+), 64 deletions(-) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index ffc29365cb9..dacff79f6ca 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -1,4 +1,4 @@ -use clap::{App, Arg}; +use clap::{App, Arg, ArgGroup}; use strum::VariantNames; use types::ProgressiveBalancesMode; @@ -355,22 +355,25 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-address") .long("http-address") + .requires("enable_http") .value_name("ADDRESS") .help("Set the listen address for the RESTful HTTP API server.") - .default_value("127.0.0.1") + .default_value_if("enable_http", None, "127.0.0.1") .takes_value(true), ) .arg( Arg::with_name("http-port") .long("http-port") + .requires("enable_http") .value_name("PORT") .help("Set the listen TCP port for the RESTful HTTP API server.") - .default_value("5052") + .default_value_if("enable_http", None, "5052") .takes_value(true), ) .arg( Arg::with_name("http-allow-origin") .long("http-allow-origin") + .requires("enable_http") .value_name("ORIGIN") .help("Set the value of the Access-Control-Allow-Origin response HTTP header. \ Use * to allow any origin (not recommended in production). \ @@ -381,11 +384,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-disable-legacy-spec") .long("http-disable-legacy-spec") + .requires("enable_http") .hidden(true) ) .arg( Arg::with_name("http-spec-fork") .long("http-spec-fork") + .requires("enable_http") .value_name("FORK") .help("Serve the spec for a specific hard fork on /eth/v1/config/spec. It should \ not be necessary to set this flag.") @@ -403,6 +408,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-tls-cert") .long("http-tls-cert") + .requires("enable_http") .help("The path of the certificate to be used when serving the HTTP API server \ over TLS.") .takes_value(true) @@ -410,6 +416,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-tls-key") .long("http-tls-key") + .requires("enable_http") .help("The path of the private key to be used when serving the HTTP API server \ over TLS. Must not be password-protected.") .takes_value(true) @@ -417,6 +424,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-allow-sync-stalled") .long("http-allow-sync-stalled") + .requires("enable_http") .help("Forces the HTTP to indicate that the node is synced when sync is actually \ stalled. This is useful for very small testnets. TESTING ONLY. DO NOT USE ON \ MAINNET.") @@ -424,8 +432,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-sse-capacity-multiplier") .long("http-sse-capacity-multiplier") + .requires("enable_http") .takes_value(true) - .default_value("1") + .default_value_if("enable_http", None, "1") .value_name("N") .help("Multiplier to apply to the length of HTTP server-sent-event (SSE) channels. \ Increasing this value can prevent messages from being dropped.") @@ -433,8 +442,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-duplicate-block-status") .long("http-duplicate-block-status") + .requires("enable_http") .takes_value(true) - .default_value("202") + .default_value_if("enable_http", None, "202") .value_name("STATUS_CODE") .help("Status code to send when a block that is already known is POSTed to the \ HTTP API.") @@ -442,13 +452,14 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-enable-beacon-processor") .long("http-enable-beacon-processor") + .requires("enable_http") .value_name("BOOLEAN") .help("The beacon processor is a scheduler which provides quality-of-service and \ DoS protection. When set to \"true\", HTTP API requests will be queued and scheduled \ alongside other tasks. When set to \"false\", HTTP API responses will be executed \ immediately.") .takes_value(true) - .default_value("true") + .default_value_if("enable_http", None, "true") ) /* Prometheus metrics HTTP server related arguments */ .arg( @@ -461,22 +472,25 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { Arg::with_name("metrics-address") .long("metrics-address") .value_name("ADDRESS") + .requires("metrics") .help("Set the listen address for the Prometheus metrics HTTP server.") - .default_value("127.0.0.1") + .default_value_if("metrics", None, "127.0.0.1") .takes_value(true), ) .arg( Arg::with_name("metrics-port") .long("metrics-port") + .requires("metrics") .value_name("PORT") .help("Set the listen TCP port for the Prometheus metrics HTTP server.") - .default_value("5054") + .default_value_if("metrics", None, "5054") .takes_value(true), ) .arg( Arg::with_name("metrics-allow-origin") .long("metrics-allow-origin") .value_name("ORIGIN") + .requires("metrics") .help("Set the value of the Access-Control-Allow-Origin response HTTP header. \ Use * to allow any origin (not recommended in production). \ If no value is supplied, the CORS allowed origin is set to the listen \ @@ -1259,4 +1273,5 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .default_value("64") .takes_value(true) ) + .group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"])) } diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index b6d0b75d9ff..4ab92a7fd46 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -94,69 +94,69 @@ pub fn get_config( * Http API server */ - if cli_args.is_present("http") { + if cli_args.is_present("enable_http") { client_config.http_api.enabled = true; - } - if let Some(address) = cli_args.value_of("http-address") { - client_config.http_api.listen_addr = address - .parse::() - .map_err(|_| "http-address is not a valid IP address.")?; - } + if let Some(address) = cli_args.value_of("http-address") { + client_config.http_api.listen_addr = address + .parse::() + .map_err(|_| "http-address is not a valid IP address.")?; + } - if let Some(port) = cli_args.value_of("http-port") { - client_config.http_api.listen_port = port - .parse::() - .map_err(|_| "http-port is not a valid u16.")?; - } + if let Some(port) = cli_args.value_of("http-port") { + client_config.http_api.listen_port = port + .parse::() + .map_err(|_| "http-port is not a valid u16.")?; + } - if let Some(allow_origin) = cli_args.value_of("http-allow-origin") { - // Pre-validate the config value to give feedback to the user on node startup, instead of - // as late as when the first API response is produced. - hyper::header::HeaderValue::from_str(allow_origin) - .map_err(|_| "Invalid allow-origin value")?; + if let Some(allow_origin) = cli_args.value_of("http-allow-origin") { + // Pre-validate the config value to give feedback to the user on node startup, instead of + // as late as when the first API response is produced. + hyper::header::HeaderValue::from_str(allow_origin) + .map_err(|_| "Invalid allow-origin value")?; - client_config.http_api.allow_origin = Some(allow_origin.to_string()); - } + client_config.http_api.allow_origin = Some(allow_origin.to_string()); + } - if cli_args.is_present("http-disable-legacy-spec") { - warn!( - log, - "The flag --http-disable-legacy-spec is deprecated and will be removed" - ); - } + if cli_args.is_present("http-disable-legacy-spec") { + warn!( + log, + "The flag --http-disable-legacy-spec is deprecated and will be removed" + ); + } - if let Some(fork_name) = clap_utils::parse_optional(cli_args, "http-spec-fork")? { - client_config.http_api.spec_fork_name = Some(fork_name); - } + if let Some(fork_name) = clap_utils::parse_optional(cli_args, "http-spec-fork")? { + client_config.http_api.spec_fork_name = Some(fork_name); + } - if cli_args.is_present("http-enable-tls") { - client_config.http_api.tls_config = Some(TlsConfig { - cert: cli_args - .value_of("http-tls-cert") - .ok_or("--http-tls-cert was not provided.")? - .parse::() - .map_err(|_| "http-tls-cert is not a valid path name.")?, - key: cli_args - .value_of("http-tls-key") - .ok_or("--http-tls-key was not provided.")? - .parse::() - .map_err(|_| "http-tls-key is not a valid path name.")?, - }); - } + if cli_args.is_present("http-enable-tls") { + client_config.http_api.tls_config = Some(TlsConfig { + cert: cli_args + .value_of("http-tls-cert") + .ok_or("--http-tls-cert was not provided.")? + .parse::() + .map_err(|_| "http-tls-cert is not a valid path name.")?, + key: cli_args + .value_of("http-tls-key") + .ok_or("--http-tls-key was not provided.")? + .parse::() + .map_err(|_| "http-tls-key is not a valid path name.")?, + }); + } - if cli_args.is_present("http-allow-sync-stalled") { - client_config.http_api.allow_sync_stalled = true; - } + if cli_args.is_present("http-allow-sync-stalled") { + client_config.http_api.allow_sync_stalled = true; + } - client_config.http_api.sse_capacity_multiplier = - parse_required(cli_args, "http-sse-capacity-multiplier")?; + client_config.http_api.sse_capacity_multiplier = + parse_required(cli_args, "http-sse-capacity-multiplier")?; - client_config.http_api.enable_beacon_processor = - parse_required(cli_args, "http-enable-beacon-processor")?; + client_config.http_api.enable_beacon_processor = + parse_required(cli_args, "http-enable-beacon-processor")?; - client_config.http_api.duplicate_block_status_code = - parse_required(cli_args, "http-duplicate-block-status")?; + client_config.http_api.duplicate_block_status_code = + parse_required(cli_args, "http-duplicate-block-status")?; + } if let Some(cache_size) = clap_utils::parse_optional(cli_args, "shuffling-cache-size")? { client_config.chain.shuffling_cache_size = cache_size; diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 10fcb101a89..f5fe7334df4 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1466,6 +1466,7 @@ fn http_flag() { fn http_address_flag() { let addr = "127.0.0.99".parse::().unwrap(); CommandLineTest::new() + .flag("http", None) .flag("http-address", Some("127.0.0.99")) .run_with_zero_port() .with_config(|config| assert_eq!(config.http_api.listen_addr, addr)); @@ -1474,6 +1475,7 @@ fn http_address_flag() { fn http_address_ipv6_flag() { let addr = "::1".parse::().unwrap(); CommandLineTest::new() + .flag("http", None) .flag("http-address", Some("::1")) .run_with_zero_port() .with_config(|config| assert_eq!(config.http_api.listen_addr, addr)); @@ -1483,6 +1485,7 @@ fn http_port_flag() { let port1 = unused_tcp4_port().expect("Unable to find unused port."); let port2 = unused_tcp4_port().expect("Unable to find unused port."); CommandLineTest::new() + .flag("http", None) .flag("http-port", Some(port1.to_string().as_str())) .flag("port", Some(port2.to_string().as_str())) .run() @@ -2446,6 +2449,7 @@ fn http_sse_capacity_multiplier_default() { #[test] fn http_sse_capacity_multiplier_override() { CommandLineTest::new() + .flag("http", None) .flag("http-sse-capacity-multiplier", Some("10")) .run_with_zero_port() .with_config(|config| assert_eq!(config.http_api.sse_capacity_multiplier, 10)); @@ -2463,6 +2467,7 @@ fn http_duplicate_block_status_default() { #[test] fn http_duplicate_block_status_override() { CommandLineTest::new() + .flag("http", None) .flag("http-duplicate-block-status", Some("301")) .run_with_zero_port() .with_config(|config| { diff --git a/validator_client/src/cli.rs b/validator_client/src/cli.rs index 0789ac78a00..0af92a9e39a 100644 --- a/validator_client/src/cli.rs +++ b/validator_client/src/cli.rs @@ -170,6 +170,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-address") .long("http-address") + .requires("http") .value_name("ADDRESS") .help("Set the address for the HTTP address. The HTTP server is not encrypted \ and therefore it is unsafe to publish on a public network. When this \ @@ -189,14 +190,16 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-port") .long("http-port") + .requires("http") .value_name("PORT") .help("Set the listen TCP port for the RESTful HTTP API server.") - .default_value("5062") + .default_value_if("http", None, "5062") .takes_value(true), ) .arg( Arg::with_name("http-allow-origin") .long("http-allow-origin") + .requires("http") .value_name("ORIGIN") .help("Set the value of the Access-Control-Allow-Origin response HTTP header. \ Use * to allow any origin (not recommended in production). \ @@ -207,21 +210,21 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("http-allow-keystore-export") .long("http-allow-keystore-export") + .requires("http") .help("If present, allow access to the DELETE /lighthouse/keystores HTTP \ API method, which allows exporting keystores and passwords to HTTP API \ consumers who have access to the API token. This method is useful for \ exporting validators, however it should be used with caution since it \ exposes private key data to authorized users.") - .required(false) .takes_value(false), ) .arg( Arg::with_name("http-store-passwords-in-secrets-dir") .long("http-store-passwords-in-secrets-dir") + .requires("http") .help("If present, any validators created via the HTTP will have keystore \ passwords stored in the secrets-dir rather than the validator \ definitions file.") - .required(false) .takes_value(false), ) /* Prometheus metrics HTTP server related arguments */ @@ -234,22 +237,25 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("metrics-address") .long("metrics-address") + .requires("metrics") .value_name("ADDRESS") .help("Set the listen address for the Prometheus metrics HTTP server.") - .default_value("127.0.0.1") + .default_value_if("metrics", None, "127.0.0.1") .takes_value(true), ) .arg( Arg::with_name("metrics-port") .long("metrics-port") + .requires("metrics") .value_name("PORT") .help("Set the listen TCP port for the Prometheus metrics HTTP server.") - .default_value("5064") + .default_value_if("metrics", None, "5064") .takes_value(true), ) .arg( Arg::with_name("metrics-allow-origin") .long("metrics-allow-origin") + .requires("metrics") .value_name("ORIGIN") .help("Set the value of the Access-Control-Allow-Origin response HTTP header. \ Use * to allow any origin (not recommended in production). \ From c4e907de9f531c8bd18d9547515c1918a5e2b0e1 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 22 Sep 2023 02:33:11 +0000 Subject: [PATCH 22/27] Update the voluntary exit endpoint to comply with the key manager specification (#4679) ## Issue Addressed #4635 ## Proposed Changes Wrap the `SignedVoluntaryExit` object in a `GenericResponse` container, adding an additional `data` layer, to ensure compliance with the key manager API specification. The new response would look like this: ```json {"data":{"message":{"epoch":"196868","validator_index":"505597"},"signature":"0xhexsig"}} ``` This is a backward incompatible change and will affect Siren as well. --- common/eth2/src/lighthouse_vc/http_client.rs | 2 +- .../src/http_api/create_signed_voluntary_exit.rs | 5 +++-- validator_client/src/http_api/tests.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/eth2/src/lighthouse_vc/http_client.rs b/common/eth2/src/lighthouse_vc/http_client.rs index 7bf4cf5b19a..b2d53c5e08d 100644 --- a/common/eth2/src/lighthouse_vc/http_client.rs +++ b/common/eth2/src/lighthouse_vc/http_client.rs @@ -666,7 +666,7 @@ impl ValidatorClientHttpClient { &self, pubkey: &PublicKeyBytes, epoch: Option, - ) -> Result { + ) -> Result, Error> { let mut path = self.server.full.clone(); path.path_segments_mut() diff --git a/validator_client/src/http_api/create_signed_voluntary_exit.rs b/validator_client/src/http_api/create_signed_voluntary_exit.rs index b777d158064..a9586da57ec 100644 --- a/validator_client/src/http_api/create_signed_voluntary_exit.rs +++ b/validator_client/src/http_api/create_signed_voluntary_exit.rs @@ -1,5 +1,6 @@ use crate::validator_store::ValidatorStore; use bls::{PublicKey, PublicKeyBytes}; +use eth2::types::GenericResponse; use slog::{info, Logger}; use slot_clock::SlotClock; use std::sync::Arc; @@ -11,7 +12,7 @@ pub async fn create_signed_voluntary_exit>, slot_clock: T, log: Logger, -) -> Result { +) -> Result, warp::Rejection> { let epoch = match maybe_epoch { Some(epoch) => epoch, None => get_current_epoch::(slot_clock).ok_or_else(|| { @@ -60,7 +61,7 @@ pub async fn create_signed_voluntary_exit Date: Fri, 22 Sep 2023 02:33:12 +0000 Subject: [PATCH 23/27] Add new teku bootnodes (#4724) Adds new Teku bootnodes Co-authored-by: Paul Hauner --- .../built_in_network_configs/mainnet/boot_enr.yaml | 6 ++++-- lighthouse/tests/beacon_node.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/eth2_network_config/built_in_network_configs/mainnet/boot_enr.yaml b/common/eth2_network_config/built_in_network_configs/mainnet/boot_enr.yaml index 428a082cc0f..7442f6576e6 100644 --- a/common/eth2_network_config/built_in_network_configs/mainnet/boot_enr.yaml +++ b/common/eth2_network_config/built_in_network_configs/mainnet/boot_enr.yaml @@ -10,11 +10,13 @@ - enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg # Teku team (Consensys) - enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiO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AACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM \ No newline at end of file +- enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index f5fe7334df4..cb51dffdced 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1194,7 +1194,7 @@ fn default_backfill_rate_limiting_flag() { } #[test] fn default_boot_nodes() { - let number_of_boot_nodes = 15; + let number_of_boot_nodes = 17; CommandLineTest::new() .run_with_zero_port() From 69c39ad1e5510222248a105b3d911e9643145e3f Mon Sep 17 00:00:00 2001 From: antondlr Date: Fri, 22 Sep 2023 02:33:13 +0000 Subject: [PATCH 24/27] Use release workflow runners (#4765) ## Issue Addressed Build releases on self-hosted hardware to speed the process up --- .github/workflows/release.yml | 18 +++++++++--------- .github/workflows/test-suite.yml | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e38b03daf70..62eadd0451a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,31 +38,31 @@ jobs: x86_64-windows-portable] include: - arch: aarch64-unknown-linux-gnu - platform: ubuntu-latest + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }} profile: maxperf - arch: aarch64-unknown-linux-gnu-portable - platform: ubuntu-latest + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }} profile: maxperf - arch: x86_64-unknown-linux-gnu - platform: ubuntu-latest + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }} profile: maxperf - arch: x86_64-unknown-linux-gnu-portable - platform: ubuntu-latest + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release", "large"]') || 'ubuntu-latest' }} profile: maxperf - arch: x86_64-apple-darwin - platform: macos-latest + runner: macos-latest profile: maxperf - arch: x86_64-apple-darwin-portable - platform: macos-latest + runner: macos-latest profile: maxperf - arch: x86_64-windows - platform: windows-2019 + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "release"]') || 'windows-2019' }} profile: maxperf - arch: x86_64-windows-portable - platform: windows-2019 + runner: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "release"]') || 'windows-2019' }} profile: maxperf - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.runner }} needs: extract-version steps: - name: Checkout sources diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 1d9856b93cf..fd9b77ae2f9 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -58,7 +58,7 @@ jobs: release-tests-ubuntu: name: release-tests-ubuntu # Use self-hosted runners only on the sigp repo. - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }} needs: cargo-fmt steps: - uses: actions/checkout@v3 @@ -73,7 +73,7 @@ jobs: run: make test-release release-tests-windows: name: release-tests-windows - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows"]') || 'windows-2019' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "CI"]') || 'windows-2019' }} needs: cargo-fmt steps: - uses: actions/checkout@v3 @@ -98,7 +98,7 @@ jobs: beacon-chain-tests: name: beacon-chain-tests # Use self-hosted runners only on the sigp repo. - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }} needs: cargo-fmt steps: - uses: actions/checkout@v3 @@ -130,7 +130,7 @@ jobs: debug-tests-ubuntu: name: debug-tests-ubuntu # Use self-hosted runners only on the sigp repo. - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }} needs: cargo-fmt steps: - uses: actions/checkout@v3 @@ -156,7 +156,7 @@ jobs: ef-tests-ubuntu: name: ef-tests-ubuntu # Use self-hosted runners only on the sigp repo. - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "small"]') || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }} needs: cargo-fmt steps: - uses: actions/checkout@v3 From dcd69dfc628cad5998225d5100b222458f3f0ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 22 Sep 2023 04:30:56 +0000 Subject: [PATCH 25/27] Move dependencies to workspace (#4650) ## Issue Addressed Synchronize dependencies and edition on the workspace `Cargo.toml` ## Proposed Changes with https://github.com/rust-lang/cargo/issues/8415 merged it's now possible to synchronize details on the workspace `Cargo.toml` like the metadata and dependencies. By only having dependencies that are shared between multiple crates aligned on the workspace `Cargo.toml` it's easier to not miss duplicate versions of the same dependency and therefore ease on the compile times. ## Additional Info this PR also removes the no longer required direct dependency of the `serde_derive` crate. should be reviewed after https://github.com/sigp/lighthouse/pull/4639 get's merged. closes https://github.com/sigp/lighthouse/issues/4651 Co-authored-by: Michael Sproul Co-authored-by: Michael Sproul --- Cargo.lock | 738 ++++++------------ Cargo.toml | 136 +++- Makefile | 2 +- account_manager/Cargo.toml | 46 +- beacon_node/Cargo.toml | 57 +- beacon_node/beacon_chain/Cargo.toml | 105 ++- .../beacon_chain/src/beacon_snapshot.rs | 2 +- beacon_node/beacon_chain/src/chain_config.rs | 2 +- beacon_node/beacon_processor/Cargo.toml | 42 +- beacon_node/builder_client/Cargo.toml | 14 +- beacon_node/client/Cargo.toml | 67 +- beacon_node/eth1/Cargo.toml | 52 +- beacon_node/execution_layer/Cargo.toml | 72 +- beacon_node/genesis/Cargo.toml | 32 +- beacon_node/http_api/Cargo.toml | 80 +- beacon_node/http_metrics/Cargo.toml | 32 +- beacon_node/lighthouse_network/Cargo.toml | 93 +-- beacon_node/lighthouse_network/src/config.rs | 2 +- .../src/peer_manager/mod.rs | 2 +- beacon_node/network/Cargo.toml | 77 +- beacon_node/operation_pool/Cargo.toml | 36 +- beacon_node/store/Cargo.toml | 36 +- beacon_node/timer/Cargo.toml | 12 +- boot_node/Cargo.toml | 36 +- common/account_utils/Cargo.toml | 26 +- common/clap_utils/Cargo.toml | 22 +- common/compare_fields/Cargo.toml | 4 +- common/compare_fields_derive/Cargo.toml | 6 +- common/deposit_contract/Cargo.toml | 16 +- common/directory/Cargo.toml | 8 +- common/eth2/Cargo.toml | 44 +- common/eth2_config/Cargo.toml | 6 +- common/eth2_interop_keypairs/Cargo.toml | 14 +- common/eth2_network_config/Cargo.toml | 37 +- common/eth2_wallet_manager/Cargo.toml | 8 +- common/filesystem/Cargo.toml | 2 +- common/lighthouse_metrics/Cargo.toml | 4 +- common/lighthouse_version/Cargo.toml | 4 +- common/lockfile/Cargo.toml | 6 +- common/logging/Cargo.toml | 22 +- common/lru_cache/Cargo.toml | 4 +- common/malloc_utils/Cargo.toml | 8 +- common/monitoring_api/Cargo.toml | 28 +- common/oneshot_broadcast/Cargo.toml | 4 +- common/pretty_reqwest_error/Cargo.toml | 6 +- common/sensitive_url/Cargo.toml | 6 +- common/slot_clock/Cargo.toml | 10 +- common/system_health/Cargo.toml | 14 +- common/target_check/Cargo.toml | 2 +- common/task_executor/Cargo.toml | 16 +- common/test_random_derive/Cargo.toml | 6 +- common/unused_port/Cargo.toml | 8 +- common/validator_dir/Cargo.toml | 26 +- common/warp_utils/Cargo.toml | 22 +- consensus/cached_tree_hash/Cargo.toml | 20 +- consensus/fork_choice/Cargo.toml | 20 +- consensus/int_to_bytes/Cargo.toml | 6 +- consensus/merkle_proof/Cargo.toml | 14 +- consensus/proto_array/Cargo.toml | 16 +- consensus/safe_arith/Cargo.toml | 2 +- consensus/state_processing/Cargo.toml | 47 +- consensus/state_processing/src/metrics.rs | 2 - .../epoch_processing_summary.rs | 1 - consensus/swap_or_not_shuffle/Cargo.toml | 8 +- consensus/types/Cargo.toml | 87 +-- crypto/bls/Cargo.toml | 25 +- crypto/eth2_key_derivation/Cargo.toml | 14 +- crypto/eth2_keystore/Cargo.toml | 24 +- crypto/eth2_wallet/Cargo.toml | 22 +- database_manager/Cargo.toml | 26 +- lcli/Cargo.toml | 66 +- lighthouse/Cargo.toml | 68 +- lighthouse/environment/Cargo.toml | 28 +- slasher/Cargo.toml | 46 +- slasher/service/Cargo.toml | 24 +- testing/ef_tests/Cargo.toml | 50 +- testing/eth1_test_rig/Cargo.toml | 18 +- .../execution_engine_integration/Cargo.toml | 38 +- testing/node_test_rig/Cargo.toml | 22 +- testing/simulator/Cargo.toml | 22 +- testing/state_transition_vectors/Cargo.toml | 14 +- testing/test-test_logger/Cargo.toml | 6 +- testing/web3signer_tests/Cargo.toml | 43 +- .../web3signer_tests/tls/lighthouse/cert.pem | 53 +- .../web3signer_tests/tls/lighthouse/key.key | 100 +-- .../web3signer_tests/tls/lighthouse/key.p12 | Bin 4189 -> 4371 bytes .../tls/lighthouse/web3signer.pem | 53 +- .../web3signer_tests/tls/web3signer/cert.pem | 53 +- .../web3signer_tests/tls/web3signer/key.key | 100 +-- .../web3signer_tests/tls/web3signer/key.p12 | Bin 4197 -> 4371 bytes .../tls/web3signer/known_clients.txt | 2 +- validator_client/Cargo.toml | 100 +-- .../slashing_protection/Cargo.toml | 26 +- validator_manager/Cargo.toml | 41 +- watch/Cargo.toml | 50 +- 95 files changed, 1712 insertions(+), 1807 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40c4c516b2c..36245a2cd0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ dependencies = [ "eth2_keystore", "eth2_wallet", "filesystem", - "rand 0.8.5", + "rand", "regex", "rpassword", "serde", @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "0f2135563fb5c609d2b2b87c1e8ce7bc41b0b45430fa9661f457981503dd5bf0" dependencies = [ "memchr", ] @@ -169,7 +169,7 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "amcl" version = "0.3.0" -source = "git+https://github.com/sigp/milagro_bls?tag=v1.4.2#16655aa033175a90c10ef02aa144e2835de23aec" +source = "git+https://github.com/sigp/milagro_bls?tag=v1.5.1#d3fc0a40cfe8b72ccda46ba050ee6786a59ce753" [[package]] name = "android-tzdata" @@ -298,7 +298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", - "autocfg 1.1.0", + "autocfg", "cfg-if", "concurrent-queue", "futures-lite", @@ -339,7 +339,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -350,7 +350,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -412,15 +412,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -517,9 +508,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -549,7 +540,7 @@ dependencies = [ name = "beacon_chain" version = "0.2.0" dependencies = [ - "bitvec 0.20.4", + "bitvec 1.0.1", "bls", "derivative", "environment", @@ -577,12 +568,11 @@ dependencies = [ "operation_pool", "parking_lot 0.12.1", "proto_array", - "rand 0.8.5", + "rand", "rayon", "safe_arith", "sensitive_url", "serde", - "serde_derive", "serde_json", "slasher", "slog", @@ -593,7 +583,7 @@ dependencies = [ "state_processing", "store", "strum", - "superstruct 0.5.0", + "superstruct", "task_executor", "tempfile", "tokio", @@ -773,7 +763,7 @@ dependencies = [ "ethereum_ssz", "hex", "milagro_bls", - "rand 0.7.3", + "rand", "serde", "serde_derive", "tree_hash", @@ -857,9 +847,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -875,9 +865,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -1008,14 +998,14 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -1102,6 +1092,7 @@ dependencies = [ "logging", "monitoring_api", "network", + "num_cpus", "operation_pool", "parking_lot 0.12.1", "sensitive_url", @@ -1278,7 +1269,7 @@ version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ - "autocfg 1.1.0", + "autocfg", "cfg-if", "crossbeam-utils", "memoffset 0.9.0", @@ -1314,9 +1305,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -1386,11 +1377,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" +checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" dependencies = [ - "nix 0.26.3", + "nix 0.27.1", "windows-sys 0.48.0", ] @@ -1409,16 +1400,16 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms 3.0.2", + "platforms 3.1.2", "rustc_version", "subtle", "zeroize", @@ -1432,7 +1423,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1559,7 +1550,7 @@ dependencies = [ "hex", "reqwest", "serde_json", - "sha2 0.10.7", + "sha2 0.9.9", "tree_hash", "types", ] @@ -1624,7 +1615,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1663,7 +1654,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1683,7 +1674,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1779,7 +1770,7 @@ dependencies = [ "lru 0.7.8", "more-asserts", "parking_lot 0.11.2", - "rand 0.8.5", + "rand", "rlp", "smallvec 1.11.0", "socket2 0.4.9", @@ -1798,7 +1789,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1855,7 +1846,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.0", "ed25519", "rand_core 0.6.4", "serde", @@ -1927,7 +1918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array", @@ -1961,7 +1952,7 @@ dependencies = [ "hex", "k256 0.11.6", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "sha3 0.10.8", @@ -1974,13 +1965,13 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "bytes", "ed25519-dalek", "hex", "k256 0.13.1", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "serde-hex", @@ -2002,9 +1993,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "log", "regex", @@ -2053,9 +2044,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -2106,7 +2097,7 @@ dependencies = [ "slog", "sloggers", "state_processing", - "superstruct 0.5.0", + "superstruct", "task_executor", "tokio", "tree_hash", @@ -2190,7 +2181,7 @@ dependencies = [ "hex", "num-bigint-dig", "ring", - "sha2 0.10.7", + "sha2 0.9.9", "zeroize", ] @@ -2204,7 +2195,7 @@ dependencies = [ "hex", "hmac 0.11.0", "pbkdf2 0.8.0", - "rand 0.8.5", + "rand", "scrypt", "serde", "serde_json", @@ -2224,13 +2215,12 @@ dependencies = [ "discv5", "eth2_config", "ethereum_ssz", - "futures", "logging", "pretty_reqwest_error", "reqwest", "sensitive_url", "serde_yaml", - "sha2 0.10.7", + "sha2 0.9.9", "slog", "tempfile", "tokio", @@ -2246,7 +2236,7 @@ dependencies = [ "eth2_key_derivation", "eth2_keystore", "hex", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_repr", @@ -2337,7 +2327,7 @@ dependencies = [ "integer-sqrt", "multiaddr 0.14.0", "multihash 0.16.3", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_yaml", @@ -2502,7 +2492,7 @@ dependencies = [ "k256 0.11.6", "once_cell", "open-fastrlp", - "rand 0.8.5", + "rand", "rlp", "rlp-derive", "serde", @@ -2524,7 +2514,6 @@ dependencies = [ "auto_impl", "base64 0.13.1", "ethers-core", - "futures-channel", "futures-core", "futures-timer", "futures-util", @@ -2540,7 +2529,6 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite 0.17.2", "tracing", "tracing-futures", "url", @@ -2611,7 +2599,7 @@ dependencies = [ "mev-rs", "parking_lot 0.12.1", "pretty_reqwest_error", - "rand 0.8.5", + "rand", "reqwest", "sensitive_url", "serde", @@ -2622,7 +2610,7 @@ dependencies = [ "ssz_types", "state_processing", "strum", - "superstruct 0.6.0", + "superstruct", "task_executor", "tempfile", "tokio", @@ -2709,9 +2697,9 @@ checksum = "ec54ac60a7f2ee9a97cad9946f9bf629a3bc6a7ae59e68983dc9318f5a54b81a" [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "field-offset" @@ -2731,6 +2719,12 @@ dependencies = [ "windows-acl", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.7.0" @@ -2738,7 +2732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2751,7 +2745,7 @@ checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "arbitrary", "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2906,7 +2900,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -2916,7 +2910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.21.6", + "rustls", ] [[package]] @@ -3014,10 +3008,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -3196,21 +3188,20 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312f66718a2d7789ffef4f4b7b213138ed9f1eb3aa1d0d82fc99f88fb3ffd26f" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ "hashbrown 0.14.0", ] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64 0.21.4", "bytes", "headers-core", "http", @@ -3462,9 +3453,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.6", + "rustls", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -3588,7 +3579,7 @@ checksum = "556b5a75cd4adb7c4ea21c64af1c48cefb2ce7d43dc4352c720a1fe47c21f355" dependencies = [ "attohttpc", "log", - "rand 0.8.5", + "rand", "url", "xmltree", ] @@ -3608,7 +3599,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", ] [[package]] @@ -3661,7 +3652,7 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.1.0", + "autocfg", "hashbrown 0.12.3", ] @@ -3731,7 +3722,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.4", "widestring 1.0.2", "windows-sys 0.48.0", "winreg", @@ -3813,7 +3804,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "pem", "ring", "serde", @@ -3873,7 +3864,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -3945,9 +3936,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libflate" @@ -4068,17 +4059,17 @@ dependencies = [ "libp2p-identity", "log", "multiaddr 0.18.0", - "multihash 0.19.0", + "multihash 0.19.1", "multistream-select", "once_cell", "parking_lot 0.12.1", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand", "rw-stream-sink", "smallvec 1.11.0", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", "void", ] @@ -4104,7 +4095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d157562dba6017193e5285acf6b1054759e83540bfd79f75b69d6ce774c88da" dependencies = [ "asynchronous-codec", - "base64 0.21.3", + "base64 0.21.4", "byteorder", "bytes", "either", @@ -4121,11 +4112,11 @@ dependencies = [ "prometheus-client", "quick-protobuf", "quick-protobuf-codec", - "rand 0.8.5", + "rand", "regex", "sha2 0.10.7", "smallvec 1.11.0", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", "void", ] @@ -4162,10 +4153,10 @@ dependencies = [ "ed25519-dalek", "libsecp256k1", "log", - "multihash 0.19.0", + "multihash 0.19.1", "p256", "quick-protobuf", - "rand 0.8.5", + "rand", "sec1 0.7.3", "sha2 0.10.7", "thiserror", @@ -4186,9 +4177,9 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "smallvec 1.11.0", - "socket2 0.5.3", + "socket2 0.5.4", "tokio", "trust-dns-proto", "void", @@ -4224,9 +4215,9 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "smallvec 1.11.0", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -4236,16 +4227,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce70757f2c0d82e9a3ef738fb10ea0723d16cec37f078f719e2c247704c1bb" dependencies = [ "bytes", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.0", "futures", "libp2p-core", "libp2p-identity", "log", "multiaddr 0.18.0", - "multihash 0.19.0", + "multihash 0.19.1", "once_cell", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "snow", "static_assertions", @@ -4267,7 +4258,7 @@ dependencies = [ "libp2p-identity", "log", "quick-protobuf", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -4286,9 +4277,9 @@ dependencies = [ "log", "parking_lot 0.12.1", "quinn", - "rand 0.8.5", - "rustls 0.21.6", - "socket2 0.5.3", + "rand", + "rustls", + "socket2 0.5.4", "thiserror", "tokio", ] @@ -4310,7 +4301,7 @@ dependencies = [ "log", "multistream-select", "once_cell", - "rand 0.8.5", + "rand", "smallvec 1.11.0", "tokio", "void", @@ -4326,7 +4317,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4342,7 +4333,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.3", + "socket2 0.5.4", "tokio", ] @@ -4358,7 +4349,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring", - "rustls 0.21.6", + "rustls", "rustls-webpki", "thiserror", "x509-parser", @@ -4391,7 +4382,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -4526,11 +4517,11 @@ dependencies = [ "prometheus-client", "quickcheck", "quickcheck_macros", - "rand 0.8.5", + "rand", "regex", "serde", "serde_derive", - "sha2 0.10.7", + "sha2 0.9.9", "slog", "slog-async", "slog-term", @@ -4538,7 +4529,7 @@ dependencies = [ "snap", "ssz_types", "strum", - "superstruct 0.5.0", + "superstruct", "task_executor", "tempfile", "tiny-keccak", @@ -4582,9 +4573,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lmdb-rkv" @@ -4613,7 +4604,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ - "autocfg 1.1.0", + "autocfg", "scopeguard", ] @@ -4771,9 +4762,9 @@ checksum = "8c408dc227d302f1496c84d9dc68c00fec6f56f9228a18f3023f976f3ca7c945" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -4781,7 +4772,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -4790,7 +4781,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -4856,7 +4847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] @@ -4872,13 +4863,13 @@ dependencies = [ [[package]] name = "milagro_bls" -version = "1.4.2" -source = "git+https://github.com/sigp/milagro_bls?tag=v1.4.2#16655aa033175a90c10ef02aa144e2835de23aec" +version = "1.5.1" +source = "git+https://github.com/sigp/milagro_bls?tag=v1.5.1#d3fc0a40cfe8b72ccda46ba050ee6786a59ce753" dependencies = [ "amcl", "hex", "lazy_static", - "rand 0.7.3", + "rand", "zeroize", ] @@ -4950,24 +4941,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" -[[package]] -name = "multer" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" -dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http", - "httparse", - "log", - "memchr", - "mime", - "spin 0.9.8", - "version_check", -] - [[package]] name = "multiaddr" version = "0.14.0" @@ -4982,7 +4955,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", "url", ] @@ -4997,11 +4970,11 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.0", + "multihash 0.19.1", "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", "url", ] @@ -5026,17 +4999,17 @@ dependencies = [ "digest 0.10.7", "multihash-derive", "sha2 0.10.7", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] name = "multihash" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -5064,7 +5037,7 @@ dependencies = [ "log", "pin-project", "smallvec 1.11.0", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -5178,9 +5151,10 @@ dependencies = [ "logging", "lru_cache", "matches", + "num_cpus", "operation_pool", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rlp", "slog", "slog-async", @@ -5224,9 +5198,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.3" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abbbc55ad7b13aac85f9401c796dcda1b864e07fcad40ad47792eaa8932ea502" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ "bitflags 2.4.0", "cfg-if", @@ -5296,25 +5270,24 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-bigint-dig" -version = "0.6.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d51546d704f52ef14b3c962b5776e53d5b862e5790e40a350d366c209bd7f7a" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ - "autocfg 0.1.8", "byteorder", "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.7.3", + "rand", "serde", "smallvec 1.11.0", "zeroize", @@ -5326,7 +5299,7 @@ version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-traits", ] @@ -5336,7 +5309,7 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ - "autocfg 1.1.0", + "autocfg", "num-integer", "num-traits", ] @@ -5347,7 +5320,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -5371,9 +5344,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -5460,7 +5433,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5471,18 +5444,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.27.0+1.1.1v" +version = "300.1.3+3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e8f197c82d7511c5b014030c9b1efeda40d7d5f99d23b4ceed3524a5e63f02" +checksum = "cd2c101a165fff9935e34def4669595ab1c7847943c42be86e21503e482be107" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.92" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -5505,7 +5478,7 @@ dependencies = [ "lighthouse_metrics", "maplit", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rayon", "serde", "serde_derive", @@ -5549,15 +5522,15 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.4", + "parity-scale-codec-derive 3.6.5", "serde", ] @@ -5575,9 +5548,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5656,15 +5629,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac 0.8.0", -] - [[package]] name = "pbkdf2" version = "0.8.0" @@ -5761,7 +5725,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5810,9 +5774,9 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "plotters" @@ -5848,7 +5812,7 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ - "autocfg 1.1.0", + "autocfg", "bitflags 1.3.2", "cfg-if", "concurrent-queue", @@ -5887,14 +5851,14 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "byteorder", "bytes", "fallible-iterator", "hmac 0.12.1", "md-5", "memchr", - "rand 0.8.5", + "rand", "sha2 0.10.7", "stringprep", ] @@ -6011,20 +5975,20 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-warning" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -6079,7 +6043,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6092,7 +6056,7 @@ dependencies = [ "serde", "serde_derive", "serde_yaml", - "superstruct 0.5.0", + "superstruct", "types", ] @@ -6146,26 +6110,25 @@ dependencies = [ "bytes", "quick-protobuf", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] name = "quickcheck" -version = "0.9.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f" +checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" dependencies = [ - "env_logger 0.7.1", + "env_logger 0.8.4", "log", - "rand 0.7.3", - "rand_core 0.5.1", + "rand", ] [[package]] name = "quickcheck_macros" -version = "0.9.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f" +checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9" dependencies = [ "proc-macro2", "quote", @@ -6184,7 +6147,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.6", + "rustls", "thiserror", "tokio", "tracing", @@ -6197,10 +6160,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" dependencies = [ "bytes", - "rand 0.8.5", + "rand", "ring", "rustc-hash", - "rustls 0.21.6", + "rustls", "slab", "thiserror", "tinyvec", @@ -6215,7 +6178,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.3", + "socket2 0.5.4", "tracing", "windows-sys 0.48.0", ] @@ -6262,19 +6225,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -6282,20 +6232,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -6324,15 +6264,6 @@ dependencies = [ "getrandom 0.2.10", ] -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - [[package]] name = "rand_xorshift" version = "0.3.0" @@ -6407,13 +6338,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.7", + "regex-automata 0.3.8", "regex-syntax 0.7.5", ] @@ -6428,9 +6359,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", @@ -6455,7 +6386,7 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -6474,14 +6405,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.6", + "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util 0.7.8", "tower-service", "url", @@ -6489,7 +6420,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots", "winreg", ] @@ -6533,7 +6464,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", + "spin", "untrusted", "web-sys", "winapi", @@ -6600,7 +6531,7 @@ dependencies = [ "bitflags 1.3.2", "fallible-iterator", "fallible-streaming-iterator", - "hashlink 0.8.3", + "hashlink 0.8.4", "libsqlite3-sys", "smallvec 1.11.0", ] @@ -6671,34 +6602,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.9" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.7", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls" -version = "0.21.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -6712,14 +6631,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" dependencies = [ "ring", "untrusted", @@ -6778,7 +6697,7 @@ checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "cfg-if", "derive_more", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info-derive", ] @@ -6968,14 +6887,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -7000,7 +6919,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -7058,17 +6977,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha1" version = "0.10.5" @@ -7137,9 +7045,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -7212,7 +7120,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -7234,7 +7142,7 @@ dependencies = [ "lru 0.7.8", "maplit", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rayon", "safe_arith", "serde", @@ -7423,7 +7331,7 @@ dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.0", "rand_core 0.6.4", "ring", "rustc_version", @@ -7443,9 +7351,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -7457,12 +7365,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.6.0" @@ -7598,10 +7500,11 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] @@ -7646,20 +7549,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "superstruct" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a99807a055ff4ff5d249bb84c80d9eabb55ca3c452187daae43fd5b51ef695" -dependencies = [ - "darling", - "itertools", - "proc-macro2", - "quote", - "smallvec 1.11.0", - "syn 1.0.109", -] - [[package]] name = "superstruct" version = "0.6.0" @@ -7696,9 +7585,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -7819,7 +7708,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.9", + "rustix 0.38.13", "windows-sys 0.48.0", ] @@ -7869,7 +7758,7 @@ dependencies = [ "hex", "hmac 0.12.1", "log", - "rand 0.8.5", + "rand", "serde", "serde_json", "sha2 0.10.7", @@ -7886,22 +7775,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -7966,17 +7855,17 @@ dependencies = [ [[package]] name = "tiny-bip39" -version = "0.8.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" dependencies = [ "anyhow", - "hmac 0.8.1", + "hmac 0.12.1", "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", + "pbkdf2 0.11.0", + "rand", "rustc-hash", - "sha2 0.9.9", + "sha2 0.10.7", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -8031,7 +7920,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -8054,7 +7943,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -8086,31 +7975,20 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "rand 0.8.5", - "socket2 0.5.3", + "rand", + "socket2 0.5.4", "tokio", "tokio-util 0.7.8", "whoami", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.8", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls", "tokio", ] @@ -8126,34 +8004,6 @@ dependencies = [ "tokio-util 0.7.8", ] -[[package]] -name = "tokio-tungstenite" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" -dependencies = [ - "futures-util", - "log", - "rustls 0.20.8", - "tokio", - "tokio-rustls 0.23.4", - "tungstenite 0.17.3", - "webpki", - "webpki-roots 0.22.6", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.18.0", -] - [[package]] name = "tokio-util" version = "0.6.10" @@ -8196,9 +8046,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -8217,9 +8067,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "serde", @@ -8277,7 +8127,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -8396,7 +8246,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec 1.11.0", "socket2 0.4.9", "thiserror", @@ -8432,51 +8282,11 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "tungstenite" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.20.8", - "sha-1", - "thiserror", - "url", - "utf-8", - "webpki", -] - -[[package]] -name = "tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand 0.8.5", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types" @@ -8506,7 +8316,7 @@ dependencies = [ "metastruct", "parking_lot 0.12.1", "paste", - "rand 0.8.5", + "rand", "rand_xorshift", "rayon", "regex", @@ -8522,7 +8332,7 @@ dependencies = [ "ssz_types", "state_processing", "strum", - "superstruct 0.6.0", + "superstruct", "swap_or_not_shuffle", "tempfile", "test_random_derive", @@ -8567,9 +8377,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -8614,9 +8424,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", @@ -8639,21 +8449,15 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna 0.4.0", "percent-encoding", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "uuid" version = "0.8.2" @@ -8695,7 +8499,7 @@ dependencies = [ "malloc_utils", "monitoring_api", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "reqwest", "ring", "safe_arith", @@ -8732,7 +8536,7 @@ dependencies = [ "filesystem", "hex", "lockfile", - "rand 0.8.5", + "rand", "tempfile", "tree_hash", "types", @@ -8801,9 +8605,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -8821,7 +8625,7 @@ dependencies = [ [[package]] name = "warp" version = "0.3.5" -source = "git+https://github.com/seanmonstar/warp.git?rev=149913fe#149913fed948bbe2149b52b9016170bcaef950ab" +source = "git+https://github.com/seanmonstar/warp.git#5ad8a9cb155f6485d13d591a564d8c70053a388a" dependencies = [ "bytes", "futures-channel", @@ -8832,7 +8636,6 @@ dependencies = [ "log", "mime", "mime_guess", - "multer", "percent-encoding", "pin-project", "rustls-pemfile", @@ -8841,9 +8644,8 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tokio-stream", - "tokio-tungstenite 0.18.0", "tokio-util 0.7.8", "tower-service", "tracing", @@ -8900,7 +8702,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -8934,7 +8736,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8994,7 +8796,7 @@ dependencies = [ "logging", "network", "r2d2", - "rand 0.7.3", + "rand", "reqwest", "serde", "serde_json", @@ -9032,7 +8834,6 @@ dependencies = [ "parking_lot 0.12.1", "reqwest", "serde", - "serde_derive", "serde_json", "serde_yaml", "slot_clock", @@ -9045,25 +8846,6 @@ dependencies = [ "zip", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - [[package]] name = "webpki-roots" version = "0.25.2" @@ -9408,9 +9190,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" +checksum = "bab77e97b50aee93da431f2cee7cd0f43b4d1da3c408042f2d7d164187774f0a" [[package]] name = "xmltree" @@ -9441,7 +9223,7 @@ dependencies = [ "nohash-hasher", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "static_assertions", ] @@ -9471,7 +9253,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9930658e652..62c0e7bd20a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,10 +89,138 @@ members = [ ] resolver = "2" -[patch] -[patch.crates-io] -# TODO: remove when 0.3.6 get's released. -warp = { git = "https://github.com/seanmonstar/warp.git", rev="149913fe" } +[workspace.package] +edition = "2021" + +[workspace.dependencies] +arbitrary = { version = "1", features = ["derive"] } +bincode = "1" +bitvec = "1" +byteorder = "1" +bytes = "1" +clap = "2" +compare_fields_derive = { path = "common/compare_fields_derive" } +criterion = "0.3" +delay_map = "0.3" +derivative = "2" +dirs = "3" +discv5 = { version = "0.3", features = ["libp2p"] } +env_logger = "0.9" +error-chain = "0.12" +ethereum-types = "0.14" +ethereum_hashing = "1.0.0-beta.2" +ethereum_serde_utils = "0.5" +ethereum_ssz = "0.5" +ethereum_ssz_derive = "0.5" +ethers-core = "1" +ethers-providers = { version = "1", default-features = false } +exit-future = "0.2" +fnv = "1" +fs2 = "0.4" +futures = "0.3" +hex = "0.4" +hyper = "0.14" +itertools = "0.10" +lazy_static = "1" +libsecp256k1 = "0.7" +log = "0.4" +lru = "0.7" +maplit = "1" +num_cpus = "1" +parking_lot = "0.12" +paste = "1" +quickcheck = "1" +quickcheck_macros = "1" +quote = "1" +r2d2 = "0.8" +rand = "0.8" +rayon = "1.7" +regex = "1" +reqwest = { version = "0.11", default-features = false, features = ["blocking", "json", "stream", "rustls-tls"] } +ring = "0.16" +rusqlite = { version = "0.28", features = ["bundled"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +serde_repr = "0.1" +serde_yaml = "0.8" +sha2 = "0.9" +slog = { version = "2", features = ["max_level_trace", "release_max_level_trace"] } +slog-async = "2" +slog-term = "2" +sloggers = { version = "2", features = ["json"] } +smallvec = "1" +snap = "1" +ssz_types = "0.5" +strum = { version = "0.24", features = ["derive"] } +superstruct = "0.6" +syn = "1" +sysinfo = "0.26" +tempfile = "3" +tokio = { version = "1", features = ["rt-multi-thread", "sync"] } +tokio-stream = { version = "0.1", features = ["sync"] } +tokio-util = { version = "0.6", features = ["codec", "compat", "time"] } +tree_hash = "0.5" +tree_hash_derive = "0.5" +url = "2" +uuid = { version = "0.8", features = ["serde", "v4"] } +# TODO update to warp 0.3.6 after released. +warp = { git = "https://github.com/seanmonstar/warp.git", default-features = false, features = ["tls"] } +zeroize = { version = "1", features = ["zeroize_derive"] } +zip = "0.6" + +# Local crates. +account_utils = { path = "common/account_utils" } +beacon_chain = { path = "beacon_node/beacon_chain" } +beacon_node = { path = "beacon_node" } +beacon_processor = { path = "beacon_node/beacon_processor" } +bls = { path = "crypto/bls" } +cached_tree_hash = { path = "consensus/cached_tree_hash" } +clap_utils = { path = "common/clap_utils" } +compare_fields = { path = "common/compare_fields" } +deposit_contract = { path = "common/deposit_contract" } +directory = { path = "common/directory" } +environment = { path = "lighthouse/environment" } +eth1 = { path = "beacon_node/eth1" } +eth1_test_rig = { path = "testing/eth1_test_rig" } +eth2 = { path = "common/eth2" } +eth2_config = { path = "common/eth2_config" } +eth2_key_derivation = { path = "crypto/eth2_key_derivation" } +eth2_keystore = { path = "crypto/eth2_keystore" } +eth2_network_config = { path = "common/eth2_network_config" } +eth2_wallet = { path = "crypto/eth2_wallet" } +execution_layer = { path = "beacon_node/execution_layer" } +filesystem = { path = "common/filesystem" } +fork_choice = { path = "consensus/fork_choice" } +genesis = { path = "beacon_node/genesis" } +http_api = { path = "beacon_node/http_api" } +int_to_bytes = { path = "consensus/int_to_bytes" } +lighthouse_metrics = { path = "common/lighthouse_metrics" } +lighthouse_network = { path = "beacon_node/lighthouse_network" } +lighthouse_version = { path = "common/lighthouse_version" } +lockfile = { path = "common/lockfile" } +logging = { path = "common/logging" } +lru_cache = { path = "common/lru_cache" } +malloc_utils = { path = "common/malloc_utils" } +merkle_proof = { path = "consensus/merkle_proof" } +monitoring_api = { path = "common/monitoring_api" } +network = { path = "beacon_node/network" } +operation_pool = { path = "beacon_node/operation_pool" } +pretty_reqwest_error = { path = "common/pretty_reqwest_error" } +proto_array = { path = "consensus/proto_array" } +safe_arith = {path = "consensus/safe_arith"} +sensitive_url = { path = "common/sensitive_url" } +slasher = { path = "slasher" } +slashing_protection = { path = "validator_client/slashing_protection" } +slot_clock = { path = "common/slot_clock" } +state_processing = { path = "consensus/state_processing" } +store = { path = "beacon_node/store" } +swap_or_not_shuffle = { path = "consensus/swap_or_not_shuffle" } +task_executor = { path = "common/task_executor" } +types = { path = "consensus/types" } +unused_port = { path = "common/unused_port" } +validator_client = { path = "validator_client/" } +validator_dir = { path = "common/validator_dir" } +warp_utils = { path = "common/warp_utils" } [profile.maxperf] inherits = "release" diff --git a/Makefile b/Makefile index 1e99b3dbb33..7bed5732b6a 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,7 @@ arbitrary-fuzz: # Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database) audit: cargo install --force cargo-audit - cargo audit --ignore RUSTSEC-2023-0052 + cargo audit # Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose. vendor: diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index 238e4a77e08..0fab7b31fe3 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -5,31 +5,31 @@ authors = [ "Paul Hauner ", "Luke Anderson ", ] -edition = "2021" +edition = { workspace = true } [dependencies] -bls = { path = "../crypto/bls" } -clap = "2.33.3" -types = { path = "../consensus/types" } -environment = { path = "../lighthouse/environment" } -eth2_network_config = { path = "../common/eth2_network_config" } -clap_utils = { path = "../common/clap_utils" } -directory = { path = "../common/directory" } -eth2_wallet = { path = "../crypto/eth2_wallet" } +bls = { workspace = true } +clap = { workspace = true } +types = { workspace = true } +environment = { workspace = true } +eth2_network_config = { workspace = true } +clap_utils = { workspace = true } +directory = { workspace = true } +eth2_wallet = { workspace = true } eth2_wallet_manager = { path = "../common/eth2_wallet_manager" } -validator_dir = { path = "../common/validator_dir" } -tokio = { version = "1.14.0", features = ["full"] } -eth2_keystore = { path = "../crypto/eth2_keystore" } -account_utils = { path = "../common/account_utils" } -slashing_protection = { path = "../validator_client/slashing_protection" } -eth2 = { path = "../common/eth2" } -safe_arith = { path = "../consensus/safe_arith" } -slot_clock = { path = "../common/slot_clock" } -filesystem = { path = "../common/filesystem" } -sensitive_url = { path = "../common/sensitive_url" } -serde = { version = "1.0.116", features = ["derive"] } -serde_json = "1.0.58" -slog = { version = "2.5.2" } +validator_dir = { workspace = true } +tokio = { workspace = true } +eth2_keystore = { workspace = true } +account_utils = { workspace = true } +slashing_protection = { workspace = true } +eth2 = { workspace = true } +safe_arith = { workspace = true } +slot_clock = { workspace = true } +filesystem = { workspace = true } +sensitive_url = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +slog = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" +tempfile = { workspace = true } diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index 3f4c93fa4df..14424aaf4ad 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Paul Hauner ", "Age Manning ", "Age Manning "] -edition = "2021" +edition = { workspace = true } autotests = false # using a single test binary compiles faster [features] @@ -12,60 +12,59 @@ participation_metrics = [] # Exposes validator participation metrics to Prometh fork_from_env = [] # Initialise the harness chain spec from the FORK_NAME env variable [dev-dependencies] -maplit = "1.0.2" -environment = { path = "../../lighthouse/environment" } -serde_json = "1.0.58" +maplit = { workspace = true } +environment = { workspace = true } +serde_json = { workspace = true } [dependencies] -merkle_proof = { path = "../../consensus/merkle_proof" } -store = { path = "../store" } -parking_lot = "0.12.0" -lazy_static = "1.4.0" -smallvec = "1.6.1" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -operation_pool = { path = "../operation_pool" } -rayon = "1.4.1" -serde = "1.0.116" -serde_derive = "1.0.116" -ethereum_serde_utils = "0.5.0" -slog = { version = "2.5.2", features = ["max_level_trace"] } -sloggers = { version = "2.1.1", features = ["json"] } -slot_clock = { path = "../../common/slot_clock" } -ethereum_hashing = "1.0.0-beta.2" -ethereum_ssz = "0.5.0" -ssz_types = "0.5.3" -ethereum_ssz_derive = "0.5.0" -state_processing = { path = "../../consensus/state_processing" } -tree_hash_derive = "0.5.0" -tree_hash = "0.5.0" -types = { path = "../../consensus/types" } -tokio = "1.14.0" -tokio-stream = "0.1.3" -eth1 = { path = "../eth1" } -futures = "0.3.7" -genesis = { path = "../genesis" } -int_to_bytes = { path = "../../consensus/int_to_bytes" } -rand = "0.8.5" -proto_array = { path = "../../consensus/proto_array" } -lru = "0.7.1" -tempfile = "3.1.0" -bitvec = "0.20.4" -bls = { path = "../../crypto/bls" } -safe_arith = { path = "../../consensus/safe_arith" } -fork_choice = { path = "../../consensus/fork_choice" } -task_executor = { path = "../../common/task_executor" } -derivative = "2.1.1" -itertools = "0.10.0" -slasher = { path = "../../slasher" } -eth2 = { path = "../../common/eth2" } -strum = { version = "0.24.0", features = ["derive"] } -logging = { path = "../../common/logging" } -execution_layer = { path = "../execution_layer" } -sensitive_url = { path = "../../common/sensitive_url" } -superstruct = "0.5.0" -hex = "0.4.2" -exit-future = "0.2.0" -oneshot_broadcast = { path = "../../common/oneshot_broadcast" } +merkle_proof = { workspace = true } +store = { workspace = true } +parking_lot = { workspace = true } +lazy_static = { workspace = true } +smallvec = { workspace = true } +lighthouse_metrics = { workspace = true } +operation_pool = { workspace = true } +rayon = { workspace = true } +serde = { workspace = true } +ethereum_serde_utils = { workspace = true } +slog = { workspace = true } +sloggers = { workspace = true } +slot_clock = { workspace = true } +ethereum_hashing = { workspace = true } +ethereum_ssz = { workspace = true } +ssz_types = { workspace = true } +ethereum_ssz_derive = { workspace = true } +state_processing = { workspace = true } +tree_hash_derive = { workspace = true } +tree_hash = { workspace = true } +types = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +eth1 = { workspace = true } +futures = { workspace = true } +genesis = { workspace = true } +int_to_bytes = { workspace = true } +rand = { workspace = true } +proto_array = { workspace = true } +lru = { workspace = true } +tempfile = { workspace = true } +bitvec = { workspace = true } +bls = { workspace = true } +safe_arith = { workspace = true } +fork_choice = { workspace = true } +task_executor = { workspace = true } +derivative = { workspace = true } +itertools = { workspace = true } +slasher = { workspace = true } +eth2 = { workspace = true } +strum = { workspace = true } +logging = { workspace = true } +execution_layer = { workspace = true } +sensitive_url = { workspace = true } +superstruct = { workspace = true } +hex = { workspace = true } +exit-future = { workspace = true } +oneshot_broadcast = { path = "../../common/oneshot_broadcast/" } [[test]] name = "beacon_chain_tests" diff --git a/beacon_node/beacon_chain/src/beacon_snapshot.rs b/beacon_node/beacon_chain/src/beacon_snapshot.rs index 7d89df98293..afb13247766 100644 --- a/beacon_node/beacon_chain/src/beacon_snapshot.rs +++ b/beacon_node/beacon_chain/src/beacon_snapshot.rs @@ -1,4 +1,4 @@ -use serde_derive::Serialize; +use serde::Serialize; use std::sync::Arc; use types::{ beacon_state::CloneConfig, AbstractExecPayload, BeaconState, EthSpec, FullPayload, Hash256, diff --git a/beacon_node/beacon_chain/src/chain_config.rs b/beacon_node/beacon_chain/src/chain_config.rs index d1bddcf736a..bccc3732c3d 100644 --- a/beacon_node/beacon_chain/src/chain_config.rs +++ b/beacon_node/beacon_chain/src/chain_config.rs @@ -1,5 +1,5 @@ pub use proto_array::{DisallowedReOrgOffsets, ReOrgThreshold}; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use std::time::Duration; use types::{Checkpoint, Epoch, ProgressiveBalancesMode}; diff --git a/beacon_node/beacon_processor/Cargo.toml b/beacon_node/beacon_processor/Cargo.toml index c626441bb71..723b09b581c 100644 --- a/beacon_node/beacon_processor/Cargo.toml +++ b/beacon_node/beacon_processor/Cargo.toml @@ -1,26 +1,26 @@ [package] name = "beacon_processor" version = "0.1.0" -edition = "2021" +edition = { workspace = true } [dependencies] -slog = { version = "2.5.2", features = ["max_level_trace"] } -itertools = "0.10.0" -logging = { path = "../../common/logging" } -tokio = { version = "1.14.0", features = ["full"] } -tokio-util = { version = "0.6.3", features = ["time"] } -futures = "0.3.7" -fnv = "1.0.7" -strum = "0.24.0" -task_executor = { path = "../../common/task_executor" } -slot_clock = { path = "../../common/slot_clock" } -lighthouse_network = { path = "../lighthouse_network" } -hex = "0.4.2" -derivative = "2.2.0" -types = { path = "../../consensus/types" } -ethereum_ssz = "0.5.0" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -parking_lot = "0.12.0" -num_cpus = "1.13.0" -serde = { version = "1.0.116", features = ["derive"] } \ No newline at end of file +slog = { workspace = true } +itertools = { workspace = true } +logging = { workspace = true } +tokio = { workspace = true } +tokio-util = { workspace = true } +futures = { workspace = true } +fnv = { workspace = true } +strum = { workspace = true } +task_executor = { workspace = true } +slot_clock = { workspace = true } +lighthouse_network = { workspace = true } +hex = { workspace = true } +derivative = { workspace = true } +types = { workspace = true } +ethereum_ssz = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +parking_lot = { workspace = true } +num_cpus = { workspace = true } +serde = { workspace = true } \ No newline at end of file diff --git a/beacon_node/builder_client/Cargo.toml b/beacon_node/builder_client/Cargo.toml index b79fc5e4073..21b9b841334 100644 --- a/beacon_node/builder_client/Cargo.toml +++ b/beacon_node/builder_client/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "builder_client" version = "0.1.0" -edition = "2021" +edition = { workspace = true } authors = ["Sean Anderson "] [dependencies] -reqwest = { version = "0.11.0", features = ["json","stream"] } -sensitive_url = { path = "../../common/sensitive_url" } -eth2 = { path = "../../common/eth2" } -serde = { version = "1.0.116", features = ["derive"] } -serde_json = "1.0.58" -lighthouse_version = { path = "../../common/lighthouse_version" } +reqwest = { workspace = true } +sensitive_url = { workspace = true } +eth2 = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +lighthouse_version = { workspace = true } diff --git a/beacon_node/client/Cargo.toml b/beacon_node/client/Cargo.toml index 87e16509026..b60748e30c6 100644 --- a/beacon_node/client/Cargo.toml +++ b/beacon_node/client/Cargo.toml @@ -2,45 +2,46 @@ name = "client" version = "0.2.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -serde_yaml = "0.8.13" -operation_pool = { path = "../operation_pool" } -tokio = "1.14.0" +serde_yaml = { workspace = true } +state_processing = { workspace = true } +operation_pool = { workspace = true } +tokio = { workspace = true } [dependencies] -state_processing = { path = "../../consensus/state_processing" } -beacon_chain = { path = "../beacon_chain" } -store = { path = "../store" } -network = { path = "../network" } +beacon_chain = { workspace = true } +store = { workspace = true } +network = { workspace = true } timer = { path = "../timer" } -lighthouse_network = { path = "../lighthouse_network" } -logging = { path = "../../common/logging" } -parking_lot = "0.12.0" -types = { path = "../../consensus/types" } -eth2_config = { path = "../../common/eth2_config" } -slot_clock = { path = "../../common/slot_clock" } -serde = "1.0.116" +lighthouse_network = { workspace = true } +logging = { workspace = true } +parking_lot = { workspace = true } +types = { workspace = true } +eth2_config = { workspace = true } +slot_clock = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -error-chain = "0.12.4" -slog = { version = "2.5.2", features = ["max_level_trace"] } -tokio = "1.14.0" -dirs = "3.0.1" -eth1 = { path = "../eth1" } -eth2 = { path = "../../common/eth2" } -sensitive_url = { path = "../../common/sensitive_url" } -genesis = { path = "../genesis" } -task_executor = { path = "../../common/task_executor" } -environment = { path = "../../lighthouse/environment" } -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } +error-chain = { workspace = true } +slog = { workspace = true } +tokio = { workspace = true } +dirs = { workspace = true } +eth1 = { workspace = true } +eth2 = { workspace = true } +sensitive_url = { workspace = true } +genesis = { workspace = true } +task_executor = { workspace = true } +environment = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } time = "0.3.5" -directory = {path = "../../common/directory"} -http_api = { path = "../http_api" } +directory = { workspace = true } +http_api = { workspace = true } http_metrics = { path = "../http_metrics" } -slasher = { path = "../../slasher" } +slasher = { workspace = true } slasher_service = { path = "../../slasher/service" } -monitoring_api = {path = "../../common/monitoring_api"} -execution_layer = { path = "../execution_layer" } -beacon_processor = { path = "../beacon_processor" } +monitoring_api = { workspace = true } +execution_layer = { workspace = true } +beacon_processor = { workspace = true } +num_cpus = { workspace = true } diff --git a/beacon_node/eth1/Cargo.toml b/beacon_node/eth1/Cargo.toml index cc982aee089..2f716cd19bc 100644 --- a/beacon_node/eth1/Cargo.toml +++ b/beacon_node/eth1/Cargo.toml @@ -2,33 +2,33 @@ name = "eth1" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -eth1_test_rig = { path = "../../testing/eth1_test_rig" } -serde_yaml = "0.8.13" -sloggers = { version = "2.1.1", features = ["json"] } -environment = { path = "../../lighthouse/environment" } +eth1_test_rig = { workspace = true } +serde_yaml = { workspace = true } +sloggers = { workspace = true } +environment = { workspace = true } [dependencies] -reqwest = { version = "0.11.0", features = ["native-tls-vendored"] } -execution_layer = { path = "../execution_layer" } -futures = "0.3.7" -serde_json = "1.0.58" -serde = { version = "1.0.116", features = ["derive"] } -hex = "0.4.2" -types = { path = "../../consensus/types"} -merkle_proof = { path = "../../consensus/merkle_proof"} -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -tree_hash = "0.5.0" -parking_lot = "0.12.0" -slog = "2.5.2" -superstruct = "0.5.0" -tokio = { version = "1.14.0", features = ["full"] } -state_processing = { path = "../../consensus/state_processing" } -lighthouse_metrics = { path = "../../common/lighthouse_metrics"} -lazy_static = "1.4.0" -task_executor = { path = "../../common/task_executor" } -eth2 = { path = "../../common/eth2" } -sensitive_url = { path = "../../common/sensitive_url" } +reqwest = { workspace = true } +execution_layer = { workspace = true } +futures = { workspace = true } +serde_json = { workspace = true } +serde = { workspace = true } +hex = { workspace = true } +types = { workspace = true } +merkle_proof = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +tree_hash = { workspace = true } +parking_lot = { workspace = true } +slog = { workspace = true } +superstruct = { workspace = true } +tokio = { workspace = true } +state_processing = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +task_executor = { workspace = true } +eth2 = { workspace = true } +sensitive_url = { workspace = true } diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index 80b4c069286..3651e371883 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -1,56 +1,56 @@ [package] name = "execution_layer" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -types = { path = "../../consensus/types"} -tokio = { version = "1.10.0", features = ["full"] } +types = { workspace = true } +tokio = { workspace = true } async-trait = "0.1.51" -slog = "2.5.2" -futures = "0.3.7" -sensitive_url = { path = "../../common/sensitive_url" } -reqwest = { version = "0.11.0", features = ["json","stream"] } -ethereum_serde_utils = "0.5.0" -serde_json = "1.0.58" -serde = { version = "1.0.116", features = ["derive"] } -warp = { version = "0.3.2", features = ["tls"] } +slog = { workspace = true } +futures = { workspace = true } +sensitive_url = { workspace = true } +reqwest = { workspace = true } +ethereum_serde_utils = { workspace = true } +serde_json = { workspace = true } +serde = { workspace = true } +warp = { workspace = true } jsonwebtoken = "8" -environment = { path = "../../lighthouse/environment" } -bytes = "1.1.0" -task_executor = { path = "../../common/task_executor" } -hex = "0.4.2" -ethereum_ssz = "0.5.0" -ssz_types = "0.5.3" -eth2 = { path = "../../common/eth2" } -state_processing = { path = "../../consensus/state_processing" } -superstruct = "0.6.0" -lru = "0.7.1" -exit-future = "0.2.0" -tree_hash = "0.5.0" -tree_hash_derive = "0.5.0" -parking_lot = "0.12.0" -slot_clock = { path = "../../common/slot_clock" } -tempfile = "3.1.0" -rand = "0.8.5" -zeroize = { version = "1.4.2", features = ["zeroize_derive"] } -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -lazy_static = "1.4.0" -ethers-core = "1.0.2" +environment = { workspace = true } +bytes = { workspace = true } +task_executor = { workspace = true } +hex = { workspace = true } +ethereum_ssz = { workspace = true } +ssz_types = { workspace = true } +eth2 = { workspace = true } +state_processing = { workspace = true } +superstruct = { workspace = true } +lru = { workspace = true } +exit-future = { workspace = true } +tree_hash = { workspace = true } +tree_hash_derive = { workspace = true } +parking_lot = { workspace = true } +slot_clock = { workspace = true } +tempfile = { workspace = true } +rand = { workspace = true } +zeroize = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +ethers-core = { workspace = true } builder_client = { path = "../builder_client" } -fork_choice = { path = "../../consensus/fork_choice" } +fork_choice = { workspace = true } mev-rs = { git = "https://github.com/ralexstokes/mev-rs", rev = "216657016d5c0889b505857c89ae42c7aa2764af" } axum = "0.6" hyper = "0.14" ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e380108" } ssz_rs = "0.9.0" -tokio-stream = { version = "0.1.9", features = [ "sync" ] } -strum = "0.24.0" +tokio-stream = { workspace = true } +strum = { workspace = true } keccak-hash = "0.10.0" hash256-std-hasher = "0.15.2" triehash = "0.8.4" hash-db = "0.15.2" -pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" } +pretty_reqwest_error = { workspace = true } arc-swap = "1.6.0" diff --git a/beacon_node/genesis/Cargo.toml b/beacon_node/genesis/Cargo.toml index 8a7d224963e..b01e6a6aea7 100644 --- a/beacon_node/genesis/Cargo.toml +++ b/beacon_node/genesis/Cargo.toml @@ -2,23 +2,23 @@ name = "genesis" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -eth1_test_rig = { path = "../../testing/eth1_test_rig" } -sensitive_url = { path = "../../common/sensitive_url" } +eth1_test_rig = { workspace = true } +sensitive_url = { workspace = true } [dependencies] -futures = "0.3.7" -types = { path = "../../consensus/types"} -environment = { path = "../../lighthouse/environment"} -eth1 = { path = "../eth1"} -rayon = "1.4.1" -state_processing = { path = "../../consensus/state_processing" } -merkle_proof = { path = "../../consensus/merkle_proof" } -ethereum_ssz = "0.5.0" -ethereum_hashing = "1.0.0-beta.2" -tree_hash = "0.5.0" -tokio = { version = "1.14.0", features = ["full"] } -slog = "2.5.2" -int_to_bytes = { path = "../../consensus/int_to_bytes" } +futures = { workspace = true } +types = { workspace = true } +environment = { workspace = true } +eth1 = { workspace = true } +rayon = { workspace = true } +state_processing = { workspace = true } +merkle_proof = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_hashing = { workspace = true } +tree_hash = { workspace = true } +tokio = { workspace = true } +slog = { workspace = true } +int_to_bytes = { workspace = true } diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index cac2f854954..b58e0442f7c 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -2,53 +2,53 @@ name = "http_api" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } autotests = false # using a single test binary compiles faster [dependencies] -warp = { version = "0.3.2", features = ["tls"] } -serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "1.14.0", features = ["macros", "sync"] } -tokio-stream = { version = "0.1.3", features = ["sync"] } -types = { path = "../../consensus/types" } -hex = "0.4.2" -beacon_chain = { path = "../beacon_chain" } -eth2 = { path = "../../common/eth2", features = ["lighthouse"] } -slog = "2.5.2" -network = { path = "../network" } -lighthouse_network = { path = "../lighthouse_network" } -eth1 = { path = "../eth1" } -state_processing = { path = "../../consensus/state_processing" } -lighthouse_version = { path = "../../common/lighthouse_version" } -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -lazy_static = "1.4.0" -warp_utils = { path = "../../common/warp_utils" } -slot_clock = { path = "../../common/slot_clock" } -ethereum_ssz = "0.5.0" +warp = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +types = { workspace = true } +hex = { workspace = true } +beacon_chain = { workspace = true } +eth2 = { workspace = true } +slog = { workspace = true } +network = { workspace = true } +lighthouse_network = { workspace = true } +eth1 = { workspace = true } +state_processing = { workspace = true } +lighthouse_version = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +warp_utils = { workspace = true } +slot_clock = { workspace = true } +ethereum_ssz = { workspace = true } bs58 = "0.4.0" -futures = "0.3.8" -execution_layer = { path = "../execution_layer" } -parking_lot = "0.12.0" -safe_arith = { path = "../../consensus/safe_arith" } -task_executor = { path = "../../common/task_executor" } -lru = "0.7.7" -tree_hash = "0.5.0" -sysinfo = "0.26.5" +futures = { workspace = true } +execution_layer = { workspace = true } +parking_lot = { workspace = true } +safe_arith = { workspace = true } +task_executor = { workspace = true } +lru = { workspace = true } +tree_hash = { workspace = true } +sysinfo = { workspace = true } system_health = { path = "../../common/system_health" } -directory = { path = "../../common/directory" } -logging = { path = "../../common/logging" } -ethereum_serde_utils = "0.5.0" -operation_pool = { path = "../operation_pool" } -sensitive_url = { path = "../../common/sensitive_url" } -store = { path = "../store" } -bytes = "1.1.0" -beacon_processor = { path = "../beacon_processor" } +directory = { workspace = true } +logging = { workspace = true } +ethereum_serde_utils = { workspace = true } +operation_pool = { workspace = true } +sensitive_url = { workspace = true } +store = { workspace = true } +bytes = { workspace = true } +beacon_processor = { workspace = true } [dev-dependencies] -environment = { path = "../../lighthouse/environment" } -serde_json = "1.0.58" -proto_array = { path = "../../consensus/proto_array" } -genesis = { path = "../genesis" } +environment = { workspace = true } +serde_json = { workspace = true } +proto_array = { workspace = true } +genesis = { workspace = true } [[test]] name = "bn_http_api_tests" diff --git a/beacon_node/http_metrics/Cargo.toml b/beacon_node/http_metrics/Cargo.toml index c98f2cb8563..f8c93ad8fc1 100644 --- a/beacon_node/http_metrics/Cargo.toml +++ b/beacon_node/http_metrics/Cargo.toml @@ -2,25 +2,25 @@ name = "http_metrics" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -warp = "0.3.2" -serde = { version = "1.0.116", features = ["derive"] } -slog = "2.5.2" -beacon_chain = { path = "../beacon_chain" } -store = { path = "../store" } -lighthouse_network = { path = "../lighthouse_network" } -slot_clock = { path = "../../common/slot_clock" } -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -lighthouse_version = { path = "../../common/lighthouse_version" } -warp_utils = { path = "../../common/warp_utils" } -malloc_utils = { path = "../../common/malloc_utils" } +warp = { workspace = true } +serde = { workspace = true } +slog = { workspace = true } +beacon_chain = { workspace = true } +store = { workspace = true } +lighthouse_network = { workspace = true } +slot_clock = { workspace = true } +lighthouse_metrics = { workspace = true } +lighthouse_version = { workspace = true } +warp_utils = { workspace = true } +malloc_utils = { workspace = true } [dev-dependencies] -tokio = { version = "1.14.0", features = ["sync"] } -reqwest = { version = "0.11.0", features = ["json"] } -environment = { path = "../../lighthouse/environment" } -types = { path = "../../consensus/types" } +tokio = { workspace = true } +reqwest = { workspace = true } +environment = { workspace = true } +types = { workspace = true } diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index 3e399f74800..07674fb6dd2 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -2,47 +2,47 @@ name = "lighthouse_network" version = "0.2.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dependencies] -discv5 = { version = "0.3.1", features = ["libp2p"] } -unsigned-varint = { version = "0.6.0", features = ["codec"] } -types = { path = "../../consensus/types" } -ssz_types = "0.5.3" -serde = { version = "1.0.116", features = ["derive"] } -serde_derive = "1.0.116" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -tree_hash = "0.5.0" -tree_hash_derive = "0.5.0" -slog = { version = "2.5.2", features = ["max_level_trace"] } -lighthouse_version = { path = "../../common/lighthouse_version" } -tokio = { version = "1.14.0", features = ["time", "macros"] } -futures = "0.3.7" -error-chain = "0.12.4" -dirs = "3.0.1" -fnv = "1.0.7" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -smallvec = "1.6.1" -tokio-io-timeout = "1.1.1" -lru = "0.7.1" -lru_cache = { path = "../../common/lru_cache" } -parking_lot = "0.12.0" -sha2 = "0.10" -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.8.5" -directory = { path = "../../common/directory" } -regex = "1.5.5" -strum = { version = "0.24.0", features = ["derive"] } -superstruct = "0.5.0" +discv5 = { workspace = true } +unsigned-varint = { version = "0.6", features = ["codec"] } +ssz_types = { workspace = true } +types = { workspace = true } +serde = { workspace = true } +serde_derive = "1" +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +tree_hash = { workspace = true } +tree_hash_derive = { workspace = true } +slog = { workspace = true } +lighthouse_version = { workspace = true } +tokio = { workspace = true } +futures = { workspace = true } +error-chain = { workspace = true } +dirs = { workspace = true } +fnv = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +smallvec = { workspace = true } +tokio-io-timeout = "1" +lru = { workspace = true } +lru_cache = { workspace = true } +parking_lot = { workspace = true } +sha2 = { workspace = true } +snap = { workspace = true } +hex = { workspace = true } +tokio-util = { workspace = true } +tiny-keccak = "2" +task_executor = { workspace = true } +rand = { workspace = true } +directory = { workspace = true } +regex = { workspace = true } +strum = { workspace = true } +superstruct = { workspace = true } prometheus-client = "0.21.0" -unused_port = { path = "../../common/unused_port" } -delay_map = "0.3.0" +unused_port = { workspace = true } +delay_map = { workspace = true } void = "1" libp2p-quic= { version = "0.9.2", features=["tokio"]} libp2p-mplex = "0.40.0" @@ -53,10 +53,13 @@ default-features = false features = ["identify", "yamux", "noise", "gossipsub", "dns", "tcp", "tokio", "plaintext", "secp256k1", "macros", "ecdsa"] [dev-dependencies] -slog-term = "2.6.0" -slog-async = "2.5.0" -tempfile = "3.1.0" -exit-future = "0.2.0" -void = "1" -quickcheck = "0.9.2" -quickcheck_macros = "0.9.1" +slog-term = { workspace = true } +slog-async = { workspace = true } +tempfile = { workspace = true } +exit-future = { workspace = true } +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } + +[features] +libp2p-websocket = [] + diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index d8c3f619dcb..c3f6b60b045 100644 --- a/beacon_node/lighthouse_network/src/config.rs +++ b/beacon_node/lighthouse_network/src/config.rs @@ -453,7 +453,7 @@ pub fn gossipsub_config( // We use the first 8 bytes of SHA256(topic, data) for content addressing let fast_gossip_message_id = |message: &gossipsub::RawMessage| { let data = [message.topic.as_str().as_bytes(), &message.data].concat(); - gossipsub::FastMessageId::from(&Sha256::digest(data)[..8]) + gossipsub::FastMessageId::from(&Sha256::digest(&data)[..8]) }; fn prefix( prefix: [u8; 4], diff --git a/beacon_node/lighthouse_network/src/peer_manager/mod.rs b/beacon_node/lighthouse_network/src/peer_manager/mod.rs index 9118dc1d0c1..3c9b29238a3 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/mod.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/mod.rs @@ -2197,7 +2197,7 @@ mod tests { } impl Arbitrary for PeerCondition { - fn arbitrary(g: &mut G) -> Self { + fn arbitrary(g: &mut Gen) -> Self { let attestation_net_bitfield = { let len = ::SubnetBitfieldLength::to_usize(); let mut bitfield = Vec::with_capacity(len); diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index 715e77bcade..0204fc2456c 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -2,52 +2,53 @@ name = "network" version = "0.2.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -sloggers = { version = "2.1.1", features = ["json"] } -genesis = { path = "../genesis" } +sloggers = { workspace = true } +genesis = { workspace = true } matches = "0.1.8" -exit-future = "0.2.0" -slog-term = "2.6.0" -slog-async = "2.5.0" +exit-future = { workspace = true } +slog-term = { workspace = true } +slog-async = { workspace = true } [dependencies] -beacon_chain = { path = "../beacon_chain" } -store = { path = "../store" } -lighthouse_network = { path = "../lighthouse_network" } -types = { path = "../../consensus/types" } -slot_clock = { path = "../../common/slot_clock" } -slog = { version = "2.5.2", features = ["max_level_trace"] } -hex = "0.4.2" -ethereum_ssz = "0.5.0" -ssz_types = "0.5.3" -futures = "0.3.7" -error-chain = "0.12.4" -tokio = { version = "1.14.0", features = ["full"] } -tokio-stream = "0.1.3" -smallvec = "1.6.1" -rand = "0.8.5" -fnv = "1.0.7" +beacon_chain = { workspace = true } +store = { workspace = true } +lighthouse_network = { workspace = true } +types = { workspace = true } +slot_clock = { workspace = true } +slog = { workspace = true } +hex = { workspace = true } +ethereum_ssz = { workspace = true } +ssz_types = { workspace = true } +futures = { workspace = true } +error-chain = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +smallvec = { workspace = true } +rand = { workspace = true } +fnv = { workspace = true } rlp = "0.5.0" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -logging = { path = "../../common/logging" } -task_executor = { path = "../../common/task_executor" } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +logging = { workspace = true } +task_executor = { workspace = true } igd = "0.12.1" -itertools = "0.10.0" -lru_cache = { path = "../../common/lru_cache" } +itertools = { workspace = true } +num_cpus = { workspace = true } +lru_cache = { workspace = true } if-addrs = "0.6.4" -strum = "0.24.0" -tokio-util = { version = "0.6.3", features = ["time"] } -derivative = "2.2.0" -delay_map = "0.3.0" -ethereum-types = { version = "0.14.1", optional = true } -operation_pool = { path = "../operation_pool" } -execution_layer = { path = "../execution_layer" } -beacon_processor = { path = "../beacon_processor" } -parking_lot = "0.12.0" -environment = { path = "../../lighthouse/environment" } +strum = { workspace = true } +tokio-util = { workspace = true } +derivative = { workspace = true } +delay_map = { workspace = true } +ethereum-types = { workspace = true } +operation_pool = { workspace = true } +execution_layer = { workspace = true } +beacon_processor = { workspace = true } +parking_lot = { workspace = true } +environment = { workspace = true } [features] # NOTE: This can be run via cargo build --bin lighthouse --features network/disable-backfill diff --git a/beacon_node/operation_pool/Cargo.toml b/beacon_node/operation_pool/Cargo.toml index fdbecb656f4..afdbd7257a0 100644 --- a/beacon_node/operation_pool/Cargo.toml +++ b/beacon_node/operation_pool/Cargo.toml @@ -2,26 +2,26 @@ name = "operation_pool" version = "0.2.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] -derivative = "2.1.1" -itertools = "0.10.0" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -parking_lot = "0.12.0" -types = { path = "../../consensus/types" } -state_processing = { path = "../../consensus/state_processing" } -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -rayon = "1.5.0" -serde = "1.0.116" +derivative = { workspace = true } +itertools = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +parking_lot = { workspace = true } +types = { workspace = true } +state_processing = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +rayon = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -store = { path = "../store" } -bitvec = "1" -rand = "0.8.5" +store = { workspace = true } +bitvec = { workspace = true } +rand = { workspace = true } [dev-dependencies] -beacon_chain = { path = "../beacon_chain" } -tokio = { version = "1.14.0", features = ["rt-multi-thread"] } -maplit = "1.0.2" +beacon_chain = { workspace = true } +tokio = { workspace = true } +maplit = { workspace = true } diff --git a/beacon_node/store/Cargo.toml b/beacon_node/store/Cargo.toml index a952f1b2ffb..32c3868294f 100644 --- a/beacon_node/store/Cargo.toml +++ b/beacon_node/store/Cargo.toml @@ -2,27 +2,27 @@ name = "store" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" -beacon_chain = {path = "../beacon_chain"} +tempfile = { workspace = true } +beacon_chain = { workspace = true } [dependencies] db-key = "0.0.5" -leveldb = { version = "0.8.6" } -parking_lot = "0.12.0" -itertools = "0.10.0" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -types = { path = "../../consensus/types" } -state_processing = { path = "../../consensus/state_processing" } -slog = "2.5.2" -serde = "1.0.116" +leveldb = { version = "0.8" } +parking_lot = { workspace = true } +itertools = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +types = { workspace = true } +state_processing = { workspace = true } +slog = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../../common/lighthouse_metrics" } -lru = "0.7.1" -sloggers = { version = "2.1.1", features = ["json"] } -directory = { path = "../../common/directory" } -strum = { version = "0.24.0", features = ["derive"] } \ No newline at end of file +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +lru = { workspace = true } +sloggers = { workspace = true } +directory = { workspace = true } +strum = { workspace = true } diff --git a/beacon_node/timer/Cargo.toml b/beacon_node/timer/Cargo.toml index bd20f24ee62..afb93f3657d 100644 --- a/beacon_node/timer/Cargo.toml +++ b/beacon_node/timer/Cargo.toml @@ -2,11 +2,11 @@ name = "timer" version = "0.2.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dependencies] -beacon_chain = { path = "../beacon_chain" } -slot_clock = { path = "../../common/slot_clock" } -tokio = { version = "1.14.0", features = ["full"] } -slog = "2.5.2" -task_executor = { path = "../../common/task_executor" } +beacon_chain = { workspace = true } +slot_clock = { workspace = true } +tokio = { workspace = true } +slog = { workspace = true } +task_executor = { workspace = true } diff --git a/boot_node/Cargo.toml b/boot_node/Cargo.toml index fcbe8f84d27..c305e70d686 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -2,26 +2,26 @@ name = "boot_node" version = "4.4.1" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dependencies] -beacon_node = { path = "../beacon_node" } -clap = "2.33.3" -clap_utils = { path = "../common/clap_utils" } -lighthouse_network = { path = "../beacon_node/lighthouse_network" } -types = { path = "../consensus/types" } -ethereum_ssz = "0.5.0" -slog = "2.5.2" -tokio = "1.14.0" -log = "0.4.11" -slog-term = "2.6.0" -logging = { path = "../common/logging" } -slog-async = "2.5.0" +beacon_node = { workspace = true } +clap = { workspace = true } +clap_utils = { workspace = true } +lighthouse_network = { workspace = true } +types = { workspace = true } +ethereum_ssz = { workspace = true } +slog = { workspace = true } +tokio = { workspace = true } +log = { workspace = true } +slog-term = { workspace = true } +logging = { workspace = true } +slog-async = { workspace = true } slog-scope = "4.3.0" slog-stdlog = "4.0.0" -hex = "0.4.2" -serde = "1.0.116" +hex = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_json = "1.0.66" -serde_yaml = "0.8.13" -eth2_network_config = { path = "../common/eth2_network_config" } +serde_json = { workspace = true } +serde_yaml = { workspace = true } +eth2_network_config = { workspace = true } diff --git a/common/account_utils/Cargo.toml b/common/account_utils/Cargo.toml index ccff88ceef3..10113ab3206 100644 --- a/common/account_utils/Cargo.toml +++ b/common/account_utils/Cargo.toml @@ -2,22 +2,22 @@ name = "account_utils" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rand = "0.8.5" -eth2_wallet = { path = "../../crypto/eth2_wallet" } -eth2_keystore = { path = "../../crypto/eth2_keystore" } -filesystem = { path = "../filesystem" } -zeroize = { version = "1.4.2", features = ["zeroize_derive"] } -serde = "1.0.116" +rand = { workspace = true } +eth2_wallet = { workspace = true } +eth2_keystore = { workspace = true } +filesystem = { workspace = true } +zeroize = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_yaml = "0.8.13" -slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } -types = { path = "../../consensus/types" } -validator_dir = { path = "../validator_dir" } -regex = "1.5.5" +serde_yaml = { workspace = true } +slog = { workspace = true } +types = { workspace = true } +validator_dir = { workspace = true } +regex = { workspace = true } rpassword = "5.0.0" -directory = { path = "../directory" } +directory = { workspace = true } diff --git a/common/clap_utils/Cargo.toml b/common/clap_utils/Cargo.toml index a882b7ce64b..e4dfb2a5560 100644 --- a/common/clap_utils/Cargo.toml +++ b/common/clap_utils/Cargo.toml @@ -2,18 +2,18 @@ name = "clap_utils" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "2.33.3" -hex = "0.4.2" -dirs = "3.0.1" -eth2_network_config = { path = "../eth2_network_config" } -ethereum_ssz = "0.5.0" -ethereum-types = "0.14.1" -serde = "1.0.116" -serde_json = "1.0.59" -serde_yaml = "0.8.13" -types = { path = "../../consensus/types"} +clap = { workspace = true } +hex = { workspace = true } +dirs = { workspace = true } +eth2_network_config = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum-types = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_yaml = { workspace = true } +types = { workspace = true } diff --git a/common/compare_fields/Cargo.toml b/common/compare_fields/Cargo.toml index 58527b57112..8df989e7225 100644 --- a/common/compare_fields/Cargo.toml +++ b/common/compare_fields/Cargo.toml @@ -2,10 +2,10 @@ name = "compare_fields" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -compare_fields_derive = { path = "../compare_fields_derive" } +compare_fields_derive = { workspace = true } [package.metadata.cargo-udeps.ignore] development = ["compare_fields_derive"] # used in doc-tests diff --git a/common/compare_fields_derive/Cargo.toml b/common/compare_fields_derive/Cargo.toml index 7696d3606bd..b4bbbaa4369 100644 --- a/common/compare_fields_derive/Cargo.toml +++ b/common/compare_fields_derive/Cargo.toml @@ -2,11 +2,11 @@ name = "compare_fields_derive" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [lib] proc-macro = true [dependencies] -syn = "1.0.42" -quote = "1.0.7" +syn = { workspace = true } +quote = { workspace = true } diff --git a/common/deposit_contract/Cargo.toml b/common/deposit_contract/Cargo.toml index aabc07fc524..a03ac2178f8 100644 --- a/common/deposit_contract/Cargo.toml +++ b/common/deposit_contract/Cargo.toml @@ -2,18 +2,18 @@ name = "deposit_contract" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } build = "build.rs" [build-dependencies] -reqwest = { version = "0.11.0", features = ["blocking", "json", "native-tls-vendored"] } -serde_json = "1.0.58" -sha2 = "0.10" -hex = "0.4.2" +reqwest = { workspace = true } +serde_json = { workspace = true } +sha2 = { workspace = true } +hex = { workspace = true } [dependencies] -types = { path = "../../consensus/types"} -ethereum_ssz = "0.5.0" -tree_hash = "0.5.0" +types = { workspace = true } +ethereum_ssz = { workspace = true } +tree_hash = { workspace = true } ethabi = "16.0.0" diff --git a/common/directory/Cargo.toml b/common/directory/Cargo.toml index f7b77ab7b7d..f7243372618 100644 --- a/common/directory/Cargo.toml +++ b/common/directory/Cargo.toml @@ -2,11 +2,11 @@ name = "directory" version = "0.1.0" authors = ["pawan "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "2.33.3" -clap_utils = {path = "../clap_utils"} -eth2_network_config = { path = "../eth2_network_config" } +clap = { workspace = true } +clap_utils = { workspace = true } +eth2_network_config = { workspace = true } diff --git a/common/eth2/Cargo.toml b/common/eth2/Cargo.toml index 8cb3de3a002..f2911fd3d9c 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -2,36 +2,36 @@ name = "eth2" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = { version = "1.0.116", features = ["derive"] } -serde_json = "1.0.58" -types = { path = "../../consensus/types" } -reqwest = { version = "0.11.0", features = ["json", "stream"] } -lighthouse_network = { path = "../../beacon_node/lighthouse_network" } -proto_array = { path = "../../consensus/proto_array", optional = true } -ethereum_serde_utils = "0.5.0" -eth2_keystore = { path = "../../crypto/eth2_keystore" } -libsecp256k1 = "0.7.0" -ring = "0.16.19" -bytes = "1.0.1" -account_utils = { path = "../../common/account_utils" } -sensitive_url = { path = "../../common/sensitive_url" } -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" +serde = { workspace = true } +serde_json = { workspace = true } +types = { workspace = true } +reqwest = { workspace = true } +lighthouse_network = { workspace = true } +proto_array = { workspace = true } +ethereum_serde_utils = { workspace = true } +eth2_keystore = { workspace = true } +libsecp256k1 = { workspace = true } +ring = { workspace = true } +bytes = { workspace = true } +account_utils = { workspace = true } +sensitive_url = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } futures-util = "0.3.8" -futures = "0.3.8" -store = { path = "../../beacon_node/store", optional = true } -slashing_protection = { path = "../../validator_client/slashing_protection", optional = true } +futures = { workspace = true } +store = { workspace = true } +slashing_protection = { workspace = true } mediatype = "0.19.13" mime = "0.3.16" -pretty_reqwest_error = { path = "../../common/pretty_reqwest_error" } +pretty_reqwest_error = { workspace = true } [dev-dependencies] -tokio = { version = "1.14.0", features = ["full"] } +tokio = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] psutil = { version = "3.2.2", optional = true } @@ -39,4 +39,4 @@ procfs = { version = "0.15.1", optional = true } [features] default = ["lighthouse"] -lighthouse = ["proto_array", "psutil", "procfs", "store", "slashing_protection"] +lighthouse = ["psutil", "procfs"] diff --git a/common/eth2_config/Cargo.toml b/common/eth2_config/Cargo.toml index 08f8c9a3937..20c3b0b6f26 100644 --- a/common/eth2_config/Cargo.toml +++ b/common/eth2_config/Cargo.toml @@ -2,8 +2,8 @@ name = "eth2_config" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -types = { path = "../../consensus/types" } -paste = "1.0.5" +types = { workspace = true } +paste = { workspace = true } diff --git a/common/eth2_interop_keypairs/Cargo.toml b/common/eth2_interop_keypairs/Cargo.toml index 7a376568eb8..ded62653e56 100644 --- a/common/eth2_interop_keypairs/Cargo.toml +++ b/common/eth2_interop_keypairs/Cargo.toml @@ -2,19 +2,19 @@ name = "eth2_interop_keypairs" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lazy_static = "1.4.0" +lazy_static = { workspace = true } num-bigint = "0.4.2" -ethereum_hashing = "1.0.0-beta.2" -hex = "0.4.2" -serde_yaml = "0.8.13" -serde = "1.0.116" +ethereum_hashing = { workspace = true } +hex = { workspace = true } +serde_yaml = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -bls = { path = "../../crypto/bls" } +bls = { workspace = true } [dev-dependencies] base64 = "0.13.0" diff --git a/common/eth2_network_config/Cargo.toml b/common/eth2_network_config/Cargo.toml index 76bf4fab0ed..18dfe19da16 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -2,30 +2,29 @@ name = "eth2_network_config" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } build = "build.rs" [build-dependencies] -zip = "0.6" -eth2_config = { path = "../eth2_config" } +zip = { workspace = true } +eth2_config = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" -tokio = "1.14.0" +tempfile = { workspace = true } +tokio = { workspace = true } [dependencies] -serde_yaml = "0.8.13" -types = { path = "../../consensus/types" } -ethereum_ssz = "0.5.0" -eth2_config = { path = "../eth2_config" } -discv5 = "0.3.1" -reqwest = { version = "0.11.0", features = ["blocking"] } -pretty_reqwest_error = { path = "../pretty_reqwest_error" } -sha2 = "0.10" -url = "2.2.2" -sensitive_url = { path = "../sensitive_url" } -slog = "2.5.2" -logging = { path = "../logging" } -futures = "0.3.7" -bytes = "1.1.0" \ No newline at end of file +serde_yaml = { workspace = true } +types = { workspace = true } +ethereum_ssz = { workspace = true } +eth2_config = { workspace = true } +discv5 = { workspace = true } +reqwest = { workspace = true } +pretty_reqwest_error = { workspace = true } +sha2 = { workspace = true } +url = { workspace = true } +sensitive_url = { workspace = true } +slog = { workspace = true } +logging = { workspace = true } +bytes = { workspace = true } diff --git a/common/eth2_wallet_manager/Cargo.toml b/common/eth2_wallet_manager/Cargo.toml index 8e6f0c0e5cf..f4717570653 100644 --- a/common/eth2_wallet_manager/Cargo.toml +++ b/common/eth2_wallet_manager/Cargo.toml @@ -2,13 +2,13 @@ name = "eth2_wallet_manager" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -eth2_wallet = { path = "../../crypto/eth2_wallet" } -lockfile = { path = "../lockfile" } +eth2_wallet = { workspace = true } +lockfile = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" +tempfile = { workspace = true } diff --git a/common/filesystem/Cargo.toml b/common/filesystem/Cargo.toml index 66cbedbb833..fd026bd517a 100644 --- a/common/filesystem/Cargo.toml +++ b/common/filesystem/Cargo.toml @@ -2,7 +2,7 @@ name = "filesystem" version = "0.1.0" authors = ["Mark Mackey "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/common/lighthouse_metrics/Cargo.toml b/common/lighthouse_metrics/Cargo.toml index 06e33555d98..6d905344011 100644 --- a/common/lighthouse_metrics/Cargo.toml +++ b/common/lighthouse_metrics/Cargo.toml @@ -2,10 +2,10 @@ name = "lighthouse_metrics" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lazy_static = "1.4.0" +lazy_static = { workspace = true } prometheus = "0.13.0" diff --git a/common/lighthouse_version/Cargo.toml b/common/lighthouse_version/Cargo.toml index 96ac266476c..3c4f9fe50ce 100644 --- a/common/lighthouse_version/Cargo.toml +++ b/common/lighthouse_version/Cargo.toml @@ -2,7 +2,7 @@ name = "lighthouse_version" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -11,4 +11,4 @@ git-version = "0.3.4" target_info = "0.1.0" [dev-dependencies] -regex = "1.5.5" +regex = { workspace = true } diff --git a/common/lockfile/Cargo.toml b/common/lockfile/Cargo.toml index b9616e87152..d0cca13d45f 100644 --- a/common/lockfile/Cargo.toml +++ b/common/lockfile/Cargo.toml @@ -2,10 +2,10 @@ name = "lockfile" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] -fs2 = "0.4.3" +fs2 = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" +tempfile = { workspace = true } diff --git a/common/logging/Cargo.toml b/common/logging/Cargo.toml index 0e158f58ff5..9c5321591bc 100644 --- a/common/logging/Cargo.toml +++ b/common/logging/Cargo.toml @@ -2,21 +2,21 @@ name = "logging" version = "0.2.0" authors = ["blacktemplar "] -edition = "2021" +edition = { workspace = true } [features] test_logger = [] # Print log output to stderr when running tests instead of dropping it [dependencies] -slog = "2.5.2" -slog-term = "2.6.0" -tokio = { version = "1.26.0", features = ["sync"] } -lighthouse_metrics = { path = "../lighthouse_metrics" } -lazy_static = "1.4.0" -sloggers = { version = "2.1.1", features = ["json"] } -slog-async = "2.7.0" +slog = { workspace = true } +slog-term = { workspace = true } +tokio = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +sloggers = { workspace = true } +slog-async = { workspace = true } take_mut = "0.2.2" -parking_lot = "0.12.1" -serde = "1.0.153" -serde_json = "1.0.94" +parking_lot = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } chrono = { version = "0.4", default-features = false, features = ["clock", "std"] } diff --git a/common/lru_cache/Cargo.toml b/common/lru_cache/Cargo.toml index 405b7be5d8f..73c623ed443 100644 --- a/common/lru_cache/Cargo.toml +++ b/common/lru_cache/Cargo.toml @@ -2,7 +2,7 @@ name = "lru_cache" version = "0.1.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dependencies] -fnv = "1.0.7" +fnv = { workspace = true } diff --git a/common/malloc_utils/Cargo.toml b/common/malloc_utils/Cargo.toml index c88ec0bd5af..4a5f39b6612 100644 --- a/common/malloc_utils/Cargo.toml +++ b/common/malloc_utils/Cargo.toml @@ -2,13 +2,13 @@ name = "malloc_utils" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -lighthouse_metrics = { path = "../lighthouse_metrics" } -lazy_static = "1.4.0" +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } libc = "0.2.79" -parking_lot = "0.12.0" +parking_lot = { workspace = true } jemalloc-ctl = { version = "0.5.0", optional = true } # Jemalloc's background_threads feature requires Linux (pthreads). diff --git a/common/monitoring_api/Cargo.toml b/common/monitoring_api/Cargo.toml index bfb5e720423..e22f747bb1a 100644 --- a/common/monitoring_api/Cargo.toml +++ b/common/monitoring_api/Cargo.toml @@ -2,22 +2,22 @@ name = "monitoring_api" version = "0.1.0" authors = ["pawan "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.11.0", features = ["json","stream"] } -task_executor = { path = "../task_executor" } -tokio = "1.14.0" -eth2 = {path = "../eth2"} -serde_json = "1.0.58" -serde = "1.0.116" +reqwest = { workspace = true } +task_executor = { workspace = true } +tokio = { workspace = true } +eth2 = { workspace = true } +serde_json = { workspace = true } serde_derive = "1.0.116" -lighthouse_version = { path = "../lighthouse_version"} -lighthouse_metrics = { path = "../lighthouse_metrics" } -slog = "2.5.2" -store = { path = "../../beacon_node/store" } -lazy_static = "1.4.0" -regex = "1.5.5" -sensitive_url = { path = "../sensitive_url" } +serde = { workspace = true } +lighthouse_version = { workspace = true } +lighthouse_metrics = { workspace = true } +slog = { workspace = true } +store = { workspace = true } +lazy_static = { workspace = true } +regex = { workspace = true } +sensitive_url = { workspace = true } diff --git a/common/oneshot_broadcast/Cargo.toml b/common/oneshot_broadcast/Cargo.toml index baefe10661b..12c9b40bc85 100644 --- a/common/oneshot_broadcast/Cargo.toml +++ b/common/oneshot_broadcast/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "oneshot_broadcast" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -parking_lot = "0.12.0" +parking_lot = { workspace = true } diff --git a/common/pretty_reqwest_error/Cargo.toml b/common/pretty_reqwest_error/Cargo.toml index ca9f4812b0c..dc79832cd3d 100644 --- a/common/pretty_reqwest_error/Cargo.toml +++ b/common/pretty_reqwest_error/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "pretty_reqwest_error" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.11.0", features = ["json","stream"] } -sensitive_url = { path = "../sensitive_url" } +reqwest = { workspace = true } +sensitive_url = { workspace = true } diff --git a/common/sensitive_url/Cargo.toml b/common/sensitive_url/Cargo.toml index 6de591efcf9..d218c8d93a1 100644 --- a/common/sensitive_url/Cargo.toml +++ b/common/sensitive_url/Cargo.toml @@ -2,10 +2,10 @@ name = "sensitive_url" version = "0.1.0" authors = ["Mac L "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -url = "2.2.1" -serde = "1.0.116" +url = { workspace = true } +serde = { workspace = true } diff --git a/common/slot_clock/Cargo.toml b/common/slot_clock/Cargo.toml index d9fdd731262..31e53779a86 100644 --- a/common/slot_clock/Cargo.toml +++ b/common/slot_clock/Cargo.toml @@ -2,10 +2,10 @@ name = "slot_clock" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -types = { path = "../../consensus/types" } -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../lighthouse_metrics" } -parking_lot = "0.12.0" +types = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +parking_lot = { workspace = true } diff --git a/common/system_health/Cargo.toml b/common/system_health/Cargo.toml index 0956710b822..c02380c9d4a 100644 --- a/common/system_health/Cargo.toml +++ b/common/system_health/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "system_health" version = "0.1.0" -edition = "2021" +edition = { workspace = true } [dependencies] -lighthouse_network = { path = "../../beacon_node/lighthouse_network" } -types = { path = "../../consensus/types" } -sysinfo = "0.26.5" -serde = "1.0.116" +lighthouse_network = { workspace = true } +types = { workspace = true } +sysinfo = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_json = "1.0.58" -parking_lot = "0.12.0" +serde_json = { workspace = true } +parking_lot = { workspace = true } diff --git a/common/target_check/Cargo.toml b/common/target_check/Cargo.toml index 2cf2cacc644..206a636be47 100644 --- a/common/target_check/Cargo.toml +++ b/common/target_check/Cargo.toml @@ -2,7 +2,7 @@ name = "target_check" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] static_assertions = "1.1.0" diff --git a/common/task_executor/Cargo.toml b/common/task_executor/Cargo.toml index 08bb565870d..38f4eca3699 100644 --- a/common/task_executor/Cargo.toml +++ b/common/task_executor/Cargo.toml @@ -2,13 +2,13 @@ name = "task_executor" version = "0.1.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } [dependencies] -tokio = { version = "1.14.0", features = ["rt-multi-thread", "macros"] } -slog = "2.5.2" -futures = "0.3.7" -exit-future = "0.2.0" -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../lighthouse_metrics" } -sloggers = { version = "2.1.1", features = ["json"] } +tokio = { workspace = true } +slog = { workspace = true } +futures = { workspace = true } +exit-future = { workspace = true } +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +sloggers = { workspace = true } diff --git a/common/test_random_derive/Cargo.toml b/common/test_random_derive/Cargo.toml index 8794eeea21e..79308797a4b 100644 --- a/common/test_random_derive/Cargo.toml +++ b/common/test_random_derive/Cargo.toml @@ -2,12 +2,12 @@ name = "test_random_derive" version = "0.2.0" authors = ["thojest "] -edition = "2021" +edition = { workspace = true } description = "Procedural derive macros for implementation of TestRandom trait" [lib] proc-macro = true [dependencies] -syn = "1.0.42" -quote = "1.0.7" +syn = { workspace = true } +quote = { workspace = true } diff --git a/common/unused_port/Cargo.toml b/common/unused_port/Cargo.toml index 2dd041ff07e..3d70cad2729 100644 --- a/common/unused_port/Cargo.toml +++ b/common/unused_port/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "unused_port" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lru_cache = { path = "../lru_cache" } -lazy_static = "1.4.0" -parking_lot = "0.12.0" +lru_cache = { workspace = true } +lazy_static = { workspace = true } +parking_lot = { workspace = true } diff --git a/common/validator_dir/Cargo.toml b/common/validator_dir/Cargo.toml index 8accddfcb9b..ae8742fe07b 100644 --- a/common/validator_dir/Cargo.toml +++ b/common/validator_dir/Cargo.toml @@ -2,7 +2,7 @@ name = "validator_dir" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [features] insecure_keys = [] @@ -10,17 +10,17 @@ insecure_keys = [] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bls = { path = "../../crypto/bls" } -eth2_keystore = { path = "../../crypto/eth2_keystore" } -filesystem = { path = "../filesystem" } -types = { path = "../../consensus/types" } -rand = "0.8.5" -deposit_contract = { path = "../deposit_contract" } -tree_hash = "0.5.0" -hex = "0.4.2" -derivative = "2.1.1" -lockfile = { path = "../lockfile" } -directory = { path = "../directory" } +bls = { workspace = true } +eth2_keystore = { workspace = true } +filesystem = { workspace = true } +types = { workspace = true } +rand = { workspace = true } +deposit_contract = { workspace = true } +tree_hash = { workspace = true } +hex = { workspace = true } +derivative = { workspace = true } +lockfile = { workspace = true } +directory = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" +tempfile = { workspace = true } diff --git a/common/warp_utils/Cargo.toml b/common/warp_utils/Cargo.toml index e66aeddfb8e..85c1901badd 100644 --- a/common/warp_utils/Cargo.toml +++ b/common/warp_utils/Cargo.toml @@ -2,20 +2,20 @@ name = "warp_utils" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -warp = "0.3.2" -eth2 = { path = "../eth2" } -types = { path = "../../consensus/types" } -beacon_chain = { path = "../../beacon_node/beacon_chain" } -state_processing = { path = "../../consensus/state_processing" } -safe_arith = { path = "../../consensus/safe_arith" } -serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "1.14.0", features = ["sync"] } +warp = { workspace = true } +eth2 = { workspace = true } +types = { workspace = true } +beacon_chain = { workspace = true } +state_processing = { workspace = true } +safe_arith = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } headers = "0.3.2" -lighthouse_metrics = { path = "../lighthouse_metrics" } -lazy_static = "1.4.0" +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } serde_array_query = "0.1.0" diff --git a/consensus/cached_tree_hash/Cargo.toml b/consensus/cached_tree_hash/Cargo.toml index 0f43c8890f1..05edc348565 100644 --- a/consensus/cached_tree_hash/Cargo.toml +++ b/consensus/cached_tree_hash/Cargo.toml @@ -2,20 +2,20 @@ name = "cached_tree_hash" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] -ethereum-types = "0.14.1" -ssz_types = "0.5.3" -ethereum_hashing = "1.0.0-beta.2" -ethereum_ssz_derive = "0.5.0" -ethereum_ssz = "0.5.0" -tree_hash = "0.5.0" -smallvec = "1.6.1" +ethereum-types = { workspace = true } +ssz_types = { workspace = true } +ethereum_hashing = { workspace = true } +ethereum_ssz_derive = { workspace = true } +ethereum_ssz = { workspace = true } +tree_hash = { workspace = true } +smallvec = { workspace = true } [dev-dependencies] -quickcheck = "0.9.2" -quickcheck_macros = "0.9.1" +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } [features] arbitrary = ["ethereum-types/arbitrary"] diff --git a/consensus/fork_choice/Cargo.toml b/consensus/fork_choice/Cargo.toml index 3864d52d47c..7a06d7352b7 100644 --- a/consensus/fork_choice/Cargo.toml +++ b/consensus/fork_choice/Cargo.toml @@ -2,19 +2,19 @@ name = "fork_choice" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -types = { path = "../types" } -state_processing = { path = "../state_processing" } -proto_array = { path = "../proto_array" } -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } +types = { workspace = true } +state_processing = { workspace = true } +proto_array = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +slog = { workspace = true } [dev-dependencies] -beacon_chain = { path = "../../beacon_node/beacon_chain" } -store = { path = "../../beacon_node/store" } -tokio = { version = "1.14.0", features = ["rt-multi-thread"] } +beacon_chain = { workspace = true } +store = { workspace = true } +tokio = { workspace = true } diff --git a/consensus/int_to_bytes/Cargo.toml b/consensus/int_to_bytes/Cargo.toml index 73dfec40f96..03bec9d3801 100644 --- a/consensus/int_to_bytes/Cargo.toml +++ b/consensus/int_to_bytes/Cargo.toml @@ -2,11 +2,11 @@ name = "int_to_bytes" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -bytes = "1.0.1" +bytes = { workspace = true } [dev-dependencies] yaml-rust = "0.4.4" -hex = "0.4.2" +hex = { workspace = true } diff --git a/consensus/merkle_proof/Cargo.toml b/consensus/merkle_proof/Cargo.toml index 2b883f8646e..3bee25eaac9 100644 --- a/consensus/merkle_proof/Cargo.toml +++ b/consensus/merkle_proof/Cargo.toml @@ -2,17 +2,17 @@ name = "merkle_proof" version = "0.2.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] -ethereum-types = "0.14.1" -ethereum_hashing = "1.0.0-beta.2" -lazy_static = "1.4.0" -safe_arith = { path = "../safe_arith" } +ethereum-types = { workspace = true } +ethereum_hashing = { workspace = true } +lazy_static = { workspace = true } +safe_arith = { workspace = true } [dev-dependencies] -quickcheck = "0.9.2" -quickcheck_macros = "0.9.1" +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } [features] arbitrary = ["ethereum-types/arbitrary"] diff --git a/consensus/proto_array/Cargo.toml b/consensus/proto_array/Cargo.toml index 81a535e34a1..b30173eb7e0 100644 --- a/consensus/proto_array/Cargo.toml +++ b/consensus/proto_array/Cargo.toml @@ -2,18 +2,18 @@ name = "proto_array" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [[bin]] name = "proto_array" path = "src/bin.rs" [dependencies] -types = { path = "../types" } -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -serde = "1.0.116" +types = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_yaml = "0.8.13" -safe_arith = { path = "../safe_arith" } -superstruct = "0.5.0" \ No newline at end of file +serde_yaml = { workspace = true } +safe_arith = { workspace = true } +superstruct = { workspace = true } \ No newline at end of file diff --git a/consensus/safe_arith/Cargo.toml b/consensus/safe_arith/Cargo.toml index d212f988420..6f2e4b811c7 100644 --- a/consensus/safe_arith/Cargo.toml +++ b/consensus/safe_arith/Cargo.toml @@ -2,7 +2,7 @@ name = "safe_arith" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/consensus/state_processing/Cargo.toml b/consensus/state_processing/Cargo.toml index f19cd1d29df..e4dfb45d585 100644 --- a/consensus/state_processing/Cargo.toml +++ b/consensus/state_processing/Cargo.toml @@ -2,42 +2,39 @@ name = "state_processing" version = "0.2.0" authors = ["Paul Hauner ", "Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dev-dependencies] -env_logger = "0.9.0" -beacon_chain = { path = "../../beacon_node/beacon_chain" } -tokio = { version = "1.14.0", features = ["rt-multi-thread"] } +env_logger = { workspace = true } +beacon_chain = { workspace = true } +tokio = { workspace = true } [dependencies] -bls = { path = "../../crypto/bls" } +bls = { workspace = true } integer-sqrt = "0.1.5" -itertools = "0.10.0" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -ssz_types = "0.5.3" -merkle_proof = { path = "../merkle_proof" } -safe_arith = { path = "../safe_arith" } -tree_hash = "0.5.0" -types = { path = "../types", default-features = false } -rayon = "1.4.1" -ethereum_hashing = "1.0.0-beta.2" -int_to_bytes = { path = "../int_to_bytes" } -smallvec = "1.6.1" -arbitrary = { version = "1.0", features = ["derive"], optional = true } -lighthouse_metrics = { path = "../../common/lighthouse_metrics", optional = true } -lazy_static = { version = "1.4.0", optional = true } -derivative = "2.1.1" +itertools = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +ssz_types = { workspace = true } +merkle_proof = { workspace = true } +safe_arith = { workspace = true } +tree_hash = { workspace = true } +types = { workspace = true } +rayon = { workspace = true } +ethereum_hashing = { workspace = true } +int_to_bytes = { workspace = true } +smallvec = { workspace = true } +arbitrary = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +derivative = { workspace = true } [features] -default = ["legacy-arith", "metrics"] +default = ["legacy-arith"] fake_crypto = ["bls/fake_crypto"] legacy-arith = ["types/legacy-arith"] -metrics = ["lighthouse_metrics", "lazy_static"] arbitrary-fuzz = [ - "arbitrary", "types/arbitrary-fuzz", - "bls/arbitrary", "merkle_proof/arbitrary", "ethereum_ssz/arbitrary", "ssz_types/arbitrary", diff --git a/consensus/state_processing/src/metrics.rs b/consensus/state_processing/src/metrics.rs index 360b007678a..d8a51135e85 100644 --- a/consensus/state_processing/src/metrics.rs +++ b/consensus/state_processing/src/metrics.rs @@ -1,5 +1,3 @@ -#![cfg(feature = "metrics")] - use lazy_static::lazy_static; pub use lighthouse_metrics::*; diff --git a/consensus/state_processing/src/per_epoch_processing/epoch_processing_summary.rs b/consensus/state_processing/src/per_epoch_processing/epoch_processing_summary.rs index 6eb2f97766b..89bc4ab5a34 100644 --- a/consensus/state_processing/src/per_epoch_processing/epoch_processing_summary.rs +++ b/consensus/state_processing/src/per_epoch_processing/epoch_processing_summary.rs @@ -21,7 +21,6 @@ pub enum EpochProcessingSummary { impl EpochProcessingSummary { /// Updates some Prometheus metrics with some values in `self`. - #[cfg(feature = "metrics")] pub fn observe_metrics(&self) -> Result<(), ParticipationCacheError> { metrics::set_gauge( &metrics::PARTICIPATION_PREV_EPOCH_HEAD_ATTESTING_GWEI_TOTAL, diff --git a/consensus/swap_or_not_shuffle/Cargo.toml b/consensus/swap_or_not_shuffle/Cargo.toml index 303e5cfba17..ea9b603c5bc 100644 --- a/consensus/swap_or_not_shuffle/Cargo.toml +++ b/consensus/swap_or_not_shuffle/Cargo.toml @@ -2,18 +2,18 @@ name = "swap_or_not_shuffle" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [[bench]] name = "benches" harness = false [dev-dependencies] -criterion = "0.3.3" +criterion = { workspace = true } [dependencies] -ethereum_hashing = "1.0.0-beta.2" -ethereum-types = "0.14.1" +ethereum_hashing = { workspace = true } +ethereum-types = { workspace = true } [features] arbitrary = ["ethereum-types/arbitrary"] diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index f030f2e97a6..d705dfdd5e7 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -2,71 +2,70 @@ name = "types" version = "0.2.1" authors = ["Paul Hauner ", "Age Manning "] -edition = "2021" +edition = { workspace = true } [[bench]] name = "benches" harness = false [dependencies] -merkle_proof = { path = "../../consensus/merkle_proof" } -bls = { path = "../../crypto/bls", features = ["arbitrary"] } -compare_fields = { path = "../../common/compare_fields" } -compare_fields_derive = { path = "../../common/compare_fields_derive" } +merkle_proof = { workspace = true } +bls = { workspace = true, features = ["arbitrary"] } +compare_fields = { workspace = true } +compare_fields_derive = { workspace = true } eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" } -ethereum-types = { version = "0.14.1", features = ["arbitrary"] } -ethereum_hashing = "1.0.0-beta.2" -hex = "0.4.2" -int_to_bytes = { path = "../int_to_bytes" } -log = "0.4.11" -rayon = "1.4.1" -rand = "0.8.5" -safe_arith = { path = "../safe_arith" } -serde = {version = "1.0.116" , features = ["rc"] } +ethereum-types = { workspace = true, features = ["arbitrary"] } +ethereum_hashing = { workspace = true } +hex = { workspace = true } +int_to_bytes = { workspace = true } +log = { workspace = true } +rayon = { workspace = true } +rand = { workspace = true } +safe_arith = { workspace = true } +serde = { workspace = true, features = ["rc"] } serde_derive = "1.0.116" -slog = "2.5.2" -ethereum_ssz = { version = "0.5.0", features = ["arbitrary"] } -ethereum_ssz_derive = "0.5.0" -ssz_types = { version = "0.5.3", features = ["arbitrary"] } -swap_or_not_shuffle = { path = "../swap_or_not_shuffle", features = ["arbitrary"] } +slog = { workspace = true } +ethereum_ssz = { workspace = true, features = ["arbitrary"] } +ethereum_ssz_derive = { workspace = true } +ssz_types = { workspace = true, features = ["arbitrary"] } +swap_or_not_shuffle = { workspace = true, features = ["arbitrary"] } test_random_derive = { path = "../../common/test_random_derive" } -tree_hash = { version = "0.5.0", features = ["arbitrary"] } -tree_hash_derive = "0.5.0" +tree_hash = { workspace = true, features = ["arbitrary"] } +tree_hash_derive = { workspace = true } rand_xorshift = "0.3.0" -cached_tree_hash = { path = "../cached_tree_hash" } -serde_yaml = "0.8.13" -tempfile = "3.1.0" -derivative = "2.1.1" -rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } +cached_tree_hash = { workspace = true } +serde_yaml = { workspace = true } +tempfile = { workspace = true } +derivative = { workspace = true } +rusqlite = { workspace = true } # The arbitrary dependency is enabled by default since Capella to avoid complexity introduced by # `AbstractExecPayload` -arbitrary = { version = "1.0", features = ["derive"] } -ethereum_serde_utils = "0.5.0" -regex = "1.5.5" -lazy_static = "1.4.0" -parking_lot = "0.12.0" -itertools = "0.10.0" -superstruct = "0.6.0" +arbitrary = { workspace = true, features = ["derive"] } +ethereum_serde_utils = { workspace = true } +regex = { workspace = true } +lazy_static = { workspace = true } +parking_lot = { workspace = true } +itertools = { workspace = true } +superstruct = { workspace = true } metastruct = "0.1.0" -serde_json = "1.0.74" -smallvec = "1.8.0" +serde_json = { workspace = true } +smallvec = { workspace = true } serde_with = "1.13.0" -maplit = "1.0.2" -strum = { version = "0.24.0", features = ["derive"] } +maplit = { workspace = true } +strum = { workspace = true } [dev-dependencies] -criterion = "0.3.3" -beacon_chain = { path = "../../beacon_node/beacon_chain" } -eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" } -state_processing = { path = "../state_processing" } -tokio = "1.14.0" -paste = "1.0.14" +criterion = { workspace = true } +beacon_chain = { workspace = true } +state_processing = { workspace = true } +tokio = { workspace = true } +paste = { workspace = true } [features] default = ["sqlite", "legacy-arith"] # Allow saturating arithmetic on slots and epochs. Enabled by default, but deprecated. legacy-arith = [] -sqlite = ["rusqlite"] +sqlite = [] # The `arbitrary-fuzz` feature is a no-op provided for backwards compatibility. # For simplicity `Arbitrary` is now derived regardless of the feature's presence. arbitrary-fuzz = [] diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index a610f257cdb..4340fb3e853 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -2,24 +2,25 @@ name = "bls" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -ethereum_ssz = "0.5.0" -tree_hash = "0.5.0" -milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.4.2", optional = true } -rand = "0.7.3" -serde = "1.0.116" +ethereum_ssz = { workspace = true } +tree_hash = { workspace = true } +milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.5.1", optional = true } +rand = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -ethereum_serde_utils = "0.5.0" -hex = "0.4.2" -ethereum_hashing = "1.0.0-beta.2" -ethereum-types = "0.14.1" -arbitrary = { version = "1.0", features = ["derive"], optional = true } -zeroize = { version = "1.4.2", features = ["zeroize_derive"] } +ethereum_serde_utils = { workspace = true } +hex = { workspace = true } +ethereum_hashing = { workspace = true } +ethereum-types = { workspace = true } +arbitrary = { workspace = true } +zeroize = { workspace = true } blst = { version = "0.3.3", optional = true } [features] +arbitrary = [] default = ["supranational"] fake_crypto = [] milagro = ["milagro_bls"] diff --git a/crypto/eth2_key_derivation/Cargo.toml b/crypto/eth2_key_derivation/Cargo.toml index 3f174a02d4f..a0237ba7ede 100644 --- a/crypto/eth2_key_derivation/Cargo.toml +++ b/crypto/eth2_key_derivation/Cargo.toml @@ -2,16 +2,16 @@ name = "eth2_key_derivation" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -sha2 = "0.10" -zeroize = { version = "1.4.2", features = ["zeroize_derive"] } -num-bigint-dig = { version = "0.6.0", features = ["zeroize"] } -ring = "0.16.19" -bls = { path = "../bls" } +sha2 = { workspace = true } +zeroize = { workspace = true } +num-bigint-dig = { version = "0.8.4", features = ["zeroize"] } +ring = { workspace = true } +bls = { workspace = true } [dev-dependencies] -hex = "0.4.2" +hex = { workspace = true } diff --git a/crypto/eth2_keystore/Cargo.toml b/crypto/eth2_keystore/Cargo.toml index d83a60da24a..bb6222807bd 100644 --- a/crypto/eth2_keystore/Cargo.toml +++ b/crypto/eth2_keystore/Cargo.toml @@ -2,26 +2,26 @@ name = "eth2_keystore" version = "0.1.0" authors = ["Pawan Dhananjay "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rand = "0.8.5" +rand = { workspace = true } hmac = "0.11.0" pbkdf2 = { version = "0.8.0", default-features = false } scrypt = { version = "0.7.0", default-features = false } -sha2 = "0.9.2" -uuid = { version = "0.8.1", features = ["serde", "v4"] } -zeroize = { version = "1.4.2", features = ["zeroize_derive"] } -serde = "1.0.116" -serde_repr = "0.1.6" -hex = "0.4.2" -bls = { path = "../bls" } -serde_json = "1.0.58" -eth2_key_derivation = { path = "../eth2_key_derivation" } +sha2 = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } +serde = { workspace = true } +serde_repr = { workspace = true } +hex = { workspace = true } +bls = { workspace = true } +serde_json = { workspace = true } +eth2_key_derivation = { workspace = true } unicode-normalization = "0.1.16" aes = { version = "0.7", features = ["ctr"] } [dev-dependencies] -tempfile = "3.1.0" +tempfile = { workspace = true } diff --git a/crypto/eth2_wallet/Cargo.toml b/crypto/eth2_wallet/Cargo.toml index 71f66ff9335..f3af6aab592 100644 --- a/crypto/eth2_wallet/Cargo.toml +++ b/crypto/eth2_wallet/Cargo.toml @@ -2,20 +2,20 @@ name = "eth2_wallet" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = "1.0.116" -serde_json = "1.0.58" -serde_repr = "0.1.6" -uuid = { version = "0.8.1", features = ["serde", "v4"] } -rand = "0.8.5" -eth2_keystore = { path = "../eth2_keystore" } -eth2_key_derivation = { path = "../eth2_key_derivation" } -tiny-bip39 = "0.8.1" +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +uuid = { workspace = true } +rand = { workspace = true } +eth2_keystore = { workspace = true } +eth2_key_derivation = { workspace = true } +tiny-bip39 = "1" [dev-dependencies] -hex = "0.4.2" -tempfile = "3.1.0" +hex = { workspace = true } +tempfile = { workspace = true } diff --git a/database_manager/Cargo.toml b/database_manager/Cargo.toml index f715528138a..1570c171cb6 100644 --- a/database_manager/Cargo.toml +++ b/database_manager/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "database_manager" version = "0.1.0" -edition = "2021" +edition = { workspace = true } [dependencies] -beacon_chain = { path = "../beacon_node/beacon_chain" } -beacon_node = { path = "../beacon_node" } -clap = "2.33.3" -clap_utils = { path = "../common/clap_utils" } -environment = { path = "../lighthouse/environment" } -logging = { path = "../common/logging" } -sloggers = "2.0.2" -store = { path = "../beacon_node/store" } -tempfile = "3.1.0" -types = { path = "../consensus/types" } -slog = "2.5.2" -strum = { version = "0.24.0", features = ["derive"] } +beacon_chain = { workspace = true } +beacon_node = { workspace = true } +clap = { workspace = true } +clap_utils = { workspace = true } +environment = { workspace = true } +logging = { workspace = true } +sloggers = { workspace = true } +store = { workspace = true } +tempfile = { workspace = true } +types = { workspace = true } +slog = { workspace = true } +strum = { workspace = true } diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 704e0a657e8..838ff9ecca6 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -3,7 +3,7 @@ name = "lcli" description = "Lighthouse CLI (modeled after zcli)" version = "4.4.1" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [features] portable = ["bls/supranational-portable"] @@ -11,38 +11,38 @@ fake_crypto = ['bls/fake_crypto'] jemalloc = ["malloc_utils/jemalloc"] [dependencies] -bls = { path = "../crypto/bls" } -clap = "2.33.3" -log = "0.4.11" -serde = "1.0.116" -serde_yaml = "0.8.13" -serde_json = "1.0.66" -env_logger = "0.9.0" -types = { path = "../consensus/types" } -state_processing = { path = "../consensus/state_processing" } -int_to_bytes = { path = "../consensus/int_to_bytes" } -ethereum_hashing = "1.0.0-beta.2" -ethereum_ssz = "0.5.0" -environment = { path = "../lighthouse/environment" } -eth2_network_config = { path = "../common/eth2_network_config" } -genesis = { path = "../beacon_node/genesis" } -deposit_contract = { path = "../common/deposit_contract" } -tree_hash = "0.5.0" -clap_utils = { path = "../common/clap_utils" } -lighthouse_network = { path = "../beacon_node/lighthouse_network" } -validator_dir = { path = "../common/validator_dir", features = ["insecure_keys"] } -lighthouse_version = { path = "../common/lighthouse_version" } -directory = { path = "../common/directory" } -account_utils = { path = "../common/account_utils" } -eth2_wallet = { path = "../crypto/eth2_wallet" } -eth1_test_rig = { path = "../testing/eth1_test_rig" } -sensitive_url = { path = "../common/sensitive_url" } -eth2 = { path = "../common/eth2" } -snap = "1.0.1" -beacon_chain = { path = "../beacon_node/beacon_chain" } -store = { path = "../beacon_node/store" } -malloc_utils = { path = "../common/malloc_utils" } -rayon = "1.7.0" +bls = { workspace = true } +clap = { workspace = true } +log = { workspace = true } +serde = { workspace = true } +serde_yaml = { workspace = true } +serde_json = { workspace = true } +env_logger = { workspace = true } +types = { workspace = true } +state_processing = { workspace = true } +int_to_bytes = { workspace = true } +ethereum_hashing = { workspace = true } +ethereum_ssz = { workspace = true } +environment = { workspace = true } +eth2_network_config = { workspace = true } +genesis = { workspace = true } +deposit_contract = { workspace = true } +tree_hash = { workspace = true } +clap_utils = { workspace = true } +lighthouse_network = { workspace = true } +validator_dir = { workspace = true, features = ["insecure_keys"] } +lighthouse_version = { workspace = true } +directory = { workspace = true } +account_utils = { workspace = true } +eth2_wallet = { workspace = true } +eth1_test_rig = { workspace = true } +sensitive_url = { workspace = true } +eth2 = { workspace = true } +snap = { workspace = true } +beacon_chain = { workspace = true } +store = { workspace = true } +malloc_utils = { workspace = true } +rayon = { workspace = true } [package.metadata.cargo-udeps.ignore] normal = ["malloc_utils"] diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 920a1f64e79..9cffcf7efac 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -2,7 +2,7 @@ name = "lighthouse" version = "4.4.1" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } autotests = false rust-version = "1.69.0" @@ -28,45 +28,45 @@ slasher-lmdb = ["slasher/lmdb"] jemalloc = ["malloc_utils/jemalloc"] [dependencies] -beacon_node = { "path" = "../beacon_node" } -slog = { version = "2.5.2", features = ["max_level_trace"] } -sloggers = { version = "2.1.1", features = ["json"] } -types = { "path" = "../consensus/types" } -bls = { path = "../crypto/bls" } -ethereum_hashing = "1.0.0-beta.2" -clap = "2.33.3" -env_logger = "0.9.0" -environment = { path = "./environment" } +beacon_node = { workspace = true } +slog = { workspace = true } +sloggers = { workspace = true } +types = { workspace = true } +bls = { workspace = true } +ethereum_hashing = { workspace = true } +clap = { workspace = true } +env_logger = { workspace = true } +environment = { workspace = true } boot_node = { path = "../boot_node" } -futures = "0.3.7" -validator_client = { "path" = "../validator_client" } +futures = { workspace = true } +validator_client = { workspace = true } account_manager = { "path" = "../account_manager" } -clap_utils = { path = "../common/clap_utils" } -eth2_network_config = { path = "../common/eth2_network_config" } -lighthouse_version = { path = "../common/lighthouse_version" } -account_utils = { path = "../common/account_utils" } -lighthouse_metrics = { path = "../common/lighthouse_metrics" } -lazy_static = "1.4.0" -serde = { version = "1.0.116", features = ["derive"] } -serde_json = "1.0.59" -serde_yaml = "0.8.13" -task_executor = { path = "../common/task_executor" } -malloc_utils = { path = "../common/malloc_utils" } -directory = { path = "../common/directory" } -unused_port = { path = "../common/unused_port" } +clap_utils = { workspace = true } +eth2_network_config = { workspace = true } +lighthouse_version = { workspace = true } +account_utils = { workspace = true } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_yaml = { workspace = true } +task_executor = { workspace = true } +malloc_utils = { workspace = true } +directory = { workspace = true } +unused_port = { workspace = true } database_manager = { path = "../database_manager" } -slasher = { path = "../slasher" } +slasher = { workspace = true } validator_manager = { path = "../validator_manager" } [dev-dependencies] -tempfile = "3.1.0" -validator_dir = { path = "../common/validator_dir" } -slashing_protection = { path = "../validator_client/slashing_protection" } -lighthouse_network = { path = "../beacon_node/lighthouse_network" } -sensitive_url = { path = "../common/sensitive_url" } -eth1 = { path = "../beacon_node/eth1" } -eth2 = { path = "../common/eth2" } -beacon_processor = { path = "../beacon_node/beacon_processor" } +tempfile = { workspace = true } +validator_dir = { workspace = true } +slashing_protection = { workspace = true } +lighthouse_network = { workspace = true } +sensitive_url = { workspace = true } +eth1 = { workspace = true } +eth2 = { workspace = true } +beacon_processor = { workspace = true } [[test]] name = "lighthouse_tests" diff --git a/lighthouse/environment/Cargo.toml b/lighthouse/environment/Cargo.toml index 1ba0bb267c5..d2a181a1b9f 100644 --- a/lighthouse/environment/Cargo.toml +++ b/lighthouse/environment/Cargo.toml @@ -2,23 +2,23 @@ name = "environment" version = "0.1.2" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -tokio = { version = "1.14.0", features = ["macros", "rt", "rt-multi-thread", "signal" ] } -slog = { version = "2.5.2", features = ["max_level_trace"] } -sloggers = { version = "2.1.1", features = ["json"] } -types = { path = "../../consensus/types" } -eth2_config = { path = "../../common/eth2_config" } -task_executor = { path = "../../common/task_executor" } -eth2_network_config = { path = "../../common/eth2_network_config" } -logging = { path = "../../common/logging" } -slog-term = "2.6.0" -slog-async = "2.5.0" -futures = "0.3.7" +tokio = { workspace = true } +slog = { workspace = true } +sloggers = { workspace = true } +types = { workspace = true } +eth2_config = { workspace = true } +task_executor = { workspace = true } +eth2_network_config = { workspace = true } +logging = { workspace = true } +slog-term = { workspace = true } +slog-async = { workspace = true } +futures = { workspace = true } slog-json = "2.3.0" -exit-future = "0.2.0" -serde = "1.0.116" +exit-future = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" [target.'cfg(not(target_family = "unix"))'.dependencies] diff --git a/slasher/Cargo.toml b/slasher/Cargo.toml index bfa7b5f64c5..9df77daa103 100644 --- a/slasher/Cargo.toml +++ b/slasher/Cargo.toml @@ -2,7 +2,7 @@ name = "slasher" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [features] default = ["lmdb"] @@ -10,26 +10,26 @@ mdbx = ["dep:mdbx"] lmdb = ["lmdb-rkv", "lmdb-rkv-sys"] [dependencies] -bincode = "1.3.1" -byteorder = "1.3.4" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" +bincode = { workspace = true } +byteorder = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } flate2 = { version = "1.0.14", features = ["zlib"], default-features = false } -lazy_static = "1.4.0" -lighthouse_metrics = { path = "../common/lighthouse_metrics" } -filesystem = { path = "../common/filesystem" } -lru = "0.7.1" -parking_lot = "0.12.0" -rand = "0.8.5" -safe_arith = { path = "../consensus/safe_arith" } -serde = "1.0" +lazy_static = { workspace = true } +lighthouse_metrics = { workspace = true } +filesystem = { workspace = true } +lru = { workspace = true } +parking_lot = { workspace = true } +rand = { workspace = true } +safe_arith = { workspace = true } +serde = { workspace = true } serde_derive = "1.0" -slog = "2.5.2" -sloggers = { version = "2.1.1", features = ["json"] } -tree_hash = "0.5.0" -tree_hash_derive = "0.5.0" -types = { path = "../consensus/types" } -strum = { version = "0.24.1", features = ["derive"] } +slog = { workspace = true } +sloggers = { workspace = true } +tree_hash = { workspace = true } +tree_hash_derive = { workspace = true } +types = { workspace = true } +strum = { workspace = true } # MDBX is pinned at the last version with Windows and macOS support. mdbx = { package = "libmdbx", git = "https://github.com/sigp/libmdbx-rs", tag = "v0.1.4", optional = true } @@ -37,8 +37,8 @@ lmdb-rkv = { git = "https://github.com/sigp/lmdb-rs", rev = "f33845c6469b9426531 lmdb-rkv-sys = { git = "https://github.com/sigp/lmdb-rs", rev = "f33845c6469b94265319aac0ed5085597862c27e", optional = true } [dev-dependencies] -maplit = "1.0.2" -rayon = "1.3.0" -tempfile = "3.1.0" -logging = { path = "../common/logging" } +maplit = { workspace = true } +rayon = { workspace = true } +tempfile = { workspace = true } +logging = { workspace = true } diff --git a/slasher/service/Cargo.toml b/slasher/service/Cargo.toml index 63cf1e4649e..41e3b5b90ad 100644 --- a/slasher/service/Cargo.toml +++ b/slasher/service/Cargo.toml @@ -2,17 +2,17 @@ name = "slasher_service" version = "0.1.0" authors = ["Michael Sproul "] -edition = "2021" +edition = { workspace = true } [dependencies] -beacon_chain = { path = "../../beacon_node/beacon_chain" } -directory = { path = "../../common/directory" } -lighthouse_network = { path = "../../beacon_node/lighthouse_network" } -network = { path = "../../beacon_node/network" } -slasher = { path = ".." } -slog = "2.5.2" -slot_clock = { path = "../../common/slot_clock" } -state_processing = { path = "../../consensus/state_processing" } -task_executor = { path = "../../common/task_executor" } -tokio = { version = "1.14.0", features = ["full"] } -types = { path = "../../consensus/types" } +beacon_chain = { workspace = true } +directory = { workspace = true } +lighthouse_network = { workspace = true } +network = { workspace = true } +slasher = { workspace = true } +slog = { workspace = true } +slot_clock = { workspace = true } +state_processing = { workspace = true } +task_executor = { workspace = true } +tokio = { workspace = true } +types = { workspace = true } diff --git a/testing/ef_tests/Cargo.toml b/testing/ef_tests/Cargo.toml index 11283052f07..16fe2250490 100644 --- a/testing/ef_tests/Cargo.toml +++ b/testing/ef_tests/Cargo.toml @@ -2,7 +2,7 @@ name = "ef_tests" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [features] # `ef_tests` feature must be enabled to actually run the tests @@ -11,28 +11,28 @@ milagro = ["bls/milagro"] fake_crypto = ["bls/fake_crypto"] [dependencies] -bls = { path = "../../crypto/bls", default-features = false } -compare_fields = { path = "../../common/compare_fields" } -compare_fields_derive = { path = "../../common/compare_fields_derive" } -derivative = "2.1.1" -ethereum-types = "0.14.1" -hex = "0.4.2" -rayon = "1.4.1" -serde = "1.0.116" +bls = { workspace = true } +compare_fields = { workspace = true } +compare_fields_derive = { workspace = true } +derivative = { workspace = true } +ethereum-types = { workspace = true } +hex = { workspace = true } +rayon = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_repr = "0.1.6" -serde_yaml = "0.8.13" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.0" -tree_hash = "0.5.0" -tree_hash_derive = "0.5.0" -cached_tree_hash = { path = "../../consensus/cached_tree_hash" } -state_processing = { path = "../../consensus/state_processing" } -swap_or_not_shuffle = { path = "../../consensus/swap_or_not_shuffle" } -types = { path = "../../consensus/types" } -snap = "1.0.1" -fs2 = "0.4.3" -beacon_chain = { path = "../../beacon_node/beacon_chain" } -store = { path = "../../beacon_node/store" } -fork_choice = { path = "../../consensus/fork_choice" } -execution_layer = { path = "../../beacon_node/execution_layer" } +serde_repr = { workspace = true } +serde_yaml = { workspace = true } +ethereum_ssz = { workspace = true } +ethereum_ssz_derive = { workspace = true } +tree_hash = { workspace = true } +tree_hash_derive = { workspace = true } +cached_tree_hash = { workspace = true } +state_processing = { workspace = true } +swap_or_not_shuffle = { workspace = true } +types = { workspace = true } +snap = { workspace = true } +fs2 = { workspace = true } +beacon_chain = { workspace = true } +store = { workspace = true } +fork_choice = { workspace = true } +execution_layer = { workspace = true } diff --git a/testing/eth1_test_rig/Cargo.toml b/testing/eth1_test_rig/Cargo.toml index 5c78c090227..c76ef91183b 100644 --- a/testing/eth1_test_rig/Cargo.toml +++ b/testing/eth1_test_rig/Cargo.toml @@ -2,15 +2,15 @@ name = "eth1_test_rig" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -tokio = { version = "1.14.0", features = ["time"] } -ethers-core = "1.0.2" -ethers-providers = "1.0.2" +tokio = { workspace = true } +ethers-core = { workspace = true } +ethers-providers = { workspace = true } ethers-contract = "1.0.2" -types = { path = "../../consensus/types"} -serde_json = "1.0.58" -deposit_contract = { path = "../../common/deposit_contract"} -unused_port = { path = "../../common/unused_port" } -hex = "0.4.2" +types = { workspace = true } +serde_json = { workspace = true } +deposit_contract = { workspace = true } +unused_port = { workspace = true } +hex = { workspace = true } diff --git a/testing/execution_engine_integration/Cargo.toml b/testing/execution_engine_integration/Cargo.toml index de3085d2227..75a63fb46f2 100644 --- a/testing/execution_engine_integration/Cargo.toml +++ b/testing/execution_engine_integration/Cargo.toml @@ -1,24 +1,24 @@ [package] name = "execution_engine_integration" version = "0.1.0" -edition = "2021" +edition = { workspace = true } [dependencies] -tempfile = "3.1.0" -serde_json = "1.0.58" -task_executor = { path = "../../common/task_executor" } -tokio = { version = "1.14.0", features = ["rt-multi-thread", "macros"] } -futures = "0.3.7" -exit-future = "0.2.0" -environment = { path = "../../lighthouse/environment" } -execution_layer = { path = "../../beacon_node/execution_layer" } -sensitive_url = { path = "../../common/sensitive_url" } -types = { path = "../../consensus/types" } -unused_port = { path = "../../common/unused_port" } -ethers-core = "1.0.2" -ethers-providers = "1.0.2" -deposit_contract = { path = "../../common/deposit_contract" } -reqwest = { version = "0.11.0", features = ["json"] } -hex = "0.4.2" -fork_choice = { path = "../../consensus/fork_choice" } -logging = { path = "../../common/logging" } +tempfile = { workspace = true } +serde_json = { workspace = true } +task_executor = { workspace = true } +tokio = { workspace = true } +futures = { workspace = true } +exit-future = { workspace = true } +environment = { workspace = true } +execution_layer = { workspace = true } +sensitive_url = { workspace = true } +types = { workspace = true } +unused_port = { workspace = true } +ethers-core = { workspace = true } +ethers-providers = { workspace = true } +deposit_contract = { workspace = true } +reqwest = { workspace = true } +hex = { workspace = true } +fork_choice = { workspace = true } +logging = { workspace = true } diff --git a/testing/node_test_rig/Cargo.toml b/testing/node_test_rig/Cargo.toml index ac77349c58e..5fe820d15b6 100644 --- a/testing/node_test_rig/Cargo.toml +++ b/testing/node_test_rig/Cargo.toml @@ -2,16 +2,16 @@ name = "node_test_rig" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [dependencies] -environment = { path = "../../lighthouse/environment" } -beacon_node = { path = "../../beacon_node" } -types = { path = "../../consensus/types" } -tempfile = "3.1.0" -eth2 = { path = "../../common/eth2" } -validator_client = { path = "../../validator_client" } -validator_dir = { path = "../../common/validator_dir", features = ["insecure_keys"] } -sensitive_url = { path = "../../common/sensitive_url" } -execution_layer = { path = "../../beacon_node/execution_layer" } -tokio = { version = "1.14.0", features = ["time"] } +environment = { workspace = true } +beacon_node = { workspace = true } +types = { workspace = true } +tempfile = { workspace = true } +eth2 = { workspace = true } +validator_client = { workspace = true } +validator_dir = { workspace = true } +sensitive_url = { workspace = true } +execution_layer = { workspace = true } +tokio = { workspace = true } diff --git a/testing/simulator/Cargo.toml b/testing/simulator/Cargo.toml index a01c133fd92..eadcaf51b20 100644 --- a/testing/simulator/Cargo.toml +++ b/testing/simulator/Cargo.toml @@ -2,20 +2,20 @@ name = "simulator" version = "0.2.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] node_test_rig = { path = "../node_test_rig" } -eth1 = {path = "../../beacon_node/eth1"} -execution_layer = {path = "../../beacon_node/execution_layer"} -types = { path = "../../consensus/types" } -parking_lot = "0.12.0" -futures = "0.3.7" -tokio = "1.14.0" -eth1_test_rig = { path = "../eth1_test_rig" } -env_logger = "0.9.0" -clap = "2.33.3" -rayon = "1.4.1" +eth1 = { workspace = true } +execution_layer = { workspace = true } +types = { workspace = true } +parking_lot = { workspace = true } +futures = { workspace = true } +tokio = { workspace = true } +eth1_test_rig = { workspace = true } +env_logger = { workspace = true } +clap = { workspace = true } +rayon = { workspace = true } sensitive_url = { path = "../../common/sensitive_url" } diff --git a/testing/state_transition_vectors/Cargo.toml b/testing/state_transition_vectors/Cargo.toml index a25b3c31c1a..8d930d13bc7 100644 --- a/testing/state_transition_vectors/Cargo.toml +++ b/testing/state_transition_vectors/Cargo.toml @@ -2,14 +2,14 @@ name = "state_transition_vectors" version = "0.1.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -state_processing = { path = "../../consensus/state_processing" } -types = { path = "../../consensus/types" } -ethereum_ssz = "0.5.0" -beacon_chain = { path = "../../beacon_node/beacon_chain" } -lazy_static = "1.4.0" -tokio = { version = "1.14.0", features = ["rt-multi-thread"] } +state_processing = { workspace = true } +types = { workspace = true } +ethereum_ssz = { workspace = true } +beacon_chain = { workspace = true } +lazy_static = { workspace = true } +tokio = { workspace = true } diff --git a/testing/test-test_logger/Cargo.toml b/testing/test-test_logger/Cargo.toml index 3d91862dbba..63bb87c06e5 100644 --- a/testing/test-test_logger/Cargo.toml +++ b/testing/test-test_logger/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "test-test_logger" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -logging = { path = "../../common/logging" } -slog = "2.7.0" +logging = { workspace = true } +slog = { workspace = true } diff --git a/testing/web3signer_tests/Cargo.toml b/testing/web3signer_tests/Cargo.toml index faad76a19c3..38b775b3928 100644 --- a/testing/web3signer_tests/Cargo.toml +++ b/testing/web3signer_tests/Cargo.toml @@ -1,31 +1,30 @@ [package] name = "web3signer_tests" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] [dev-dependencies] -eth2_keystore = { path = "../../crypto/eth2_keystore" } -types = { path = "../../consensus/types" } -tempfile = "3.1.0" -tokio = { version = "1.14.0", features = ["rt-multi-thread", "macros"] } -reqwest = { version = "0.11.0", features = ["json","stream"] } -url = "2.2.2" -validator_client = { path = "../../validator_client" } -slot_clock = { path = "../../common/slot_clock" } -futures = "0.3.7" -exit-future = "0.2.0" -task_executor = { path = "../../common/task_executor" } -environment = { path = "../../lighthouse/environment" } -account_utils = { path = "../../common/account_utils" } -serde = "1.0.116" -serde_derive = "1.0.116" -serde_yaml = "0.8.13" -eth2_network_config = { path = "../../common/eth2_network_config" } -serde_json = "1.0.58" -zip = "0.6" -lazy_static = "1.4.0" -parking_lot = "0.12.0" +eth2_keystore = { workspace = true } +types = { workspace = true } +tempfile = { workspace = true } +tokio = { workspace = true } +reqwest = { workspace = true } +url = { workspace = true } +validator_client = { workspace = true } +slot_clock = { workspace = true } +futures = { workspace = true } +exit-future = { workspace = true } +task_executor = { workspace = true } +environment = { workspace = true } +account_utils = { workspace = true } +serde = { workspace = true } +serde_yaml = { workspace = true } +eth2_network_config = { workspace = true } +serde_json = { workspace = true } +zip = { workspace = true } +lazy_static = { workspace = true } +parking_lot = { workspace = true } diff --git a/testing/web3signer_tests/tls/lighthouse/cert.pem b/testing/web3signer_tests/tls/lighthouse/cert.pem index 061b0e3cd7b..5746d19a165 100644 --- a/testing/web3signer_tests/tls/lighthouse/cert.pem +++ b/testing/web3signer_tests/tls/lighthouse/cert.pem @@ -1,32 +1,33 @@ -----BEGIN CERTIFICATE----- -MIIFmzCCA4OgAwIBAgIUXpTV/0rd/GAoCfCyzPOtwcb4t7YwDQYJKoZIhvcNAQEL +MIIFujCCA6KgAwIBAgIUELASgYwStCn/u/8tPByRADyCwLEwDQYJKoZIhvcNAQEL BQAwazELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlZBMREwDwYDVQQHDAhTb21lQ2l0 eTESMBAGA1UECgwJTXlDb21wYW55MRMwEQYDVQQLDApNeURpdmlzaW9uMRMwEQYD -VQQDDApsaWdodGhvdXNlMCAXDTIyMDUxMTEzNDEwOFoYDzIxMjIwNDE3MTM0MTA4 +VQQDDApsaWdodGhvdXNlMCAXDTIzMDkyMjAzMDA1N1oYDzIxMjMwODI5MDMwMDU3 WjBrMQswCQYDVQQGEwJVUzELMAkGA1UECAwCVkExETAPBgNVBAcMCFNvbWVDaXR5 MRIwEAYDVQQKDAlNeUNvbXBhbnkxEzARBgNVBAsMCk15RGl2aXNpb24xEzARBgNV -BAMMCmxpZ2h0aG91c2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC0 -HrD6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XBt/pRryiIlDyLenJwHmrv6p+P/FYvgnJHvAEtTynxYm5GA16YWy+Dj +c5XVgNHjV4TdX3GueAp+NhBBaHDFvYCbP/oXkRvNRQIDAQABo1QwUjALBgNVHQ8E +BAMCBDAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0RBAgwBocEfwAAATAdBgNV +HQ4EFgQUoeeF4G1qTRzLvO583qitbNDzr10wDQYJKoZIhvcNAQELBQADggIBAA9Y +YZP0pZLyovSnjyyuTR4KE9B+TSwqHe/LvH+7EAXLH+cwhyS7ADfJyt3mOCbKHZSo +dmJ5KWQ6M2Xn9Wq40BPk8mQPmAxy0nHg5beG03HYXOIsK8zgXTMad1+D1jnHPAda +ldXJ2Y+ljx4TDXKCWpTaq1+flqgRD3t98tOLuiULZ5jsTFX8Xbun7matcjziU5Lo +GWVQPWkb8Vx+3QyfbfiYJ7hggfYTxQsVJOXKuD8k2FMtKn5oTp3VwD2kY1q2X2Yk +HsDZJdYrvjWi2LcZDKoSNeusuLrv1XoUnwsAa3ng6drvoEU16vfILLYqH820UJ61 +/fFm3a9BFHRvPVd/WcSeIVc9jx9+32RIVxlppwCINnGMGE20kUZxu0TiMjTX9bCp +AouDuhwMt7z5jiQIi/CMxN6IlHBeVLqyK8ayWvH40xYgZTXlePpmLcQhcieNk7oJ +ard9jMfj4JhH5GbLXVptMBVJ0f9Ql4rW3EyNipvVKdkgTUNIeVm7LyUK220aT7ty +a0pGWHHViiF1MjGExo0P3gjZIML32TjZWlG3Nts5NAiyXDo4f78VeLyZQ7efVkub +GpjMf89vrmPdQhssoFr8fRFQObDe7hgxkgeiw9jgHItJl2/MWAxfsHV18HwiBqGW +QzaZR995YhU480jvA5XR8+EB6QUZeCEKunW8WK/F -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.key b/testing/web3signer_tests/tls/lighthouse/key.key index bbc69ca38bc..91bee6a783a 100644 --- a/testing/web3signer_tests/tls/lighthouse/key.key +++ b/testing/web3signer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C1KX0CX1qT1anVZq9bSMTG+M= -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.p12 b/testing/web3signer_tests/tls/lighthouse/key.p12 index 22b7d7f42545e5e8eb8996d09fae59cc796e9c82..d96ab477574f923701367fcd1ed4c5f6b1c45b35 100644 GIT binary patch literal 4371 zcmai&XD}QL*M_Y{^cH2KtZuEkdQH)LiQZQUqKg_q!sM*df)y=9??P5z7QrG& z)F_Ge=AG}G=lS{mICJLQ_nbLDuX_#*K|_TP0KyQ|14JbJF&Z)F6o5N`Vgz+F0fM^m zuUrR15S9LG5fvkdGX6@b_yD}WE$&|j05kh%Af$k4!Jz++{T5i=;y~$TsHAN00Q149ftXE*pH4{(gv#TgEp9r+pm1MG1G6 zXV@}_v1*!8Y3(!$g5A+exh=pyVg}C(F`wHW zeZ9oW)9LuaNiF8hgFNZ&;=E!S_2V0?x?#)g z*9nbSz(f`(%yjdO7%Sbi74V|IPnBQ2W+#e#GXY$($9Hd1!KO|n*5UzluQVsc5I%gs z5^QTOo}sppt9M5juzo~2+*8Vk@Ho&*&hrsL?c!cvqUXqM~$n>V!mcLqRv z={u}vz3iqC*dN;+9tm9~-FnhCLXY?&eC{*~)r-$Wdwwq<#w5yPvTmU@#L6zh1Uxf7 zTsaB9O=_R*6hVf6s!G!SCdS|uIzy!<+~e8zY= zUT}?5B4xA44eB5xMWtWU!djKbDvQ83OsmH{iK9owbb+9DGsgpiBTdb@U1eONUW9m+ zzKN=v!WA2InMloFL12RdPb>C7({V)^LmZJT?P3{et6dwO5j36eommTPK+!fz_|Y4X z2HsOSJzQM48fCAtN1W9hO3FfwSKM-uc8m~E#GJIDO+e4n{LwUhTxG4iSh~oU(j_Sf z!2QAwq0-sLn$$e+ve^zkl>0h1&gd#+Kb!b%bh|_#Y;@GSa`#?X4fIec^L!;;^(HK~ z@0QhDGX&lkugW>wHHS^WVq>`rqbko5#GU7EJx31+Id*Gi!=o{rB>-L?8F;HNoHtO4 zQL-v%Gx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MlM6$OPB!%CbL|b$@2=NlqX*EqmV2fFY9&sD7d2H_hhokL z4adC;-<&Jx)L5lUUej=-DK#-``I*_A5})N6^C$n{vFuFgA_Bp3g;d}uU%s%lXz8nR zVBfRVqbW#3-o0$9LEcqN!y21W8CvDuIqwV2dGCu*yhZLE`ZJJPC{! zuIVEwWZ1HEXLo@<`9mCs;60Xk6NC;(2mBg7xSl)M_t0PImOboM|V~492KpM65rG4{;^au36BtaU<~FD!tpf; zHX=fZvE)X>?DC#)`YLd1S|=`8fx{jPuA=wD@`OBT-J`ZU4X;tx3L+Yc{_VSCMMFg$ zstih6<-{BNxSjz~xJ~6DrK_cVz00Ism6nwK^x1QHiu8jF!7Is%tH%D7+6|Du?}Uhd znxq0tX%iQt*5`X!UuliXAs~<6*s7XSahKGvO4J^yB6;hZZ}!BNi7M~DZ9??b++Xh0 zheEV`7>g#ylE#;Z-nyzJJjMM2Pg;sqLPe2z+n)@6+-5E|jc-SEE&blO&#yuOt4f|H zu~bBaEr#7LgY;lnDG^i#Q=Pia?&4^#XKo6=|HqTE(KRoeUpls}K&rXDv)jV!(Rt@273IK$Syh;w(5D19J%|1}Dy z4`Sy+-3ibW(fy!$)L5d#O^1rLwd#S@%Us;Gc&m4J9pbuba5xnAz0>H6R?&s)Zhwt9 zw2pijmgThCk>s>|S0!sAgY!N7+~yP)Ng?&p1CUiEo6fl4xL-f0TE!EZFA%BQU%8uE z+oS$~l$verxX!nW2TJH2UULG?s?@-=A$;4}h+9y+ei3%0(u*-#%&7yuFKN5x!a`t!T0@5#A-zdM_?d)K`I zoD|QSO6tKv2I4=}A&cK5J8h zpY?y+88KJ@LI5Ii)~NCALa(P?yC;~9j*`?^CQ9=Q@H6uh0|Z{{l%!@jL(k diff --git a/testing/web3signer_tests/tls/lighthouse/web3signer.pem b/testing/web3signer_tests/tls/lighthouse/web3signer.pem index 460cb8b4003..4550214478a 100644 --- a/testing/web3signer_tests/tls/lighthouse/web3signer.pem +++ b/testing/web3signer_tests/tls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8lq0M7apWwK1FQUBECIlfw+ +tk9aq2zLl409vuqzgsWeffBcdVEDHGCLQauzYRtxMBbzLb33gWWd+9149dWeG5up +P0CZvdetgXhlcbusmrBWVn0O57/QDaGzEUZKxqoy8Ncv04KMYN1gOF+nO5cKn0R1 ++4yvb/NJTdo9WcdLcleqSL1Ju3kX1dCIPOpuaZ3aEwLHrvlNxT8Y5OMvRsYPINAU +6JfNGu21+Bq2nEqSqrw8Ys2hdGI+E95uXjPcsm8BZRCfxfkEeYVtx4ZaqMF+bkfD +d+uePSFp4VBWbg40RMVymr1YcNTX3CjvtLZDH4BZBdx/8YjUEUYPpC7xGoaQDGvA ++J9cVHRpxYpry5fbBmSvrKvKXU6aijLpM7etjYWzYFturpi52Ya9h3LIHd4RaBzB +0YzmatirLK/07YBUECsVcAlddIK5KOA5Nd7+oUikmrR1wMY+I/hym6fSTZGo/TDY +vDFERRj1XOOhlCzHx94SS1DS0rVTAj4uxbuZisaz -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/web3signer/cert.pem b/testing/web3signer_tests/tls/web3signer/cert.pem index 460cb8b4003..4550214478a 100644 --- a/testing/web3signer_tests/tls/web3signer/cert.pem +++ b/testing/web3signer_tests/tls/web3signer/cert.pem @@ -1,32 +1,33 @@ -----BEGIN CERTIFICATE----- -MIIFmzCCA4OgAwIBAgIUSHwf3lJKpa1BNR9rFOmxhoKTD1MwDQYJKoZIhvcNAQEL +MIIFujCCA6KgAwIBAgIUOVccYETgo2YpKO85U4XRKifK09kwDQYJKoZIhvcNAQEL BQAwazELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlZBMREwDwYDVQQHDAhTb21lQ2l0 eTESMBAGA1UECgwJTXlDb21wYW55MRMwEQYDVQQLDApNeURpdmlzaW9uMRMwEQYD -VQQDDAp3ZWIzc2lnbmVyMCAXDTIyMDUxMTEzNDEwOFoYDzIxMjIwNDE3MTM0MTA4 +VQQDDAp3ZWIzc2lnbmVyMCAXDTIzMDkyMjAzMDA1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matirLK/07YBUECsVcAlddIK5KOA5Nd7+oUikmrR1wMY+I/hym6fSTZGo/TDY +vDFERRj1XOOhlCzHx94SS1DS0rVTAj4uxbuZisaz -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/web3signer/key.key b/testing/web3signer_tests/tls/web3signer/key.key index 6e5171f3742..42b7ad9a944 100644 --- a/testing/web3signer_tests/tls/web3signer/key.key +++ b/testing/web3signer_tests/tls/web3signer/key.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -MIIJRQIBADANBgkqhkiG9w0BAQEFAASCCS8wggkrAgEAAoICAQDraQUU4O7K/aBA -iH86RV3ye/Q7vguwplUNku317chzyFdB+OnGSUga6+zjdUmr8+49nki1q0rLEU/x -J0NpffTdzFgk1nk6Jh7Ly26q18SNpwpuwdvbajnTeh+BPSWZQL85xfO9th/RkJkg -pzKukxK/npjvU6PbwiufSWI7mXNIgR0lIIacFXZ4RsD1PxZo/07ktoF0N+yLGW76 -yfeINRw43bG1MQxklePsk6zAUqJEi0tZmXqzh1NZHH5Q1VAEKKPWyAVTDi3bWmvh -3iSfgmckesjwUHANFeMhLpdiVTOi31OaILpx9HGRYYnqjW1AUZLoSMKkyPsm6IN6 -0GpAVI7TP3URVpTPPW78UeEUyeYN06tABYJsFWGFChg9Hf2yvcZU2DDGdHpxut6h -4WAwx9oL5rG4VSxFjhVi6ty3Hb9B0YFE/WNfV07wWPSQADZSK/ktfhE+8zavQzjs -xm2f1Ko5L/x8cIc5MS1xyaXn/UkoqH3QdWZC1aLs9NCl4F8ZE06gjjvN9WdsCXmT -EShqaXoRsZG7SfcQsu4gUUZ/fjbJ5hRf+QxMMKv42SUpqsRhslEF/Pqu0WQd82Cg -G1a7XnfUO8BYSchTJZL55vx40ZZuQAu/ULsF7toa0lktijBxCPn38HEnyLEyA3e8 -a93P0myWoxFn/fUpegT3TVSv33anqwIDAQABAoICAQDihR2kp4Rfw4luT2nNUm5C -JFAxJH/vLT5uX1Gm8XWPI9oC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eYUW+8nypG2jprKezMVSNu+lWHanE +vw+fLvRWyDEdKQK6RHOytHppFn48eC5HrPdOe4EaNQ09vUiMsJmVL6ep4nuAg4nr +WilB9iJQtrFcItB5tnfD2puJQKaFV3rgqWCFIgJJg0ThuiWyoVNKtlRvv5o3mQyz +Y+jyCm4RtgSDm9+e/Tcv2vUeoiNt2bVb9tK3r2M2cZ6N1PuHV/cmBjf6I/ssPqmM +CXDusRSlsQNpzHc6QKq8IDZLut9g -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/web3signer/key.p12 b/testing/web3signer_tests/tls/web3signer/key.p12 index 459f4fb62e8abcc9d97ebb6d19435da2de188422..51269be8d0ff0d62646848e81ab350c5af415c24 100644 GIT binary patch literal 4371 zcmai&WmFRk`^I4m7-N(pq^6YQaFnFdNOwpG14SCAFiLVrPIAa7>5v!=(jg!qp@Q^~ zZV(WVRA1lo|DWgi_B61(i^wX5=XiDJ5wxhQ1Mq zp|AZbS0XSJ`TtrJxflxEUnv1VO7eF_|Lc$PQA86#~-tOOU(ZX15>{hW1p9_76=%F%&m#olC8- zFT0Y1QAXKZqaqA7qX_Yu6UCC|WXw`pud#7YNJn+-o-jIZda;Q;M;FY%eds4o&k+**gadBq8 z572DaO@=Z-T`;!wM;WI^_g+^^8y>jN3DeukH);y+B-a~sMOP<9nF%VwNnhpAj5ja* zuDH6-IOzZ6nwA%*U3XaaE?(be*$vtMTFKlH+LO-0-r1R-ql!fb2`^`}#ueKQ8U@0$ zLKu(V!$a>lV%Pn|Z1GJvhe_y|cP75sD$VOyB7tEn}wKI2$C!7PKcKh6Sp8?q}0d+yJ@sk8r`IqhLx_mWsm+C=A|X zedYiXmd@L#sda)S+xKN+5xEU?PUyVE-)#0SYPB0*^^DNygfCA zr8jwWylrXf3v+W856)OiR>yJc_enwfeP@GE z6T9WTn~i_E+t@U2ynclv?ZyW5vF1O?D=Z%CnJj%=bfV%a6>2LJ6G!=LXrb>aYU2@4 z{bnbtCC?pGBe(f}=hJ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=-aMN)(fo|` zZa&bCq1PTuZe4~rAN213wlol", "Age Manning ", "Luke Anderson "] -edition = "2021" +edition = { workspace = true } [lib] name = "validator_client" path = "src/lib.rs" [dev-dependencies] -tokio = { version = "1.14.0", features = ["time", "rt-multi-thread", "macros"] } +tokio = { workspace = true } [dependencies] -tree_hash = "0.5.0" -clap = "2.33.3" -slashing_protection = { path = "./slashing_protection" } -slot_clock = { path = "../common/slot_clock" } -types = { path = "../consensus/types" } -safe_arith = { path = "../consensus/safe_arith" } -serde = "1.0.116" +tree_hash = { workspace = true } +clap = { workspace = true } +slashing_protection = { workspace = true } +slot_clock = { workspace = true } +types = { workspace = true } +safe_arith = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -bincode = "1.3.1" -serde_json = "1.0.58" -slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } -tokio = { version = "1.14.0", features = ["time"] } -tokio-stream = { version = "0.1.3", features = ["sync"] } -futures = "0.3.7" -dirs = "3.0.1" -directory = { path = "../common/directory" } -lockfile = { path = "../common/lockfile" } -environment = { path = "../lighthouse/environment" } -parking_lot = "0.12.0" -exit-future = "0.2.0" -filesystem = { path = "../common/filesystem" } -hex = "0.4.2" -deposit_contract = { path = "../common/deposit_contract" } -bls = { path = "../crypto/bls" } -eth2 = { path = "../common/eth2" } -tempfile = "3.1.0" -validator_dir = { path = "../common/validator_dir" } -clap_utils = { path = "../common/clap_utils" } -eth2_keystore = { path = "../crypto/eth2_keystore" } -account_utils = { path = "../common/account_utils" } -lighthouse_version = { path = "../common/lighthouse_version" } -warp_utils = { path = "../common/warp_utils" } -warp = "0.3.2" -hyper = "0.14.4" -ethereum_serde_utils = "0.5.0" -libsecp256k1 = "0.7.0" -ring = "0.16.19" -rand = { version = "0.8.5", features = ["small_rng"] } -lighthouse_metrics = { path = "../common/lighthouse_metrics" } -lazy_static = "1.4.0" -itertools = "0.10.0" -monitoring_api = { path = "../common/monitoring_api" } -sensitive_url = { path = "../common/sensitive_url" } -task_executor = { path = "../common/task_executor" } -reqwest = { version = "0.11.0", features = ["json","stream"] } -url = "2.2.2" -malloc_utils = { path = "../common/malloc_utils" } -sysinfo = "0.26.5" +bincode = { workspace = true } +serde_json = { workspace = true } +slog = { workspace = true } +tokio = { workspace = true } +tokio-stream = { workspace = true } +futures = { workspace = true } +dirs = { workspace = true } +directory = { workspace = true } +lockfile = { workspace = true } +environment = { workspace = true } +parking_lot = { workspace = true } +exit-future = { workspace = true } +filesystem = { workspace = true } +hex = { workspace = true } +deposit_contract = { workspace = true } +bls = { workspace = true } +eth2 = { workspace = true } +tempfile = { workspace = true } +validator_dir = { workspace = true } +clap_utils = { workspace = true } +eth2_keystore = { workspace = true } +account_utils = { workspace = true } +lighthouse_version = { workspace = true } +warp_utils = { workspace = true } +warp = { workspace = true } +hyper = { workspace = true } +ethereum_serde_utils = { workspace = true } +libsecp256k1 = { workspace = true } +ring = { workspace = true } +rand = { workspace = true, features = ["small_rng"] } +lighthouse_metrics = { workspace = true } +lazy_static = { workspace = true } +itertools = { workspace = true } +monitoring_api = { workspace = true } +sensitive_url = { workspace = true } +task_executor = { workspace = true } +reqwest = { workspace = true } +url = { workspace = true } +malloc_utils = { workspace = true } +sysinfo = { workspace = true } system_health = { path = "../common/system_health" } -logging = { path = "../common/logging" } +logging = { workspace = true } diff --git a/validator_client/slashing_protection/Cargo.toml b/validator_client/slashing_protection/Cargo.toml index 278dc22d0de..cc90c979b9a 100644 --- a/validator_client/slashing_protection/Cargo.toml +++ b/validator_client/slashing_protection/Cargo.toml @@ -2,7 +2,7 @@ name = "slashing_protection" version = "0.1.0" authors = ["Michael Sproul ", "pscott "] -edition = "2021" +edition = { workspace = true } autotests = false [[test]] @@ -10,21 +10,21 @@ name = "slashing_protection_tests" path = "tests/main.rs" [dependencies] -tempfile = "3.1.0" -types = { path = "../../consensus/types" } -rusqlite = { version = "0.28.0", features = ["bundled"] } -r2d2 = "0.8.9" +tempfile = { workspace = true } +types = { workspace = true } +rusqlite = { workspace = true } +r2d2 = { workspace = true } r2d2_sqlite = "0.21.0" -serde = "1.0.116" +serde = { workspace = true } serde_derive = "1.0.116" -serde_json = "1.0.58" -ethereum_serde_utils = "0.5.0" -filesystem = { path = "../../common/filesystem" } -arbitrary = { version = "1.0", features = ["derive"], optional = true } +serde_json = { workspace = true } +ethereum_serde_utils = { workspace = true } +filesystem = { workspace = true } +arbitrary = { workspace = true, features = ["derive"] } [dev-dependencies] -lazy_static = "1.4.0" -rayon = "1.4.1" +lazy_static = { workspace = true } +rayon = { workspace = true } [features] -arbitrary-fuzz = ["arbitrary", "types/arbitrary-fuzz"] +arbitrary-fuzz = ["types/arbitrary-fuzz"] diff --git a/validator_manager/Cargo.toml b/validator_manager/Cargo.toml index 851510820e8..35af2b1ce73 100644 --- a/validator_manager/Cargo.toml +++ b/validator_manager/Cargo.toml @@ -1,30 +1,29 @@ [package] name = "validator_manager" version = "0.1.0" -edition = "2021" +edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bls = { path = "../crypto/bls" } -clap = "2.33.3" -types = { path = "../consensus/types" } -environment = { path = "../lighthouse/environment" } -eth2_network_config = { path = "../common/eth2_network_config" } -clap_utils = { path = "../common/clap_utils" } -eth2_wallet = { path = "../crypto/eth2_wallet" } -eth2_keystore = { path = "../crypto/eth2_keystore" } -account_utils = { path = "../common/account_utils" } -serde = { version = "1.0.116", features = ["derive"] } -serde_json = "1.0.58" -ethereum_serde_utils = "0.5.0" -tree_hash = "0.5.0" -eth2 = { path = "../common/eth2", features = ["lighthouse"]} -hex = "0.4.2" -tokio = { version = "1.14.0", features = ["time", "rt-multi-thread", "macros"] } +bls = { workspace = true } +clap = { workspace = true } +types = { workspace = true } +environment = { workspace = true } +eth2_network_config = { workspace = true } +clap_utils = { workspace = true } +eth2_wallet = { workspace = true } +eth2_keystore = { workspace = true } +account_utils = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +ethereum_serde_utils = { workspace = true } +tree_hash = { workspace = true } +eth2 = { workspace = true } +hex = { workspace = true } +tokio = { workspace = true } [dev-dependencies] -tempfile = "3.1.0" -regex = "1.6.0" -eth2_network_config = { path = "../common/eth2_network_config" } -validator_client = { path = "../validator_client" } +tempfile = { workspace = true } +regex = { workspace = true } +validator_client = { workspace = true } diff --git a/watch/Cargo.toml b/watch/Cargo.toml index 3dc3b7c1905..67cbc3cc233 100644 --- a/watch/Cargo.toml +++ b/watch/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "watch" version = "0.1.0" -edition = "2018" +edition = { workspace = true } [lib] name = "watch" @@ -14,35 +14,35 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "2.33.3" -log = "0.4.14" -env_logger = "0.9.0" -types = { path = "../consensus/types" } -eth2 = { path = "../common/eth2" } -beacon_node = { path = "../beacon_node"} -tokio = { version = "1.14.0", features = ["time"] } +clap = { workspace = true } +log = { workspace = true } +env_logger = { workspace = true } +types = { workspace = true } +eth2 = { workspace = true } +beacon_node = { workspace = true } +tokio = { workspace = true } axum = "0.6.18" -hyper = "0.14.20" -serde = "1.0.116" -serde_json = "1.0.58" -reqwest = { version = "0.11.0", features = ["json","stream"] } -url = "2.2.2" -rand = "0.7.3" +hyper = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +reqwest = { workspace = true } +url = { workspace = true } +rand = { workspace = true } diesel = { version = "2.0.2", features = ["postgres", "r2d2"] } diesel_migrations = { version = "2.0.0", features = ["postgres"] } -byteorder = "1.4.3" -bls = { path = "../crypto/bls" } -hex = "0.4.2" -r2d2 = "0.8.9" -serde_yaml = "0.8.24" +byteorder = { workspace = true } +bls = { workspace = true } +hex = { workspace = true } +r2d2 = { workspace = true } +serde_yaml = { workspace = true } [dev-dependencies] tokio-postgres = "0.7.5" -http_api = { path = "../beacon_node/http_api" } -beacon_chain = { path = "../beacon_node/beacon_chain" } -network = { path = "../beacon_node/network" } +http_api = { workspace = true } +beacon_chain = { workspace = true } +network = { workspace = true } # TODO: update to 0.15 when released: https://github.com/testcontainers/testcontainers-rs/issues/497 testcontainers = { git = "https://github.com/testcontainers/testcontainers-rs/", rev = "0f2c9851" } -unused_port = { path = "../common/unused_port" } -task_executor = { path = "../common/task_executor" } -logging = { path = "../common/logging" } +unused_port = { workspace = true } +task_executor = { workspace = true } +logging = { workspace = true } From fbb6997309a28cec503e660af154f7f1d1905443 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 22 Sep 2023 11:04:47 +0000 Subject: [PATCH 26/27] Fix release CI for self-hosted runners (#4770) ## Issue Addressed NA ## Proposed Changes Disables some commands for self-hosted runners to prevent failures. ## Additional Info NA --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62eadd0451a..24ca09ec00e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,8 @@ env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} REPO_NAME: ${{ github.repository_owner }}/lighthouse IMAGE_NAME: ${{ github.repository_owner }}/lighthouse + # Enable self-hosted runners for the sigp repo only. + SELF_HOSTED_RUNNERS: ${{ github.repository == 'sigp/lighthouse' }} jobs: extract-version: @@ -68,6 +70,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - name: Get latest version of stable Rust + if: env.SELF_HOSTED_RUNNERS == 'false' run: rustup update stable # ============================== @@ -75,7 +78,7 @@ jobs: # ============================== - uses: KyleMayes/install-llvm-action@v1 - if: startsWith(matrix.arch, 'x86_64-windows') + if: env.SELF_HOSTED_RUNNERS == 'false' && startsWith(matrix.arch, 'x86_64-windows') with: version: "15.0" directory: ${{ runner.temp }}/llvm From 0f05499e304989e1eab0e50ffd8079e1198387e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 22 Sep 2023 12:00:51 +0000 Subject: [PATCH 27/27] Fix cli options (#4772) ## Issue Addressed Fixes breaking change introduced on https://github.com/sigp/lighthouse/pull/4674/ that doesn't allow multiple `http_enabled` `ArgGroup` flags --- beacon_node/src/cli.rs | 2 +- lighthouse/tests/beacon_node.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index dacff79f6ca..15f8f565516 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -1273,5 +1273,5 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .default_value("64") .takes_value(true) ) - .group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"])) + .group(ArgGroup::with_name("enable_http").args(&["http", "gui", "staking"]).multiple(true)) } diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index cb51dffdced..bc6b6284e5a 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -2337,6 +2337,18 @@ fn gui_flag() { }); } +#[test] +fn multiple_http_enabled_flags() { + CommandLineTest::new() + .flag("gui", None) + .flag("http", None) + .flag("staking", None) + .run_with_zero_port() + .with_config(|config| { + assert!(config.http_api.enabled); + }); +} + #[test] fn optimistic_finalized_sync_default() { CommandLineTest::new()