question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error unselecting staking pool during staking pool withdrawal

See original GitHub issue

Problem Calling unselect_staking_pool will fail during withdrawal if the user staked again after triggering Unstake. This will be a more common issue when we launch partial unstaking.

Expected Behavior We should not trigger unselect_staking_pool during Withdrawal, only withdraw_all_from_staking_pool.

Steps to reproduce

  1. Stake a small amount (not your entire lockup balance)
  2. Unstake
  3. Stake again
  4. When your first stake is ready to withdraw, initiate the withdrawal
  5. Attempt to approve unselect_staking_pool

Details

Failed TX: https://explorer.near.org/transactions/7ujCVsCHSBWfzRSkhhG79N9uj2MNLCCeh4ny7SDR4S8F

Error text: panicked at 'assertion failed: `(left == right)`\n left: `499999980183345121319654`,\n right: `0`: There is still a deposit on the staking pool', src/owner.rs:56:9

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mattlockyercommented, Oct 15, 2020

@kcole16 the issue seems to be specifically with calling “unselect” while there is still something staked? Despite calling “withdrawal all” and successfully withdrawing all of the available balance, correct?

I will add a check to lockup withdraw function that will not unselect pool until all balances are “0” with validator.

0reactions
Patrick1904commented, Oct 17, 2020

I’m using it right now to determine if you currently have a balance with a validator. Seems unusual to me that we’d keep the validator selected even if I don’t have any balance with the validator, but can adjust if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Staking Troubleshooting - The Sandbox - GitBook
You do not need to withdraw your stake. The staking pool will resume again shortly. We generally cannot provide any accurate timeframes for...
Read more >
How to Claim/Exit/Unstake From the DeFi Pool | by RioDeFi
There are three actions you could take to exit from the DeFi staking. Effect: By exiting the pool, you withdraw both your RFUEL...
Read more >
I'm having trouble unstaking / withdrawing my SOL - Phantom
Your stake is still "Activating" or "Deactivating". You will need to wait for your stake to be "Inactive" in order to withdraw it....
Read more >
Dozens of Ethereum 2.0 Validators Slashed Due to Staking ...
Ethereum 2.0 staking pool Staked penalized for $30000 due to bad behavior in an attempt to improve the efficiency of block validation.
Read more >
Withdrawing pledge - Operate a Stake Pool - Cardano Forum
In fact, i need to know where it will transfer and how? The second question is about managing the payment address in staking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found