perf(node): accelerate and harden mainnet block sync #492
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: never | |
| RUST_BACKTRACE: 1 | |
| CARGO_INCREMENTAL: 0 | |
| # Default storage features compatible with MSRV 1.95 + a standard Linux host. | |
| PORTABLE_FEATURES: "rocksdb,fjall,redb,mdbx,bitcoinconsensus" | |
| jobs: | |
| wallet-no-seckey: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| ! grep -r 'SecretKey\|secp256k1::Secret\|seckey' crates/wallet/src | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.95.0 | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.95.0 | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| # In a virtual workspace (no root [package]), `--features` flags are not | |
| # forwarded to library crates; use `-p bitcoin-rs` so the binary's feature | |
| # table propagates all backends to bitcoin-rs-node and its deps. | |
| - run: | | |
| cargo clippy -p bitcoin-rs --all-targets \ | |
| --no-default-features --features "${PORTABLE_FEATURES}" \ | |
| -- -D warnings | |
| # -p bitcoin-rs-node catches test-target lints invisible to the line above | |
| # (virtual workspace: -p bitcoin-rs does not forward features to node's own | |
| # test targets, so their lints are silently skipped without this step). | |
| cargo clippy -p bitcoin-rs-node --all-targets -- -D warnings | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.95.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| # Library unit tests run with each crate's own default features. | |
| - run: cargo test --workspace --no-fail-fast | |
| # Node / binary tests run with the full portable feature set. -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 "${PORTABLE_FEATURES}" | |
| bench-smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.95.0 | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| cargo bench -p bitcoin-rs --no-run \ | |
| --no-default-features --features "${PORTABLE_FEATURES}" | |
| # Crate-level bench targets are unreachable from -p bitcoin-rs; compile | |
| # them in both allocator configurations so bench-mimalloc breakage is | |
| # visible to CI. | |
| - run: cargo bench -p bitcoin-rs-coinstats -p bitcoin-rs-utxo --no-run | |
| - run: | | |
| cargo bench -p bitcoin-rs-coinstats -p bitcoin-rs-utxo --no-run \ | |
| --features bench-mimalloc | |
| deny: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| rust-version: "1.95.0" | |
| arguments: --workspace --no-default-features --features ${{ env.PORTABLE_FEATURES }} | |
| # Full kernel-build profile gate (plan 2026-06-10-001 R5): consensus parity | |
| # suite (committed fixture corpus, --include-ignored by design), the node | |
| # under the kernel engine, and clippy on both kernel-profile package roots. | |
| # Storage backend is rocksdb-only by CI wall-clock decision: the four-backend | |
| # storage-equivalence surface is already covered by the portable `test` job, | |
| # and the extra native backend builds (mdbx/fjall/redb) buy no kernel-specific | |
| # coverage here. `kernel` and `bitcoinconsensus` cannot share a binary | |
| # (overlapping native Core symbols), hence the isolated job. | |
| kernel-node: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: sudo apt-get update && sudo apt-get install -y libboost-dev cmake | |
| - uses: dtolnay/rust-toolchain@1.95.0 | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| cargo test -p bitcoin-rs-consensus --no-fail-fast \ | |
| --no-default-features --features kernel -- --include-ignored | |
| - run: | | |
| cargo test -p bitcoin-rs --no-fail-fast \ | |
| --no-default-features --features "rocksdb,kernel" | |
| - run: | | |
| cargo clippy -p bitcoin-rs --all-targets \ | |
| --no-default-features --features "rocksdb,kernel" \ | |
| -- -D warnings | |
| - run: | | |
| cargo clippy -p bitcoin-rs-consensus --all-targets \ | |
| --no-default-features --features kernel \ | |
| -- -D warnings |