diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index 3817ffeaf35f..000000000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: โšก๏ธ Benchmarks - -on: - push: - paths-ignore: - - '**.md' - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - paths-ignore: - - '**.md' - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Benchmarks - runs-on: benchmark - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [ 3.9 ] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - BLOCKS_AND_PLOTS_VERSION: 0.30.0 - - steps: - - name: Clean workspace - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - shell: bash - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - - name: Cache pip - uses: actions/cache@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v3 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: ${{ env.BLOCKS_AND_PLOTS_VERSION }} - fetch-depth: 1 - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python-version }} - development: true - legacy_keyring: true - - - uses: chia-network/actions/activate-venv@main - - - name: pytest - run: | - pytest -n 0 --capture no -m benchmark tests diff --git a/.github/workflows/build-linux-arm64-installer.yml b/.github/workflows/build-linux-arm64-installer.yml deleted file mode 100644 index b9eb690a6966..000000000000 --- a/.github/workflows/build-linux-arm64-installer.yml +++ /dev/null @@ -1,256 +0,0 @@ -name: ๐Ÿ“ฆ๐Ÿš€ Build Installer - Linux DEB ARM64 - -on: - workflow_dispatch: - push: - paths-ignore: - - '**.md' - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - paths-ignore: - - '**.md' - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Linux arm64 DEB Installer - runs-on: [Linux, ARM64] - container: chianetwork/ubuntu-18.04-builder:latest - timeout-minutes: 120 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8] - - steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Add safe git directory - uses: Chia-Network/actions/git-mark-workspace-safe@main - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: Chia-Network/actions/git-ssh-to-https@main - - - name: Cleanup any leftovers that exist from previous runs - run: bash build_scripts/clean-runner.sh || true - - - name: Set Env - uses: Chia-Network/actions/setjobenv@main - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Create our own venv outside of the git directory JUST for getting the ACTUAL version so that install can't break it - - name: Get version number - id: version_number - run: | - python3 -m venv ../venv - . ../venv/bin/activate - pip3 install setuptools_scm - echo "CHIA_INSTALLER_VERSION=$(python3 ./build_scripts/installer-version.py)" >> $GITHUB_OUTPUT - deactivate - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_AWS_SECRET - unset HAS_GLUE_SECRET - - if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi - echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >> $GITHUB_OUTPUT - - if [ -n "$GLUE_ACCESS_TOKEN" ]; then HAS_GLUE_SECRET='true' ; fi - echo HAS_GLUE_SECRET=${HAS_GLUE_SECRET} >> $GITHUB_OUTPUT - env: - AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}" - GLUE_ACCESS_TOKEN: "${{ secrets.GLUE_ACCESS_TOKEN }}" - - - name: Get latest madmax plotter - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - LATEST_MADMAX=$(gh api repos/Chia-Network/chia-plotter-madmax/releases/latest --jq 'select(.prerelease == false) | .tag_name') - mkdir "$GITHUB_WORKSPACE/madmax" - gh release download -R Chia-Network/chia-plotter-madmax $LATEST_MADMAX -p 'chia_plot-*-arm64' -O $GITHUB_WORKSPACE/madmax/chia_plot - gh release download -R Chia-Network/chia-plotter-madmax $LATEST_MADMAX -p 'chia_plot_k34-*-arm64' -O $GITHUB_WORKSPACE/madmax/chia_plot_k34 - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" - - - name: Get latest bladebit plotter - if: '!github.event.release.prerelease' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - LATEST_BLADEBIT=$(gh api repos/Chia-Network/bladebit/releases/latest --jq 'select(.prerelease == false) | .tag_name') - mkdir "$GITHUB_WORKSPACE/bladebit" - cd "$GITHUB_WORKSPACE/bladebit" - gh release download -R Chia-Network/bladebit $LATEST_BLADEBIT -p 'bladebit*-ubuntu-arm64.tar.gz' - ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}' - ls bladebit* | xargs -I{} chmod +x {} - cd "$OLDPWD" - - - name: Get latest prerelease bladebit plotter - if: env.PRE_RELEASE == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - LATEST_PRERELEASE=$(gh api repos/Chia-Network/bladebit/releases --jq 'map(select(.prerelease)) | first | .tag_name') - mkdir "$GITHUB_WORKSPACE/bladebit" - cd "$GITHUB_WORKSPACE/bladebit" - gh release download -R Chia-Network/bladebit $LATEST_PRERELEASE -p 'bladebit*ubuntu-arm64.tar.gz' - ls *.tar.gz | xargs -I{} bash -c 'tar -xzf {} && rm {}' - ls bladebit* | xargs -I{} chmod +x {} - cd "$OLDPWD" - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python-version }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Prepare GUI cache - id: gui-ref - run: | - gui_ref=$(git submodule status chia-blockchain-gui | sed -e 's/^ //g' -e 's/ chia-blockchain-gui.*$//g') - echo "${gui_ref}" - echo "GUI_REF=${gui_ref}" >> $GITHUB_OUTPUT - echo "rm -rf ./chia-blockchain-gui" - rm -rf ./chia-blockchain-gui - - - name: Cache GUI - uses: actions/cache@v3 - id: cache-gui - with: - path: ./chia-blockchain-gui - key: ${{ runner.os }}-arm64-chia-blockchain-gui-${{ steps.gui-ref.outputs.GUI_REF }} - - - if: steps.cache-gui.outputs.cache-hit != 'true' - name: Build GUI - continue-on-error: false - run: | - cd ./build_scripts - bash build_linux_deb-1-gui.sh - - - name: Build arm64 .deb package - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - ldd --version - cd ./build_scripts - sh build_linux_deb-2-installer.sh arm64 - - - name: Upload Linux artifacts - uses: actions/upload-artifact@v3 - with: - name: chia-installers-linux-deb-arm64 - path: ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_AWS_SECRET - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb" "s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_arm64.deb" - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb" "s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_arm64.deb" - - - name: Create Checksums - if: env.FULL_RELEASE == 'true' || github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - - name: Create torrent - if: env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb - gh release upload $RELEASE_TAG $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent - - - name: Upload Dev Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/latest-dev/chia-blockchain_arm64_latest_dev.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain_arm64_latest_dev.deb.sha256 - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/latest-dev/chia-blockchain-cli_arm64_latest_dev.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli_arm64_latest_dev.deb.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent s3://download.chia.net/torrents/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "TAG_NAME=$(echo ${{ github.ref }} | cut -d'/' -f 3)" >> $GITHUB_OUTPUT - echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2)" >> $GITHUB_OUTPUT - - - name: Upload release artifacts - if: env.RELEASE == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - gh release upload \ - $RELEASE_TAG \ - build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb \ - build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb - - - name: Mark installer complete - if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true' - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-arm - - - name: Clean up on self hosted runner - run: | - sudo rm -rf build_scripts/final_installer - - - name: Remove working files to exclude from cache - run: | - rm -rf ./chia-blockchain-gui/packages/gui/daemon diff --git a/.github/workflows/build-linux-installer-deb.yml b/.github/workflows/build-linux-installer-deb.yml index 187f8d3aa37b..469a28635e9d 100644 --- a/.github/workflows/build-linux-installer-deb.yml +++ b/.github/workflows/build-linux-installer-deb.yml @@ -28,6 +28,8 @@ jobs: runs-on: ubuntu-latest container: chianetwork/ubuntu-18.04-builder:latest timeout-minutes: 120 + permissions: + contents: write strategy: fail-fast: false max-parallel: 4 @@ -163,25 +165,6 @@ jobs: name: chia-installers-linux-deb-intel path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_AWS_SECRET - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb" "s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_amd64.deb" - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb" "s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_amd64.deb" - - name: Create Checksums if: env.FULL_RELEASE == 'true' || github.ref == 'refs/heads/main' env: @@ -192,38 +175,6 @@ jobs: sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - name: Create .deb torrent - if: env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb - gh release upload $RELEASE_TAG $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent - - - name: Upload Dev Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/latest-dev/chia-blockchain_amd64_latest_dev.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain_amd64_latest_dev.deb.sha256 - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/latest-dev/chia-blockchain-cli_amd64_latest_dev.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli_amd64_latest_dev.deb.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent s3://download.chia.net/torrents/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent s3://download.chia.net/torrents/ - - name: Get tag name if: startsWith(github.ref, 'refs/tags/') id: tag-name @@ -242,11 +193,6 @@ jobs: build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb \ build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb - - name: Mark installer complete - if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true' - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-linux-deb - - name: Remove working files to exclude from cache run: | rm -rf ./chia-blockchain-gui/packages/gui/daemon diff --git a/.github/workflows/build-linux-installer-rpm.yml b/.github/workflows/build-linux-installer-rpm.yml index 9ead48f6d03f..91c4eac4e0ce 100644 --- a/.github/workflows/build-linux-installer-rpm.yml +++ b/.github/workflows/build-linux-installer-rpm.yml @@ -29,6 +29,8 @@ jobs: container: image: chianetwork/centos7-builder:latest timeout-minutes: 40 + permissions: + contents: write strategy: fail-fast: false max-parallel: 4 @@ -162,26 +164,6 @@ jobs: name: chia-installers-linux-rpm-intel path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_AWS_SECRET - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/dev/chia-blockchain-${CHIA_DEV_BUILD}-1.x86_64.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/dev/chia-blockchain-cli-${CHIA_DEV_BUILD}-1.x86_64.rpm - - name: Create Checksums if: env.FULL_RELEASE == 'true' || github.ref == 'refs/heads/main' env: @@ -192,38 +174,6 @@ jobs: sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - name: Create .rpm torrent - if: env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent --webseed https://download.chia.net/install/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent --webseed https://download.chia.net/install/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm - gh release upload $RELEASE_TAG $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent - - - name: Upload Dev Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/latest-dev/chia-blockchain-1.x86_64_latest_dev.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/latest-dev/chia-blockchain-1.x86_64_latest_dev.rpm.sha256 - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/latest-dev/chia-blockchain-cli-1.x86_64_latest_dev.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/latest-dev/chia-blockchain-cli-1.x86_64_latest_dev.rpm.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent s3://download.chia.net/torrents/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent s3://download.chia.net/torrents/ - - name: Get tag name if: startsWith(github.ref, 'refs/tags/') id: tag-name @@ -242,12 +192,6 @@ jobs: build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm \ build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm - - - name: Mark installer complete - if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true' - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-linux-rpm - - name: Remove working files to exclude from cache run: | rm -rf ./chia-blockchain-gui/packages/gui/daemon diff --git a/.github/workflows/build-macos-installers.yml b/.github/workflows/build-macos-installers.yml index ca5b22a57c38..4a070d3579a8 100644 --- a/.github/workflows/build-macos-installers.yml +++ b/.github/workflows/build-macos-installers.yml @@ -27,24 +27,20 @@ jobs: name: MacOS ${{ matrix.os.name }} Installer runs-on: ${{ matrix.os.runs-on }} timeout-minutes: 90 + permissions: + contents: write strategy: fail-fast: false max-parallel: 4 matrix: python-version: [3.9] os: - - runs-on: macos-10.14 + - runs-on: macos-11 name: intel file-suffix: "" mac-package-name: "Chia-darwin-x64" glue-name: "build-macos" bladebit-suffix: macos-x86-64.tar.gz - - runs-on: [MacOS, ARM64] - name: m1 - file-suffix: "-arm64" - mac-package-name: "Chia-darwin-arm64" - glue-name: "build-mac-m1" - bladebit-suffix: macos-arm64.tar.gz steps: - uses: Chia-Network/actions/clean-workspace@main @@ -210,11 +206,6 @@ jobs: name: chia-installers-macos-dmg-${{ matrix.os.name }} path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Install AWS CLI - if: steps.check_secrets.outputs.HAS_AWS_SECRET - run: | - command -v aws || brew install awscli - - name: Install GH CLI run: | command -v gh || brew install gh @@ -224,50 +215,6 @@ jobs: ls shasum -a 256 ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg > ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/dev/Chia-${CHIA_DEV_BUILD}${{ matrix.os.file-suffix }}.dmg - - - name: Create torrent - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: env.FULL_RELEASE == 'true' - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg - ls ${{ github.workspace }}/build_scripts/final_installer/ - gh release upload $RELEASE_TAG ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent - - - name: Upload Dev Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/latest-dev/Chia${{ matrix.os.file-suffix }}_latest_dev.dmg - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 s3://download.chia.net/latest-dev/Chia${{ matrix.os.file-suffix }}_latest_dev.dmg.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true' - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent s3://download.chia.net/torrents/ - - name: Get tag name if: startsWith(github.ref, 'refs/tags/') id: tag-name @@ -285,11 +232,6 @@ jobs: $RELEASE_TAG \ build_scripts/final_installer/*.dmg - - name: Mark installer complete - if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true' - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/${{ matrix.os.glue-name }} - # We want to delete this no matter what happened in the previous steps (failures, success, etc) - name: Delete signing keychain if: always() diff --git a/.github/workflows/build-windows-installer.yml b/.github/workflows/build-windows-installer.yml index 78dcf04b7f2f..cb3c9d728cc8 100644 --- a/.github/workflows/build-windows-installer.yml +++ b/.github/workflows/build-windows-installer.yml @@ -27,6 +27,8 @@ jobs: name: Windows 10 Installer runs-on: [windows-2019] timeout-minutes: 65 + permissions: + contents: write strategy: fail-fast: false matrix: @@ -212,32 +214,6 @@ jobs: name: chia-installers-windows-exe-intel path: ${{ github.workspace }}\chia-blockchain-gui\release-builds\ - - name: Install AWS CLI - if: steps.check_secrets.outputs.HAS_AWS_SECRET - run: | - msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi - - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_AWS_SECRET - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - shell: bash - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo CHIA_DEV_BUILD=${CHIA_DEV_BUILD} >>$GITHUB_OUTPUT - echo ${CHIA_DEV_BUILD} - pwd - aws s3 cp chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${CHIA_INSTALLER_VERSION}.exe s3://download.chia.net/dev/ChiaSetup-${CHIA_DEV_BUILD}.exe - - name: Create Checksums env: CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} @@ -245,33 +221,6 @@ jobs: certutil.exe -hashfile ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe SHA256 > ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 ls ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ - - name: Create torrent - if: env.FULL_RELEASE == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe -o ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent --webseed https://download.chia.net/install/ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe - ls - gh release upload $env:RELEASE_TAG ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent - - - name: Upload Dev Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true' - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - run: | - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent s3://download.chia.net/torrents/ - - name: Get tag name if: startsWith(github.ref, 'refs/tags/') id: tag-name @@ -288,18 +237,6 @@ jobs: run: | gh release upload $env:RELEASE_TAG ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe - - name: Mark installer complete - if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true' - run: | - $headers = @{ - Authorization="Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" - } - $data = @{ - chia_ref='${{ steps.tag-name.outputs.TAG_NAME }}' - } - $json = $data | ConvertTo-Json - $response = Invoke-RestMethod '${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-windows' -Method Post -Body $json -ContentType 'application/json' -Headers $headers - - name: Remove Windows exe and installer to exclude from cache run: | Remove-Item .\chia-blockchain-gui\packages\gui\dist -Recurse -Force diff --git a/.github/workflows/check-commit-signing.yml b/.github/workflows/check-commit-signing.yml deleted file mode 100644 index 22baacff0862..000000000000 --- a/.github/workflows/check-commit-signing.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: ๐Ÿšจ Check commit signing - -on: - push: - branches: - - long_lived/** - - main - - release/** - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - check-commit-signing: - name: Check commit signing - runs-on: [ubuntu-latest] - timeout-minutes: 5 - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: chia-network/actions/check-commit-signing@main diff --git a/.github/workflows/check_wheel_availability.yaml b/.github/workflows/check_wheel_availability.yaml deleted file mode 100644 index bae74698905e..000000000000 --- a/.github/workflows/check_wheel_availability.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: ๐Ÿšจ Check Dependency Artifacts - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - check_dependency_artifacts: - name: ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python-version }} - runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} - strategy: - fail-fast: false - matrix: - os: - - name: Linux - matrix: linux - runs-on: - intel: ubuntu-latest - arm: [linux, arm64] - - name: macOS - matrix: macos - runs-on: - intel: macos-10.14 - arm: [macos, arm64] - - name: Windows - matrix: windows - runs-on: - intel: windows-latest - arch: - - name: ARM64 - matrix: arm - - name: Intel - matrix: intel - python-version: ['3.8', '3.9', '3.10', '3.11'] - exclude: - - os: - matrix: macos - arch: - matrix: arm - python-version: '3.8' - - os: - matrix: windows - arch: - matrix: arm - - steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - - - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python-version }} - force-pyenv: ${{ matrix.os.matrix == 'macos' && matrix.arch.matrix == 'intel' }} - - - name: Check Wheel Availability - run: python build_scripts/check_dependency_artifacts.py diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3463f6d7c22c..000000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,75 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: ๐Ÿšจ CodeQL - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '34 14 * * 3' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # โ„น๏ธ Command-line programs to run using the OS shell. - # ๐Ÿ“š https://git.io/JvXDl - - # โœ๏ธ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/conflict-check.yml b/.github/workflows/conflict-check.yml deleted file mode 100644 index 3782b764854a..000000000000 --- a/.github/workflows/conflict-check.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: ๐Ÿฉน Conflict Check -on: - # So that PRs touching the same files as the push are updated - push: - # So that the `dirtyLabel` is removed if conflicts are resolve - # We recommend `pull_request_target` so that github secrets are available. - # In `pull_request` we wouldn't be able to change labels of fork PRs - pull_request_target: - types: [opened, synchronize, reopened] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: check if prs are behind main - uses: Chia-Network/actions/label-conflict@main - with: - labelToAddOnConflict: "merge_conflict" - secretToken: "${{ secrets.GITHUB_TOKEN }}" - # targeting 2 minutes of retry, longest observed window thus far is ~30 seconds - retryIntervalSec: 5 - retryMax: 24 - commentToAddOnConflict: "This pull request has conflicts, please resolve those before we can evaluate the pull request." - commentToAddOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly." diff --git a/.github/workflows/daily-matrix.yml b/.github/workflows/daily-matrix.yml deleted file mode 100644 index 95571294a6c6..000000000000 --- a/.github/workflows/daily-matrix.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: ๐ŸŒ„ Daily Full Matrix Test - -on: - schedule: - - cron: '0 13 * * *' -jobs: - trigger_workflow_dispatch: - runs-on: ubuntu-latest - steps: - - name: Trigger Workflow Dispatch - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh workflow run test.yml --repo Chia-Network/chia-blockchain --ref main diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml deleted file mode 100644 index 166631b4933f..000000000000 --- a/.github/workflows/dependency-review.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Dependency Review Action -# -# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. -# -# Source repository: https://github.com/actions/dependency-review-action -# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: '๐Ÿšจ Dependency Review' -on: [pull_request] - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Repository' - uses: actions/checkout@v3 - - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index aa4b86fd6838..000000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: ๐Ÿšจ pre-commit - -on: - pull_request: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - pre-commit: - name: ${{ matrix.os.name }} ${{ matrix.arch.name }} - runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - os: - - name: Linux - matrix: linux - runs-on: - intel: ubuntu-latest - arm: [linux, arm64] - - name: macOS - matrix: macos - runs-on: - intel: macos-latest - arm: [macos, arm64] - - name: Windows - matrix: windows - runs-on: - intel: windows-latest - arch: - - name: ARM64 - matrix: arm - - name: Intel - matrix: intel - python: - - major_dot_minor: '3.9' - exclude: - - os: - matrix: windows - arch: - matrix: arm - - steps: - - name: Clean workspace - uses: Chia-Network/actions/clean-workspace@main - - - uses: Chia-Network/actions/git-mark-workspace-safe@main - - - name: disable git autocrlf - run: | - git config --global core.autocrlf false - - - uses: actions/checkout@v3 - - - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python.major_dot_minor }} - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.major_dot_minor }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - env: - CHIA_MANAGE_CLVM_CHECK_USE_CACHE: "false" - CHIA_MANAGE_MYPY_CHECK_EXCLUSIONS: "true" - run: pre-commit run --all-files --verbose diff --git a/.github/workflows/require-labels.yml b/.github/workflows/require-labels.yml deleted file mode 100644 index 10106b7a5cf3..000000000000 --- a/.github/workflows/require-labels.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: ๐Ÿšจ Check PR Labels -on: - pull_request: - types: [opened, labeled, unlabeled, synchronize] -jobs: - check-labels: - runs-on: ubuntu-latest - permissions: - checks: write - pull-requests: read - statuses: write - outputs: - status: ${{ steps.check-labels.outputs.status }} - steps: - - id: check-labels - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: "Added, Changed, Fixed" - exit_type: success - - run: echo SUCCESS - if: steps.check-labels.outputs.status == 'success' - - run: echo FAILURE && exit 1 - if: steps.check-labels.outputs.status == 'failure' diff --git a/.github/workflows/snyk-python-scan.yml b/.github/workflows/snyk-python-scan.yml deleted file mode 100644 index fcd750f317f1..000000000000 --- a/.github/workflows/snyk-python-scan.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: ๐Ÿšจ Snyk Python Scan -on: - push: - paths-ignore: - - '**.md' - branches: - - long_lived/** - - main - - release/** - tags: - - '**' - pull_request: - paths-ignore: - - '**.md' - branches: - - '**' - workflow_dispatch: - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true -permissions: - contents: read - -jobs: - snyk_python: - name: Scan the dependencies of Chia Blockchain - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.9] - - steps: - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SNYK_SECRET - if [ -n "$SNYK_TOKEN" ]; then HAS_SNYK_SECRET='true' ; fi - echo HAS_SNYK_SECRET=${HAS_SNYK_SECRET} >> $GITHUB_OUTPUT - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - - name: Checkout Code - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Chia Blockchain - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python-version }} - development: true - - - name: Activate Chia venv - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - uses: chia-network/actions/activate-venv@main - - - name: Generate requirements.txt file - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - run: | - pip freeze > requirements.txt - - - name: Run Snyk to check for vulnerabilities - if: steps.check_secrets.outputs.HAS_SNYK_SECRET - uses: snyk/actions/python@master - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - with: - command: monitor - args: --skip-unresolved diff --git a/.github/workflows/stale-issue.yml b/.github/workflows/stale-issue.yml deleted file mode 100644 index 76c816c4e901..000000000000 --- a/.github/workflows/stale-issue.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: 'Close stale issues' -on: - schedule: - - cron: '0 11 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: chia-network/stale@main - with: - operations-per-run: 10000 - ascending: true - days-before-issue-stale: 14 - days-before-issue-close: 7 - days-before-pr-stale: 45 - days-before-pr-close: -1 - exempt-all-pr-milestones: true - exempt-all-issue-milestones: true - exempt-all-assignees: true - stale-issue-label: stale-issue - stale-pr-label: stale-pr - remove-stale-when-updated: true - stale-issue-message: >- - This issue has not been updated in 14 days and is now flagged - as stale. If this issue is still affecting you and in need - of further review, please comment on it with an update to - keep it from auto closing in 7 days. - close-issue-message: >- - This issue was automatically closed because it has been - flagged as stale, and subsequently passed 7 days with no - further activity from the submitter or watchers. - stale-pr-message: >- - This PR has been flagged as stale due to no activity for over - 60 days. It will not be automatically closed, but it has been - given a stale-pr label and should be manually reviewed by the - relevant parties. diff --git a/.github/workflows/start-release.yml b/.github/workflows/start-release.yml deleted file mode 100644 index 6c58b6edcee6..000000000000 --- a/.github/workflows/start-release.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Starts a release for the given ref on the Glue API -name: Start Release -on: - workflow_dispatch: - release: - types: [published] - -jobs: - start_release: - name: Starts release process in Glue API - runs-on: [glue-notify] - steps: - - name: Get tag name - if: "!github.event.release.prerelease" - id: tag-name - run: | - echo "TAG_NAME=$(echo ${{ github.ref }} | cut -d'/' -f 3)" >> $GITHUB_OUTPUT - echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2)" >> $GITHUB_OUTPUT - - name: Start release - if: "!github.event.release.prerelease" - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/start diff --git a/.github/workflows/start-sync-test.yml b/.github/workflows/start-sync-test.yml deleted file mode 100644 index 147f9f99a867..000000000000 --- a/.github/workflows/start-sync-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Starts a sync test for every new release (pre-releases included) -name: Start Sync Test -on: - release: - types: [published] - -jobs: - start_release: - name: Starts Sync Test - runs-on: ubuntu-latest - steps: - - name: Get tag name - id: tag-name - run: | - echo "TAG_NAME=$(echo ${{ github.ref }} | cut -d'/' -f 3)" >> $GITHUB_OUTPUT - - name: Trigger Workflow - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"test_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/sync-test/${{ steps.tag-name.outputs.TAG_NAME }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"test_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/sync-test/${{ steps.tag-name.outputs.TAG_NAME }}/success/deploy diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index bfaea969352a..000000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,85 +0,0 @@ ---- -########################### -########################### -## Linter GitHub Actions ## -########################### -########################### -name: ๐Ÿšจ GitHub Super Linter - -# -# Documentation: -# https://github.com/github/super-linter -# https://help.github.com/en/articles/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - timeout-minutes: 60 - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v3 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v5 -# uses: docker://github/super-linter:v3.10.2 - env: - VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: main - LINTER_RULES_PATH: . - MARKDOWN_CONFIG_FILE: .markdown-lint.yml - VALIDATE_BASH: true - VALIDATE_CSS: true - VALIDATE_DOCKER: true - VALIDATE_GO: true - VALIDATE_HTML: true - VALIDATE_JAVASCRIPT_ES: true - VALIDATE_JSON: true - VALIDATE_MD: true - VALIDATE_POWERSHELL: true - VALIDATE_SHELL_SHFMT: true - VALIDATE_TYPESCRIPT_ES: true - VALIDATE_YAML: true - DISABLE_ERRORS: false - PYTHONPATH: ${{ github.workspace }}:$PYTHONPATH - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FILTER_REGEX_EXCLUDE: .*github/ISSUE_TEMPLATE/config.yml -# ACTIONS_RUNNER_DEBUG: true - -... diff --git a/.github/workflows/test-install-scripts.yml b/.github/workflows/test-install-scripts.yml deleted file mode 100644 index 46be8ef1b88a..000000000000 --- a/.github/workflows/test-install-scripts.yml +++ /dev/null @@ -1,195 +0,0 @@ -name: ๐Ÿ—๏ธ Test Install Scripts - -on: - push: - paths-ignore: - - '**.md' - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - paths-ignore: - - '**.md' - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - test_scripts: - name: Test Install Scripts - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.9] - os: [macOS-latest, ubuntu-latest] - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python-version }} - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python-version }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Run install-gui script - run: | - sh install-gui.sh - - test_scripts_in_docker: - name: Test Install Scripts ${{ matrix.distribution.name }} - runs-on: ${{ matrix.os }} - container: ${{ matrix.distribution.url }} - strategy: - fail-fast: false - max-parallel: 4 - matrix: - os: [ubuntu-latest] - distribution: - - name: amazonlinux:2 - type: amazon - url: "docker://amazonlinux:2" - - name: arch:latest - type: arch - url: "docker://archlinux:latest" - - name: centos:7 - type: centos - url: "docker://centos:7" -# commented out until we decide what to do with this, it fails consistently -# - name: centos:8 -# type: centos -# url: "docker://centos:8" - - name: debian:bullseye - type: debian - # https://packages.debian.org/bullseye/python/python3 (3.9) - url: "docker://debian:bullseye" - - name: debian:bookworm - type: debian - # https://packages.debian.org/bookworm/python/python3 (3.11) - url: "docker://debian:bookworm" - - name: fedora:34 - type: fedora - # (34, 3.9) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+34&start=0 - url: "docker://fedora:34" - - name: fedora:35 - type: fedora - # (35, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+35&start=0 - url: "docker://fedora:35" - - name: fedora:36 - type: fedora - # (36, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+36&start=0 - url: "docker://fedora:36" - - name: rockylinux:8 - type: rocky - url: "docker://rockylinux:8" - - name: ubuntu:focal (20.04) - type: ubuntu - # https://packages.ubuntu.com/focal/python3 (20.04, 3.8) - url: "docker://ubuntu:focal" - - name: ubuntu:jammy (22.04) - type: ubuntu - # https://packages.ubuntu.com/jammy/python3 (22.04, 3.10) - url: "docker://ubuntu:jammy" - - steps: - - name: Prepare Amazon Linux - if: ${{ matrix.distribution.type == 'amazon' }} - run: | - yum install --assumeyes git sudo - - - name: Prepare Arch - if: ${{ matrix.distribution.type == 'arch' }} - run: | - pacman --noconfirm -Syu - pacman --noconfirm -S base git sudo openssl-1.1 - # The behavior we follow in install.sh is unique with Arch in that - # we leave it to the user to install the appropriate version of python, - # so we need to install python here in order for the test to succeed. - pacman --noconfirm -U --needed https://archive.archlinux.org/packages/p/python/python-3.9.9-1-x86_64.pkg.tar.zst - - - name: Prepare CentOS - if: ${{ matrix.distribution.type == 'centos' }} - # Installing Git from yum brings git@1.x which doesn't work on actions/checkout. - # So install git@2.x from source - run: | - if [ "$(rpm --eval %{centos_ver})" = "8" ]; then - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*; - fi - yum update -y - yum install -y sudo gcc autoconf make wget curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel - wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz - tar zxf git-2.29.0.tar.gz - pushd git-2.29.0 - make configure - ./configure --prefix=/usr/local - make all - make install - popd - - - name: Prepare Debian - if: ${{ matrix.distribution.type == 'debian' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - apt-get --yes update - apt-get install --yes git lsb-release sudo - - - name: Prepare Fedora - if: ${{ matrix.distribution.type == 'fedora' }} - run: | - yum install --assumeyes git - - - name: Prepare Rocky - if: ${{ matrix.distribution.type == 'rocky' }} - run: | - yum install --assumeyes git sudo - - - name: Prepare Ubuntu - if: ${{ matrix.distribution.type == 'ubuntu' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - # for bionic - apt-get --yes update - apt-get install --yes software-properties-common - add-apt-repository --yes ppa:git-core/ppa - apt-get --yes update - apt-get install --yes git lsb-release sudo - - - name: Add safe git directory - run: git config --global --add safe.directory $GITHUB_WORKSPACE - - # after installing git so we use that copy - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python-version }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Run chia --help - run: | - chia --help diff --git a/.github/workflows/test-single.yml b/.github/workflows/test-single.yml deleted file mode 100644 index 90e085250b73..000000000000 --- a/.github/workflows/test-single.yml +++ /dev/null @@ -1,240 +0,0 @@ -name: test - -# This reusable workflow structure was chosen for the sole purpose of working around -# the 256 job per matrix limit. The initial total test job count was 290. This -# approach shifts the 256 limit to be per OS rather than overall. A simpler single -# regular workflow with matrixing against the OS would be preferred. - -on: - workflow_call: - inputs: - emoji: - required: true - type: string - matrix: - required: true - type: string - name: - required: true - type: string - file_name: - required: true - type: string - concurrency_name: - required: true - type: string - configuration: - required: true - type: string - matrix_mode: - required: true - type: string - runs-on: - required: true - type: string - - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ inputs.concurrency_name }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - test: - name: ${{ matrix.os.emoji }} ${{ matrix.configuration.name }} - ${{ matrix.python.name }} - runs-on: ${{ matrix.os.runs-on }} - timeout-minutes: ${{ matrix.configuration.job_timeout }} - strategy: - fail-fast: false - matrix: - configuration: ${{ fromJson(inputs.configuration) }} - os: - - emoji: ${{ inputs.emoji }} - matrix: ${{ inputs.matrix }} - name: ${{ inputs.name }} - file_name: ${{ inputs.file_name }} - runs-on: ${{ inputs.runs-on }} - python: - - name: '3.8' - file_name: '3.8' - action: '3.8' - apt: '3.8' - install_sh: '3.8' - matrix: '3.8' - exclude_from: - limited: True - main: True - - name: '3.9' - file_name: '3.9' - action: '3.9' - apt: '3.9' - install_sh: '3.9' - matrix: '3.9' - - name: '3.10' - file_name: '3.10' - action: '3.10' - apt: '3.10' - install_sh: '3.10' - matrix: '3.10' - exclude_from: - limited: True - main: True - - name: '3.11' - file_name: '3.11' - action: '3.11' - apt: '3.11' - install_sh: '3.11' - matrix: '3.11' - exclude_from: - limited: True - main: True - exclude: - - os: - matrix: macos - python: - matrix: '3.8' - - os: - matrix: windows - configuration: - install_timelord: true - - os: - matrix: windows - configuration: - name: core.full_node - - python: - exclude_from: - ${{ inputs.matrix_mode }}: True - - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - CHIA_SIMULATOR_ROOT: ${{ github.workspace }}/.chia/simulator - JOB_FILE_NAME: tests_${{ matrix.os.file_name }}_python-${{ matrix.python.file_name }}_${{ matrix.configuration.name }} - BLOCKS_AND_PLOTS_VERSION: 0.30.0 - - steps: - - name: Configure git - run: | - git config --global core.autocrlf false - - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set Env - uses: Chia-Network/actions/setjobenv@main - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Python environment - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python.action }} - - - name: Create keychain for CI use (macOS) - if: matrix.os.matrix == 'macos' - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Cache npm (Ubuntu) - if: matrix.os.matrix == 'ubuntu' - uses: actions/cache@v3 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: 1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - shell: bash - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - - name: Cache pip - uses: actions/cache@v3 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: 1 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache test blocks and plots - if: matrix.configuration.checkout_blocks_and_plots - uses: actions/cache@v3 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: 1 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: ${{ env.BLOCKS_AND_PLOTS_VERSION }} - - - - name: Checkout test blocks and plots - if: matrix.configuration.checkout_blocks_and_plots && steps.test-blocks-plots.outputs.cache-hit != 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release download -R Chia-Network/test-cache ${{ env.BLOCKS_AND_PLOTS_VERSION }} --archive=tar.gz -O - | tar xzf - - mkdir "${GITHUB_WORKSPACE}/.chia" - mv "${GITHUB_WORKSPACE}/test-cache-${{ env.BLOCKS_AND_PLOTS_VERSION }}/"* "${GITHUB_WORKSPACE}/.chia" - - - name: Install boost (macOS) - if: matrix.os.matrix == 'macos' - run: | - brew install boost - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.install_sh }} - development: true - legacy_keyring: ${{ matrix.configuration.legacy_keyring_required }} - - - uses: chia-network/actions/activate-venv@main - - - name: Install timelord - if: matrix.configuration.install_timelord - run: | - sh install-timelord.sh -n - ./vdf_bench square_asm 400000 - - - name: Test blockchain code with pytest - env: - ENABLE_PYTEST_MONITOR: ${{ matrix.os.matrix == 'ubuntu' && matrix.configuration.enable_pytest_monitor || '' }} - run: | - pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }} - - - name: Process coverage data - run: | - coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage-data - cp .coverage "coverage-data/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage-data/coverage.${{ env.JOB_FILE_NAME }}.xml" - coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage data - uses: actions/upload-artifact@v3 - with: - name: coverage-data - path: coverage-data/* - if-no-files-found: error - - - name: Check resource usage - if: matrix.os.matrix == 'ubuntu' && matrix.configuration.check_resource_usage - run: | - sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out - ./tests/check_pytest_monitor_output.py matrix.json - cat matrix.json - echo configuration=$(cat matrix.json) >> $GITHUB_OUTPUT - echo matrix_mode=${{ ( github.event_name == 'workflow_dispatch' ) && 'all' || ( github.repository_owner == 'Chia-Network' && github.repository != 'Chia-Network/chia-blockchain' ) && 'limited' || ( github.repository_owner == 'Chia-Network' && github.repository == 'Chia-Network/chia-blockchain' && github.ref == 'refs/heads/main' ) && 'main' || ( github.repository_owner == 'Chia-Network' && github.repository == 'Chia-Network/chia-blockchain' && startsWith(github.ref, 'refs/heads/release/') ) && 'all' || ( github.repository_owner == 'Chia-Network' && github.repository == 'Chia-Network/chia-blockchain' && startsWith(github.base_ref, 'release/') ) && 'all' || 'main' }} >> $GITHUB_OUTPUT - - outputs: - configuration: ${{ steps.configure.outputs.configuration }} - matrix_mode: ${{ steps.configure.outputs.matrix_mode }} - - macos: - uses: ./.github/workflows/test-single.yml - needs: configure - with: - emoji: ๐ŸŽ - matrix: macos - name: macOS - file_name: macos - concurrency_name: macos - configuration: ${{ needs.configure.outputs.configuration }} - matrix_mode: ${{ needs.configure.outputs.matrix_mode }} - runs-on: macos-latest - ubuntu: - uses: ./.github/workflows/test-single.yml - needs: configure - with: - emoji: ๐Ÿง - matrix: ubuntu - name: Ubuntu - file_name: ubuntu - concurrency_name: ubuntu - configuration: ${{ needs.configure.outputs.configuration }} - matrix_mode: ${{ needs.configure.outputs.matrix_mode }} - runs-on: ubuntu-latest - windows: - uses: ./.github/workflows/test-single.yml - needs: configure - with: - emoji: ๐ŸชŸ - matrix: windows - name: Windows - file_name: windows - concurrency_name: windows - configuration: ${{ needs.configure.outputs.configuration }} - matrix_mode: ${{ needs.configure.outputs.matrix_mode }} - runs-on: windows-latest - - coverage: - name: ${{ matrix.os.emoji }} Coverage - ${{ matrix.python.name }} - runs-on: ${{ matrix.os.runs-on }} - needs: - - macos - - ubuntu - - windows - strategy: - fail-fast: false - matrix: - os: - - emoji: ๐Ÿง - matrix: ubuntu - name: Ubuntu - runs-on: ubuntu-latest - python: - - name: '3.9' - action: '3.9' - apt: '3.9' - install_sh: '3.9' - matrix: '3.9' - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Download Coverage - uses: actions/download-artifact@v3 - with: - name: coverage-data - path: coverage-data - - - name: Set up ${{ matrix.python.name }} - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python.action }} - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.action }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Coverage Processing - run: | - coverage combine --rcfile=.coveragerc --data-file=coverage-reports/.coverage coverage-data/ - coverage xml --rcfile=.coveragerc --data-file=coverage-reports/.coverage -o coverage-reports/coverage.xml - coverage html --rcfile=.coveragerc --data-file=coverage-reports/.coverage --directory coverage-reports/html/ - - - uses: coverallsapp/github-action@v2 - if: always() - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - - - name: Coverage report (chia/) - if: always() - run: | - set -o pipefail - coverage report --rcfile=.coveragerc --data-file=coverage-reports/.coverage --include='chia/**/*' --show-missing | tee coverage-reports/coverage-chia-stdout - - - name: Coverage report (tests/) - if: always() - run: | - set -o pipefail - coverage report --rcfile=.coveragerc --data-file=coverage-reports/.coverage --include='tests/**/*' --show-missing | tee coverage-reports/coverage-tests-stdout - - - name: Coverage report (diff) - if: always() - env: - compare-branch: ${{ github.base_ref == '' && github.event.before || format('origin/{0}', github.base_ref) }} - run: | - set -o pipefail - diff-cover --compare-branch=${{ env.compare-branch }} --fail-under=100 --html-report=coverage-reports/diff-cover.html --markdown-report=coverage-reports/diff-cover.md coverage-reports/coverage.xml | tee coverage-reports/diff-cover-stdout - - - name: Add diff coverage report to workflow summary - if: always() - run: | - cat coverage-reports/diff-cover.md >> $GITHUB_STEP_SUMMARY - - - name: Publish coverage reports - if: always() - uses: actions/upload-artifact@v3 - with: - name: coverage-reports - path: coverage-reports/* - if-no-files-found: error diff --git a/.github/workflows/trigger-docker-dev.yml b/.github/workflows/trigger-docker-dev.yml deleted file mode 100644 index 88c08749343e..000000000000 --- a/.github/workflows/trigger-docker-dev.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: ๐Ÿ“ฆ๐Ÿš€ Trigger Dev Docker Build - -on: - push: - paths-ignore: - - '**.md' - branches: - - 'long_lived/**' - - 'release/**' - pull_request: - paths-ignore: - - '**.md' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - trigger: - name: Trigger building a new dev tag for the chia-docker image - runs-on: ubuntu-latest - steps: - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - - if [ -n "$GLUE_ACCESS_TOKEN" ]; then HAS_SECRET='true' ; fi - echo HAS_SECRET=${HAS_SECRET} >> $GITHUB_OUTPUT - env: - GLUE_ACCESS_TOKEN: "${{ secrets.GLUE_ACCESS_TOKEN }}" - - - name: Trigger docker dev workflow via github-glue - if: steps.check_secrets.outputs.HAS_SECRET - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"sha":"${{ github.sha }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-dev/${{ github.sha }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"sha":"${{ github.sha }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-dev/${{ github.sha }}/success/build-dev diff --git a/.github/workflows/trigger-docker-main.yml b/.github/workflows/trigger-docker-main.yml deleted file mode 100644 index 432a2129fbaa..000000000000 --- a/.github/workflows/trigger-docker-main.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: ๐Ÿ“ฆ๐Ÿš€ Trigger Main Docker Build - -on: - push: - paths-ignore: - - '**.md' - branches: - - main - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - trigger: - name: Trigger building a new `main` tag for the chia-docker image - runs-on: ubuntu-latest - steps: - - name: Trigger docker main workflow via github-glue - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-main/${{ github.sha }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-main/${{ github.sha }}/success/build-main diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml deleted file mode 100644 index 15273cb00aca..000000000000 --- a/.github/workflows/upload-pypi-source.yml +++ /dev/null @@ -1,216 +0,0 @@ -name: ๐Ÿšจ๐Ÿš€ Lint and upload source distribution - -on: - push: - paths-ignore: - - '**.md' - branches: - - 'long_lived/**' - - main - - 'release/**' - release: - types: [published] - pull_request: - paths-ignore: - - '**.md' - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - mypy: - name: ${{ matrix.os.emoji }} ${{ matrix.check.name }} - ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major_dot_minor }} - runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} - timeout-minutes: 10 - strategy: - fail-fast: false - matrix: - os: - - name: Linux - matrix: linux - emoji: ๐Ÿง - runs-on: - intel: ubuntu-latest - arm: [linux, arm64] - - name: macOS - matrix: macos - emoji: ๐ŸŽ - runs-on: - intel: macos-latest - arm: [macos, arm64] - - name: Windows - matrix: windows - emoji: ๐ŸชŸ - runs-on: - intel: windows-latest - arch: - - name: ARM64 - matrix: arm - - name: Intel - matrix: intel - python: - - major_dot_minor: '3.8' - - major_dot_minor: '3.9' - - major_dot_minor: '3.10' - - major_dot_minor: '3.11' - check: - - name: mypy - command: | - echo "MYPY VERSION IS: $(mypy --version)" - python manage-mypy.py build-mypy-ini - mypy - exclude: - - os: - matrix: macos - arch: - matrix: arm - python: - major_dot_minor: '3.8' - - os: - matrix: windows - arch: - matrix: arm - - steps: - - uses: chia-network/actions/clean-workspace@main - - - name: Add safe git directory - uses: chia-network/actions/git-mark-workspace-safe@main - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: chia-network/actions/setup-python@main - with: - python-version: ${{ matrix.python.major_dot_minor }} - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.major_dot_minor }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Check with ${{ matrix.check.name }} - run: | - ${{ matrix.check.command }} - - check: - name: ${{ matrix.os.emoji }} ${{ matrix.check.name }} - ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python.major_dot_minor }} - runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} - timeout-minutes: 10 - strategy: - fail-fast: false - matrix: - os: - - name: Linux - matrix: linux - emoji: ๐Ÿง - runs-on: - intel: ubuntu-latest - arm: [linux, arm64] - arch: - - name: Intel - matrix: intel - python: - - major_dot_minor: '3.8' - check: - - name: black - command: black --check --diff . - - name: flake8 - command: flake8 benchmarks build_scripts chia tests tools *.py - - name: pylint - command: pylint benchmarks build_scripts chia tests tools *.py - - name: generated protocol tests - command: | - python3 -m tests.util.build_network_protocol_files - git diff --exit-code - - steps: - - uses: chia-network/actions/clean-workspace@main - - - name: Add safe git directory - uses: chia-network/actions/git-mark-workspace-safe@main - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: chia-network/actions/setup-python@main - with: - python-version: ${{ matrix.python.major_dot_minor }} - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.major_dot_minor }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Check with ${{ matrix.check.name }} - run: | - ${{ matrix.check.command }} - - upload_source_dist: - name: Lint and Upload source distribution - runs-on: [ubuntu-latest] - timeout-minutes: 30 - needs: - - mypy - - check - steps: - - name: Add safe git directory - uses: chia-network/actions/git-mark-workspace-safe@main - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: Chia-Network/actions/setup-python@main - name: Install Python - with: - python-version: '3.8' - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo HAS_SECRET=${HAS_SECRET} >> $GITHUB_OUTPUT - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - uses: ./.github/actions/install - with: - python-version: ${{ matrix.python.major_dot_minor }} - development: true - - - uses: chia-network/actions/activate-venv@main - - - name: Build source distribution - run: | - python -m build --sdist --outdir dist . - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: ./dist - - - name: Publish distribution to PyPI - if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags') - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' diff --git a/build_scripts/installer-version.py b/build_scripts/installer-version.py index cdd09e072887..032e1137ff2a 100644 --- a/build_scripts/installer-version.py +++ b/build_scripts/installer-version.py @@ -5,6 +5,10 @@ # example: 1.0b5.dev225 def main() -> None: + + print("2.0.0rc1+og-1.4.0") + return + scm_full_version = get_version(root="..", relative_to=__file__) # scm_full_version = "1.0.5.dev22" diff --git a/chia/farmer/farmer.py b/chia/farmer/farmer.py index 16cfa989e2bc..c1d28c458c03 100644 --- a/chia/farmer/farmer.py +++ b/chia/farmer/farmer.py @@ -6,6 +6,7 @@ import time import traceback from math import floor +from asyncio import sleep from pathlib import Path from typing import Any, Dict, List, Optional, Set, Tuple, Union @@ -13,6 +14,9 @@ from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey from chia.consensus.constants import ConsensusConstants +from chia.consensus.pot_iterations import calculate_sp_interval_iters +from chia.farmer.pooling.og_pool_state import OgPoolState +from chia.farmer.pooling.pool_api_client import PoolApiClient from chia.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain from chia.plot_sync.delta import Delta from chia.plot_sync.receiver import Receiver @@ -37,7 +41,7 @@ from chia.ssl.create_ssl import get_mozilla_ca_crt from chia.types.blockchain_format.proof_of_space import ProofOfSpace from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash +from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash from chia.util.byte_types import hexstr_to_bytes from chia.util.config import config_path_for_filename, load_config, lock_and_load_config, save_config from chia.util.errors import KeychainProxyConnectionFailure @@ -100,6 +104,8 @@ def increment_pool_stats( return +DEFAULT_OG_POOL_URL: str = "https://farmer.chia-og.foxypool.io" + """ HARVESTER PROTOCOL (FARMER <-> HARVESTER) """ @@ -164,6 +170,21 @@ def __init__( # Use to find missing signage points. (new_signage_point, time) self.prev_signage_point: Optional[Tuple[uint64, farmer_protocol.NewSignagePoint]] = None + # OG Pooling properties + self.pool_url = None + self.pool_payout_address = None + self.is_og_pooling_disabled = False + self.pool_sub_slot_iters = None + self.iters_limit = None + self.pool_minimum_difficulty = None + self.og_pool_state = None + self.pool_var_diff_target_in_seconds = None + self.pool_reward_target = None + self.adjust_pool_difficulty_task: Optional[asyncio.Task] = None + self.check_pool_reward_target_task: Optional[asyncio.Task] = None + self.update_og_pool_info_task: Optional[asyncio.Task] = None + self.pool_api_client = None + def get_connections(self, request_node_type: Optional[NodeType]) -> List[Dict[str, Any]]: return default_get_connections(server=self.server, request_node_type=request_node_type) @@ -222,8 +243,21 @@ async def setup_keys(self) -> bool: log.warning(no_keys_error_str) return False + # OG Pooling setup + self.pool_url = self.config.get("pool_url", DEFAULT_OG_POOL_URL) + self.pool_payout_address = self.config.get("pool_payout_address", self.farmer_target_encoded) + self.is_og_pooling_disabled = self.config.get("disable_og_pooling", False) + self.iters_limit = calculate_sp_interval_iters(self.constants, self.constants.POOL_SUB_SLOT_ITERS) + self.pool_minimum_difficulty: uint64 = uint64(1) + self.og_pool_state: OgPoolState = OgPoolState(difficulty=self.pool_minimum_difficulty) + self.pool_var_diff_target_in_seconds = 5 * 60 + self.pool_reward_target = self.pool_target + return True + def is_pooling_enabled(self): + return self.pool_url is not None and self.pool_payout_address is not None and not self.is_og_pooling_disabled + async def _start(self) -> None: async def start_task() -> None: # `Farmer.setup_keys` returns `False` if there are no keys setup yet. In this case we just try until it @@ -232,6 +266,22 @@ async def start_task() -> None: if await self.setup_keys(): self.update_pool_state_task = asyncio.create_task(self._periodically_update_pool_state_task()) self.cache_clear_task = asyncio.create_task(self._periodically_clear_cache_and_refresh_task()) + if not self.is_pooling_enabled(): + self.log.info(f"Not OG pooling as 'disable_og_pooling' is set to true in your config") + log.debug("start_task: initialized") + self.started = True + return + self.pool_api_client = PoolApiClient(self.pool_url) + await self.initialize_pooling() + self.adjust_pool_difficulty_task = asyncio.create_task( + self._periodically_adjust_pool_difficulty_task() + ) + self.check_pool_reward_target_task = asyncio.create_task( + self._periodically_check_pool_reward_target_task() + ) + self.update_og_pool_info_task = asyncio.create_task( + self._periodically_update_og_pool_info_task() + ) log.debug("start_task: initialized") self.started = True return @@ -239,6 +289,54 @@ async def start_task() -> None: asyncio.create_task(start_task()) + async def initialize_pooling(self): + self.log.debug(f"Connecting to OG pool {self.pool_url} ..") + is_connected_to_og_pool = False + while not is_connected_to_og_pool: + try: + pool_info = await self.pool_api_client.get_pool_info() + self._update_local_pool_info(pool_info) + pool_name = pool_info["name"] + self.log.info(f"Connected to OG pool {pool_name} ({self.pool_url}) using payout address {self.pool_payout_address}") + is_connected_to_og_pool = True + except asyncio.TimeoutError: + self.log.error(f"Timed out while retrieving OG pool info") + await sleep(5) + except Exception as e: + tb = traceback.format_exc() + self.log.error(f"Error connecting to the OG pool: {e} {tb}") + await sleep(5) + + self.og_pool_state.difficulty = self.pool_minimum_difficulty + + async def _update_og_pool_info(self): + pool_info: Dict + try: + pool_info = await self.pool_api_client.get_pool_info() + except asyncio.TimeoutError: + self.log.error(f"Timed out while retrieving OG pool info") + return + except Exception as e: + self.log.error(f"Error retrieving OG pool info: {e}") + return + + self._update_local_pool_info(pool_info) + self.log.info(f"Updated the OG pool_info successfully") + + def _update_local_pool_info(self, pool_info: Dict): + assert pool_info.get("var_diff_target_in_seconds") is not None + self.pool_var_diff_target_in_seconds = pool_info["var_diff_target_in_seconds"] + assert pool_info.get("minimum_difficulty") is not None + self.pool_minimum_difficulty = uint64(pool_info["minimum_difficulty"]) + assert pool_info.get("target_puzzle_hash") is not None + pool_target = bytes32.fromhex(pool_info["target_puzzle_hash"][2:]) + assert len(pool_target) == 32 + self.pool_reward_target = pool_target + address_prefix = self.config["network_overrides"]["config"][self.config["selected_network"]]["address_prefix"] + pool_target_encoded = encode_puzzle_hash(pool_target, address_prefix) + if self.pool_target != pool_target or self.pool_target_encoded != pool_target_encoded: + self.set_reward_targets(farmer_target_encoded=None, pool_target_encoded=pool_target_encoded) + def _close(self) -> None: self._shut_down = True @@ -247,6 +345,12 @@ async def _await_closed(self, shutting_down: bool = True) -> None: await self.cache_clear_task if self.update_pool_state_task is not None: await self.update_pool_state_task + if self.adjust_pool_difficulty_task is not None: + await self.adjust_pool_difficulty_task + if self.check_pool_reward_target_task is not None: + await self.check_pool_reward_target_task + if self.update_og_pool_info_task is not None: + await self.update_og_pool_info_task if shutting_down and self.keychain_proxy is not None: proxy = self.keychain_proxy self.keychain_proxy = None @@ -670,6 +774,7 @@ def set_reward_targets(self, farmer_target_encoded: Optional[str], pool_target_e self.farmer_target_encoded = farmer_target_encoded self.farmer_target = decode_puzzle_hash(farmer_target_encoded) config["farmer"]["xch_target_address"] = farmer_target_encoded + self.pool_payout_address = self.config.get("pool_payout_address", self.farmer_target_encoded) if pool_target_encoded is not None: self.pool_target_encoded = pool_target_encoded self.pool_target = decode_puzzle_hash(pool_target_encoded) @@ -826,3 +931,61 @@ async def _periodically_clear_cache_and_refresh_task(self) -> None: log.error(f"_periodically_clear_cache_and_refresh_task failed: {traceback.format_exc()}") await asyncio.sleep(1) + + async def _periodically_adjust_pool_difficulty_task(self): + time_slept = 0 + while not self._shut_down: + # Sleep in 1 sec intervals to quickly exit outer loop, but effectively sleep 60 sec between actual code runs + await sleep(1) + time_slept += 1 + if time_slept < 60: + continue + time_slept = 0 + if (time.time() - self.og_pool_state.last_partial_submit_timestamp) < self.pool_var_diff_target_in_seconds: + continue + diff_since_last_partial_submit_in_seconds = time.time() - self.og_pool_state.last_partial_submit_timestamp + missing_partial_submits = int( + diff_since_last_partial_submit_in_seconds // self.pool_var_diff_target_in_seconds) + new_difficulty = uint64(max( + (self.og_pool_state.difficulty - (missing_partial_submits * 2)), + self.pool_minimum_difficulty + )) + if new_difficulty == self.og_pool_state.difficulty: + continue + old_difficulty = self.og_pool_state.difficulty + self.og_pool_state.difficulty = new_difficulty + log.info( + f"Lowered the OG pool difficulty from {old_difficulty} to " + f"{new_difficulty} due to no partial submits within the last " + f"{int(round(diff_since_last_partial_submit_in_seconds))} seconds" + ) + + async def _periodically_check_pool_reward_target_task(self): + time_slept = 0 + while not self._shut_down: + # Sleep in 1 sec intervals to quickly exit outer loop, but effectively sleep 5 min between actual code runs + await sleep(1) + time_slept += 1 + if time_slept < 5 * 60: + continue + time_slept = 0 + if self.pool_target == self.pool_reward_target: + continue + address_prefix = self.config["network_overrides"]["config"][self.config["selected_network"]]["address_prefix"] + pool_target_encoded = encode_puzzle_hash(self.pool_reward_target, address_prefix) + self.set_reward_targets(farmer_target_encoded=None, pool_target_encoded=pool_target_encoded) + + async def _periodically_update_og_pool_info_task(self): + time_slept = 0 + while not self._shut_down: + # Sleep in 1 sec intervals to quickly exit outer loop, but effectively sleep 1h between actual code runs + await sleep(1) + time_slept += 1 + if time_slept < 60 * 60: + continue + time_slept = 0 + try: + await self._update_og_pool_info() + except Exception as e: + tb = traceback.format_exc() + self.log.error(f"Exception in update_og_pool_info, {e} {tb}") diff --git a/chia/farmer/farmer_api.py b/chia/farmer/farmer_api.py index 33d8e19ecffb..2ebb6a7bc87e 100644 --- a/chia/farmer/farmer_api.py +++ b/chia/farmer/farmer_api.py @@ -1,16 +1,18 @@ from __future__ import annotations +import asyncio import json import logging import time from typing import Any, Dict, List, Optional import aiohttp -from blspy import AugSchemeMPL, G2Element, PrivateKey +from blspy import AugSchemeMPL, G2Element, G1Element, PrivateKey from chia import __version__ from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters from chia.farmer.farmer import Farmer, increment_pool_stats, strip_old_entries +from chia.farmer.pooling.og_pool_protocol import PartialPayload, SubmitPartial from chia.harvester.harvester_api import HarvesterAPI from chia.protocols import farmer_protocol, harvester_protocol from chia.protocols.harvester_protocol import ( @@ -410,6 +412,17 @@ async def new_proof_of_space( return + pool_public_key = new_proof_of_space.proof.pool_public_key + if pool_public_key is not None and self.farmer.is_pooling_enabled(): + await self.process_new_proof_of_space_for_og_pool( + new_proof_of_space, + peer, + pool_public_key, + computed_quality_string + ) + + return + @api_request() async def respond_signatures(self, response: harvester_protocol.RespondSignatures) -> None: """ @@ -589,10 +602,16 @@ async def new_signage_point(self, new_signage_point: farmer_protocol.NewSignageP p2_singleton_puzzle_hash, ) ) + difficulty = new_signage_point.difficulty + sub_slot_iters = new_signage_point.sub_slot_iters + if self.farmer.is_pooling_enabled(): + sub_slot_iters = self.farmer.constants.POOL_SUB_SLOT_ITERS + difficulty = self.farmer.og_pool_state.difficulty + message = harvester_protocol.NewSignagePointHarvester( new_signage_point.challenge_hash, - new_signage_point.difficulty, - new_signage_point.sub_slot_iters, + difficulty, + sub_slot_iters, new_signage_point.signage_point_index, new_signage_point.challenge_chain_sp, pool_difficulties, @@ -700,3 +719,95 @@ async def plot_sync_duplicates(self, message: PlotSyncPathList, peer: WSChiaConn @api_request(peer_required=True) async def plot_sync_done(self, message: PlotSyncDone, peer: WSChiaConnection) -> None: await self.farmer.plot_sync_receivers[peer.peer_node_id].sync_done(message) + + async def process_new_proof_of_space_for_og_pool( + self, + new_proof_of_space: harvester_protocol.NewProofOfSpace, + peer: WSChiaConnection, + pool_public_key: G1Element, + computed_quality_string: bytes32 + ): + og_pool_state = self.farmer.og_pool_state + + # Otherwise, send the proof of space to the pool + # When we win a block, we also send the partial to the pool + required_iters = calculate_iterations_quality( + self.farmer.constants.DIFFICULTY_CONSTANT_FACTOR, + computed_quality_string, + new_proof_of_space.proof.size, + og_pool_state.difficulty, + new_proof_of_space.sp_hash, + ) + if required_iters >= self.farmer.iters_limit: + self.farmer.log.debug( + f"Proof of space not good enough for OG pool difficulty of {og_pool_state.difficulty}" + ) + return + + # Submit partial to pool + is_eos = new_proof_of_space.signage_point_index == 0 + payload = PartialPayload( + new_proof_of_space.proof, + new_proof_of_space.sp_hash, + is_eos, + self.farmer.pool_payout_address, + peer.peer_node_id, + ) + + # The plot key is 2/2 so we need the harvester's half of the signature + m_to_sign = payload.get_hash() + request = harvester_protocol.RequestSignatures( + new_proof_of_space.plot_identifier, + new_proof_of_space.challenge_hash, + new_proof_of_space.sp_hash, + [m_to_sign], + ) + response: Any = await peer.call_api(HarvesterAPI.request_signatures, request) + if not isinstance(response, harvester_protocol.RespondSignatures): + self.farmer.log.error(f"Invalid response from harvester: {response}") + return + + assert len(response.message_signatures) == 1 + + plot_signature: Optional[G2Element] = None + for sk in self.farmer.get_private_keys(): + pk = sk.get_g1() + if pk == response.farmer_pk: + agg_pk = generate_plot_public_key(response.local_pk, pk) + assert agg_pk == new_proof_of_space.proof.plot_public_key + sig_farmer = AugSchemeMPL.sign(sk, m_to_sign, agg_pk) + plot_signature = AugSchemeMPL.aggregate([sig_farmer, response.message_signatures[0][1]]) + assert AugSchemeMPL.verify(agg_pk, m_to_sign, plot_signature) + pool_sk = self.farmer.pool_sks_map[bytes(pool_public_key)] + authentication_signature = AugSchemeMPL.sign(pool_sk, m_to_sign) + + assert plot_signature is not None + agg_sig: G2Element = AugSchemeMPL.aggregate([plot_signature, authentication_signature]) + + submit_partial = SubmitPartial(payload, agg_sig, og_pool_state.difficulty) + self.farmer.log.debug("Submitting partial to OG pool ..") + og_pool_state.last_partial_submit_timestamp = time.time() + submit_partial_response: Dict + try: + submit_partial_response = await self.farmer.pool_api_client.submit_partial(submit_partial) + except asyncio.TimeoutError: + self.farmer.log.error(f"Timed out while submitting partial to OG pool") + return + except Exception as e: + self.farmer.log.error(f"Error submitting partial to OG pool: {e}") + return + self.farmer.log.debug(f"OG pool response: {submit_partial_response}") + if "error_code" in submit_partial_response: + if submit_partial_response["error_code"] == 5: + self.farmer.log.info( + "Local OG pool difficulty too low, adjusting to OG pool difficulty " + f"({submit_partial_response['current_difficulty']})" + ) + og_pool_state.difficulty = uint64(submit_partial_response["current_difficulty"]) + else: + self.farmer.log.error( + f"Error in OG pooling: {submit_partial_response['error_code'], submit_partial_response['error_message']}" + ) + else: + self.farmer.log.info("The partial submitted to the OG pool was accepted") + og_pool_state.difficulty = uint64(submit_partial_response["current_difficulty"]) diff --git a/chia/farmer/pooling/__init__.py b/chia/farmer/pooling/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/chia/farmer/pooling/og_pool_protocol.py b/chia/farmer/pooling/og_pool_protocol.py new file mode 100644 index 000000000000..5f6f4c1b175f --- /dev/null +++ b/chia/farmer/pooling/og_pool_protocol.py @@ -0,0 +1,25 @@ +from dataclasses import dataclass + +from blspy import G2Element +from chia.types.blockchain_format.proof_of_space import ProofOfSpace +from chia.types.blockchain_format.sized_bytes import bytes32 +from chia.util.ints import uint64 +from chia.util.streamable import streamable, Streamable + + +@streamable +@dataclass(frozen=True) +class PartialPayload(Streamable): + proof_of_space: ProofOfSpace + sp_hash: bytes32 + end_of_sub_slot: bool + payout_address: str # The farmer can choose where to send the rewards. This can take a few minutes + harvester_id: bytes32 + + +@streamable +@dataclass(frozen=True) +class SubmitPartial(Streamable): + payload: PartialPayload + partial_aggregate_signature: G2Element # Sig of partial by plot key and pool key + difficulty: uint64 diff --git a/chia/farmer/pooling/og_pool_state.py b/chia/farmer/pooling/og_pool_state.py new file mode 100644 index 000000000000..78ca31701bc6 --- /dev/null +++ b/chia/farmer/pooling/og_pool_state.py @@ -0,0 +1,12 @@ +import time + +from chia.util.ints import uint64 + + +class OgPoolState: + difficulty: uint64 + last_partial_submit_timestamp: float + + def __init__(self, difficulty: uint64 = 1, last_partial_submit_timestamp: float = time.time()): + self.difficulty = difficulty + self.last_partial_submit_timestamp = last_partial_submit_timestamp diff --git a/chia/farmer/pooling/pool_api_client.py b/chia/farmer/pooling/pool_api_client.py new file mode 100644 index 000000000000..8a2561854672 --- /dev/null +++ b/chia/farmer/pooling/pool_api_client.py @@ -0,0 +1,31 @@ +from aiohttp import ClientSession, ClientTimeout + +from chia import __version__ +from chia.farmer.pooling.og_pool_protocol import SubmitPartial +from chia.server.server import ssl_context_for_root +from chia.ssl.create_ssl import get_mozilla_ca_crt + +timeout = ClientTimeout(total=30) + + +class PoolApiClient: + base_url: str + + def __init__(self, base_url: str) -> None: + self.base_url = base_url + self.ssl_context = ssl_context_for_root(get_mozilla_ca_crt()) + + async def get_pool_info(self): + async with ClientSession(timeout=timeout) as client: + async with client.get(f"{self.base_url}/pool_info", ssl=self.ssl_context) as res: + return await res.json() + + async def submit_partial(self, submit_partial: SubmitPartial): + async with ClientSession(timeout=timeout) as client: + async with client.post( + f"{self.base_url}/partial", + json=submit_partial.to_json_dict(), + ssl=self.ssl_context, + headers={"User-Agent": f"Chia Blockchain/{__version__}"}, + ) as res: + return await res.json() diff --git a/pyproject.toml b/pyproject.toml index 92a8988d0b4d..1c8e9d3efa59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=4.1.2"] -build-backend = "setuptools.build_meta" - -[tool.setuptools_scm] -fallback_version = "unknown-no-.git-directory" -local_scheme = "no-local-version" +requires = ["setuptools>=42", "wheel"] [tool.black] line-length = 120 diff --git a/setup.py b/setup.py index 67a723a2119e..b7b63bf27024 100644 --- a/setup.py +++ b/setup.py @@ -117,6 +117,7 @@ "chia.ssl": ["chia_ca.crt", "chia_ca.key", "dst_root_ca.pem"], "mozilla-ca": ["cacert.pem"], }, + version="2.0.0rc1+og-1.4.0", long_description=open("README.md").read(), long_description_content_type="text/markdown", zip_safe=False,