While doing that I worked through a bug in the chain_state where following a reorg chain state for a header's parent was not found because the parent wasn't in the candidate chain. As a result I refactored chain state so that it would not require the candidate index but instead just drive off of parent pointers. This actually simplified some code and should have the same performance, since chasing parent pointers is just as efficient as sequential height increments with header pointer lookup.