Skip to content

Align shutdown timestamp to draw period #116

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

Conversation

trmid
Copy link
Member

@trmid trmid commented Jun 27, 2024

The TWAB shutdown time is not guaranteed to be aligned with the prize pool draws. Since the prize pool checks shutdown status based on timestamps, it's possible that the prize pool can award a draw, have some prizes claimed, and then shutdown mid-draw. This causes issues with the shutdown portion calculation if any prizes were claimed in that time period (see original issue for more details).

To mitigate this, the TWAB shutdown timestamp is truncated to the draw period such that the prize pool is always guaranteed to be shutdown at the start of a draw.

Copy link

linear bot commented Jun 27, 2024

@trmid trmid changed the base branch from main to fix-review June 27, 2024 15:31
@trmid trmid requested a review from asselstine June 27, 2024 15:31
Copy link

LCOV of commit 6d57310 during Tests with 100% Coverage #560

Summary coverage rate:
  lines......: 99.8% (519 of 520 lines)
  functions..: 100.0% (80 of 80 functions)
  branches...: no data found

Files changed coverage rate:
                                             |Lines       |Functions  |Branches    
  Filename                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================
  src/PrizePool.sol                          |99.6%    232| 100%    46|    -      0

Copy link
Contributor

@asselstine asselstine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@trmid trmid merged commit 1338ae0 into fix-review Jun 28, 2024
2 checks passed
@trmid trmid deleted the gen-1775-133-force-align-prize-pool-shutdown-time-to-start-of-draw branch July 15, 2024 23:09
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

Successfully merging this pull request may close these issues.

2 participants