terra-money / fcd-classic

Terra ETL + RestFul API Server
https://fcd.terra.dev/swagger
MIT License
63 stars 42 forks source link

Incorrect uptime percent in Terra station #130

Closed StayHomeThereIsNoFrance closed 2 years ago

StayHomeThereIsNoFrance commented 3 years ago

Hi! Uptime percent in Terra Station looks incorrect.

For example MoonletWallet validator has 91% uptime image

from validatorDetails.ts

upTime: getOracleUptime(missedOracleVote)

Uptime shows only from oracle misses, and not for missed blocks. Why?

And oracle misses uptime percent looks incorrect too.

According to https://lcd.terra.dev/oracle/voters/terravaloper19xe62428tlfesdym0zn5wx9slyefqjp00r67kw/miss MoonletWallet has 9271 oracle misses.

According to https://lcd.terra.dev/oracle/parameters "slash_window": "432000"

Uptime percent should be 100% - 9271 / 432000 = 98%

Maybe problem is in config.ts?

// We can ORACLE_SLASH_WINDOW from {lcd}/oracle/parameters, but do this way because it's rare to be changed ORACLE_SLASH_WINDOW: parseInt(ORACLE_SLASH_WINDOW || '100800') || 100800

looks so: 100% - 9271/100800 = 91% as shown in Terra Station

hanjukim commented 2 years ago

Thank you. Oracle Slash Window variable was not set and it should be fixed now. We didn't included missed blocks since oracle is the main source of staking return.