Current getchainstates
RPC returns “normal” and “snapshot” fields which are not ideal because it requires new “normal” and “snapshot” terms to be defined, and the definitions are not really consistent with internal code. (In the RPC interface, the “snapshot” chainstate becomes the “normal” chainstate after it is validated, while in internal code there is no “normal chainstate” and the “snapshot chainstate” is still called that temporarily after it is validated).
The current getchainstates
RPC is also awkward to use if you to want information about the most-work chainstate, because you have to look at the “snapshot” field if it exists, and otherwise fall back to the “normal” field.
Fix these issues by having getchainstates
just return a flat list of chainstates ordered by work, and adding a new chainstate “validated” field alongside the existing “snapshot_blockhash” field so it is explicit if a chainstate was originally loaded from a snapshot, and whether the snapshot has been validated.
This change was motivated by comment thread in #28562 (review)