celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
687 stars 362 forks source link

L2 Governance Hotfix #11014

Closed soloseng closed 1 week ago

soloseng commented 1 month ago

Description

Implements 2 phase hotfixes (Approval & execute):

Tested

Unit tested.

Related issues

Backwards compatibility

Maintains backwards compatibility with L1.

soloseng commented 1 month ago

Worked on implementing a hotfix mechanism using a Security Council multisig (number of signer TBD). This new process, however, is potentially less secure than the original validator hotfix process.

The hotfix process went from a 3 step to a 2 step approval process, as the prepare step (using epoch number) has been deprecated.

The original validator hotfix process required a byzantine quorum of validators in order to execute a hotfix. Because validators had a financial incentive to not be malicious, this guaranteed that a set threshold of healthy, non-malicious validators approved the hotfix. In addition to that, since the list of validators approving the hotfix depended on current set of validators at the time of approval, it was much more difficult for validators to collude and approve a malicious hotfix.

With the prepare step being deprecated, this leaves a hotfix proposal open to being executed at anytime after it was approved. This is divergent from the original hotfix process, as with each new epoch, the hotfixWhitelistValidatorTally could change, requiring validators to reapprove a hotfix that was not executed in the allotted timeframe.

Using the multisig approach on L2, the list of signer would remain fixed. Given that there are no obvious incentives for Security Council signers to act for the greater good of the network, this increases the risk of collusion between Security Council signers, and the risk of a malicious hotfix being approved and executed. The main safety against malicious hotfix is based on the assumption that there will be no overlap or collusion between approvers and the Security Council signers.

soloseng commented 1 month ago

With the prepare step being deprecated, this leaves a hotfix proposal open to being executed at anytime after it was approved. This is divergent from the original hotfix process, as with each new epoch, the hotfixWhitelistValidatorTally could change, requiring validators to reapprove a hotfix that was not executed in the allotted timeframe.

I added a time limit for the prepareHotfix step on L2. This requires the approvers and Security Council to re-approve and prepare the hotfix once the hotfixes[hash].executionTimeLimit has elapsed.

openzeppelin-code[bot] commented 1 month ago

L2 Governance Hotfix

Generated at commit: dbe6a673acf44e1fd8e90752a1bc679715adb48a

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
3
0
15
41
61
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

gitguardian[bot] commented 1 week ago

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [10538986](https://dashboard.gitguardian.com/workspace/286247/incidents/10538986?occurrence=160678969) | Triggered | Generic High Entropy Secret | 181f4e6bbab54c51037e82d95724423ee0cdfb76 | packages/protocol/scripts/foundry/constants.sh | [View secret](https://github.com/celo-org/celo-monorepo/commit/181f4e6bbab54c51037e82d95724423ee0cdfb76#diff-6dbf3b6a58b42af6d81011adca70b6cd3db90af76d9216223576607ff06f60ecR4) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.