-
Notifications
You must be signed in to change notification settings - Fork 19
feat: v1.1.0 FWSS upgrade scripts and documentation #384
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
base: main
Are you sure you want to change the base?
Changes from all commits
39619b2
5f6154e
a79de37
608d91e
cbc7641
33f824f
20a168d
f15a275
4b0253f
25ec0bf
d49a18a
d8b9b6d
6a774b8
79055ef
3f41420
38a0caf
77bf6dd
41ee70d
9d05a18
2141519
18086d7
52d1947
9827322
041c9ae
a899196
2fc6bd3
67f2c33
203e00d
4191992
ea506df
08942c1
f8ffc6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
rjan90 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| name: Create Release Issue | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
rjan90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| network: | ||
| description: 'Target network' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - Calibnet | ||
| - Mainnet | ||
| upgrade_type: | ||
| description: 'Type of upgrade' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - Routine | ||
| - Breaking Change | ||
| upgrade_registry: | ||
| description: '(Rare) Also upgrading ServiceProviderRegistry?' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| upgrade_state_view: | ||
| description: '(Rare) Also redeploying FilecoinWarmStorageServiceStateView?' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| after_epoch: | ||
| description: 'AFTER_EPOCH (block number after which upgrade can execute)' | ||
| required: true | ||
| type: string | ||
| changelog_pr: | ||
| description: 'PR number with changelog updates' | ||
| required: true | ||
| type: string | ||
| changes_summary: | ||
| description: 'Summary of changes (use | for multiple lines)' | ||
| required: true | ||
| type: string | ||
| action_required: | ||
| description: 'Action required for integrators (or "None" if no action needed)' | ||
| required: true | ||
| type: string | ||
| default: 'None' | ||
| release_tag: | ||
| description: 'Release tag if already created (usually added after upgrade completes)' | ||
| required: false | ||
| type: string | ||
| dry_run: | ||
| description: 'Dry run (preview issue without creating)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| create-announcement: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Create announcement issue | ||
| id: create_issue | ||
| env: | ||
| NETWORK: ${{ inputs.network }} | ||
| UPGRADE_TYPE: ${{ inputs.upgrade_type }} | ||
| UPGRADE_REGISTRY: ${{ inputs.upgrade_registry }} | ||
| UPGRADE_STATE_VIEW: ${{ inputs.upgrade_state_view }} | ||
| AFTER_EPOCH: ${{ inputs.after_epoch }} | ||
| CHANGELOG_PR: ${{ inputs.changelog_pr }} | ||
| CHANGES_SUMMARY: ${{ inputs.changes_summary }} | ||
| ACTION_REQUIRED: ${{ inputs.action_required }} | ||
| RELEASE_TAG: ${{ inputs.release_tag }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| if [ "${{ inputs.dry_run }}" = "true" ]; then | ||
| node .github/scripts/create-upgrade-announcement.js --dry-run | ||
| else | ||
| node .github/scripts/create-upgrade-announcement.js | ||
| fi | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| echo "## Release Issue ${{ inputs.dry_run == true && '(Dry Run)' || 'Created' }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Network**: ${{ inputs.network }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "**After Epoch**: ${{ inputs.after_epoch }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| if [ "${{ inputs.dry_run }}" = "true" ]; then | ||
| echo "This was a dry run. No issue was created." >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "See the created issue for full details." >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
rjan90 marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add documentation about view contracts/addresses? I didn't see anything in https://github.com/FilOzone/filecoin-services/blob/9a18943b4390e37186fe0715789c38b364ce7f96/service_contracts/tools/README.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,23 @@ | |
|
|
||
| This directory contains scripts for deploying and upgrading the FilecoinWarmStorageService contract on Calibration testnet and Mainnet. | ||
|
|
||
| > **For detailed upgrade procedures**, see [UPGRADE-PROCESS.md](./UPGRADE-PROCESS.md). | ||
|
|
||
| ## Scripts Overview | ||
|
|
||
| ### Available Scripts | ||
| ### Deployment Scripts | ||
|
|
||
| - `deploy-warm-storage-calibnet.sh` - Deploy FilecoinWarmStorageService only (requires existing PDPVerifier and FilecoinPayV1 contracts) | ||
| - `deploy-warm-storage-calibnet.sh` - Deploy FilecoinWarmStorageService to **Calibnet only** (deploys both the ERC1967 proxy and implementation, plus the SignatureVerificationLib library; requires existing PDPVerifier, FilecoinPayV1, FilBeam, SessionKeyRegistry, and ServiceProviderRegistry contracts) | ||
| - `deploy-warm-storage-implementation-only.sh` - Deploy FWSS implementation only; loads defaults from `deployments.json` and writes back new implementation + metadata (reuses existing signature lib unless redeployed) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What networks does it deploy to? I'm asking given some scripts specify a network name in the file name.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can deploy to both. I´m fixing up a lot of the naming issues with regards to the scripts in a PR ontop of this: #414 |
||
| - `deploy-all-warm-storage.sh` - Deploy all contracts to either Calibnet or Mainnet | ||
| - `upgrade-warm-storage-calibnet.sh` - Upgrade existing FilecoinWarmStorageService contract with new proving period parameters | ||
|
|
||
| ### Upgrade Scripts | ||
|
|
||
rjan90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| For the [two step upgrade process](#contract-upgrade-process): | ||
| - `announce-planned-upgrade.sh` - Announce a planned FWSS upgrade (two-step process) | ||
| - `upgrade.sh` - Execute a previously announced FWSS upgrade | ||
| - `announce-planned-upgrade-registry.sh` - Announce a planned ServiceProviderRegistry upgrade | ||
| - `upgrade-registry.sh` - Execute a previously announced registry upgrade | ||
|
|
||
| ### Usage | ||
|
|
||
|
|
@@ -19,8 +29,9 @@ This directory contains scripts for deploying and upgrading the FilecoinWarmStor | |
| # Deploy all contracts | ||
| ./tools/deploy-all-warm-storage.sh | ||
|
|
||
| # Upgrade existing deployment | ||
| ./tools/upgrade-warm-storage-calibnet.sh | ||
| # Upgrade existing deployment (see UPGRADE-PROCESS.md for details) | ||
| ./tools/announce-planned-upgrade.sh # Step 1: Announce | ||
| ./tools/upgrade.sh # Step 2: Execute (after AFTER_EPOCH) | ||
| ``` | ||
|
|
||
| ## Deployment Parameters | ||
|
|
@@ -116,16 +127,13 @@ These scripts now follow forge/cast's environment variable conventions. Set the | |
|
|
||
| ### Required for specific scripts: | ||
| - `deploy-warm-storage-calibnet.sh` requires: | ||
|
|
||
| - `PDP_VERIFIER_PROXY_ADDRESS` - Address of deployed PDPVerifier contract | ||
| - `FILECOIN_PAY_ADDRESS` - Address of deployed FilecoinPayV1 contract | ||
|
|
||
|
|
||
| - `deploy-all-warm-storage.sh` requires: | ||
| - `CHALLENGE_FINALITY` - Challenge finality parameter for PDPVerifier | ||
|
|
||
| - `upgrade-warm-storage-calibnet.sh` requires: | ||
| - `WARM_STORAGE_SERVICE_PROXY_ADDRESS` - Address of existing FilecoinWarmStorageService proxy to upgrade | ||
| - Upgrade scripts - see [UPGRADE-PROCESS.md](./UPGRADE-PROCESS.md) for complete environment variable reference | ||
|
|
||
| ## Usage Examples | ||
|
|
||
|
|
@@ -160,25 +168,24 @@ export FILECOIN_PAY_ADDRESS="0x456..." | |
|
|
||
| ### Upgrade Existing Contract | ||
|
|
||
| ```bash | ||
| export ETH_KEYSTORE="/path/to/keystore.json" | ||
| export PASSWORD="your-password" | ||
| export ETH_RPC_URL="https://api.calibration.node.glif.io/rpc/v1" | ||
| export WARM_STORAGE_SERVICE_PROXY_ADDRESS="0x789..." | ||
| See [UPGRADE-PROCESS.md](./UPGRADE-PROCESS.md) for the complete two-step upgrade workflow. | ||
|
|
||
| # Optional: Custom proving periods | ||
| export MAX_PROVING_PERIOD="240" # 240 epochs for calibnet, 2880 for mainnet | ||
| export CHALLENGE_WINDOW_SIZE="20" # 20 epochs for calibnet, 60 for mainnet | ||
| ## Contract Upgrade Process | ||
|
|
||
| ./upgrade-warm-storage-calibnet.sh | ||
| ``` | ||
| The FilecoinWarmStorageService and ServiceProviderRegistry contracts use a **two-step upgrade process** for security: | ||
|
|
||
| ## Contract Upgrade Process | ||
| 1. **Announce**: Call `announcePlannedUpgrade()` with the new implementation address and a future epoch | ||
| 2. **Execute**: After the announced epoch, call `upgradeToAndCall()` to complete the upgrade | ||
|
|
||
| This gives stakeholders time to review changes before execution. | ||
|
|
||
| The FilecoinWarmStorageService contract uses OpenZeppelin's upgradeable pattern. When upgrading: | ||
| **For complete upgrade documentation**, including: | ||
| - Step-by-step upgrade workflows | ||
| - Environment variable reference | ||
| - Immutable dependency handling | ||
| - Verification procedures | ||
|
|
||
| 1. **Deploy new implementation**: The script deploys a new implementation contract | ||
| 2. **Upgrade proxy**: Uses `upgradeToAndCall` to point the proxy to the new implementation | ||
| See [UPGRADE-PROCESS.md](./UPGRADE-PROCESS.md). | ||
|
|
||
| ## Testing | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.