Skip to content

Commit

Permalink
remove latency api for validator address
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Sep 19, 2024
1 parent 1209a19 commit b2f7c67
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,6 @@ class ValidatorService(
}
}

// fun getBlockLatencyData(address: String, blockCount: Int) =
// getValidatorOperatorAddress(address)?.let { addr ->
// BlockProposerRecord.getRecordsForProposer(addr.operatorAddress, blockCount).let { res ->
// val average = res.map { it.blockLatency!! }.average()
// val data = res.associate { it.blockHeight to it.blockLatency!! }
// BlockLatencyData(addr.operatorAddress, data, average)
// }
// } ?: throw ResourceNotFoundException("Invalid validator address: '$address'")

private fun getLatestHeight() = SpotlightCacheRecord.getSpotlight()?.latestBlock?.height ?: blockService.getMaxBlockCacheHeight()

fun getDistinctValidatorsWithMissedBlocksInTimeframe(timeframe: Timeframe) = transaction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,6 @@ class ValidatorControllerV2(
dayCount: Int
) = validatorService.getValidatorMarketRateStats(address, fromDate, toDate, dayCount)

// @ApiOperation("Returns block latency data for the validator")
// @GetMapping("/{address}/latency")
// fun blockLatency(
// @ApiParam(value = "The Validator's operator, owning account, or consensus address")
// @PathVariable
// address: String,
// @ApiParam(value = "The number of blocks of data returned", defaultValue = "100", required = false)
// @RequestParam(defaultValue = "100")
// blockCount: Int
// ) = validatorService.getBlockLatencyData(address, blockCount)

@ApiOperation("Returns distinct validators with missed blocks for the timeframe")
@GetMapping("/missed_blocks/distinct")
fun missedBlocksDistinct(
Expand Down

0 comments on commit b2f7c67

Please sign in to comment.