Skip to content

[Meta] Build & sync reliability: root cause of the stall, reproducible build, and the path to release #147

Description

@melvincarvalho

Purpose

Tracking issue for the build/sync modernization effort. It consolidates the root cause of the long-standing "won't compile / won't sync past the fork" problems, the fixes (already written as PRs), the release strategy, and live consensus-validation results. It cross-links the cluster of related issues so anyone landing on one of them finds the plan.

TL;DR

Root cause of the stall (the important part)

Same source, different compiler → different consensus result. Specifically, GCC 13+ at -O2 miscompiles BMW256 (part of the LYRA2REv2 hash chain), producing wrong PoW hashes for LYRA2REv2 blocks. The node then rejects valid blocks at the multi-algorithm activation (block 450,947) and stalls.

Community confirmation: builds work with default flags but break with -Ofast -march=native, which overrides the protective per-file -O1.

⚠️ Build with default optimization. Do NOT use -Ofast or -march=native — they re-break the LYRA2REv2 hash and reintroduce the stall.

The fixes (open PRs)

PR Fixes Notes
#138 Ubuntu 22.04/24.04 build (Boost 1.74, BDB, blake2, placeholders) clean; supersedes #144
#142 GCC-13 BMW256/LYRA2REv2 miscompile (-O1 on the hash files) the stall fix; field-proven ~1 year
#146 OpenSSL 3.x lax DER signature parsing (stall at 605,359) field-proven; bespoke parser to be hardened
#144 blake2 alignment redundant — already in #138; can be closed

Strategy

  1. Pin a reproducible build on Ubuntu 24.04 LTS. A settled toolchain whose consensus-affecting bugs are already fixed; the resulting binary also runs on 22.04 / 26.04. Newer toolchains carry higher consensus-miscompile risk for this old code, so we deliberately do not chase the newest OS for the canonical build.
  2. Consensus-validate every build by full reindex against the existing chain — building is not the same as correct.
  3. Release prebuilt binaries / AppImage so users need not compile — follow-up.
  4. 26.04 / Boost 1.90 native — separate experimental track (Boost 1.90 removed copy_option and asio resolver::query; needs source modernization).

Validation status (live)

Reindexing the chain with a clean 24.04 build of #138 + #142 + #146:

  • Crossed block 450,947 (LYRA2REv2 activation) clean — the historical stall point — and kept going.
  • Zero validation errors so far (currently ~500k and climbing).
  • Continuing to tip for full structural confirmation.

Phased plan

  • Phase 1 — match the network: reproducible 24.04 build, reindex-validated. (in progress — passing)
  • Phase 2 — polish: add a startup PoW known-answer self-test (catches any future miscompile, any algorithm, regardless of compiler); replace Fix OpenSSL 3.x signature verification failure #146's bespoke DER parser with Bitcoin Core's audited ecdsa_signature_parse_der_lax; split/clean the PRs.
  • Phase 3 — 26.04 native + tagged release with binaries.

Related issues

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildCompilation / toolchain failuresconsensusSync, PoW, or block-validation correctnessdocumentationDocumentationpriority: highBlocker: won't build or won't sync

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions