threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Jan 1st 24 distribution miscalculation: nuInT earnings during transition period #123

Closed manumonti closed 5 months ago

manumonti commented 6 months ago

In addition to #120, another miscalculation in the Jan 1st distribution has been detected. This relates to whether or not the staked legacy Nu is eligible for rewards during the transition period.

Context

At 2023-11-22T04:06:11.000Z the support of legacy Keep and Nu staking was dropped as announced in TIP-063. This date is the start of the transition process, where stakes with legacy staking can migrate their legacy tokens (Keep & Nu) to Threshold Network tokens (T). This process is described in the Transition Guide.

During the transition period, the release of rewards for legacy stakes has been frozen since these are eligible for rewards depending on whether they complete the migration in time.

On Dec 8th, the migration period for legacy Nu stakes ended, so on Jan 1st, 2024 distribution, the rewards associated with legacy Nu stakes were released.

It is worth noting that the staking rewards have two sources: tBTC rewards and PRE/TACo rewards.

The issue

For the calculation of the legacy Nu rewards during the transition period, we considered the following mechanism (as stated in #116):

If a staker completes the transition process in time, the rewards are calculated based on the re-staked amount. So, for example, if the stake had 1000 NuInT, and after deactivation, it re-stake 500T, only 500T will be considered as staked during the period between legacy deactivation and re-staking.

This is not correct, since the rewards should be calculated based on the original amount of NuInT, in the example, 1000T.

The fix

The remaining rewards will be distributed in future rewards distributions.