tezos-reward-distributor-organization / tezos-reward-distributor

Tezos Reward Distributor (TRD): A reward distribution software for tezos bakers.
https://tezos-reward-distributor-organization.github.io/tezos-reward-distributor/
GNU General Public License v3.0
87 stars 51 forks source link

Paris support #703

Closed nicolasochem closed 1 month ago

nicolasochem commented 2 months ago

In Paris, everything is changing. As "Paris B" was chosen by governance, as soon as Paris activates, adaptive issuance will kick in.

Paris starts at 5,726,209 cycle 743. There will be a grace period of a few cycles where the rights have already been calculated, so first cycle with active AI is 748 .

Then, rewards calculations will change. In tezos, rewards are derived from baking rights. In Oxford, baking rights come from delegation (including baker's own balance). In Paris, they are split in 2 unequal parts:

Note: this 2/3 / 1/3 distribution is global, not per baker. It is possible for a baker to have no stakers, only delegators, or no delegators, only stakers.

There is no RPC to query this lowest balance. Therefore, the ability to implement a simple RPC-based reward distributor has been lost.

For a while, the only supported backend of TRD has been tzkt. This will remain the only supported solution in Paris, however tzkt did not implement the same calculations as the protocol for minimal balance. It is still providing reward data, by looking at the end of cycles. TRD will keep using this data, even though it does not precisely represent the reward distribution, it approximates it.

The first few cycles after Paris, rewards are already calculated using Oxford formulas. Adaptive issuance calculation takes effect a few cycles later only. This is all handled by TzKT, so we do not concern ourselves with this.

Other things we should do:

I will update this ticket as development progresses.

jdsika commented 2 months ago

"also, the fees collected in blocks by bakers (negligible today) are not taken into account for staking rewards. They all go to delegation rewards."

If there is no delegation and I am not using e.g. TRD as payout tool then the fees remain with the baker and are not distributed to the "stakers"?

sorry. Didn't see the last parageraph before doing the comment :)

"We will pick solution 3" - I am ok with that!

jdsika commented 2 months ago

For a while, the only supported backend of TRD has been tzkt. This will remain the only supported solution in Paris, however tzkt did not implement the same calculations as the protocol for minimal balance. It is still providing reward data, by looking at the end of cycles. TRD will keep using this data, even though it does not precisely represent the reward distribution, it approximates it.

Has this issue been raised with the tzkt team?

jdsika commented 2 months ago

For a while, the only supported backend of TRD has been tzkt.

Everstake uses tzPro but the service will be deprecated and therefore we can remove it.

UPDATE: TzPro APIs will further be maintained by Trilitech according to this tweet