Commit 49dfe24
fix: v32 — post-fast-sync catch-up + HBC admission + cache invariant
v32.1 — fast_sync re-verifies network tip before declaring complete.
Reads BEST_PEER_HEIGHT and live get_max_peer_height() each iteration and
takes max(); refuses to break the bulk loop while the actual peer-quorum
tip is still ahead. Prevents premature exit when the network advances
during a batch download.
v32.2 — chronic_stall handler uses adaptive bulk catch-up. When the gap
to peer-quorum tip exceeds 90 blocks, it requests sync_blocks(next,
next + min(gap, 1000)) instead of the fixed 90-block tip-recovery window.
Catch-up rate now scales with the gap rather than capping at 90 blocks
per cooldown.
v32.3 — production gate drives catch-up. When the per-slot production
gate blocks due to !node_synced and the quorum tip is more than 50 blocks
ahead, the gate sets CHRONIC_STALL_REQUESTED so the next chronic_stall
iteration triggers v32.2 bulk catch-up. 30 s per-trigger cooldown
prevents request storms.
v32.4 — admission no longer whitelists HBC sample signature formats. The
v31.7 prefix whitelist did not include the real producer-side format
(hybrid_p2p_bin), so every HeartbeatCommitment TX was rejected on
mempool admission and no HBC ever landed on-chain. Admission now keeps
only structural/DoS checks (size, merkle-proof depth, hex format);
signature-format dispatch and cryptographic verification stay in the
verify-stage path (verify_consensus_signature) and at the eligibility
gate (Phase 2A merkle replay + Dilithium verify).
v32.5 — cache_block_hash is called only after save_microblock succeeds,
not at verify success. The verify-stage cache write let uncommitted
view-change candidate hashes leak into the RAM cache; when apply
selected a different canonical block the cache no longer matched
RocksDB, and the next height's parent-hash check raised a false
hash_chain_break that wedged the verify pipeline (observed at h=25015
after 9 view-change rounds, with a 25 875 s verify_stuck on
verify:load_prev_block). Invariant after this commit:
RECENT_BLOCK_HASHES[h] == storage[h] for every cached h. The RocksDB-hit
backfill at the verify fallback is canonical by construction and is
retained.
Validation: cargo check + lib tests across qnet-integration (147/147),
qnet-consensus (73/73), qnet-state (32/32). 252 tests pass, 0
regressions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 93a7200 commit 49dfe24
3 files changed
Lines changed: 74 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
1346 | 1347 | | |
1347 | 1348 | | |
1348 | 1349 | | |
1349 | 1350 | | |
1350 | 1351 | | |
1351 | 1352 | | |
1352 | 1353 | | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
| 1354 | + | |
| 1355 | + | |
1356 | 1356 | | |
1357 | 1357 | | |
1358 | 1358 | | |
1359 | 1359 | | |
1360 | 1360 | | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | 1361 | | |
1370 | 1362 | | |
1371 | 1363 | | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1364 | + | |
1375 | 1365 | | |
1376 | 1366 | | |
1377 | 1367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2020 | 2020 | | |
2021 | 2021 | | |
2022 | 2022 | | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
2029 | 2027 | | |
2030 | 2028 | | |
2031 | 2029 | | |
| |||
2381 | 2379 | | |
2382 | 2380 | | |
2383 | 2381 | | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
2384 | 2386 | | |
2385 | 2387 | | |
2386 | 2388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17447 | 17447 | | |
17448 | 17448 | | |
17449 | 17449 | | |
17450 | | - | |
17451 | | - | |
| 17450 | + | |
| 17451 | + | |
| 17452 | + | |
| 17453 | + | |
| 17454 | + | |
| 17455 | + | |
| 17456 | + | |
| 17457 | + | |
| 17458 | + | |
| 17459 | + | |
| 17460 | + | |
| 17461 | + | |
| 17462 | + | |
| 17463 | + | |
| 17464 | + | |
| 17465 | + | |
17452 | 17466 | | |
17453 | 17467 | | |
17454 | 17468 | | |
| |||
18077 | 18091 | | |
18078 | 18092 | | |
18079 | 18093 | | |
18080 | | - | |
18081 | | - | |
| 18094 | + | |
| 18095 | + | |
| 18096 | + | |
| 18097 | + | |
| 18098 | + | |
| 18099 | + | |
18082 | 18100 | | |
18083 | | - | |
| 18101 | + | |
| 18102 | + | |
18084 | 18103 | | |
18085 | 18104 | | |
| 18105 | + | |
| 18106 | + | |
| 18107 | + | |
18086 | 18108 | | |
18087 | 18109 | | |
18088 | 18110 | | |
| |||
18641 | 18663 | | |
18642 | 18664 | | |
18643 | 18665 | | |
18644 | | - | |
18645 | | - | |
18646 | | - | |
| 18666 | + | |
| 18667 | + | |
| 18668 | + | |
| 18669 | + | |
| 18670 | + | |
18647 | 18671 | | |
18648 | 18672 | | |
18649 | 18673 | | |
| |||
18655 | 18679 | | |
18656 | 18680 | | |
18657 | 18681 | | |
| 18682 | + | |
| 18683 | + | |
| 18684 | + | |
| 18685 | + | |
| 18686 | + | |
| 18687 | + | |
| 18688 | + | |
| 18689 | + | |
| 18690 | + | |
| 18691 | + | |
| 18692 | + | |
| 18693 | + | |
| 18694 | + | |
| 18695 | + | |
| 18696 | + | |
| 18697 | + | |
| 18698 | + | |
| 18699 | + | |
| 18700 | + | |
| 18701 | + | |
| 18702 | + | |
| 18703 | + | |
| 18704 | + | |
| 18705 | + | |
| 18706 | + | |
| 18707 | + | |
18658 | 18708 | | |
18659 | 18709 | | |
18660 | 18710 | | |
| |||
0 commit comments