gRPC Gateway Removal (#14089)

* wip passing e2e

* reverting temp comment

* remove unneeded comments

* fixing merge errors

* fixing more bugs from merge

* fixing test

* WIP moving code around and fixing tests

* unused linting

* gaz

* temp removing these tests as we need placeholder/wrapper APIs for them with the removal of the gateway

* attempting to remove dependencies to gRPC gateway , 1 mroe left in deps.bzl

* renaming flags and other gateway services to http

* goimport

* fixing deepsource

* git mv

* Update validator/package/validator.yaml

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update validator/package/validator.yaml

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update cmd/beacon-chain/flags/base.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update cmd/beacon-chain/flags/base.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update cmd/beacon-chain/flags/base.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing feedback

* missed lint

* renaming import

* reversal based on feedback

* fixing web ui registration

* don't require mux handler

* gaz

* removing gRPC service from validator completely, merged with http service, renames are a work in progress

* updating go.sum

* linting

* trailing white space

* realized there was more cleanup i could do with code reuse

* adding wrapper for routes

* reverting version

* fixing dependencies from merging develop

* gaz

* fixing unit test

* fixing dependencies

* reverting unit test

* fixing conflict

* updating change log

* Update log.go

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* gaz

* Update api/server/httprest/server.go

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* addressing some feedback

* forgot to remove deprecated flag in usage

* gofmt

* fixing test

* fixing deepsource issue

* moving deprecated flag and adding timeout handler

* missed removal of a flag

* fixing test:

* Update CHANGELOG.md

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* addressing feedback

* updating comments based on feedback

* removing unused field for now, we can add it back in if we need to use the option

* removing unused struct

* changing api-timeout flag based on feedback

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
This commit is contained in:
james-prysm
2024-09-04 10:40:31 -05:00
committed by GitHub
parent 963a1b4cb7
commit 45fd3eb1bf
94 changed files with 494 additions and 7751 deletions

View File

@@ -1,12 +0,0 @@
diff --git a/internal/descriptor/apiconfig/BUILD.bazel b/internal/descriptor/apiconfig/BUILD.bazel
index 80dc57a2..76d4374f 100644
--- a/internal/descriptor/apiconfig/BUILD.bazel
+++ b/internal/descriptor/apiconfig/BUILD.bazel
@@ -11,6 +11,7 @@ proto_library(
],
deps = [
"@go_googleapis//google/api:annotations_proto",
+ "@go_googleapis//google/api:http_proto",
],
)

View File

@@ -1,22 +0,0 @@
diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go
index 6d3476df..6392af9a 100644
--- a/protoc-gen-grpc-gateway/internal/gengateway/template.go
+++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go
@@ -243,8 +243,7 @@ It translates gRPC into RESTful JSON APIs.
package {{.GoPkg.Name}}
import (
github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
- emptypb "github.com/golang/protobuf/ptypes/empty"
- "github.com/golang/protobuf/ptypes/empty"
+ "google.golang.org/protobuf/types/known/emptypb"
{{range $i := .Imports}}{{if $i | printf "%q" | ne "github.com/golang/protobuf/ptypes/empty"}}{{$i | printf "%s\n"}}{{end}}{{end}}
)
@@ -257,7 +256,6 @@ var _ = utilities.NewDoubleArray
var _ = metadata.Join
var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
var _ = emptypb.Empty{}
-var _ = empty.Empty{}
`))
handlerTemplate = template.Must(template.New("handler").Parse(`

View File

@@ -1,40 +0,0 @@
diff --git a/protoc-gen-grpc-gateway/internal/gengateway/template.go b/protoc-gen-grpc-gateway/internal/gengateway/template.go
index 6392af9..2d28493 100644
--- a/protoc-gen-grpc-gateway/internal/gengateway/template.go
+++ b/protoc-gen-grpc-gateway/internal/gengateway/template.go
@@ -152,13 +152,13 @@ type trailerParams struct {
func typeFromName(name string) string {
lowerName := strings.ToLower(name)
if strings.Contains(lowerName, "epoch") {
- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch"
+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch"
} else if strings.Contains(lowerName, "slot") {
- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Slot"
+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot"
} else if strings.Contains(lowerName, "committee") {
- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.CommitteeIndex"
+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.CommitteeIndex"
} else if strings.Contains(lowerName, "index") {
- return "github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.ValidatorIndex"
+ return "github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex"
}
return ""
}
@@ -242,7 +242,7 @@ It translates gRPC into RESTful JSON APIs.
*/{{end}}
package {{.GoPkg.Name}}
import (
- github_com_prysmaticlabs_prysm_v4_consensus_types_primitives "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
+ github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"google.golang.org/protobuf/types/known/emptypb"
{{range $i := .Imports}}{{if $i | printf "%q" | ne "github.com/golang/protobuf/ptypes/empty"}}{{$i | printf "%s\n"}}{{end}}{{end}}
)
@@ -254,7 +254,7 @@ var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
-var _ = github_com_prysmaticlabs_prysm_v4_consensus_types_primitives.Epoch(0)
+var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0)
var _ = emptypb.Empty{}
`))