Skip to content

Commit

Permalink
Merge branch 'main' into clvm_mypie
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed May 13, 2024
2 parents e265924 + 250a6ab commit 037d882
Show file tree
Hide file tree
Showing 115 changed files with 4,682 additions and 2,077 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/build-linux-installer-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,32 +202,32 @@ jobs:
publish:
name: Publish ${{ matrix.os.arch }}
runs-on: ${{ matrix.os.runs-on }}
runs-on: ubuntu-latest
needs:
- build
container: chianetwork/ubuntu-20.04-builder:latest
timeout-minutes: ${{ matrix.os.timeout }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os:
- runs-on: ubuntu-latest
arch: amd64
- arch: amd64
glue-name: "build-amd64-deb"
timeout: 5
- runs-on: [Linux, ARM64]
arch: arm64
- arch: arm64
glue-name: "build-arm64-deb"
# TOOD: some self hosted runners are exhibiting slow artifact downloads sometimes
timeout: 20
timeout: 5

env:
CHIA_INSTALLER_VERSION: ${{ needs.build.outputs.chia-installer-version }}

steps:
- uses: Chia-Network/actions/clean-workspace@main

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

- uses: chia-network/actions/create-venv@main
id: create-venv

Expand Down Expand Up @@ -289,7 +289,6 @@ jobs:
aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_${{ matrix.os.arch }}.deb" "s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_${{ matrix.os.arch }}.deb"
- name: Create Checksums
if: env.FULL_RELEASE == 'true' || github.ref == 'refs/heads/main'
run: |
ls "$GITHUB_WORKSPACE"/build_scripts/final_installer/
sha256sum "$GITHUB_WORKSPACE"/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_${{ matrix.os.arch }}.deb > "$GITHUB_WORKSPACE"/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_${{ matrix.os.arch }}.deb.sha256
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-linux-installer-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
container:
image: chianetwork/rocky8-builder:latest
timeout-minutes: 5
strategy:
fail-fast: false
Expand All @@ -221,6 +219,10 @@ jobs:
steps:
- uses: Chia-Network/actions/clean-workspace@main

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

- uses: chia-network/actions/create-venv@main
id: create-venv

Expand Down Expand Up @@ -283,7 +285,6 @@ jobs:
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'
run: |
ls "$GITHUB_WORKSPACE"/build_scripts/final_installer/
sha256sum "$GITHUB_WORKSPACE"/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm > "$GITHUB_WORKSPACE"/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256
Expand Down
41 changes: 17 additions & 24 deletions .github/workflows/build-macos-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,19 @@ jobs:

publish:
name: Publish ${{ matrix.os.name }} DMG
runs-on: ${{ matrix.os.runs-on }}
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 10
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os:
- runs-on: macos-11
name: intel
- name: intel
file-suffix: ""
glue-name: "build-macos"
- runs-on: [MacOS, ARM64]
name: m1
- name: m1
file-suffix: "-arm64"
glue-name: "build-mac-m1"

Expand Down Expand Up @@ -318,19 +316,10 @@ jobs:
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
GLUE_API_URL: "${{ secrets.GLUE_API_URL }}"

- 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
- name: Create Checksums
run: |
ls
shasum -a 256 ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg > ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256
shasum -a 256 ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg > ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256
- name: Configure AWS credentials
if: steps.check_secrets.outputs.HAS_AWS_SECRET
Expand All @@ -345,29 +334,29 @@ jobs:
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-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/dev/Chia-${CHIA_DEV_BUILD}${{ matrix.os.file-suffix }}.dmg
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.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-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg
ls ${{ github.workspace }}/build_scripts/final_installer/
gh release upload --repo ${{ github.repository }} $RELEASE_TAG ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent
gh release upload --repo ${{ github.repository }} $RELEASE_TAG ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.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'
run: |
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.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-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 s3://download.chia.net/latest-dev/Chia${{ matrix.os.file-suffix }}_latest_dev.dmg.sha256
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.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-${{ env.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'
run: |
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/install/
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 s3://download.chia.net/install/
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent s3://download.chia.net/torrents/
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg s3://download.chia.net/install/
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.sha256 s3://download.chia.net/install/
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-${{ env.CHIA_INSTALLER_VERSION }}${{ matrix.os.file-suffix }}.dmg.torrent s3://download.chia.net/torrents/
- name: Upload release artifacts
if: env.RELEASE == 'true'
Expand Down Expand Up @@ -414,6 +403,10 @@ jobs:
matrix: 13
runs-on:
intel: macos-13
- name: 14
matrix: 14
runs-on:
arm: macos-14
arch:
- name: ARM64
matrix: arm
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/build-windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,7 @@ jobs:
publish:
name: Publish EXE
runs-on: [windows-2019]
defaults:
run:
shell: bash
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 5
Expand Down Expand Up @@ -326,12 +323,6 @@ jobs:
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
GLUE_API_URL: "${{ secrets.GLUE_API_URL }}"

- name: Install AWS CLI
if: steps.check_secrets.outputs.HAS_AWS_SECRET
shell: pwsh
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@v4
Expand All @@ -350,10 +341,10 @@ jobs:
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
shell: pwsh
run: |
certutil.exe -hashfile ${{ github.workspace }}/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe SHA256 > ${{ github.workspace }}/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.sha256
ls ${{ github.workspace }}/chia-blockchain-gui/release-builds/windows-installer/
ls "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/
sha256sum "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe > "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.sha256
ls "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/
- name: Create torrent
if: env.FULL_RELEASE == 'true'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-install-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
python:
- major-dot-minor: "3.10"
os:
- runs-on: macos-latest
matrix: macos-arm
- runs-on: macos-12
matrix: macos
matrix: macos-intel
- runs-on: ubuntu-latest
matrix: linux
- runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions .repo-content-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var_overrides:
DEPENDABOT_ACTIONS_REVIEWERS: '["cmmarslender", "altendky"]'
4 changes: 4 additions & 0 deletions build_scripts/check_dependency_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
import sys
import tempfile

# TODO: publish wheels for these
excepted_packages = {
"dnslib", # pure python
"chialisp_loader",
"chialisp_puzzles",
"chia_base",
}


Expand Down
12 changes: 6 additions & 6 deletions build_scripts/npm_linux/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions build_scripts/npm_macos/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions build_scripts/npm_windows/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 35 additions & 1 deletion chia/_tests/clvm/test_curry_and_treehash.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
from __future__ import annotations

from typing import List

import pytest

from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle # import (puzzle_for_pk, puzzle_hash_for_pk, MOD)
from chia.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash
from chia.wallet.util.curry_and_treehash import (
calculate_hash_of_quoted_mod_hash,
curry_and_treehash,
shatree_atom,
shatree_atom_list,
shatree_int,
)


def test_curry_and_treehash() -> None:
Expand All @@ -21,3 +32,26 @@ def test_curry_and_treehash() -> None:
hashed_args = [Program.to(_).get_tree_hash() for _ in args]
puzzle_hash_via_f = curry_and_treehash(quoted_mod_hash, *hashed_args)
assert puzzle_hash_via_curry == puzzle_hash_via_f


@pytest.mark.parametrize(
"value", [[], [bytes32([3] * 32)], [bytes32([0] * 32), bytes32([1] * 32)], [bytes([1]), bytes([1, 2, 3])]]
)
def test_shatree_atom_list(value: List[bytes]) -> None:
h1 = shatree_atom_list(value)
h2 = Program.to(value).get_tree_hash()
assert h1 == h2


@pytest.mark.parametrize("value", [0, -1, 1, 0x7F, 0x80, 100000000, -10000000])
def test_shatree_int(value: int) -> None:
h1 = shatree_int(value)
h2 = Program.to(value).get_tree_hash()
assert h1 == h2


@pytest.mark.parametrize("value", [bytes([1] * 1), bytes([]), bytes([5] * 1000)])
def test_shatree_atom(value: bytes) -> None:
h1 = shatree_atom(value)
h2 = Program.to(value).get_tree_hash()
assert h1 == h2
Loading

0 comments on commit 037d882

Please sign in to comment.