Closes #26362
This continues the work that was started with #26426. It fixes the overflow issue by switching most of the values tracked in the index from historical totals to values per block. The only effect of this is that it requires iterating over all the entries to get to these historical values, however nothing changes for the capabilities of the RPCs we have today because the switched values were always report per block and the totals were used in concepts like #19792.
The change requires a rebuild of the index. Because of this, the PR introduces the concept of versioning to indexes and I am looking for feedback on the approach here. If an outdated version is detected the node won’t start until the user has removed the index manually or start without the option. This should prevent unwanted data loss for the user.
Ideally the approach chosen here should be compatible with any future cases where we require an index to upgrade. The most recently such a scenario was discussed in #28241. I am currently convinced that a different approach would be a better fit there, however the discussion is still in the early stages.
This PR also does quite a bit of renaming, reorgs some lines and adds some white space. All of this made it easier for me to work with the code.