diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fd5799a5083..8145503e707 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,7 +57,7 @@ jobs: build-docker-single-arch: name: build-docker-${{ matrix.binary }}${{ matrix.features.version_suffix }} # Use self-hosted runners only on the sigp repo. - runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "large"]') || 'ubuntu-22.04' }} + runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "release"]') || 'ubuntu-22.04' }} strategy: matrix: binary: [aarch64, @@ -79,7 +79,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Update Rust - if: env.SELF_HOSTED_RUNNERS == false + if: env.SELF_HOSTED_RUNNERS == 'false' run: rustup update stable - name: Dockerhub login run: | @@ -107,9 +107,11 @@ jobs: run: echo "MODERNITY_SUFFIX=-modern" >> $GITHUB_ENV; - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e38b03daf70..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: @@ -38,36 +40,37 @@ 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 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 diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 5c3aa2bde6f..1b8a3b2c0c1 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 @@ -140,7 +140,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 @@ -166,7 +166,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 diff --git a/Cargo.lock b/Cargo.lock index 4c62adb5f1e..54b8830c020 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", @@ -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", ] @@ -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" @@ -347,7 +347,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", @@ -377,7 +377,7 @@ checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -388,7 +388,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -399,7 +399,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -423,7 +423,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -461,15 +461,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" @@ -495,7 +486,7 @@ dependencies = [ "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.12", + "pin-project-lite", "rustversion", "serde", "serde_json", @@ -527,9 +518,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", @@ -566,9 +557,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -599,7 +590,7 @@ dependencies = [ name = "beacon_chain" version = "0.2.0" dependencies = [ - "bitvec 0.20.4", + "bitvec 1.0.1", "bls", "derivative", "environment", @@ -629,12 +620,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", @@ -647,7 +637,7 @@ dependencies = [ "state_processing", "store", "strum", - "superstruct 0.5.0", + "superstruct", "task_executor", "tempfile", "tokio", @@ -655,12 +645,11 @@ dependencies = [ "tree_hash", "tree_hash_derive", "types", - "unused_port", ] [[package]] name = "beacon_node" -version = "4.4.1" +version = "4.5.0" dependencies = [ "beacon_chain", "clap 2.34.0", @@ -766,7 +755,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.29", + "syn 2.0.37", "which", ] @@ -852,7 +841,7 @@ dependencies = [ "ethereum_ssz", "hex", "milagro_bls", - "rand 0.7.3", + "rand", "serde", "serde_derive", "tree_hash", @@ -883,7 +872,7 @@ dependencies = [ [[package]] name = "boot_node" -version = "4.4.1" +version = "4.5.0" dependencies = [ "beacon_node", "clap 2.34.0", @@ -936,9 +925,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" @@ -954,9 +943,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", ] @@ -1065,9 +1054,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", @@ -1115,14 +1104,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]] @@ -1202,7 +1191,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1250,6 +1239,7 @@ dependencies = [ "logging", "monitoring_api", "network", + "num_cpus", "operation_pool", "parking_lot 0.12.1", "sensitive_url", @@ -1432,7 +1422,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", @@ -1468,9 +1458,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", @@ -1540,11 +1530,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.2", + "nix 0.27.1", "windows-sys 0.48.0", ] @@ -1563,16 +1553,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", @@ -1586,7 +1576,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1713,7 +1703,7 @@ dependencies = [ "hex", "reqwest", "serde_json", - "sha2 0.10.7", + "sha2 0.9.9", "tree_hash", "types", ] @@ -1755,9 +1745,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" @@ -1778,7 +1768,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1796,9 +1786,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", @@ -1810,14 +1800,14 @@ 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", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -1837,7 +1827,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]] @@ -1933,7 +1923,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", @@ -1952,7 +1942,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -2009,7 +1999,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", @@ -2085,7 +2075,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", @@ -2100,9 +2090,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", ] @@ -2119,7 +2109,7 @@ dependencies = [ "hex", "k256 0.11.6", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "sha3 0.10.8", @@ -2132,13 +2122,13 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "ed25519-dalek", "hex", "k256 0.13.1", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "serde-hex", @@ -2160,9 +2150,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", @@ -2211,18 +2201,18 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f94c0e13118e7d7533271f754a168ae8400e6a1cc043f2bfd53cc7290f1a1de3" +checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" dependencies = [ "serde", ] [[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", @@ -2273,7 +2263,7 @@ dependencies = [ "slog", "sloggers", "state_processing", - "superstruct 0.5.0", + "superstruct", "task_executor", "tokio", "tree_hash", @@ -2359,7 +2349,7 @@ dependencies = [ "hex", "num-bigint-dig", "ring", - "sha2 0.10.7", + "sha2 0.9.9", "zeroize", ] @@ -2373,7 +2363,7 @@ dependencies = [ "hex", "hmac 0.11.0", "pbkdf2 0.8.0", - "rand 0.8.5", + "rand", "scrypt", "serde", "serde_json", @@ -2389,6 +2379,7 @@ dependencies = [ name = "eth2_network_config" version = "0.2.0" dependencies = [ + "bytes", "discv5", "eth2_config", "ethereum_ssz", @@ -2399,9 +2390,10 @@ dependencies = [ "sensitive_url", "serde_json", "serde_yaml", - "sha2 0.10.7", + "sha2 0.9.9", "slog", "tempfile", + "tokio", "types", "url", "zip", @@ -2414,7 +2406,7 @@ dependencies = [ "eth2_key_derivation", "eth2_keystore", "hex", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_repr", @@ -2505,7 +2497,7 @@ dependencies = [ "integer-sqrt", "multiaddr 0.14.0", "multihash 0.16.3", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_yaml", @@ -2670,7 +2662,7 @@ dependencies = [ "k256 0.11.6", "once_cell", "open-fastrlp", - "rand 0.8.5", + "rand", "rlp", "rlp-derive", "serde", @@ -2692,7 +2684,6 @@ dependencies = [ "auto_impl", "base64 0.13.1", "ethers-core", - "futures-channel", "futures-core", "futures-timer", "futures-util", @@ -2708,7 +2699,6 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite 0.17.2", "tracing", "tracing-futures", "url", @@ -2753,7 +2743,9 @@ dependencies = [ name = "execution_layer" version = "0.1.0" dependencies = [ + "arc-swap", "async-trait", + "axum", "builder_client", "bytes", "environment", @@ -2768,6 +2760,7 @@ dependencies = [ "hash-db", "hash256-std-hasher", "hex", + "hyper", "jsonwebtoken", "keccak-hash", "kzg", @@ -2777,7 +2770,7 @@ dependencies = [ "mev-rs", "parking_lot 0.12.1", "pretty_reqwest_error", - "rand 0.8.5", + "rand", "reqwest", "sensitive_url", "serde", @@ -2788,7 +2781,7 @@ dependencies = [ "ssz_types", "state_processing", "strum", - "superstruct 0.6.0", + "superstruct", "task_executor", "tempfile", "tokio", @@ -2875,9 +2868,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" @@ -2897,6 +2890,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" @@ -2904,7 +2903,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2917,7 +2916,7 @@ checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "arbitrary", "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -3060,7 +3059,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.12", + "pin-project-lite", "waker-fn", ] @@ -3072,7 +3071,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -3082,7 +3081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.21.6", + "rustls", ] [[package]] @@ -3127,7 +3126,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite", "pin-utils", "slab", ] @@ -3180,10 +3179,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]] @@ -3211,9 +3208,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" @@ -3267,9 +3264,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", @@ -3362,21 +3359,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", @@ -3506,7 +3502,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.12", + "pin-project-lite", ] [[package]] @@ -3552,7 +3548,6 @@ dependencies = [ "tokio-stream", "tree_hash", "types", - "unused_port", "warp", "warp_utils", ] @@ -3612,7 +3607,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.12", + "pin-project-lite", "socket2 0.4.9", "tokio", "tower-service", @@ -3629,9 +3624,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.6", + "rustls", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -3755,7 +3750,7 @@ checksum = "556b5a75cd4adb7c4ea21c64af1c48cefb2ce7d43dc4352c720a1fe47c21f355" dependencies = [ "attohttpc", "log", - "rand 0.8.5", + "rand", "url", "xmltree", ] @@ -3775,7 +3770,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]] @@ -3828,7 +3823,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", ] @@ -3898,10 +3893,10 @@ 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 0.50.0", + "winreg", ] [[package]] @@ -3917,7 +3912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.8", + "rustix 0.38.13", "windows-sys 0.48.0", ] @@ -3991,7 +3986,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.4", "pem", "ring", "serde", @@ -4069,7 +4064,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -4080,7 +4075,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lcli" -version = "4.4.1" +version = "4.5.0" dependencies = [ "account_utils", "beacon_chain", @@ -4142,9 +4137,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" @@ -4222,7 +4217,6 @@ dependencies = [ "libp2p-quic", "libp2p-swarm", "libp2p-tcp", - "libp2p-websocket", "libp2p-yamux", "multiaddr 0.18.0", "pin-project", @@ -4266,17 +4260,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", ] @@ -4302,7 +4296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d157562dba6017193e5285acf6b1054759e83540bfd79f75b69d6ce774c88da" dependencies = [ "asynchronous-codec", - "base64 0.21.2", + "base64 0.21.4", "byteorder", "bytes", "either", @@ -4319,11 +4313,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", ] @@ -4360,10 +4354,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", @@ -4384,9 +4378,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", @@ -4422,9 +4416,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]] @@ -4434,16 +4428,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", @@ -4465,7 +4459,7 @@ dependencies = [ "libp2p-identity", "log", "quick-protobuf", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -4484,9 +4478,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", ] @@ -4508,7 +4502,7 @@ dependencies = [ "log", "multistream-select", "once_cell", - "rand 0.8.5", + "rand", "smallvec 1.11.0", "tokio", "void", @@ -4524,7 +4518,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -4540,7 +4534,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.3", + "socket2 0.5.4", "tokio", ] @@ -4556,33 +4550,13 @@ dependencies = [ "libp2p-identity", "rcgen", "ring", - "rustls 0.21.6", + "rustls", "rustls-webpki", "thiserror", "x509-parser", "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" @@ -4609,7 +4583,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -4668,7 +4642,7 @@ dependencies = [ [[package]] name = "lighthouse" -version = "4.4.1" +version = "4.5.0" dependencies = [ "account_manager", "account_utils", @@ -4735,6 +4709,7 @@ dependencies = [ "lazy_static", "libp2p", "libp2p-mplex", + "libp2p-quic", "lighthouse_metrics", "lighthouse_version", "lru 0.7.8", @@ -4743,11 +4718,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", @@ -4755,7 +4730,7 @@ dependencies = [ "snap", "ssz_types", "strum", - "superstruct 0.5.0", + "superstruct", "task_executor", "tempfile", "tiny-keccak", @@ -4799,9 +4774,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" @@ -4830,7 +4805,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ - "autocfg 1.1.0", + "autocfg", "scopeguard", ] @@ -4988,9 +4963,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" @@ -4998,7 +4973,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -5007,7 +4982,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -5073,7 +5048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] @@ -5089,13 +5064,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", ] @@ -5167,24 +5142,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" @@ -5199,7 +5156,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", "url", ] @@ -5214,11 +5171,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", ] @@ -5243,17 +5200,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]] @@ -5281,7 +5238,7 @@ dependencies = [ "log", "pin-project", "smallvec 1.11.0", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -5396,9 +5353,10 @@ dependencies = [ "logging", "lru_cache", "matches", + "num_cpus", "operation_pool", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rlp", "slog", "slog-async", @@ -5442,14 +5400,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "libc", - "static_assertions", ] [[package]] @@ -5511,29 +5468,28 @@ 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", + "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", @@ -5545,7 +5501,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", ] @@ -5555,7 +5511,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", ] @@ -5566,7 +5522,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -5590,9 +5546,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -5658,11 +5614,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", @@ -5679,7 +5635,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -5690,18 +5646,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.91" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -5724,7 +5680,7 @@ dependencies = [ "lighthouse_metrics", "maplit", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rayon", "serde", "serde_derive", @@ -5768,15 +5724,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", ] @@ -5794,9 +5750,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", @@ -5855,7 +5811,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec 1.11.0", - "windows-targets 0.48.3", + "windows-targets 0.48.5", ] [[package]] @@ -5875,15 +5831,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" @@ -5980,20 +5927,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -6035,9 +5976,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" @@ -6073,13 +6014,13 @@ 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", "libc", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "windows-sys 0.48.0", ] @@ -6108,27 +6049,27 @@ 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.4", "byteorder", "bytes", "fallible-iterator", "hmac 0.12.1", "md-5", "memchr", - "rand 0.8.5", + "rand", "sha2 0.10.7", "stringprep", ] [[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", @@ -6165,7 +6106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6246,20 +6187,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", ] @@ -6314,7 +6255,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -6327,7 +6268,7 @@ dependencies = [ "serde", "serde_derive", "serde_yaml", - "superstruct 0.5.0", + "superstruct", "types", ] @@ -6381,43 +6322,31 @@ 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", "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" @@ -6426,11 +6355,11 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "futures-io", - "pin-project-lite 0.2.12", + "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.6", + "rustls", "thiserror", "tokio", "tracing", @@ -6438,15 +6367,15 @@ 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", + "rand", "ring", "rustc-hash", - "rustls 0.21.6", + "rustls", "slab", "thiserror", "tinyvec", @@ -6461,7 +6390,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.3", + "socket2 0.5.4", "tracing", "windows-sys 0.48.0", ] @@ -6508,19 +6437,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" @@ -6528,20 +6444,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" @@ -6570,15 +6476,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" @@ -6653,14 +6550,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -6674,13 +6571,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -6691,17 +6588,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.4", "bytes", "encoding_rs", "futures-core", @@ -6719,15 +6616,15 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.12", - "rustls 0.21.6", + "pin-project-lite", + "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", @@ -6735,8 +6632,8 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.22.6", - "winreg 0.10.1", + "webpki-roots", + "winreg", ] [[package]] @@ -6779,7 +6676,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", + "spin", "untrusted", "web-sys", "winapi", @@ -6846,7 +6743,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", ] @@ -6917,34 +6814,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +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", @@ -6958,14 +6843,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "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", @@ -7024,7 +6909,7 @@ checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "cfg-if", "derive_more", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info-derive", ] @@ -7168,9 +7053,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", ] @@ -7208,20 +7093,20 @@ 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", - "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", @@ -7246,7 +7131,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -7304,30 +7189,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" -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" @@ -7396,9 +7257,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" @@ -7461,17 +7322,17 @@ 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", + "autocfg", ] [[package]] @@ -7493,7 +7354,7 @@ dependencies = [ "lru 0.7.8", "maplit", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "rayon", "safe_arith", "serde", @@ -7554,9 +7415,9 @@ dependencies = [ [[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", @@ -7685,7 +7546,7 @@ dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0", + "curve25519-dalek 4.1.0", "rand_core 0.6.4", "ring", "rustc_version", @@ -7705,41 +7566,20 @@ 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", ] -[[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" 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" @@ -7875,10 +7715,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", ] @@ -7923,20 +7764,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" @@ -7973,9 +7800,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", @@ -8089,14 +7916,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.13", "windows-sys 0.48.0", ] @@ -8146,7 +7973,7 @@ dependencies = [ "hex", "hmac 0.12.1", "log", - "rand 0.8.5", + "rand", "serde", "serde_json", "sha2 0.10.7", @@ -8163,22 +7990,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]] @@ -8202,9 +8029,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", @@ -8223,9 +8050,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", ] @@ -8243,17 +8070,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", @@ -8306,9 +8133,9 @@ 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", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -8319,7 +8146,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", ] @@ -8331,7 +8158,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -8346,9 +8173,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", @@ -8360,23 +8187,14 @@ dependencies = [ "parking_lot 0.12.1", "percent-encoding", "phf", - "pin-project-lite 0.2.12", + "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.5.3", + "rand", + "socket2 0.5.4", "tokio", "tokio-util 0.7.8", -] - -[[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", + "whoami", ] [[package]] @@ -8385,7 +8203,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls", "tokio", ] @@ -8396,39 +8214,11 @@ 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", ] -[[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" @@ -8440,7 +8230,7 @@ dependencies = [ "futures-io", "futures-sink", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "slab", "tokio", ] @@ -8454,7 +8244,7 @@ dependencies = [ "bytes", "futures-core", "futures-sink", - "pin-project-lite 0.2.12", + "pin-project-lite", "slab", "tokio", "tracing", @@ -8471,9 +8261,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", @@ -8492,9 +8282,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", @@ -8512,7 +8302,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.12", + "pin-project-lite", "tokio", "tower-layer", "tower-service", @@ -8539,7 +8329,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.12", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -8552,7 +8342,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", ] [[package]] @@ -8671,7 +8461,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec 1.11.0", "socket2 0.4.9", "thiserror", @@ -8707,51 +8497,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 0.10.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" @@ -8782,7 +8532,7 @@ dependencies = [ "metastruct", "parking_lot 0.12.1", "paste", - "rand 0.8.5", + "rand", "rand_xorshift", "rayon", "regex", @@ -8797,7 +8547,7 @@ dependencies = [ "ssz_types", "state_processing", "strum", - "superstruct 0.6.0", + "superstruct", "swap_or_not_shuffle", "tempfile", "test_random_derive", @@ -8827,9 +8577,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", ] @@ -8842,9 +8592,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" @@ -8889,9 +8639,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", @@ -8914,21 +8664,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 = "utf8parse" version = "0.2.1" @@ -8976,7 +8720,7 @@ dependencies = [ "malloc_utils", "monitoring_api", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "reqwest", "ring", "safe_arith", @@ -9013,7 +8757,7 @@ dependencies = [ "filesystem", "hex", "lockfile", - "rand 0.8.5", + "rand", "tempfile", "tree_hash", "types", @@ -9082,9 +8826,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", @@ -9102,7 +8846,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", @@ -9113,7 +8857,6 @@ dependencies = [ "log", "mime", "mime_guess", - "multer", "percent-encoding", "pin-project", "rustls-pemfile", @@ -9122,9 +8865,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", @@ -9181,7 +8923,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -9215,7 +8957,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9228,9 +8970,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", @@ -9275,7 +9017,7 @@ dependencies = [ "logging", "network", "r2d2", - "rand 0.7.3", + "rand", "reqwest", "serde", "serde_json", @@ -9313,7 +9055,6 @@ dependencies = [ "parking_lot 0.12.1", "reqwest", "serde", - "serde_derive", "serde_json", "serde_yaml", "slot_clock", @@ -9326,25 +9067,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" @@ -9362,6 +9084,16 @@ dependencies = [ "once_cell", ] +[[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" @@ -9430,7 +9162,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]] @@ -9460,7 +9192,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]] @@ -9480,17 +9212,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]] @@ -9501,9 +9233,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" @@ -9519,9 +9251,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" @@ -9537,9 +9269,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" @@ -9555,9 +9287,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" @@ -9573,9 +9305,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" @@ -9585,9 +9317,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" @@ -9603,28 +9335,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" @@ -9699,9 +9422,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" @@ -9732,7 +9455,7 @@ dependencies = [ "nohash-hasher", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "static_assertions", ] @@ -9762,7 +9485,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 aa9ccd5e295..7c00d175d25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,10 +90,139 @@ 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", "nested-values"] } +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" } +kzg = { path = "crypto/kzg" } +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/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/Makefile b/Makefile index 19d04bdae68..0236b445248 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,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/account_manager/src/validator/exit.rs b/account_manager/src/validator/exit.rs index 6eb21ce304b..bc9e0ee1dd6 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/Cargo.toml b/beacon_node/Cargo.toml index c3f3cc7bbc9..276faaecdd4 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "beacon_node" -version = "4.4.1" +version = "4.5.0" authors = [ "Paul Hauner ", "Age Manning ", "Age Manning "] -edition = "2021" +edition = { workspace = true } autotests = false # using a single test binary compiles faster [features] @@ -12,66 +12,64 @@ 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] -serde_json = "1.0.58" -eth2_network_config = { path = "../../common/eth2_network_config"} -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.4" -ethereum_ssz_derive = "0.5.3" -state_processing = { path = "../../consensus/state_processing" } -tree_hash_derive = "0.5.0" -tree_hash = "0.5.2" -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" } -kzg = { path = "../../crypto/kzg" } -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" -unused_port = {path = "../../common/unused_port"} -oneshot_broadcast = { path = "../../common/oneshot_broadcast" } -slog-term = "2.6.0" -slog-async = "2.5.0" +serde_json = { workspace = true } +eth2_network_config = { workspace = true } +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 } +kzg = { 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/" } +slog-term = { workspace = true } +slog-async = { workspace = true } [[test]] name = "beacon_chain_tests" diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index df9cebe4b2f..088850437a9 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -874,10 +874,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. @@ -954,10 +954,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); @@ -1017,10 +1017,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. 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/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 6dae5deb4f8..a534b515ac4 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -811,11 +811,8 @@ 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); } @@ -824,9 +821,10 @@ impl GossipVerifiedBlock { // We check this *before* we load the parent so that we can return a more detailed error. let block = check_block_is_finalized_checkpoint_or_descendant( chain, - &chain.canonical_head.fork_choice_read_lock(), + &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)?; 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_chain/src/errors.rs b/beacon_node/beacon_chain/src/errors.rs index 683ec68c28d..7c1bb04917d 100644 --- a/beacon_node/beacon_chain/src/errors.rs +++ b/beacon_node/beacon_chain/src/errors.rs @@ -149,6 +149,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/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index e7d459afe4f..11bb35620dc 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -20,8 +20,8 @@ use execution_layer::test_utils::generate_genesis_header; 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, }; @@ -175,7 +175,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, @@ -311,7 +310,6 @@ where store_mutator: None, execution_layer: None, mock_execution_layer: None, - mock_builder: None, testing_slot_clock: None, runtime, log, @@ -451,50 +449,21 @@ 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 mock = mock_execution_layer_from_parts::( self.spec.as_ref().expect("cannot build without spec"), self.runtime.task_executor.clone(), - None, - None, + builder_threshold, ); 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.as_ref().expect("cannot build without spec"); - let mock_el = mock_execution_layer_from_parts::( - spec, - self.runtime.task_executor.clone(), - Some(builder_url.clone()), - builder_threshold, - ) - .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.clone(), - 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 { @@ -581,7 +550,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, blob_signature_cache: <_>::default(), rng: make_rng(), } @@ -591,7 +560,6 @@ where pub fn mock_execution_layer_from_parts( spec: &ChainSpec, task_executor: TaskExecutor, - builder_url: Option, builder_threshold: Option, ) -> MockExecutionLayer { let shanghai_time = spec.capella_fork_epoch.map(|epoch| { @@ -615,7 +583,6 @@ pub fn mock_execution_layer_from_parts( builder_threshold, Some(JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap()), spec.clone(), - builder_url, Some(kzg), ) } @@ -639,7 +606,7 @@ pub struct BeaconChainHarness { pub runtime: TestRuntime, pub mock_execution_layer: Option>, - pub mock_builder: Option>>, + pub mock_builder: Option>>, /// Cache for blob signature because we don't need them for import, but we do need them /// to test gossip validation. We always make them during block production but drop them @@ -695,6 +662,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_head_block(&self) -> RpcBlock { let block = self.chain.head_beacon_block(); let block_root = block.canonical_root(); diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index cb5b98fa2cb..6b6206d5e02 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -2159,12 +2159,8 @@ async fn weak_subjectivity_sync_test(slots: Vec, checkpoint_slot: Slot) { .map_err(|e| println!("Unable to read trusted setup file: {}", e)) .unwrap(); - let mock = mock_execution_layer_from_parts( - &harness.spec, - harness.runtime.task_executor.clone(), - None, - None, - ); + let mock = + mock_execution_layer_from_parts(&harness.spec, harness.runtime.task_executor.clone(), None); // Initialise a new beacon chain from the finalized checkpoint. // The slot clock must be set to a time ahead of the checkpoint state. 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/client/src/builder.rs b/beacon_node/client/src/builder.rs index 8a0a3d2eb3e..d0cfb3825b5 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -259,7 +259,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))? } @@ -279,7 +279,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) @@ -380,7 +380,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(), @@ -1099,7 +1099,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, @@ -1113,6 +1113,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/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/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/eth1/Cargo.toml b/beacon_node/eth1/Cargo.toml index 9ec144a401b..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.3" -tree_hash = "0.5.2" -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 7e3e20a49b9..60c97b028c5 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -1,55 +1,58 @@ [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.4" -eth2 = { path = "../../common/eth2" } -kzg = { path = "../../crypto/kzg" } -state_processing = { path = "../../consensus/state_processing" } -superstruct = "0.6.0" -lru = "0.7.1" -exit-future = "0.2.0" -tree_hash = "0.5.2" -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 } +kzg = { 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 } #PR: https://github.com/ralexstokes/mev-rs/pull/124 mev-rs = { git = "https://github.com/jimmygchen/mev-rs", rev = "dedc77a" } +axum = "0.6" +hyper = "0.14" ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "12508c1f9b0c8f4bf4c5e9b6d441e840c1b37fd9" } 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/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index aa2bc7feabc..9eb19bb2b73 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; @@ -301,7 +302,7 @@ type PayloadContentsRefTuple<'a, T> = (ExecutionPayloadRef<'a, T>, Option<&'a Bl struct Inner { engine: Arc, - builder: Option, + builder: ArcSwapOption, execution_engine_forkchoice_lock: Mutex<()>, suggested_fee_recipient: Option
, proposer_preparation_data: Mutex>, @@ -453,25 +454,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()), @@ -486,19 +471,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 @@ -655,9 +666,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 @@ -666,7 +677,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; } } @@ -1743,6 +1754,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/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 7af0d26627f..d06c9be4fff 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -42,6 +42,11 @@ use types::{ ExecutionPayloadHeader, ForkName, ForkVersionedResponse, Hash256, Slot, Uint256, }; +pub type MockBuilderServer = axum::Server< + hyper::server::conn::AddrIncoming, + axum::routing::IntoMakeService, +>; + #[derive(Clone)] pub enum Operation { FeeRecipient(Address), @@ -166,19 +171,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(); @@ -207,39 +218,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 5aa3b2f8b9a..f1bd89868c8 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 @@ -34,7 +34,6 @@ impl MockExecutionLayer { Some(JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap()), spec, None, - None, ) } @@ -47,7 +46,6 @@ impl MockExecutionLayer { builder_threshold: Option, jwt_key: Option, spec: ChainSpec, - builder_url: Option, kzg: Option>, ) -> Self { let handle = executor.handle().unwrap(); @@ -72,7 +70,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 0366d682c59..b322eb221c7 100644 --- a/beacon_node/execution_layer/src/test_utils/mod.rs +++ b/beacon_node/execution_layer/src/test_utils/mod.rs @@ -31,7 +31,7 @@ pub use execution_block_generator::{ pub use hook::Hook; pub use mock_builder::{ convert_err, custom_err, from_ssz_rs, to_ssz_rs, Context as MockBuilderContext, MockBuilder, - Operation, TestingBuilder, + MockBuilderServer, Operation, }; pub use mock_execution_layer::MockExecutionLayer; diff --git a/beacon_node/genesis/Cargo.toml b/beacon_node/genesis/Cargo.toml index 8b465fa6005..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.2" -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 3f845fc784e..b58e0442f7c 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -2,54 +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.2" -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" } -unused_port = { path = "../../common/unused_port" } -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_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index fa25e409226..00560439135 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -2869,12 +2869,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 { @@ -2922,13 +2918,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 { @@ -3055,6 +3046,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()) @@ -3062,6 +3054,7 @@ pub fn serve( |endpoint_version: EndpointVersion, slot: Slot, query: api_types::ValidatorBlocksQuery, + accept_header: Option, task_spawner: TaskSpawner, chain: Arc>, log: Logger| { @@ -3109,9 +3102,24 @@ pub fn serve( let block_contents = build_block_contents::build_block_contents(fork_name, block, maybe_blobs)?; - fork_versioned_response(endpoint_version, fork_name, block_contents) - .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_contents.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_contents) + .map(|response| warp::reply::json(&response).into_response()) + .map(|res| add_consensus_version_header(res, fork_name)), + } }) }, ); @@ -3128,11 +3136,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 { @@ -3176,10 +3186,25 @@ pub fn serve( maybe_blobs, )?; - // Pose as a V2 endpoint so we return the fork `version`. - fork_versioned_response(V2, fork_name, block_contents) - .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_contents.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_contents) + .map(|response| warp::reply::json(&response).into_response()) + .map(|res| add_consensus_version_header(res, fork_name)), + } }) }, ); @@ -3697,12 +3722,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)?; @@ -4363,7 +4389,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/beacon_node/http_api/src/test_utils.rs b/beacon_node/http_api/src/test_utils.rs index 15b7ecd331c..fe47e56dc57 100644 --- a/beacon_node/http_api/src/test_utils.rs +++ b/beacon_node/http_api/src/test_utils.rs @@ -126,17 +126,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 @@ -149,8 +141,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/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 40e15752f1c..a1576d33d9e 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(); @@ -247,29 +250,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, @@ -383,7 +397,6 @@ impl ApiTester { .mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_THRESHOLD_WEI, ))); @@ -406,7 +419,6 @@ impl ApiTester { .mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_PAYLOAD_VALUE_WEI, ))); @@ -2528,6 +2540,74 @@ 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_contents = + BlockContents::>::from_ssz_bytes(&block_bytes, &self.chain.spec) + .expect("block contents bytes can be decoded"); + + let signed_block_contents = + block_contents.sign(&sk, &fork, genesis_validators_root, &self.chain.spec); + + self.client + .post_beacon_blocks_ssz(&signed_block_contents) + .await + .unwrap(); + + assert_eq!( + self.chain.head_beacon_block().as_ref(), + signed_block_contents.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(); @@ -2713,12 +2793,18 @@ impl ApiTester { sk.sign(message).into() }; - let block_contents = self + let block_contents_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_contents = BlockContents::::from_ssz_bytes( + &block_contents_bytes, + &self.chain.spec, + ) + .expect("block contents bytes can be decoded"); let signed_block_contents = block_contents.sign(&sk, &fork, genesis_validators_root, &self.chain.spec); @@ -3309,6 +3395,7 @@ impl ApiTester { .unwrap() .get_payload_by_root(&payload.tree_hash_root()) .is_none()); + self } @@ -3317,7 +3404,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::GasLimit(30_000_000)); let slot = self.chain.slot().unwrap(); @@ -3361,7 +3447,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::FeeRecipient(test_fee_recipient)); let slot = self.chain.slot().unwrap(); @@ -3404,7 +3489,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::ParentHash(invalid_parent_hash)); let slot = self.chain.slot().unwrap(); @@ -3454,7 +3538,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::PrevRandao(invalid_prev_randao)); let slot = self.chain.slot().unwrap(); @@ -3500,7 +3583,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::BlockNumber(invalid_block_number)); let slot = self.chain.slot().unwrap(); @@ -3548,7 +3630,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Timestamp(invalid_timestamp)); let slot = self.chain.slot().unwrap(); @@ -3589,11 +3670,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(); @@ -3878,7 +3955,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_BUILDER_THRESHOLD_WEI - 1, ))); @@ -3916,7 +3992,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -3954,7 +4029,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI, ))); @@ -3992,7 +4066,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI - 1, ))); @@ -4030,7 +4103,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -4067,7 +4139,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -4104,7 +4175,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::Value(Uint256::from( DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI + 1, ))); @@ -4112,7 +4182,6 @@ impl ApiTester { self.mock_builder .as_ref() .unwrap() - .builder .add_operation(Operation::WithdrawalsRoot(Hash256::repeat_byte(0x42))); let slot = self.chain.slot().unwrap(); @@ -4976,6 +5045,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/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 aeaf5112e6b..07674fb6dd2 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -2,63 +2,64 @@ 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.4" -serde = { version = "1.0.116", features = ["derive"] } -serde_derive = "1.0.116" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.3" -tree_hash = "0.5.2" -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" [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" -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 = [] \ No newline at end of file +libp2p-websocket = [] + diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index c77583144cd..30c94940764 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, @@ -417,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/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 c1513c55581..9006d648687 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. @@ -2208,7 +2209,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/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 24b707cf774..8e97487bd5d 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -160,8 +160,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 @@ -371,8 +369,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); @@ -427,9 +426,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; @@ -470,6 +476,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::>(); @@ -1058,30 +1078,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); } } @@ -1388,22 +1405,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, @@ -1504,7 +1505,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), @@ -1536,7 +1544,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) => { @@ -1586,13 +1594,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 f0e2cc96509..4d05518aad2 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 4604b8e3569..dc77e3efe21 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; @@ -71,15 +70,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 = 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(); @@ -99,8 +102,7 @@ pub async fn build_libp2p_instance( fork_name: ForkName, spec: &ChainSpec, ) -> Libp2pInstance { - let port = unused_tcp4_port().unwrap(); - let config = build_config(port, boot_nodes); + let config = build_config(boot_nodes); // launch libp2p service let (signal, exit) = exit_future::signal(); @@ -127,6 +129,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)] @@ -135,6 +143,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,33 +151,57 @@ 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 { + // 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(_) = receiver.next_event().await { - return; + if let NetworkEvent::NewListenAddr(addr) = receiver.next_event().await { + 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 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)) diff --git a/beacon_node/lighthouse_network/tests/rpc_tests.rs b/beacon_node/lighthouse_network/tests/rpc_tests.rs index c6bad603853..0a6dd4aa047 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::{ SignedBeaconBlock, 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)); @@ -282,8 +296,14 @@ fn test_blobs_by_range_chunked_rpc() { rt.block_on(async { // get sender/receiver let spec = E::default_spec(); - let (mut sender, mut receiver) = - common::build_node_pair(Arc::downgrade(&rt), &log, ForkName::Deneb, &spec).await; + let (mut sender, mut receiver) = common::build_node_pair( + Arc::downgrade(&rt), + &log, + ForkName::Deneb, + &spec, + Protocol::Tcp, + ) + .await; // BlobsByRange Request let rpc_request = Request::BlobsByRange(BlobsByRangeRequest { @@ -373,7 +393,7 @@ fn test_blobs_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; @@ -388,8 +408,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)); @@ -456,7 +482,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; @@ -472,8 +498,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)); @@ -582,7 +614,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; @@ -594,8 +626,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)); @@ -682,7 +720,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; @@ -695,8 +733,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 = @@ -808,7 +852,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; @@ -822,8 +866,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 = @@ -939,14 +989,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()); @@ -956,7 +1001,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 { @@ -982,12 +1028,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; } } }; @@ -1002,3 +1045,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/Cargo.toml b/beacon_node/network/Cargo.toml index 0ecd9e77387..65711ca920d 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -2,53 +2,54 @@ 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" -eth2 = {path="../../common/eth2"} +exit-future = { workspace = true } +slog-term = { workspace = true } +slog-async = { workspace = true } +eth2 = { 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", "nested-values"] } -hex = "0.4.2" -ethereum_ssz = "0.5.0" -ssz_types = "0.5.4" -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/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 993551441f3..9829f6ccc26 100644 --- a/beacon_node/network/src/network_beacon_processor/tests.rs +++ b/beacon_node/network/src/network_beacon_processor/tests.rs @@ -42,7 +42,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. @@ -202,15 +201,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 bee7c2fcd71..381829f933e 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, @@ -617,32 +612,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); } } } @@ -997,7 +978,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 64ac3aaeeee..548dee45bdf 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/operation_pool/Cargo.toml b/beacon_node/operation_pool/Cargo.toml index a4ebc7f5ce9..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.3" -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/src/cli.rs b/beacon_node/src/cli.rs index 82e941a4586..7b9cd757a5b 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; @@ -82,11 +82,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") @@ -96,9 +96,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), ) @@ -106,8 +107,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), ) @@ -118,12 +119,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( @@ -166,7 +182,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( @@ -174,7 +198,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( @@ -182,7 +214,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), ) @@ -191,7 +223,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), ) @@ -232,11 +264,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") @@ -323,22 +362,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). \ @@ -349,11 +391,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.") @@ -371,6 +415,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) @@ -378,6 +423,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) @@ -385,6 +431,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.") @@ -392,8 +439,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.") @@ -401,8 +449,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.") @@ -410,13 +459,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( @@ -429,22 +479,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 \ @@ -1283,4 +1336,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"]).multiple(true)) } diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 1ff4a3b5ad1..a624d8ffb39 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -95,69 +95,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; @@ -952,15 +952,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() @@ -968,6 +968,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) => { @@ -978,7 +996,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 @@ -986,20 +1004,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, }) } @@ -1011,16 +1041,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, }) } @@ -1029,31 +1068,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, }, ) @@ -1169,6 +1221,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 @@ -1185,6 +1245,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 @@ -1194,9 +1262,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 @@ -1204,7 +1272,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() { @@ -1214,7 +1282,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); } } @@ -1247,11 +1315,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 } }; @@ -1310,6 +1378,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/beacon_node/store/Cargo.toml b/beacon_node/store/Cargo.toml index e39d46db67a..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.3" -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/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/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/boot_node/Cargo.toml b/boot_node/Cargo.toml index fcbe8f84d27..0c815ca9a7a 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -1,27 +1,27 @@ [package] name = "boot_node" -version = "4.4.1" +version = "4.5.0" 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/boot_node/src/config.rs b/boot_node/src/config.rs index 779269921a5..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 { @@ -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), ) }; @@ -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/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 e5d0025200d..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.2" +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 a1e58280168..02460551a9e 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -2,38 +2,38 @@ 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" -ssz_types = "0.5.4" -tree_hash = "0.5.2" -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.3" +serde = { workspace = true } +serde_json = { workspace = true } +ssz_types = { workspace = true } +tree_hash = { 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 } @@ -41,4 +41,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/src/lib.rs b/common/eth2/src/lib.rs index d19a2981290..59d22d648c2 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, } } } @@ -1629,14 +1631,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() @@ -1658,9 +1660,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, @@ -1677,17 +1736,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() @@ -1709,9 +1765,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/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/common/eth2/src/types.rs b/common/eth2/src/types.rs index 1c1b956bd17..cc790f467ff 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1468,9 +1468,10 @@ mod tests { } /// A wrapper over a [`BeaconBlock`] or a [`BeaconBlockAndBlobSidecars`]. -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Encode, Serialize, Deserialize)] #[serde(untagged)] #[serde(bound = "T: EthSpec")] +#[ssz(enum_behaviour = "transparent")] pub enum BlockContents> { BlockAndBlobSidecars(BeaconBlockAndBlobSidecars), BlindedBlockAndBlobSidecars(BlindedBeaconBlockAndBlobSidecars), @@ -1483,6 +1484,58 @@ pub type BlockContentsTuple = ( ); impl> BlockContents { + pub fn new( + block: BeaconBlock, + blobs: Option>, + ) -> Self { + match (Payload::block_type(), blobs) { + (BlockType::Full, Some(blobs)) => { + Self::BlockAndBlobSidecars(BeaconBlockAndBlobSidecars { + block, + blob_sidecars: blobs, + }) + } + (BlockType::Blinded, Some(blobs)) => { + Self::BlindedBlockAndBlobSidecars(BlindedBeaconBlockAndBlobSidecars { + blinded_block: block, + blinded_blob_sidecars: blobs, + }) + } + (_, None) => Self::Block(block), + } + } + + /// SSZ decode with fork variant determined by slot. + pub fn from_ssz_bytes(bytes: &[u8], spec: &ChainSpec) -> Result { + let slot_len = ::ssz_fixed_len(); + let slot_bytes = bytes + .get(0..slot_len) + .ok_or(DecodeError::InvalidByteLength { + len: bytes.len(), + expected: slot_len, + })?; + + let slot = Slot::from_ssz_bytes(slot_bytes)?; + let fork_at_slot = spec.fork_name_at_slot::(slot); + + match fork_at_slot { + ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => { + BeaconBlock::from_ssz_bytes(bytes, spec).map(|block| BlockContents::Block(block)) + } + ForkName::Deneb => { + let mut builder = ssz::SszDecoderBuilder::new(bytes); + builder.register_anonymous_variable_length_item()?; + builder.register_type::>()?; + + let mut decoder = builder.build()?; + let block = + decoder.decode_next_with(|bytes| BeaconBlock::from_ssz_bytes(bytes, spec))?; + let blobs = decoder.decode_next()?; + Ok(BlockContents::new(block, Some(blobs))) + } + } + } + pub fn block(&self) -> &BeaconBlock { match self { BlockContents::BlockAndBlobSidecars(block_and_sidecars) => &block_and_sidecars.block, 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_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_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 650882d5881..8bc114487a3 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -2,29 +2,31 @@ 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" +tempfile = { workspace = true } +tokio = { workspace = true } [dependencies] -serde_yaml = "0.8.13" -serde_json = "1.0.58" -types = { path = "../../consensus/types" } -kzg = { path = "../../crypto/kzg" } -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" } +serde_yaml = { workspace = true } +serde_json = { workspace = true } +types = { workspace = true } +kzg = { 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_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..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 @@ -1,8 +1,9 @@ # EF -- enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk -- enr:-KG4QF6d6vMSboSujAXTI4vYqArccm0eIlXfcxf2Lx_VE1q6IkQo_2D5LAO3ZSBVUs0w5rrVDmABJZuMzISe_pZundADhGV0aDKQqX6DZjABcAAAAQAAAAAAAIJpZIJ2NIJpcISygIjpiXNlY3AyNTZrMaEDF3aSa7QSCvdqLpANNd8GML4PLEZVg45fKQwMWhDZjd2DdGNwgiMog3VkcIIjKA -- enr:-Ly4QJLXSSAj3ggPBIcodvBU6IyfpU_yW7E9J-5syoJorBuvcYj_Fokcjr303bQoTdWXADf8po0ssh75Mr5wVGzZZsMBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCpfoNmMAFwAAABAAAAAAAAgmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQJrIlXIQDvQ6t9yDySqJYDXgZgLXzTvq8W7OI51jfmxJohzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA +- enr:-Ku4QFo-9q73SspYI8cac_4kTX7yF800VXqJW4Lj3HkIkb5CMqFLxciNHePmMt4XdJzHvhrCC5ADI4D_GkAsxGJRLnQBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpAhnTT-AQFwAP__________gmlkgnY0gmlwhLKAiOmJc2VjcDI1NmsxoQORcM6e19T1T9gi7jxEZjk_sjVLGFscUNqAY9obgZaxbIN1ZHCCIyk +- enr:-Ku4QPG7F72mbKx3gEQEx07wpYYusGDh-ni6SNkLvOS-hhN-BxIggN7tKlmalb0L5JPoAfqD-akTZ-gX06hFeBEz4WoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpAhnTT-AQFwAP__________gmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQKLVXFOhp2uX6jeT0DvvDpPcU8FWMjQdR4wMuORMhpX24N1ZHCCIyk +- enr:-LK4QPxe-mDiSOtEB_Y82ozvxn9aQM07Ui8A-vQHNgYGMMthfsfOabaaTHhhJHFCBQQVRjBww_A5bM1rf8MlkJU_l68Eh2F0dG5ldHOIAADAAAAAAACEZXRoMpBpt9l0BAFwAAABAAAAAAAAgmlkgnY0gmlwhLKAiOmJc2VjcDI1NmsxoQJu6T9pclPObAzEVQ53DpVQqjadmVxdTLL-J3h9NFoCeIN0Y3CCIyiDdWRwgiMo +- enr:-Ly4QGbOw4xNel5EhmDsJJ-QhC9XycWtsetnWoZ0uRy381GHdHsNHJiCwDTOkb3S1Ade0SFQkWJX_pgb3g8Jfh93rvMBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpBpt9l0BAFwAAABAAAAAAAAgmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQOxKv9sv3zKF8GDewgFGGHKP5HCZZpPpTrwl9eXKAWGxIhzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA # Teku -- enr:-LK4QMlzEff6d-M0A1pSFG5lJ2c56i_I-ZftdojZbW3ehkGNM4pkQuHQqzVvF1BG9aDjIakjnmO23mCBFFZ2w5zOsugEh2F0dG5ldHOIAAAAAAYAAACEZXRoMpCpfoNmMAFwAAABAAAAAAAAgmlkgnY0gmlwhKyuI_mJc2VjcDI1NmsxoQIH1kQRCZW-4AIVyAeXj5o49m_IqNFKRHp6tSpfXMUrSYN0Y3CCIyiDdWRwgiMo +- enr:-LS4QG0uV4qvcpJ-HFDJRGBmnlD3TJo7yc4jwK8iP7iKaTlfQ5kZvIDspLMJhk7j9KapuL9yyHaZmwTEZqr10k9XumyCEcmHYXR0bmV0c4gAAAAABgAAAIRldGgykGm32XQEAXAAAAEAAAAAAACCaWSCdjSCaXCErK4j-YlzZWNwMjU2azGhAgfWRBEJlb7gAhXIB5ePmjj2b8io0UpEenq1Kl9cxStJg3RjcIIjKIN1ZHCCIyg # Sigma Prime -- enr:-Le4QI88slOwzz66Ksq8Vnz324DPb1BzSiY-WYPvnoJIl-lceW9bmSJnwDzgNbCjp5wsBigg76x4tValvGgQPxxSjrMBhGV0aDKQqX6DZjABcAAAAQAAAAAAAIJpZIJ2NIJpcIQ5gR6Wg2lwNpAgAUHQBwEQAAAAAAAAADR-iXNlY3AyNTZrMaEDPMSNdcL92uNIyCsS177Z6KTXlbZakQqxv3aQcWawNXeDdWRwgiMohHVkcDaCI4I +- enr:-Le4QLoE1wFHSlGcm48a9ZESb_MRLqPPu6G0vHqu4MaUcQNDHS69tsy-zkN0K6pglyzX8m24mkb-LtBcbjAYdP1uxm4BhGV0aDKQabfZdAQBcAAAAQAAAAAAAIJpZIJ2NIJpcIQ5gR6Wg2lwNpAgAUHQBwEQAAAAAAAAADR-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 40edf9b6175..9f4faeb27a4 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 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:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA -- enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA +- enr:-KG4QL-eqFoHy0cI31THvtZjpYUu_Jdw_MO7skQRJxY1g5HTN1A0epPCU6vi0gLGUgrzpU-ygeMSS8ewVxDpKfYmxMMGhGV0aDKQtTA_KgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaED8GJ2vzUqgL6-KD1xalo1CsmY4X1HaDnyl6Y_WayCo9GDdGNwgiMog3VkcIIjKA +- enr:-KG4QMOEswP62yzDjSwWS4YEjtTZ5PO6r65CPqYBkgTTkrpaedQ8uEUo1uMALtJIvb2w_WWEVmg5yt1UAuK1ftxUU7QDhGV0aDKQu6TalgMAAAD__________4JpZIJ2NIJpcIQEnfA2iXNlY3AyNTZrMaEDfol8oLr6XJ7FsdAYE7lpJhKMls4G_v6qQOGKJUWGb_uDdGNwgiMog3VkcIIjKA +- enr:-KG4QF4B5WrlFcRhUU6dZETwY5ZzAXnA0vGC__L1Kdw602nDZwXSTs5RFXFIFUnbQJmhNGVU6OIX7KVrCSTODsz1tK4DhGV0aDKQu6TalgMAAAD__________4JpZIJ2NIJpcIQExNYEiXNlY3AyNTZrMaECQmM9vp7KhaXhI-nqL_R0ovULLCFSFTa9CPPSdb1zPX6DdGNwgiMog3VkcIIjKA # Prysm team (Prysmatic Labs) - enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg - enr:-Ku4QP2xDnEtUXIjzJ_DhlCRN9SN99RYQPJL92TMlSv7U5C1YnYLjwOQHgZIUXw6c-BvRg2Yc2QsZxxoS_pPRVe0yK8Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMeFF5GrS7UZpAH2Ly84aLK-TyvH-dRo0JM1i8yygH50YN1ZHCCJxA - enr:-Ku4QPp9z1W4tAO8Ber_NQierYaOStqhDqQdOPY3bB3jDgkjcbk6YrEnVYIiCBbTxuar3CzS528d2iE7TdJsrL-dEKoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMw5fqqkw2hHC4F5HZZDPsNmPdB1Gi8JPQK7pRc9XHh-oN1ZHCCKvg # Nimbus team - enr:-LK4QA8FfhaAjlb_BXsXxSfiysR7R52Nhi9JBt4F8SPssu8hdE1BXQQEtVDC3qStCW60LSO7hEsVHv5zm8_6Vnjhcn0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAN4aBKJc2VjcDI1NmsxoQJerDhsJ-KxZ8sHySMOCmTO6sHM3iCFQ6VMvLTe948MyYN0Y3CCI4yDdWRwgiOM -- enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM \ No newline at end of file +- enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index 660ae97fa97..510f76ad5f5 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -11,11 +11,12 @@ //! 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 kzg::{KzgPreset, KzgPresetId, TrustedSetup}; 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}; @@ -168,14 +169,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, .. @@ -190,10 +185,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())) } } @@ -211,7 +204,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, @@ -221,15 +214,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 { @@ -241,9 +226,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) @@ -269,6 +254,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. @@ -396,7 +392,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, @@ -428,12 +424,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) => { @@ -463,6 +454,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) @@ -507,11 +510,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/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/lighthouse_version/src/lib.rs b/common/lighthouse_version/src/lib.rs index 567714e5ca9..c31917e0405 100644 --- a/common/lighthouse_version/src/lib.rs +++ b/common/lighthouse_version/src/lib.rs @@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!( // NOTE: using --match instead of --exclude for compatibility with old Git "--match=thiswillnevermatchlol" ], - prefix = "Lighthouse/v4.4.1-", - fallback = "Lighthouse/v4.4.1" + prefix = "Lighthouse/v4.5.0-", + fallback = "Lighthouse/v4.5.0" ); /// Returns `VERSION`, but with platform information appended to the end. 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 02388092cd5..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.2" -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 e6c75deae46..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.4" -ethereum_hashing = "1.0.0-beta.2" -ethereum_ssz_derive = "0.5.3" -ethereum_ssz = "0.5.0" -tree_hash = "0.5.2" -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 bd0b9888e61..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.3" -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 f6e189d9cf9..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.3" -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 765ba2307c2..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.3" -ssz_types = "0.5.4" -merkle_proof = { path = "../merkle_proof" } -safe_arith = { path = "../safe_arith" } -tree_hash = "0.5.2" -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 2eb59ad0052..e092ff02acf 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"] } -kzg = { path = "../../crypto/kzg" } -compare_fields = { path = "../../common/compare_fields" } -compare_fields_derive = { path = "../../common/compare_fields_derive" } +merkle_proof = { workspace = true } +bls = { workspace = true, features = ["arbitrary"] } +kzg = { workspace = true } +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.3" -ssz_types = { version = "0.5.4", 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.2", 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" +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" -rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } -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" -maplit = "1.0.2" -strum = { version = "0.24.0", features = ["derive"] } +serde_json = { workspace = true } +smallvec = { workspace = true } +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/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index 9f68ca940b2..ba2260eae55 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") )] diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index dc59fd85efb..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.2" -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 2c4b8d05538..1ef215fa897 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "lcli" description = "Lighthouse CLI (modeled after zcli)" -version = "4.4.1" +version = "4.5.0" authors = ["Paul Hauner "] -edition = "2021" +edition = { workspace = true } [features] portable = ["bls/supranational-portable"] @@ -11,39 +11,39 @@ fake_crypto = ['bls/fake_crypto'] jemalloc = ["malloc_utils/jemalloc"] [dependencies] -bls = { path = "../crypto/bls" } -kzg = { path = "../crypto/kzg" } -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.2" -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 } +kzg = { 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/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..48b4eb037ab 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "lighthouse" -version = "4.4.1" +version = "4.5.0" authors = ["Sigma Prime "] -edition = "2021" +edition = { workspace = true } autotests = false -rust-version = "1.68.2" +rust-version = "1.69.0" [features] default = ["slasher-lmdb"] @@ -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/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/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 74d708bedb6..4dca5cb1c2f 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1042,12 +1042,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)) ); }); } @@ -1060,22 +1060,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!( @@ -1083,19 +1083,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!( @@ -1103,24 +1103,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!( @@ -1128,8 +1128,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!( @@ -1137,8 +1137,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)) ); }); } @@ -1150,6 +1189,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() @@ -1179,7 +1226,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() @@ -1256,6 +1303,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() @@ -1272,6 +1327,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() @@ -1294,7 +1357,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)) @@ -1319,7 +1382,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)) @@ -1351,7 +1414,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)) @@ -1359,7 +1422,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)) @@ -1435,6 +1498,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)); @@ -1443,6 +1507,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)); @@ -1452,6 +1517,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() @@ -2342,6 +2408,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() @@ -2454,6 +2532,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)); @@ -2471,6 +2550,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/scripts/local_testnet/beacon_node.sh b/scripts/local_testnet/beacon_node.sh index bbd52ae32d6..940fe2b8581 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 0c8cb3751c7..c796050bc42 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 @@ -146,7 +146,7 @@ sed -i 's/"cancunTime".*$/"cancunTime": 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 b566cfedb66..e13c06cdbac 100755 --- a/scripts/tests/doppelganger_protection.sh +++ b/scripts/tests/doppelganger_protection.sh @@ -43,21 +43,21 @@ 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 -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 )) @@ -68,7 +68,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" @@ -94,7 +94,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 @@ -108,7 +108,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." @@ -126,7 +126,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." @@ -152,4 +152,4 @@ if [[ "$BEHAVIOR" == "success" ]]; then fi fi -exit 0 \ No newline at end of file +exit 0 diff --git a/slasher/Cargo.toml b/slasher/Cargo.toml index 230a758d868..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.3" +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.2" -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 9a1815a7025..b4bd5a50a04 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,32 +11,32 @@ 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" -kzg = { path = "../../crypto/kzg" } -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 } +kzg = { workspace = true } +rayon = { workspace = true } +serde = { workspace = true } serde_derive = "1.0.116" -serde_json = "1.0.58" -serde_repr = "0.1.6" -serde_yaml = "0.8.13" -eth2_network_config = { path = "../../common/eth2_network_config" } -ethereum_serde_utils = "0.5.0" -ethereum_ssz = "0.5.0" -ethereum_ssz_derive = "0.5.3" -tree_hash = "0.5.2" -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_json = { workspace = true } +serde_repr = { workspace = true } +serde_yaml = { workspace = true } +eth2_network_config = { workspace = true } +ethereum_serde_utils = { 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/node_test_rig/src/lib.rs b/testing/node_test_rig/src/lib.rs index 7d533ec7d29..3f08c837169 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; @@ -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/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/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); 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/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. 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 -HrD6fJGcqm8zwEs+Y+FGIpRYPyjdlugj3qqwvMSI9jeDW2fr1zUl/wIuf4o+O16P -XZitHgAyg3lph1x/kKL59c4rwWxUabSudAQZ6YCJHo4jWf3hR+UmMQEdNPgNrofv -vGCA7CjLPKZfW6pzZo9kvMwbgeRNuJCuKZ0v/p9Y/lOplj+TTBq16HMtsSarib3b -nKEaRdLCQgTJS3vwbtEiCC9BcZAkvs0fmVUIENRVeKGZIqcAdiOTUPvs4zctchzJ -MGG+TA2ckKIpGT0F4be8gy1uHyP0fncJAtNvkGRPmVQcNew/HIIkJjiJvmrwewn4 -dYqYAe+aEL5AB4dZhlKjIPENfq38t7iY/aXV8COTQZGMEZ7Diext1JmEb34vEXgS -7Gk9ZSCp/1X+fk/wW4uQeRlGwblaRtRxBrfJWmEoQHohzyP4jog8dajSZTjUbsA+ -HGaeZo1k3M0i3lxRBbLGamPODIO9CVGwKaiEJTy4bEpreM2tLR1rk5JECf46WPUR -SN6OdHrO5x38wzQlUv+Hb4vN4p0ZkiGJO62Duuw6hbGA6UIBffM20QuJUtz3Pa8D -un/NunIagmIL5KCsrDtZkt5wBsX3XU6OPdfZrfgOIXNfQmpbbeAUOok1NOgszXjP -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 -----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_tests/tls/lighthouse/key.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -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 -JAkxGuYLZeyrHEyeKLm7S77SLipKWg== +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 +GlPvUaKC1KX0CX1qT1anVZq9bSMTG+M= -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.p12 b/testing/web3signer_tests/tls/lighthouse/key.p12 index 22b7d7f4254..d96ab477574 100644 Binary files a/testing/web3signer_tests/tls/lighthouse/key.p12 and b/testing/web3signer_tests/tls/lighthouse/key.p12 differ 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/lighthouse/web3signer.pem @@ -1,32 +1,33 @@ -----BEGIN CERTIFICATE----- -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 -----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----- -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 -----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----- -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 -/OsV3MTX1gCaTE9Q2GlZVybDh20ZvdBC/g== +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 +CXDusRSlsQNpzHc6QKq8IDZLut9g -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/web3signer/key.p12 b/testing/web3signer_tests/tls/web3signer/key.p12 index 459f4fb62e8..51269be8d0f 100644 Binary files a/testing/web3signer_tests/tls/web3signer/key.p12 and b/testing/web3signer_tests/tls/web3signer/key.p12 differ diff --git a/testing/web3signer_tests/tls/web3signer/known_clients.txt b/testing/web3signer_tests/tls/web3signer/known_clients.txt index de80bb7cebe..33013273122 100644 --- a/testing/web3signer_tests/tls/web3signer/known_clients.txt +++ b/testing/web3signer_tests/tls/web3signer/known_clients.txt @@ -1 +1 @@ -lighthouse 1B:43:E1:58:26:7D:3F:70:BD:DA:32:E9:29:A5:A9:50:EA:B2:A8:C3:0C:82:BF:90:13:ED:5B:E0:7D:5B:0A:C0 +lighthouse FF:4C:84:A6:37:28:EC:7E:A7:D8:C6:49:0D:C6:F9:5D:C1:06:BA:6D:69:49:0A:AA:38:32:01:2B:ED:D9:F2:FA diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index 5a988ed681c..46f523c9905 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -2,63 +2,63 @@ name = "validator_client" version = "0.3.5" authors = ["Paul Hauner ", "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.2" -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_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). \ 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 { slot_clock: SystemTimeSlotClock, http_api_listen_addr: Option, config: Config, + beacon_nodes: Arc>, + genesis_time: u64, } impl ProductionValidatorClient { @@ -307,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) @@ -501,12 +506,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 +518,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 +531,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 +607,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(), 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 }