Skip to content

Commit f88a211

Browse files
authored
catchup: into long_lived/datalayer_merkle_blob from main @ ae706ad (#19664)
Source hash: ae706ad Remaining commits: 0
2 parents 6dcc8cf + 94db228 commit f88a211

File tree

9 files changed

+50
-82
lines changed

9 files changed

+50
-82
lines changed

.github/workflows/build-linux-installer-deb.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ${{ matrix.os.runs-on }}
4848
needs:
4949
- version
50-
container: chianetwork/ubuntu-20.04-builder:latest
50+
container: chianetwork/ubuntu-22.04-builder:latest
5151
timeout-minutes: 120
5252
strategy:
5353
fail-fast: false
@@ -257,18 +257,10 @@ jobs:
257257
arm: [linux, arm64]
258258
intel: [ubuntu-latest]
259259
distribution:
260-
- name: debian:bullseye
261-
type: debian
262-
# https://packages.debian.org/bullseye/python/python3 (3.9)
263-
url: "docker://debian:bullseye"
264260
- name: debian:bookworm
265261
type: debian
266262
# https://packages.debian.org/bookworm/python/python3 (3.11)
267263
url: "docker://debian:bookworm"
268-
- name: ubuntu:focal (20.04)
269-
type: ubuntu
270-
# https://packages.ubuntu.com/focal/python3 (20.04, 3.8)
271-
url: "docker://ubuntu:focal"
272264
- name: ubuntu:jammy (22.04)
273265
type: ubuntu
274266
# https://packages.ubuntu.com/jammy/python3 (22.04, 3.10)

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ jobs:
153153
- name: arch:latest
154154
type: arch
155155
url: "docker://archlinux:latest"
156-
- name: debian:bullseye
157-
type: debian
158-
# https://packages.debian.org/bullseye/python/python3 (3.9)
159-
url: "docker://debian:bullseye"
160156
- name: debian:bookworm
161157
type: debian
162158
# https://packages.debian.org/bookworm/python/python3 (3.11)
@@ -175,10 +171,6 @@ jobs:
175171
- name: rockylinux:9
176172
type: rocky
177173
url: "docker://rockylinux:9"
178-
- name: ubuntu:focal (20.04)
179-
type: ubuntu
180-
# https://packages.ubuntu.com/focal/python3 (20.04, 3.8)
181-
url: "docker://ubuntu:focal"
182174
- name: ubuntu:jammy (22.04)
183175
type: ubuntu
184176
# https://packages.ubuntu.com/jammy/python3 (22.04, 3.10)
@@ -243,7 +235,7 @@ jobs:
243235
apt-get --yes update
244236
apt-get install --yes git lsb-release sudo
245237
MINIMUM=3.9
246-
if ! apt satisfy --yes "python3-venv (>= ${MINIMUM})"
238+
if ! apt-get satisfy --yes "python3-venv (>= ${MINIMUM})"
247239
then
248240
apt-get install --yes python${MINIMUM}-venv
249241
fi

build_scripts/build_linux_deb-2-installer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ if [ "$PLATFORM" = "arm64" ]; then
9090
# This is a temporary fix.
9191
# https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499
9292
# @TODO Consolidates the process to amd64 if the issue of electron-builder is resolved
93-
sudo apt -y install ruby ruby-dev
93+
sudo apt-get -y install ruby ruby-dev
9494
# ERROR: Error installing fpm:
9595
# 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
9696
# dotenv requires Ruby version >= 3.0. The current ruby version is 2.7.0.0.

chia/consensus/blockchain.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -613,20 +613,13 @@ async def _reconsider_peak(
613613
[fork_add.coin for fork_add in fork_info.additions_since_fork.values() if fork_add.is_coinbase],
614614
)
615615

616-
def get_next_difficulty(self, header_hash: bytes32, new_slot: bool) -> uint64:
616+
def get_next_sub_slot_iters_and_difficulty(self, header_hash: bytes32, new_slot: bool) -> tuple[uint64, uint64]:
617617
curr = self.try_block_record(header_hash)
618618
assert curr is not None
619619
if curr.height <= 2:
620-
return self.constants.DIFFICULTY_STARTING
620+
return self.constants.SUB_SLOT_ITERS_STARTING, self.constants.DIFFICULTY_STARTING
621621

622-
return get_next_sub_slot_iters_and_difficulty(self.constants, new_slot, curr, self)[1]
623-
624-
def get_next_slot_iters(self, header_hash: bytes32, new_slot: bool) -> uint64:
625-
curr = self.try_block_record(header_hash)
626-
assert curr is not None
627-
if curr.height <= 2:
628-
return self.constants.SUB_SLOT_ITERS_STARTING
629-
return get_next_sub_slot_iters_and_difficulty(self.constants, new_slot, curr, self)[0]
622+
return get_next_sub_slot_iters_and_difficulty(self.constants, new_slot, curr, self)
630623

631624
async def get_sp_and_ip_sub_slots(
632625
self, header_hash: bytes32

chia/full_node/full_node.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class PeakPostProcessingResult:
102102
fns_peak_result: FullNodeStorePeakResult # The result of calling FullNodeStore.new_peak
103103
hints: list[tuple[bytes32, bytes]] # The hints added to the DB
104104
lookup_coin_ids: list[bytes32] # The coin IDs that we need to look up to notify wallets of changes
105+
signage_points: list[tuple[RespondSignagePoint, WSChiaConnection, Optional[EndOfSubSlotBundle]]]
105106

106107

107108
@dataclasses.dataclass(frozen=True)
@@ -837,7 +838,7 @@ async def send_peak_to_timelords(
837838
peak_block = await self.blockchain.get_full_peak()
838839
if peak_block is not None:
839840
peak = self.blockchain.block_record(peak_block.header_hash)
840-
difficulty = self.blockchain.get_next_difficulty(peak.header_hash, False)
841+
difficulty = self.blockchain.get_next_sub_slot_iters_and_difficulty(peak.header_hash, False)[1]
841842
ses: Optional[SubEpochSummary] = next_sub_epoch_summary(
842843
self.constants,
843844
self.blockchain,
@@ -1807,10 +1808,9 @@ async def signage_point_post_processing(
18071808
# Makes sure to potentially update the difficulty if we are past the peak (into a new sub-slot)
18081809
assert ip_sub_slot is not None
18091810
if request.challenge_chain_vdf.challenge != ip_sub_slot.challenge_chain.get_hash():
1810-
next_difficulty = self.blockchain.get_next_difficulty(peak.header_hash, True)
1811-
next_sub_slot_iters = self.blockchain.get_next_slot_iters(peak.header_hash, True)
1812-
difficulty = next_difficulty
1813-
sub_slot_iters = next_sub_slot_iters
1811+
sub_slot_iters, difficulty = self.blockchain.get_next_sub_slot_iters_and_difficulty(
1812+
peak.header_hash, True
1813+
)
18141814
else:
18151815
difficulty = self.constants.DIFFICULTY_STARTING
18161816
sub_slot_iters = self.constants.SUB_SLOT_ITERS_STARTING
@@ -1845,8 +1845,7 @@ async def peak_post_processing(
18451845
"""
18461846

18471847
record = state_change_summary.peak
1848-
difficulty = self.blockchain.get_next_difficulty(record.header_hash, False)
1849-
sub_slot_iters = self.blockchain.get_next_slot_iters(record.header_hash, False)
1848+
sub_slot_iters, difficulty = self.blockchain.get_next_sub_slot_iters_and_difficulty(record.header_hash, False)
18501849

18511850
self.log.info(
18521851
f"🌱 Updated peak to height {record.height}, weight {record.weight}, "
@@ -1895,6 +1894,7 @@ async def peak_post_processing(
18951894
difficulty,
18961895
)
18971896

1897+
signage_points: list[tuple[RespondSignagePoint, WSChiaConnection, Optional[EndOfSubSlotBundle]]] = []
18981898
if fns_peak_result.new_signage_points is not None and peer is not None:
18991899
for index, sp in fns_peak_result.new_signage_points:
19001900
assert (
@@ -1903,8 +1903,13 @@ async def peak_post_processing(
19031903
and sp.rc_vdf is not None
19041904
and sp.rc_proof is not None
19051905
)
1906-
await self.signage_point_post_processing(
1907-
RespondSignagePoint(index, sp.cc_vdf, sp.cc_proof, sp.rc_vdf, sp.rc_proof), peer, sub_slots[1]
1906+
# Collect the data for networking outside the mutex
1907+
signage_points.append(
1908+
(
1909+
RespondSignagePoint(index, sp.cc_vdf, sp.cc_proof, sp.rc_vdf, sp.rc_proof),
1910+
peer,
1911+
sub_slots[1],
1912+
)
19081913
)
19091914

19101915
if sub_slots[1] is None:
@@ -1934,6 +1939,7 @@ async def peak_post_processing(
19341939
fns_peak_result,
19351940
hints_to_add,
19361941
lookup_coin_ids,
1942+
signage_points=signage_points,
19371943
)
19381944

19391945
async def peak_post_processing_2(
@@ -1948,6 +1954,8 @@ async def peak_post_processing_2(
19481954
with peers
19491955
"""
19501956
record = state_change_summary.peak
1957+
for signage_point in ppp_result.signage_points:
1958+
await self.signage_point_post_processing(*signage_point)
19511959
for new_peak_item in ppp_result.mempool_peak_result:
19521960
self.log.debug(f"Added transaction to mempool: {new_peak_item.transaction_id}")
19531961
mempool_item = self.mempool_manager.get_mempool_item(new_peak_item.transaction_id)
@@ -2673,8 +2681,9 @@ async def add_end_of_sub_slot(
26732681

26742682
peak = self.blockchain.get_peak()
26752683
if peak is not None and peak.height > 2:
2676-
next_sub_slot_iters = self.blockchain.get_next_slot_iters(peak.header_hash, True)
2677-
next_difficulty = self.blockchain.get_next_difficulty(peak.header_hash, True)
2684+
next_sub_slot_iters, next_difficulty = self.blockchain.get_next_sub_slot_iters_and_difficulty(
2685+
peak.header_hash, True
2686+
)
26782687
else:
26792688
next_sub_slot_iters = self.constants.SUB_SLOT_ITERS_STARTING
26802689
next_difficulty = self.constants.DIFFICULTY_STARTING

chia/full_node/full_node_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,9 @@ async def respond_signage_point(
726726
return None
727727
peak = self.full_node.blockchain.get_peak()
728728
if peak is not None and peak.height > self.full_node.constants.MAX_SUB_SLOT_BLOCKS:
729-
next_sub_slot_iters = self.full_node.blockchain.get_next_slot_iters(peak.header_hash, True)
729+
next_sub_slot_iters = self.full_node.blockchain.get_next_sub_slot_iters_and_difficulty(
730+
peak.header_hash, True
731+
)[0]
730732
sub_slots_for_peak = await self.full_node.blockchain.get_sp_and_ip_sub_slots(peak.header_hash)
731733
assert sub_slots_for_peak is not None
732734
ip_sub_slot: Optional[EndOfSubSlotBundle] = sub_slots_for_peak[1]

install-timelord.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,6 @@ echo "${CHIAVDF_POETRY_INFO_VERSION}"
5959
CHIAVDF_VERSION="chiavdf==${CHIAVDF_POETRY_INFO_VERSION}"
6060
echo "${CHIAVDF_VERSION}"
6161

62-
ubuntu_cmake_install() {
63-
UBUNTU_PRE_2004=$(python -c 'import subprocess; id = subprocess.run(["lsb_release", "-is"], stdout=subprocess.PIPE); version = subprocess.run(["lsb_release", "-rs"], stdout=subprocess.PIPE); print(id.stdout.decode("ascii") == "Ubuntu\n" and float(version.stdout) < float(20.04))')
64-
if [ "$UBUNTU_PRE_2004" = "True" ]; then
65-
echo "Installing CMake with snap."
66-
sudo apt-get install snapd -y
67-
sudo apt-get remove --purge cmake -y
68-
hash -r
69-
sudo snap install cmake --classic
70-
# shellcheck disable=SC1091
71-
. /etc/profile
72-
else
73-
echo "Ubuntu 20.04LTS and newer support CMake 3.16+"
74-
sudo apt-get install cmake -y
75-
fi
76-
}
77-
7862
symlink_vdf_bench() {
7963
if [ ! -e vdf_bench ] && [ -e venv/lib/"$1"/site-packages/vdf_bench ]; then
8064
echo ln -s venv/lib/"$1"/site-packages/vdf_bench
@@ -111,8 +95,6 @@ if [ -e "$THE_PATH" ]; then
11195
else
11296
if [ -e venv/bin/python ] && test "$UBUNTU_DEBIAN"; then
11397
echo "Installing chiavdf dependencies on Ubuntu/Debian"
114-
# If Ubuntu version is older than 20.04LTS then upgrade CMake
115-
ubuntu_cmake_install
11698
# Install remaining needed development tools - assumes venv and prior run of install.sh
11799
echo "apt-get install libgmp-dev libboost-python-dev $PYTHON_DEV_DEPENDENCY libboost-system-dev build-essential -y"
118100
sudo apt-get install libgmp-dev libboost-python-dev "$PYTHON_DEV_DEPENDENCY" libboost-system-dev build-essential -y

poetry.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,15 +2649,15 @@ wheel = "*"
26492649

26502650
[[package]]
26512651
name = "pytest-xdist"
2652-
version = "3.6.1"
2652+
version = "3.7.0"
26532653
description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs"
26542654
optional = true
2655-
python-versions = ">=3.8"
2655+
python-versions = ">=3.9"
26562656
groups = ["main"]
26572657
markers = "extra == \"dev\""
26582658
files = [
2659-
{file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"},
2660-
{file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"},
2659+
{file = "pytest_xdist-3.7.0-py3-none-any.whl", hash = "sha256:7d3fbd255998265052435eb9daa4e99b62e6fb9cfb6efd1f858d4d8c0c7f0ca0"},
2660+
{file = "pytest_xdist-3.7.0.tar.gz", hash = "sha256:f9248c99a7c15b7d2f90715df93610353a485827bc06eefb6566d23f6400f126"},
26612661
]
26622662

26632663
[package.dependencies]
@@ -3506,4 +3506,4 @@ upnp = ["miniupnpc"]
35063506
[metadata]
35073507
lock-version = "2.1"
35083508
python-versions = ">=3.9, <4"
3509-
content-hash = "dc2647eb50337c908de6d510644356ca0ba1d289e782e527b6525d87e2edec9d"
3509+
content-hash = "6a5b2af260a6b53a529c7e283f456b910aef9b332995a10436456399181d2937"

pyproject.toml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
[tool.poetry]
1+
[project]
22
name = "chia-blockchain"
3-
# see [tool.poetry-dynamic-versioning]
4-
version = "0.0.0"
3+
dynamic = [ "dependencies", "version" ]
54
description = "Chia blockchain full node, farmer, timelord, and wallet."
6-
authors = ["Mariano Sorgente <[email protected]>"]
7-
license = "Apache-2.0"
8-
readme = "README.md"
5+
requires-python = ">=3.9, <4"
6+
authors = [
7+
{name="Mariano Sorgente", email="[email protected]"}
8+
]
9+
license = {text="Apache-2.0"}
10+
readme = {file = "README.md", content-type = "text/markdown"}
911
keywords= ["chia", "blockchain", "node"]
1012
homepage = "https://chia.net/"
13+
14+
[tool.poetry]
15+
# see [tool.poetry-dynamic-versioning]
1116
packages = [{ include = "chia"}, { include = "mozilla-ca/cacert.pem" }]
17+
version = "0.0.0"
1218

13-
[tool.poetry.scripts]
19+
[project.scripts]
1420
chia = "chia.cmds.chia:main"
1521
chia_daemon = "chia.daemon.server:main"
1622
chia_wallet = "chia.server.start_wallet:main"
@@ -32,12 +38,11 @@ name = "chia"
3238
url = "https://pypi.chia.net/simple/"
3339
priority = "supplemental"
3440

35-
[tool.poetry.urls]
36-
"Source" = "https://github.com/Chia-Network/chia-blockchain/"
37-
"Changelog" = "https://github.com/Chia-Network/chia-blockchain/blob/main/CHANGELOG.md"
41+
[project.urls]
42+
source = "https://github.com/Chia-Network/chia-blockchain/"
43+
changelog = "https://github.com/Chia-Network/chia-blockchain/blob/main/CHANGELOG.md"
3844

3945
[tool.poetry.dependencies]
40-
python = ">=3.9, <4"
4146
aiofiles = ">=24.1.0" # Async IO for files
4247
aiohttp = ">=3.10.4" # HTTP server for full node rpc
4348
aiosqlite = ">=0.20.0" # asyncio wrapper for sqlite, to store blocks
@@ -140,10 +145,3 @@ bump = true
140145
[build-system]
141146
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
142147
build-backend = "poetry_dynamic_versioning.backend"
143-
144-
[project]
145-
# duplicating until poetry v2, then revisit https://github.com/Chia-Network/chia-blockchain/pull/18797
146-
name = "chia-blockchain"
147-
# This has to match the poetry python entry above
148-
requires-python = ">=3.9, <4"
149-
dynamic = ["version"]

0 commit comments

Comments
 (0)