Skip to content

Commit ea2ee80

Browse files
committed
Merge branch 'main' into farmer_solver_networking
2 parents eb9a51f + 0396922 commit ea2ee80

File tree

4 files changed

+59
-19
lines changed

4 files changed

+59
-19
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ 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
@@ -151,22 +156,38 @@ jobs:
151156
arch: arm
152157
arch-emoji: 💪
153158
collect-junit: false
154-
ubuntu:
155-
if: github.event_name != 'workflow_dispatch' || inputs.run-linux
159+
ubuntu-intel:
160+
if: github.event_name != 'workflow_dispatch' || inputs.run-linux-intel
156161
uses: ./.github/workflows/test-single.yml
157162
needs: configure
158163
with:
159164
os-emoji: 🐧
160165
matrix: ubuntu
161166
name: Ubuntu
162-
file_name: ubuntu
163-
concurrency-name: ubuntu
167+
file_name: ubuntu-intel
168+
concurrency-name: ubuntu-intel
164169
configuration: ${{ needs.configure.outputs.configuration }}
165170
matrix_mode: ${{ needs.configure.outputs.matrix_mode }}
166171
runs-on: ubuntu-latest
167172
arch: intel
168173
arch-emoji: 🌀
169174
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
170191
windows:
171192
if: github.event_name != 'workflow_dispatch' || inputs.run-windows
172193
uses: ./.github/workflows/test-single.yml
@@ -192,7 +213,8 @@ jobs:
192213
- configure
193214
- macos-intel
194215
- macos-arm
195-
- ubuntu
216+
- ubuntu-intel
217+
- ubuntu-arm
196218
- windows
197219
strategy:
198220
fail-fast: false

build_scripts/build_linux_deb-2-installer.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +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-
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
9592
echo USE_SYSTEM_FPM=true "${NPM_PATH}/electron-builder" build --linux deb --arm64 \
9693
--config.extraMetadata.name=chia-blockchain \
9794
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \

chia/_tests/core/server/test_rate_limits.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def advance(self, duration: float) -> None:
4242
@pytest.mark.anyio
4343
async def test_get_rate_limits_to_use() -> None:
4444
assert get_rate_limits_to_use(rl_v2, rl_v2) != get_rate_limits_to_use(rl_v2, rl_v1)
45+
assert get_rate_limits_to_use(rl_v2, rl_v2) != get_rate_limits_to_use(rl_v1, rl_v2)
4546
assert get_rate_limits_to_use(rl_v1, rl_v1) == get_rate_limits_to_use(rl_v2, rl_v1)
4647
assert get_rate_limits_to_use(rl_v1, rl_v1) == get_rate_limits_to_use(rl_v1, rl_v2)
4748

chia/plotting/check_plots.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
import concurrent.futures
44
import logging
55
from collections import Counter
6+
from collections.abc import Sequence
67
from pathlib import Path
78
from threading import Lock
89
from time import monotonic, sleep
9-
from typing import Optional
10+
from typing import Optional, Union
1011

1112
from chia_rs import G1Element
13+
from chia_rs.sized_bytes import bytes32
1214
from chia_rs.sized_ints import uint8, uint32
1315
from chiapos import Verifier
1416

17+
from chia.consensus.default_constants import DEFAULT_CONSTANTS
1518
from chia.plotting.manager import PlotManager
19+
from chia.plotting.prover import PlotVersion
1620
from chia.plotting.util import (
1721
PlotInfo,
1822
PlotRefreshEvents,
@@ -22,6 +26,10 @@
2226
get_plot_filenames,
2327
parse_plot_info,
2428
)
29+
from chia.types.blockchain_format.proof_of_space import (
30+
quality_for_partial_proof,
31+
solve_proof,
32+
)
2533
from chia.util.bech32m import encode_puzzle_hash
2634
from chia.util.config import load_config
2735
from chia.util.cpu import available_logical_cores
@@ -168,12 +176,18 @@ def process_plot(plot_path: Path, plot_info: PlotInfo, num_start: int, num_end:
168176

169177
total_proofs = 0
170178
caught_exception: bool = False
179+
version = pr.get_version()
171180
for i in range(num_start, num_end):
172181
challenge = std_hash(i.to_bytes(32, "big"))
182+
# these are either qualities (v1) or partial proofs (v2)
183+
proofs: Sequence[Union[bytes32, bytes]]
173184
# Some plot errors cause get_qualities_for_challenge to throw a RuntimeError
174185
try:
175186
quality_start_time = round(monotonic() * 1000)
176-
qualities = pr.get_qualities_for_challenge(challenge)
187+
if version == PlotVersion.V1:
188+
proofs = pr.get_qualities_for_challenge(challenge)
189+
else:
190+
proofs = pr.get_partial_proofs_for_challenge(challenge, DEFAULT_CONSTANTS.PLOT_STRENGTH_INITIAL)
177191
quality_spent_time = round(monotonic() * 1000) - quality_start_time
178192
if quality_spent_time > 8000:
179193
log.warning(
@@ -201,13 +215,19 @@ def process_plot(plot_path: Path, plot_info: PlotInfo, num_start: int, num_end:
201215
caught_exception = True
202216
break
203217

204-
for index, quality_str in enumerate(qualities):
218+
for index, proof in enumerate(proofs):
205219
# Other plot errors cause get_full_proof or validate_proof to throw an AssertionError
206220
try:
207221
proof_start_time = round(monotonic() * 1000)
208-
# TODO : todo_v2_plots handle v2 plots
209-
proof = pr.get_full_proof(challenge, index, parallel_read)
210-
proof_spent_time = round(monotonic() * 1000) - proof_start_time
222+
if version == PlotVersion.V1:
223+
quality_str = bytes32(proof)
224+
full_proof = pr.get_full_proof(challenge, index, parallel_read)
225+
proof_spent_time = round(monotonic() * 1000) - proof_start_time
226+
else:
227+
quality_str = quality_for_partial_proof(proof, challenge)
228+
proof_spent_time = round(monotonic() * 1000) - proof_start_time
229+
full_proof = solve_proof(proof)
230+
211231
if proof_spent_time > 15000:
212232
log.warning(
213233
f"\tFinding proof took: {proof_spent_time} ms. This should be below 15 seconds "
@@ -216,7 +236,7 @@ def process_plot(plot_path: Path, plot_info: PlotInfo, num_start: int, num_end:
216236
else:
217237
log.info(f"\tFinding proof took: {proof_spent_time} ms. Filepath: {plot_path}")
218238

219-
ver_quality_str = v.validate_proof(pr.get_id(), pr.get_size().size_v1, challenge, proof)
239+
ver_quality_str = v.validate_proof(pr.get_id(), pr.get_size().size_v1, challenge, full_proof)
220240
if quality_str == ver_quality_str:
221241
total_proofs += 1
222242
else:

0 commit comments

Comments
 (0)