From de9e1b2deecdfb83ebc54610969b7c40b2687a1d Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:25:33 -0700 Subject: [PATCH 1/8] add rust crate --- .github/workflows/release-rust-crates-new.yml | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/release-rust-crates-new.yml diff --git a/.github/workflows/release-rust-crates-new.yml b/.github/workflows/release-rust-crates-new.yml new file mode 100644 index 00000000..87b5e611 --- /dev/null +++ b/.github/workflows/release-rust-crates-new.yml @@ -0,0 +1,102 @@ +name: Rust Package + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + inputs: + ref: + description: 'The reference (branch/tag/commit) to checkout' + required: false + release-type: + type: choice + required: false + default: 'none' + description: 'Indicates whether we want to make a release and if which one' + options: + - release + - none + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + name: Build and Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: aarch64-unknown-linux-gnu + os: linux-arm64 + - target: x86_64-apple-darwin + os: macos-13 + - target: aarch64-apple-darwin + os: macos-14 + - target: x86_64-pc-windows-gnu + os: windows-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: ${{ matrix.target }} + + - name: Build + run: cargo build --target ${{ matrix.target }} --verbose + + - name: Run tests + run: cargo test --target ${{ matrix.target }} --verbose + + publish: + name: Publish in order + needs: build-and-test + if: ${{ inputs.release-type != 'none' && github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + # These steps are in a specific order so crate dependencies are updated first + - name: Publish bls12_381 + run: cargo publish --package crate_crypto_internal_eth_kzg_bls12_381 + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} + + - name: Publish polynomial + run: cargo publish --package crate_crypto_internal_eth_kzg_polynomial + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} + + - name: Publish erasure_codes + run: cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} + + - name: Publish kzg_multi_open + run: cargo publish --package crate_crypto_kzg_multi_open_fk20 + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} + + - name: Publish eip7594 + run: cargo publish --package eip7594 + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} \ No newline at end of file From cbbb55fa63bde628c691e27d4d5cbb2f97d7a170 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:29:25 -0700 Subject: [PATCH 2/8] add back comment --- .github/workflows/release-rust-crates-new.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-rust-crates-new.yml b/.github/workflows/release-rust-crates-new.yml index 87b5e611..aeab272d 100644 --- a/.github/workflows/release-rust-crates-new.yml +++ b/.github/workflows/release-rust-crates-new.yml @@ -59,6 +59,8 @@ jobs: - name: Run tests run: cargo test --target ${{ matrix.target }} --verbose +# We really only want to publish the eip7594 crate +# However, crates.io forces us to publish its dependencies too. publish: name: Publish in order needs: build-and-test From d564e391d00a63960efe44d264dc727e95e6396d Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:30:47 -0700 Subject: [PATCH 3/8] remove old yml release file --- .github/workflows/release-rust-crates-new.yml | 104 ------------------ .github/workflows/release-rust-crates.yml | 76 ++++++++++--- 2 files changed, 60 insertions(+), 120 deletions(-) delete mode 100644 .github/workflows/release-rust-crates-new.yml diff --git a/.github/workflows/release-rust-crates-new.yml b/.github/workflows/release-rust-crates-new.yml deleted file mode 100644 index aeab272d..00000000 --- a/.github/workflows/release-rust-crates-new.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Rust Package - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - workflow_dispatch: - inputs: - ref: - description: 'The reference (branch/tag/commit) to checkout' - required: false - release-type: - type: choice - required: false - default: 'none' - description: 'Indicates whether we want to make a release and if which one' - options: - - release - - none - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-and-test: - name: Build and Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - - target: aarch64-unknown-linux-gnu - os: linux-arm64 - - target: x86_64-apple-darwin - os: macos-13 - - target: aarch64-apple-darwin - os: macos-14 - - target: x86_64-pc-windows-gnu - os: windows-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref || github.ref }} - - - name: Setup toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: ${{ matrix.target }} - - - name: Build - run: cargo build --target ${{ matrix.target }} --verbose - - - name: Run tests - run: cargo test --target ${{ matrix.target }} --verbose - -# We really only want to publish the eip7594 crate -# However, crates.io forces us to publish its dependencies too. - publish: - name: Publish in order - needs: build-and-test - if: ${{ inputs.release-type != 'none' && github.event_name == 'workflow_dispatch' }} - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref || github.ref }} - - - name: Setup toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - # These steps are in a specific order so crate dependencies are updated first - - name: Publish bls12_381 - run: cargo publish --package crate_crypto_internal_eth_kzg_bls12_381 - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - - - name: Publish polynomial - run: cargo publish --package crate_crypto_internal_eth_kzg_polynomial - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - - - name: Publish erasure_codes - run: cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - - - name: Publish kzg_multi_open - run: cargo publish --package crate_crypto_kzg_multi_open_fk20 - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - - - name: Publish eip7594 - run: cargo publish --package eip7594 - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index e9b3e3f7..aeab272d 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -1,27 +1,76 @@ -# We really only want to publish the eip7594 crate -# However, crates.io forces us to publish its dependencies too. -name: Publish rust crates +name: Rust Package on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] workflow_dispatch: inputs: ref: - description: The reference (branch/tag/commit) to checkout - required: true + description: 'The reference (branch/tag/commit) to checkout' + required: false + release-type: + type: choice + required: false + default: 'none' + description: 'Indicates whether we want to make a release and if which one' + options: + - release + - none concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + build-and-test: + name: Build and Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: aarch64-unknown-linux-gnu + os: linux-arm64 + - target: x86_64-apple-darwin + os: macos-13 + - target: aarch64-apple-darwin + os: macos-14 + - target: x86_64-pc-windows-gnu + os: windows-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.ref }} + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: ${{ matrix.target }} + + - name: Build + run: cargo build --target ${{ matrix.target }} --verbose + + - name: Run tests + run: cargo test --target ${{ matrix.target }} --verbose + +# We really only want to publish the eip7594 crate +# However, crates.io forces us to publish its dependencies too. publish: name: Publish in order + needs: build-and-test + if: ${{ inputs.release-type != 'none' && github.event_name == 'workflow_dispatch' }} runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@v4 with: - ref: ${{ inputs.ref }} + ref: ${{ inputs.ref || github.ref }} - name: Setup toolchain uses: dtolnay/rust-toolchain@master @@ -30,31 +79,26 @@ jobs: # These steps are in a specific order so crate dependencies are updated first - name: Publish bls12_381 - run: | - cargo publish --package crate_crypto_internal_eth_kzg_bls12_381 + run: cargo publish --package crate_crypto_internal_eth_kzg_bls12_381 env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - name: Publish polynomial - run: | - cargo publish --package crate_crypto_internal_eth_kzg_polynomial + run: cargo publish --package crate_crypto_internal_eth_kzg_polynomial env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - name: Publish erasure_codes - run: | - cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes + run: cargo publish --package crate_crypto_internal_eth_kzg_erasure_codes env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - name: Publish kzg_multi_open - run: | - cargo publish --package crate_crypto_kzg_multi_open_fk20 + run: cargo publish --package crate_crypto_kzg_multi_open_fk20 env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} - name: Publish eip7594 - run: | - cargo publish --package eip7594 + run: cargo publish --package eip7594 env: CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_RELEASE_TOKEN }} \ No newline at end of file From cdeaecb198b8b332952cec0e24200e0446e2f791 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:31:05 -0700 Subject: [PATCH 4/8] modify workflow-dispatch input --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8abb6649..36cd9b55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: with: workflow: release-rust-crates.yml ref: master - inputs: '{ "ref": "${{ needs.release-please.outputs.tag-name }}" }' + inputs: '{ "ref": "${{ needs.release-please.outputs.tag-name }}", "release-type": "release" }' token: ${{ secrets.RELEASE_TOKEN }} publish-node-bindings: From 8401223939fb2ab6eff18de1f3fe13c6ed8c21d2 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:38:50 -0700 Subject: [PATCH 5/8] debug heap overflow --- .github/workflows/release-rust-crates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index aeab272d..53a143c3 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -57,7 +57,7 @@ jobs: run: cargo build --target ${{ matrix.target }} --verbose - name: Run tests - run: cargo test --target ${{ matrix.target }} --verbose + run: RUST_BACKTRACE=1 cargo test -p crate_crypto_kzg_multi_open_fk20 --lib -- --nocapture # We really only want to publish the eip7594 crate # However, crates.io forces us to publish its dependencies too. From 2aff67954d4d2489d8f581f19ff9ec3642068e87 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:45:10 -0700 Subject: [PATCH 6/8] separate windows test --- .github/workflows/release-rust-crates.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index 53a143c3..53426027 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -56,8 +56,13 @@ jobs: - name: Build run: cargo build --target ${{ matrix.target }} --verbose + - name: Run tests (Windows) + if: matrix.target == 'x86_64-pc-windows-gnu' + run: cargo test --target ${{ matrix.target }} -- --test-threads=1 + - name: Run tests - run: RUST_BACKTRACE=1 cargo test -p crate_crypto_kzg_multi_open_fk20 --lib -- --nocapture + if: matrix.target != 'x86_64-pc-windows-gnu' + run: cargo test --target ${{ matrix.target }} # We really only want to publish the eip7594 crate # However, crates.io forces us to publish its dependencies too. From 0669ba1acfd9a03d50d6f23515776bdec1eb502c Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:54:26 -0700 Subject: [PATCH 7/8] add comment re running tests on windows --- .github/workflows/release-rust-crates.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-rust-crates.yml b/.github/workflows/release-rust-crates.yml index 53426027..14645a9e 100644 --- a/.github/workflows/release-rust-crates.yml +++ b/.github/workflows/release-rust-crates.yml @@ -55,7 +55,8 @@ jobs: - name: Build run: cargo build --target ${{ matrix.target }} --verbose - + + # See issue 133 as to why windows is running on a single thread - name: Run tests (Windows) if: matrix.target == 'x86_64-pc-windows-gnu' run: cargo test --target ${{ matrix.target }} -- --test-threads=1 From 4587b7e6b9ac3786fc9c03fe43c57030be98e452 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Thu, 1 Aug 2024 22:55:31 -0700 Subject: [PATCH 8/8] remove old test rust workflow file --- .github/workflows/test-rust.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/test-rust.yml diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml deleted file mode 100644 index 0abbfa94..00000000 --- a/.github/workflows/test-rust.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Test Rust Workspace - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose