Skip to content

BUG: Stakes corruption when delayed stakes move existing stakes to another court and juror is drawn #1990

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

Open
jaybuidl opened this issue May 13, 2025 · 0 comments

Comments

@jaybuidl
Copy link
Member

jaybuidl commented May 13, 2025

Reproduction

  1. Juror is staked in court A (10K) and B (15K)
  2. In generating or drawing phase, juror moves his stakes from court B to court A
    → stakes in court A are increased immediately to 25K BUT stake decreased are delayed in court B (still 15K) due to the instant staking logic
  3. Juror gets drawn several times in court A based on an INCORRECT stake of 25K + 15K = 40K, too many times!! Locked stakes in this dispute: 38K.
  4. Phase goes to Staking, delayed stakes are executed: - It releases 40K - 38K = 2K to court A
    • It sets his stake in court B to 0
  5. The juror is now missing 13K !!

Example

Root cause

Bug in #990

Solution

Revert the instant staking logic for stake increases: too many edge cases and it made the code more complex in an area where it was already too complex.

@jaybuidl jaybuidl changed the title Stakes corruption when delayed stakes move existing stakes to another court and juror is drawn BUG: Stakes corruption when delayed stakes move existing stakes to another court and juror is drawn May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants