Skip to content

Fix: [for cherry-picking] Moved descriptor network validation ahead of #1987

Fix: [for cherry-picking] Moved descriptor network validation ahead of

Fix: [for cherry-picking] Moved descriptor network validation ahead of #1987

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
# Every pull request, not only those based on `main`. A stacked PR targets
# the branch below it, and `branches: [main]` excluded those by
# construction -- five open PRs had never been built or tested, while
# reporting no failing checks, which reads exactly like green.
branches: ['**']
# Bounded because the trigger above is wider: a superseded pull-request run is
# cancelled when a newer commit lands on the same PR.
#
# `main` pushes are put in a group of their own, keyed by `run_id`, rather than
# relying on `cancel-in-progress: false`. That flag only protects a run that is
# already executing: with a shared group, a `main` run that is still *pending*
# behind an in-progress one is cancelled when a third push arrives, and its
# commit then has no CI record at all. A unique group per run means `main`
# pushes never queue against each other and so are never cancelled.
concurrency:
group: ci-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Fast gate: the only required-status job set for pull requests. Pure Rust and
# default features only -- no libboost/cmake install, no kernel build. The
# expensive or C++-building lanes (full-node feature set, benches, fuzz,
# nightly dependency/feature matrices, kernel oracle) live in main.yml and run
# on `main` pushes only.
env:
CARGO_TERM_COLOR: never
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
# Feature set for the full dependency-graph deny check: all four storage
# backends plus the bitcoinkernel script-verification engine. cargo-deny
# resolves metadata without compiling, so checking the full graph costs no
# C++ toolchain here.
FULL_NODE_FEATURES: "rocksdb,fjall,redb,mdbx,kernel"
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@a5f673d0ba8626c3977bb416a1612774bc82181b # 1.95.0
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@a5f673d0ba8626c3977bb416a1612774bc82181b # 1.95.0
with:
components: clippy
- uses: Swatinem/rust-cache@49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c # v2
# Pure-Rust clippy gate with -D warnings. consensus and node have
# `kernel` in their per-crate defaults, which would pull in the C++
# libbitcoinkernel build (cmake + libboost-dev); exclude them from the
# workspace-wide pass and lint them separately with --no-default-features
# so the PR gate needs no C++ toolchain install.
- run: |
cargo clippy --workspace --all-targets \
--exclude bitcoin-rs-consensus --exclude bitcoin-rs-node \
-- -D warnings
# consensus without kernel: --all-targets compiles its unit tests
# (bip30/bip34/bip112/bip113/bip141/bip143 modules in src/),
# integration tests (vectors, coinbase_amount), and benches.
# Previously invisible to the hook lanes: the workspace-wide pass
# would either fail (no cmake for kernel) or the crate was excluded
# entirely, leaving its test-target lints unchecked.
cargo clippy -p bitcoin-rs-consensus \
--no-default-features --all-targets -- -D warnings
# node without kernel: add back fjall and zmq (the pure-Rust
# defaults from bin/bitcoin-rs) so the crate and its test/bench
# targets compile and are linted.
cargo clippy -p bitcoin-rs-node \
--no-default-features --features fjall,zmq --all-targets -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@a5f673d0ba8626c3977bb416a1612774bc82181b # 1.95.0
- uses: Swatinem/rust-cache@49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c # v2
# Pure-Rust test gate: each workspace member tested with its own default
# features minus kernel. Deliberately no apt step -- the default path
# needs no CMake/Boost toolchain; the kernel engine is opt-in and
# exercised only by the main-only lanes in main.yml. consensus and node
# are excluded from the workspace pass (their defaults include kernel)
# and tested separately with --no-default-features.
- run: |
cargo test --workspace --no-fail-fast \
--exclude bitcoin-rs-consensus --exclude bitcoin-rs-node
cargo test -p bitcoin-rs-consensus --no-default-features --no-fail-fast
cargo test -p bitcoin-rs-node \
--no-default-features --features fjall,zmq --no-fail-fast
# Isolated so node's default `zmq` feature cannot unify this package on.
- run: cargo test -p bitcoin-rs-rpc --no-default-features --no-fail-fast
# Node / binary tests run with the full-node backend set, minus the
# kernel engine: the kernel builds from C++ (cmake + libboost-dev),
# which this job deliberately does not install. Kernel-gated bin tests
# run in the main-only `full-node` lane, and the deny job still audits
# the full graph including kernel. -p is required because
# `--workspace --features` silently ignores --features in a virtual
# workspace (no root [package] section in the top-level Cargo.toml).
- run: |
cargo test -p bitcoin-rs --no-fail-fast \
--no-default-features --features "rocksdb,fjall,redb,mdbx"
bench-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@a5f673d0ba8626c3977bb416a1612774bc82181b # 1.95.0
- uses: Swatinem/rust-cache@49a0bdc70d2e1b713ca9e2869b211fcce03d3c1c # v2
# The kernel engine is built from C++ (cmake + libboost-dev); the default
# feature set now includes it, so every production lane installs the
# prerequisites up front.
- run: sudo apt-get update && sudo apt-get install -y libboost-dev cmake
- run: |
cargo bench -p bitcoin-rs --no-run \
--no-default-features --features "${FULL_NODE_FEATURES}"
# Crate-level UTXO bench target is unreachable from -p bitcoin-rs; compile
# the production-allocator benchmark so bench breakage is visible to CI.
- run: cargo bench -p bitcoin-rs-utxo --no-run
# Candidate assembly is crate-level, same as the UTXO commit bench.
- run: cargo bench -p bitcoin-rs-mining --no-run --bench candidate
# The chainstate replay gate is an explicit harness: compile it on every
# PR, while measured executions remain release/PR evidence.
- run: |
cargo bench -p bitcoin-rs-node --no-run \
--no-default-features --features fjall --bench chainstate_journal
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: EmbarkStudios/cargo-deny-action@b66acf5e9fe20f8aba065be86778a8a4c846f902 # v2
with:
rust-version: "1.95.0"
# Check the full dependency graph (all backends + kernel).
# cargo-deny resolves metadata without compiling, so this costs no
# C++ toolchain. The opt-in kernel/full-backend graph is also
# audited by the main-only `deny-full` lane in main.yml.
arguments: --workspace --no-default-features --features ${{ env.FULL_NODE_FEATURES }}
# Comparator campaign behavioral tests and the C150/Cmodern corpus freeze.
# Pure Python, self-contained -- no bitcoind, no external services. The
# comparator tests use typing.TypeIs (Python 3.13+); actions/setup-python
# downloads the runtime from GitHub's release hosting, which is a
# first-party action but network-dependent.
comparator-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.13"
- run: |
cd tools/benchmark-campaign
for f in test_*.py; do python3 "$f" || exit 1; done
- run: python3 tools/campaign-corpus/test_corpus.py