Skip to content

Commit

Permalink
[Tech debt] Remove async-std (#3845)
Browse files Browse the repository at this point in the history
* tests and CI

* remove `async-std`

* `fmt`

* fix doc build

* remove counter tests

* remove counter tests

* build w/o lockfile

* `lock` -> `std`

* Revert "`lock` -> `std`"

This reverts commit 21ebf05.

* lock

* `async_broadcast`

* overflow

* Revert "`async_broadcast`"

This reverts commit f03bb57.

* `try_send`
  • Loading branch information
rob-maron authored Nov 8, 2024
1 parent fa73cd9 commit 1c3e22f
Show file tree
Hide file tree
Showing 126 changed files with 723 additions and 2,918 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/EXTERNAL_ISSUE_FORM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body:
placeholder: |
Include other details here such as: open questions, directions to reproduce a bug, relevant error logs, etc.
E.g. To reproduce this bug run `just async_std test_basic`. You should see logs similar to the ones below:
E.g. To reproduce this bug run `just test_basic`. You should see logs similar to the ones below:
`ERROR: This is an important error!`
validations:
required: false
Expand Down
93 changes: 26 additions & 67 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
test:
strategy:
matrix:
just_variants:
- async-std
- tokio
test_suites:
- test-ci-1
- test-ci-2
Expand All @@ -41,7 +38,6 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "test"
prefix-key: ${{ matrix.just_variants }}
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' && matrix.test_suites == 'test-ci-rest' }}

Expand All @@ -51,17 +47,13 @@ jobs:

- name: Unit and integration tests for all crates in workspace
run: |
just ${{ matrix.just_variants }} ${{ matrix.test_suites }}
just ${{ matrix.test_suites }}
timeout-minutes: 60
env:
RUST_BACKTRACE: full

test-examples:
strategy:
matrix:
just_variants:
- async-std
- tokio
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand All @@ -75,23 +67,18 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "examples"
prefix-key: ${{ matrix.just_variants }}
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@just

- name: Test examples
run: |
just ${{ matrix.just_variants }} example all-push-cdn -- --config_file ./crates/orchestrator/run-config.toml
just example all-push-cdn -- --config_file ./crates/orchestrator/run-config.toml
timeout-minutes: 20

build-release:
strategy:
matrix:
just_variants:
- async-std
- tokio
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand All @@ -105,35 +92,30 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "build-release"
prefix-key: ${{ matrix.just_variants }}
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@just

- name: Build examples in release mode
run: just ${{ matrix.just_variants }} build_release --examples --package hotshot-examples --no-default-features
run: just build_release --examples --package hotshot-examples --no-default-features

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: binaries-amd64-${{ matrix.just_variants }}
name: binaries-amd64
path: |
target/${{ matrix.just_variants }}/release/examples/counter
target/${{ matrix.just_variants }}/release/examples/multi-validator-libp2p
target/${{ matrix.just_variants }}/release/examples/validator-libp2p
target/${{ matrix.just_variants }}/release/examples/validator-combined
target/${{ matrix.just_variants }}/release/examples/validator-push-cdn
target/${{ matrix.just_variants }}/release/examples/orchestrator
target/${{ matrix.just_variants }}/release/examples/cdn-broker
target/${{ matrix.just_variants }}/release/examples/cdn-marshal
target/release/examples/counter
target/release/examples/multi-validator-libp2p
target/release/examples/validator-libp2p
target/release/examples/validator-combined
target/release/examples/validator-push-cdn
target/release/examples/orchestrator
target/release/examples/cdn-broker
target/release/examples/cdn-marshal
build-arm-release:
strategy:
matrix:
just_variants:
- async-std
- tokio
fail-fast: false
runs-on: buildjet-4vcpu-ubuntu-2204-arm
if: ${{ github.ref == 'refs/heads/main' }}
Expand All @@ -146,33 +128,28 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "build-arm-release"
prefix-key: ${{ matrix.just_variants }}
cache-on-failure: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Build examples in release mode
run: just ${{ matrix.just_variants }} build_release --examples --package hotshot-examples --no-default-features
run: just build_release --examples --package hotshot-examples --no-default-features

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
name: binaries-aarch64-${{ matrix.just_variants }}
name: binaries-aarch64
path: |
target/${{ matrix.just_variants }}/release/examples/counter
target/${{ matrix.just_variants }}/release/examples/multi-validator-libp2p
target/${{ matrix.just_variants }}/release/examples/validator-libp2p
target/${{ matrix.just_variants }}/release/examples/validator-combined
target/${{ matrix.just_variants }}/release/examples/validator-push-cdn
target/${{ matrix.just_variants }}/release/examples/orchestrator
target/${{ matrix.just_variants }}/release/examples/cdn-broker
target/${{ matrix.just_variants }}/release/examples/cdn-marshal
target/release/examples/counter
target/release/examples/multi-validator-libp2p
target/release/examples/validator-libp2p
target/release/examples/validator-combined
target/release/examples/validator-push-cdn
target/release/examples/orchestrator
target/release/examples/cdn-broker
target/release/examples/cdn-marshal
build-dockers:
strategy:
matrix:
just_variants:
- async-std
- tokio
fail-fast: false
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
Expand All @@ -195,56 +172,50 @@ jobs:
- name: Download AMD executables
uses: actions/download-artifact@v4
with:
name: binaries-amd64-${{ matrix.just_variants }}
path: target/${{ matrix.just_variants }}/amd64/release/examples
name: binaries-amd64
path: target/amd64/release/examples

- name: Download ARM executables
uses: actions/download-artifact@v4
with:
name: binaries-aarch64-${{ matrix.just_variants }}
path: target/${{ matrix.just_variants }}/arm64/release/examples
name: binaries-aarch64
path: target/arm64/release/examples

- name: Generate validator-libp2p docker metadata
uses: docker/metadata-action@v5
id: validator-libp2p
with:
images: ghcr.io/espressosystems/hotshot/validator-libp2p
flavor: suffix=-${{ matrix.just_variants }}

- name: Generate validator-combined docker metadata
uses: docker/metadata-action@v5
id: validator-combined
with:
images: ghcr.io/espressosystems/hotshot/validator-combined
flavor: suffix=-${{ matrix.just_variants }}

- name: Generate validator-push-cdn docker metadata
uses: docker/metadata-action@v5
id: validator-push-cdn
with:
images: ghcr.io/espressosystems/hotshot/validator-push-cdn
flavor: suffix=-${{ matrix.just_variants }}

- name: Generate orchestrator docker metadata
uses: docker/metadata-action@v5
id: orchestrator
with:
images: ghcr.io/espressosystems/hotshot/orchestrator
flavor: suffix=-${{ matrix.just_variants }}

- name: Generate cdn-broker docker metadata
uses: docker/metadata-action@v5
id: cdn-broker
with:
images: ghcr.io/espressosystems/hotshot/cdn-broker
flavor: suffix=-${{ matrix.just_variants }}

- name: Generate cdn-marshal docker metadata
uses: docker/metadata-action@v5
id: cdn-marshal
with:
images: ghcr.io/espressosystems/hotshot/cdn-marshal
flavor: suffix=-${{ matrix.just_variants }}

- name: Build and push validator-libp2p docker
uses: docker/build-push-action@v6
Expand All @@ -257,8 +228,6 @@ jobs:
labels: ${{ steps.validator-libp2p.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}

- name: Build and push validator-combined docker
uses: docker/build-push-action@v6
Expand All @@ -271,8 +240,6 @@ jobs:
labels: ${{ steps.validator-combined.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}

- name: Build and push validator-push-cdn docker
uses: docker/build-push-action@v6
Expand All @@ -285,8 +252,6 @@ jobs:
labels: ${{ steps.validator-push-cdn.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}

- name: Build and push orchestrator docker
uses: docker/build-push-action@v6
Expand All @@ -299,8 +264,6 @@ jobs:
labels: ${{ steps.orchestrator.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}

- name: Build and push cdn-broker docker
uses: docker/build-push-action@v6
Expand All @@ -313,8 +276,6 @@ jobs:
labels: ${{ steps.cdn-broker.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}

- name: Build and push cdn-marshal docker
uses: docker/build-push-action@v6
Expand All @@ -327,5 +288,3 @@ jobs:
labels: ${{ steps.cdn-marshal.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ASYNC_EXECUTOR=${{ matrix.just_variants }}
3 changes: 0 additions & 3 deletions .github/workflows/build-without-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"'

jobs:
build-ignore-lockfile:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
# sanity check that repository builds with nix
- name: Build
run: |
nix develop -c just async-std build
nix develop -c just build
6 changes: 3 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:

- name: Test Docs
run: |
just async-std doc_test
just doc_test
- name: Build Docs
run: |
just async-std doc
just doc
- name: Create documentation
if: ${{ github.ref == 'refs/heads/main' }}
run: |
cp -R target/async-std/doc public
cp -R target/doc public
echo '<meta http-equiv="refresh" content="0; url=hotshot">' > public/index.html
- name: Deploy
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ concurrency:
jobs:
clippy:
strategy:
matrix:
just_variants:
- async-std
- tokio
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand All @@ -34,14 +30,13 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "lint"
prefix-key: ${{ matrix.just_variants }}
save-if: ${{ github.ref == 'refs/heads/main' }}

- uses: taiki-e/install-action@just

- name: Run clippy
run: |
just ${{ matrix.just_variants }} clippy
just clippy
fmt:
runs-on: ubuntu-latest
Expand All @@ -56,4 +51,4 @@ jobs:

- name: Check rustfmt
run: |
just ${{ matrix.just_variants }} fmt_check
just fmt_check
9 changes: 2 additions & 7 deletions .github/workflows/semver-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
test-sequencer:
runs-on: ubuntu-latest
name: semver
strategy:
matrix:
async_runtimes:
- async-std
- tokio

steps:
- uses: actions/checkout@v4
name: Checkout Repository
Expand All @@ -42,7 +38,6 @@ jobs:
name: Enable Rust Caching
with:
shared-key: "build-and-test"
prefix-key: ${{ matrix.just_variants }}
save-if: false

- name: Install cargo-semver-checks and cargo-workspaces
Expand All @@ -53,5 +48,5 @@ jobs:
- name: Run cargo-semver-checks
run: |
cd current
just ${{matrix.async_runtimes}} semver --baseline-root ../baseline
just semver --baseline-root ../baseline
2 changes: 0 additions & 2 deletions .github/workflows/test-sequencer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ jobs:
- name: Build sequencer tests
working-directory: sequencer
run: |
export RUSTFLAGS='--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" --cfg hotshot_example'
cargo test --release --workspace --all-features --no-run
- name: Run sequencer tests
working-directory: sequencer
run: |
export RUSTFLAGS='--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" --cfg hotshot_example'
cargo test --release --workspace --all-features --verbose -- --test-threads 1 --nocapture
6 changes: 0 additions & 6 deletions .vscode/settings.json.example

This file was deleted.

Loading

0 comments on commit 1c3e22f

Please sign in to comment.