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

Implement admin container and pausable contracts #759

Merged
merged 7 commits into from
Jun 20, 2022

Conversation

Westlad
Copy link
Contributor

@Westlad Westlad commented Jun 10, 2022

fixes #718
fixes #675
This PR is quite big, but it's mainly additive code. It creates an administrator container from which one can call all of the 'onlyOwner' functions in the polygon-nightfall smart contracts (except for registering a new verifying key, which shouldn't be a manual process). Currently we have no simple way to call these functions. It also adds a 'pausable' interface to our critical contracts (State, Shield) so that these can be paused (frozen) in the event of an attack.
Testing is manual (this may change in future but there isn't time now) but easy:

  1. Run up nightfall as normal (./start-nightfall -g -s -d). This will now also create an admin container.
  2. Exec into this container. The easiest way is with docker-compose exec administrator bash.
  3. Run the administrator application (./admin).
  4. You will be asked for the owner private key. The easiest way to find this is to look in docker-compose.ganache.yml. The owner key is the first of the four listed there. You can use the others to test some of the functions that require private keys. The key will be remembered until you exit the ./admin application.
  5. When you have finished, exit the application. It will then forget the private key. Note however that your changes will persist on the ganache blockchain, for example if you transfer ownership of nightfall, you'll need to use the new private key until you restart polygon-nightfall.
    Most of the actions will emit an event which will be picked up (and then ignored) by optimist so that you can tell if the call has worked. Note that client will see events emitted by the State contract but not the Shield contract because it doesn't listen to that.

Copy link
Contributor

@druiz0992 druiz0992 left a comment

Choose a reason for hiding this comment

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

You will need to rebase with master and failing tests should now pass

@Westlad Westlad force-pushed the westlad/pausable branch from 0c68b5e to ee3add1 Compare June 15, 2022 10:44
@IlyasRidhuan IlyasRidhuan merged commit 0bbb499 into master Jun 20, 2022
@IlyasRidhuan IlyasRidhuan deleted the westlad/pausable branch June 20, 2022 09:14
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.

make administration container Freeze contract feature
3 participants