Skip to content

Commit fafd2a2

Browse files
committed
Merge branch 'main' into fine_william___fine
2 parents 828e413 + 326b108 commit fafd2a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1335
-831
lines changed

.github/workflows/build-macos-installers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
matrix:
5454
python-version: ["3.10"]
5555
os:
56-
- runs-on: macos-13
56+
- runs-on: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
5757
name: intel
5858
bladebit-suffix: macos-x86-64.tar.gz
5959
arch-artifact-name: intel
@@ -296,7 +296,7 @@ jobs:
296296
- name: 13
297297
matrix: 13
298298
runs-on:
299-
intel: macos-13
299+
intel: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
300300
- name: 14
301301
matrix: 14
302302
runs-on:

.github/workflows/check_wheel_availability.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: macOS
3333
matrix: macos
3434
runs-on:
35-
intel: macos-13
35+
intel: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
3636
arm: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-arm64' || 'macos-15' }}
3737
- name: Windows
3838
matrix: windows

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: macOS
3030
matrix: macos
3131
runs-on:
32-
intel: macos-13
32+
intel: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
3333
arm: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-arm64' || 'macos-15' }}
3434
- name: Windows
3535
matrix: windows
@@ -51,6 +51,11 @@ jobs:
5151
matrix: windows
5252
arch:
5353
matrix: arm
54+
# Back to self hosted mac intel runners, which we have very few of
55+
- os:
56+
matrix: macos
57+
arch:
58+
matrix: intel
5459

5560
steps:
5661
- name: Clean workspace

.github/workflows/test-install-scripts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
emoji: 🍎
4141
runs-on:
4242
arm: macos-15
43-
intel: macos-13
43+
intel: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
4444
matrix: macos
4545
- name: Windows
4646
emoji: 🪟

.github/workflows/test.yml

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ on:
4040
default: 1
4141
required: false
4242
type: number
43-
run-linux:
44-
description: "run Linux tests"
43+
run-linux-intel:
44+
description: "run Linux-intel tests"
45+
default: true
46+
required: false
47+
type: boolean
48+
run-linux-arm:
49+
description: "run Linux-arm tests"
4550
default: true
4651
required: false
4752
type: boolean
4853
run-macos-intel:
4954
description: "run macOS-intel tests"
50-
default: true
55+
default: false
5156
required: false
5257
type: boolean
5358
run-macos-arm:
@@ -104,12 +109,24 @@ jobs:
104109
|| 'main'
105110
}} >> "$GITHUB_OUTPUT"
106111
112+
- name: Generate mac intel configuration
113+
id: macintel
114+
run: |
115+
echo mac_intel=${{
116+
( github.event_name == 'schedule' || inputs.run-macos-intel )
117+
|| ( github.repository_owner == 'Chia-Network' && github.repository == 'Chia-Network/chia-blockchain' && startsWith(github.ref, 'refs/heads/release/') )
118+
|| ( github.repository_owner == 'Chia-Network' && github.repository == 'Chia-Network/chia-blockchain' && startsWith(github.base_ref, 'release/') )
119+
&& 'true'
120+
|| 'false'
121+
}} >> "$GITHUB_OUTPUT"
122+
107123
outputs:
108124
configuration: ${{ steps.configure.outputs.configuration }}
109125
matrix_mode: ${{ steps.configure.outputs.matrix_mode }}
126+
mac_intel: ${{ steps.macintel.outputs.mac_intel }}
110127

111128
macos-intel:
112-
if: github.event_name != 'workflow_dispatch' || inputs.run-macos-intel
129+
if: needs.configure.outputs.mac_intel == 'true'
113130
uses: ./.github/workflows/test-single.yml
114131
needs: configure
115132
with:
@@ -120,7 +137,7 @@ jobs:
120137
concurrency-name: macos-intel
121138
configuration: ${{ needs.configure.outputs.configuration }}
122139
matrix_mode: ${{ needs.configure.outputs.matrix_mode }}
123-
runs-on: macos-13
140+
runs-on: ${{ github.repository_owner == 'Chia-Network' && 'macos-13-intel' || 'macos-13' }}
124141
arch: intel
125142
arch-emoji: 🌀
126143
macos-arm:
@@ -139,22 +156,38 @@ jobs:
139156
arch: arm
140157
arch-emoji: 💪
141158
collect-junit: false
142-
ubuntu:
143-
if: github.event_name != 'workflow_dispatch' || inputs.run-linux
159+
ubuntu-intel:
160+
if: github.event_name != 'workflow_dispatch' || inputs.run-linux-intel
144161
uses: ./.github/workflows/test-single.yml
145162
needs: configure
146163
with:
147164
os-emoji: 🐧
148165
matrix: ubuntu
149166
name: Ubuntu
150-
file_name: ubuntu
151-
concurrency-name: ubuntu
167+
file_name: ubuntu-intel
168+
concurrency-name: ubuntu-intel
152169
configuration: ${{ needs.configure.outputs.configuration }}
153170
matrix_mode: ${{ needs.configure.outputs.matrix_mode }}
154171
runs-on: ubuntu-latest
155172
arch: intel
156173
arch-emoji: 🌀
157174
collect-junit: false
175+
ubuntu-arm:
176+
if: github.event_name != 'workflow_dispatch' || inputs.run-linux-arm
177+
uses: ./.github/workflows/test-single.yml
178+
needs: configure
179+
with:
180+
os-emoji: 🐧
181+
matrix: ubuntu
182+
name: Ubuntu
183+
file_name: ubuntu-arm
184+
concurrency-name: ubuntu-arm
185+
configuration: ${{ needs.configure.outputs.configuration }}
186+
matrix_mode: ${{ needs.configure.outputs.matrix_mode }}
187+
runs-on: ubuntu-24.04-arm
188+
arch: arm
189+
arch-emoji: 💪
190+
collect-junit: false
158191
windows:
159192
if: github.event_name != 'workflow_dispatch' || inputs.run-windows
160193
uses: ./.github/workflows/test-single.yml
@@ -173,13 +206,15 @@ jobs:
173206
collect-junit: false
174207

175208
coverage:
176-
if: github.repository_owner == 'Chia-Network'
209+
if: always() && github.repository_owner == 'Chia-Network'
177210
name: ${{ matrix.os.emoji }} Coverage - ${{ matrix.python.name }}
178211
runs-on: ${{ matrix.os.runs-on }}
179212
needs:
213+
- configure
180214
- macos-intel
181215
- macos-arm
182-
- ubuntu
216+
- ubuntu-intel
217+
- ubuntu-arm
183218
- windows
184219
strategy:
185220
fail-fast: false
@@ -197,6 +232,12 @@ jobs:
197232
matrix: "3.10"
198233

199234
steps:
235+
- uses: re-actors/alls-green@release/v1.2
236+
id: alls-green
237+
with:
238+
allowed-skips: ${{ needs.configure.outputs.mac_intel != 'true' && 'macos-intel' || '' }}
239+
jobs: ${{ toJSON(needs) }}
240+
200241
- uses: actions/checkout@v5
201242
with:
202243
fetch-depth: 0
@@ -253,13 +294,13 @@ jobs:
253294
- uses: chia-network/actions/activate-venv@main
254295

255296
- name: Add time out assert results to workflow summary
256-
if: always() && false
297+
if: always() && steps.alls-green.outputs.success == 'true' && false
257298
run: |
258299
python -m chia._tests.process_junit --limit 50 --type time_out_assert --xml junit-results/junit.xml --markdown --link-prefix ${{ github.event.repository.html_url }}/blob/${{ github.sha }}/ --link-line-separator \#L >> "$GITHUB_STEP_SUMMARY"
259300
python -m chia._tests.process_junit --type time_out_assert --xml junit-results/junit.xml --markdown --link-prefix ${{ github.event.repository.html_url }}/blob/${{ github.sha }}/ --link-line-separator \#L >> junit-results/time_out_assert.md
260301
261302
- name: Publish JUnit results
262-
if: always() && false
303+
if: always() && steps.alls-green.outputs.success == 'true' && false
263304
uses: actions/upload-artifact@v4
264305
with:
265306
name: junit-results
@@ -273,18 +314,18 @@ jobs:
273314
coverage html --rcfile=.coveragerc --data-file=coverage-reports/.coverage --directory coverage-reports/html/
274315
275316
- uses: coverallsapp/github-action@v2
276-
if: always()
317+
if: always() && steps.alls-green.outputs.success == 'true'
277318
env:
278319
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
279320

280321
- name: Coverage report (chia/)
281-
if: always()
322+
if: always() && steps.alls-green.outputs.success == 'true'
282323
run: |
283324
set -o pipefail
284325
coverage report --rcfile=.coveragerc --data-file=coverage-reports/.coverage --include='chia/**/*' --omit='chia/_tests/**/*' --show-missing | tee coverage-reports/coverage-chia-stdout
285326
286327
- name: Coverage report (chia/_tests/)
287-
if: always()
328+
if: always() && steps.alls-green.outputs.success == 'true'
288329
run: |
289330
set -o pipefail
290331
coverage report --rcfile=.coveragerc --data-file=coverage-reports/.coverage --include='chia/_tests/**/*' --show-missing | tee coverage-reports/coverage-tests-stdout
@@ -295,7 +336,7 @@ jobs:
295336
echo "hash=$(git rev-parse HEAD~1)" >> "$GITHUB_OUTPUT"
296337
297338
- name: Coverage report (diff)
298-
if: (github.base_ref != '' || github.event.before != '') && always()
339+
if: (github.base_ref != '' || github.event.before != '') && always() && steps.alls-green.outputs.success == 'true'
299340
env:
300341
compare-branch: ${{ github.base_ref == '' && steps.parent-commit.outputs.hash || format('origin/{0}', github.base_ref) }}
301342
run: |
@@ -308,7 +349,7 @@ jobs:
308349
fi
309350
310351
- name: Remove previous coverage report comment and label from PR
311-
if: github.base_ref != '' && always()
352+
if: github.base_ref != '' && always() && steps.alls-green.outputs.success == 'true'
312353
shell: bash
313354
env:
314355
COV_STATUS: ${{ env.COV_STATUS }}
@@ -329,7 +370,7 @@ jobs:
329370
fi
330371
331372
- name: Add diff coverage report comment to PR
332-
if: github.base_ref != '' && always()
373+
if: github.base_ref != '' && always() && steps.alls-green.outputs.success == 'true'
333374
env:
334375
BRANCH_NAME: ${{ github.sha }}
335376
COV_STATUS: ${{ env.COV_STATUS }}
@@ -379,12 +420,12 @@ jobs:
379420
fi
380421
381422
- name: Add diff coverage report to workflow summary
382-
if: (github.base_ref != '' || github.event.before != '') && always()
423+
if: (github.base_ref != '' || github.event.before != '') && always() && steps.alls-green.outputs.success == 'true'
383424
run: |
384425
cat coverage-reports/diff-cover.md >> "$GITHUB_STEP_SUMMARY"
385426
386427
- name: Publish coverage reports
387-
if: always()
428+
if: always() && steps.alls-green.outputs.success == 'true'
388429
uses: actions/upload-artifact@v4
389430
with:
390431
name: coverage-reports

.github/workflows/upload-pypi-source.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix: macos
4545
emoji: 🍎
4646
runs-on:
47-
intel: macos-13
47+
intel: macos-13-intel
4848
arm: macos-13-arm64
4949
- name: Windows
5050
matrix: windows
@@ -75,6 +75,11 @@ jobs:
7575
matrix: windows
7676
arch:
7777
matrix: arm
78+
# Back to self hosted mac intel runners, which we have very few of
79+
- os:
80+
matrix: macos
81+
arch:
82+
matrix: intel
7883

7984
steps:
8085
- uses: chia-network/actions/clean-workspace@main

build_scripts/build_linux_deb-2-installer.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,9 @@ jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json >temp.json &
8686
echo "Building Linux(deb) Electron app"
8787
PRODUCT_NAME="chia"
8888
if [ "$PLATFORM" = "arm64" ]; then
89-
# electron-builder does not work for arm64 as of Aug 16, 2022.
90-
# This is a temporary fix.
9189
# https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499
92-
# @TODO Consolidates the process to amd64 if the issue of electron-builder is resolved
93-
sudo apt-get -y install ruby ruby-dev
94-
# ERROR: Error installing fpm:
95-
# The last version of dotenv (>= 0) to support your Ruby & RubyGems was 2.8.1. Try installing it with `gem install dotenv -v 2.8.1` and then running the current command again
96-
# dotenv requires Ruby version >= 3.0. The current ruby version is 2.7.0.0.
97-
# @TODO Once ruby 3.0 can be installed on `apt install ruby`, installing dotenv below should be removed.
98-
sudo gem install dotenv -v 2.8.1
99-
sudo gem install fpm
90+
# workaround for above now implemented in the image build at
91+
# https://github.com/Chia-Network/build-images/blob/7c74d2f20739543c486c2522032cf09d96396d24/ubuntu-22.04/Dockerfile#L48-L61
10092
echo USE_SYSTEM_FPM=true "${NPM_PATH}/electron-builder" build --linux deb --arm64 \
10193
--config.extraMetadata.name=chia-blockchain \
10294
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \

chia/_tests/blockchain/blockchain_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def _validate_and_add_block(
7676
conds = None
7777
else:
7878
# fake the signature validation. Just say True here.
79-
conds = SpendBundleConditions([], 0, 0, 0, None, None, [], 0, 0, 0, True, 0, 0)
79+
conds = SpendBundleConditions([], 0, 0, 0, None, None, [], 0, 0, 0, True, 0, 0, 0, 0, 0)
8080
results = PreValidationResult(None, uint64(1), conds, uint32(0))
8181
else:
8282
future = await pre_validate_block(

chia/_tests/blockchain/test_blockchain.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4352,6 +4352,9 @@ async def test_include_spends_same_as_parent(
43524352
True,
43534353
0,
43544354
0,
4355+
0,
4356+
0,
4357+
0,
43554358
)
43564359
# Now let's run the test
43574360
test_setup.fork_info.include_spends(conds, test_setup.test_block, test_setup.test_block.header_hash)

chia/_tests/core/custom_types/test_proof_of_space.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from chia._tests.util.misc import Marks, datacases
1313
from chia.consensus.default_constants import DEFAULT_CONSTANTS
1414
from chia.types.blockchain_format.proof_of_space import (
15-
calculate_plot_difficulty,
1615
calculate_prefix_bits,
16+
calculate_required_plot_strength,
1717
check_plot_size,
1818
make_pos,
1919
passes_plot_filter,
@@ -201,26 +201,26 @@ def test_verify_and_get_quality_string_v2(caplog: pytest.LogCaptureFixture, case
201201

202202

203203
@pytest.mark.parametrize(
204-
"height, difficulty",
204+
"height, strength",
205205
[
206206
(0, 2),
207207
(DEFAULT_CONSTANTS.HARD_FORK_HEIGHT, 2),
208208
(DEFAULT_CONSTANTS.HARD_FORK2_HEIGHT, 2),
209-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_4_HEIGHT - 1, 2),
210-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_4_HEIGHT, 4),
211-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_5_HEIGHT - 1, 4),
212-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_5_HEIGHT, 5),
213-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_6_HEIGHT - 1, 5),
214-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_6_HEIGHT, 6),
215-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_7_HEIGHT - 1, 6),
216-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_7_HEIGHT, 7),
217-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_8_HEIGHT - 1, 7),
218-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_8_HEIGHT, 8),
219-
(DEFAULT_CONSTANTS.PLOT_DIFFICULTY_8_HEIGHT + 1000000, 8),
209+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_4_HEIGHT - 1, 2),
210+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_4_HEIGHT, 4),
211+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_5_HEIGHT - 1, 4),
212+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_5_HEIGHT, 5),
213+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_6_HEIGHT - 1, 5),
214+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_6_HEIGHT, 6),
215+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_7_HEIGHT - 1, 6),
216+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_7_HEIGHT, 7),
217+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_8_HEIGHT - 1, 7),
218+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_8_HEIGHT, 8),
219+
(DEFAULT_CONSTANTS.PLOT_STRENGTH_8_HEIGHT + 1000000, 8),
220220
],
221221
)
222-
def test_calculate_plot_difficulty(height: uint32, difficulty: uint8) -> None:
223-
assert calculate_plot_difficulty(DEFAULT_CONSTANTS, height) == difficulty
222+
def test_calculate_plot_strength(height: uint32, strength: uint8) -> None:
223+
assert calculate_required_plot_strength(DEFAULT_CONSTANTS, height) == strength
224224

225225

226226
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)