Fix sync-freeze: backpressure, prune protection, eviction direction, bridge-repair + PoS header guard

Sync-freeze patch (original):
- Backpressure ceiling HEADER_FRONT_MAX_AHEAD=8000
- PruneHeaders protects live sync window (nProtectFloor)
- Hard-cap eviction from highest-height first
- Bridge-repair getheaders from connected tip via PathReachesChain

Additional fix:
- Skip PoW check on PoS headers (nonce=0) in AddHeaderNode
  Block 1026 is PoS but within the 0-9000 PoW range — old code
  rejected valid PoS headers and severed the chain at height 1025

Verified: from-zero no-snapshot sync reached block 17k+ past the
old 15k freeze zone. 132/132 unit tests pass.
This commit is contained in:
Sami Ahmed
2026-06-20 20:56:47 -07:00
parent 6b49dd9e62
commit 7ba8d8b8c9
2 changed files with 99 additions and 15 deletions
+1
View File
@@ -50,6 +50,7 @@ private:
void PruneHeaders();
bool AddHeaderNode(const CBlock& header, const uint256& hashHeader);
std::vector<uint256> GetDownloadPath(uint256 hashTip) const;
bool PathReachesChain(const std::vector<uint256>& vPath) const;
void ContinueHeaders(CNode* pfrom, const uint256& hashTip);
};