From 1a1cc25bd1f827cf0ebb272ffc82635a238e0d58 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Sat, 21 Sep 2024 02:18:17 +0900 Subject: [PATCH] Deprecate `pb.gw.go` files (#14464) * Clean pb.gw.go files * Deprecate pb.gw.go file support --- .policy.yml | 2 -- hack/README.md | 4 ++-- hack/common.sh | 2 +- hack/update-go-pbs.sh | 2 +- proto/eth/v1/attestation.pb.gw.go | 4 ---- proto/eth/v1/beacon_block.pb.gw.go | 4 ---- proto/eth/v1/beacon_chain.pb.gw.go | 4 ---- proto/eth/v1/events.pb.gw.go | 4 ---- proto/eth/v1/node.pb.gw.go | 4 ---- proto/eth/v1/validator.pb.gw.go | 4 ---- proto/eth/v2/beacon_block.pb.gw.go | 4 ---- proto/eth/v2/beacon_chain.pb.gw.go | 4 ---- proto/eth/v2/beacon_lightclient.pb.gw.go | 4 ---- proto/eth/v2/custom.go | 3 ++- proto/eth/v2/ssz.pb.gw.go | 4 ---- proto/eth/v2/sync_committee.pb.gw.go | 4 ---- proto/eth/v2/validator.pb.gw.go | 4 ---- proto/eth/v2/version.pb.gw.go | 4 ---- proto/eth/v2/withdrawals.pb.gw.go | 4 ---- 19 files changed, 6 insertions(+), 63 deletions(-) delete mode 100755 proto/eth/v1/attestation.pb.gw.go delete mode 100755 proto/eth/v1/beacon_block.pb.gw.go delete mode 100755 proto/eth/v1/beacon_chain.pb.gw.go delete mode 100755 proto/eth/v1/events.pb.gw.go delete mode 100755 proto/eth/v1/node.pb.gw.go delete mode 100755 proto/eth/v1/validator.pb.gw.go delete mode 100755 proto/eth/v2/beacon_block.pb.gw.go delete mode 100755 proto/eth/v2/beacon_chain.pb.gw.go delete mode 100755 proto/eth/v2/beacon_lightclient.pb.gw.go delete mode 100755 proto/eth/v2/ssz.pb.gw.go delete mode 100755 proto/eth/v2/sync_committee.pb.gw.go delete mode 100755 proto/eth/v2/validator.pb.gw.go delete mode 100755 proto/eth/v2/version.pb.gw.go delete mode 100755 proto/eth/v2/withdrawals.pb.gw.go diff --git a/.policy.yml b/.policy.yml index 4f76e4865d5a..5fed6dc23393 100644 --- a/.policy.yml +++ b/.policy.yml @@ -26,7 +26,6 @@ approval_rules: only_changed_files: paths: - "*pb.go" - - "*pb.gw.go" - "*.bazel" options: ignore_commits_by: @@ -69,7 +68,6 @@ approval_rules: changed_files: ignore: - "*pb.go" - - "*pb.gw.go" - "*.bazel" options: ignore_commits_by: diff --git a/hack/README.md b/hack/README.md index 6720654d82f4..5cf3ec3b0350 100644 --- a/hack/README.md +++ b/hack/README.md @@ -5,6 +5,6 @@ This subproject contains useful bash scripts for working with our repository. We ## update-go-pbs.sh -This script generates the *.pb.go and *.pb.gw.go files from the *.proto files. -After running `update-go-pbs.sh` keep only the *.pb.go and *pb.gw.go for the protos that have changed before checking in. +This script generates the *.pb.go files from the *.proto files. +After running `update-go-pbs.sh` keep only the *.pb.go for the protos that have changed before checking in. *Note*: the generated files may not have imports correctly linted and will need to be fixed to remote associated errors. \ No newline at end of file diff --git a/hack/common.sh b/hack/common.sh index c4f1bf32c19d..06a70ed7a16d 100644 --- a/hack/common.sh +++ b/hack/common.sh @@ -19,7 +19,7 @@ cygwin*) system="windows" ;; esac readonly system -# Get locations of pb.go and pb.gw.go files. +# Get locations of pb.go files. findutil="find" # On OSX `find` is not GNU find compatible, so require "findutils" package. if [ "$system" == "darwin" ]; then diff --git a/hack/update-go-pbs.sh b/hack/update-go-pbs.sh index 47a009eb9b10..6ab61ba22539 100755 --- a/hack/update-go-pbs.sh +++ b/hack/update-go-pbs.sh @@ -9,7 +9,7 @@ bazel query 'attr(testonly, 0, //proto/...)' | xargs bazel build $@ file_list=() while IFS= read -d $'\0' -r file; do file_list=("${file_list[@]}" "$file") -done < <($findutil -L "$(bazel info bazel-bin)"/proto -type f -regextype sed -regex ".*pb\.\(gw\.\)\?go$" -print0) +done < <($findutil -L "$(bazel info bazel-bin)"/proto -type f -regextype sed -regex ".*pb\.go$" -print0) arraylength=${#file_list[@]} searchstring="prysmaticlabs/prysm/v5/" diff --git a/proto/eth/v1/attestation.pb.gw.go b/proto/eth/v1/attestation.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/attestation.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/beacon_block.pb.gw.go b/proto/eth/v1/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/beacon_chain.pb.gw.go b/proto/eth/v1/beacon_chain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/beacon_chain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/events.pb.gw.go b/proto/eth/v1/events.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/events.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/node.pb.gw.go b/proto/eth/v1/node.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/node.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v1/validator.pb.gw.go b/proto/eth/v1/validator.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v1/validator.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_block.pb.gw.go b/proto/eth/v2/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_chain.pb.gw.go b/proto/eth/v2/beacon_chain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_chain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/beacon_lightclient.pb.gw.go b/proto/eth/v2/beacon_lightclient.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/beacon_lightclient.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/custom.go b/proto/eth/v2/custom.go index f61e764614fa..678b71a39ff5 100644 --- a/proto/eth/v2/custom.go +++ b/proto/eth/v2/custom.go @@ -3,9 +3,10 @@ package eth import ( "bytes" "fmt" - enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" "math/bits" + enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" + v1 "github.com/prysmaticlabs/prysm/v5/proto/eth/v1" ) diff --git a/proto/eth/v2/ssz.pb.gw.go b/proto/eth/v2/ssz.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/ssz.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/sync_committee.pb.gw.go b/proto/eth/v2/sync_committee.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/sync_committee.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/validator.pb.gw.go b/proto/eth/v2/validator.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/validator.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/version.pb.gw.go b/proto/eth/v2/version.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/version.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/eth/v2/withdrawals.pb.gw.go b/proto/eth/v2/withdrawals.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/eth/v2/withdrawals.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore