Closed sgerogia closed 2 years ago
As we can't query for supply at a certain height, going with the second approach seems better.
Considering cosmos-hub inflation as 14% i.e. 0.038% per day, for the cached endpoint to be reliable enough that the supply difference isn't more than one day's minted tokens, supply/cachedSupply should not be greater than 1.00038
Inflation can be fetched from /liquidity/cosmos/mint/v1beta1/inflation
CC: @gamarin2
The current version of the
cached/cosmos/bank/v1beta1/supply
endpoint is a cached version (i.e. approximation) of the original value (liquidity/cosmos/bank/v1beta1/supply
)The current int. test takes a simple approach of comparing the 2 endpoints 1-to-1. Due to timing and other factors, this always fails.
We need a better way of identifying if the cached endpoint returns the wrong results (i.e. it has not been updated in a while).
Some initial thoughts to start the investigation:
/liquidity
results. Does the Cosmos node endpoint allow for supply queries based on block height? How many blocks "behind" should the cached result be for us to consider it failed?CC @gamarin2 for comments