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

Dual Guardian mechanism #302

Open
wants to merge 29 commits into
base: celo-contracts/v1.8.0-1
Choose a base branch
from

Conversation

m-chrzan
Copy link

@m-chrzan m-chrzan commented Jan 28, 2025

Description

Introduces CeloSuperchainConfig which:

  • behaves like SuperchainConfig
    • i.e. allows a Guardian role to pause certain parts of an OP system
  • Stores the address of another SuperchainConfig (this is intended to be the one used by the actual Superchain)
  • paused() returns the logical OR of its own paused value and Superchain's paused value
  • A new function, checkAndPauseIfSuperchainPaused(), checks the paused() status while also permissionlessly pausing this contract as long as Superchain is paused.
    • The idea is to use this instead of paused() in contracts that are pausable. They will thus fetch the current paused() status, while also atomically pausing the Celo system, such that if Superchain unpauses, Celo remains paused until manual intervention from the Celo Guardian.

Fixes #299.

TODOs

  • Events
  • NatSpecs
  • Pause at initialize time if Superchain paused
  • Connect all pausable contracts to this
    • Already done for OptimismPortal as a PoC
  • Test the new mechanism in pausable contracts
  • Fix TODOs in code
  • Rebase on top of pahor/genesisGeneration

Questions

  • Naming: just CeloConfig instead?
    • Or something more general (without "Celo") so it's more reusable by other projects in a similar situation. E.g. "DualGuardianConfig".
  • Package structure: do we put new contracts like this together with other OP contracts (in L1/ in this case), or should they go in a separate directory (like celo/, as we had before)?

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