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

feat: add unpauser role #384

Merged
merged 16 commits into from
Mar 12, 2025
Merged

feat: add unpauser role #384

merged 16 commits into from
Mar 12, 2025

Conversation

Zygimantass
Copy link
Contributor

Description

Adds an UNPAUSER_ROLE which can unpause the protocol. This is done to separate the pauser role from the unpauser. The pauser role is going to have more lax requirements to be able to respond to incidents quickly, while we want the unpauser role to be more strict.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@Zygimantass Zygimantass force-pushed the zygis/admin-only-pause branch from 1a2689a to 5d47c0b Compare March 10, 2025 16:17
Base automatically changed from zygis/add-pausing-scripts to main March 10, 2025 16:22
Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Looks mostly OK to me, but would like tests added similar to the pauser tests. Also added some minor comments

@@ -26,7 +26,7 @@ jobs:
forge script scripts/deployments/DeployProxiedICS20Transfer.sol -vvv --broadcast --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
forge script scripts/deployments/DeploySP1ICS07Tendermint.sol -vvv --broadcast --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
forge script scripts/deployments/PauseTransfers.sol -vvv --broadcast --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
forge script scripts/deployments/UnpauseTransfers.sol -vvv --broadcast --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
forge script scripts/deployments/UnpauseTransfers.sol -vvv --broadcast --private-key 59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted the workflow to test that the pauser and unpauser are two different wallets, and as such the private keys for them are different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's reflected in the deployments/local/31337.json file, specifically the pauser and unpauser fields.

Copy link
Member

@srdtrk srdtrk left a comment

Choose a reason for hiding this comment

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

I'm guessing that the reason why e2e tests aren't passing is because somewhere in the deployment script, ics20transfer.initialize was encoded with a abi.encodeWithSelector instead of abi.encodeCall. So it cannot validate the syntax. It is specifically here.

You may fix this now. There is a general issue for this #321, which we can address in a separate PR after this.

@@ -103,6 +103,7 @@ abstract contract Deployments {

// admin control
address pauser;
address unpauser;
Copy link
Member

Choose a reason for hiding this comment

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

note that there could be multiple wallets with these roles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I'm going to refactor this logic to take multiple addresses for both pauser and unpauser in a different PR.

Copy link

codecov bot commented Mar 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.86%. Comparing base (e929d43) to head (11cfac7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #384   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          14       14           
  Lines         731      740    +9     
=======================================
+ Hits          730      739    +9     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@srdtrk srdtrk left a comment

Choose a reason for hiding this comment

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

Looks really good. I didn't notice if there is any test case where unpause succeeds. If so, you can reply to my comment and then we can merge it. Otherwise, please add it to your tests.

Copy link
Member

@srdtrk srdtrk left a comment

Choose a reason for hiding this comment

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

lgtm

@srdtrk srdtrk merged commit 5975a6a into main Mar 12, 2025
66 checks passed
@srdtrk srdtrk deleted the zygis/admin-only-pause branch March 12, 2025 20:17
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