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

Add training wheels mechanisms #69

Merged
merged 9 commits into from
Nov 24, 2022
Merged

Add training wheels mechanisms #69

merged 9 commits into from
Nov 24, 2022

Conversation

invocamanman
Copy link
Collaborator

@invocamanman invocamanman commented Nov 16, 2022

  • GlobalExitRootManager

    • Erase lastGlobalExitRootNum
    • Now in the globalExitRootMap stores the current timestamp instead
    • This timestamp will be used by the bridge by a protection bootstrap mechanism ( claimTimeout)
    • If the root does not change, DO NOT update the timestamp and neither emit event of update
  • Bridge

    • Update the clones method, now with create2 ( for saving 2600 of gas in every call, also seems more clear the SC verification on blockscout), FE 🔴 should be aware of this, the way that the precalculatedWrapperAddress works change a little bit and depend on the name, symbol and decimals ( they already agree that this is fine tho)
    • Added claimTimeout
      • Once claim is call will check that the globalExtiRoot of that claim exist and at least claimTimeout seconds has passed since that global exit root was submitted
    • Add owner that is able to update the claimTimeout
    • Add emergencyMode
      • Stops all bridges and claims once activated
      • Only can be activate i deactivated by PoE contract
  • PoE

    • Add emergencyMode
      • Can be activated by a owner ( bootstrap mechanism) or by call proofDifferentState succesfully
      • Stop forcedBatches, sequenceBatches, sequenceForcedBatches and verifyBatches functions
      • Only can be stopped by securityCouncil Address
      • Once activate/deactivated also actives/deactives the bridge one emergency one!
  • Summary of training wheels mechanism;

    • Bridge owner can basically stops the claims on the bridge ( setting the claimTimeout to max)
    • PoE owner can basically stops both contracts ( activating the emergencyMode)
    • Security council can only interact once emergency mode is active
    • The idea is to remove in some point both ownership's of the contracts
    • Once removed, the only way to go emergency mode is to proof a different state
      • But this means that if there's a bug in the rom that can be exploited to subtract tokens/ether we cannot do anything about it!
  • Update related tests and deployment scripts

  • Add create genesis script

TODO:

  • Create a timelock that will be the proxyManager of all contracts, and reduce the update time if the emergencyMode is active
    This was intended to be in this PR but i didint have time sorry xD

@invocamanman invocamanman marked this pull request as ready for review November 21, 2022 00:55
@invocamanman invocamanman changed the title first approach Add training wheels mechanisms Nov 23, 2022
Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

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

😸

@krlosMata krlosMata merged commit 59388f7 into develop Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants