diff --git a/.github/workflows/docker-release.yaml b/.github/workflows/docker-release.yaml index f14b14b3a..ddf8bb61d 100644 --- a/.github/workflows/docker-release.yaml +++ b/.github/workflows/docker-release.yaml @@ -31,7 +31,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: clippy - toolchain: 1.71.0 + toolchain: 1.75.0 - name: Install toolchain (nightly) run: rustup toolchain add nightly --component rustfmt --profile minimal @@ -40,6 +40,8 @@ jobs: with: cache-on-failure: true + - uses: taiki-e/install-action@cross + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -53,10 +55,8 @@ jobs: - name: Build and push image run: | - cargo install cross --git https://github.com/cross-rs/cross - if [ -n "${{ github.event.inputs.version }}" ]; then - make GIT_TAG="${{ github.event.inputs.version }}" docker-build + sudo -E env "PATH=$PATH" make GIT_TAG="${{ github.event.inputs.version }}" docker-build else - make docker-build-latest + sudo -E env "PATH=$PATH" make docker-build-latest fi diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c3d7d9c5f..da7626c7c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,52 +30,52 @@ jobs: build: name: build release + runs-on: ${{ matrix.os }} + needs: extract-version strategy: matrix: - arch: - [ - aarch64-unknown-linux-gnu, - x86_64-unknown-linux-gnu, - x86_64-apple-darwin, - aarch64-apple-darwin, - x86_64-pc-windows-gnu, - ] include: - - arch: aarch64-unknown-linux-gnu - platform: ubuntu-latest + - target: aarch64-unknown-linux-gnu + os: ubuntu-20.04 profile: release - - arch: x86_64-unknown-linux-gnu - platform: ubuntu-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-20.04 profile: release - - arch: x86_64-apple-darwin - platform: macos-latest + - target: x86_64-apple-darwin + os: macos-latest profile: release - - arch: aarch64-apple-darwin - platform: macos-latest + - target: aarch64-apple-darwin + os: macos-latest profile: release - - arch: x86_64-pc-windows-gnu - platform: ubuntu-latest + - target: x86_64-pc-windows-gnu + os: ubuntu-20.04 profile: release - runs-on: ${{ matrix.platform }} - needs: extract-version steps: - - name: Checkout sources - uses: actions/checkout@v3 - - name: Get latest version of stable Rust - run: rustup update stable - - name: Install target - run: rustup target add ${{ matrix.arch }} + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: dtolnay/rust-toolchain@stable + with: + target: ${{ matrix.target }} + - uses: taiki-e/install-action@cross - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true + - name: Foundry install + if: contains( ${{ matrix.target }}, 'apple') + uses: foundry-rs/foundry-toolchain@v1 + - name: Install protobuf + if: contains( ${{ matrix.target }}, 'apple') + uses: arduino/setup-protoc@v3 + # ============================== # Apple Silicon SDK setup # ============================== - name: Apple Silicon setup - if: ${{ matrix.job.target == 'aarch64-apple-darwin' }} + if: matrix.target == 'aarch64-apple-darwin' run: | echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV @@ -84,22 +84,15 @@ jobs: # Builds # ============================== - - name: Build rundler for ${{ matrix.arch }} + - name: Build rundler for ${{ matrix.target }} run: | - cargo install cross - env PROFILE=${{ matrix.profile }} make build-${{ matrix.arch }} + sudo -E env "PATH=$PATH" make build-${{ matrix.target }} - name: Move cross-compiled binary - if: matrix.arch != 'x86_64-pc-windows-gnu' - run: | - mkdir artifacts - mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler ./artifacts - - - name: Move cross-compiled binary (Windows) - if: matrix.arch == 'x86_64-pc-windows-gnu' run: | mkdir artifacts - mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler.exe ./artifacts + [[ "${{ matrix.target }}" == *windows* ]] && ext=".exe" + sudo mv "target/${{ matrix.target }}/${{ matrix.profile }}/rundler${ext}" ./artifacts # ============================== # Signing @@ -111,10 +104,10 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | export GPG_TTY=$(tty) - echo -n "$GPG_SIGNING_KEY" | gpg --batch --import + echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --batch --import cd artifacts - tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz rundler* - echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz + tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz rundler* + echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz mv *tar.gz* .. shell: bash @@ -125,14 +118,14 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz - path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz + name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz + path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz - name: Upload signature uses: actions/upload-artifact@v3 with: - name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc - path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc + name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc + path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc draft-release: name: draft release @@ -220,7 +213,7 @@ jobs: ) assets=() for asset in ./rundler-*.tar.gz*; do - assets+=("-a" "$asset/$asset") + assets+=("$asset/$asset") done tag_name="${{ env.VERSION }}" - echo "$body" | gh release create --draft "${assets[@]}" -F "-" "$tag_name" + echo "$body" | gh release create --draft -t "Rundler $tag_name" -F "-" "$tag_name" "${assets[@]}" diff --git a/Cargo.lock b/Cargo.lock index 42c2a301c..a178358ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1792,21 +1792,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.0" @@ -2259,19 +2244,6 @@ dependencies = [ "tokio-io-timeout", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "iana-time-zone" version = "0.1.53" @@ -2907,7 +2879,6 @@ checksum = "9bf4e7146e30ad172c42c39b3246864bd2d3c6396780711a1baf749cfe423e21" dependencies = [ "base64 0.21.0", "hyper", - "hyper-tls", "indexmap 2.2.3", "ipnet", "metrics 0.22.1", @@ -2915,7 +2886,6 @@ dependencies = [ "quanta", "thiserror", "tokio", - "tracing", ] [[package]] @@ -3037,24 +3007,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -3207,50 +3159,12 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.4.1", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae94056a791d0e1217d18b6cbdccb02c61e3054fc69893607f4067e3bb0b1fd1" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -4176,7 +4090,7 @@ dependencies = [ [[package]] name = "rundler" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "clap", @@ -4214,7 +4128,7 @@ dependencies = [ [[package]] name = "rundler-builder" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "async-trait", @@ -4255,7 +4169,7 @@ dependencies = [ [[package]] name = "rundler-dev" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "ethers", @@ -4264,7 +4178,7 @@ dependencies = [ [[package]] name = "rundler-pool" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "async-stream", @@ -4298,7 +4212,7 @@ dependencies = [ [[package]] name = "rundler-provider" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "async-trait", @@ -4317,7 +4231,7 @@ dependencies = [ [[package]] name = "rundler-rpc" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "async-trait", @@ -4346,7 +4260,7 @@ dependencies = [ [[package]] name = "rundler-sim" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "arrayvec", @@ -4373,7 +4287,7 @@ dependencies = [ [[package]] name = "rundler-task" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "async-trait", @@ -4393,7 +4307,7 @@ dependencies = [ [[package]] name = "rundler-tools" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "clap", @@ -4410,7 +4324,7 @@ dependencies = [ [[package]] name = "rundler-types" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "chrono", @@ -4425,7 +4339,7 @@ dependencies = [ [[package]] name = "rundler-utils" -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" dependencies = [ "anyhow", "derive_more", @@ -5538,16 +5452,6 @@ dependencies = [ "tokio-stream", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.23.4" @@ -6060,12 +5964,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" diff --git a/Cargo.toml b/Cargo.toml index e490b1678..d1ae4a4f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ default-members = ["bin/rundler"] resolver = "2" [workspace.package] -version = "0.2.0-alpha.0" +version = "0.1.0-rc0" edition = "2021" rust-version = "1.75" license = "MIT OR Apache-2.0" diff --git a/Cross.toml b/Cross.toml index 76c3e817f..a69f5ecaf 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,2 +1,2 @@ [build] -dockerfile = "Dockerfile.build" +dockerfile = "./Dockerfile.build" diff --git a/Dockerfile.build b/Dockerfile.build index 7b8f19e4e..2324e2af4 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,18 +1,22 @@ ARG CROSS_BASE_IMAGE -# Dockerfile.forge -FROM ghcr.io/foundry-rs/foundry:latest as foundry + +FROM ghcr.io/foundry-rs/foundry:nightly-ac802618e15039b31e464ae6d1fe3ee39f87cefd as foundry FROM $CROSS_BASE_IMAGE COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge -ARG DEBIAN_FRONTEND=noninteractive +# Install Node.js 14.x and Yarn +RUN apt-get update \ + && apt-get install -y curl \ + && curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g yarn \ + && apt-get clean + +RUN apt-get update && apt-get install -y unzip + +# Install Protobuf compiler v3 +RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip \ + && unzip protoc-3.15.8-linux-x86_64.zip -d /usr/local \ + && chmod +x /usr/local/bin/protoc -RUN apt-get update && apt-get install -y gnupg2 apt-transport-https ca-certificates software-properties-common -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN mkdir -p /etc/apt/keyrings -RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list -RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn -RUN add-apt-repository ppa:ethereum/ethereum -RUN apt-get update -RUN apt-get install -y solc diff --git a/Makefile b/Makefile index c176f6a86..073c87048 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ submodule-update: ## Update git submodules git submodule update build-%: - cross build --bin rundler --target $* --profile "$(PROFILE)" + cross build --target $* --profile "$(PROFILE)" .PHONY: fmt fmt: ## format code with nightly rust @@ -71,6 +71,6 @@ define build_docker_image --platform linux/arm64,linux/amd64 \ --tag $(DOCKER_IMAGE_NAME):$(1) \ $(if $(2),--tag $(DOCKER_IMAGE_NAME):$(2)) \ - --provenance=false + --provenance=false --push endef diff --git a/bin/rundler/Cargo.toml b/bin/rundler/Cargo.toml index 75d085d52..86a58c87b 100644 --- a/bin/rundler/Cargo.toml +++ b/bin/rundler/Cargo.toml @@ -27,7 +27,7 @@ dotenv = "0.15.0" ethers.workspace = true itertools = "0.12.1" metrics = "0.22.1" -metrics-exporter-prometheus = "0.13.1" +metrics-exporter-prometheus = { version = "0.13.1", default-features = false, features = ["http-listener"] } metrics-process = "1.0.10" metrics-util = "0.16.2" paste = "1.0" @@ -44,3 +44,4 @@ tracing.workspace = true tracing-appender = "0.2.2" tracing-log = "0.2.0" tracing-subscriber = { version = "0.3.16", features = ["env-filter", "fmt", "json"] } + diff --git a/deny.toml b/deny.toml index c6cb720f9..b00691538 100644 --- a/deny.toml +++ b/deny.toml @@ -22,6 +22,7 @@ deny = [ # Each entry the name of a crate and a version range. If version is # not specified, all versions will be matched. #{ name = "ansi_term", version = "=0.11.0" }, + { name = "openssl" } ] # Certain crates/versions that will be skipped when doing duplicate detection. skip = []