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

Freeze observations after shutdown #112

Merged

Conversation

trmid
Copy link
Member

@trmid trmid commented Apr 17, 2024

See description of issue here: #111 (comment)

@trmid trmid requested a review from asselstine April 17, 2024 14:54
Copy link

LCOV of commit 847263a during Tests with 100% Coverage #531

Summary coverage rate:
  lines......: 100.0% (518 of 518 lines)
  functions..: 97.4% (76 of 78 functions)
  branches...: no data found

Files changed coverage rate:
                                             |Lines       |Functions  |Branches    
  Filename                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================
  src/PrizePool.sol                          | 100%    230|95.5%    44|    -      0

Copy link

LCOV of commit aea00c7 during Tests with 100% Coverage #533

Summary coverage rate:
  lines......: 100.0% (518 of 518 lines)
  functions..: 97.4% (76 of 78 functions)
  branches...: no data found

Files changed coverage rate:
                                             |Lines       |Functions  |Branches    
  Filename                                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================================
  src/PrizePool.sol                          | 100%    230|95.5%    44|    -      0

// Any new contributions will be made to the draw ID immediately after shutdown.
// The shutdown balances are calculated using the newest observations and do not rely on draw ID.
_drawId = getDrawIdPriorToShutdown() + 1;
_totalAccumulator.add(_amount, _drawId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think locking the draw id makes a ton of sense! This is the right approach.

If we don't update the vault accumulator then other functions will break: getContributedBetween, getVaultPortion, etc. We don't know how those functions will be used; so ideally we can keep them working as long as possible.

Instead I think we should insert the locking logic into the getOpenDrawId function, because that will have a broader trickle-down effect. Anything bound to getOpenDrawId will still be "correct", and the other functions will still work.

Copy link

LCOV of commit 060de4a during Tests with 100% Coverage #535

Summary coverage rate:
  lines......: 99.8% (519 of 520 lines)
  functions..: 97.5% (78 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|95.7%    46|    -      0
  src/libraries/DrawAccumulatorLib.sol       | 100%     61| 100%     5|    -      0

⛔ The code coverage is too low. Expected at least 100.

@asselstine asselstine merged commit f26119f into gen-1337-investigate-shutdownbalanceof-logic Apr 17, 2024
0 of 2 checks passed
@asselstine asselstine deleted the shutdown-obs-freeze branch April 17, 2024 17:42
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.

None yet

2 participants