From e3ba718d9202dc7cc4d877de4a277cb776c90bf2 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 19 Sep 2023 02:46:42 +1000 Subject: [PATCH 1/5] Try rust-cache and cargo-binstall --- .github/workflows/test-suite.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 1d9856b93c..d648ae1153 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -69,6 +69,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run tests in release run: make test-release release-tests-windows: @@ -93,6 +94,7 @@ jobs: directory: ${{ runner.temp }}/llvm - name: Set LIBCLANG_PATH run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV + - uses: Swatinem/rust-cache@v2 - name: Run tests in release run: make test-release beacon-chain-tests: @@ -105,6 +107,7 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == false run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run beacon_chain tests for all known forks run: make test-beacon-chain op-pool-tests: @@ -115,6 +118,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run operation_pool tests for all known forks run: make test-op-pool slasher-tests: @@ -125,6 +129,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run slasher tests for all supported backends run: make test-slasher debug-tests-ubuntu: @@ -141,6 +146,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run tests in debug run: make test-debug state-transition-vectors-ubuntu: @@ -151,6 +157,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run state_transition_vectors in release. run: make run-state-transition-tests ef-tests-ubuntu: @@ -163,6 +170,7 @@ jobs: - name: Get latest version of stable Rust if: env.SELF_HOSTED_RUNNERS == false run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run consensus-spec-tests with blst, milagro and fake_crypto run: make test-ef dockerfile-ubuntu: @@ -189,6 +197,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim that starts from an eth1 contract run: cargo run --release --bin simulator eth1-sim merge-transition-ubuntu: @@ -203,6 +212,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim and go through the merge transition run: cargo run --release --bin simulator eth1-sim --post-merge no-eth1-simulator-ubuntu: @@ -213,6 +223,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run the beacon chain sim without an eth1 connection run: cargo run --release --bin simulator no-eth1-sim syncing-simulator-ubuntu: @@ -227,6 +238,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + - uses: Swatinem/rust-cache@v2 - name: Run the syncing simulator run: cargo run --release --bin simulator syncing-sim doppelganger-protection-test: @@ -237,6 +249,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Install geth run: | sudo add-apt-repository -y ppa:ethereum/ethereum @@ -268,6 +281,7 @@ jobs: dotnet-version: '6.0.201' - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run exec engine integration tests in release run: make test-exec-engine check-benchmarks: @@ -278,6 +292,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Typecheck benchmark code without running it run: make check-benches clippy: @@ -288,6 +303,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Lint code for quality and style with Clippy run: make lint - name: Certify Cargo.lock freshness @@ -300,6 +316,7 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust @ MSRV (${{ needs.extract-msrv.outputs.MSRV }}) run: rustup override set ${{ needs.extract-msrv.outputs.MSRV }} + - uses: Swatinem/rust-cache@v2 - name: Run cargo check run: cargo check --workspace arbitrary-check: @@ -310,6 +327,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Validate state_processing feature arbitrary-fuzz run: make arbitrary-fuzz cargo-audit: @@ -320,6 +338,7 @@ jobs: - uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: Swatinem/rust-cache@v2 - name: Run cargo audit to identify known security vulnerabilities reported to the RustSec Advisory Database run: make audit cargo-vendor: @@ -338,8 +357,10 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust (${{ env.PINNED_NIGHTLY }}) run: rustup toolchain install $PINNED_NIGHTLY + - uses: Swatinem/rust-cache@v2 + - uses: cargo-bins/cargo-binstall@main - name: Install cargo-udeps - run: cargo install cargo-udeps --locked --force + run: cargo binstall --no-confirm cargo-udeps --locked --force - name: Create Cargo config dir run: mkdir -p .cargo - name: Install custom Cargo config @@ -358,5 +379,6 @@ jobs: run: sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang - name: Use Rust beta run: rustup override set beta + - uses: Swatinem/rust-cache@v2 - name: Run make run: make From 5de6f678044ac6f99fc2311ac186e0fd742d5486 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 19 Sep 2023 02:47:15 +1000 Subject: [PATCH 2/5] Trigger build --- .github/workflows/test-suite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index d648ae1153..cb29cfd481 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -7,6 +7,7 @@ on: - staging - trying - 'pr/*' + - '*' pull_request: merge_group: From c182ed7ea780ceccbc2436c03ef1846213b18405 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 19 Sep 2023 11:22:26 +1000 Subject: [PATCH 3/5] Remove workflow push rule added for testing only. --- .github/workflows/test-suite.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index cb29cfd481..d648ae1153 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -7,7 +7,6 @@ on: - staging - trying - 'pr/*' - - '*' pull_request: merge_group: From c353c2dabe24e8a06b7886f00550a9bed9bda388 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 19 Sep 2023 13:01:59 +1000 Subject: [PATCH 4/5] Install cross with `cargo binstall` --- .github/workflows/docker.yml | 4 +++- .github/workflows/release.yml | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 21ca4940d9..e8e154eaa3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -76,9 +76,11 @@ jobs: - name: Dockerhub login run: | echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin + - uses: cargo-bins/cargo-binstall@main + - name: Install cross + run: cargo binstall --no-confirm cross - name: Cross build Lighthouse binary run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} CROSS_FEATURES=${{ matrix.features.env }} make build-${{ matrix.binary }} - name: Move cross-built binary into Docker scope (if ARM) if: startsWith(matrix.binary, 'aarch64') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e38b03daf7..97e9b3cae8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,6 +69,9 @@ jobs: uses: actions/checkout@v3 - name: Get latest version of stable Rust run: rustup update stable + - uses: cargo-bins/cargo-binstall@main + - name: Install cross + run: cargo binstall --no-confirm cross # ============================== # Windows dependencies @@ -90,25 +93,21 @@ jobs: - name: Build Lighthouse for aarch64-unknown-linux-gnu-portable if: matrix.arch == 'aarch64-unknown-linux-gnu-portable' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-aarch64-portable - name: Build Lighthouse for aarch64-unknown-linux-gnu if: matrix.arch == 'aarch64-unknown-linux-gnu' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-aarch64 - name: Build Lighthouse for x86_64-unknown-linux-gnu-portable if: matrix.arch == 'x86_64-unknown-linux-gnu-portable' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-x86_64-portable - name: Build Lighthouse for x86_64-unknown-linux-gnu if: matrix.arch == 'x86_64-unknown-linux-gnu' run: | - cargo install cross env CROSS_PROFILE=${{ matrix.profile }} make build-x86_64 - name: Move cross-compiled binary From 2ea18ef1e6e2d5c5c9fdb8a27b76e85b2958fb26 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 19 Sep 2023 17:06:19 +1000 Subject: [PATCH 5/5] Cargo.toml format fix. --- consensus/types/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index f030f2e97a..c159c26b78 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -22,7 +22,7 @@ log = "0.4.11" rayon = "1.4.1" rand = "0.8.5" safe_arith = { path = "../safe_arith" } -serde = {version = "1.0.116" , features = ["rc"] } +serde = { version = "1.0.116", features = ["rc"] } serde_derive = "1.0.116" slog = "2.5.2" ethereum_ssz = { version = "0.5.0", features = ["arbitrary"] }