Skip to content

Commit a46dd15

Browse files
authored
Release 1.222.0
See release notes.
2 parents dffc3cb + 797c7eb commit a46dd15

File tree

3,299 files changed

+418444
-70283
lines changed

Some content is hidden

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

3,299 files changed

+418444
-70283
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[build]
2+
rustdocflags = ["--cfg", "docsrs", "-D", "warnings"]
3+
14
[target.'cfg(all())']
25
rustflags = [
36
# https://rust-lang.github.io/rust-clippy/master/index.html#drop_non_drop

.codespellrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
[codespell]
55
# Comma-separated list of words to ignore
6-
ignore-words-list = ACN,ALO,Alo,BadAloPx,arange,crate,datas,deques,disjointness,HIGHTER,Implementors,ot,pre,ser,socio-economic,Superseed,SUPERSEED,zar
6+
ignore-words-list = ACN,ALO,Alo,BadAloPx,CapTable,arange,crate,datas,deques,disjointness,HIGHTER,Implementors,ot,pre,ser,socio-economic,Superseed,SUPERSEED,trough,usIn,zar

.config/nextest.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ test-group = 'serial-tests'
1111
[[profile.default.overrides]]
1212
filter = 'test(test_order_book)'
1313
slow-timeout = { period = "300s" }
14+
15+
# Websocket tests can be flaky due to timing on low-spec runners, give them extra retries
16+
[[profile.default.overrides]]
17+
filter = 'binary(websocket)'
18+
retries = 3

.docker/DockerfileUbuntu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
# Remove the image
1515
# docker image rm nautilus-dev
1616

17-
FROM ubuntu:22.04
17+
# Pin to specific digest for supply-chain security (ubuntu:22.04 as of 2025-11-29)
18+
FROM ubuntu@sha256:104ae83764a5119017b8e8d6218fa0832b09df65aae7d5a6de29a85d813da2fb
1819

1920
# Set environment variables
2021
ENV DEBIAN_FRONTEND=noninteractive
2122
ENV BUILD_MODE=release
2223
ENV RUST_BACKTRACE=1
23-
ENV CARGO_INCREMENTAL=1
24+
ENV CARGO_INCREMENTAL=0
2425
ENV CC="clang"
2526
ENV CXX="clang++"
2627

.docker/nautilus_trader.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM python:3.13-slim AS base
1+
# Pin to specific digest for supply-chain security (python:3.13-slim as of 2025-11-29)
2+
FROM python@sha256:326df678c20c78d465db501563f3492d17c42a4afe33a1f2bf5406a1d56b0e86 AS base
23
ENV PYTHONUNBUFFERED=1 \
34
PYTHONDONTWRITEBYTECODE=1 \
45
PIP_NO_CACHE_DIR=off \

.github/OVERVIEW.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,43 @@ CI/CD, testing, publishing, and automation within the NautilusTrader repository.
1616

1717
## Workflows (`.github/workflows`)
1818

19-
- **build.yml**: runs pre-commit, cargo-deny security checks, Rust tests, Python tests, builds wheels on multiple platforms, and uploads wheel artifacts.
20-
- **build-docs.yml**: dispatches a repository event to trigger the documentation build on `master` and `nightly` pushes.
21-
- **codeql-analysis.yml**: schedules and runs CodeQL security scans for Python and Rust code on pull requests to develop and periodically via cron.
22-
- **coverage.yml**: (optional) coverage report generation for the `nightly` branch.
23-
- **docker.yml**: builds and pushes Docker images (`nautilus_trader`, `jupyterlab`) for `master` and `nightly` branches using Buildx and QEMU.
24-
- **nightly-merge.yml**: automatically merges `develop` into `nightly` when the latest `develop` workflows succeed.
25-
- **performance.yml**: runs Rust/Python performance benchmarks on the `nightly` branch and reports to CodSpeed.
19+
- **build.yml**: main CI pipeline - pre-commit, cargo-deny, Rust tests, Python tests, wheel builds, and artifact uploads.
20+
- **build-v2.yml**: CI pipeline for the v2 Rust-native system.
21+
- **build-docs.yml**: dispatches documentation build on `master` and `nightly` pushes.
22+
- **cli-binaries.yml**: builds and publishes CLI binaries for multiple platforms.
23+
- **codeql-analysis.yml**: CodeQL security scans for Python and Rust on PRs and via cron.
24+
- **copilot-setup-steps.yml**: environment setup for GitHub Copilot coding agent.
25+
- **coverage.yml**: coverage report generation for the `nightly` branch.
26+
- **docker.yml**: builds and pushes Docker images (`nautilus_trader`, `jupyterlab`) using Buildx and QEMU.
27+
- **nightly-merge.yml**: auto-merges `develop` into `nightly` when CI succeeds.
28+
- **performance.yml**: Rust/Python benchmarks on `nightly`, reporting to CodSpeed.
29+
- **trigger-reindexing.yml**: triggers documentation reindexing for search.
2630

2731
## Security
2832

29-
- **CODEOWNERS**: Critical infrastructure files (workflows, dependencies, build configs, scripts) require Core team review before merge. This prevents unauthorized supply chain modifications and ensures all sensitive changes receive security review.
30-
- **Branch protection**: The develop branch requires PR reviews with CODEOWNERS enforcement and passing CI checks. External PRs must receive Core team approval before merge, while admin bypass is enabled for maintainer flexibility.
31-
- **cargo-deny**: Rust dependency auditing for security advisories (RUSTSEC/GHSA), license compliance (LGPL-3.0 compatibility), banned crates, and supply chain integrity. Runs in CI to block vulnerable or non-compliant dependencies. Configuration in `deny.toml`.
32-
- **Build attestations**: All published artifacts (wheels and source distributions) include cryptographic SLSA build provenance attestations. These prove artifacts were built by the official GitHub Actions workflow and link each artifact to a specific commit SHA, enabling users to verify authenticity via `gh attestation verify`. Attestations are generated for all releases, nightly builds, and develop builds published to PyPI, GitHub Releases, and the Nautech Systems package index.
33-
- **Code scanning**: CodeQL is enabled for continuous security analysis of Python and Rust code. Scans run on all PRs to develop and weekly via cron schedule.
34-
- **Immutable action pinning**: All third-party actions are pinned to specific commit SHAs to guarantee immutability and reproducibility.
35-
- **Hardened runners**: Most workflows employ `step-security/harden-runner` with `egress-policy: audit` to reduce attack surface and monitor outbound traffic.
36-
- **Secret management**: No secrets or credentials are stored in the repo. AWS, PyPI, and other credentials are provided via GitHub Secrets and injected at runtime.
33+
### Access controls
34+
35+
- **CODEOWNERS**: Critical infrastructure files (workflows, dependencies, build configs, scripts) require Core team review before merge.
36+
- **Branch protection**: The develop branch requires PR reviews with CODEOWNERS enforcement and passing CI checks. External PRs must receive Core team approval before merge.
37+
- **Least-privilege tokens**: Workflows default `GITHUB_TOKEN` to `contents: read, actions: read` and selectively elevate scopes only for jobs that need them.
38+
- **Secret management**: No secrets or credentials are stored in the repo. Credentials are provided via GitHub Secrets and injected at runtime.
39+
40+
### Dependency security
41+
42+
- **cargo-deny**: Rust dependency auditing for security advisories (RUSTSEC/GHSA), license compliance, banned crates, and supply chain integrity. Configuration in `deny.toml`.
3743
- **Dependency pinning**: Key tools (pre-commit, Python versions, Rust toolchain, cargo-nextest) are locked to fixed versions or SHAs.
38-
- **Least-privilege tokens**: Workflows default the `GITHUB_TOKEN` to
39-
`contents: read, actions: read` and selectively elevate scopes (e.g.
40-
`contents: write`) only for the jobs that need to tag a release or upload
41-
assets. This follows the principle of least privilege and limits blast
42-
radius if a job is compromised.
43-
- **Caching**: Caches for sccache, pip/site-packages, pre-commit, and test data speed up workflows while preserving hermetic builds.
44+
- **Code scanning**: CodeQL is enabled for continuous security analysis of Python and Rust code on all PRs and weekly via cron.
45+
46+
### Build integrity
47+
48+
- **Build attestations**: All published artifacts include cryptographic SLSA build provenance attestations, linking each artifact to a specific commit SHA. Verify via `gh attestation verify`.
49+
- **Immutable action pinning**: All third-party GitHub Actions are pinned to specific commit SHAs.
50+
- **Docker image pinning**: Base images in Dockerfiles are pinned to SHA256 digests to prevent supply-chain attacks via tag mutation.
51+
- **Caching**: Caches for sccache, pip/site-packages, pre-commit, and test data speed up workflows while preserving hermetic (reproducible) builds.
52+
53+
### Runtime hardening
54+
55+
- **Hardened runners**: Most workflows employ `step-security/harden-runner` with `egress-policy: audit` to reduce attack surface and monitor outbound traffic.
4456

4557
### Allowed network endpoints
4658

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: cargo-tool-install
2+
description: Install a cargo tool with caching
3+
4+
inputs:
5+
tool-name:
6+
description: The cargo tool to install (e.g., cargo-deny, cargo-vet)
7+
required: true
8+
9+
outputs:
10+
version:
11+
description: The installed tool version
12+
value: ${{ steps.get-version.outputs.version }}
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Get tool version
18+
id: get-version
19+
shell: bash
20+
env:
21+
TOOL_NAME: ${{ inputs.tool-name }}
22+
run: |
23+
VERSION=$(bash scripts/cargo-tool-version.sh "$TOOL_NAME")
24+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
25+
echo "TOOL_VERSION=$VERSION" >> "$GITHUB_ENV"
26+
echo "TOOL_NAME=$TOOL_NAME" >> "$GITHUB_ENV"
27+
28+
- name: Get Rust toolchain version
29+
shell: bash
30+
run: echo "TOOLCHAIN=$(bash scripts/rust-toolchain.sh)" >> "$GITHUB_ENV"
31+
32+
# https://github.com/actions-rust-lang/setup-rust-toolchain
33+
- name: Set up Rust toolchain
34+
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
35+
with:
36+
toolchain: ${{ env.TOOLCHAIN }}
37+
override: true
38+
39+
# https://github.com/actions/cache
40+
- name: Cache tool binary
41+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
42+
with:
43+
path: ${{ runner.tool_cache }}/${{ inputs.tool-name }}
44+
key: ${{ inputs.tool-name }}-bin-${{ env.TOOL_VERSION }}
45+
46+
- name: Add tool to PATH
47+
shell: bash
48+
env:
49+
TOOL_CACHE: ${{ runner.tool_cache }}
50+
run: echo "$TOOL_CACHE/$TOOL_NAME/bin" >> "$GITHUB_PATH"
51+
52+
- name: Install tool
53+
shell: bash
54+
env:
55+
TOOL_CACHE: ${{ runner.tool_cache }}
56+
run: |
57+
cargo install --locked \
58+
--root "$TOOL_CACHE/$TOOL_NAME" \
59+
--version "$TOOL_VERSION" \
60+
"$TOOL_NAME"

.github/actions/common-setup/action.yml

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: Free disk space
1010
required: false
1111
default: "false"
12+
build-type:
13+
description: Type of build (pre-commit, test, release)
14+
required: false
15+
default: "release"
1216

1317
runs:
1418
using: "composite"
@@ -20,20 +24,24 @@ runs:
2024
# https://github.com/jlumbroso/free-disk-space
2125
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
2226
with:
23-
tool-cache: true
27+
tool-cache: ${{ inputs.build-type != 'pre-commit' }}
2428
android: true
2529
dotnet: true
26-
haskell: true
27-
large-packages: true
30+
haskell: ${{ inputs.build-type != 'pre-commit' }}
31+
large-packages: ${{ inputs.build-type != 'pre-commit' }}
2832
docker-images: true
29-
swap-storage: true
33+
swap-storage: ${{ inputs.build-type != 'pre-commit' }}
3034

3135
- name: Free disk space (Windows)
3236
if: inputs.free-disk-space == 'true' && runner.os == 'Windows'
3337
shell: bash
38+
env:
39+
BUILD_TYPE: ${{ inputs.build-type }}
3440
run: |
3541
rm -rf "/c/Program Files/dotnet"
36-
rm -rf "/c/Program Files (x86)/Microsoft Visual Studio/2019"
42+
if [ "$BUILD_TYPE" != "pre-commit" ]; then
43+
rm -rf "/c/Program Files (x86)/Microsoft Visual Studio/2019"
44+
fi
3745
3846
- name: Install runner dependencies
3947
if: runner.os == 'Linux'
@@ -42,19 +50,49 @@ runs:
4250
sudo apt-get update -o Acquire::Retries=5
4351
sudo apt-get install -y curl clang git make pkg-config ripgrep -o Acquire::Retries=5
4452
sudo apt-get install -y python3-dev libpython3-dev -o Acquire::Retries=5
45-
sudo apt-get install -y capnproto libcapnp-dev -o Acquire::Retries=5
4653
sudo apt-get clean
4754
sudo rm -rf /var/lib/apt/lists/*
4855
49-
- name: Install capnproto (macOS)
56+
- name: Install capnp and ripgrep (macOS)
5057
if: runner.os == 'macOS'
5158
shell: bash
5259
run: |
5360
brew update || { sleep 5; brew update; }
5461
brew install capnp ripgrep || { sleep 5; brew install capnp ripgrep; }
5562
brew cleanup
5663
57-
- name: Install capnproto (Windows)
64+
- name: Set Cap'n Proto install prefix (Linux)
65+
if: runner.os == 'Linux'
66+
shell: bash
67+
run: |
68+
echo "CAPNP_PREFIX=$GITHUB_WORKSPACE/.cache/capnp" >> $GITHUB_ENV
69+
echo "$GITHUB_WORKSPACE/.cache/capnp/bin" >> $GITHUB_PATH
70+
71+
- name: Get Linux version
72+
if: runner.os == 'Linux'
73+
id: linux-version
74+
shell: bash
75+
run: echo "release=$(lsb_release -rs)" >> "$GITHUB_OUTPUT"
76+
77+
- name: Get capnp version from capnp-version
78+
shell: bash
79+
run: |
80+
echo "CAPNP_VERSION=$(cat capnp-version)" >> $GITHUB_ENV
81+
82+
- name: Cache Cap'n Proto (Linux)
83+
if: runner.os == 'Linux'
84+
id: cache-capnp
85+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
86+
with:
87+
path: ${{ github.workspace }}/.cache/capnp
88+
key: capnp-linux-${{ steps.linux-version.outputs.release }}-${{ env.CAPNP_VERSION }}-${{ runner.arch }}
89+
90+
- name: Install capnp
91+
if: runner.os == 'Linux'
92+
shell: bash
93+
run: bash scripts/install-capnp.sh
94+
95+
- name: Install capnp (Windows)
5896
if: runner.os == 'Windows'
5997
shell: bash
6098
run: |
@@ -81,13 +119,14 @@ runs:
81119
82120
# https://github.com/actions-rust-lang/setup-rust-toolchain
83121
- name: Set up Rust toolchain
84-
uses: actions-rust-lang/setup-rust-toolchain@ac90e63697ac2784f4ecfe2964e1a285c304003a # v1.14.1
122+
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
85123
with:
86124
toolchain: ${{ env.TOOLCHAIN }}
87125
components: clippy,rustfmt
88126
override: true
89127

90128
- name: Install cargo-nextest
129+
if: inputs.build-type != 'pre-commit'
91130
# https://github.com/taiki-e/install-action # v2.53.2
92131
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb
93132
with:
@@ -96,6 +135,7 @@ runs:
96135
# > --------------------------------------------------
97136
# > sccache
98137
- name: Set sccache env vars (common)
138+
if: inputs.build-type != 'pre-commit'
99139
shell: bash
100140
run: |
101141
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
@@ -109,38 +149,26 @@ runs:
109149
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
110150
111151
- name: Set sccache env vars (non-Windows)
112-
if: runner.os != 'Windows'
152+
if: runner.os != 'Windows' && inputs.build-type != 'pre-commit'
113153
shell: bash
114154
run: |
115-
echo "SCCACHE_DIR=${{ github.workspace }}/.cache/sccache" >> $GITHUB_ENV
155+
echo "SCCACHE_DIR=$GITHUB_WORKSPACE/.cache/sccache" >> $GITHUB_ENV
116156
echo "CC=sccache clang" >> $GITHUB_ENV
117157
echo "CXX=sccache clang++" >> $GITHUB_ENV
118158
119159
- name: Set sccache env vars (Windows)
120-
if: runner.os == 'Windows'
160+
if: runner.os == 'Windows' && inputs.build-type != 'pre-commit'
121161
shell: bash
122162
run: |
123163
echo SCCACHE_DIR="C:\.cache\sccache" >> $GITHUB_ENV
124164
echo CMAKE_C_COMPILER_LAUNCHER=sccache >> $GITHUB_ENV
125165
echo CMAKE_CXX_COMPILER_LAUNCHER=sccache >> $GITHUB_ENV
126166
127-
- name: Cached sccache
128-
id: cached-sccache
129-
# https://github.com/actions/cache
130-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
131-
with:
132-
path: ${{ env.SCCACHE_DIR }}
133-
key:
134-
sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{
135-
hashFiles('**/Cargo.toml', '**/Cargo.lock', '**/uv.lock') }}
136-
restore-keys: |
137-
sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-
138-
sccache-${{ runner.os }}-${{ github.workflow }}-
139-
sccache-${{ runner.os }}-
140-
141167
- name: Run sccache
168+
if: inputs.build-type != 'pre-commit'
142169
# https://github.com/Mozilla-Actions/sccache-action
143170
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
171+
continue-on-error: true # Build continues without cache if sccache setup fails
144172

145173
# > --------------------------------------------------
146174
# > Python
@@ -160,10 +188,15 @@ runs:
160188
run: |
161189
echo "PYTHON_VERSION=$(bash scripts/python-version.sh)" >> $GITHUB_ENV
162190
191+
- name: Get pre-commit version
192+
shell: bash
193+
run: |
194+
echo "PRE_COMMIT_VERSION=$(bash scripts/pre-commit-version.sh)" >> $GITHUB_ENV
195+
163196
- name: Cache Python site-packages
164197
id: cached-site-packages
165198
# https://github.com/actions/cache
166-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
199+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
167200
with:
168201
path: ~/.local/lib/python${{ inputs.python-version }}/site-packages
169202
key: ${{ runner.os }}-${{ inputs.python-version }}-site-packages
@@ -172,7 +205,7 @@ runs:
172205
173206
- name: Install pre-commit
174207
shell: bash
175-
run: pip install pre-commit==4.2.0
208+
run: pip install pre-commit==${{ env.PRE_COMMIT_VERSION }}
176209

177210
# > --------------------------------------------------
178211
# > UV
@@ -183,7 +216,7 @@ runs:
183216
184217
- name: Install uv
185218
# https://github.com/astral-sh/setup-uv
186-
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
219+
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
187220
with:
188221
version: ${{ env.UV_VERSION }}
189222

@@ -193,19 +226,25 @@ runs:
193226
echo "UV_CACHE_DIR=$(uv cache dir)" >> $GITHUB_ENV
194227
195228
- name: Cached uv
229+
# Skip on macOS: hashFiles() broken in composite actions after Nov 20 runner update
230+
# See: https://github.com/actions/runner/issues/3765
231+
if: runner.os != 'macOS'
196232
id: cached-uv
197233
# https://github.com/actions/cache
198-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
234+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
199235
with:
200236
path: ${{ env.UV_CACHE_DIR }}
201237
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-uv-${{ hashFiles('**/uv.lock') }}
202238

203239
# > --------------------------------------------------
204240
# > pre-commit
205241
- name: Cached pre-commit
242+
# Skip on macOS: hashFiles() broken in composite actions after Nov 20 runner update
243+
# See: https://github.com/actions/runner/issues/3765
244+
if: runner.os != 'macOS'
206245
id: cached-pre-commit
207246
# https://github.com/actions/cache
208-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
247+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
209248
with:
210249
path: ~/.cache/pre-commit
211250
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

0 commit comments

Comments
 (0)