Update active stake cache to use control table #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, active stake cache uses max(epoch_no) from existing tables to run delta cache on. But this may not always be accurate for pool and epoch, as during setup - values for epoch prior may not be available. Stake Snapshot Cache would provides data an epoch earlier to these tables, thus - relying on max(epoch_no) is no longer an accurate outcome.
Account's active stake cache does not require maintaining historical information and can be left as-is.
Motivation and context
Found recently that some of our instances reported empty array for pool_history endpoint. On verifying, found out epoch as well as pool cache tables could have missing entries due to our current mode of execution. This only started showing up recently on fresh instances restored via snapshot, wherein snapshot cache would fill entries prior to historical information is populated
How has this been tested?
On rdlrt2 instance