You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bug in the calculation of tBTC rewards has been discovered during regular checks of the last rewards distribution: a node may be able to skip penalties for insufficient uptime (96%) under certain circumstances.
The issue
If a node running the tBTC client stops running just before the end of a rewards period (i.e. the last days of the month) and starts up again during the next rewards period, the calculation script will erroneously consider that this is a new node during when calculating the rewards for the latter rewards period.
So a node can stop the client for a long time without being penalized for not meeting the 96% uptime requirement.
Example
I run my node during all through January, but I stop it on January 31st. Then, I wait until Feb 14th to start it again, and I keep it running during the rest of February.
Theoretically, I didn't run my node during 50% of February, so I shouldn't receive any rewards for the February period.
But in practice, the script will consider this to be a new node that starts for the first time on Feb 14th. As a new node, the uptime counter starts at Feb 14th, so the script will consider the uptime is 100% so this node will receive the rewards for the Feb 14th - Feb 28th period instead of being penalized with no rewards.
Why is this happening?
When calculating the tBTC rewards, the uptime of the clients is checked through a Prometheus server: the script queries the Prometheus server for the heartbeats sent by each tBTC client. So, if the client doesn't send heartbeats during more than 4% of the period time (the requirement is 96% of uptime), this node doesn't qualify for rewards.
The problem is that the tBTC calculation script queries the Prometheus server for the dates of the current period.
In the previous example, if we are calculating the February rewards, the script will query the heartbeats from Feb 1st to Feb 28th. Since the node stopped on Dec 31st and started again at Feb 14th, the query will not return any heartbeat from Feb 1st to Feb 14th. So the first heartbeat on Feb 14th will be considered as the first heartbeat ever and this node will be considered as new.
The text was updated successfully, but these errors were encountered:
A bug in the calculation of tBTC rewards has been discovered during regular checks of the last rewards distribution: a node may be able to skip penalties for insufficient uptime (96%) under certain circumstances.
The issue
If a node running the tBTC client stops running just before the end of a rewards period (i.e. the last days of the month) and starts up again during the next rewards period, the calculation script will erroneously consider that this is a new node during when calculating the rewards for the latter rewards period.
So a node can stop the client for a long time without being penalized for not meeting the 96% uptime requirement.
Example
I run my node during all through January, but I stop it on January 31st. Then, I wait until Feb 14th to start it again, and I keep it running during the rest of February.
Theoretically, I didn't run my node during 50% of February, so I shouldn't receive any rewards for the February period.
But in practice, the script will consider this to be a new node that starts for the first time on Feb 14th. As a new node, the uptime counter starts at Feb 14th, so the script will consider the uptime is 100% so this node will receive the rewards for the Feb 14th - Feb 28th period instead of being penalized with no rewards.
Why is this happening?
When calculating the tBTC rewards, the uptime of the clients is checked through a Prometheus server: the script queries the Prometheus server for the heartbeats sent by each tBTC client. So, if the client doesn't send heartbeats during more than 4% of the period time (the requirement is 96% of uptime), this node doesn't qualify for rewards.
The problem is that the tBTC calculation script queries the Prometheus server for the dates of the current period.
https://github.com/threshold-network/merkle-distribution/blob/main/src/scripts/tbtcv2-rewards/rewards.ts#L636
In the previous example, if we are calculating the February rewards, the script will query the heartbeats from Feb 1st to Feb 28th. Since the node stopped on Dec 31st and started again at Feb 14th, the query will not return any heartbeat from Feb 1st to Feb 14th. So the first heartbeat on Feb 14th will be considered as the first heartbeat ever and this node will be considered as new.
The text was updated successfully, but these errors were encountered: