SPP-3: Ability to delegate rewards before the start of a new era

Author: relax
Created: 2025-03-14
Status: Draft

Motivation

Currently, delegators do not have the ability to delegate rewards for the previous era before the start of the new era. So a whole week is lost, the tokens are in limbo for a whole week, they can only be sold. In the current market conditions, many delegators will choose to delegate rewards, but as already said, a whole week is lost.

Proposal

Add the ability to delegate rewards before the start of a new era

Implementation

How this can be implemented:

  • Add a pause between eras, for example, 20 minutes. These 20 minutes can be taken by shortening the era by 20 minutes. The main thing is that the rewards are sent to wallets within these 20 minutes.
  • Auto restake rewards feature.

Implementation time: maximum 1 month from the date of voting

This is very good idea regarding persuading delegators to keep their rewards in the staking contract.
Previously, we don’t allow delegation changes to happen immediately, it was mainly to prevent opportunism, people keep moving delegation around. But maybe we can make a backdoor that for the claimed delegation rewards, they can be redelegate without waiting for another era.

A potential problem is to deal with when a node operator has reached their max delegation quota. We probably can allow it to exceed but in places where we use totalStake, we use the effective total stake which is their capped totalStake. I think we already have that logic, just need to reassure it works as expected.

I don’t think a pause between eras can be practical. And for auto restake, who will cover the tx cost? maybe it won’t be needed if the extra era can be avoided?

Obviously the cost of transactions is covered by the user.

If a node has reached its maximum, it cannot be delegated to.


Let’s just change the logic in the code and allow delegation at any time and this amount will immediately start to be taken into account!?
If this is beyond the developers’ capabilities, then I am for a 20-minute pause. Now there is also a pause of several minutes, when the message on the site: “The era is ended.” This is a fake pause: everything works as is, there is just a little time to delegate rewards so that they are taken into account in the current era.

I have kicked off experimenting potential solutions. Will update here once I got anything.

I have an implementation here feat: allow staking rewards to stake by ianhe8x · Pull Request #438 · subquery/network-contracts · GitHub

Some differences from your original idea.

  • work for both node operator and delegator
  • new stake is effective immediately, different from normal staking process. Can happen anytime in an era. (only when it is from the rewards)
  • It is allowed if new added delegation leads to over the node operator’s delegation limit.

As an FYI, I’ve changed title from SPP-2 to SPP-3 to ensure consistency. SPP-2 was this but unfortunately was not named as such.

* new stake is effective immediately, different from normal staking process. Can happen anytime in an era. (only when it is from the rewards)
Great

@Ian, Hi!
For some reason, I didn’t think of it right away. If we can now delegate rewards at any time and have them count within the current era, then why not allow the delegation globally at any time to take into account in current era?
We need flexibility, why this unnecessary restriction? Just need to write the algorithm in the code correctly.

Hey @mister_freeman , good point as well! Let me see if we can add this to the current scope of delegating rewards immediately as well!