-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Summary
Binaries compiled from source (master branch) fail to sync past block 450,947 with PoW validation errors, while the official v0.9.7.2 release binary syncs successfully.
Environment
- OS: Ubuntu 22.04 / 24.04
- Compiler: GCC 11+
- OpenSSL: 3.0.x
- Boost: 1.74+
Reproduction Steps
- Build from master branch (with PR Fix build on Ubuntu 22.04 and 24.04 (GCC 11+, Boost 1.74+) #138 fixes for Blake2 alignment and Boost placeholders)
- Start
bitmarkdand let it sync - Observe failure at block 450,947
Error Details
UpdateTip: new best=d4b12e844971df57d6e1017e1c0c191f2e2c31175ee0d63313142754393a8956 height=450946 log2_work=72.842976 tx=1090252 date=1528347329 progress=0.031011 nbits=453792464 algo=0
ProcessBlock: ACCEPTED
ERROR: CheckProofOfWork() : hash doesn't match nBits (hash is dd64d857462cf74a732c555b70f36efb82691956d9cb600b8f81df73760fa267, nbits is 0000003e7fc10000...
ERROR: CheckBlock() : proof of work failed
- Block 450,946 (algo=0, Scrypt) validates successfully
- Block 450,947 (should be algo=5, Lyra2REv2) fails
- The computed hash has no leading zeros - suggesting wrong hash algorithm
Investigation Findings
Official Binary Works
The official v0.9.7.2 binary (Ubuntu 18.04, OpenSSL 1.0.2n) syncs past Fork #1:
height=450947 nbits=490635201 algo=5 ✓
height=450948 nbits=490635201 algo=5 ✓
...continuing to 668,000+
Code Comparison
Compared v0.9.7.2 tag with current master:
BLOCK_VERSION_ALGOmask: identical(7 << 9)GetAlgo()function: identicalGetPoWHash()function: identicalCheckProofOfWork(): identical
The only consensus-related changes are:
- Fork2 functions commented out (March 2021)
- VARIANT flags added to block version (bits 13-14)
- Neither should affect blocks before 511,111
Related Issues
- bitmarkd compiled from source doesn't sync after block 450627 #54 - "bitmarkd compiled from source doesn't sync after block 450627" (2018)
- Bitmark doesn't sync after block 518192 #87 - "Bitmark doesn't sync after block 518192" (2018)
Potential Causes
- OpenSSL 1.1+ incompatibility - BIGNUM became opaque structure
- Compiler optimization differences - GCC 11+ vs GCC 7.x
- Undefined behavior - code that worked on older compilers
- Hash function library differences - sphlib, Lyra2, etc.
Proposed Solutions
- Add debug logging to trace algo detection and hash computation
- Build in Ubuntu 16.04/18.04 Docker with OpenSSL 1.0
- Identify specific code causing different behavior
- Create compatibility layer for OpenSSL 1.1+
Questions
- Was the official v0.9.7.2 binary built from exactly commit 79262c2?
- Are there any unpublished patches in the release binaries?
- Has anyone successfully built from source on modern systems?
/cc @dbkeys @piratelinux
Metadata
Metadata
Assignees
Labels
No labels