Skip to content

[Fix] - Use per pause type expiry#2335

Open
thedarkjester wants to merge 14 commits intomainfrom
fix/pause-expiry-splitting
Open

[Fix] - Use per pause type expiry#2335
thedarkjester wants to merge 14 commits intomainfrom
fix/pause-expiry-splitting

Conversation

@thedarkjester
Copy link
Collaborator

@thedarkjester thedarkjester commented Feb 9, 2026

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Note

High Risk
Changes core pausing/cooldown behavior and adds new storage/state (nonSecurityCouncilCooldownEnd, per-type expiries) in an upgradeable security-critical contract, so incorrect logic or storage assumptions could lock/unlock functionality unexpectedly.

Overview
Refactors PauseManager to replace the single global pauseExpiryTimestamp with per-PauseType expiry tracking (pauseTypeExpiryTimestamps) and a new nonSecurityCouncilCooldownEnd that enforces a pause window (additional types can be paused during the first PAUSE_DURATION) followed by a cooldown where non-security-council pausing is blocked.

Adds explicit security council indefinite pausing semantics: pauseByType by SECURITY_COUNCIL_ROLE sets expiry to uint256.max and emits PausedIndefinitely, while unPauseByType now blocks non-SC from unpausing indefinite pauses via OnlySecurityCouncilCanUnpauseIndefinitePause. Introduces resetNonSecurityCouncilCooldownEnd() (SC-only) and emits NonSecurityCouncilCooldownEndReset.

Updates hardhat tests and yield-manager controls to match new timing/emit behavior and adds a short doc (pause-by-type-flow.txt); updates LineaRollupV7.1.abi to reflect the new pause manager surface (new getter/event/function/error).

Written by Cursor Bugbot for commit c374a2c. This will update automatically on new commits. Configure here.

@thedarkjester thedarkjester requested a review from a team as a code owner February 9, 2026 15:20
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.97%. Comparing base (317ee4a) to head (c374a2c).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2335      +/-   ##
============================================
+ Coverage     60.93%   60.97%   +0.03%     
  Complexity     1619     1619              
============================================
  Files           436      436              
  Lines         17363    17379      +16     
  Branches       1908     1912       +4     
============================================
+ Hits          10580    10596      +16     
  Misses         6123     6123              
  Partials        660      660              
Flag Coverage Δ *Carryforward flag
hardhat 97.91% <100.00%> (+0.01%) ⬆️
kotlin 56.64% <ø> (ø) Carriedforward from a4b328e

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
contracts/src/security/pausing/PauseManager.sol 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

revert PauseUnavailableDueToCooldown(pauseExpiryTimestamp + COOLDOWN_DURATION);
unchecked {
uint256 _remainingCooldown = _cooldownEnd - block.timestamp;
if (_remainingCooldown > COOLDOWN_DURATION) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about the triple-nested if-else blocks 😅

Copy link
Contributor

@kyzooghost kyzooghost Feb 10, 2026

Choose a reason for hiding this comment

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

should we use early returns instead?

if security_council ... -> early return
if past_cooldown ... -> early return
if in_pause_window ... -> early return
revert...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you still need to set the pause and emit and adding another function just for that felt messier.

kyzooghost
kyzooghost previously approved these changes Feb 10, 2026
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.

3 participants