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

Delayed stakes: transfer PNK immediately without waiting for the next Staking phase #990

Closed
Tracked by #1588
jaybuidl opened this issue Jun 28, 2023 · 2 comments · Fixed by #1228
Closed
Tracked by #1588
Milestone

Comments

@jaybuidl
Copy link
Member

Rationale

Currently, if a juror changes his stake outside the Staking phase, this change is queued and executed at the next Staking phase. The corresponding PNK amount doesn't leave the user's account until execution of the delayed stake. This has raised a UX issue: when a users checks his account after staking outside the Staking phase, his account does not yet reflect the new PNK balance.

Previous attempt

Previously, we wanted to provide more visibility about this to the user via the court frontend: #942 but it has been abandonned to avoid exposing more complexity for the user, and instead make smart contract changes.

This solution

In case of:

  • Stake increase outside the Staking phase, the sortition module must transfer the corresponding PNK amount immediately, but it must wait for the next Staking phase to update the SortitionSumTree.
  • Stake decrease outside the Staking phase, same as before.
@Jovian-Dsouza
Copy link

Hello, @jaybuidl. I would appreciate your assistance in clarifying which function in the SortitionModule.sol file is invoked by the juror when modifying their stake outside the staking phase. I am seeking a better understanding of this particular functionality. Thank you.

@jaybuidl jaybuidl linked a pull request Jul 6, 2023 that will close this issue
@jaybuidl
Copy link
Member Author

jaybuidl commented Jul 31, 2023

Hey @Jovian-Dsouza

which function in the SortitionModule.sol file is invoked by the juror when modifying their stake outside the staking phase.

function executeDelayedStakes(uint256 _iterations) external {

@jaybuidl jaybuidl modified the milestones: testnet-2, testnet-2.1 Oct 16, 2023
@jaybuidl jaybuidl modified the milestones: testnet-2.1, backlog Dec 7, 2023
@jaybuidl jaybuidl linked a pull request Dec 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants