-
Notifications
You must be signed in to change notification settings - Fork 3
feat: automate contract syncing and migrate contracts display to a table #215
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?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@silent-cipher : when we deploy new contracts does this get updated automatically or is there a manual step? Also, if you want someone to review it, please @mention them or request review. |
|
It's a manual step. When new contracts are deployed, the contract addresses needs to be updated explicitly. |
Ack, ok. It would be good to have that automated, but that's a task for another time. For now we'll document this step as part of doing FilOzone/filecoin-services#346 |
Can we use the deployment.json file in filecoin-service: https://github.com/FilOzone/filecoin-services/blob/main/service_contracts/deployments.json ? Maybe have a GHA that checks them every day? And then open a PR if they have changed? |
|
@silent-cipher : my thought would be that we should list all the FWSS related contracts (which includs pdpVerifier and the SPRegistry for example). I created an issue for this #217 . I think we'll likely need to change the layout, and probably a table is better than cards. |
|
Agreed - listing all FWSS-related contracts makes sense. I’ll incorporate #217 here, and I’m leaning towards using a table instead of cards. |
|
All sounds good @silent-cipher . The part that will need to be clarified is how new |
|
Until now pay.filecoin.cloud was only dependent on filecoin-pay contract. If that changes then it's manual task to update the subgraph ( ui as well if there's schema changes ) and redeploy it. If there's no ui changes then updating subgraph and redeploying it will do the work. |
|
@silent-cipher : apologies, I meant to say: we need to clarify is how new filecoin.cloud (not pay.filecoin.cloud) gets built/deployed if https://github.com/FilOzone/filecoin-services/blob/main/service_contracts/deployments.json changes. |
|
In this PR, I’ve introduced a new github workflow to sync contract addresses with upstream deployments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds automated syncing of on-chain contract addresses from an upstream deployments.json, and updates the Warm Storage Service UI to present all relevant contract addresses in a table.
Changes:
- Introduces
deployments.json+ Zod schema parsing to centralize and validate deployed contract addresses. - Updates chain/contract config to reference validated addresses instead of hardcoded strings.
- Replaces the Warm Storage contract “cards” UI with a TanStack table listing all FWSS-related contracts and links.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/schemas/deployments-schema.ts |
Adds Zod schema for validating deployments JSON and typing addresses as viem Address. |
src/config/deployments.json |
Introduces checked-in contract addresses for mainnet and calibration. |
src/config/deployments.ts |
Parses and exports validated deployments data. |
src/config/chains.ts |
Migrates chain contract address sources to deployments.json and expands contract set. |
src/constants/site-metadata.ts |
Adds source-code URLs for additional contracts displayed in the new table. |
src/app/warm-storage-service/hooks/use-contracts-table-data.ts |
Provides table-ready contract rows including explorer and source links. |
src/app/warm-storage-service/data/contracts-column-definition.tsx |
Defines table columns for contracts list. |
src/app/warm-storage-service/components/WarmStorageContractsTable.tsx |
New TanStack-based contracts table component. |
src/app/warm-storage-service/components/WarmStorageServicesClient.tsx |
Switches UI from contract cards to the new contracts table. |
scripts/sync-contract-addresses.ts |
New script to compare/sync local deployments against upstream and print diffs. |
.github/workflows/sync-contract-addresses.yml |
Adds scheduled workflow to run the script and open/update a PR on changes. |
package.json |
Adds tsx to run the sync script in CI/workflows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 Description
This PR adds
Sync Contract Addressesworkflow to raise a PR for any contract address update in upstream deployments.Also, replaces grid card view by table to show all FWSS related contracts.
🛠️ Key Changes
deployments.jsonwith deployed contract addresses. JSON data is validated by zod schema.WarmStorageContractsTableto display all FWSS related contract addresses into table format. This replaces the Grid Cards with table.📸 Screenshots
Closes #134 #217