Skip to content

Commit d2fde47

Browse files
authored
Merge branch 'main' into core-mempool-attributes
2 parents f7ad557 + 2513b54 commit d2fde47

167 files changed

Lines changed: 8173 additions & 4527 deletions

File tree

Some content is hidden

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

‎.github/actionlint.yaml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ paths:
1515
".github/workflows/build-docs.yml":
1616
ignore:
1717
- 'unexpected key "queue" for "concurrency" section'
18+
# GitHub supports self-repository ($/) action references, but the latest
19+
# actionlint release does not yet recognize them (rhysd/actionlint#711).
20+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
1821
".github/workflows/cleanup-pr-previews.yml":
1922
ignore:
2023
- 'unexpected key "queue" for "concurrency" section'
@@ -32,3 +35,15 @@ paths:
3235
".github/workflows/test-wheel-windows.yml":
3336
ignore:
3437
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
38+
".github/workflows/build-wheel.yml":
39+
ignore:
40+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
41+
".github/workflows/pre-commit.yml":
42+
ignore:
43+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
44+
".github/workflows/test-sdist-windows.yml":
45+
ignore:
46+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
47+
".github/workflows/coverage.yml":
48+
ignore:
49+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'

‎.github/actions/download-artifact-retry/action.yml‎

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,33 @@
55
name: Download artifact (with retry)
66

77
description: >-
8-
Wrapper around actions/download-artifact that retries once after a short
9-
delay when the first attempt fails. Designed to absorb transient
10-
infrastructure flakes such as "other side closed" without failing the job.
8+
Wrapper around actions/download-artifact that retries up to three times with
9+
exponential backoff when a download fails. Handles both transient TCP errors
10+
such as "other side closed" and storage-layer throttling such as
11+
"HTTP 503: Egress is over the account limit". Accepts either an exact
12+
artifact name or a glob pattern; supply exactly one.
1113
1214
inputs:
1315
name:
14-
description: "Name of the artifact to download"
15-
required: true
16+
description: >-
17+
Exact name of the artifact to download. Mutually exclusive with
18+
'pattern'; supply exactly one of the two.
19+
required: false
20+
default: ""
21+
pattern:
22+
description: >-
23+
Glob pattern matching one or more artifact names. Mutually exclusive
24+
with 'name'; supply exactly one of the two.
25+
required: false
26+
default: ""
27+
merge-multiple:
28+
description: >-
29+
When true and 'pattern' is set, merge files from all matched artifacts
30+
directly into 'path' instead of placing each in its own subdirectory.
31+
required: false
32+
default: "false"
1633
path:
17-
description: "Destination path for the downloaded artifact"
34+
description: "Destination path for the downloaded artifact(s)"
1835
required: true
1936
run-id:
2037
description: >-
@@ -32,39 +49,80 @@ inputs:
3249
required: false
3350
default: ""
3451
retry-delay-seconds:
35-
description: "Seconds to wait between the first failure and the retry"
52+
description: "Seconds to wait between the first failure and the second attempt"
3653
required: false
3754
default: "15"
3855

3956
runs:
4057
using: composite
4158
steps:
59+
- name: Validate inputs
60+
shell: bash --noprofile --norc -euo pipefail {0}
61+
env:
62+
INPUT_NAME: ${{ inputs.name }}
63+
INPUT_PATTERN: ${{ inputs.pattern }}
64+
run: |
65+
if [[ -n "${INPUT_NAME}" && -n "${INPUT_PATTERN}" ]]; then
66+
echo "::error::Specify exactly one of 'name' or 'pattern', not both"
67+
exit 1
68+
fi
69+
if [[ -z "${INPUT_NAME}" && -z "${INPUT_PATTERN}" ]]; then
70+
echo "::error::Specify exactly one of 'name' or 'pattern'"
71+
exit 1
72+
fi
73+
4274
- name: Download artifact (attempt 1)
4375
id: attempt1
4476
continue-on-error: true
4577
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
4678
with:
4779
name: ${{ inputs.name }}
80+
pattern: ${{ inputs.pattern }}
81+
merge-multiple: ${{ inputs.merge-multiple }}
4882
path: ${{ inputs.path }}
4983
run-id: ${{ inputs.run-id }}
5084
github-token: ${{ inputs.github-token }}
5185

52-
- name: Wait before retry
86+
- name: Wait before retry (attempt 2)
5387
if: ${{ steps.attempt1.outcome == 'failure' }}
5488
shell: bash --noprofile --norc -euo pipefail {0}
5589
env:
56-
# Pass through env instead of interpolating the input into the shell
57-
# script, so a non-numeric value cannot inject commands.
5890
RETRY_DELAY_SECONDS: ${{ inputs.retry-delay-seconds }}
5991
run: |
6092
echo "::warning::Artifact download failed (attempt 1); retrying in ${RETRY_DELAY_SECONDS}s"
6193
sleep "$RETRY_DELAY_SECONDS"
6294
6395
- name: Download artifact (attempt 2)
96+
id: attempt2
6497
if: ${{ steps.attempt1.outcome == 'failure' }}
98+
continue-on-error: true
99+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
100+
with:
101+
name: ${{ inputs.name }}
102+
pattern: ${{ inputs.pattern }}
103+
merge-multiple: ${{ inputs.merge-multiple }}
104+
path: ${{ inputs.path }}
105+
run-id: ${{ inputs.run-id }}
106+
github-token: ${{ inputs.github-token }}
107+
108+
- name: Wait before retry (attempt 3)
109+
if: ${{ steps.attempt1.outcome == 'failure' && steps.attempt2.outcome == 'failure' }}
110+
shell: bash --noprofile --norc -euo pipefail {0}
111+
env:
112+
RETRY_DELAY_SECONDS: ${{ inputs.retry-delay-seconds }}
113+
run: |
114+
# Double the delay for the second retry to give egress throttling more time to clear.
115+
RETRY_DELAY_SECONDS=$(( RETRY_DELAY_SECONDS * 2 ))
116+
echo "::warning::Artifact download failed (attempt 2); retrying in ${RETRY_DELAY_SECONDS}s"
117+
sleep "$RETRY_DELAY_SECONDS"
118+
119+
- name: Download artifact (attempt 3)
120+
if: ${{ steps.attempt1.outcome == 'failure' && steps.attempt2.outcome == 'failure' }}
65121
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
66122
with:
67123
name: ${{ inputs.name }}
124+
pattern: ${{ inputs.pattern }}
125+
merge-multiple: ${{ inputs.merge-multiple }}
68126
path: ${{ inputs.path }}
69127
run-id: ${{ inputs.run-id }}
70128
github-token: ${{ inputs.github-token }}

‎.github/actions/harden-pip/action.yml‎

Lines changed: 0 additions & 28 deletions
This file was deleted.

‎.github/actions/lychee-links/action.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ outputs:
2626
description: "Whether the current PR label explicitly enables the HTTP 429 override"
2727
value: ${{ steps.lychee-policy.outputs.allow-429 }}
2828

29-
# Callers provide Python and the checked-out repository; the build of any
30-
# rendered documentation must already be complete.
29+
# Callers provide Python through setup-hardened-python and the checked-out
30+
# repository; the build of any rendered documentation must already be complete.
3131
runs:
3232
using: composite
3333
steps:
@@ -113,9 +113,6 @@ runs:
113113
printf '[Open the cache refresh workflow](%s).\n' "$WORKFLOW_URL"
114114
} >> "$GITHUB_STEP_SUMMARY"
115115
116-
- name: Harden pip
117-
uses: ./.github/actions/harden-pip
118-
119116
- name: Check links through the configured pre-commit hook
120117
shell: bash --noprofile --norc -euo pipefail {0}
121118
env:
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Set up hardened Python
6+
description: >-
7+
Install CPython with a pinned uv, create a venv from it, and put the venv
8+
first on PATH. setup-uv verifies the uv binary and uv verifies the
9+
python-build-standalone archive against embedded checksums, so the
10+
interpreter's integrity does not depend on TLS. The job then fails unless
11+
the interpreter's ssl module rejects the compromised eMudhra/emSign CA keys
12+
(CVE-2026-115557; first fixed releases: 3.11.18, 3.12.16, 3.13.18, 3.14.10,
13+
3.15.2), and pip is updated through that ssl module. Unlike setup-python,
14+
this provides patched Windows builds of maintenance series, for which
15+
python.org publishes no installers. See
16+
https://github.com/NVIDIA/cuda-python/issues/3195 and
17+
https://discuss.python.org/t/109678.
18+
19+
inputs:
20+
python-version:
21+
description: >-
22+
uv Python request, e.g. "3.12" or "3.14t" (free-threaded). The newest
23+
patch known to the pinned uv is installed. Only series with a fixed
24+
release listed in the interpreter check (3.11-3.15) are accepted.
25+
required: true
26+
venv:
27+
description: Directory for the venv. Defaults to a new directory under RUNNER_TEMP.
28+
default: ""
29+
30+
outputs:
31+
python-path:
32+
description: Absolute path of the venv's interpreter.
33+
value: ${{ steps.venv.outputs.python-path }}
34+
python-version:
35+
description: Full version of the interpreter, e.g. "3.14.10".
36+
value: ${{ steps.venv.outputs.python-version }}
37+
38+
runs:
39+
using: composite
40+
steps:
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
43+
with:
44+
# The newest uv whose checksum ships inside the pinned setup-uv, so
45+
# the binary is verified against the SHA-pinned action itself. The uv
46+
# release determines the newest patch of each CPython series, so
47+
# bumping the setup-uv SHA also moves the CPython patch versions.
48+
version: "latest-known"
49+
enable-cache: false
50+
# Some callers (e.g. release verification) have no checkout.
51+
ignore-empty-workdir: true
52+
53+
- name: Install Python and create venv
54+
id: venv
55+
shell: bash --noprofile --norc -euo pipefail {0}
56+
env:
57+
PY_REQUEST: ${{ inputs.python-version }}
58+
VENV_DIR: ${{ inputs.venv }}
59+
# A per-job install directory ensures the newest patch known to the
60+
# pinned uv is used, never an older interpreter left on a persistent
61+
# self-hosted runner.
62+
UV_PYTHON_INSTALL_DIR: ${{ runner.temp }}/setup-hardened-python/interpreters
63+
UV_NO_CONFIG: "1"
64+
run: |
65+
uv python install --no-bin --no-registry "${PY_REQUEST}"
66+
base="$(uv python find --managed-python --no-project "${PY_REQUEST}")"
67+
venv="${VENV_DIR}"
68+
if [[ -z "${venv}" ]]; then
69+
# A fresh directory per call, so a second call in the same job
70+
# (e.g. build-wheel.yml) leaves the first venv intact.
71+
venv="$("${base}" -c 'import sys, tempfile; print(tempfile.mkdtemp(prefix="venv-", dir=sys.argv[1]))' "${RUNNER_TEMP}")"
72+
fi
73+
# The stdlib venv seeds pip from the interpreter's bundled wheel, so
74+
# nothing is downloaded before the ssl check below.
75+
"${base}" -m venv --clear "${venv}"
76+
if [[ "${RUNNER_OS}" == Windows ]]; then
77+
py="${venv}/Scripts/python.exe"
78+
else
79+
py="${venv}/bin/python"
80+
fi
81+
# Let the interpreter report native absolute paths (Windows included).
82+
python_path="$("${py}" -c 'import sys; print(sys.executable)')"
83+
"${py}" -c 'import os, sys; print(os.path.dirname(sys.executable))' >> "${GITHUB_PATH}"
84+
{
85+
echo "python-path=${python_path}"
86+
echo "python-version=$("${py}" -c 'import platform; print(platform.python_version())')"
87+
} >> "${GITHUB_OUTPUT}"
88+
89+
- name: Check Python interpreter is patched (CVE-2026-115557)
90+
# Runs the venv's python through the PATH entry added above.
91+
shell: python {0}
92+
env:
93+
PYTHON: ${{ steps.venv.outputs.python-path }}
94+
run: |
95+
import os
96+
import platform
97+
import sys
98+
99+
if os.path.normcase(sys.executable) != os.path.normcase(os.environ["PYTHON"]):
100+
print(f"::error::PATH resolves python to {sys.executable}, not the venv interpreter {os.environ['PYTHON']}.")
101+
sys.exit(1)
102+
103+
FIXED = {(3, 11): 18, (3, 12): 16, (3, 13): 18, (3, 14): 10, (3, 15): 2}
104+
v = sys.version_info
105+
series = (v.major, v.minor)
106+
name = f"{v.major}.{v.minor}"
107+
full = platform.python_version()
108+
print("sys.version:", sys.version)
109+
if series in FIXED:
110+
floor = f"{name}.{FIXED[series]}"
111+
if v.micro < FIXED[series]:
112+
print(f"::error::Python {full} is older than {floor}, the first {name} release whose ssl module rejects the compromised eMudhra CA keys (CVE-2026-115557).")
113+
sys.exit(1)
114+
print(f"Python {full}: ssl module carries the fix (first fixed: {floor}).")
115+
else:
116+
# Fail closed: a series is only accepted once its fixed release is listed.
117+
print(f"::error::Python {full}: no {name} release is known to reject the compromised eMudhra CA keys (CVE-2026-115557).")
118+
sys.exit(1)
119+
120+
- name: Update pip
121+
shell: bash --noprofile --norc -xeuo pipefail {0}
122+
env:
123+
PYTHON: ${{ steps.venv.outputs.python-path }}
124+
run: |
125+
"${PYTHON}" -m pip install -U pip

0 commit comments

Comments
 (0)