Skip to content

Conversation

@Inspector-Butters
Copy link
Contributor

@Inspector-Butters Inspector-Butters commented Nov 6, 2025

What type of PR is this?
Feature

What does this PR do? Why is it needed?
This PR adds a bash script to automate the prysm version upgrade process.

This is the process that the script is automating:

Migrates the Prysm dependency from OffchainLabs/prysm/vX to OffchainLabs/prysm/vY across the entire codebase.

File Modifications
  • Replaces import paths in all *.bazel, *.go, *.proto files
File Updates
  • Manually updates references in go.mod, .deepsource.toml, hack/update-mockgen.sh, and hack/update-go-pbs.sh
Command Updates
  • Regenerates Bazel deps:
    bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=deps.bzl%prysm_deps -prune=true
  • Cleans and fetches Go deps:
    go mod tidy && go get ./...
  • Regenerates protobufs:
    ./hack/update-go-pbs.sh
  • Cleans bazel files:
    bazel clean --expunge --async
  • Regenerates ssz files:
    ./hack/update-go-ssz.sh
  • Verifies builds:
    go build ./... && bazel build //cmd/beacon-chain //cmd/validator

Co-authored-by: Preston Van Loon <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an automation script to streamline the Prysm version upgrade process from v6 to v7. The script replaces manual find-and-replace operations across multiple file types and ensures all necessary build commands are executed in the correct sequence.

Key Changes:

  • Added hack/upgrade-version.sh script that automates import path updates across .bazel, .go, and .proto files
  • Script handles both file-wide replacements and specific file updates, followed by regeneration of dependencies, protobufs, and SSZ files
  • Added changelog entry documenting the new automation feature

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
hack/upgrade-version.sh Main automation script that performs find-replace operations and executes build/regeneration commands
changelog/bastin_version-upgrade-script.md Changelog entry documenting the new version upgrade automation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

while IFS= read -r -d '' file; do
"${SED_INPLACE[@]}" "s/${OLD_ESCAPED}/${NEW_ESCAPED}/g" "$file"
echo "updated (by ext): $file"
done < <(find . -type f -name "*.${ext}" -print0)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script searches the entire directory tree including potentially large directories like node_modules, .git, or build artifacts. Consider excluding common directories that shouldn't contain Prysm imports, e.g., find . -type f -name \"*.${ext}\" ! -path \"*/node_modules/*\" ! -path \"*/.git/*\" ! -path \"*/bazel-*/*\" -print0.

Suggested change
done < <(find . -type f -name "*.${ext}" -print0)
done < <(find . -type f -name "*.${ext}" \
! -path "*/node_modules/*" \
! -path "*/.git/*" \
! -path "*/bazel-*/*" \
-print0)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants