-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Remove dangling deployment artifacts #300
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f3b47f1
chore: Update gitignore
zguesmi 6dadbe8
feat: Remove dangling artifact deployments after upgrade
zguesmi 5f16785
chore: Rename input variable
zguesmi 16d538c
chore: Add dry-run script
zguesmi 3d38bf8
chore: Comment script
zguesmi 40aaee4
chore: Don't run pre-upgrade stage on dry-run
zguesmi 6a99359
docs: Update upgrade guide
zguesmi 572b898
chore: Proceed with upgrade if pre-upgrade succeeded or was skipped
zguesmi 9594fc5
chore: Revert "chore: Proceed with upgrade if pre-upgrade succeeded o…
zguesmi b2fcf32
chore: Revert if check
zguesmi 20db8eb
ci: Test upgrade ci
zguesmi ac4be00
chore: Add log message
zguesmi d594693
chore: Restore default workflow
zguesmi beb0cd8
chore: Apply copilot suggestions (MacOS compatibility and script check)
zguesmi e34e577
chore: Fix dry run script
zguesmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,41 @@ | ||
| # PoCo Smart Contracts Upgrade Guide | ||
|
|
||
| This document explains the recommended steps for creating and applying | ||
| a safe, traceable, and reproducible upgrade to the PoCo Diamond proxy. | ||
| This document explains the recommended steps for creating and applying a safe, traceable, | ||
| and reproducible upgrade to the PoCo Diamond proxy. | ||
|
|
||
| ## Upgrade Steps | ||
|
|
||
| 0. **Ensure all tests pass**:<br> | ||
| Run the full test suite to make sure everything is working before starting an upgrade. | ||
|
|
||
| 1. **Create a new upgrade script**:<br> | ||
| Name the script using the version and upgrade name format: `vX.Y.Z-upgrade-name.ts`. | ||
| Name the script using the version and upgrade name in the form `vX.Y.Z-upgrade-name.ts` | ||
| and implement the upgrade logic. | ||
|
|
||
| 2. **Create a corresponding Markdown report**:<br> | ||
| Copy the template file `v0.0.0-template.md` and rename it to match the script: `vX.Y.Z-upgrade-name.md`. | ||
| Copy the template file `v0.0.0-template.md` and rename it to match the script's name | ||
| (`vX.Y.Z-upgrade-name.md`). | ||
|
|
||
| 3. **Update GitHub Actions**:<br> | ||
| 3. **Test dry-runs locally**:<br> | ||
| Use the script [./dry-run.sh](./dry-run.sh) and check the logs. | ||
|
|
||
| 4. **Update GitHub Actions**:<br> | ||
| Modify `upgrade-facets.yml` workflow to call the new upgrade script. | ||
|
|
||
| 4. **Upgrade on Testnet**: | ||
| 5. **Upgrade on Testnet**: | ||
| - ⚠️ Always upgrade on the testnet first. | ||
| - Trigger the upgrade workflow on GitHub and choose the testnet network. | ||
| - Start with a **dry run** to simulate the upgrade. | ||
| - Once verified, apply the upgrade on the live testnet. | ||
|
|
||
| 5. **Upgrade on Mainnet**: | ||
| 6. **Upgrade on Mainnet**: | ||
| - Trigger the upgrade workflow on GitHub and choose the mainnet network. | ||
| - Perform a dry run first. | ||
| - Apply the upgrade on the mainnet. | ||
| - Merge the artifacts PR after successful execution. | ||
|
|
||
| 6. **Update upgrade report**:<br> | ||
| 7. **Update upgrade report**:<br> | ||
| Fill in all required information in `vX.Y.Z-upgrade-name.ts` (tx hashes, logs, ...). | ||
|
|
||
| 7. **Create a release** | ||
| 8. **Create a release** | ||
| - Use **Release Please** to tag the upgrade version and create the release on GitHub. | ||
|
|
||
|
|
||
| Following these steps ensures upgrades are **safe, traceable, and reproducible**. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Usage: | ||
| # ARBITRUM_SEPOLIA_FORK=true \ | ||
| # UPGRADE_SCRIPT=<script_name> \ | ||
| # bash ./scripts/upgrades/dry-run.sh | ||
|
|
||
|
|
||
| DEPLOYMENTS_FOLDER='' | ||
| if [ "${ARBITRUM_SEPOLIA_FORK}" == "true" ]; then | ||
| DEPLOYMENTS_FOLDER=arbitrumSepolia | ||
| elif [ "${ARBITRUM_FORK}" == "true" ]; then | ||
| DEPLOYMENTS_FOLDER=arbitrum | ||
| fi | ||
| if [ -z "${DEPLOYMENTS_FOLDER}" ]; then | ||
| echo "Error: You must set either ARBITRUM_SEPOLIA_FORK=true or ARBITRUM_FORK=true." | ||
| exit 1 | ||
| fi | ||
| # Copy the forked network deployments to the hardhat network folder. | ||
| rm -rf deployments/hardhat | ||
| cp -r deployments/${DEPLOYMENTS_FOLDER} deployments/hardhat | ||
| # Stage the old deployments to have a clean diff after the upgrade script run. | ||
| cp .gitignore .gitignore.bak | ||
| sed -i.bak '/deployments\/hardhat/d' .gitignore | ||
| git add deployments/hardhat | ||
| # Run the upgrade and print the git diff. | ||
| npx hardhat run scripts/upgrades/${UPGRADE_SCRIPT} --network hardhat | ||
| echo "\n=== Upgrade diff ===" | ||
| git --no-pager diff --name-status | ||
| mv .gitignore.bak .gitignore | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.