Currently IsValidPruningPoint does various checks to make sure that the proposed pruning point is the valid one.
This was done because finding the pruningPoint has been a costly affair at the time.
The downside is that this validation logic error-prone. It might be possible to construct such a block that fits all the validation requirements, but is not the pruning point expected by our node.
Since headersSelectedChainStore was introduced, finding the expected pruningPoint should be no harder then a binary search on the headers selected chain.
This should be done in a way that the day-to-day moving of the pruning point uses the same routine to calculate the pruning point.
Currently IsValidPruningPoint does various checks to make sure that the proposed pruning point is the valid one.
This was done because finding the pruningPoint has been a costly affair at the time. The downside is that this validation logic error-prone. It might be possible to construct such a block that fits all the validation requirements, but is not the pruning point expected by our node.
Since headersSelectedChainStore was introduced, finding the expected pruningPoint should be no harder then a binary search on the headers selected chain.
This should be done in a way that the day-to-day moving of the pruning point uses the same routine to calculate the pruning point.