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

🐞[BUG] (Race Condition Issue) Claiming your Stacked CC before FAST Pool Reward Payout = 0 STX Rewards #22

Open
ghost opened this issue Oct 13, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 13, 2023

Bug Description:
This is a race condition type of problem where the user is able to claim their stacked MIA/NYC/CityCoins before Friedger's FAST Pool pays out the treasury stacking rewards. Because the user claim's their CityCoins before the calculation is done, their stacked CC is set to 0, so the resulting Stacking rewards is then calculated as 0.

Steps to reproduce the behavior:

  1. Stack your CC.
  2. When the last cycle is completed, claim your CC before the FAST Pool pays out the stacking rewards.
  3. Checking your rewards for this last cycle will show 0.

Expected behavior:
The user is unable to claim their CC until the FAST Pool pays out the stacking rewards.

Device:
Windows 11, Brave Browser

Possible solutions:

  1. Set an arbitrary minimum limit where the user is unable to claim for X amount of blocks after the cycle ends. Maybe something like 200 blocks; if a user checks their rewards on minecitycoins.com, it will show the CC to reclaim, but the button should be greyed out and say something along the lines of, "Please wait to claim until Stacks block XXXXXX."
  2. Similar to the above, but instead of the minimum limit being arbitrary like 200 blocks, we read the FAST Pool TxID data and get the Anchor Block the Tx was confirmed in. The greyed out button should also show something like, "Please wait to claim until Stacks block XXXXXX." But instead of XXXXXX being the CycleEndBlock + 200 Stacks blocks, it would be the CycleEndBlock + FastPoolConfirmedAnchorBlock.
@ghost
Copy link
Author

ghost commented Oct 13, 2023

Or change the calculation to use a snapsot of the user's stacked CC from a block during the last cycle they stacked for, not the block until the FAST Pool payout.

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

No branches or pull requests

0 participants