Scan Node SLA API
To evaluate the health of nodes in the network, Forta calculates a score (SLA) based on node activity. This score is a 0-1 score where higher is better. This calculation will evolve as more factors are considered.
SLA Calculation
See SLA for details regarding the composition of the SLA score.
API
To make this score visible, we now have an API that anyone can call for a given scanner address. Simply curl the API to get a summary report for the period you are interested in.
Request
URL
Request Parameters
startTime
- Start of date range to consider, in RFC3339 (YYYY-MM-DDTHH:MM:SSZ) (Default: 2 hours ago)endTime
- End of date range to consider, in RFC3339 (YYYY-MM-DDTHH:MM:SSZ) (Default: 1 hour ago)showMinutes
- Enables thelowestMinutes
list in the response (Default: false)
Example (Most Recent available Hour)
Example (The day of 2022-09-07)
https://api.forta.network/stats/sla/scanner/0x58ee631aaef6882a392da1c25486ee181ff1b7d5?startTime=2022-09-07T00:00:00Z&endTime=2022-09-08T00:00:00Z&showMinutes=true
Response
Fields
scannerId
- ID of scanner requestedstartTime
- Start time considered for SLA calculationsendTime
- End time considered for SLA calculationsstatistics
- Score statistics for the periodmin
- Minimum hour-level score for the periodmax
- Maximum hour-level score for the periodp50
- 50th Percentile hour-level score for the periodavg
- Average hour-level score for the period
lowestScores
- Hour scores for the period (sorted by score ASC)minute
- Hour for this hour summary scorescore
- Score for this hourinputs
- Inputs considered in the subscoresinput_performance
- Average of all latest block scores from reported minutesexpected_input_performance
- Always 1 (for reference)reporting_success
- Sum of batch scores of all reported minutes in the hourexpected_min_reporting_success
- Strict for bot-assigned nodesexpected_max_reporting_success
- The number of minutes in one hourinspection_score
- The Resource score for the node (hour average) (see SLA for details)expected_inspection_score
- Always 1 (for reference)
scores
- Subscores that led to overall score for this hourname
- Name of scorevalue
- Value of score (0-1)weight
- Weight towards overall score
lowestMinutes
- 10 lowest minute scores for the period (sorted by score ASC) (enabled with?showMinutes=true
)minute
- Minute for this minute scorescore
- Score for this minuteinputs
- Inputs considered in the subscoresbatch_count
- Number of batches sent in this minuteexpected_batch_count
- Expected number of batches for the minutelatest_block
- Latest block sent by scan node in this minuteexpected_latest_block
- 75th Percentile block for all peers for this networklatest_block_threshold
- Threshold used for evaluation of the latest blockinspection_score
- The Resource score for the node (see SLA for details)
scores
- Subscores that led to overall score for this minutename
- Name of scorevalue
- Value of score (0-1)weight
- Weight towards overall score
Subscores
From minutes (affects hour)
-
batch_score
- 0-1 score forbatch_count
vsexpected_batch_count
- Score is proportional (4 = 1, 3 = 0.75, 2 = 0.50, 1 = 0.25, 0 = 0)
- Exceeding also decreases score (4 = 1, 5 = 0.75, 6 = 0.50, 7 = 0.25, 8 = 0)
-
latest_block
- 0-1 score forlatest_block
vsexpected_latest_block
- Full credit for being at or above
expected_latest_block
(within 100 blocks) - Decreases from 1 to 0 if
latest_block
is belowexpected_latest_block
, until 100 blocks behind (score = 0)
- Full credit for being at or above
From hour (affects final score)
reporting_success
- 0-1 score for totalbatch_score
within the hour vs.expected_(min|max)_reporting_success
.- Score is proportional between
[0,min]
. Min is 59 for bot-assigned nodes and 3 for idle nodes. - The sum does not exceed 60 in an hour.
- Score is proportional between
input_performance
- 0-1 score for averagelatest_block
score within the hour vs.expected_input_performance
(i.e. 1).- The average is calculated using reported minutes.
- An idle and a bot-assigned node can have the same score although they report at different rates.
Example Response
{
"scannerId":"0x9DC6B3679DF5d3327612d6882680F22F984C5F24",
"startTime":"2022-09-07T10:13:58.247904993Z",
"endTime":"2022-09-07T11:13:58.247904993Z",
"statistics":{
"min":1,
"max":1,
"p50":1,
"avg":1
},
"lowestScores":[
{
"minute":"2022-09-07T10:00:00Z",
"score":1,
"inputs":{
"batch_count":215,
"expected_min_batch_count":0,
"expected_max_batch_count":0,
"reporting_success":60,
"expected_min_reporting_success":59,
"expected_max_reporting_success":60,
"latest_block_threshold":0,
"latest_block":0,
"expected_latest_block":0,
"input_performance":1,
"expected_input_performance":1,
"inspection_score":1,
"expected_inspection_score":1
},
"scores":[
{
"name":"input_performance",
"value":1,
"weight":5
},
{
"name":"reporting_success",
"value":1,
"weight":1
}
]
}
],
"lowestMinutes":[
{
"minute":"2022-09-07T11:29:00Z",
"score":0,
"inputs":{
"batch_count":4,
"expected_min_batch_count":1,
"expected_max_batch_count":4,
"reporting_success":0,
"expected_min_reporting_success":0,
"expected_max_reporting_success":0,
"latest_block_threshold":40,
"latest_block":15490042,
"expected_latest_block":15490040,
"input_performance":0,
"expected_input_performance":0,
"inspection_score":1,
"expected_inspection_score":0
},
"scores":[
{
"name":"batch_count",
"value":1,
"weight":1
},
{
"name":"latest_block",
"value":1,
"weight":5
}
]
}
]
}