Update the registry script#1348
Merged
Merged
Conversation
…hain ID - Add update-registry.ts script to update all contract JSON files - Add GitHub Actions workflow for manual registry updates - Script supports adding chain IDs with deployment types (canonical, eip155, zksync) - Automatically sorts network addresses by chain ID - Creates PR with changes when run via GitHub Actions
- Parse deployment type from version string (e.g., v1.3.0-canonical) - Remove separate deployment_type parameter - Update GitHub Actions workflow to use choice selector for version - Version options: v1.3.0-canonical, v1.3.0-eip155, v1.4.1, v1.5.0
- Import AddressType from types - Update sortNetworkAddresses function signature to use AddressType - Improve type safety by properly casting deploymentType to AddressType - Remove unnecessary 'as any' casts
- Add explicit check to preserve existing deployment type when converting single to array - Add better logging to show when values are preserved - Add safety check to prevent duplicates when adding to arrays - Ensure both canonical and eip155 are kept for v1.3.0 when adding second type
- Add pre-validation phase that checks all contracts before making changes - Early exit if chain ID with deployment type is already fully supported - Clear reporting of which contracts already support the deployment - Prevent unnecessary file writes when nothing needs updating - Better user feedback with summary of what will be updated
- Added chain ID 988 to all contracts in version v1.3.0-canonical
- Introduced a new function to sort deployment types, ensuring "canonical" precedes "eip155" as per company convention for version 1.3.0. - Updated logic in the main function to utilize the new sorting function when adding deployment types to the network addresses. - Enhanced logging to reflect the sorted array of deployment types after updates.
Add chain 988 to v1.3.0-canonical registry
- Updated the sorting function to preserve an existing value as the first element in the array when present. - Adjusted the logic to ensure "eip155" is prioritized when no existing value is provided. - Improved logging to reflect the changes in sorting behavior and array updates.
- Updated chain ID 4326 from 'canonical' to ['eip155', 'canonical'] in all v1.3.0 contract files - Ensures eip155 deployment type is available for chain ID 4326 - Order: eip155 first, then canonical
- Modified the `update-registry` command in `package.json` to include JSON linting after execution. - Removed the JSON formatting step from the GitHub Actions workflow to streamline the process. - Refactored the `update-registry.ts` script for improved readability and efficiency, including adjustments to sorting logic and logging for better clarity.
- Updated the sorting function to use BigInt for chain ID comparisons, improving accuracy for large numbers. - Enhanced error handling by throwing an error when unsupported deployment types are detected, ensuring all contracts must support the specified type before proceeding.
…nt policy - Updated comments in the sorting function to clarify the official policy for deployment types. - Ensured that existing deployments are prioritized to avoid breaking changes and that eip155 is preferred when applicable.
…yment type handling - Eliminated the sortDeploymentTypes function to streamline the logic for updating network addresses. - Updated the handling of existing deployment types to directly append new types without sorting, preserving the first value for consistency.
- Introduced a new step to verify if the user triggering the workflow is a member of the 'safe-global' organization. - Added input parameters for version and chain ID to support workflow calls. - Updated permissions to include read access for members.
… workflow to simplify execution. Updated permissions to remove read access for members.
- Removed JSON linting from the `update-registry` command in package.json for streamlined execution. - Introduced a new command `update-registry:full` to run the update and linting sequentially. - Added JSON linting step in the update-registry GitHub workflow to ensure code quality after deployment.
…cript execution.
…linting after registry updates. Removed JSON linting from the GitHub workflow to streamline the process.
…wing simultaneous updates for both canonical and eip155 deployments. Updated registry update logic and modified commit message formatting for clarity.
nlordell
reviewed
Dec 3, 2025
|
|
||
| **Changes:** | ||
| - Added chain ID `${{ inputs.chain_id }}` to all contract JSON files in `src/assets/${{ inputs.version }}/` | ||
| ${{ inputs.version == 'v1.3.0-both' && format('- Added chain ID `{0}` to all contract JSON files in `src/assets/v1.3.0/` for both canonical and eip155 deployment types', inputs.chain_id) || format('- Added chain ID `{0}` to all contract JSON files in `src/assets/{1}/`', inputs.chain_id, inputs.version) }} |
Contributor
There was a problem hiding this comment.
This doesn't produce correct values for v1.3.0-eip155 or v1.3.0-canonical, why the extra effort to make it work with v1.3.0?
nlordell
reviewed
Dec 3, 2025
| Add chain ${{ inputs.chain_id }} to ${{ inputs.version }} registry | ||
| Add chain ${{ inputs.chain_id }} to ${{ inputs.version == 'v1.3.0-both' && 'v1.3.0 (canonical + eip155)' || inputs.version }} registry | ||
| body: | | ||
| This PR adds chain ID `${{ inputs.chain_id }}` to the registry for version `${{ inputs.version }}`. |
Contributor
There was a problem hiding this comment.
I didn't notice before, but noticed now that PR body doesn't follow our PR template that is required for CI to pass, so networks introduced this way to not pass CI.
…ersion. Simplified registry update logic to handle single version updates and improved commit message formatting for clarity.
…wing simultaneous updates for both canonical and eip155 deployments. Updated logic to conditionally handle version input and improved commit message formatting for clarity.
nlordell
reviewed
Dec 3, 2025
Co-authored-by: Nicholas Rodrigues Lordello <n@lordello.net>
nlordell
reviewed
Dec 3, 2025
Comment on lines
+101
to
+104
| Relevant information: | ||
| - Safe version: ${{ inputs.version }} | ||
| - Generated by: GitHub Actions workflow | ||
| - Files updated: All contract JSON files in the specified version directory |
Contributor
There was a problem hiding this comment.
This is all redundant and not relevant information 😅
nlordell
approved these changes
Dec 3, 2025
Contributor
nlordell
left a comment
There was a problem hiding this comment.
LGTM, just some nits on the PR body, but nothing blocking.
…ion to streamline the process. This change eliminates unnecessary details about the safe version and generated files, focusing on essential inputs for the Chain ID.
nlordell
approved these changes
Dec 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.