Skip to content

refacto(parallelizer): split togglePause into pause and unpause - #25

Merged
FabienCoutant merged 3 commits into
feat/savings-donation-and-pause-refactorfrom
refactor/parallelizer-pause
May 27, 2026
Merged

FabienCoutant merged 3 commits into
feat/savings-donation-and-pause-refactorfrom
refactor/parallelizer-pause

Conversation

@FabienCoutant

@FabienCoutant FabienCoutant commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Feature branch to be aggregated into feat/savings-donation-and-pause-refactor (the code intended for audit).

Changes

  • refacto(parallelizer): split the Parallelizer's togglePause(collateral, ActionType) into explicit pause/unpause.
  • refacto(utils): add the SECONDS_PER_YEAR constant and the AlreadyPaused/NotPaused errors.
  • chore(foundry): default via_ir = false.

Tests

forge build OK, Setters suite green (99 tests) on the branch rebased onto dev.

🤖 Generated with Claude Code

FabienCoutant added 3 commits May 27, 2026 14:10
The audit/eip3009-hotfix-fees branch grew the Storage struct (Surplus
fields) past the point where Yul can route stack variables through
EVM stack slots in a few code paths, surfacing as
"Variable size is 1 too deep in the stack" during compilation.

Disabling via_ir at the default profile sidesteps the issue across
the whole compilation graph. The dev and ci profiles already had
via_ir = false, so this only changes the unprofiled forge invocation
(the one CI and most local runs use).
- SECONDS_PER_YEAR (= 365 days) replaces the hardcoded 31_536_000
  literal in Savings.estimatedAPY().
- AlreadyPaused / NotPaused errors enable explicit pause/unpause
  flows that revert on no-op governance calls instead of silently
  toggling.
Mirrors the Savings refactor from this branch on the per-collateral
governance pause exposed by SettersGuardian. The `togglePause(collateral,
action)` entry point flipped the live flag without checking the current
state, so a misclicked governance call could silently invert the pause
status of a critical action — the only audit signal was the emitted
event.

Changes:
- LibSetters: new `pause(collateral, action)` and `unpause(collateral,
  action)` internals share a private `_setPauseState` helper. Both revert
  with `AlreadyPaused` / `NotPaused` on no-op transitions; the existing
  `PauseToggled` event is preserved for backward compatibility with
  indexers.
- SettersGuardian: replaces the external `togglePause` with `pause` and
  `unpause`.
- ISettersGuardian: interface updated accordingly.
- DiamondInitializer / Test config: previous `togglePause` calls
  enabled mint/burn/redeem at deploy time, so they map cleanly to
  `unpause` (set the live flag from 0 to 1).
- Selector wiring: `tests/utils/ConfigAccessManager.sol` and
  `scripts/SetParallelizerRoles.s.sol` updated to register both new
  selectors under the guardian role.
- Generated dummy diamond implementations regenerated with the new
  signatures.
- Tests updated to use the new API. The two no-op double-toggles in
  Redeem.t.sol that relied on legacy toggle semantics are kept as a
  pause+unpause sequence so they're now explicit about being a no-op.
@FabienCoutant
FabienCoutant merged commit a1204e1 into feat/savings-donation-and-pause-refactor May 27, 2026
4 checks passed
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.

1 participant