mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
The height a cert certifies is carried by the cert. It was being taken from the top of whatever the finalizing call happened to accept, which is zero for a cert about a block already held — the ordinary case. Retention over the durable store is ordered by height, so a store keyed at zero has no order and answers for no height: the serve path finds nothing and pairs each block with an empty cert, which a node behind the tip can neither accept nor reject. The in-memory window covers this until a restart drops it, leaving the durable height as the only route back for a lagging node. The two tests that already covered this store call persistServedCert directly and supply the height, so they hold whatever the caller computes. The new test drives applyBranchFinalization with an empty accept plan and asserts the persisted height equals the cert's; it fails without this change. Co-authored-by: Hanzo Dev <[email protected]>