Bug Report
Setup
CometBFT version
main; v0.38.x-experimental
Have you tried the latest version: yes/no
yes
Config
Pruning is enabled.
What happened?
In the extreme case where pruning is triggered while the chain is at height 1 and the retain height is set to 1, no blocks can be pruned as they should not be. However, we still attempt to prune the state store and get an error that pruning failed.
What did you expect to happen?
If not blocks are pruned, there should be no attempt to prune the states.
How to reproduce it
The bug appeared in subsequent runs of the TestProvider test in http_test. The test added with the fix would fail if not for the changes fixing it.