Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release pending ZQ1 staking rewards once we migrate mainnet to ZQ2 #2091

Open
rrw-zilliqa opened this issue Jan 6, 2025 · 1 comment
Open
Labels
Agate Required for mainnet launch

Comments

@rrw-zilliqa
Copy link
Contributor

The existing Ziliqa 1 staking contract contains quite a few rewards that cannot be withdrawn, because the transaction to withdraw them involves traversing a list which is sufficiently long that doing so exceeds the maximum transaction gas.

One approach is to simply upgrade the SSNList contract. However, this involves spending quite a bit of money on state migration and complexity.

My preferred plan is to:

  • Pause the SSNList contract on mainnet at zq1/zq2 transition
  • Total up the amount delegators are due using a script
  • Wait until 2w after the zq1/zq2 transition (to account for the unbonding period)
  • Deploy a contract (LegacyRewardWithdrawal) which supports the SSNList interface and allows users to withdraw their totaled up rewards but nothing else
  • Move the ZIL from the old SSNList contract to the new one.
  • Change the SSNList proxy contract so that it points to LegacyRewardWithdrawal

Users can then withdraw from the LegacyRewardWithdrawal contract using the same tools as they used to stake using the existing SSNList contract.

For clarity, I would propose that the LegacyRewardWithdrawal contract not require users to unstake first and not require an unbonding period - there is little point since staking in ZQ2 is a separate mechanism and no rewards will be issued to the SSNList contract post ZQ1->ZQ2 migration.

@DrZoltanFazekas DrZoltanFazekas added the Agate Required for mainnet launch label Jan 6, 2025
@DrZoltanFazekas
Copy link
Contributor

DrZoltanFazekas commented Jan 7, 2025

Wait until 2w after the zq1/zq2 transition (to account for the unbonding period)

No need to wait, we'll set the unbonding period in the SSNList contract to zero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agate Required for mainnet launch
Projects
None yet
Development

No branches or pull requests

3 participants
@DrZoltanFazekas @rrw-zilliqa and others