From 123e2894260ac56a37f0115d8565bb3b2a122af0 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 14:30:02 -0500 Subject: [PATCH 01/58] wip passing e2e --- BUILD.bazel | 7 - api/gateway/BUILD.bazel | 43 ---- api/gateway/gateway.go | 212 ------------------ api/gateway/modifiers.go | 30 --- api/gateway/options.go | 79 ------- api/grpc/BUILD.bazel | 16 +- api/grpc/grpc.go | 113 ++++++++++ .../gateway_test.go => grpc/grpc_test.go} | 38 +--- api/grpc/grpcutils.go | 59 +++++ api/grpc/grpcutils_test.go | 11 +- api/{gateway => grpc}/log.go | 2 +- api/grpc/options.go | 49 ++++ beacon-chain/gateway/BUILD.bazel | 27 --- beacon-chain/gateway/helpers.go | 78 ------- beacon-chain/gateway/helpers_test.go | 29 --- beacon-chain/node/BUILD.bazel | 3 +- beacon-chain/node/node.go | 36 +-- .../rpc/prysm/v1alpha1/node/BUILD.bazel | 1 - .../rpc/prysm/v1alpha1/node/server_test.go | 3 +- cmd/beacon-chain/flags/BUILD.bazel | 2 +- proto/eth/v1/BUILD.bazel | 13 +- proto/eth/v2/BUILD.bazel | 13 +- .../v1alpha1/validator-client/BUILD.bazel | 34 +-- .../validator-client/keymanager.pb.go | 5 +- testing/endtoend/endtoend_setup_test.go | 1 - validator/node/BUILD.bazel | 5 +- validator/node/node.go | 57 +---- validator/rpc/BUILD.bazel | 2 - validator/rpc/beacon.go | 21 +- validator/rpc/handlers_keymanager_test.go | 11 +- validator/web/handler.go | 1 - 31 files changed, 283 insertions(+), 718 deletions(-) delete mode 100644 api/gateway/BUILD.bazel delete mode 100644 api/gateway/gateway.go delete mode 100644 api/gateway/modifiers.go delete mode 100644 api/gateway/options.go create mode 100644 api/grpc/grpc.go rename api/{gateway/gateway_test.go => grpc/grpc_test.go} (63%) rename api/{gateway => grpc}/log.go (84%) create mode 100644 api/grpc/options.go delete mode 100644 beacon-chain/gateway/BUILD.bazel delete mode 100644 beacon-chain/gateway/helpers.go delete mode 100644 beacon-chain/gateway/helpers_test.go diff --git a/BUILD.bazel b/BUILD.bazel index f3a5ed411f72..f91ae52520aa 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -55,13 +55,6 @@ alias( visibility = ["//visibility:public"], ) -# Protobuf gRPC gateway compiler -alias( - name = "grpc_gateway_proto_compiler", - actual = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - visibility = ["//visibility:public"], -) - gometalinter( name = "gometalinter", config = "//:.gometalinter.json", diff --git a/api/gateway/BUILD.bazel b/api/gateway/BUILD.bazel deleted file mode 100644 index 282e7724da97..000000000000 --- a/api/gateway/BUILD.bazel +++ /dev/null @@ -1,43 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "gateway.go", - "log.go", - "modifiers.go", - "options.go", - ], - importpath = "github.com/prysmaticlabs/prysm/v5/api/gateway", - visibility = [ - "//beacon-chain:__subpackages__", - "//validator:__subpackages__", - ], - deps = [ - "//api/server:go_default_library", - "//runtime:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//connectivity:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - "@org_golang_google_grpc//credentials/insecure:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["gateway_test.go"], - embed = [":go_default_library"], - deps = [ - "//cmd/beacon-chain/flags:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@com_github_urfave_cli_v2//:go_default_library", - ], -) diff --git a/api/gateway/gateway.go b/api/gateway/gateway.go deleted file mode 100644 index a78500c5a030..000000000000 --- a/api/gateway/gateway.go +++ /dev/null @@ -1,212 +0,0 @@ -// Package gateway defines a grpc-gateway server that serves HTTP-JSON traffic and acts a proxy between HTTP and gRPC. -package gateway - -import ( - "context" - "fmt" - "net" - "net/http" - "time" - - "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server" - "github.com/prysmaticlabs/prysm/v5/runtime" - "google.golang.org/grpc" - "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" -) - -var _ runtime.Service = (*Gateway)(nil) - -// PbMux serves grpc-gateway requests for selected patterns using registered protobuf handlers. -type PbMux struct { - Registrations []PbHandlerRegistration // Protobuf registrations to be registered in Mux. - Patterns []string // URL patterns that will be handled by Mux. - Mux *gwruntime.ServeMux // The router that will be used for grpc-gateway requests. -} - -// PbHandlerRegistration is a function that registers a protobuf handler. -type PbHandlerRegistration func(context.Context, *gwruntime.ServeMux, *grpc.ClientConn) error - -// MuxHandler is a function that implements the mux handler functionality. -type MuxHandler func( - h http.HandlerFunc, - w http.ResponseWriter, - req *http.Request, -) - -// Config parameters for setting up the gateway service. -type config struct { - maxCallRecvMsgSize uint64 - remoteCert string - gatewayAddr string - remoteAddr string - allowedOrigins []string - muxHandler MuxHandler - pbHandlers []*PbMux - router *mux.Router - timeout time.Duration -} - -// Gateway is the gRPC gateway to serve HTTP JSON traffic as a proxy and forward it to the gRPC server. -type Gateway struct { - cfg *config - conn *grpc.ClientConn - server *http.Server - cancel context.CancelFunc - ctx context.Context - startFailure error -} - -// New returns a new instance of the Gateway. -func New(ctx context.Context, opts ...Option) (*Gateway, error) { - g := &Gateway{ - ctx: ctx, - cfg: &config{}, - } - for _, opt := range opts { - if err := opt(g); err != nil { - return nil, err - } - } - if g.cfg.router == nil { - g.cfg.router = mux.NewRouter() - } - return g, nil -} - -// Start the gateway service. -func (g *Gateway) Start() { - ctx, cancel := context.WithCancel(g.ctx) - g.cancel = cancel - - conn, err := g.dial(ctx, "tcp", g.cfg.remoteAddr) - if err != nil { - log.WithError(err).Error("Failed to connect to gRPC server") - g.startFailure = err - return - } - g.conn = conn - - for _, h := range g.cfg.pbHandlers { - for _, r := range h.Registrations { - if err := r(ctx, h.Mux, g.conn); err != nil { - log.WithError(err).Error("Failed to register handler") - g.startFailure = err - return - } - } - for _, p := range h.Patterns { - g.cfg.router.PathPrefix(p).Handler(h.Mux) - } - } - - corsMux := server.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) - - if g.cfg.muxHandler != nil { - g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - g.cfg.muxHandler(corsMux.ServeHTTP, w, r) - }) - } - - g.server = &http.Server{ - Addr: g.cfg.gatewayAddr, - Handler: corsMux, - ReadHeaderTimeout: time.Second, - } - - go func() { - log.WithField("address", g.cfg.gatewayAddr).Info("Starting gRPC gateway") - if err := g.server.ListenAndServe(); err != http.ErrServerClosed { - log.WithError(err).Error("Failed to start gRPC gateway") - g.startFailure = err - return - } - }() -} - -// Status of grpc gateway. Returns an error if this service is unhealthy. -func (g *Gateway) Status() error { - if g.startFailure != nil { - return g.startFailure - } - if s := g.conn.GetState(); s != connectivity.Ready { - return fmt.Errorf("grpc server is %s", s) - } - return nil -} - -// Stop the gateway with a graceful shutdown. -func (g *Gateway) Stop() error { - if g.server != nil { - shutdownCtx, shutdownCancel := context.WithTimeout(g.ctx, 2*time.Second) - defer shutdownCancel() - if err := g.server.Shutdown(shutdownCtx); err != nil { - if errors.Is(err, context.DeadlineExceeded) { - log.Warn("Existing connections terminated") - } else { - log.WithError(err).Error("Failed to gracefully shut down server") - } - } - } - if g.cancel != nil { - g.cancel() - } - return nil -} - -// dial the gRPC server. -func (g *Gateway) dial(ctx context.Context, network, addr string) (*grpc.ClientConn, error) { - switch network { - case "tcp": - return g.dialTCP(ctx, addr) - case "unix": - return g.dialUnix(ctx, addr) - default: - return nil, fmt.Errorf("unsupported network type %q", network) - } -} - -// dialTCP creates a client connection via TCP. -// "addr" must be a valid TCP address with a port number. -func (g *Gateway) dialTCP(ctx context.Context, addr string) (*grpc.ClientConn, error) { - var security grpc.DialOption - if len(g.cfg.remoteCert) > 0 { - creds, err := credentials.NewClientTLSFromFile(g.cfg.remoteCert, "") - if err != nil { - return nil, err - } - security = grpc.WithTransportCredentials(creds) - } else { - // Use insecure credentials when there's no remote cert provided. - security = grpc.WithTransportCredentials(insecure.NewCredentials()) - } - opts := []grpc.DialOption{ - security, - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(int(g.cfg.maxCallRecvMsgSize))), - } - return grpc.DialContext(ctx, addr, opts...) -} - -// dialUnix creates a client connection via a unix domain socket. -// "addr" must be a valid path to the socket. -func (g *Gateway) dialUnix(ctx context.Context, addr string) (*grpc.ClientConn, error) { - d := func(addr string, timeout time.Duration) (net.Conn, error) { - return net.DialTimeout("unix", addr, timeout) - } - f := func(ctx context.Context, addr string) (net.Conn, error) { - if deadline, ok := ctx.Deadline(); ok { - return d(addr, time.Until(deadline)) - } - return d(addr, 0) - } - opts := []grpc.DialOption{ - grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithContextDialer(f), - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(int(g.cfg.maxCallRecvMsgSize))), - } - return grpc.DialContext(ctx, addr, opts...) -} diff --git a/api/gateway/modifiers.go b/api/gateway/modifiers.go deleted file mode 100644 index dab4e608942f..000000000000 --- a/api/gateway/modifiers.go +++ /dev/null @@ -1,30 +0,0 @@ -package gateway - -import ( - "context" - "net/http" - "strconv" - - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "google.golang.org/protobuf/proto" -) - -func HttpResponseModifier(ctx context.Context, w http.ResponseWriter, _ proto.Message) error { - md, ok := gwruntime.ServerMetadataFromContext(ctx) - if !ok { - return nil - } - // set http status code - if vals := md.HeaderMD.Get("x-http-code"); len(vals) > 0 { - code, err := strconv.Atoi(vals[0]) - if err != nil { - return err - } - // delete the headers to not expose any grpc-metadata in http response - delete(md.HeaderMD, "x-http-code") - delete(w.Header(), "Grpc-Metadata-X-Http-Code") - w.WriteHeader(code) - } - - return nil -} diff --git a/api/gateway/options.go b/api/gateway/options.go deleted file mode 100644 index f029314214f7..000000000000 --- a/api/gateway/options.go +++ /dev/null @@ -1,79 +0,0 @@ -package gateway - -import ( - "time" - - "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" -) - -type Option func(g *Gateway) error - -func WithPbHandlers(handlers []*PbMux) Option { - return func(g *Gateway) error { - g.cfg.pbHandlers = handlers - return nil - } -} - -func WithMuxHandler(m MuxHandler) Option { - return func(g *Gateway) error { - g.cfg.muxHandler = m - return nil - } -} - -func WithGatewayAddr(addr string) Option { - return func(g *Gateway) error { - g.cfg.gatewayAddr = addr - return nil - } -} - -func WithRemoteAddr(addr string) Option { - return func(g *Gateway) error { - g.cfg.remoteAddr = addr - return nil - } -} - -// WithRouter allows adding a custom mux router to the gateway. -func WithRouter(r *mux.Router) Option { - return func(g *Gateway) error { - g.cfg.router = r - return nil - } -} - -// WithAllowedOrigins allows adding a set of allowed origins to the gateway. -func WithAllowedOrigins(origins []string) Option { - return func(g *Gateway) error { - g.cfg.allowedOrigins = origins - return nil - } -} - -// WithRemoteCert allows adding a custom certificate to the gateway, -func WithRemoteCert(cert string) Option { - return func(g *Gateway) error { - g.cfg.remoteCert = cert - return nil - } -} - -// WithMaxCallRecvMsgSize allows specifying the maximum allowed gRPC message size. -func WithMaxCallRecvMsgSize(size uint64) Option { - return func(g *Gateway) error { - g.cfg.maxCallRecvMsgSize = size - return nil - } -} - -// WithTimeout allows changing the timeout value for API calls. -func WithTimeout(seconds uint64) Option { - return func(g *Gateway) error { - g.cfg.timeout = time.Second * time.Duration(seconds) - gwruntime.DefaultContextTimeout = time.Second * time.Duration(seconds) - return nil - } -} diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index 6ee34f669937..84c5e5e084de 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -3,12 +3,20 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "grpc.go", "grpcutils.go", + "log.go", + "options.go", "parameters.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/api/grpc", visibility = ["//visibility:public"], deps = [ + "//api/server:go_default_library", + "//runtime:go_default_library", + "@com_github_gorilla_mux//:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", + "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", @@ -17,13 +25,17 @@ go_library( go_test( name = "go_default_test", - srcs = ["grpcutils_test.go"], + srcs = [ + "grpc_test.go", + "grpcutils_test.go", + ], embed = [":go_default_library"], deps = [ + "//cmd/beacon-chain/flags:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", + "@com_github_urfave_cli_v2//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", ], diff --git a/api/grpc/grpc.go b/api/grpc/grpc.go new file mode 100644 index 000000000000..5f43b63fdd84 --- /dev/null +++ b/api/grpc/grpc.go @@ -0,0 +1,113 @@ +// Package gateway defines a grpc-gateway server that serves HTTP-JSON traffic and acts a proxy between HTTP and gRPC. +package grpc + +import ( + "context" + "net/http" + "time" + + "github.com/gorilla/mux" + "github.com/pkg/errors" + "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/runtime" +) + +var _ runtime.Service = (*Server)(nil) + +// MuxHandler is a function that implements the mux handler functionality. +type MuxHandler func( + h http.HandlerFunc, + w http.ResponseWriter, + req *http.Request, +) + +// Config parameters for setting up the gateway service. +type config struct { + gatewayAddr string + allowedOrigins []string + muxHandler MuxHandler + router *mux.Router + timeout time.Duration +} + +// Server is the gRPC gateway to serve HTTP JSON traffic as a proxy and forward it to the gRPC server. +type Server struct { + cfg *config + server *http.Server + cancel context.CancelFunc + ctx context.Context + startFailure error +} + +// New returns a new instance of the Server. +func New(ctx context.Context, opts ...Option) (*Server, error) { + g := &Server{ + ctx: ctx, + cfg: &config{}, + } + for _, opt := range opts { + if err := opt(g); err != nil { + return nil, err + } + } + // TODO: this is a codesmell ( we should always have a router here) + if g.cfg.router == nil { + g.cfg.router = mux.NewRouter() + } + + corsMux := server.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) + // TODO: actually use the timeout config provided + g.server = &http.Server{ + Addr: g.cfg.gatewayAddr, + Handler: corsMux, + ReadHeaderTimeout: time.Second, + } + if g.cfg.muxHandler != nil { // rest APIS and Web UI registration + g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + g.cfg.muxHandler(corsMux.ServeHTTP, w, r) + }) + } + return g, nil +} + +// Start the gateway service. +func (g *Server) Start() { + _, cancel := context.WithCancel(g.ctx) + g.cancel = cancel + + go func() { + log.WithField("address", g.cfg.gatewayAddr).Info("Starting gRPC gateway") + if err := g.server.ListenAndServe(); err != http.ErrServerClosed { + log.WithError(err).Error("Failed to start gRPC gateway") + g.startFailure = err + return + } + }() +} + +// Status of grpc gateway. Returns an error if this service is unhealthy. +func (g *Server) Status() error { + if g.startFailure != nil { + return g.startFailure + } + return nil +} + +// Stop the gateway with a graceful shutdown. +func (g *Server) Stop() error { + if g.server != nil { + shutdownCtx, shutdownCancel := context.WithTimeout(g.ctx, 2*time.Second) + defer shutdownCancel() + if err := g.server.Shutdown(shutdownCtx); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + log.Warn("Existing connections terminated") + } else { + log.WithError(err).Error("Failed to gracefully shut down server") + } + } + } + if g.cancel != nil { + g.cancel() + } + return nil +} diff --git a/api/gateway/gateway_test.go b/api/grpc/grpc_test.go similarity index 63% rename from api/gateway/gateway_test.go rename to api/grpc/grpc_test.go index d03d0dc28448..c14d9d965acf 100644 --- a/api/gateway/gateway_test.go +++ b/api/grpc/grpc_test.go @@ -1,4 +1,4 @@ -package gateway +package grpc import ( "context" @@ -9,7 +9,6 @@ import ( "net/url" "testing" - "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -17,35 +16,6 @@ import ( "github.com/urfave/cli/v2" ) -func TestGateway_Customized(t *testing.T) { - r := mux.NewRouter() - cert := "cert" - origins := []string{"origin"} - size := uint64(100) - - opts := []Option{ - WithRouter(r), - WithRemoteCert(cert), - WithAllowedOrigins(origins), - WithMaxCallRecvMsgSize(size), - WithMuxHandler(func( - _ http.HandlerFunc, - _ http.ResponseWriter, - _ *http.Request, - ) { - }), - } - - g, err := New(context.Background(), opts...) - require.NoError(t, err) - - assert.Equal(t, r, g.cfg.router) - assert.Equal(t, cert, g.cfg.remoteCert) - require.Equal(t, 1, len(g.cfg.allowedOrigins)) - assert.Equal(t, origins[0], g.cfg.allowedOrigins[0]) - assert.Equal(t, size, g.cfg.maxCallRecvMsgSize) -} - func TestGateway_StartStop(t *testing.T) { hook := logTest.NewGlobal() @@ -55,13 +25,10 @@ func TestGateway_StartStop(t *testing.T) { gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - rpcHost := ctx.String(flags.RPCHost.Name) - selfAddress := fmt.Sprintf("%s:%d", rpcHost, ctx.Int(flags.RPCPort.Name)) gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) opts := []Option{ WithGatewayAddr(gatewayAddress), - WithRemoteAddr(selfAddress), WithMuxHandler(func( _ http.HandlerFunc, _ http.ResponseWriter, @@ -89,13 +56,10 @@ func TestGateway_NilHandler_NotFoundHandlerRegistered(t *testing.T) { gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - rpcHost := ctx.String(flags.RPCHost.Name) - selfAddress := fmt.Sprintf("%s:%d", rpcHost, ctx.Int(flags.RPCPort.Name)) gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) opts := []Option{ WithGatewayAddr(gatewayAddress), - WithRemoteAddr(selfAddress), } g, err := New(context.Background(), opts...) diff --git a/api/grpc/grpcutils.go b/api/grpc/grpcutils.go index 53378b6c1a5f..1a93179e6a49 100644 --- a/api/grpc/grpcutils.go +++ b/api/grpc/grpcutils.go @@ -94,3 +94,62 @@ func AppendCustomErrorHeader(ctx context.Context, errorData interface{}) error { } return nil } + +// +//// MuxConfig contains configuration that should be used when registering the beacon node in the gateway. +//type MuxConfig struct { +// EthPbMux *PbMux +// V1AlphaPbMux *PbMux +//} +// +//// DefaultConfig returns a fully configured MuxConfig with standard gateway behavior. +//func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig { +// var v1AlphaPbHandler, ethPbHandler *PbMux +// if flags.EnableHTTPPrysmAPI(httpModules) { +// v1AlphaRegistrations := []PbHandlerRegistration{ +// ethpbalpha.RegisterNodeHandler, +// ethpbalpha.RegisterBeaconChainHandler, +// ethpbalpha.RegisterBeaconNodeValidatorHandler, +// ethpbalpha.RegisterHealthHandler, +// } +// if enableDebugRPCEndpoints { +// v1AlphaRegistrations = append(v1AlphaRegistrations, ethpbalpha.RegisterDebugHandler) +// } +// v1AlphaMux := gwruntime.NewServeMux( +// gwruntime.WithMarshalerOption( +// api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, +// ), +// ) +// v1AlphaPbHandler = &PbMux{ +// Registrations: v1AlphaRegistrations, +// Patterns: []string{"/eth/v1alpha1/", "/eth/v1alpha2/"}, +// Mux: v1AlphaMux, +// } +// } +// if flags.EnableHTTPEthAPI(httpModules) { +// ethRegistrations := []PbHandlerRegistration{} +// ethMux := gwruntime.NewServeMux( +// gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ +// Marshaler: &gwruntime.JSONPb{ +// MarshalOptions: protojson.MarshalOptions{ +// UseProtoNames: true, +// EmitUnpopulated: true, +// }, +// UnmarshalOptions: protojson.UnmarshalOptions{ +// DiscardUnknown: true, +// }, +// }, +// }), +// ) +// ethPbHandler = &PbMux{ +// Registrations: ethRegistrations, +// Patterns: []string{"/internal/eth/v1/", "/internal/eth/v2/"}, +// Mux: ethMux, +// } +// } +// +// return MuxConfig{ +// EthPbMux: ethPbHandler, +// V1AlphaPbMux: v1AlphaPbHandler, +// } +//} diff --git a/api/grpc/grpcutils_test.go b/api/grpc/grpcutils_test.go index b7094319b4c1..0da3a3a19b3c 100644 --- a/api/grpc/grpcutils_test.go +++ b/api/grpc/grpcutils_test.go @@ -6,7 +6,6 @@ import ( "strings" "testing" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" logTest "github.com/sirupsen/logrus/hooks/test" @@ -64,15 +63,15 @@ func TestAppendHeaders(t *testing.T) { } func TestAppendCustomErrorHeader(t *testing.T) { - stream := &runtime.ServerTransportStream{} - ctx := grpc.NewContextWithServerTransportStream(context.Background(), stream) + ctx := context.Background() + stream := grpc.ServerTransportStreamFromContext(ctx) + ctx = grpc.NewContextWithServerTransportStream(ctx, stream) data := &customErrorData{Message: "foo"} require.NoError(t, AppendCustomErrorHeader(ctx, data)) // The stream used in test setup sets the metadata key in lowercase. - value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] + md, ok := metadata.FromIncomingContext(ctx) require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") expected, err := json.Marshal(data) require.NoError(t, err) - assert.Equal(t, string(expected), value[0]) - + assert.Equal(t, string(expected), md.Get(strings.ToLower(CustomErrorMetadataKey))[0]) } diff --git a/api/gateway/log.go b/api/grpc/log.go similarity index 84% rename from api/gateway/log.go rename to api/grpc/log.go index fe3dcc54cd4d..3b61356ce501 100644 --- a/api/gateway/log.go +++ b/api/grpc/log.go @@ -1,4 +1,4 @@ -package gateway +package grpc import "github.com/sirupsen/logrus" diff --git a/api/grpc/options.go b/api/grpc/options.go new file mode 100644 index 000000000000..315f91ccac92 --- /dev/null +++ b/api/grpc/options.go @@ -0,0 +1,49 @@ +package grpc + +import ( + "time" + + "github.com/gorilla/mux" + gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" +) + +type Option func(g *Server) error + +func WithMuxHandler(m MuxHandler) Option { + return func(g *Server) error { + g.cfg.muxHandler = m + return nil + } +} + +func WithGatewayAddr(addr string) Option { + return func(g *Server) error { + g.cfg.gatewayAddr = addr + return nil + } +} + +// WithRouter allows adding a custom mux router to the gateway. +func WithRouter(r *mux.Router) Option { + return func(g *Server) error { + g.cfg.router = r + return nil + } +} + +// WithAllowedOrigins allows adding a set of allowed origins to the gateway. +func WithAllowedOrigins(origins []string) Option { + return func(g *Server) error { + g.cfg.allowedOrigins = origins + return nil + } +} + +// WithTimeout allows changing the timeout value for API calls. +func WithTimeout(seconds uint64) Option { + return func(g *Server) error { + g.cfg.timeout = time.Second * time.Duration(seconds) + gwruntime.DefaultContextTimeout = time.Second * time.Duration(seconds) + return nil + } +} diff --git a/beacon-chain/gateway/BUILD.bazel b/beacon-chain/gateway/BUILD.bazel deleted file mode 100644 index 60df0caac826..000000000000 --- a/beacon-chain/gateway/BUILD.bazel +++ /dev/null @@ -1,27 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["helpers.go"], - importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/gateway", - visibility = ["//beacon-chain:__subpackages__"], - deps = [ - "//api:go_default_library", - "//api/gateway:go_default_library", - "//cmd/beacon-chain/flags:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["helpers_test.go"], - embed = [":go_default_library"], - deps = [ - "//api/gateway:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - ], -) diff --git a/beacon-chain/gateway/helpers.go b/beacon-chain/gateway/helpers.go deleted file mode 100644 index fb74f2a8e6eb..000000000000 --- a/beacon-chain/gateway/helpers.go +++ /dev/null @@ -1,78 +0,0 @@ -package gateway - -import ( - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" - ethpbalpha "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - "google.golang.org/protobuf/encoding/protojson" -) - -// MuxConfig contains configuration that should be used when registering the beacon node in the gateway. -type MuxConfig struct { - EthPbMux *gateway.PbMux - V1AlphaPbMux *gateway.PbMux -} - -// DefaultConfig returns a fully configured MuxConfig with standard gateway behavior. -func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig { - var v1AlphaPbHandler, ethPbHandler *gateway.PbMux - if flags.EnableHTTPPrysmAPI(httpModules) { - v1AlphaRegistrations := []gateway.PbHandlerRegistration{ - ethpbalpha.RegisterNodeHandler, - ethpbalpha.RegisterBeaconChainHandler, - ethpbalpha.RegisterBeaconNodeValidatorHandler, - ethpbalpha.RegisterHealthHandler, - } - if enableDebugRPCEndpoints { - v1AlphaRegistrations = append(v1AlphaRegistrations, ethpbalpha.RegisterDebugHandler) - } - v1AlphaMux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - gwruntime.WithMarshalerOption( - api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, - ), - ) - v1AlphaPbHandler = &gateway.PbMux{ - Registrations: v1AlphaRegistrations, - Patterns: []string{"/eth/v1alpha1/", "/eth/v1alpha2/"}, - Mux: v1AlphaMux, - } - } - if flags.EnableHTTPEthAPI(httpModules) { - ethRegistrations := []gateway.PbHandlerRegistration{} - ethMux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - UseProtoNames: true, - EmitUnpopulated: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - ) - ethPbHandler = &gateway.PbMux{ - Registrations: ethRegistrations, - Patterns: []string{"/internal/eth/v1/", "/internal/eth/v2/"}, - Mux: ethMux, - } - } - - return MuxConfig{ - EthPbMux: ethPbHandler, - V1AlphaPbMux: v1AlphaPbHandler, - } -} diff --git a/beacon-chain/gateway/helpers_test.go b/beacon-chain/gateway/helpers_test.go deleted file mode 100644 index e5d076790047..000000000000 --- a/beacon-chain/gateway/helpers_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package gateway - -import ( - "testing" - - "github.com/prysmaticlabs/prysm/v5/api/gateway" - "github.com/prysmaticlabs/prysm/v5/testing/assert" - "github.com/prysmaticlabs/prysm/v5/testing/require" -) - -func TestDefaultConfig(t *testing.T) { - t.Run("Without Prysm API", func(t *testing.T) { - cfg := DefaultConfig(true, "eth") - assert.NotNil(t, cfg.EthPbMux.Mux) - require.Equal(t, 2, len(cfg.EthPbMux.Patterns)) - assert.Equal(t, "/internal/eth/v1/", cfg.EthPbMux.Patterns[0]) - assert.Equal(t, 0, len(cfg.EthPbMux.Registrations)) - assert.Equal(t, (*gateway.PbMux)(nil), cfg.V1AlphaPbMux) - }) - t.Run("Without Eth API", func(t *testing.T) { - cfg := DefaultConfig(true, "prysm") - assert.Equal(t, (*gateway.PbMux)(nil), cfg.EthPbMux) - assert.NotNil(t, cfg.V1AlphaPbMux.Mux) - require.Equal(t, 2, len(cfg.V1AlphaPbMux.Patterns)) - assert.Equal(t, "/eth/v1alpha1/", cfg.V1AlphaPbMux.Patterns[0]) - assert.Equal(t, "/eth/v1alpha2/", cfg.V1AlphaPbMux.Patterns[1]) - assert.Equal(t, 5, len(cfg.V1AlphaPbMux.Registrations)) - }) -} diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 114f8e759eb3..f3d913a1e4d6 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -15,7 +15,7 @@ go_library( "//cmd/beacon-chain:__subpackages__", ], deps = [ - "//api/gateway:go_default_library", + "//api/grpc:go_default_library", "//api/server:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", @@ -30,7 +30,6 @@ go_library( "//beacon-chain/execution:go_default_library", "//beacon-chain/forkchoice:go_default_library", "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", - "//beacon-chain/gateway:go_default_library", "//beacon-chain/monitor:go_default_library", "//beacon-chain/node/registration:go_default_library", "//beacon-chain/operations/attestations:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 5c498a717585..a4148276e81b 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" - apigateway "github.com/prysmaticlabs/prysm/v5/api/gateway" + "github.com/prysmaticlabs/prysm/v5/api/grpc" "github.com/prysmaticlabs/prysm/v5/api/server" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" @@ -34,7 +34,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/execution" "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/gateway" "github.com/prysmaticlabs/prysm/v5/beacon-chain/monitor" "github.com/prysmaticlabs/prysm/v5/beacon-chain/node/registration" "github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations" @@ -1054,38 +1053,17 @@ func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { } gatewayHost := b.cliCtx.String(flags.GRPCGatewayHost.Name) gatewayPort := b.cliCtx.Int(flags.GRPCGatewayPort.Name) - rpcHost := b.cliCtx.String(flags.RPCHost.Name) - rpcPort := b.cliCtx.Int(flags.RPCPort.Name) - - selfAddress := net.JoinHostPort(rpcHost, strconv.Itoa(rpcPort)) gatewayAddress := net.JoinHostPort(gatewayHost, strconv.Itoa(gatewayPort)) allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") - enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name) - selfCert := b.cliCtx.String(flags.CertFlag.Name) - maxCallSize := b.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - httpModules := b.cliCtx.String(flags.HTTPModules.Name) timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - gatewayConfig := gateway.DefaultConfig(enableDebugRPCEndpoints, httpModules) - muxs := make([]*apigateway.PbMux, 0) - if gatewayConfig.V1AlphaPbMux != nil { - muxs = append(muxs, gatewayConfig.V1AlphaPbMux) - } - if gatewayConfig.EthPbMux != nil { - muxs = append(muxs, gatewayConfig.EthPbMux) - } - - opts := []apigateway.Option{ - apigateway.WithRouter(router), - apigateway.WithGatewayAddr(gatewayAddress), - apigateway.WithRemoteAddr(selfAddress), - apigateway.WithPbHandlers(muxs), - apigateway.WithRemoteCert(selfCert), - apigateway.WithMaxCallRecvMsgSize(maxCallSize), - apigateway.WithAllowedOrigins(allowedOrigins), - apigateway.WithTimeout(uint64(timeout)), + opts := []grpc.Option{ + grpc.WithRouter(router), + grpc.WithGatewayAddr(gatewayAddress), + grpc.WithAllowedOrigins(allowedOrigins), + grpc.WithTimeout(uint64(timeout)), } - g, err := apigateway.New(b.ctx, opts...) + g, err := grpc.New(b.ctx, opts...) if err != nil { return err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index 428753ab1481..c77f196f2a26 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -47,7 +47,6 @@ go_test( "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//reflection:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 1d99a2e7b3ab..a919d2ef5c0a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -10,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" @@ -204,7 +203,7 @@ func TestNodeServer_GetHealth(t *testing.T) { } ethpb.RegisterNodeServer(server, ns) reflection.Register(server) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) _, err := ns.GetHealth(ctx, ðpb.HealthRequest{SyncingStatus: tt.customStatus}) if tt.wantedErr == "" { require.NoError(t, err) diff --git a/cmd/beacon-chain/flags/BUILD.bazel b/cmd/beacon-chain/flags/BUILD.bazel index 0dfdcd088e4c..2385a70931c2 100644 --- a/cmd/beacon-chain/flags/BUILD.bazel +++ b/cmd/beacon-chain/flags/BUILD.bazel @@ -11,7 +11,7 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags", visibility = [ - "//api/gateway:__pkg__", + "//api:__subpackages__", "//beacon-chain:__subpackages__", "//cmd/beacon-chain:__subpackages__", "//testing/endtoend:__subpackages__", diff --git a/proto/eth/v1/BUILD.bazel b/proto/eth/v1/BUILD.bazel index 8db674d4cfb0..87dd2f68c9d4 100644 --- a/proto/eth/v1/BUILD.bazel +++ b/proto/eth/v1/BUILD.bazel @@ -83,24 +83,13 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1", - protos = [":proto"], - visibility = ["//proto:__subpackages__"], -) - go_library( name = "go_default_library", srcs = [ ":ssz_generated_files", ], embed = [ - ":go_grpc_gateway_library", + ":go_proto", ], importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v1", visibility = ["//visibility:public"], diff --git a/proto/eth/v2/BUILD.bazel b/proto/eth/v2/BUILD.bazel index 70099df14b76..3e8a41ec95bb 100644 --- a/proto/eth/v2/BUILD.bazel +++ b/proto/eth/v2/BUILD.bazel @@ -72,23 +72,12 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2", - protos = [":proto"], - visibility = ["//proto:__subpackages__"], -) - go_library( name = "go_default_library", srcs = [ ":ssz_generated_files", ], - embed = [":go_grpc_gateway_library"], + embed = [":go_proto"], importpath = "github.com/prysmaticlabs/prysm/v5/proto/eth/v2", visibility = ["//visibility:public"], deps = SSZ_DEPS, diff --git a/proto/prysm/v1alpha1/validator-client/BUILD.bazel b/proto/prysm/v1alpha1/validator-client/BUILD.bazel index bd4607d598bc..df99b795100a 100644 --- a/proto/prysm/v1alpha1/validator-client/BUILD.bazel +++ b/proto/prysm/v1alpha1/validator-client/BUILD.bazel @@ -11,11 +11,6 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") -############################################################################## -# OpenAPI (Swagger) V2 -############################################################################## -load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2") - proto_library( name = "proto", srcs = [ @@ -25,7 +20,6 @@ proto_library( deps = [ "//proto/eth/ext:proto", "//proto/prysm/v1alpha1:proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:empty_proto", @@ -49,7 +43,6 @@ go_proto_library( "//proto/eth/ext:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -63,35 +56,13 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client", - protos = [":proto"], - visibility = ["//visibility:private"], - deps = [ - "//proto/eth/ext:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@googleapis//google/api:annotations_go_proto", - "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", - "@io_bazel_rules_go//proto/wkt:empty_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - ], -) - go_library( name = "go_default_library", srcs = [ "interface.go", ], embed = [ - ":go_grpc_gateway_library", + ":go_proto", ], importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client", visibility = ["//visibility:public"], @@ -99,9 +70,6 @@ go_library( "//proto/eth/ext:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go index caf68d3882f1..e0906f5541f3 100755 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.go +++ b/proto/prysm/v1alpha1/validator-client/keymanager.pb.go @@ -16,7 +16,6 @@ import ( v1alpha1 "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/wrapperspb" ) const ( @@ -673,9 +672,7 @@ var file_proto_prysm_v1alpha1_validator_client_keymanager_proto_rawDesc = []byte 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x6b, 0x65, 0x79, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x1b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x65, 0x78, 0x74, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x74, 0x74, 0x65, diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index b4518853e1a7..cb4f686c2489 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -57,7 +57,6 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 759ad23a593b..1611fff2f19b 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -36,7 +36,7 @@ go_library( ], deps = [ "//api:go_default_library", - "//api/gateway:go_default_library", + "//api/grpc:go_default_library", "//api/server:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", @@ -51,7 +51,6 @@ go_library( "//monitoring/backup:go_default_library", "//monitoring/prometheus:go_default_library", "//monitoring/tracing:go_default_library", - "//proto/prysm/v1alpha1:go_default_library", "//runtime:go_default_library", "//runtime/debug:go_default_library", "//runtime/prereqs:go_default_library", @@ -69,11 +68,9 @@ go_library( "//validator/web:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_fastssz//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", - "@org_golang_google_protobuf//encoding/protojson:go_default_library", ], ) diff --git a/validator/node/node.go b/validator/node/node.go index aee6e841f718..9d2499d66e36 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -20,11 +20,10 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/gateway" + "github.com/prysmaticlabs/prysm/v5/api/grpc" "github.com/prysmaticlabs/prysm/v5/api/server" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" @@ -39,7 +38,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/monitoring/backup" "github.com/prysmaticlabs/prysm/v5/monitoring/prometheus" tracing2 "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" - pb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/runtime" "github.com/prysmaticlabs/prysm/v5/runtime/debug" "github.com/prysmaticlabs/prysm/v5/runtime/prereqs" @@ -57,7 +55,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/web" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" - "google.golang.org/protobuf/encoding/protojson" ) // ValidatorClient defines an instance of an Ethereum validator that manages @@ -657,9 +654,6 @@ func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { ) } gatewayPort := c.cliCtx.Int(flags.GRPCGatewayPort.Name) - rpcHost := c.cliCtx.String(flags.RPCHost.Name) - rpcPort := c.cliCtx.Int(flags.RPCPort.Name) - rpcAddr := net.JoinHostPort(rpcHost, fmt.Sprintf("%d", rpcPort)) gatewayAddress := net.JoinHostPort(gatewayHost, fmt.Sprintf("%d", gatewayPort)) timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) var allowedOrigins []string @@ -668,56 +662,27 @@ func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { } else { allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") } - maxCallSize := c.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name) - - registrations := []gateway.PbHandlerRegistration{ - pb.RegisterHealthHandler, - } - gwmux := gwruntime.NewServeMux( - gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ - Marshaler: &gwruntime.JSONPb{ - MarshalOptions: protojson.MarshalOptions{ - EmitUnpopulated: true, - UseProtoNames: true, - }, - UnmarshalOptions: protojson.UnmarshalOptions{ - DiscardUnknown: true, - }, - }, - }), - gwruntime.WithMarshalerOption( - api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, // TODO: remove this - ), - gwruntime.WithForwardResponseOption(gateway.HttpResponseModifier), - ) muxHandler := func(h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { - // The validator gateway handler requires this special logic as it serves the web APIs and the web UI. + // The validator api handler requires this special logic as it serves the web APIs and the web UI. if strings.HasPrefix(req.URL.Path, "/api") { - req.URL.Path = strings.Replace(req.URL.Path, "/api", "", 1) + req.URL.Path = strings.Replace(req.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs // Else, we handle with the Prysm API gateway without a middleware. - h(w, req) + h(w, req) //TODO: test this handler wrapper ... } else { // Finally, we handle with the web server. web.Handler(w, req) } } - pbHandler := &gateway.PbMux{ - Registrations: registrations, - Mux: gwmux, - } - opts := []gateway.Option{ - gateway.WithMuxHandler(muxHandler), - gateway.WithRouter(router), // note some routes are registered in server.go - gateway.WithRemoteAddr(rpcAddr), - gateway.WithGatewayAddr(gatewayAddress), - gateway.WithMaxCallRecvMsgSize(maxCallSize), - gateway.WithPbHandlers([]*gateway.PbMux{pbHandler}), - gateway.WithAllowedOrigins(allowedOrigins), - gateway.WithTimeout(uint64(timeout)), + opts := []grpc.Option{ + grpc.WithMuxHandler(muxHandler), + grpc.WithRouter(router), // note some routes are registered in server.go + grpc.WithGatewayAddr(gatewayAddress), + grpc.WithAllowedOrigins(allowedOrigins), + grpc.WithTimeout(uint64(timeout)), } - gw, err := gateway.New(c.cliCtx.Context, opts...) + gw, err := grpc.New(c.cliCtx.Context, opts...) if err != nil { return err } diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 5c07cd7a9c09..6f63f55d531f 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -50,7 +50,6 @@ go_library( "//validator/accounts/petnames:go_default_library", "//validator/accounts/wallet:go_default_library", "//validator/client:go_default_library", - "//validator/client/beacon-api:go_default_library", "//validator/client/beacon-chain-client-factory:go_default_library", "//validator/client/iface:go_default_library", "//validator/client/node-client-factory:go_default_library", @@ -144,7 +143,6 @@ go_test( "@com_github_golang_protobuf//ptypes/empty", "@com_github_google_uuid//:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index 5ae024d3011a..fe5795e5a170 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -1,8 +1,6 @@ package rpc import ( - "net/http" - middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/retry" grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" @@ -11,7 +9,6 @@ import ( grpcutil "github.com/prysmaticlabs/prysm/v5/api/grpc" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client" - beaconApi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" beaconChainClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-chain-client-factory" nodeClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" validatorClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" @@ -54,14 +51,16 @@ func (s *Server) registerBeaconClient() error { s.beaconApiTimeout, ) - restHandler := beaconApi.NewBeaconApiJsonRestHandler( - http.Client{Timeout: s.beaconApiTimeout}, - s.beaconApiEndpoint, - ) - - s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) - s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) - s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) + //restHandler := beaconApi.NewBeaconApiJsonRestHandler( + // http.Client{Timeout: s.beaconApiTimeout}, + // s.beaconApiEndpoint, + //) + //s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) + //s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) + //s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) + s.chainClient = beaconChainClientFactory.NewChainClient(conn, nil) + s.nodeClient = nodeClientFactory.NewNodeClient(conn, nil) + s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, nil) return nil } diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 330340c37413..3251cc16c8af 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -14,7 +14,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/proposer" @@ -692,7 +691,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) defaultWalletPath = setupWalletDir(t) opts := []accounts.Option{ accounts.WithWalletDir(defaultWalletPath), @@ -955,7 +954,7 @@ func TestServer_SetGasLimit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), tr) pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") @@ -1163,7 +1162,7 @@ func TestServer_SetGasLimit_InvalidPubKey(t *testing.T) { } func TestServer_DeleteGasLimit(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") require.NoError(t, err) @@ -1600,7 +1599,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) { defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) @@ -1810,7 +1809,7 @@ func TestServer_SetFeeRecipientByPubkey_InvalidFeeRecipient(t *testing.T) { } func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) diff --git a/validator/web/handler.go b/validator/web/handler.go index ac9ad89d3083..c5f5f46199c1 100644 --- a/validator/web/handler.go +++ b/validator/web/handler.go @@ -10,7 +10,6 @@ import ( const prefix = "prysm-web-ui" // Handler serves web requests from the bundled site data. -// DEPRECATED: Prysm Web UI and associated endpoints will be fully removed in a future hard fork. var Handler = func(res http.ResponseWriter, req *http.Request) { addSecurityHeaders(res) u, err := url.ParseRequestURI(req.RequestURI) From dcaefd2daf9ad26b79b421c341bfdf32d18cac7c Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 14:38:59 -0500 Subject: [PATCH 02/58] reverting temp comment --- validator/rpc/beacon.go | 20 ++++++++++---------- validator/rpc/handlers_beacon.go | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index fe5795e5a170..d1635fe0f16e 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -1,6 +1,8 @@ package rpc import ( + "net/http" + middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/retry" grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" @@ -9,6 +11,7 @@ import ( grpcutil "github.com/prysmaticlabs/prysm/v5/api/grpc" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/client" + beaconApi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" beaconChainClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-chain-client-factory" nodeClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" validatorClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" @@ -51,16 +54,13 @@ func (s *Server) registerBeaconClient() error { s.beaconApiTimeout, ) - //restHandler := beaconApi.NewBeaconApiJsonRestHandler( - // http.Client{Timeout: s.beaconApiTimeout}, - // s.beaconApiEndpoint, - //) + restHandler := beaconApi.NewBeaconApiJsonRestHandler( + http.Client{Timeout: s.beaconApiTimeout}, + s.beaconApiEndpoint, + ) - //s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) - //s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) - //s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) - s.chainClient = beaconChainClientFactory.NewChainClient(conn, nil) - s.nodeClient = nodeClientFactory.NewNodeClient(conn, nil) - s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, nil) + s.chainClient = beaconChainClientFactory.NewChainClient(conn, restHandler) + s.nodeClient = nodeClientFactory.NewNodeClient(conn, restHandler) + s.beaconNodeValidatorClient = validatorClientFactory.NewValidatorClient(conn, restHandler) return nil } diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 345d36a1bf80..b4a25f045702 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -42,6 +42,7 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { } genesisTime := uint64(time.Unix(genesis.GenesisTime.Seconds, 0).Unix()) address := genesis.DepositContractAddress + chainHead, err := s.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "ChainHead").Error(), http.StatusInternalServerError) From 3385c429d2cfba1c48b71be78d155629247ecfc2 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 14:45:30 -0500 Subject: [PATCH 03/58] remove unneeded comments --- api/grpc/grpcutils.go | 59 ------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/api/grpc/grpcutils.go b/api/grpc/grpcutils.go index 1a93179e6a49..53378b6c1a5f 100644 --- a/api/grpc/grpcutils.go +++ b/api/grpc/grpcutils.go @@ -94,62 +94,3 @@ func AppendCustomErrorHeader(ctx context.Context, errorData interface{}) error { } return nil } - -// -//// MuxConfig contains configuration that should be used when registering the beacon node in the gateway. -//type MuxConfig struct { -// EthPbMux *PbMux -// V1AlphaPbMux *PbMux -//} -// -//// DefaultConfig returns a fully configured MuxConfig with standard gateway behavior. -//func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig { -// var v1AlphaPbHandler, ethPbHandler *PbMux -// if flags.EnableHTTPPrysmAPI(httpModules) { -// v1AlphaRegistrations := []PbHandlerRegistration{ -// ethpbalpha.RegisterNodeHandler, -// ethpbalpha.RegisterBeaconChainHandler, -// ethpbalpha.RegisterBeaconNodeValidatorHandler, -// ethpbalpha.RegisterHealthHandler, -// } -// if enableDebugRPCEndpoints { -// v1AlphaRegistrations = append(v1AlphaRegistrations, ethpbalpha.RegisterDebugHandler) -// } -// v1AlphaMux := gwruntime.NewServeMux( -// gwruntime.WithMarshalerOption( -// api.EventStreamMediaType, &gwruntime.EventSourceJSONPb{}, -// ), -// ) -// v1AlphaPbHandler = &PbMux{ -// Registrations: v1AlphaRegistrations, -// Patterns: []string{"/eth/v1alpha1/", "/eth/v1alpha2/"}, -// Mux: v1AlphaMux, -// } -// } -// if flags.EnableHTTPEthAPI(httpModules) { -// ethRegistrations := []PbHandlerRegistration{} -// ethMux := gwruntime.NewServeMux( -// gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{ -// Marshaler: &gwruntime.JSONPb{ -// MarshalOptions: protojson.MarshalOptions{ -// UseProtoNames: true, -// EmitUnpopulated: true, -// }, -// UnmarshalOptions: protojson.UnmarshalOptions{ -// DiscardUnknown: true, -// }, -// }, -// }), -// ) -// ethPbHandler = &PbMux{ -// Registrations: ethRegistrations, -// Patterns: []string{"/internal/eth/v1/", "/internal/eth/v2/"}, -// Mux: ethMux, -// } -// } -// -// return MuxConfig{ -// EthPbMux: ethPbHandler, -// V1AlphaPbMux: v1AlphaPbHandler, -// } -//} From b9de3539d5f1c896fd9042f73efe6255053ade98 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 15:07:47 -0500 Subject: [PATCH 04/58] fixing merge errors --- api/gateway/BUILD.bazel | 8 -------- api/gateway/gateway.go | 0 api/grpc/grpc.go | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 api/gateway/BUILD.bazel delete mode 100644 api/gateway/gateway.go diff --git a/api/gateway/BUILD.bazel b/api/gateway/BUILD.bazel deleted file mode 100644 index d7981234a14c..000000000000 --- a/api/gateway/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["gateway.go"], - importpath = "github.com/prysmaticlabs/prysm/v5/api/gateway", - visibility = ["//visibility:public"], -) diff --git a/api/gateway/gateway.go b/api/gateway/gateway.go deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/api/grpc/grpc.go b/api/grpc/grpc.go index 5f43b63fdd84..908ff0c23490 100644 --- a/api/grpc/grpc.go +++ b/api/grpc/grpc.go @@ -8,7 +8,7 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/runtime" ) @@ -55,7 +55,7 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { g.cfg.router = mux.NewRouter() } - corsMux := server.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) + corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) // TODO: actually use the timeout config provided g.server = &http.Server{ Addr: g.cfg.gatewayAddr, From 6b6206e007fb70e04a7c34242140ca81547dec52 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 15:24:45 -0500 Subject: [PATCH 05/58] fixing more bugs from merge --- api/grpc/BUILD.bazel | 2 +- beacon-chain/node/node.go | 1 - validator/node/node.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index 84c5e5e084de..f046ff79ea41 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -12,7 +12,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/api/grpc", visibility = ["//visibility:public"], deps = [ - "//api/server:go_default_library", + "//api/server/middleware:go_default_library", "//runtime:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 49c897954b55..00e79d9252d7 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -1052,7 +1052,6 @@ func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { } gatewayHost := b.cliCtx.String(flags.GRPCGatewayHost.Name) gatewayPort := b.cliCtx.Int(flags.GRPCGatewayPort.Name) - enableDebugRPCEndpoints := !b.cliCtx.Bool(flags.DisableDebugRPCEndpoints.Name) gatewayAddress := net.JoinHostPort(gatewayHost, strconv.Itoa(gatewayPort)) allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) diff --git a/validator/node/node.go b/validator/node/node.go index 7abd3278875c..c1e37f0376d8 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/api/grpc" + "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" From 7959bab0344a4a0930d4810619e5d9b5a2150a46 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 15:32:29 -0500 Subject: [PATCH 06/58] fixing test --- validator/rpc/handlers_keymanager_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 3251cc16c8af..f762e26f4bb8 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -954,7 +954,7 @@ func TestServer_SetGasLimit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), tr) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") From bf623e203ece0d36c7ba5d6a9eaf7200205bbf27 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 16:03:50 -0500 Subject: [PATCH 07/58] WIP moving code around and fixing tests --- api/grpc/BUILD.bazel | 15 ++------- api/grpc/grpcutils_test.go | 7 ++-- api/grpc/log.go | 2 +- api/server/rest/BUILD.bazel | 33 +++++++++++++++++++ api/server/rest/log.go | 5 +++ api/{grpc => server/rest}/options.go | 4 +-- api/{grpc/grpc.go => server/rest/server.go} | 12 +++---- .../rest/server_test.go} | 2 +- beacon-chain/node/BUILD.bazel | 2 +- beacon-chain/node/node.go | 14 ++++---- .../rpc/prysm/v1alpha1/node/BUILD.bazel | 1 + .../rpc/prysm/v1alpha1/node/server_test.go | 3 +- validator/node/BUILD.bazel | 2 +- validator/node/node.go | 16 ++++----- 14 files changed, 74 insertions(+), 44 deletions(-) create mode 100644 api/server/rest/BUILD.bazel create mode 100644 api/server/rest/log.go rename api/{grpc => server/rest}/options.go (94%) rename api/{grpc/grpc.go => server/rest/server.go} (91%) rename api/{grpc/grpc_test.go => server/rest/server_test.go} (99%) diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index f046ff79ea41..8b935b68f6b8 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -3,20 +3,13 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "grpc.go", "grpcutils.go", "log.go", - "options.go", "parameters.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/api/grpc", visibility = ["//visibility:public"], deps = [ - "//api/server/middleware:go_default_library", - "//runtime:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", @@ -25,17 +18,13 @@ go_library( go_test( name = "go_default_test", - srcs = [ - "grpc_test.go", - "grpcutils_test.go", - ], + srcs = ["grpcutils_test.go"], embed = [":go_default_library"], deps = [ - "//cmd/beacon-chain/flags:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@com_github_urfave_cli_v2//:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", ], diff --git a/api/grpc/grpcutils_test.go b/api/grpc/grpcutils_test.go index 0da3a3a19b3c..be8c17790728 100644 --- a/api/grpc/grpcutils_test.go +++ b/api/grpc/grpcutils_test.go @@ -6,6 +6,7 @@ import ( "strings" "testing" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" logTest "github.com/sirupsen/logrus/hooks/test" @@ -64,14 +65,14 @@ func TestAppendHeaders(t *testing.T) { func TestAppendCustomErrorHeader(t *testing.T) { ctx := context.Background() - stream := grpc.ServerTransportStreamFromContext(ctx) + stream := &runtime.ServerTransportStream{} ctx = grpc.NewContextWithServerTransportStream(ctx, stream) data := &customErrorData{Message: "foo"} require.NoError(t, AppendCustomErrorHeader(ctx, data)) // The stream used in test setup sets the metadata key in lowercase. - md, ok := metadata.FromIncomingContext(ctx) + value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") expected, err := json.Marshal(data) require.NoError(t, err) - assert.Equal(t, string(expected), md.Get(strings.ToLower(CustomErrorMetadataKey))[0]) + assert.Equal(t, string(expected), value[0]) } diff --git a/api/grpc/log.go b/api/grpc/log.go index 3b61356ce501..23b605de6492 100644 --- a/api/grpc/log.go +++ b/api/grpc/log.go @@ -2,4 +2,4 @@ package grpc import "github.com/sirupsen/logrus" -var log = logrus.WithField("prefix", "gateway") +var log = logrus.WithField("prefix", "gRPC") diff --git a/api/server/rest/BUILD.bazel b/api/server/rest/BUILD.bazel new file mode 100644 index 000000000000..ae773878d893 --- /dev/null +++ b/api/server/rest/BUILD.bazel @@ -0,0 +1,33 @@ +load("@prysm//tools/go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = [ + "log.go", + "options.go", + "server.go", + ], + importpath = "github.com/prysmaticlabs/prysm/v5/api/server/rest", + visibility = ["//visibility:public"], + deps = [ + "//api/server/middleware:go_default_library", + "//runtime:go_default_library", + "@com_github_gorilla_mux//:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", + "@com_github_pkg_errors//:go_default_library", + "@com_github_sirupsen_logrus//:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["server_test.go"], + embed = [":go_default_library"], + deps = [ + "//cmd/beacon-chain/flags:go_default_library", + "//testing/assert:go_default_library", + "//testing/require:go_default_library", + "@com_github_sirupsen_logrus//hooks/test:go_default_library", + "@com_github_urfave_cli_v2//:go_default_library", + ], +) diff --git a/api/server/rest/log.go b/api/server/rest/log.go new file mode 100644 index 000000000000..7fe5ca46f803 --- /dev/null +++ b/api/server/rest/log.go @@ -0,0 +1,5 @@ +package rest + +import "github.com/sirupsen/logrus" + +var log = logrus.WithField("prefix", "REST") diff --git a/api/grpc/options.go b/api/server/rest/options.go similarity index 94% rename from api/grpc/options.go rename to api/server/rest/options.go index 315f91ccac92..c54f945e3d69 100644 --- a/api/grpc/options.go +++ b/api/server/rest/options.go @@ -1,4 +1,4 @@ -package grpc +package rest import ( "time" @@ -9,7 +9,7 @@ import ( type Option func(g *Server) error -func WithMuxHandler(m MuxHandler) Option { +func WithMuxHandler(m restHandler) Option { return func(g *Server) error { g.cfg.muxHandler = m return nil diff --git a/api/grpc/grpc.go b/api/server/rest/server.go similarity index 91% rename from api/grpc/grpc.go rename to api/server/rest/server.go index 908ff0c23490..db5ff0f1ff58 100644 --- a/api/grpc/grpc.go +++ b/api/server/rest/server.go @@ -1,5 +1,5 @@ // Package gateway defines a grpc-gateway server that serves HTTP-JSON traffic and acts a proxy between HTTP and gRPC. -package grpc +package rest import ( "context" @@ -14,8 +14,8 @@ import ( var _ runtime.Service = (*Server)(nil) -// MuxHandler is a function that implements the mux handler functionality. -type MuxHandler func( +// restHandler is a functional interface that implements the rest handler functionality. +type restHandler func( h http.HandlerFunc, w http.ResponseWriter, req *http.Request, @@ -25,7 +25,7 @@ type MuxHandler func( type config struct { gatewayAddr string allowedOrigins []string - muxHandler MuxHandler + muxHandler restHandler router *mux.Router timeout time.Duration } @@ -50,9 +50,9 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { return nil, err } } - // TODO: this is a codesmell ( we should always have a router here) + if g.cfg.router == nil { - g.cfg.router = mux.NewRouter() + return nil, errors.New("router option not configured") } corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) diff --git a/api/grpc/grpc_test.go b/api/server/rest/server_test.go similarity index 99% rename from api/grpc/grpc_test.go rename to api/server/rest/server_test.go index c14d9d965acf..2a96b8acd997 100644 --- a/api/grpc/grpc_test.go +++ b/api/server/rest/server_test.go @@ -1,4 +1,4 @@ -package grpc +package rest import ( "context" diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 81bf1429cf1a..74b2432557c7 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -15,8 +15,8 @@ go_library( "//cmd/beacon-chain:__subpackages__", ], deps = [ - "//api/grpc:go_default_library", "//api/server/middleware:go_default_library", + "//api/server/rest:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 00e79d9252d7..7704b5222416 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,8 +19,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/grpc" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" + "github.com/prysmaticlabs/prysm/v5/api/server/rest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" @@ -1056,13 +1056,13 @@ func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - opts := []grpc.Option{ - grpc.WithRouter(router), - grpc.WithGatewayAddr(gatewayAddress), - grpc.WithAllowedOrigins(allowedOrigins), - grpc.WithTimeout(uint64(timeout)), + opts := []rest.Option{ + rest.WithRouter(router), + rest.WithGatewayAddr(gatewayAddress), + rest.WithAllowedOrigins(allowedOrigins), + rest.WithTimeout(uint64(timeout)), } - g, err := grpc.New(b.ctx, opts...) + g, err := rest.New(b.ctx, opts...) if err != nil { return err } diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index c77f196f2a26..428753ab1481 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -47,6 +47,7 @@ go_test( "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//reflection:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index a919d2ef5c0a..1d99a2e7b3ab 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" @@ -203,7 +204,7 @@ func TestNodeServer_GetHealth(t *testing.T) { } ethpb.RegisterNodeServer(server, ns) reflection.Register(server) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) _, err := ns.GetHealth(ctx, ðpb.HealthRequest{SyncingStatus: tt.customStatus}) if tt.wantedErr == "" { require.NoError(t, err) diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index cb6f955e1ed1..c4bf36de1b4d 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -36,8 +36,8 @@ go_library( ], deps = [ "//api:go_default_library", - "//api/grpc:go_default_library", "//api/server/middleware:go_default_library", + "//api/server/rest:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", "//cmd/validator/flags:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index c1e37f0376d8..267fce941da4 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/grpc" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" + "github.com/prysmaticlabs/prysm/v5/api/server/rest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" @@ -675,14 +675,14 @@ func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { } } - opts := []grpc.Option{ - grpc.WithMuxHandler(muxHandler), - grpc.WithRouter(router), // note some routes are registered in server.go - grpc.WithGatewayAddr(gatewayAddress), - grpc.WithAllowedOrigins(allowedOrigins), - grpc.WithTimeout(uint64(timeout)), + opts := []rest.Option{ + rest.WithMuxHandler(muxHandler), + rest.WithRouter(router), // note some routes are registered in server.go + rest.WithGatewayAddr(gatewayAddress), + rest.WithAllowedOrigins(allowedOrigins), + rest.WithTimeout(uint64(timeout)), } - gw, err := grpc.New(c.cliCtx.Context, opts...) + gw, err := rest.New(c.cliCtx.Context, opts...) if err != nil { return err } From 46f274f65a32db3fc1d746322fcb345d29480e10 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 16:08:31 -0500 Subject: [PATCH 08/58] unused linting --- api/grpc/log.go | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 api/grpc/log.go diff --git a/api/grpc/log.go b/api/grpc/log.go deleted file mode 100644 index 23b605de6492..000000000000 --- a/api/grpc/log.go +++ /dev/null @@ -1,5 +0,0 @@ -package grpc - -import "github.com/sirupsen/logrus" - -var log = logrus.WithField("prefix", "gRPC") From c7614437972ee5579c88c23edc643b3135ca3f44 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 6 Jun 2024 16:26:34 -0500 Subject: [PATCH 09/58] gaz --- api/grpc/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index 8b935b68f6b8..6ee34f669937 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "grpcutils.go", - "log.go", "parameters.go", ], importpath = "github.com/prysmaticlabs/prysm/v5/api/grpc", From c80f8e46042e525cda2f157d3a86b0ab548f83cf Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 7 Jun 2024 09:39:34 -0500 Subject: [PATCH 10/58] temp removing these tests as we need placeholder/wrapper APIs for them with the removal of the gateway --- testing/endtoend/endtoend_setup_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index cb4f686c2489..d173ffffa036 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -57,6 +57,7 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, + //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -132,7 +133,7 @@ func e2eMainnet(t *testing.T, usePrysmSh, useMultiClient bool, cfg *params.Beaco ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, + //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.FeeRecipientIsPresent, @@ -188,7 +189,7 @@ func scenarioEvals() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, + //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -209,7 +210,7 @@ func scenarioEvalsMulti() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - ev.APIGatewayV1Alpha1VerifyIntegrity, + //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, } From cfbc2e478c36d17335566380e00224d29b6d0a1c Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 10 Jun 2024 17:14:22 -0500 Subject: [PATCH 11/58] attempting to remove dependencies to gRPC gateway , 1 mroe left in deps.bzl --- api/grpc/BUILD.bazel | 2 - api/grpc/grpcutils_test.go | 30 +- api/server/rest/BUILD.bazel | 1 - api/server/rest/options.go | 2 - beacon-chain/rpc/eth/helpers/BUILD.bazel | 3 - beacon-chain/rpc/eth/helpers/sync_test.go | 59 +- .../rpc/prysm/v1alpha1/node/BUILD.bazel | 2 - .../rpc/prysm/v1alpha1/node/server_test.go | 20 +- deps.bzl | 164 +- go.mod | 6 +- go.sum | 76 +- proto/prysm/v1alpha1/BUILD.bazel | 34 +- proto/prysm/v1alpha1/attestation.pb.gw.go | 4 - proto/prysm/v1alpha1/beacon_block.pb.gw.go | 4 - proto/prysm/v1alpha1/beacon_chain.pb.gw.go | 1862 -------------- proto/prysm/v1alpha1/beacon_state.pb.gw.go | 4 - proto/prysm/v1alpha1/blobs.pb.gw.go | 4 - proto/prysm/v1alpha1/debug.pb.gw.go | 487 ---- proto/prysm/v1alpha1/eip_7251.pb.gw.go | 4 - .../finalized_block_root_container.pb.gw.go | 4 - proto/prysm/v1alpha1/health.pb.gw.go | 138 - proto/prysm/v1alpha1/node.pb.gw.go | 711 ------ proto/prysm/v1alpha1/p2p_messages.pb.gw.go | 4 - proto/prysm/v1alpha1/powchain.pb.gw.go | 4 - proto/prysm/v1alpha1/slasher.pb.gw.go | 4 - proto/prysm/v1alpha1/sync_committee.pb.gw.go | 4 - .../validator-client/keymanager.pb.gw.go | 4 - proto/prysm/v1alpha1/validator.pb.gw.go | 2263 ----------------- proto/prysm/v1alpha1/withdrawals.pb.gw.go | 4 - 29 files changed, 71 insertions(+), 5837 deletions(-) delete mode 100755 proto/prysm/v1alpha1/attestation.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_block.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_chain.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/beacon_state.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/blobs.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/debug.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/eip_7251.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/health.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/node.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/p2p_messages.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/powchain.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/slasher.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/sync_committee.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/validator.pb.gw.go delete mode 100755 proto/prysm/v1alpha1/withdrawals.pb.gw.go diff --git a/api/grpc/BUILD.bazel b/api/grpc/BUILD.bazel index 6ee34f669937..9284944b385b 100644 --- a/api/grpc/BUILD.bazel +++ b/api/grpc/BUILD.bazel @@ -22,9 +22,7 @@ go_test( deps = [ "//testing/assert:go_default_library", "//testing/require:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", ], ) diff --git a/api/grpc/grpcutils_test.go b/api/grpc/grpcutils_test.go index be8c17790728..fab083ae84e8 100644 --- a/api/grpc/grpcutils_test.go +++ b/api/grpc/grpcutils_test.go @@ -2,15 +2,11 @@ package grpc import ( "context" - "encoding/json" - "strings" "testing" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" logTest "github.com/sirupsen/logrus/hooks/test" - "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -63,16 +59,16 @@ func TestAppendHeaders(t *testing.T) { }) } -func TestAppendCustomErrorHeader(t *testing.T) { - ctx := context.Background() - stream := &runtime.ServerTransportStream{} - ctx = grpc.NewContextWithServerTransportStream(ctx, stream) - data := &customErrorData{Message: "foo"} - require.NoError(t, AppendCustomErrorHeader(ctx, data)) - // The stream used in test setup sets the metadata key in lowercase. - value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] - require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") - expected, err := json.Marshal(data) - require.NoError(t, err) - assert.Equal(t, string(expected), value[0]) -} +//func TestAppendCustomErrorHeader(t *testing.T) { +// ctx := context.Background() +// stream := &runtime.ServerTransportStream{} +// ctx = grpc.NewContextWithServerTransportStream(ctx, stream) +// data := &customErrorData{Message: "foo"} +// require.NoError(t, AppendCustomErrorHeader(ctx, data)) +// // The stream used in test setup sets the metadata key in lowercase. +// value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] +// require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") +// expected, err := json.Marshal(data) +// require.NoError(t, err) +// assert.Equal(t, string(expected), value[0]) +//} diff --git a/api/server/rest/BUILD.bazel b/api/server/rest/BUILD.bazel index ae773878d893..b42280f663c3 100644 --- a/api/server/rest/BUILD.bazel +++ b/api/server/rest/BUILD.bazel @@ -13,7 +13,6 @@ go_library( "//api/server/middleware:go_default_library", "//runtime:go_default_library", "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", ], diff --git a/api/server/rest/options.go b/api/server/rest/options.go index c54f945e3d69..c24a115e9a3c 100644 --- a/api/server/rest/options.go +++ b/api/server/rest/options.go @@ -4,7 +4,6 @@ import ( "time" "github.com/gorilla/mux" - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" ) type Option func(g *Server) error @@ -43,7 +42,6 @@ func WithAllowedOrigins(origins []string) Option { func WithTimeout(seconds uint64) Option { return func(g *Server) error { g.cfg.timeout = time.Second * time.Duration(seconds) - gwruntime.DefaultContextTimeout = time.Second * time.Duration(seconds) return nil } } diff --git a/beacon-chain/rpc/eth/helpers/BUILD.bazel b/beacon-chain/rpc/eth/helpers/BUILD.bazel index 29abaf29b165..83f56c2c0da5 100644 --- a/beacon-chain/rpc/eth/helpers/BUILD.bazel +++ b/beacon-chain/rpc/eth/helpers/BUILD.bazel @@ -40,7 +40,6 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//api/grpc:go_default_library", "//beacon-chain/blockchain/testing:go_default_library", "//beacon-chain/db/testing:go_default_library", "//beacon-chain/forkchoice/doubly-linked-tree:go_default_library", @@ -62,7 +61,5 @@ go_test( "//testing/require:go_default_library", "//testing/util:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/beacon-chain/rpc/eth/helpers/sync_test.go b/beacon-chain/rpc/eth/helpers/sync_test.go index 54832c7e7321..43c1511b76bd 100644 --- a/beacon-chain/rpc/eth/helpers/sync_test.go +++ b/beacon-chain/rpc/eth/helpers/sync_test.go @@ -3,12 +3,9 @@ package helpers import ( "context" "strconv" - "strings" "testing" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - grpcutil "github.com/prysmaticlabs/prysm/v5/api/grpc" chainmock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbtest "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" doublylinkedtree "github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice/doubly-linked-tree" @@ -26,36 +23,36 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" - "google.golang.org/grpc" ) func TestValidateSync(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) - t.Run("syncing", func(t *testing.T) { - syncChecker := &syncmock.Sync{ - IsSyncing: true, - } - headSlot := primitives.Slot(100) - st, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, st.SetSlot(50)) - chainService := &chainmock.ChainService{ - Slot: &headSlot, - State: st, - } - err = ValidateSyncGRPC(ctx, syncChecker, chainService, chainService, chainService) - require.NotNil(t, err) - sts, ok := grpc.ServerTransportStreamFromContext(ctx).(*runtime.ServerTransportStream) - require.Equal(t, true, ok, "type assertion failed") - md := sts.Header() - v, ok := md[strings.ToLower(grpcutil.CustomErrorMetadataKey)] - require.Equal(t, true, ok, "could not retrieve custom error metadata value") - assert.DeepEqual( - t, - []string{`{"data":{"head_slot":"50","sync_distance":"50","is_syncing":true,"is_optimistic":false,"el_offline":false}}`}, - v, - ) - }) + // TODO: determine if we should create our own serverTransportStream or remove the gRPC sync header metatdata + //ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + //t.Run("syncing", func(t *testing.T) { + // syncChecker := &syncmock.Sync{ + // IsSyncing: true, + // } + // headSlot := primitives.Slot(100) + // st, err := util.NewBeaconState() + // require.NoError(t, err) + // require.NoError(t, st.SetSlot(50)) + // chainService := &chainmock.ChainService{ + // Slot: &headSlot, + // State: st, + // } + // err = ValidateSyncGRPC(ctx, syncChecker, chainService, chainService, chainService) + // require.NotNil(t, err) + // sts, ok := grpc.ServerTransportStreamFromContext(ctx).(*runtime.ServerTransportStream) + // require.Equal(t, true, ok, "type assertion failed") + // md := sts.Header() + // v, ok := md[strings.ToLower(grpcutil.CustomErrorMetadataKey)] + // require.Equal(t, true, ok, "could not retrieve custom error metadata value") + // assert.DeepEqual( + // t, + // []string{`{"data":{"head_slot":"50","sync_distance":"50","is_syncing":true,"is_optimistic":false,"el_offline":false}}`}, + // v, + // ) + //}) t.Run("not syncing", func(t *testing.T) { syncChecker := &syncmock.Sync{ IsSyncing: false, @@ -68,7 +65,7 @@ func TestValidateSync(t *testing.T) { Slot: &headSlot, State: st, } - err = ValidateSyncGRPC(ctx, syncChecker, nil, nil, chainService) + err = ValidateSyncGRPC(context.Background(), syncChecker, nil, nil, chainService) require.NoError(t, err) }) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index 428753ab1481..745a73e9a4c0 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -47,9 +47,7 @@ go_test( "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//crypto:go_default_library", "@com_github_ethereum_go_ethereum//p2p/enode:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//reflection:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", "@org_golang_google_protobuf//types/known/timestamppb:go_default_library", diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 1d99a2e7b3ab..49dddfc94e54 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -3,14 +3,12 @@ package node import ( "context" "errors" - "fmt" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" mock "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain/testing" dbutil "github.com/prysmaticlabs/prysm/v5/beacon-chain/db/testing" "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p" @@ -24,7 +22,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/util" "google.golang.org/grpc" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/reflection" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" @@ -190,11 +187,6 @@ func TestNodeServer_GetHealth(t *testing.T) { input: &mockSync.Sync{IsSyncing: false}, wantedErr: "service unavailable", }, - { - name: "custom sync status", - input: &mockSync.Sync{IsSyncing: true}, - customStatus: 206, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -204,21 +196,11 @@ func TestNodeServer_GetHealth(t *testing.T) { } ethpb.RegisterNodeServer(server, ns) reflection.Register(server) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) - _, err := ns.GetHealth(ctx, ðpb.HealthRequest{SyncingStatus: tt.customStatus}) + _, err := ns.GetHealth(context.Background(), ðpb.HealthRequest{SyncingStatus: tt.customStatus}) if tt.wantedErr == "" { require.NoError(t, err) return } - if tt.customStatus != 0 { - // Assuming the call was successful, now extract the headers - headers, _ := metadata.FromIncomingContext(ctx) - // Check for the specific header - values, ok := headers["x-http-code"] - require.Equal(t, true, ok && len(values) > 0) - require.Equal(t, fmt.Sprintf("%d", tt.customStatus), values[0]) - - } require.ErrorContains(t, tt.wantedErr, err) }) } diff --git a/deps.bzl b/deps.bzl index b46caadbedbe..0d1086276b14 100644 --- a/deps.bzl +++ b/deps.bzl @@ -94,12 +94,6 @@ def prysm_deps(): sum = "h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=", version = "v0.0.0-20161002113705-648efa622239", ) - go_repository( - name = "com_github_antihax_optional", - importpath = "github.com/antihax/optional", - sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=", - version = "v1.0.0", - ) go_repository( name = "com_github_apache_thrift", importpath = "github.com/apache/thrift", @@ -334,12 +328,6 @@ def prysm_deps(): sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", version = "v1.0.1", ) - go_repository( - name = "com_github_bgentry_go_netrc", - importpath = "github.com/bgentry/go-netrc", - sum = "h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=", - version = "v0.0.0-20140422174119-9fd32a8b3d3d", - ) go_repository( name = "com_github_bgentry_speakeasy", importpath = "github.com/bgentry/speakeasy", @@ -352,12 +340,6 @@ def prysm_deps(): sum = "h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k=", version = "v1.11.0", ) - go_repository( - name = "com_github_bketelsen_crypt", - importpath = "github.com/bketelsen/crypt", - sum = "h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc=", - version = "v0.0.3-0.20200106085610-5cbc8cc4026c", - ) go_repository( name = "com_github_bradfitz_go_smtpd", importpath = "github.com/bradfitz/go-smtpd", @@ -382,12 +364,6 @@ def prysm_deps(): sum = "h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=", version = "v1.0.1", ) - go_repository( - name = "com_github_bufbuild_buf", - importpath = "github.com/bufbuild/buf", - sum = "h1:11zJVA0D4uJVGOC9h+oOVHrKKoBgMYIqJJ0d1Xt6oeQ=", - version = "v0.37.0", - ) go_repository( name = "com_github_buger_jsonparser", importpath = "github.com/buger/jsonparser", @@ -600,23 +576,11 @@ def prysm_deps(): sum = "h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=", version = "v1.1.0", ) - go_repository( - name = "com_github_coreos_bbolt", - importpath = "github.com/coreos/bbolt", - sum = "h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=", - version = "v1.3.2", - ) - go_repository( - name = "com_github_coreos_etcd", - importpath = "github.com/coreos/etcd", - sum = "h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=", - version = "v3.3.13+incompatible", - ) go_repository( name = "com_github_coreos_go_semver", importpath = "github.com/coreos/go-semver", - sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", - version = "v0.3.0", + sum = "h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=", + version = "v0.2.0", ) go_repository( name = "com_github_coreos_go_systemd", @@ -633,8 +597,8 @@ def prysm_deps(): go_repository( name = "com_github_coreos_pkg", importpath = "github.com/coreos/pkg", - sum = "h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=", - version = "v0.0.0-20180928190104-399ea9e2e55f", + sum = "h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI=", + version = "v0.0.0-20160727233714-3ac0863d7acf", ) go_repository( name = "com_github_cpuguy83_go_md2man_v2", @@ -738,12 +702,6 @@ def prysm_deps(): sum = "h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=", version = "v0.0.0-20190423205320-6a90982ecee2", ) - go_repository( - name = "com_github_dgryski_go_sip13", - importpath = "github.com/dgryski/go-sip13", - sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=", - version = "v0.0.0-20181026042036-e10d5fee7954", - ) go_repository( name = "com_github_dlclark_regexp2", importpath = "github.com/dlclark/regexp2", @@ -1230,12 +1188,6 @@ def prysm_deps(): sum = "h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=", version = "v0.8.1", ) - go_repository( - name = "com_github_gofrs_uuid", - importpath = "github.com/gofrs/uuid", - sum = "h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=", - version = "v4.0.0+incompatible", - ) go_repository( name = "com_github_gogo_googleapis", importpath = "github.com/gogo/googleapis", @@ -1416,12 +1368,6 @@ def prysm_deps(): sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", version = "v0.0.0-20181017120253-0766667cb4d1", ) - go_repository( - name = "com_github_gordonklaus_ineffassign", - importpath = "github.com/gordonklaus/ineffassign", - sum = "h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug=", - version = "v0.0.0-20200309095847-7953dde2c7bf", - ) go_repository( name = "com_github_gorilla_context", importpath = "github.com/gorilla/context", @@ -1473,8 +1419,8 @@ def prysm_deps(): go_repository( name = "com_github_grpc_ecosystem_go_grpc_middleware", importpath = "github.com/grpc-ecosystem/go-grpc-middleware", - sum = "h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0=", - version = "v1.2.2", + sum = "h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=", + version = "v1.0.1-0.20190118093823-f849b5445de4", ) go_repository( name = "com_github_grpc_ecosystem_go_grpc_prometheus", @@ -1488,20 +1434,6 @@ def prysm_deps(): sum = "h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=", version = "v1.9.5", ) - go_repository( - name = "com_github_grpc_ecosystem_grpc_gateway_v2", - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2", - patch_args = ["-p1"], - patches = [ - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2.patch", - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch", - "//third_party:com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch", - ], - replace = "github.com/prysmaticlabs/grpc-gateway/v2", - repo_mapping = {"@go_googleapis": "@googleapis"}, - sum = "h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28=", - version = "v2.3.1-0.20230315201114-09284ba20446", - ) go_repository( name = "com_github_guptarohit_asciigraph", importpath = "github.com/guptarohit/asciigraph", @@ -1619,8 +1551,8 @@ def prysm_deps(): go_repository( name = "com_github_hashicorp_hcl", importpath = "github.com/hashicorp/hcl", - sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", - version = "v1.0.0", + sum = "h1:LFTfzwAUSKPijQbJrMWZm/CysECsF/U1UUniUeXxzFw=", + version = "v0.0.0-20170914154624-68e816d1c783", ) go_repository( name = "com_github_hashicorp_logutils", @@ -1833,12 +1765,6 @@ def prysm_deps(): sum = "h1:ujPKutqRlJtcfWk6toYVYagwra7HQHbXOaS171b4Tg8=", version = "v0.0.0-20150330215556-f50fe3d243e1", ) - go_repository( - name = "com_github_jhump_protoreflect", - importpath = "github.com/jhump/protoreflect", - sum = "h1:z7Ciiz3Bz37zSd485fbiTW8ABafIasyOWZI0N9EUUdo=", - version = "v1.8.1", - ) go_repository( name = "com_github_jmespath_go_jmespath", importpath = "github.com/jmespath/go-jmespath", @@ -1990,12 +1916,6 @@ def prysm_deps(): sum = "h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=", version = "v2.2.7", ) - go_repository( - name = "com_github_klauspost_pgzip", - importpath = "github.com/klauspost/pgzip", - sum = "h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=", - version = "v1.2.5", - ) go_repository( name = "com_github_klauspost_reedsolomon", importpath = "github.com/klauspost/reedsolomon", @@ -2214,8 +2134,8 @@ def prysm_deps(): go_repository( name = "com_github_magiconair_properties", importpath = "github.com/magiconair/properties", - sum = "h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=", - version = "v1.8.1", + sum = "h1:SesWF0c8l/IKQX0NlsED38qoBhUpneg5HIHNdy5LyEE=", + version = "v1.7.4-0.20170902060319-8d7837e64d3c", ) go_repository( name = "com_github_mailgun_raymond_v2", @@ -2364,8 +2284,8 @@ def prysm_deps(): go_repository( name = "com_github_mitchellh_go_homedir", importpath = "github.com/mitchellh/go-homedir", - sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", - version = "v1.1.0", + sum = "h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=", + version = "v1.0.0", ) go_repository( name = "com_github_mitchellh_go_testing_interface", @@ -2568,12 +2488,6 @@ def prysm_deps(): sum = "h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=", version = "v0.0.0-20151028013722-8c68805598ab", ) - go_repository( - name = "com_github_nishanths_predeclared", - importpath = "github.com/nishanths/predeclared", - sum = "h1:3f0nxAmdj/VoCGN/ijdMy7bj6SBagaqYg1B0hu8clMA=", - version = "v0.0.0-20200524104333-86fad755b4d3", - ) go_repository( name = "com_github_nxadm_tail", importpath = "github.com/nxadm/tail", @@ -2598,12 +2512,6 @@ def prysm_deps(): sum = "h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=", version = "v1.0.0", ) - go_repository( - name = "com_github_oklog_ulid", - importpath = "github.com/oklog/ulid", - sum = "h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=", - version = "v1.3.1", - ) go_repository( name = "com_github_olekukonko_tablewriter", importpath = "github.com/olekukonko/tablewriter", @@ -2745,8 +2653,8 @@ def prysm_deps(): go_repository( name = "com_github_pelletier_go_toml", importpath = "github.com/pelletier/go-toml", - sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", - version = "v1.2.0", + sum = "h1:6P7XZEBu/ZWizC/liUX4UYm4nEAACofmSkOzY39RBxM=", + version = "v1.0.1-0.20170904195809-1d6b12b7cb29", ) go_repository( name = "com_github_pelletier_go_toml_v2", @@ -2958,12 +2866,6 @@ def prysm_deps(): sum = "h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y=", version = "v1.3.0", ) - go_repository( - name = "com_github_prometheus_tsdb", - importpath = "github.com/prometheus/tsdb", - sum = "h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=", - version = "v0.7.1", - ) go_repository( name = "com_github_protolambda_bls12_381_util", importpath = "github.com/protolambda/bls12-381-util", @@ -3068,8 +2970,8 @@ def prysm_deps(): go_repository( name = "com_github_rogpeppe_fastuuid", importpath = "github.com/rogpeppe/fastuuid", - sum = "h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=", - version = "v1.2.0", + sum = "h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=", + version = "v0.0.0-20150106093220-6724a57986af", ) go_repository( name = "com_github_rogpeppe_go_internal", @@ -3356,8 +3258,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_cast", importpath = "github.com/spf13/cast", - sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", - version = "v1.3.0", + sum = "h1:0Rhw4d6C8J9VPu6cjZLIhZ8+aAOHcDvGeKn+cq5Aq3k=", + version = "v1.1.0", ) go_repository( name = "com_github_spf13_cobra", @@ -3368,8 +3270,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_jwalterweatherman", importpath = "github.com/spf13/jwalterweatherman", - sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", - version = "v1.0.0", + sum = "h1:zBoLErXXAvWnNsu+pWkRYl6Cx1KXmIfAVsIuYkPN6aY=", + version = "v0.0.0-20170901151539-12bd96e66386", ) go_repository( name = "com_github_spf13_pflag", @@ -3380,8 +3282,8 @@ def prysm_deps(): go_repository( name = "com_github_spf13_viper", importpath = "github.com/spf13/viper", - sum = "h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=", - version = "v1.7.0", + sum = "h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I=", + version = "v1.0.0", ) go_repository( name = "com_github_stackexchange_wmi", @@ -3419,12 +3321,6 @@ def prysm_deps(): sum = "h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=", version = "v1.9.0", ) - go_repository( - name = "com_github_subosito_gotenv", - importpath = "github.com/subosito/gotenv", - sum = "h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=", - version = "v1.2.0", - ) go_repository( name = "com_github_syndtr_goleveldb", importpath = "github.com/syndtr/goleveldb", @@ -3500,8 +3396,8 @@ def prysm_deps(): go_repository( name = "com_github_tmc_grpc_websocket_proxy", importpath = "github.com/tmc/grpc-websocket-proxy", - sum = "h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=", - version = "v0.0.0-20190109142713-0ad062ec5ee5", + sum = "h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=", + version = "v0.0.0-20170815181823-89b8d40f7ca8", ) go_repository( name = "com_github_trailofbits_go_mutexasserts", @@ -3509,12 +3405,6 @@ def prysm_deps(): sum = "h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0=", version = "v0.0.0-20230328101604-8cdbc5f3d279", ) - go_repository( - name = "com_github_twitchtv_twirp", - importpath = "github.com/twitchtv/twirp", - sum = "h1:3fNSDoSPyq+fTrifIvGue9XM/tptzuhiGY83rxPVNUg=", - version = "v7.1.0+incompatible", - ) go_repository( name = "com_github_tyler_smith_go_bip39", importpath = "github.com/tyler-smith/go-bip39", @@ -4777,12 +4667,6 @@ def prysm_deps(): sum = "h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=", version = "v1.56.3", ) - go_repository( - name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc", - importpath = "google.golang.org/grpc/cmd/protoc-gen-go-grpc", - sum = "h1:lQ+dE99pFsb8osbJB3oRfE5eW4Hx6a/lZQr8Jh+eoT4=", - version = "v1.0.0", - ) go_repository( name = "org_golang_google_protobuf", importpath = "google.golang.org/protobuf", diff --git a/go.mod b/go.mod index 8adbe8af741e..b5da3dad4a6a 100644 --- a/go.mod +++ b/go.mod @@ -32,9 +32,8 @@ require ( github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 - github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 + github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e github.com/holiman/uint256 v1.2.4 @@ -281,6 +280,3 @@ require ( ) replace github.com/json-iterator/go => github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b - -// See https://github.com/prysmaticlabs/grpc-gateway/issues/2 -replace github.com/grpc-ecosystem/grpc-gateway/v2 => github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 diff --git a/go.sum b/go.sum index 5f206e79d1ce..9ffc26395778 100644 --- a/go.sum +++ b/go.sum @@ -31,7 +31,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -93,7 +92,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= @@ -119,18 +117,15 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.11.0 h1:RMyy2mBBShArUAhfVRZJ2xyBO58KCBCtZFShw3umo6k= github.com/bits-and-blooms/bitset v1.11.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bufbuild/buf v0.37.0/go.mod h1:lQ1m2HkIaGOFba6w/aC3KYBHhKEOESP3gaAEpS3dAFM= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -181,20 +176,15 @@ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5U github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= @@ -225,7 +215,6 @@ github.com/dgraph-io/ristretto v0.0.4-0.20210318174700-74754f61e018/go.mod h1:MI github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= @@ -260,7 +249,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= @@ -354,10 +342,8 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -370,10 +356,7 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c h1:HoqgYR60VYu5+0BuG6pjeGp7LKEPZnHt+dUClx9PeIs= github.com/golang/gddo v0.0.0-20200528160355-8d077c1d8f4c/go.mod h1:sam69Hju0uq+5uvLJUMDlsKlQ21Vrs1Kd/1YFPNYdOU= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= @@ -404,7 +387,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -472,14 +454,12 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= @@ -489,18 +469,13 @@ github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY4 github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= @@ -525,7 +500,6 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:i github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -573,7 +547,6 @@ github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/U github.com/jedib0t/go-pretty/v6 v6.5.4 h1:gOGo0613MoqUcf0xCj+h/V3sHDaZasfv152G6/5l91s= github.com/jedib0t/go-pretty/v6 v6.5.4/go.mod h1:5LQIxa52oJ/DlDSLv0HEkWOFMDGoWkJb9ss5KqPpJBg= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/jhump/protoreflect v1.8.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joonix/log v0.0.0-20200409080653-9c1d2ceb5f1d h1:k+SfYbN66Ev/GDVq39wYOXVW5RNd5kzzairbCe9dK5Q= @@ -597,13 +570,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -667,7 +638,6 @@ github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+L github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -726,7 +696,6 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -790,14 +759,12 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -853,7 +820,6 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.2.0 h1:w/UPXyl5GfahFxcTOz2j9wCIHNI+pUPr2laqpojKNCg= @@ -913,7 +879,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -925,7 +890,6 @@ github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b/go.mod h1:KdQU github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= @@ -942,9 +906,7 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= @@ -955,7 +917,6 @@ github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5E github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -965,7 +926,6 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44 h1:c3p3UzV4vFA7xaCDphnDWOjpxcadrQ26l5b+ypsvyxo= github.com/prysmaticlabs/fastssz v0.0.0-20221107182844-78142813af44/go.mod h1:MA5zShstUwCQaE9faGHgCGvEWUbG87p4SAXINhmCkvg= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= @@ -973,8 +933,6 @@ github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4 github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446/go.mod h1:IOyTYjcIO0rkmnGBfJTL0NJ11exy/Tc2QEuv7hCXp24= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c h1:9PHRCuO/VN0s9k+RmLykho7AjDxblNYI5bYKed16NPU= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c/go.mod h1:ZRws458tYHS/Zs936OQ6oCrL+Ict5O4Xpwve1UQ6C9M= github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU= @@ -993,7 +951,6 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -1053,24 +1010,18 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.1-0.20201006035406-b97b5ead31f7/go.mod h1:yk5b0mALVusDL5fMM6Rd1wgnoO5jUPhwsQ6LQAJTidQ= github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1097,7 +1048,6 @@ github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= @@ -1115,10 +1065,8 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279 h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0= github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279/go.mod h1:GA3+Mq3kt3tYAfM0WZCu7ofy+GW9PuGysHfhr+6JX7s= -github.com/twitchtv/twirp v7.1.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= @@ -1160,7 +1108,6 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= @@ -1175,14 +1122,11 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -1197,14 +1141,12 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= @@ -1250,7 +1192,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= @@ -1315,7 +1256,6 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -1361,7 +1301,6 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= @@ -1427,7 +1366,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1546,7 +1484,6 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1570,10 +1507,8 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1664,7 +1599,6 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= @@ -1679,14 +1613,12 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210426193834-eac7f76ac494/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1712,14 +1644,11 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0-dev.0.20201218190559-666aea1fb34c/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1730,8 +1659,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8/go.mod h1:hFxJC2f0epmp1elRCiEGJTKAWbwxZ2nvqZdHl3FQXCY= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= @@ -1751,7 +1678,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= diff --git a/proto/prysm/v1alpha1/BUILD.bazel b/proto/prysm/v1alpha1/BUILD.bazel index 02c496eabb5e..c90c08efc5fd 100644 --- a/proto/prysm/v1alpha1/BUILD.bazel +++ b/proto/prysm/v1alpha1/BUILD.bazel @@ -32,7 +32,6 @@ proto_library( deps = [ "//proto/engine/v1:proto", "//proto/eth/ext:proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto", "@com_google_protobuf//:any_proto", "@com_google_protobuf//:descriptor_proto", "@com_google_protobuf//:empty_proto", @@ -167,7 +166,6 @@ go_proto_library( "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -181,29 +179,6 @@ go_proto_library( ], ) -go_proto_library( - name = "go_grpc_gateway_library", - compilers = [ - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway", - ], - embed = [":go_proto"], - importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1", - protos = [":proto"], - visibility = ["//visibility:private"], - deps = [ - "//proto/engine/v1:go_default_library", - "//proto/eth/ext:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_prysmaticlabs_go_bitfield//:go_default_library", - "@googleapis//google/api:annotations_go_proto", - "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", - "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", - "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", - "@org_golang_google_protobuf//types/descriptorpb:go_default_library", - "@org_golang_google_protobuf//types/known/emptypb:go_default_library", - ], -) - go_library( name = "go_default_library", srcs = [ @@ -214,9 +189,7 @@ go_library( "sync_committee_minimal.go", # keep ":ssz_generated_files", # keep ], - embed = [ - ":go_grpc_gateway_library", - ], + embed = [":go_proto"], importpath = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1", visibility = ["//visibility:public"], deps = SSZ_DEPS + [ @@ -225,10 +198,8 @@ go_library( "//proto/engine/v1:go_default_library", "//proto/eth/ext:go_default_library", "//runtime/version:go_default_library", + "//consensus-types/primitives:go_default_library", "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep "@googleapis//google/api:annotations_go_proto", "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", @@ -239,6 +210,7 @@ go_library( "@org_golang_google_grpc//grpclog:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", "@org_golang_google_grpc//status:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", "@org_golang_google_protobuf//types/descriptorpb:go_default_library", diff --git a/proto/prysm/v1alpha1/attestation.pb.gw.go b/proto/prysm/v1alpha1/attestation.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/attestation.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/beacon_block.pb.gw.go b/proto/prysm/v1alpha1/beacon_block.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/beacon_block.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go deleted file mode 100755 index a7f81408911e..000000000000 --- a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go +++ /dev/null @@ -1,1862 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/beacon_chain.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_BeaconChain_ListAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAttestations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListAttestations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAttestations(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListAttestationsElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListIndexedAttestations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListIndexedAttestations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListIndexedAttestations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestations_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListIndexedAttestations(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListIndexedAttestationsElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListIndexedAttestationsElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListIndexedAttestationsElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListIndexedAttestationsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListIndexedAttestationsElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListIndexedAttestationsElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_AttestationPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPool_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AttestationPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_AttestationPool_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPool_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AttestationPool(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_AttestationPoolElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AttestationPoolElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_AttestationPoolElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationPoolRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_AttestationPoolElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AttestationPoolElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListBeaconBlocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListBeaconBlocks_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconBlocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListBeaconBlocks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListBeaconBlocks_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconBlocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListBeaconBlocks(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetChainHead(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetChainHead(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListBeaconCommittees_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListBeaconCommittees_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListCommitteesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconCommittees_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListBeaconCommittees(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListBeaconCommittees_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListCommitteesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListBeaconCommittees_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListBeaconCommittees(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidatorBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidatorBalances_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorBalancesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidatorBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidatorBalances_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorBalancesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidatorBalances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidators_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidators_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidators_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidators(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidator_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidator_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidator_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidator_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidator_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidator(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorActiveSetChanges_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorActiveSetChanges_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorActiveSetChangesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorActiveSetChanges_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorActiveSetChanges(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorActiveSetChanges_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorActiveSetChangesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorActiveSetChanges_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorActiveSetChanges(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetValidatorQueue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetValidatorQueue(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorPerformance_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorPerformanceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorPerformance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorPerformance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorPerformanceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorPerformance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorPerformance(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_ListValidatorAssignments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_ListValidatorAssignments_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorAssignmentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorAssignments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ListValidatorAssignments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_ListValidatorAssignments_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListValidatorAssignmentsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_ListValidatorAssignments_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ListValidatorAssignments(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetValidatorParticipation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorParticipationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorParticipation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorParticipation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorParticipationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetValidatorParticipation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorParticipation(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconChain_GetBeaconConfig_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetBeaconConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetBeaconConfig_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetBeaconConfig(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitAttesterSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAttesterSlashing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitAttesterSlashing_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAttesterSlashing(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitAttesterSlashingElectra_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashingElectra - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAttesterSlashingElectra(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitAttesterSlashingElectra_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttesterSlashingElectra - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitAttesterSlashingElectra_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAttesterSlashingElectra(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_SubmitProposerSlashing_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_SubmitProposerSlashing_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ProposerSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitProposerSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitProposerSlashing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_SubmitProposerSlashing_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ProposerSlashing - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_SubmitProposerSlashing_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitProposerSlashing(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconChain_GetIndividualVotes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconChain_GetIndividualVotes_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconChainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndividualVotesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetIndividualVotes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetIndividualVotes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconChain_GetIndividualVotes_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconChainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq IndividualVotesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconChain_GetIndividualVotes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetIndividualVotes(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterBeaconChainHandlerServer registers the http handlers for service BeaconChain to "mux". -// UnaryRPC :call BeaconChainServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconChainHandlerFromEndpoint instead. -func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconChainServer) error { - - mux.Handle("GET", pattern_BeaconChain_ListAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListAttestations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListIndexedAttestations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPool") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_AttestationPool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconBlocks") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListBeaconBlocks_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetChainHead_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetChainHead_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconCommittees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListBeaconCommittees_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconCommittees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidatorBalances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidator") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidator_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorActiveSetChanges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorActiveSetChanges_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorActiveSetChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorQueue_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorPerformance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorPerformance_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorPerformance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorAssignments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_ListValidatorAssignments_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorAssignments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorParticipation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetValidatorParticipation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorParticipation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetBeaconConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetBeaconConfig_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetBeaconConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitAttesterSlashing_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_SubmitProposerSlashing_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitProposerSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetIndividualVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconChain_GetIndividualVotes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetIndividualVotes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterBeaconChainHandlerFromEndpoint is same as RegisterBeaconChainHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterBeaconChainHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterBeaconChainHandler(ctx, mux, conn) -} - -// RegisterBeaconChainHandler registers the http handlers for service BeaconChain to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterBeaconChainHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterBeaconChainHandlerClient(ctx, mux, NewBeaconChainClient(conn)) -} - -// RegisterBeaconChainHandlerClient registers the http handlers for service BeaconChain -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BeaconChainClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BeaconChainClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "BeaconChainClient" to call the correct interceptors. -func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconChainClient) error { - - mux.Handle("GET", pattern_BeaconChain_ListAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListAttestations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListIndexedAttestations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListIndexedAttestationsElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListIndexedAttestationsElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListIndexedAttestationsElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListIndexedAttestationsElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPool") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_AttestationPool_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_AttestationPoolElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/AttestationPoolElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_AttestationPoolElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_AttestationPoolElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconBlocks") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListBeaconBlocks_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetChainHead_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetChainHead_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetChainHead_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListBeaconCommittees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListBeaconCommittees") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListBeaconCommittees_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListBeaconCommittees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidatorBalances_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidators_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidator") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidator_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorActiveSetChanges_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorActiveSetChanges") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorActiveSetChanges_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorActiveSetChanges_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorQueue_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorPerformance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorPerformance_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorPerformance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_ListValidatorAssignments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorAssignments") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_ListValidatorAssignments_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_ListValidatorAssignments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetValidatorParticipation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetValidatorParticipation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetValidatorParticipation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetBeaconConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetBeaconConfig") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetBeaconConfig_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetBeaconConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitAttesterSlashing_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitAttesterSlashingElectra_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitAttesterSlashingElectra") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitAttesterSlashingElectra_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitAttesterSlashingElectra_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_SubmitProposerSlashing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/SubmitProposerSlashing") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_SubmitProposerSlashing_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_SubmitProposerSlashing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconChain_GetIndividualVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetIndividualVotes") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconChain_GetIndividualVotes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconChain_GetIndividualVotes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_BeaconChain_ListAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations"}, "")) - - pattern_BeaconChain_ListAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "attestations_electra"}, "")) - - pattern_BeaconChain_ListIndexedAttestations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed"}, "")) - - pattern_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "indexed_electra"}, "")) - - pattern_BeaconChain_AttestationPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool"}, "")) - - pattern_BeaconChain_AttestationPoolElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "beacon", "attestations", "pool_electra"}, "")) - - pattern_BeaconChain_ListBeaconBlocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "beacon", "blocks"}, "")) - - pattern_BeaconChain_GetChainHead_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "chainhead"}, "")) - - pattern_BeaconChain_ListBeaconCommittees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "committees"}, "")) - - pattern_BeaconChain_ListValidatorBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "balances"}, "")) - - pattern_BeaconChain_ListValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "validators"}, "")) - - pattern_BeaconChain_GetValidator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "validator"}, "")) - - pattern_BeaconChain_GetValidatorActiveSetChanges_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "activesetchanges"}, "")) - - pattern_BeaconChain_GetValidatorQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "queue"}, "")) - - pattern_BeaconChain_GetValidatorPerformance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "performance"}, "")) - - pattern_BeaconChain_ListValidatorAssignments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "assignments"}, "")) - - pattern_BeaconChain_GetValidatorParticipation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validators", "participation"}, "")) - - pattern_BeaconChain_GetBeaconConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "config"}, "")) - - pattern_BeaconChain_SubmitAttesterSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit"}, "")) - - pattern_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "attester", "submit_electra"}, "")) - - pattern_BeaconChain_SubmitProposerSlashing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"eth", "v1alpha1", "beacon", "slashings", "proposer", "submit"}, "")) - - pattern_BeaconChain_GetIndividualVotes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "beacon", "individual_votes"}, "")) -) - -var ( - forward_BeaconChain_ListAttestations_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListAttestationsElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListIndexedAttestations_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListIndexedAttestationsElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_AttestationPool_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_AttestationPoolElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListBeaconBlocks_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetChainHead_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListBeaconCommittees_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidatorBalances_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidators_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidator_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorActiveSetChanges_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorQueue_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorPerformance_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_ListValidatorAssignments_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetValidatorParticipation_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetBeaconConfig_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitAttesterSlashing_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitAttesterSlashingElectra_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_SubmitProposerSlashing_0 = runtime.ForwardResponseMessage - - forward_BeaconChain_GetIndividualVotes_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/beacon_state.pb.gw.go b/proto/prysm/v1alpha1/beacon_state.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/beacon_state.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/blobs.pb.gw.go b/proto/prysm/v1alpha1/blobs.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/blobs.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/debug.pb.gw.go b/proto/prysm/v1alpha1/debug.pb.gw.go deleted file mode 100755 index 750a64dc7280..000000000000 --- a/proto/prysm/v1alpha1/debug.pb.gw.go +++ /dev/null @@ -1,487 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/debug.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_Debug_GetBeaconState_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetBeaconState_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BeaconStateRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBeaconState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBeaconState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetBeaconState_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BeaconStateRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBeaconState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBeaconState(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_GetBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetBlock_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequestByRoot - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetBlock_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequestByRoot - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBlock(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_SetLoggingLevel_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_SetLoggingLevel_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoggingLevelRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_SetLoggingLevel_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SetLoggingLevel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_SetLoggingLevel_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LoggingLevelRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_SetLoggingLevel_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SetLoggingLevel(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Debug_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListPeers(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Debug_GetPeer_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Debug_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, client DebugClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Debug_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, server DebugServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Debug_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPeer(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterDebugHandlerServer registers the http handlers for service Debug to "mux". -// UnaryRPC :call DebugServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDebugHandlerFromEndpoint instead. -func RegisterDebugHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DebugServer) error { - - mux.Handle("GET", pattern_Debug_GetBeaconState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBeaconState") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetBeaconState_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBeaconState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Debug_SetLoggingLevel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/SetLoggingLevel") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_SetLoggingLevel_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_SetLoggingLevel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Debug_GetPeer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterDebugHandlerFromEndpoint is same as RegisterDebugHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDebugHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDebugHandler(ctx, mux, conn) -} - -// RegisterDebugHandler registers the http handlers for service Debug to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterDebugHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDebugHandlerClient(ctx, mux, NewDebugClient(conn)) -} - -// RegisterDebugHandlerClient registers the http handlers for service Debug -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DebugClient" to call the correct interceptors. -func RegisterDebugHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugClient) error { - - mux.Handle("GET", pattern_Debug_GetBeaconState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBeaconState") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetBeaconState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBeaconState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Debug_SetLoggingLevel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/SetLoggingLevel") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_SetLoggingLevel_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_SetLoggingLevel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Debug_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Debug_GetPeer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Debug_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Debug_GetBeaconState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "state"}, "")) - - pattern_Debug_GetBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "block"}, "")) - - pattern_Debug_SetLoggingLevel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "logging"}, "")) - - pattern_Debug_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peers"}, "")) - - pattern_Debug_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "debug", "peer"}, "")) -) - -var ( - forward_Debug_GetBeaconState_0 = runtime.ForwardResponseMessage - - forward_Debug_GetBlock_0 = runtime.ForwardResponseMessage - - forward_Debug_SetLoggingLevel_0 = runtime.ForwardResponseMessage - - forward_Debug_ListPeers_0 = runtime.ForwardResponseMessage - - forward_Debug_GetPeer_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/eip_7251.pb.gw.go b/proto/prysm/v1alpha1/eip_7251.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/eip_7251.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go b/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/health.pb.gw.go b/proto/prysm/v1alpha1/health.pb.gw.go deleted file mode 100755 index 099b72831001..000000000000 --- a/proto/prysm/v1alpha1/health.pb.gw.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/health.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -func request_Health_StreamBeaconLogs_0(ctx context.Context, marshaler runtime.Marshaler, client HealthClient, req *http.Request, pathParams map[string]string) (Health_StreamBeaconLogsClient, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - stream, err := client.StreamBeaconLogs(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -// RegisterHealthHandlerServer registers the http handlers for service Health to "mux". -// UnaryRPC :call HealthServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthHandlerFromEndpoint instead. -func RegisterHealthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthServer) error { - - mux.Handle("GET", pattern_Health_StreamBeaconLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - return nil -} - -// RegisterHealthHandlerFromEndpoint is same as RegisterHealthHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterHealthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterHealthHandler(ctx, mux, conn) -} - -// RegisterHealthHandler registers the http handlers for service Health to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterHealthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterHealthHandlerClient(ctx, mux, NewHealthClient(conn)) -} - -// RegisterHealthHandlerClient registers the http handlers for service Health -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "HealthClient" to call the correct interceptors. -func RegisterHealthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthClient) error { - - mux.Handle("GET", pattern_Health_StreamBeaconLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Health/StreamBeaconLogs") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Health_StreamBeaconLogs_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Health_StreamBeaconLogs_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Health_StreamBeaconLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "health", "logs", "stream"}, "")) -) - -var ( - forward_Health_StreamBeaconLogs_0 = runtime.ForwardResponseStream -) diff --git a/proto/prysm/v1alpha1/node.pb.gw.go b/proto/prysm/v1alpha1/node.pb.gw.go deleted file mode 100755 index 104633765f54..000000000000 --- a/proto/prysm/v1alpha1/node.pb.gw.go +++ /dev/null @@ -1,711 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/node.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -func request_Node_GetSyncStatus_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetSyncStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetSyncStatus_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetSyncStatus(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetGenesis_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetGenesis(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetGenesis_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetGenesis(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetVersion(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Node_GetHealth_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Node_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq HealthRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetHealth_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetHealth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetHealth_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq HealthRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetHealth_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetHealth(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_ListImplementedServices_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListImplementedServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_ListImplementedServices_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListImplementedServices(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetHost(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Node_GetPeer_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Node_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetPeer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetPeer_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PeerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Node_GetPeer_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetPeer(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.ListPeers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_ListPeers_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.ListPeers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Node_GetETH1ConnectionStatus_0(ctx context.Context, marshaler runtime.Marshaler, client NodeClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetETH1ConnectionStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Node_GetETH1ConnectionStatus_0(ctx context.Context, marshaler runtime.Marshaler, server NodeServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetETH1ConnectionStatus(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterNodeHandlerServer registers the http handlers for service Node to "mux". -// UnaryRPC :call NodeServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNodeHandlerFromEndpoint instead. -func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeServer) error { - - mux.Handle("GET", pattern_Node_GetSyncStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetSyncStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetSyncStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetGenesis_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetGenesis_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetGenesis_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetVersion_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHealth") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetHealth_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListImplementedServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListImplementedServices") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_ListImplementedServices_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListImplementedServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHost") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetHost_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetPeer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_ListPeers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetETH1ConnectionStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetETH1ConnectionStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Node_GetETH1ConnectionStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetETH1ConnectionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterNodeHandlerFromEndpoint is same as RegisterNodeHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterNodeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterNodeHandler(ctx, mux, conn) -} - -// RegisterNodeHandler registers the http handlers for service Node to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterNodeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterNodeHandlerClient(ctx, mux, NewNodeClient(conn)) -} - -// RegisterNodeHandlerClient registers the http handlers for service Node -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "NodeClient" to call the correct interceptors. -func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeClient) error { - - mux.Handle("GET", pattern_Node_GetSyncStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetSyncStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetSyncStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetGenesis_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetGenesis_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetGenesis_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetVersion_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHealth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHealth") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetHealth_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHealth_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListImplementedServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListImplementedServices") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_ListImplementedServices_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListImplementedServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetHost") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetHost_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetPeer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetPeer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetPeer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetPeer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_ListPeers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_ListPeers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_ListPeers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Node_GetETH1ConnectionStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetETH1ConnectionStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Node_GetETH1ConnectionStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Node_GetETH1ConnectionStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Node_GetSyncStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "syncing"}, "")) - - pattern_Node_GetGenesis_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "genesis"}, "")) - - pattern_Node_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "version"}, "")) - - pattern_Node_GetHealth_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "health"}, "")) - - pattern_Node_ListImplementedServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "services"}, "")) - - pattern_Node_GetHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "p2p"}, "")) - - pattern_Node_GetPeer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "peer"}, "")) - - pattern_Node_ListPeers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "node", "peers"}, "")) - - pattern_Node_GetETH1ConnectionStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "node", "eth1", "connections"}, "")) -) - -var ( - forward_Node_GetSyncStatus_0 = runtime.ForwardResponseMessage - - forward_Node_GetGenesis_0 = runtime.ForwardResponseMessage - - forward_Node_GetVersion_0 = runtime.ForwardResponseMessage - - forward_Node_GetHealth_0 = runtime.ForwardResponseMessage - - forward_Node_ListImplementedServices_0 = runtime.ForwardResponseMessage - - forward_Node_GetHost_0 = runtime.ForwardResponseMessage - - forward_Node_GetPeer_0 = runtime.ForwardResponseMessage - - forward_Node_ListPeers_0 = runtime.ForwardResponseMessage - - forward_Node_GetETH1ConnectionStatus_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/p2p_messages.pb.gw.go b/proto/prysm/v1alpha1/p2p_messages.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/p2p_messages.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/powchain.pb.gw.go b/proto/prysm/v1alpha1/powchain.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/powchain.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/slasher.pb.gw.go b/proto/prysm/v1alpha1/slasher.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/slasher.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/sync_committee.pb.gw.go b/proto/prysm/v1alpha1/sync_committee.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/sync_committee.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go b/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/validator-client/keymanager.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go deleted file mode 100755 index b5a85384e7a0..000000000000 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ /dev/null @@ -1,2263 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/prysm/v1alpha1/validator.proto - -/* -Package eth is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package eth - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/emptypb" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join -var _ = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch(0) -var _ = emptypb.Empty{} - -var ( - filter_BeaconNodeValidator_GetDuties_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetDuties_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DutiesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetDuties_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetDuties(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetDuties_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DutiesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetDuties_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetDuties(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_DomainData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_DomainData_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DomainRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_DomainData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DomainData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_DomainData_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DomainRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_DomainData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DomainData(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_WaitForChainStart_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_WaitForChainStartClient, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - stream, err := client.WaitForChainStart(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_WaitForActivation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_WaitForActivation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_WaitForActivationClient, runtime.ServerMetadata, error) { - var protoReq ValidatorActivationRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_WaitForActivation_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.WaitForActivation(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_ValidatorIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_ValidatorIndex_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ValidatorIndex_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorIndex(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_ValidatorStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_ValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_ValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorStatus(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_MultipleValidatorStatus_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_MultipleValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MultipleValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_MultipleValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.MultipleValidatorStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_MultipleValidatorStatus_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MultipleValidatorStatusRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_MultipleValidatorStatus_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.MultipleValidatorStatus(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetBeaconBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetBeaconBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetBeaconBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BlockRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetBeaconBlock_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetBeaconBlock(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GenericSignedBeaconBlock - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeBeaconBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeBeaconBlock_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GenericSignedBeaconBlock - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeBeaconBlock(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_PrepareBeaconProposer_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PrepareBeaconProposerRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PrepareBeaconProposer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_PrepareBeaconProposer_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PrepareBeaconProposerRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PrepareBeaconProposer(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq FeeRecipientByPubKeyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetFeeRecipientByPubKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq FeeRecipientByPubKeyRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetFeeRecipientByPubKey(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetAttestationData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetAttestationData_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetAttestationData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAttestationData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetAttestationData_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AttestationDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetAttestationData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAttestationData(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeAttestation_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Attestation - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeAttestation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeAttestation_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Attestation - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeAttestation(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitAggregateSelectionProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregateSelectionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitAggregateSelectionProof(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSignedAggregateSelectionProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedAggregateSubmitRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSignedAggregateSelectionProof(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_ProposeExit_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedVoluntaryExit - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ProposeExit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_ProposeExit_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedVoluntaryExit - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ProposeExit(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommitteeSubnetsSubscribeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubscribeCommitteeSubnets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CommitteeSubnetsSubscribeRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubscribeCommitteeSubnets(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_CheckDoppelGanger_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_CheckDoppelGanger_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DoppelGangerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_CheckDoppelGanger_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.CheckDoppelGanger(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_CheckDoppelGanger_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DoppelGangerRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_CheckDoppelGanger_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.CheckDoppelGanger(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := client.GetSyncMessageBlockRoot(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - msg, err := server.GetSyncMessageBlockRoot(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSyncMessage_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeMessage - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSyncMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSyncMessage_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeMessage - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSyncMessage(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncSubcommitteeIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSyncSubcommitteeIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncSubcommitteeIndexRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_GetSyncSubcommitteeIndex_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetSyncSubcommitteeIndex(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeContributionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSyncCommitteeContribution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SyncCommitteeContributionRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetSyncCommitteeContribution(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedContributionAndProof - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitSignedContributionAndProof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedContributionAndProof - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitSignedContributionAndProof(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_StreamSlots_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_StreamSlots_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_StreamSlotsClient, runtime.ServerMetadata, error) { - var protoReq StreamSlotsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_StreamSlots_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.StreamSlots(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -var ( - filter_BeaconNodeValidator_StreamBlocksAltair_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_StreamBlocksAltair_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (BeaconNodeValidator_StreamBlocksAltairClient, runtime.ServerMetadata, error) { - var protoReq StreamBlocksRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_StreamBlocksAltair_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - stream, err := client.StreamBlocksAltair(ctx, &protoReq) - if err != nil { - return nil, metadata, err - } - header, err := stream.Header() - if err != nil { - return nil, metadata, err - } - metadata.HeaderMD = header - return stream, metadata, nil - -} - -func request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedValidatorRegistrationsV1 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitValidatorRegistrations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SignedValidatorRegistrationsV1 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitValidatorRegistrations(ctx, &protoReq) - return msg, metadata, err - -} - -func request_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AssignValidatorToSubnetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AssignValidatorToSubnet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AssignValidatorToSubnetRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AssignValidatorToSubnet(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx context.Context, marshaler runtime.Marshaler, client BeaconNodeValidatorClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregatedSigAndAggregationBitsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AggregatedSigAndAggregationBits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx context.Context, marshaler runtime.Marshaler, server BeaconNodeValidatorServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AggregatedSigAndAggregationBitsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_BeaconNodeValidator_AggregatedSigAndAggregationBits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AggregatedSigAndAggregationBits(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterBeaconNodeValidatorHandlerServer registers the http handlers for service BeaconNodeValidator to "mux". -// UnaryRPC :call BeaconNodeValidatorServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBeaconNodeValidatorHandlerFromEndpoint instead. -func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BeaconNodeValidatorServer) error { - - mux.Handle("GET", pattern_BeaconNodeValidator_GetDuties_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetDuties_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_DomainData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_DomainData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForChainStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForActivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ValidatorIndex_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ValidatorStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_MultipleValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_MultipleValidatorStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_MultipleValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetBeaconBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeBeaconBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_PrepareBeaconProposer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/PrepareBeaconProposer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_PrepareBeaconProposer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_PrepareBeaconProposer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetAttestationData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetAttestationData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetAttestationData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeAttestation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_ProposeExit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeExit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_CheckDoppelGanger_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/CheckDoppelGanger") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_CheckDoppelGanger_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_CheckDoppelGanger_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSyncMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSyncMessage") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSyncMessage_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSyncMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_GetSyncCommitteeContribution_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedContributionAndProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamSlots_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamBlocksAltair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") - _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_AssignValidatorToSubnet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AssignValidatorToSubnet") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_AssignValidatorToSubnet_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AggregatedSigAndAggregationBits") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterBeaconNodeValidatorHandlerFromEndpoint is same as RegisterBeaconNodeValidatorHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterBeaconNodeValidatorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterBeaconNodeValidatorHandler(ctx, mux, conn) -} - -// RegisterBeaconNodeValidatorHandler registers the http handlers for service BeaconNodeValidator to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterBeaconNodeValidatorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterBeaconNodeValidatorHandlerClient(ctx, mux, NewBeaconNodeValidatorClient(conn)) -} - -// RegisterBeaconNodeValidatorHandlerClient registers the http handlers for service BeaconNodeValidator -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BeaconNodeValidatorClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BeaconNodeValidatorClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "BeaconNodeValidatorClient" to call the correct interceptors. -func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BeaconNodeValidatorClient) error { - - mux.Handle("GET", pattern_BeaconNodeValidator_GetDuties_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetDuties_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetDuties_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_DomainData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/DomainData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_DomainData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_DomainData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForChainStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForChainStart") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_WaitForChainStart_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_WaitForChainStart_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_WaitForActivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/WaitForActivation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_WaitForActivation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_WaitForActivation_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ValidatorIndex_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_ValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ValidatorStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_MultipleValidatorStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/MultipleValidatorStatus") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_MultipleValidatorStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_MultipleValidatorStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetBeaconBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeBeaconBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeBeaconBlock") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeBeaconBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeBeaconBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_PrepareBeaconProposer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/PrepareBeaconProposer") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_PrepareBeaconProposer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_PrepareBeaconProposer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetFeeRecipientByPubKey_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetAttestationData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetAttestationData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetAttestationData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeAttestation") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeAttestation_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeAttestation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitAggregateSelectionProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedAggregateSelectionProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_ProposeExit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/ProposeExit") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_ProposeExit_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_ProposeExit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubscribeCommitteeSubnets") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubscribeCommitteeSubnets_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_CheckDoppelGanger_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/CheckDoppelGanger") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_CheckDoppelGanger_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_CheckDoppelGanger_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncMessageBlockRoot_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSyncMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSyncMessage") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSyncMessage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSyncMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_GetSyncCommitteeContribution_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitSignedContributionAndProof") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitSignedContributionAndProof_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamSlots_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamSlots") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_StreamSlots_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_StreamSlots_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_StreamBlocksAltair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/StreamBlocksAltair") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_StreamBlocksAltair_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_StreamBlocksAltair_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SubmitValidatorRegistrations") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_SubmitValidatorRegistrations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_BeaconNodeValidator_AssignValidatorToSubnet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AssignValidatorToSubnet") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_AssignValidatorToSubnet_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AggregatedSigAndAggregationBits") - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_BeaconNodeValidator_GetDuties_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "duties"}, "")) - - pattern_BeaconNodeValidator_DomainData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "domain"}, "")) - - pattern_BeaconNodeValidator_WaitForChainStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "chainstart", "stream"}, "")) - - pattern_BeaconNodeValidator_WaitForActivation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "activation", "stream"}, "")) - - pattern_BeaconNodeValidator_ValidatorIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "index"}, "")) - - pattern_BeaconNodeValidator_ValidatorStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "status"}, "")) - - pattern_BeaconNodeValidator_MultipleValidatorStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "statuses"}, "")) - - pattern_BeaconNodeValidator_GetBeaconBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "validator", "block"}, "")) - - pattern_BeaconNodeValidator_ProposeBeaconBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha2", "validator", "block"}, "")) - - pattern_BeaconNodeValidator_PrepareBeaconProposer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "prepare_beacon_proposer"}, "")) - - pattern_BeaconNodeValidator_GetFeeRecipientByPubKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "fee_recipient_by_pub_key"}, "")) - - pattern_BeaconNodeValidator_GetAttestationData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation"}, "")) - - pattern_BeaconNodeValidator_ProposeAttestation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "attestation"}, "")) - - pattern_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) - - pattern_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "aggregate"}, "")) - - pattern_BeaconNodeValidator_ProposeExit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "exit"}, "")) - - pattern_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "subnet", "subscribe"}, "")) - - pattern_BeaconNodeValidator_CheckDoppelGanger_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "doppelganger"}, "")) - - pattern_BeaconNodeValidator_GetSyncMessageBlockRoot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "sync_message_block_root"}, "")) - - pattern_BeaconNodeValidator_SubmitSyncMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "sync_message"}, "")) - - pattern_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"eth", "v1alpha1", "sync_subcommittee_index"}, "")) - - pattern_BeaconNodeValidator_GetSyncCommitteeContribution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "contribution_and_proof"}, "")) - - pattern_BeaconNodeValidator_SubmitSignedContributionAndProof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "signed_contribution_and_proof"}, "")) - - pattern_BeaconNodeValidator_StreamSlots_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "stream_slots"}, "")) - - pattern_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "stream"}, "")) - - pattern_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"eth", "v1alpha1", "validator", "registration"}, "")) - - pattern_BeaconNodeValidator_AssignValidatorToSubnet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "assign_validator_to_subnet"}, "")) - - pattern_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"eth", "v1alpha1", "validator", "blocks", "aggregated_sig_and_aggregation_bits"}, "")) -) - -var ( - forward_BeaconNodeValidator_GetDuties_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_DomainData_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_WaitForChainStart_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_WaitForActivation_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_ValidatorIndex_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ValidatorStatus_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_MultipleValidatorStatus_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetBeaconBlock_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeBeaconBlock_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_PrepareBeaconProposer_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetFeeRecipientByPubKey_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetAttestationData_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeAttestation_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitAggregateSelectionProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSignedAggregateSelectionProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_ProposeExit_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubscribeCommitteeSubnets_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_CheckDoppelGanger_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncMessageBlockRoot_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSyncMessage_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncSubcommitteeIndex_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_GetSyncCommitteeContribution_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_SubmitSignedContributionAndProof_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_StreamSlots_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_StreamBlocksAltair_0 = runtime.ForwardResponseStream - - forward_BeaconNodeValidator_SubmitValidatorRegistrations_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_AssignValidatorToSubnet_0 = runtime.ForwardResponseMessage - - forward_BeaconNodeValidator_AggregatedSigAndAggregationBits_0 = runtime.ForwardResponseMessage -) diff --git a/proto/prysm/v1alpha1/withdrawals.pb.gw.go b/proto/prysm/v1alpha1/withdrawals.pb.gw.go deleted file mode 100755 index cdd03643f0c7..000000000000 --- a/proto/prysm/v1alpha1/withdrawals.pb.gw.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build ignore -// +build ignore - -package ignore From b6ba98c2dc18a7dd5664002443c5a1e51ae9bd16 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 11 Jun 2024 16:30:46 -0500 Subject: [PATCH 12/58] renaming flags and other gateway services to http --- api/grpc/grpcutils.go | 15 - api/grpc/grpcutils_test.go | 14 - api/server/{rest => http-rest}/BUILD.bazel | 3 +- api/server/{rest => http-rest}/log.go | 2 +- api/server/{rest => http-rest}/options.go | 6 +- api/server/{rest => http-rest}/server.go | 21 +- api/server/{rest => http-rest}/server_test.go | 27 +- beacon-chain/node/BUILD.bazel | 2 +- beacon-chain/node/node.go | 39 +- beacon-chain/node/node_test.go | 4 +- beacon-chain/rpc/eth/helpers/BUILD.bazel | 4 - beacon-chain/rpc/eth/helpers/sync.go | 43 -- beacon-chain/rpc/eth/helpers/sync_test.go | 46 -- cmd/beacon-chain/flags/base.go | 43 +- cmd/beacon-chain/main.go | 8 +- cmd/beacon-chain/usage.go | 8 +- cmd/validator/flags/flags.go | 50 +- cmd/validator/main.go | 8 +- cmd/validator/usage.go | 13 +- cmd/validator/web/web.go | 10 +- hack/interop_start.sh | 2 +- proto/eth/v1/README.md | 4 - proto/prysm/v1alpha1/README.md | 4 - proto/prysm/v1alpha1/beacon_chain.proto | 1 - testing/endtoend/components/beacon_node.go | 2 +- .../components/lighthouse_validator.go | 2 +- testing/endtoend/components/validator.go | 8 +- testing/endtoend/endtoend_setup_test.go | 4 - testing/endtoend/evaluators/BUILD.bazel | 2 - .../evaluators/api_gateway_v1alpha1.go | 501 ------------------ testing/endtoend/evaluators/beaconapi/util.go | 6 +- .../endtoend/evaluators/beaconapi/verify.go | 2 +- .../endtoend/evaluators/execution_engine.go | 4 +- testing/endtoend/evaluators/operations.go | 2 +- testing/endtoend/evaluators/validator.go | 2 +- testing/endtoend/helpers/helpers.go | 2 +- testing/endtoend/params/params.go | 18 +- testing/endtoend/params/params_test.go | 2 +- validator/node/BUILD.bazel | 2 +- validator/node/node.go | 57 +- validator/package/validator.yaml | 4 +- validator/rpc/auth_token.go | 2 +- validator/rpc/handlers_keymanager_test.go | 11 +- validator/rpc/server.go | 14 +- validator/web/BUILD.bazel | 1 - 45 files changed, 197 insertions(+), 828 deletions(-) rename api/server/{rest => http-rest}/BUILD.bazel (87%) rename api/server/{rest => http-rest}/log.go (82%) rename api/server/{rest => http-rest}/options.go (91%) rename api/server/{rest => http-rest}/server.go (77%) rename api/server/{rest => http-rest}/server_test.go (66%) delete mode 100644 proto/eth/v1/README.md delete mode 100644 proto/prysm/v1alpha1/README.md delete mode 100644 testing/endtoend/evaluators/api_gateway_v1alpha1.go diff --git a/api/grpc/grpcutils.go b/api/grpc/grpcutils.go index 53378b6c1a5f..b1d9444d5788 100644 --- a/api/grpc/grpcutils.go +++ b/api/grpc/grpcutils.go @@ -2,8 +2,6 @@ package grpc import ( "context" - "encoding/json" - "fmt" "strings" "time" @@ -81,16 +79,3 @@ func AppendHeaders(parent context.Context, headers []string) context.Context { } return parent } - -// AppendCustomErrorHeader sets a CustomErrorMetadataKey gRPC header on the passed in context, -// using the passed in error data as the header's value. The data is serialized as JSON. -func AppendCustomErrorHeader(ctx context.Context, errorData interface{}) error { - j, err := json.Marshal(errorData) - if err != nil { - return fmt.Errorf("could not marshal error data into JSON: %w", err) - } - if err := grpc.SetHeader(ctx, metadata.Pairs(CustomErrorMetadataKey, string(j))); err != nil { - return fmt.Errorf("could not set custom error header: %w", err) - } - return nil -} diff --git a/api/grpc/grpcutils_test.go b/api/grpc/grpcutils_test.go index fab083ae84e8..8bae339a5637 100644 --- a/api/grpc/grpcutils_test.go +++ b/api/grpc/grpcutils_test.go @@ -58,17 +58,3 @@ func TestAppendHeaders(t *testing.T) { assert.Equal(t, "value=1", md.Get("first")[0]) }) } - -//func TestAppendCustomErrorHeader(t *testing.T) { -// ctx := context.Background() -// stream := &runtime.ServerTransportStream{} -// ctx = grpc.NewContextWithServerTransportStream(ctx, stream) -// data := &customErrorData{Message: "foo"} -// require.NoError(t, AppendCustomErrorHeader(ctx, data)) -// // The stream used in test setup sets the metadata key in lowercase. -// value, ok := stream.Header()[strings.ToLower(CustomErrorMetadataKey)] -// require.Equal(t, true, ok, "Failed to retrieve custom error metadata value") -// expected, err := json.Marshal(data) -// require.NoError(t, err) -// assert.Equal(t, string(expected), value[0]) -//} diff --git a/api/server/rest/BUILD.bazel b/api/server/http-rest/BUILD.bazel similarity index 87% rename from api/server/rest/BUILD.bazel rename to api/server/http-rest/BUILD.bazel index b42280f663c3..76b468532107 100644 --- a/api/server/rest/BUILD.bazel +++ b/api/server/http-rest/BUILD.bazel @@ -7,7 +7,7 @@ go_library( "options.go", "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/v5/api/server/rest", + importpath = "github.com/prysmaticlabs/prysm/v5/api/server/http-rest", visibility = ["//visibility:public"], deps = [ "//api/server/middleware:go_default_library", @@ -26,6 +26,7 @@ go_test( "//cmd/beacon-chain/flags:go_default_library", "//testing/assert:go_default_library", "//testing/require:go_default_library", + "@com_github_gorilla_mux//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_urfave_cli_v2//:go_default_library", ], diff --git a/api/server/rest/log.go b/api/server/http-rest/log.go similarity index 82% rename from api/server/rest/log.go rename to api/server/http-rest/log.go index 7fe5ca46f803..e94c0fc8c1a9 100644 --- a/api/server/rest/log.go +++ b/api/server/http-rest/log.go @@ -1,4 +1,4 @@ -package rest +package http_rest import "github.com/sirupsen/logrus" diff --git a/api/server/rest/options.go b/api/server/http-rest/options.go similarity index 91% rename from api/server/rest/options.go rename to api/server/http-rest/options.go index c24a115e9a3c..335af24d41b3 100644 --- a/api/server/rest/options.go +++ b/api/server/http-rest/options.go @@ -1,4 +1,4 @@ -package rest +package http_rest import ( "time" @@ -15,9 +15,9 @@ func WithMuxHandler(m restHandler) Option { } } -func WithGatewayAddr(addr string) Option { +func WithHTTPAddr(addr string) Option { return func(g *Server) error { - g.cfg.gatewayAddr = addr + g.cfg.httpAddr = addr return nil } } diff --git a/api/server/rest/server.go b/api/server/http-rest/server.go similarity index 77% rename from api/server/rest/server.go rename to api/server/http-rest/server.go index db5ff0f1ff58..45a973becfb1 100644 --- a/api/server/rest/server.go +++ b/api/server/http-rest/server.go @@ -1,5 +1,4 @@ -// Package gateway defines a grpc-gateway server that serves HTTP-JSON traffic and acts a proxy between HTTP and gRPC. -package rest +package http_rest import ( "context" @@ -21,16 +20,16 @@ type restHandler func( req *http.Request, ) -// Config parameters for setting up the gateway service. +// Config parameters for setting up the http-rest service. type config struct { - gatewayAddr string + httpAddr string allowedOrigins []string muxHandler restHandler router *mux.Router timeout time.Duration } -// Server is the gRPC gateway to serve HTTP JSON traffic as a proxy and forward it to the gRPC server. +// Server serves HTTP JSON traffic. type Server struct { cfg *config server *http.Server @@ -58,7 +57,7 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) // TODO: actually use the timeout config provided g.server = &http.Server{ - Addr: g.cfg.gatewayAddr, + Addr: g.cfg.httpAddr, Handler: corsMux, ReadHeaderTimeout: time.Second, } @@ -70,22 +69,22 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { return g, nil } -// Start the gateway service. +// Start the http rest service. func (g *Server) Start() { _, cancel := context.WithCancel(g.ctx) g.cancel = cancel go func() { - log.WithField("address", g.cfg.gatewayAddr).Info("Starting gRPC gateway") + log.WithField("address", g.cfg.httpAddr).Info("Starting HTTP server") if err := g.server.ListenAndServe(); err != http.ErrServerClosed { - log.WithError(err).Error("Failed to start gRPC gateway") + log.WithError(err).Error("Failed to start HTTP server") g.startFailure = err return } }() } -// Status of grpc gateway. Returns an error if this service is unhealthy. +// Status of the HTTP server. Returns an error if this service is unhealthy. func (g *Server) Status() error { if g.startFailure != nil { return g.startFailure @@ -93,7 +92,7 @@ func (g *Server) Status() error { return nil } -// Stop the gateway with a graceful shutdown. +// Stop the HTTP server with a graceful shutdown. func (g *Server) Stop() error { if g.server != nil { shutdownCtx, shutdownCancel := context.WithTimeout(g.ctx, 2*time.Second) diff --git a/api/server/rest/server_test.go b/api/server/http-rest/server_test.go similarity index 66% rename from api/server/rest/server_test.go rename to api/server/http-rest/server_test.go index 2a96b8acd997..d196f8c353f6 100644 --- a/api/server/rest/server_test.go +++ b/api/server/http-rest/server_test.go @@ -1,4 +1,4 @@ -package rest +package http_rest import ( "context" @@ -9,6 +9,7 @@ import ( "net/url" "testing" + "github.com/gorilla/mux" "github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" @@ -16,25 +17,26 @@ import ( "github.com/urfave/cli/v2" ) -func TestGateway_StartStop(t *testing.T) { +func TestServer_StartStop(t *testing.T) { hook := logTest.NewGlobal() app := cli.App{} set := flag.NewFlagSet("test", 0) ctx := cli.NewContext(&app, set, nil) - gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) - gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) + port := ctx.Int(flags.HTTPServerPort.Name) + host := ctx.String(flags.HTTPServerHost.Name) + address := fmt.Sprintf("%s:%d", host, port) opts := []Option{ - WithGatewayAddr(gatewayAddress), + WithHTTPAddr(address), WithMuxHandler(func( _ http.HandlerFunc, _ http.ResponseWriter, _ *http.Request, ) { }), + WithRouter(mux.NewRouter()), } g, err := New(context.Background(), opts...) @@ -42,24 +44,25 @@ func TestGateway_StartStop(t *testing.T) { g.Start() go func() { - require.LogsContain(t, hook, "Starting gRPC gateway") + require.LogsContain(t, hook, "Starting HTTP server") require.LogsDoNotContain(t, hook, "Starting API middleware") }() err = g.Stop() require.NoError(t, err) } -func TestGateway_NilHandler_NotFoundHandlerRegistered(t *testing.T) { +func TestServer_NilHandler_NotFoundHandlerRegistered(t *testing.T) { app := cli.App{} set := flag.NewFlagSet("test", 0) ctx := cli.NewContext(&app, set, nil) - gatewayPort := ctx.Int(flags.GRPCGatewayPort.Name) - gatewayHost := ctx.String(flags.GRPCGatewayHost.Name) - gatewayAddress := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) + port := ctx.Int(flags.HTTPServerPort.Name) + host := ctx.String(flags.HTTPServerHost.Name) + address := fmt.Sprintf("%s:%d", host, port) opts := []Option{ - WithGatewayAddr(gatewayAddress), + WithHTTPAddr(address), + WithRouter(mux.NewRouter()), } g, err := New(context.Background(), opts...) diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 74b2432557c7..21d2e3f7036a 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -15,8 +15,8 @@ go_library( "//cmd/beacon-chain:__subpackages__", ], deps = [ + "//api/server/http-rest:go_default_library", "//api/server/middleware:go_default_library", - "//api/server/rest:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/builder:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 451459c76cd8..ede4aa15d98c 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,8 +19,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" + http_rest "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" - "github.com/prysmaticlabs/prysm/v5/api/server/rest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/builder" @@ -368,9 +368,9 @@ func registerServices(cliCtx *cli.Context, beacon *BeaconNode, synchronizer *sta return errors.Wrap(err, "could not register RPC service") } - log.Debugln("Registering GRPC Gateway Service") - if err := beacon.registerGRPCGateway(router); err != nil { - return errors.Wrap(err, "could not register GRPC gateway service") + log.Debugln("Registering HTTP Service") + if err := beacon.registerHTTPService(router); err != nil { + return errors.Wrap(err, "could not register HTTP service") } log.Debugln("Registering Validator Monitoring Service") @@ -401,10 +401,10 @@ func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error { func newRouter(cliCtx *cli.Context) *mux.Router { var allowedOrigins []string - if cliCtx.IsSet(flags.GPRCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") + if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GPRCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") } r := mux.NewRouter() r.Use(middleware.NormalizeQueryValuesHandler) @@ -1045,23 +1045,20 @@ func (b *BeaconNode) registerPrometheusService(_ *cli.Context) error { return b.services.RegisterService(service) } -func (b *BeaconNode) registerGRPCGateway(router *mux.Router) error { - if b.cliCtx.Bool(flags.DisableGRPCGateway.Name) { - return nil - } - gatewayHost := b.cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := b.cliCtx.Int(flags.GRPCGatewayPort.Name) - gatewayAddress := net.JoinHostPort(gatewayHost, strconv.Itoa(gatewayPort)) - allowedOrigins := strings.Split(b.cliCtx.String(flags.GPRCGatewayCorsDomain.Name), ",") +func (b *BeaconNode) registerHTTPService(router *mux.Router) error { + host := b.cliCtx.String(flags.HTTPServerHost.Name) + port := b.cliCtx.Int(flags.HTTPServerPort.Name) + address := net.JoinHostPort(host, strconv.Itoa(port)) + allowedOrigins := strings.Split(b.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - opts := []rest.Option{ - rest.WithRouter(router), - rest.WithGatewayAddr(gatewayAddress), - rest.WithAllowedOrigins(allowedOrigins), - rest.WithTimeout(uint64(timeout)), + opts := []http_rest.Option{ + http_rest.WithRouter(router), + http_rest.WithHTTPAddr(address), + http_rest.WithAllowedOrigins(allowedOrigins), + http_rest.WithTimeout(uint64(timeout)), } - g, err := rest.New(b.ctx, opts...) + g, err := http_rest.New(b.ctx, opts...) if err != nil { return err } diff --git a/beacon-chain/node/node_test.go b/beacon-chain/node/node_test.go index c7aca7d8d777..3cf022226a46 100644 --- a/beacon-chain/node/node_test.go +++ b/beacon-chain/node/node_test.go @@ -255,9 +255,9 @@ func TestCORS(t *testing.T) { // Mock CLI context with a test CORS domain app := cli.App{} set := flag.NewFlagSet("test", 0) - set.String(flags.GPRCGatewayCorsDomain.Name, "http://allowed-example.com", "") + set.String(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com", "") cliCtx := cli.NewContext(&app, set, nil) - require.NoError(t, cliCtx.Set(flags.GPRCGatewayCorsDomain.Name, "http://allowed-example.com")) + require.NoError(t, cliCtx.Set(flags.HTTPServerCorsDomain.Name, "http://allowed-example.com")) router := newRouter(cliCtx) diff --git a/beacon-chain/rpc/eth/helpers/BUILD.bazel b/beacon-chain/rpc/eth/helpers/BUILD.bazel index 83f56c2c0da5..c9e1b5ff4b4d 100644 --- a/beacon-chain/rpc/eth/helpers/BUILD.bazel +++ b/beacon-chain/rpc/eth/helpers/BUILD.bazel @@ -10,14 +10,11 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/eth/helpers", visibility = ["//visibility:public"], deps = [ - "//api/grpc:go_default_library", - "//api/server/structs:go_default_library", "//beacon-chain/blockchain:go_default_library", "//beacon-chain/db:go_default_library", "//beacon-chain/rpc/lookup:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/stategen:go_default_library", - "//beacon-chain/sync:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", "//consensus-types/interfaces:go_default_library", @@ -46,7 +43,6 @@ go_test( "//beacon-chain/rpc/testutil:go_default_library", "//beacon-chain/state:go_default_library", "//beacon-chain/state/state-native:go_default_library", - "//beacon-chain/sync/initial-sync/testing:go_default_library", "//config/fieldparams:go_default_library", "//config/params:go_default_library", "//consensus-types/blocks:go_default_library", diff --git a/beacon-chain/rpc/eth/helpers/sync.go b/beacon-chain/rpc/eth/helpers/sync.go index 856f1c0aced8..0f1d4509306a 100644 --- a/beacon-chain/rpc/eth/helpers/sync.go +++ b/beacon-chain/rpc/eth/helpers/sync.go @@ -8,58 +8,15 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/grpc" - "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/v5/beacon-chain/db" "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/lookup" - "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/encoding/bytesutil" "github.com/prysmaticlabs/prysm/v5/time/slots" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" ) -// ValidateSyncGRPC checks whether the node is currently syncing and returns an error if it is. -// It also appends syncing info to gRPC headers. -func ValidateSyncGRPC( - ctx context.Context, - syncChecker sync.Checker, - headFetcher blockchain.HeadFetcher, - timeFetcher blockchain.TimeFetcher, - optimisticModeFetcher blockchain.OptimisticModeFetcher, -) error { - if !syncChecker.Syncing() { - return nil - } - headSlot := headFetcher.HeadSlot() - isOptimistic, err := optimisticModeFetcher.IsOptimistic(ctx) - if err != nil { - return status.Errorf(codes.Internal, "Could not check optimistic status: %v", err) - } - - syncDetailsContainer := &structs.SyncDetailsContainer{ - Data: &structs.SyncDetails{ - HeadSlot: strconv.FormatUint(uint64(headSlot), 10), - SyncDistance: strconv.FormatUint(uint64(timeFetcher.CurrentSlot()-headSlot), 10), - IsSyncing: true, - IsOptimistic: isOptimistic, - }, - } - - err = grpc.AppendCustomErrorHeader(ctx, syncDetailsContainer) - if err != nil { - return status.Errorf( - codes.Internal, - "Syncing to latest head, not ready to respond. Could not prepare sync details: %v", - err, - ) - } - return status.Error(codes.Unavailable, "Syncing to latest head, not ready to respond") -} - // IsOptimistic checks whether the beacon state's block is optimistic. func IsOptimistic( ctx context.Context, diff --git a/beacon-chain/rpc/eth/helpers/sync_test.go b/beacon-chain/rpc/eth/helpers/sync_test.go index 43c1511b76bd..ee5f004044f6 100644 --- a/beacon-chain/rpc/eth/helpers/sync_test.go +++ b/beacon-chain/rpc/eth/helpers/sync_test.go @@ -12,7 +12,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/beacon-chain/rpc/testutil" "github.com/prysmaticlabs/prysm/v5/beacon-chain/state" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" - syncmock "github.com/prysmaticlabs/prysm/v5/beacon-chain/sync/initial-sync/testing" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks" @@ -25,51 +24,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/util" ) -func TestValidateSync(t *testing.T) { - // TODO: determine if we should create our own serverTransportStream or remove the gRPC sync header metatdata - //ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) - //t.Run("syncing", func(t *testing.T) { - // syncChecker := &syncmock.Sync{ - // IsSyncing: true, - // } - // headSlot := primitives.Slot(100) - // st, err := util.NewBeaconState() - // require.NoError(t, err) - // require.NoError(t, st.SetSlot(50)) - // chainService := &chainmock.ChainService{ - // Slot: &headSlot, - // State: st, - // } - // err = ValidateSyncGRPC(ctx, syncChecker, chainService, chainService, chainService) - // require.NotNil(t, err) - // sts, ok := grpc.ServerTransportStreamFromContext(ctx).(*runtime.ServerTransportStream) - // require.Equal(t, true, ok, "type assertion failed") - // md := sts.Header() - // v, ok := md[strings.ToLower(grpcutil.CustomErrorMetadataKey)] - // require.Equal(t, true, ok, "could not retrieve custom error metadata value") - // assert.DeepEqual( - // t, - // []string{`{"data":{"head_slot":"50","sync_distance":"50","is_syncing":true,"is_optimistic":false,"el_offline":false}}`}, - // v, - // ) - //}) - t.Run("not syncing", func(t *testing.T) { - syncChecker := &syncmock.Sync{ - IsSyncing: false, - } - headSlot := primitives.Slot(100) - st, err := util.NewBeaconState() - require.NoError(t, err) - require.NoError(t, st.SetSlot(50)) - chainService := &chainmock.ChainService{ - Slot: &headSlot, - State: st, - } - err = ValidateSyncGRPC(context.Background(), syncChecker, nil, nil, chainService) - require.NoError(t, err) - }) -} - func TestIsOptimistic(t *testing.T) { ctx := context.Background() diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 4e8c94882043..f13b4a33764e 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -100,30 +100,33 @@ var ( Usage: "Comma-separated list of API module names. Possible values: `" + PrysmAPIModule + `,` + EthAPIModule + "`.", Value: PrysmAPIModule + `,` + EthAPIModule, } - // DisableGRPCGateway for JSON-HTTP requests to the beacon node. - DisableGRPCGateway = &cli.BoolFlag{ + // Deprecated: DeprecatedDisableGRPCGateway for JSON-HTTP requests to the beacon node. + DeprecatedDisableGRPCGateway = &cli.BoolFlag{ Name: "disable-grpc-gateway", Usage: "Disable the gRPC gateway for JSON-HTTP requests", } - // GRPCGatewayHost specifies a gRPC gateway host for Prysm. - GRPCGatewayHost = &cli.StringFlag{ - Name: "grpc-gateway-host", - Usage: "The host on which the gateway server runs on", - Value: "127.0.0.1", - } - // GRPCGatewayPort specifies a gRPC gateway port for Prysm. - GRPCGatewayPort = &cli.IntFlag{ - Name: "grpc-gateway-port", - Usage: "The port on which the gateway server runs on", - Value: 3500, - } - // GPRCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. - GPRCGatewayCorsDomain = &cli.StringFlag{ - Name: "grpc-gateway-corsdomain", - Usage: "Comma separated list of domains from which to accept cross origin requests " + - "(browser enforced). This flag has no effect if not used with --grpc-gateway-port.", - Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + // HTTPServerHost specifies a HTTP server host for the validator client. + HTTPServerHost = &cli.StringFlag{ + Name: "http-host", + Usage: "Host on which the HTTP server runs on.", + Value: "127.0.0.1", + Aliases: []string{"grpc-gateway-host"}, + } + // HTTPServerPort enables a REST server port to be exposed for the validator client. + HTTPServerPort = &cli.IntFlag{ + Name: "http-port", + Usage: "Port on which the REST server runs on.", + Value: 3500, + Aliases: []string{"grpc-gateway-port"}, + } + // HTTPServerCorsDomain serves preflight requests when serving HTTP. + HTTPServerCorsDomain = &cli.StringFlag{ + Name: "corsdomain", + Usage: "Comma separated list of domains from which to accept cross origin requests.", + Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + Aliases: []string{"grpc-gateway-corsdomain"}, } + // MinSyncPeers specifies the required number of successful peer handshakes in order // to start syncing with external peers. MinSyncPeers = &cli.IntFlag{ diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index b74f9d523671..f1f3f0f5f7a7 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -49,10 +49,10 @@ var appFlags = []cli.Flag{ flags.CertFlag, flags.KeyFlag, flags.HTTPModules, - flags.DisableGRPCGateway, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, - flags.GPRCGatewayCorsDomain, + flags.DeprecatedDisableGRPCGateway, + flags.HTTPServerHost, + flags.HTTPServerPort, + flags.HTTPServerCorsDomain, flags.MinSyncPeers, flags.ContractDeploymentBlock, flags.SetGCPercent, diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 6d0f39cc2535..6a06588ae338 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -103,10 +103,9 @@ var appHelpFlagGroups = []flagGroup{ flags.CertFlag, flags.KeyFlag, flags.HTTPModules, - flags.DisableGRPCGateway, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, - flags.GPRCGatewayCorsDomain, + flags.HTTPServerHost, + flags.HTTPServerPort, + flags.HTTPServerCorsDomain, flags.ExecutionEngineEndpoint, flags.ExecutionEngineHeaders, flags.ExecutionJWTSecretFlag, @@ -195,6 +194,7 @@ var appHelpFlagGroups = []flagGroup{ Name: "deprecated", Flags: []cli.Flag{ cmd.BackupWebhookOutputDir, + flags.DeprecatedDisableGRPCGateway, }, }, } diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index d9822cc7223f..9d9d12b6d56f 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -17,8 +17,8 @@ import ( const ( // WalletDefaultDirName for accounts. WalletDefaultDirName = "prysm-wallet-v2" - // DefaultGatewayHost for the validator client. - DefaultGatewayHost = "127.0.0.1" + // DefaultHTTPServerHost for the validator client. + DefaultHTTPServerHost = "127.0.0.1" ) var ( @@ -35,10 +35,10 @@ var ( Usage: "Beacon node RPC provider endpoint.", Value: "127.0.0.1:4000", } - // BeaconRPCGatewayProviderFlag defines a beacon node JSON-RPC endpoint. - BeaconRPCGatewayProviderFlag = &cli.StringFlag{ + // Deprecated: DeprecatedBeaconRPCGatewayProviderFlag defines a beacon node JSON-RPC endpoint. + DeprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ Name: "beacon-rpc-gateway-provider", - Usage: "Beacon node RPC gateway provider endpoint.", + Usage: "Flag deprecated and unused", Value: "127.0.0.1:3500", } // BeaconRESTApiProviderFlag defines a beacon node REST API endpoint. @@ -109,25 +109,27 @@ var ( Usage: `Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls. Example: --grpc-headers=key=value`, } - // GRPCGatewayHost specifies a gRPC gateway host for the validator client. - GRPCGatewayHost = &cli.StringFlag{ - Name: "grpc-gateway-host", - Usage: "Host on which the gateway server runs on.", - Value: DefaultGatewayHost, - } - // GRPCGatewayPort enables a gRPC gateway to be exposed for the validator client. - GRPCGatewayPort = &cli.IntFlag{ - Name: "grpc-gateway-port", - Usage: "Enables gRPC gateway for JSON requests.", - Value: 7500, - } - // GRPCGatewayCorsDomain serves preflight requests when serving gRPC JSON gateway. - GRPCGatewayCorsDomain = &cli.StringFlag{ - Name: "grpc-gateway-corsdomain", - Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced). - This flag has no effect if not used with --grpc-gateway-port. -`, - Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000"} + // HTTPServerHost specifies a HTTP server host for the validator client. + HTTPServerHost = &cli.StringFlag{ + Name: "http-host", + Usage: "Host on which the HTTP server runs on.", + Value: DefaultHTTPServerHost, + Aliases: []string{"grpc-gateway-host"}, + } + // HTTPServerPort enables a HTTP server port to be exposed for the validator client. + HTTPServerPort = &cli.IntFlag{ + Name: "http-port", + Usage: "Port on which the HTTP server runs on.", + Value: 7500, + Aliases: []string{"grpc-gateway-port"}, + } + // HTTPServerCorsDomain adds accepted cross origin request addresses. + HTTPServerCorsDomain = &cli.StringFlag{ + Name: "corsdomain", + Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced).`, + Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + Aliases: []string{"grpc-gateway-corsdomain"}, + } // MonitoringPortFlag defines the http port used to serve prometheus metrics. MonitoringPortFlag = &cli.IntFlag{ Name: "monitoring-port", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index f5ca240ee05a..86ac6f502afa 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -50,7 +50,7 @@ func startNode(ctx *cli.Context) error { var appFlags = []cli.Flag{ flags.BeaconRPCProviderFlag, - flags.BeaconRPCGatewayProviderFlag, + flags.DeprecatedBeaconRPCGatewayProviderFlag, flags.BeaconRESTApiProviderFlag, flags.CertFlag, flags.GraffitiFlag, @@ -60,12 +60,12 @@ var appFlags = []cli.Flag{ flags.EnableRPCFlag, flags.RPCHost, flags.RPCPort, - flags.GRPCGatewayPort, - flags.GRPCGatewayHost, + flags.HTTPServerPort, + flags.HTTPServerHost, flags.GRPCRetriesFlag, flags.GRPCRetryDelayFlag, flags.GRPCHeadersFlag, - flags.GRPCGatewayCorsDomain, + flags.HTTPServerCorsDomain, flags.DisableAccountMetricsFlag, flags.MonitoringPortFlag, flags.SlasherRPCProviderFlag, diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index cef63780bba8..436c2b467662 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -96,15 +96,14 @@ var appHelpFlagGroups = []flagGroup{ Flags: []cli.Flag{ flags.CertFlag, flags.BeaconRPCProviderFlag, - flags.BeaconRPCGatewayProviderFlag, flags.EnableRPCFlag, flags.RPCHost, flags.RPCPort, - flags.GRPCGatewayPort, - flags.GRPCGatewayHost, + flags.HTTPServerPort, + flags.HTTPServerHost, flags.GRPCRetriesFlag, flags.GRPCRetryDelayFlag, - flags.GRPCGatewayCorsDomain, + flags.HTTPServerCorsDomain, flags.GRPCHeadersFlag, flags.BeaconRESTApiProviderFlag, }, @@ -157,6 +156,12 @@ var appHelpFlagGroups = []flagGroup{ flags.InteropStartIndex, }, }, + { + Name: "deprecated", + Flags: []cli.Flag{ + flags.DeprecatedBeaconRPCGatewayProviderFlag, + }, + }, } func init() { diff --git a/cmd/validator/web/web.go b/cmd/validator/web/web.go index 34a4edb22ace..91c2c08c5724 100644 --- a/cmd/validator/web/web.go +++ b/cmd/validator/web/web.go @@ -24,8 +24,8 @@ var Commands = &cli.Command{ Description: `Generate an authentication token for the Prysm web interface`, Flags: cmd.WrapFlags([]cli.Flag{ flags.WalletDirFlag, - flags.GRPCGatewayHost, - flags.GRPCGatewayPort, + flags.HTTPServerHost, + flags.HTTPServerPort, flags.AuthTokenPathFlag, cmd.AcceptTosFlag, }), @@ -43,9 +43,9 @@ var Commands = &cli.Command{ if walletDirPath == "" { log.Fatal("--wallet-dir not specified") } - gatewayHost := cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := cliCtx.Int(flags.GRPCGatewayPort.Name) - validatorWebAddr := fmt.Sprintf("%s:%d", gatewayHost, gatewayPort) + host := cliCtx.String(flags.HTTPServerHost.Name) + port := cliCtx.Int(flags.HTTPServerPort.Name) + validatorWebAddr := fmt.Sprintf("%s:%d", host, port) authTokenPath := filepath.Join(walletDirPath, api.AuthTokenFileName) tempAuthTokenPath := cliCtx.String(flags.AuthTokenPathFlag.Name) if tempAuthTokenPath != "" { diff --git a/hack/interop_start.sh b/hack/interop_start.sh index e6655f6d530a..dd2d4a08c985 100755 --- a/hack/interop_start.sh +++ b/hack/interop_start.sh @@ -86,7 +86,7 @@ echo -n "$IDENTITY" > /tmp/id.key BEACON_FLAGS="--bootstrap-node= \ --deposit-contract=0xD775140349E6A5D12524C6ccc3d6A1d4519D4029 \ --p2p-port=$PORT \ - --grpc-gateway-port=$RPCPORT \ + --http-port=$RPCPORT \ --peer=$PEERS \ --interop-genesis-state=$GEN_STATE \ --p2p-priv-key=/tmp/id.key \ diff --git a/proto/eth/v1/README.md b/proto/eth/v1/README.md deleted file mode 100644 index af9cfcca7034..000000000000 --- a/proto/eth/v1/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# gRPC Gateway - -This package is contains generated files for applications that wish to use eth/v1alpha as a -[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). \ No newline at end of file diff --git a/proto/prysm/v1alpha1/README.md b/proto/prysm/v1alpha1/README.md deleted file mode 100644 index af9cfcca7034..000000000000 --- a/proto/prysm/v1alpha1/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# gRPC Gateway - -This package is contains generated files for applications that wish to use eth/v1alpha as a -[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). \ No newline at end of file diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index b6d24cb4d5ec..7cfc1b113444 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -288,7 +288,6 @@ message ListIndexedAttestationsRequest { // Request for attestations. message ListAttestationsRequest { - // TODO(preston): Test oneof with gRPC gateway. oneof query_filter { // Filter attestations by epoch processed. diff --git a/testing/endtoend/components/beacon_node.go b/testing/endtoend/components/beacon_node.go index a42da708bf35..bd1ec4de2531 100644 --- a/testing/endtoend/components/beacon_node.go +++ b/testing/endtoend/components/beacon_node.go @@ -261,7 +261,7 @@ func (node *BeaconNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%d", cmdshared.P2PTCPPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeTCPPort+index), fmt.Sprintf("--%s=%d", cmdshared.P2PMaxPeers.Name, expectedNumOfPeers), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.PrysmBeaconNodeMetricsPort+index), - fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+index), + fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort+index), fmt.Sprintf("--%s=%d", flags.ContractDeploymentBlock.Name, 0), fmt.Sprintf("--%s=%d", flags.MinPeersPerSubnet.Name, 0), fmt.Sprintf("--%s=%d", cmdshared.RPCMaxPageSizeFlag.Name, params.BeaconConfig().MinGenesisActiveValidatorCount), diff --git a/testing/endtoend/components/lighthouse_validator.go b/testing/endtoend/components/lighthouse_validator.go index a412480aa154..df02e56141f4 100644 --- a/testing/endtoend/components/lighthouse_validator.go +++ b/testing/endtoend/components/lighthouse_validator.go @@ -179,7 +179,7 @@ func (v *LighthouseValidatorNode) Start(ctx context.Context) error { // beacon node, we split half the validators to run with // lighthouse and the other half with prysm. if v.config.UseValidatorCrossClient && index%2 == 0 { - httpPort = e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + httpPort = e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort } args := []string{ "validator_client", diff --git a/testing/endtoend/components/validator.go b/testing/endtoend/components/validator.go index 042a49bc7e55..c24f062075c7 100644 --- a/testing/endtoend/components/validator.go +++ b/testing/endtoend/components/validator.go @@ -226,7 +226,7 @@ func (v *ValidatorNode) Start(ctx context.Context) error { fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, file.Name()), fmt.Sprintf("--%s=%s", flags.GraffitiFileFlag.Name, gFile), fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.ValidatorMetricsPort+index), - fmt.Sprintf("--%s=%d", flags.GRPCGatewayPort.Name, e2e.TestParams.Ports.ValidatorGatewayPort+index), + fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.ValidatorHTTPPort+index), fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort), fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything. @@ -238,10 +238,10 @@ func (v *ValidatorNode) Start(ctx context.Context) error { } if v.config.UseBeaconRestApi { - beaconRestApiPort := e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + index - if beaconRestApiPort >= e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+e2e.TestParams.BeaconNodeCount { + beaconRestApiPort := e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort + index + if beaconRestApiPort >= e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort+e2e.TestParams.BeaconNodeCount { // Point any extra validator clients to a node we know is running. - beaconRestApiPort = e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + beaconRestApiPort = e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort } args = append(args, diff --git a/testing/endtoend/endtoend_setup_test.go b/testing/endtoend/endtoend_setup_test.go index d173ffffa036..7d1de12653e6 100644 --- a/testing/endtoend/endtoend_setup_test.go +++ b/testing/endtoend/endtoend_setup_test.go @@ -57,7 +57,6 @@ func e2eMinimal(t *testing.T, cfg *params.BeaconChainConfig, cfgo ...types.E2ECo ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -133,7 +132,6 @@ func e2eMainnet(t *testing.T, usePrysmSh, useMultiClient bool, cfg *params.Beaco ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.FeeRecipientIsPresent, @@ -189,7 +187,6 @@ func scenarioEvals() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, ev.ValidatorSyncParticipation, @@ -210,7 +207,6 @@ func scenarioEvalsMulti() []types.Evaluator { ev.BellatrixForkTransition, ev.CapellaForkTransition, ev.DenebForkTransition, - //ev.APIGatewayV1Alpha1VerifyIntegrity, ev.FinishedSyncing, ev.AllNodesHaveSameHead, } diff --git a/testing/endtoend/evaluators/BUILD.bazel b/testing/endtoend/evaluators/BUILD.bazel index 8a4da9abd7fe..3b59c0095cf6 100644 --- a/testing/endtoend/evaluators/BUILD.bazel +++ b/testing/endtoend/evaluators/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", testonly = True, srcs = [ - "api_gateway_v1alpha1.go", "builder.go", "data.go", "execution_engine.go", @@ -55,7 +54,6 @@ go_library( "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_ethereum_go_ethereum//ethclient:go_default_library", "@com_github_ethereum_go_ethereum//rpc:go_default_library", - "@com_github_golang_protobuf//ptypes/empty", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_go_bitfield//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", diff --git a/testing/endtoend/evaluators/api_gateway_v1alpha1.go b/testing/endtoend/evaluators/api_gateway_v1alpha1.go deleted file mode 100644 index 3b1ed1f893a6..000000000000 --- a/testing/endtoend/evaluators/api_gateway_v1alpha1.go +++ /dev/null @@ -1,501 +0,0 @@ -package evaluators - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "net/http" - - "github.com/golang/protobuf/ptypes/empty" - "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" - e2e "github.com/prysmaticlabs/prysm/v5/testing/endtoend/params" - "github.com/prysmaticlabs/prysm/v5/testing/endtoend/policies" - e2etypes "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" - "google.golang.org/grpc" -) - -// APIGatewayV1Alpha1VerifyIntegrity of our API gateway for the Prysm v1alpha1 API. -// This ensures our gRPC HTTP gateway returns and processes the same data _for the same endpoints_ -// as using a gRPC connection to interact with the API. Running this in end-to-end tests helps us -// ensure parity between our HTTP gateway for our API and gRPC never breaks. -// This evaluator checks a few request/response trips for both GET and POST requests. -var APIGatewayV1Alpha1VerifyIntegrity = e2etypes.Evaluator{ - Name: "api_gateway_v1alpha1_verify_integrity_epoch_%d", - Policy: policies.OnEpoch(2), - Evaluation: apiGatewayV1Alpha1Verify, -} - -const ( - v1Alpha1GatewayPathTemplate = "http://localhost:%d/eth/v1alpha1" -) - -type apiComparisonFunc func(beaconNodeIdx int, conn *grpc.ClientConn) error - -func apiGatewayV1Alpha1Verify(_ *e2etypes.EvaluationContext, conns ...*grpc.ClientConn) error { - for beaconNodeIdx, conn := range conns { - if err := runAPIComparisonFunctions( - beaconNodeIdx, - conn, - withComparePeers, - withCompareListAttestations, - withCompareValidators, - withCompareChainHead, - ); err != nil { - return err - } - } - return nil -} - -func withComparePeers(beaconNodeIdx int, conn *grpc.ClientConn) error { - type peerJSON struct { - Address string `json:"address"` - Direction string `json:"direction"` - ConnectionState string `json:"connectionState"` - PeerId string `json:"peerId"` - Enr string `json:"enr"` - } - type peersResponseJSON struct { - Peers []*peerJSON `json:"peers"` - } - ctx := context.Background() - nodeClient := ethpb.NewNodeClient(conn) - resp, err := nodeClient.ListPeers(ctx, &empty.Empty{}) - if err != nil { - return err - } - respJSON := &peersResponseJSON{} - if err := doGatewayJSONRequest( - "/node/peers", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - if len(respJSON.Peers) != len(resp.Peers) { - return fmt.Errorf( - "HTTP gateway number of peers %d does not match gRPC %d", - len(respJSON.Peers), - len(resp.Peers), - ) - } - grpcPeerMap := make(map[string]*ethpb.Peer) - jsonPeerMap := make(map[string]*peerJSON) - for i := 0; i < len(respJSON.Peers); i++ { - grpcPeerMap[resp.Peers[i].PeerId] = resp.Peers[i] - jsonPeerMap[respJSON.Peers[i].PeerId] = respJSON.Peers[i] - } - - for id, peer := range jsonPeerMap { - grpcPeer, ok := grpcPeerMap[id] - if !ok { - return errors.Errorf("grpc peer %s doesn't exist", id) - } - if peer.Address != grpcPeer.Address { - return fmt.Errorf( - "HTTP gateway peer %s with address %s does not match gRPC %s", - id, - peer.Address, - grpcPeer.Address, - ) - } - if peer.Direction != grpcPeer.Direction.String() { - return fmt.Errorf( - "HTTP gateway peer %s with direction %s does not match gRPC %s", - id, - peer.Direction, - grpcPeer.Direction, - ) - } - if peer.ConnectionState != grpcPeer.ConnectionState.String() { - return fmt.Errorf( - "HTTP gateway peer %s with connection state %s does not match gRPC %s", - id, - peer.ConnectionState, - grpcPeer.ConnectionState, - ) - } - if peer.PeerId != grpcPeer.PeerId { - return fmt.Errorf( - "HTTP gateway peer %s with peer id %s does not match gRPC %s", - id, - peer.PeerId, - grpcPeer.PeerId, - ) - } - if peer.Enr != grpcPeer.Enr { - return fmt.Errorf( - "HTTP gateway peer %s with enr %s does not match gRPC %s", - id, - peer.Enr, - grpcPeer.Enr, - ) - } - } - return nil -} - -func withCompareListAttestations(beaconNodeIdx int, conn *grpc.ClientConn) error { - type checkpointJSON struct { - Epoch string `json:"epoch"` - Root string `json:"root"` - } - type attestationDataJSON struct { - Slot string `json:"slot"` - CommitteeIndex string `json:"committeeIndex"` - BeaconBlockRoot string `json:"beaconBlockRoot"` - Source *checkpointJSON `json:"source"` - Target *checkpointJSON `json:"target"` - } - type attestationJSON struct { - AggregationBits string `json:"aggregationBits"` - Data *attestationDataJSON `json:"data"` - Signature string `json:"signature"` - } - type attestationsResponseJSON struct { - Attestations []*attestationJSON `json:"attestations"` - NextPageToken string `json:"nextPageToken"` - TotalSize int32 `json:"totalSize"` - } - ctx := context.Background() - beaconClient := ethpb.NewBeaconChainClient(conn) - resp, err := beaconClient.ListAttestations(ctx, ðpb.ListAttestationsRequest{ - QueryFilter: ðpb.ListAttestationsRequest_GenesisEpoch{GenesisEpoch: true}, - }) - if err != nil { - return err - } - respJSON := &attestationsResponseJSON{} - if err := doGatewayJSONRequest( - "/beacon/attestations?genesis_epoch=true", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - // Begin comparisons. - if respJSON.NextPageToken != resp.NextPageToken { - return fmt.Errorf( - "HTTP gateway next page token %s does not match gRPC %s", - respJSON.NextPageToken, - resp.NextPageToken, - ) - } - if respJSON.TotalSize != resp.TotalSize { - return fmt.Errorf( - "HTTP gateway total size %d does not match gRPC %d", - respJSON.TotalSize, - resp.TotalSize, - ) - } - for i, att := range respJSON.Attestations { - grpcAtt := resp.Attestations[i] - if att.AggregationBits != base64.StdEncoding.EncodeToString(grpcAtt.AggregationBits) { - return fmt.Errorf( - "HTTP gateway attestation %d aggregation bits %s does not match gRPC %d", - i, - att.AggregationBits, - grpcAtt.AggregationBits, - ) - } - data := att.Data - grpcData := grpcAtt.Data - if data.Slot != fmt.Sprintf("%d", grpcData.Slot) { - return fmt.Errorf( - "HTTP gateway attestation %d slot %s does not match gRPC %d", - i, - data.Slot, - grpcData.Slot, - ) - } - if data.CommitteeIndex != fmt.Sprintf("%d", grpcData.CommitteeIndex) { - return fmt.Errorf( - "HTTP gateway attestation %d committee index %s does not match gRPC %d", - i, - data.CommitteeIndex, - grpcData.CommitteeIndex, - ) - } - if data.BeaconBlockRoot != base64.StdEncoding.EncodeToString(grpcData.BeaconBlockRoot) { - return fmt.Errorf( - "HTTP gateway attestation %d beacon block root %s does not match gRPC %d", - i, - data.BeaconBlockRoot, - grpcData.BeaconBlockRoot, - ) - } - if data.Source.Epoch != fmt.Sprintf("%d", grpcData.Source.Epoch) { - return fmt.Errorf( - "HTTP gateway attestation %d source epoch %s does not match gRPC %d", - i, - data.Source.Epoch, - grpcData.Source.Epoch, - ) - } - if data.Source.Root != base64.StdEncoding.EncodeToString(grpcData.Source.Root) { - return fmt.Errorf( - "HTTP gateway attestation %d source root %s does not match gRPC %d", - i, - data.Source.Root, - grpcData.Source.Root, - ) - } - if data.Target.Epoch != fmt.Sprintf("%d", grpcData.Target.Epoch) { - return fmt.Errorf( - "HTTP gateway attestation %d target epoch %s does not match gRPC %d", - i, - data.Target.Epoch, - grpcData.Target.Epoch, - ) - } - if data.Target.Root != base64.StdEncoding.EncodeToString(grpcData.Target.Root) { - return fmt.Errorf( - "HTTP gateway attestation %d target root %s does not match gRPC %d", - i, - data.Target.Root, - grpcData.Target.Root, - ) - } - if att.Signature != base64.StdEncoding.EncodeToString(grpcAtt.Signature) { - return fmt.Errorf( - "HTTP gateway attestation %d signature %s does not match gRPC %d", - i, - att.Signature, - grpcAtt.Signature, - ) - } - } - return nil -} - -func withCompareValidators(beaconNodeIdx int, conn *grpc.ClientConn) error { - type validatorJSON struct { - PublicKey string `json:"publicKey"` - WithdrawalCredentials string `json:"withdrawalCredentials"` - EffectiveBalance string `json:"effectiveBalance"` - Slashed bool `json:"slashed"` - ActivationEligibilityEpoch string `json:"activationEligibilityEpoch"` - ActivationEpoch string `json:"activationEpoch"` - ExitEpoch string `json:"exitEpoch"` - WithdrawableEpoch string `json:"withdrawableEpoch"` - } - type validatorContainerJSON struct { - Index string `json:"index"` - Validator *validatorJSON `json:"validator"` - } - type validatorsResponseJSON struct { - Epoch string `json:"epoch"` - ValidatorList []*validatorContainerJSON `json:"validatorList"` - NextPageToken string `json:"nextPageToken"` - TotalSize int32 `json:"totalSize"` - } - ctx := context.Background() - beaconClient := ethpb.NewBeaconChainClient(conn) - resp, err := beaconClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ - QueryFilter: ðpb.ListValidatorsRequest_Genesis{ - Genesis: true, - }, - PageSize: 4, - }) - if err != nil { - return err - } - respJSON := &validatorsResponseJSON{} - if err := doGatewayJSONRequest( - "/validators?genesis=true&page_size=4", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - // Begin comparisons. - if respJSON.Epoch != fmt.Sprintf("%d", resp.Epoch) { - return fmt.Errorf( - "HTTP gateway epoch %s does not match gRPC %d", - respJSON.Epoch, - resp.Epoch, - ) - } - if respJSON.NextPageToken != resp.NextPageToken { - return fmt.Errorf( - "HTTP gateway next page token %s does not match gRPC %s", - respJSON.NextPageToken, - resp.NextPageToken, - ) - } - if respJSON.TotalSize != resp.TotalSize { - return fmt.Errorf( - "HTTP gateway total size %d does not match gRPC %d", - respJSON.TotalSize, - resp.TotalSize, - ) - } - - // Compare validators. - for i, val := range respJSON.ValidatorList { - if val.Index != fmt.Sprintf("%d", resp.ValidatorList[i].Index) { - return fmt.Errorf( - "HTTP gateway validator %d index %s does not match gRPC %d", - i, - val.Index, - resp.ValidatorList[i].Index, - ) - } - httpVal := val.Validator - grpcVal := resp.ValidatorList[i].Validator - if httpVal.PublicKey != base64.StdEncoding.EncodeToString(grpcVal.PublicKey) { - return fmt.Errorf( - "HTTP gateway validator %d public key %s does not match gRPC %d", - i, - httpVal.PublicKey, - grpcVal.PublicKey, - ) - } - continue - } - return nil -} - -// Compares a regular beacon chain head GET request with no arguments gRPC and gRPC gateway. -func withCompareChainHead(beaconNodeIdx int, conn *grpc.ClientConn) error { - // used for gateway, if using pure HTTP use shared.ChainHead - type chainHeadResponseJSON struct { - HeadSlot string `json:"headSlot"` - HeadEpoch string `json:"headEpoch"` - HeadBlockRoot string `json:"headBlockRoot"` - FinalizedSlot string `json:"finalizedSlot"` - FinalizedEpoch string `json:"finalizedEpoch"` - FinalizedBlockRoot string `json:"finalizedBlockRoot"` - JustifiedSlot string `json:"justifiedSlot"` - JustifiedEpoch string `json:"justifiedEpoch"` - JustifiedBlockRoot string `json:"justifiedBlockRoot"` - PreviousJustifiedSlot string `json:"previousJustifiedSlot"` - PreviousJustifiedEpoch string `json:"previousJustifiedEpoch"` - PreviousJustifiedBlockRoot string `json:"previousJustifiedBlockRoot"` - } - beaconClient := ethpb.NewBeaconChainClient(conn) - ctx := context.Background() - resp, err := beaconClient.GetChainHead(ctx, &empty.Empty{}) - if err != nil { - return err - } - respJSON := &chainHeadResponseJSON{} - if err := doGatewayJSONRequest( - "/beacon/chainhead", - beaconNodeIdx, - respJSON, - ); err != nil { - return err - } - - if respJSON.HeadSlot != fmt.Sprintf("%d", resp.HeadSlot) { - return fmt.Errorf( - "HTTP gateway head slot %s does not match gRPC %d", - respJSON.HeadSlot, - resp.HeadSlot, - ) - } - if respJSON.HeadEpoch != fmt.Sprintf("%d", resp.HeadEpoch) { - return fmt.Errorf( - "HTTP gateway head epoch %s does not match gRPC %d", - respJSON.HeadEpoch, - resp.HeadEpoch, - ) - } - if respJSON.HeadBlockRoot != base64.StdEncoding.EncodeToString(resp.HeadBlockRoot) { - return fmt.Errorf( - "HTTP gateway head block root %s does not match gRPC %s", - respJSON.HeadBlockRoot, - resp.HeadBlockRoot, - ) - } - if respJSON.FinalizedSlot != fmt.Sprintf("%d", resp.FinalizedSlot) { - return fmt.Errorf( - "HTTP gateway finalized slot %s does not match gRPC %d", - respJSON.FinalizedSlot, - resp.FinalizedSlot, - ) - } - if respJSON.FinalizedEpoch != fmt.Sprintf("%d", resp.FinalizedEpoch) { - return fmt.Errorf( - "HTTP gateway finalized epoch %s does not match gRPC %d", - respJSON.FinalizedEpoch, - resp.FinalizedEpoch, - ) - } - if respJSON.FinalizedBlockRoot != base64.StdEncoding.EncodeToString(resp.FinalizedBlockRoot) { - return fmt.Errorf( - "HTTP gateway finalized block root %s does not match gRPC %s", - respJSON.FinalizedBlockRoot, - resp.FinalizedBlockRoot, - ) - } - if respJSON.JustifiedSlot != fmt.Sprintf("%d", resp.JustifiedSlot) { - return fmt.Errorf( - "HTTP gateway justified slot %s does not match gRPC %d", - respJSON.JustifiedSlot, - resp.JustifiedSlot, - ) - } - if respJSON.JustifiedEpoch != fmt.Sprintf("%d", resp.JustifiedEpoch) { - return fmt.Errorf( - "HTTP gateway justified epoch %s does not match gRPC %d", - respJSON.JustifiedEpoch, - resp.JustifiedEpoch, - ) - } - if respJSON.JustifiedBlockRoot != base64.StdEncoding.EncodeToString(resp.JustifiedBlockRoot) { - return fmt.Errorf( - "HTTP gateway justified block root %s does not match gRPC %s", - respJSON.JustifiedBlockRoot, - resp.JustifiedBlockRoot, - ) - } - if respJSON.PreviousJustifiedSlot != fmt.Sprintf("%d", resp.PreviousJustifiedSlot) { - return fmt.Errorf( - "HTTP gateway justified slot %s does not match gRPC %d", - respJSON.FinalizedSlot, - resp.FinalizedSlot, - ) - } - if respJSON.PreviousJustifiedEpoch != fmt.Sprintf("%d", resp.PreviousJustifiedEpoch) { - return fmt.Errorf( - "HTTP gateway justified epoch %s does not match gRPC %d", - respJSON.FinalizedEpoch, - resp.FinalizedEpoch, - ) - } - if respJSON.PreviousJustifiedBlockRoot != base64.StdEncoding.EncodeToString(resp.PreviousJustifiedBlockRoot) { - return fmt.Errorf( - "HTTP gateway justified block root %s does not match gRPC %s", - respJSON.JustifiedBlockRoot, - resp.JustifiedBlockRoot, - ) - } - return nil -} - -func doGatewayJSONRequest(requestPath string, beaconNodeIdx int, dst interface{}) error { - basePath := fmt.Sprintf(v1Alpha1GatewayPathTemplate, e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort+beaconNodeIdx) - httpResp, err := http.Get( - basePath + requestPath, - ) - if err != nil { - return err - } - return json.NewDecoder(httpResp.Body).Decode(&dst) -} - -func runAPIComparisonFunctions(beaconNodeIdx int, conn *grpc.ClientConn, fs ...apiComparisonFunc) error { - for _, f := range fs { - if err := f(beaconNodeIdx, conn); err != nil { - return err - } - } - return nil -} diff --git a/testing/endtoend/evaluators/beaconapi/util.go b/testing/endtoend/evaluators/beaconapi/util.go index 5c8aa1d70fb5..3d0f7914f9ca 100644 --- a/testing/endtoend/evaluators/beaconapi/util.go +++ b/testing/endtoend/evaluators/beaconapi/util.go @@ -33,7 +33,7 @@ func doJSONGetRequest(template, requestPath string, beaconNodeIdx int, resp inte var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: @@ -74,7 +74,7 @@ func doSSZGetRequest(template, requestPath string, beaconNodeIdx int, bnType ... var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: @@ -116,7 +116,7 @@ func doJSONPostRequest(template, requestPath string, beaconNodeIdx int, postObj, var port int switch bnType[0] { case "Prysm": - port = params.TestParams.Ports.PrysmBeaconNodeGatewayPort + port = params.TestParams.Ports.PrysmBeaconNodeHTTPPort case "Lighthouse": port = params.TestParams.Ports.LighthouseBeaconNodeHTTPPort default: diff --git a/testing/endtoend/evaluators/beaconapi/verify.go b/testing/endtoend/evaluators/beaconapi/verify.go index baa9a12d2068..1352fc1c32e0 100644 --- a/testing/endtoend/evaluators/beaconapi/verify.go +++ b/testing/endtoend/evaluators/beaconapi/verify.go @@ -181,7 +181,7 @@ func postEvaluation(nodeIdx int, requests map[string]endpoint, epoch primitives. } // perform a health check - basePath := fmt.Sprintf(v1PathTemplate, params2.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIdx) + basePath := fmt.Sprintf(v1PathTemplate, params2.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIdx) resp, err := http.Get(basePath + "/node/health") if err != nil { return errors.Wrap(err, "could not perform a health check") diff --git a/testing/endtoend/evaluators/execution_engine.go b/testing/endtoend/evaluators/execution_engine.go index f02dae04c4fd..7719ceaaf4cb 100644 --- a/testing/endtoend/evaluators/execution_engine.go +++ b/testing/endtoend/evaluators/execution_engine.go @@ -27,7 +27,7 @@ var OptimisticSyncEnabled = types.Evaluator{ func optimisticSyncEnabled(_ *types.EvaluationContext, conns ...*grpc.ClientConn) error { for nodeIndex := range conns { - path := fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/head", params.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIndex) + path := fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/head", params.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIndex) resp := structs.GetBlockV2Response{} httpResp, err := http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param and node index if err != nil { @@ -53,7 +53,7 @@ func optimisticSyncEnabled(_ *types.EvaluationContext, conns ...*grpc.ClientConn return err } for i := startSlot; i <= primitives.Slot(headSlot); i++ { - path = fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/%d", params.TestParams.Ports.PrysmBeaconNodeGatewayPort+nodeIndex, i) + path = fmt.Sprintf("http://localhost:%d/eth/v1/beacon/blinded_blocks/%d", params.TestParams.Ports.PrysmBeaconNodeHTTPPort+nodeIndex, i) resp = structs.GetBlockV2Response{} httpResp, err = http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param and node index if err != nil { diff --git a/testing/endtoend/evaluators/operations.go b/testing/endtoend/evaluators/operations.go index b683f8c863b3..6b23b314da80 100644 --- a/testing/endtoend/evaluators/operations.go +++ b/testing/endtoend/evaluators/operations.go @@ -626,7 +626,7 @@ func submitWithdrawal(ec *e2etypes.EvaluationContext, conns ...*grpc.ClientConn) }) } - beaconAPIClient, err := beacon.NewClient(fmt.Sprintf("http://localhost:%d/eth/v1", e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort)) // only uses the first node so no updates to port + beaconAPIClient, err := beacon.NewClient(fmt.Sprintf("http://localhost:%d/eth/v1", e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort)) // only uses the first node so no updates to port if err != nil { return err } diff --git a/testing/endtoend/evaluators/validator.go b/testing/endtoend/evaluators/validator.go index e8d9b4e2a403..02137d366d7a 100644 --- a/testing/endtoend/evaluators/validator.go +++ b/testing/endtoend/evaluators/validator.go @@ -133,7 +133,7 @@ func validatorsParticipating(_ *types.EvaluationContext, conns ...*grpc.ClientCo expected = 0.95 } if partRate < expected { - path := fmt.Sprintf("http://localhost:%d/eth/v2/debug/beacon/states/head", e2eparams.TestParams.Ports.PrysmBeaconNodeGatewayPort) + path := fmt.Sprintf("http://localhost:%d/eth/v2/debug/beacon/states/head", e2eparams.TestParams.Ports.PrysmBeaconNodeHTTPPort) resp := structs.GetBeaconStateV2Response{} httpResp, err := http.Get(path) // #nosec G107 -- path can't be constant because it depends on port param if err != nil { diff --git a/testing/endtoend/helpers/helpers.go b/testing/endtoend/helpers/helpers.go index d9dbd29adfbc..9e1700bd9573 100644 --- a/testing/endtoend/helpers/helpers.go +++ b/testing/endtoend/helpers/helpers.go @@ -323,7 +323,7 @@ func NewLocalConnections(ctx context.Context, numConns int) ([]*grpc.ClientConn, func BeaconAPIHostnames(numConns int) []string { hostnames := make([]string, 0) for i := 0; i < numConns; i++ { - port := e2e.TestParams.Ports.PrysmBeaconNodeGatewayPort + i + port := e2e.TestParams.Ports.PrysmBeaconNodeHTTPPort + i hostnames = append(hostnames, net.JoinHostPort("127.0.0.1", strconv.Itoa(port))) } return hostnames diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index 8ef153c9fd61..9a78552ebafc 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -48,14 +48,14 @@ type ports struct { PrysmBeaconNodeUDPPort int PrysmBeaconNodeQUICPort int PrysmBeaconNodeTCPPort int - PrysmBeaconNodeGatewayPort int + PrysmBeaconNodeHTTPPort int PrysmBeaconNodeMetricsPort int PrysmBeaconNodePprofPort int LighthouseBeaconNodeP2PPort int LighthouseBeaconNodeHTTPPort int LighthouseBeaconNodeMetricsPort int ValidatorMetricsPort int - ValidatorGatewayPort int + ValidatorHTTPPort int JaegerTracingPort int } @@ -147,7 +147,7 @@ const ( prysmBeaconNodeUDPPort = prysmBeaconNodeRPCPort + portSpan prysmBeaconNodeQUICPort = prysmBeaconNodeRPCPort + 2*portSpan prysmBeaconNodeTCPPort = prysmBeaconNodeRPCPort + 3*portSpan - prysmBeaconNodeGatewayPort = prysmBeaconNodeRPCPort + 4*portSpan + prysmBeaconNodeHTTPPort = prysmBeaconNodeRPCPort + 4*portSpan prysmBeaconNodeMetricsPort = prysmBeaconNodeRPCPort + 5*portSpan prysmBeaconNodePprofPort = prysmBeaconNodeRPCPort + 6*portSpan @@ -155,8 +155,8 @@ const ( lighthouseBeaconNodeHTTPPort = lighthouseBeaconNodeP2PPort + portSpan lighthouseBeaconNodeMetricsPort = lighthouseBeaconNodeP2PPort + 2*portSpan - validatorGatewayPort = 6150 - validatorMetricsPort = validatorGatewayPort + portSpan + validatorHTTPPort = 6150 + validatorMetricsPort = validatorHTTPPort + portSpan jaegerTracingPort = 9150 @@ -340,7 +340,7 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR if err != nil { return err } - beaconNodeGatewayPort, err := port(prysmBeaconNodeGatewayPort, shardCount, shardIndex, existingRegistrations) + beaconNodeHTTPPort, err := port(prysmBeaconNodeHTTPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } @@ -352,7 +352,7 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR if err != nil { return err } - validatorGatewayPort, err := port(validatorGatewayPort, shardCount, shardIndex, existingRegistrations) + validatorHTTPPort, err := port(validatorHTTPPort, shardCount, shardIndex, existingRegistrations) if err != nil { return err } @@ -375,11 +375,11 @@ func initializeStandardPorts(shardCount, shardIndex int, ports *ports, existingR ports.PrysmBeaconNodeUDPPort = beaconNodeUDPPort ports.PrysmBeaconNodeQUICPort = beaconNodeQUICPort ports.PrysmBeaconNodeTCPPort = beaconNodeTCPPort - ports.PrysmBeaconNodeGatewayPort = beaconNodeGatewayPort + ports.PrysmBeaconNodeHTTPPort = beaconNodeHTTPPort ports.PrysmBeaconNodeMetricsPort = beaconNodeMetricsPort ports.PrysmBeaconNodePprofPort = beaconNodePprofPort ports.ValidatorMetricsPort = validatorMetricsPort - ports.ValidatorGatewayPort = validatorGatewayPort + ports.ValidatorHTTPPort = validatorHTTPPort ports.JaegerTracingPort = jaegerTracingPort return nil } diff --git a/testing/endtoend/params/params_test.go b/testing/endtoend/params/params_test.go index e0f795984b37..cc7fbfea5ff1 100644 --- a/testing/endtoend/params/params_test.go +++ b/testing/endtoend/params/params_test.go @@ -31,7 +31,7 @@ func TestStandardPorts(t *testing.T) { testPorts := &ports{} assert.NoError(t, initializeStandardPorts(2, 0, testPorts, &existingRegistrations)) assert.Equal(t, 17, len(existingRegistrations)) - assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeGatewayPort) + assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeHTTPPort) assert.NotEqual(t, 0, testPorts.PrysmBeaconNodeTCPPort) assert.NotEqual(t, 0, testPorts.JaegerTracingPort) } diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index c4bf36de1b4d..8524b5e8a866 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -36,8 +36,8 @@ go_library( ], deps = [ "//api:go_default_library", + "//api/server/http-rest:go_default_library", "//api/server/middleware:go_default_library", - "//api/server/rest:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", "//cmd/validator/flags:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index 267fce941da4..2220e3f0309a 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" - "github.com/prysmaticlabs/prysm/v5/api/server/rest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" @@ -146,10 +146,10 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) { func newRouter(cliCtx *cli.Context) *mux.Router { var allowedOrigins []string - if cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") + if cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") } r := mux.NewRouter() r.Use(middleware.NormalizeQueryValuesHandler) @@ -292,7 +292,7 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerRPCGatewayService(router); err != nil { + if err := c.registerHTTPService(router); err != nil { return err } } @@ -335,12 +335,12 @@ func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *mux.Rout if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerRPCGatewayService(router); err != nil { + if err := c.registerHTTPService(router); err != nil { return err } - gatewayHost := cliCtx.String(flags.GRPCGatewayHost.Name) - gatewayPort := cliCtx.Int(flags.GRPCGatewayPort.Name) - webAddress := fmt.Sprintf("http://%s:%d", gatewayHost, gatewayPort) + host := cliCtx.String(flags.HTTPServerHost.Name) + port := cliCtx.Int(flags.HTTPServerPort.Name) + webAddress := fmt.Sprintf("http://%s:%d", host, port) log.WithField("address", webAddress).Info( "Starting Prysm web UI on address, open in browser to access", ) @@ -624,8 +624,8 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ Host: c.cliCtx.String(flags.RPCHost.Name), Port: fmt.Sprintf("%d", c.cliCtx.Int(flags.RPCPort.Name)), - GRPCGatewayHost: c.cliCtx.String(flags.GRPCGatewayHost.Name), - GRPCGatewayPort: c.cliCtx.Int(flags.GRPCGatewayPort.Name), + HTTPHost: c.cliCtx.String(flags.HTTPServerHost.Name), + HTTPPort: c.cliCtx.Int(flags.HTTPServerPort.Name), GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), @@ -645,44 +645,43 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { return c.services.RegisterService(s) } -func (c *ValidatorClient) registerRPCGatewayService(router *mux.Router) error { - gatewayHost := c.cliCtx.String(flags.GRPCGatewayHost.Name) - if gatewayHost != flags.DefaultGatewayHost { - log.WithField("webHost", gatewayHost).Warn( +func (c *ValidatorClient) registerHTTPService(router *mux.Router) error { + host := c.cliCtx.String(flags.HTTPServerHost.Name) + if host != flags.DefaultHTTPServerHost { + log.WithField("webHost", host).Warn( "You are using a non-default web host. Web traffic is served by HTTP, so be wary of " + "changing this parameter if you are exposing this host to the Internet!", ) } - gatewayPort := c.cliCtx.Int(flags.GRPCGatewayPort.Name) - gatewayAddress := net.JoinHostPort(gatewayHost, fmt.Sprintf("%d", gatewayPort)) + port := c.cliCtx.Int(flags.HTTPServerPort.Name) + address := net.JoinHostPort(host, fmt.Sprintf("%d", port)) timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) var allowedOrigins []string - if c.cliCtx.IsSet(flags.GRPCGatewayCorsDomain.Name) { - allowedOrigins = strings.Split(c.cliCtx.String(flags.GRPCGatewayCorsDomain.Name), ",") + if c.cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { + allowedOrigins = strings.Split(c.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") } else { - allowedOrigins = strings.Split(flags.GRPCGatewayCorsDomain.Value, ",") + allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") } muxHandler := func(h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { // The validator api handler requires this special logic as it serves the web APIs and the web UI. if strings.HasPrefix(req.URL.Path, "/api") { req.URL.Path = strings.Replace(req.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs - // Else, we handle with the Prysm API gateway without a middleware. - h(w, req) //TODO: test this handler wrapper ... + h(w, req) } else { // Finally, we handle with the web server. web.Handler(w, req) } } - opts := []rest.Option{ - rest.WithMuxHandler(muxHandler), - rest.WithRouter(router), // note some routes are registered in server.go - rest.WithGatewayAddr(gatewayAddress), - rest.WithAllowedOrigins(allowedOrigins), - rest.WithTimeout(uint64(timeout)), + opts := []http_rest.Option{ + http_rest.WithMuxHandler(muxHandler), + http_rest.WithRouter(router), // note some routes are registered in server.go + http_rest.WithHTTPAddr(address), + http_rest.WithAllowedOrigins(allowedOrigins), + http_rest.WithTimeout(uint64(timeout)), } - gw, err := rest.New(c.cliCtx.Context, opts...) + gw, err := http_rest.New(c.cliCtx.Context, opts...) if err != nil { return err } diff --git a/validator/package/validator.yaml b/validator/package/validator.yaml index 4cee5808a874..45289d276f04 100644 --- a/validator/package/validator.yaml +++ b/validator/package/validator.yaml @@ -15,7 +15,7 @@ wallet-dir: /var/lib/prysm/validator # beacon-rpc-provider: Beacon node RPC provider endpoint. Default: localhost:4000 # rpc-host: Specify the RPC host exposed by the validator. Default: localhost # rpc-port: Specify the RPC port exposed by the validator. Default: 7000 -# grpc-gateway-host: Specify the gRPC gateway port exposed by the validator. Default: localhost -# grpc-gateway-port: Specify the gRPC gateway port exposed by the validator. Default: 7500 +# http-host: Specify the http host exposed by the validator. Default: localhost +# http-port: Specify the http port exposed by the validator. Default: 7500 # graffiti: A string to include in proposed block. # graffiti-file: Path to Yaml file containing advanced graffiti settings. See https://docs.prylabs.network/docs/prysm-usage/graffiti-file \ No newline at end of file diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index ecff1019b570..df67fae07965 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -104,7 +104,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } - validatorWebAddr := fmt.Sprintf("%s:%d", s.grpcGatewayHost, s.grpcGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", s.httpHost, s.httpPort) logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index f762e26f4bb8..a76f4c6f7142 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -40,7 +40,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/slashing-protection-history/format" mocks "github.com/prysmaticlabs/prysm/v5/validator/testing" "go.uber.org/mock/gomock" - "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -691,7 +690,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := context.Background() defaultWalletPath = setupWalletDir(t) opts := []accounts.Option{ accounts.WithWalletDir(defaultWalletPath), @@ -954,7 +953,7 @@ func TestServer_SetGasLimit(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := context.Background() pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") @@ -1162,7 +1161,7 @@ func TestServer_SetGasLimit_InvalidPubKey(t *testing.T) { } func TestServer_DeleteGasLimit(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := context.Background() pubkey1, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") pubkey2, err2 := hexutil.Decode("0xbedefeaa94e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2cdddddddddddddddddddddddd") require.NoError(t, err) @@ -1599,7 +1598,7 @@ func TestServer_FeeRecipientByPubkey(t *testing.T) { defer ctrl.Finish() beaconClient := validatormock.NewMockValidatorClient(ctrl) - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := context.Background() pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) @@ -1809,7 +1808,7 @@ func TestServer_SetFeeRecipientByPubkey_InvalidFeeRecipient(t *testing.T) { } func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { - ctx := grpc.NewContextWithServerTransportStream(context.Background(), grpc.ServerTransportStreamFromContext(context.Background())) + ctx := context.Background() pubkey := "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493" byteval, err := hexutil.Decode(pubkey) require.NoError(t, err) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 6120e5ccfd08..f584cf58cddd 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -32,8 +32,8 @@ import ( type Config struct { Host string Port string - GRPCGatewayHost string - GRPCGatewayPort int + HTTPHost string + HTTPPort int GRPCMaxCallRecvMsgSize int GRPCRetries uint GRPCRetryDelay time.Duration @@ -57,8 +57,8 @@ type Server struct { cancel context.CancelFunc host string port string - grpcGatewayHost string - grpcGatewayPort int + httpHost string + httpPort int listener net.Listener grpcMaxCallRecvMsgSize int grpcRetries uint @@ -97,8 +97,8 @@ func NewServer(ctx context.Context, cfg *Config) *Server { logStreamerBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. host: cfg.Host, port: cfg.Port, - grpcGatewayHost: cfg.GRPCGatewayHost, - grpcGatewayPort: cfg.GRPCGatewayPort, + httpHost: cfg.HTTPHost, + httpPort: cfg.HTTPPort, grpcMaxCallRecvMsgSize: cfg.GRPCMaxCallRecvMsgSize, grpcRetries: cfg.GRPCRetries, grpcRetryDelay: cfg.GRPCRetryDelay, @@ -124,7 +124,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.initializeAuthToken(); err != nil { log.WithError(err).Error("Could not initialize web auth token") } - validatorWebAddr := fmt.Sprintf("%s:%d", server.grpcGatewayHost, server.grpcGatewayPort) + validatorWebAddr := fmt.Sprintf("%s:%d", server.httpHost, server.httpPort) logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) } diff --git a/validator/web/BUILD.bazel b/validator/web/BUILD.bazel index f9a4a63935fa..63a3d714541a 100644 --- a/validator/web/BUILD.bazel +++ b/validator/web/BUILD.bazel @@ -11,7 +11,6 @@ go_library( ], importpath = "github.com/prysmaticlabs/prysm/v5/validator/web", visibility = [ - "//api/gateway:__pkg__", "//validator:__subpackages__", ], deps = ["@com_github_sirupsen_logrus//:go_default_library"], From e1ef6ff2555c35217017c0318d6cf347d4290a74 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 11 Jun 2024 16:39:44 -0500 Subject: [PATCH 13/58] goimport --- validator/node/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/node/node.go b/validator/node/node.go index 2220e3f0309a..c7457133bb0d 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" + http_rest "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" From 5927bc44bc2c8cd160a4ee2955401ab25888c620 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 11 Jun 2024 16:57:54 -0500 Subject: [PATCH 14/58] fixing deepsource --- .../components/lighthouse_validator.go | 25 +++++++++---------- testing/endtoend/helpers/helpers.go | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/testing/endtoend/components/lighthouse_validator.go b/testing/endtoend/components/lighthouse_validator.go index df02e56141f4..fde4a0f26e7d 100644 --- a/testing/endtoend/components/lighthouse_validator.go +++ b/testing/endtoend/components/lighthouse_validator.go @@ -20,26 +20,25 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/endtoend/helpers" e2e "github.com/prysmaticlabs/prysm/v5/testing/endtoend/params" "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" - e2etypes "github.com/prysmaticlabs/prysm/v5/testing/endtoend/types" "github.com/prysmaticlabs/prysm/v5/validator/keymanager" keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" "golang.org/x/sync/errgroup" ) -var _ e2etypes.ComponentRunner = (*LighthouseValidatorNode)(nil) -var _ e2etypes.ComponentRunner = (*LighthouseValidatorNodeSet)(nil) -var _ e2etypes.MultipleComponentRunners = (*LighthouseValidatorNodeSet)(nil) +var _ types.ComponentRunner = (*LighthouseValidatorNode)(nil) +var _ types.ComponentRunner = (*LighthouseValidatorNodeSet)(nil) +var _ types.MultipleComponentRunners = (*LighthouseValidatorNodeSet)(nil) // LighthouseValidatorNodeSet represents set of lighthouse validator nodes. type LighthouseValidatorNodeSet struct { - e2etypes.ComponentRunner - config *e2etypes.E2EConfig + types.ComponentRunner + config *types.E2EConfig started chan struct{} - nodes []e2etypes.ComponentRunner + nodes []types.ComponentRunner } // NewLighthouseValidatorNodeSet creates and returns a set of lighthouse validator nodes. -func NewLighthouseValidatorNodeSet(config *e2etypes.E2EConfig) *LighthouseValidatorNodeSet { +func NewLighthouseValidatorNodeSet(config *types.E2EConfig) *LighthouseValidatorNodeSet { return &LighthouseValidatorNodeSet{ config: config, started: make(chan struct{}, 1), @@ -59,7 +58,7 @@ func (s *LighthouseValidatorNodeSet) Start(ctx context.Context) error { validatorsPerNode := validatorNum / beaconNodeNum // Create validator nodes. - nodes := make([]e2etypes.ComponentRunner, lighthouseBeaconNum) + nodes := make([]types.ComponentRunner, lighthouseBeaconNum) for i := 0; i < lighthouseBeaconNum; i++ { offsetIdx := i + prysmBeaconNum nodes[i] = NewLighthouseValidatorNode(s.config, validatorsPerNode, i, validatorsPerNode*offsetIdx) @@ -134,7 +133,7 @@ func (s *LighthouseValidatorNodeSet) StopAtIndex(i int) error { } // ComponentAtIndex returns the component at the provided index. -func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.ComponentRunner, error) { +func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (types.ComponentRunner, error) { if i >= len(s.nodes) { return nil, errors.Errorf("provided index exceeds slice size: %d >= %d", i, len(s.nodes)) } @@ -143,8 +142,8 @@ func (s *LighthouseValidatorNodeSet) ComponentAtIndex(i int) (e2etypes.Component // LighthouseValidatorNode represents a lighthouse validator node. type LighthouseValidatorNode struct { - e2etypes.ComponentRunner - config *e2etypes.E2EConfig + types.ComponentRunner + config *types.E2EConfig started chan struct{} validatorNum int index int @@ -153,7 +152,7 @@ type LighthouseValidatorNode struct { } // NewLighthouseValidatorNode creates and returns a lighthouse validator node. -func NewLighthouseValidatorNode(config *e2etypes.E2EConfig, validatorNum, index, offset int) *LighthouseValidatorNode { +func NewLighthouseValidatorNode(config *types.E2EConfig, validatorNum, index, offset int) *LighthouseValidatorNode { return &LighthouseValidatorNode{ config: config, validatorNum: validatorNum, diff --git a/testing/endtoend/helpers/helpers.go b/testing/endtoend/helpers/helpers.go index 9e1700bd9573..1c6fd3423e22 100644 --- a/testing/endtoend/helpers/helpers.go +++ b/testing/endtoend/helpers/helpers.go @@ -132,7 +132,7 @@ func WaitForTextInFile(src *os.File, match string) error { select { case <-ctx.Done(): - return fmt.Errorf("could not find requested text \"%s\" in %s before deadline:\n", match, f.Name()) + return fmt.Errorf("could not find requested text %s in %s before deadline", match, f.Name()) case <-foundChan: return nil case err = <-errChan: From 20cc6c6737378169db276debd30768d522ea42e5 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 13 Jun 2024 11:23:27 -0500 Subject: [PATCH 15/58] git mv --- api/gateway/BUILD.bazel | 43 ------------------- api/gateway/modifiers.go | 30 ------------- api/{gateway => server/http-rest}/log.go | 0 api/{gateway => server/http-rest}/options.go | 0 .../gateway.go => server/http-rest/server.go} | 0 .../http-rest/server_test.go} | 0 6 files changed, 73 deletions(-) delete mode 100644 api/gateway/BUILD.bazel delete mode 100644 api/gateway/modifiers.go rename api/{gateway => server/http-rest}/log.go (100%) rename api/{gateway => server/http-rest}/options.go (100%) rename api/{gateway/gateway.go => server/http-rest/server.go} (100%) rename api/{gateway/gateway_test.go => server/http-rest/server_test.go} (100%) diff --git a/api/gateway/BUILD.bazel b/api/gateway/BUILD.bazel deleted file mode 100644 index 0aafeb732956..000000000000 --- a/api/gateway/BUILD.bazel +++ /dev/null @@ -1,43 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "gateway.go", - "log.go", - "modifiers.go", - "options.go", - ], - importpath = "github.com/prysmaticlabs/prysm/v5/api/gateway", - visibility = [ - "//beacon-chain:__subpackages__", - "//validator:__subpackages__", - ], - deps = [ - "//api/server/middleware:go_default_library", - "//runtime:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", - "@com_github_pkg_errors//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//connectivity:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - "@org_golang_google_grpc//credentials/insecure:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["gateway_test.go"], - embed = [":go_default_library"], - deps = [ - "//cmd/beacon-chain/flags:go_default_library", - "//testing/assert:go_default_library", - "//testing/require:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_sirupsen_logrus//hooks/test:go_default_library", - "@com_github_urfave_cli_v2//:go_default_library", - ], -) diff --git a/api/gateway/modifiers.go b/api/gateway/modifiers.go deleted file mode 100644 index dab4e608942f..000000000000 --- a/api/gateway/modifiers.go +++ /dev/null @@ -1,30 +0,0 @@ -package gateway - -import ( - "context" - "net/http" - "strconv" - - gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "google.golang.org/protobuf/proto" -) - -func HttpResponseModifier(ctx context.Context, w http.ResponseWriter, _ proto.Message) error { - md, ok := gwruntime.ServerMetadataFromContext(ctx) - if !ok { - return nil - } - // set http status code - if vals := md.HeaderMD.Get("x-http-code"); len(vals) > 0 { - code, err := strconv.Atoi(vals[0]) - if err != nil { - return err - } - // delete the headers to not expose any grpc-metadata in http response - delete(md.HeaderMD, "x-http-code") - delete(w.Header(), "Grpc-Metadata-X-Http-Code") - w.WriteHeader(code) - } - - return nil -} diff --git a/api/gateway/log.go b/api/server/http-rest/log.go similarity index 100% rename from api/gateway/log.go rename to api/server/http-rest/log.go diff --git a/api/gateway/options.go b/api/server/http-rest/options.go similarity index 100% rename from api/gateway/options.go rename to api/server/http-rest/options.go diff --git a/api/gateway/gateway.go b/api/server/http-rest/server.go similarity index 100% rename from api/gateway/gateway.go rename to api/server/http-rest/server.go diff --git a/api/gateway/gateway_test.go b/api/server/http-rest/server_test.go similarity index 100% rename from api/gateway/gateway_test.go rename to api/server/http-rest/server_test.go From d415e8e2a7fd59929e74288151b7154819e76524 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:17:26 -0500 Subject: [PATCH 16/58] Update validator/package/validator.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- validator/package/validator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/package/validator.yaml b/validator/package/validator.yaml index 45289d276f04..42101dd6d314 100644 --- a/validator/package/validator.yaml +++ b/validator/package/validator.yaml @@ -16,6 +16,6 @@ wallet-dir: /var/lib/prysm/validator # rpc-host: Specify the RPC host exposed by the validator. Default: localhost # rpc-port: Specify the RPC port exposed by the validator. Default: 7000 # http-host: Specify the http host exposed by the validator. Default: localhost -# http-port: Specify the http port exposed by the validator. Default: 7500 +# http-port: Specify the HTTP port exposed by the validator. Default: 7500 # graffiti: A string to include in proposed block. # graffiti-file: Path to Yaml file containing advanced graffiti settings. See https://docs.prylabs.network/docs/prysm-usage/graffiti-file \ No newline at end of file From 2b7f795052bb74936e6a9c70a157ba0dab1e8e59 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:17:32 -0500 Subject: [PATCH 17/58] Update validator/package/validator.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- validator/package/validator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/package/validator.yaml b/validator/package/validator.yaml index 42101dd6d314..4cf7e716629e 100644 --- a/validator/package/validator.yaml +++ b/validator/package/validator.yaml @@ -15,7 +15,7 @@ wallet-dir: /var/lib/prysm/validator # beacon-rpc-provider: Beacon node RPC provider endpoint. Default: localhost:4000 # rpc-host: Specify the RPC host exposed by the validator. Default: localhost # rpc-port: Specify the RPC port exposed by the validator. Default: 7000 -# http-host: Specify the http host exposed by the validator. Default: localhost +# http-host: Specify the HTTP host exposed by the validator. Default: localhost # http-port: Specify the HTTP port exposed by the validator. Default: 7500 # graffiti: A string to include in proposed block. # graffiti-file: Path to Yaml file containing advanced graffiti settings. See https://docs.prylabs.network/docs/prysm-usage/graffiti-file \ No newline at end of file From 8ea3902a9e2e750a4f421c10571e6c627eee0179 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:17:42 -0500 Subject: [PATCH 18/58] Update cmd/beacon-chain/flags/base.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- cmd/beacon-chain/flags/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index f13b4a33764e..5769026e791b 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -115,7 +115,7 @@ var ( // HTTPServerPort enables a REST server port to be exposed for the validator client. HTTPServerPort = &cli.IntFlag{ Name: "http-port", - Usage: "Port on which the REST server runs on.", + Usage: "Port on which the HTTP server runs on.", Value: 3500, Aliases: []string{"grpc-gateway-port"}, } From cac35b8051650e5de5d69879c9ba96ed949615e0 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:17:51 -0500 Subject: [PATCH 19/58] Update cmd/beacon-chain/flags/base.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- cmd/beacon-chain/flags/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 5769026e791b..97dbfb612728 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -121,7 +121,7 @@ var ( } // HTTPServerCorsDomain serves preflight requests when serving HTTP. HTTPServerCorsDomain = &cli.StringFlag{ - Name: "corsdomain", + Name: "http-cors-domain", Usage: "Comma separated list of domains from which to accept cross origin requests.", Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", Aliases: []string{"grpc-gateway-corsdomain"}, From 602178d2649476bffdc7d866712e19b041341721 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:17:58 -0500 Subject: [PATCH 20/58] Update cmd/beacon-chain/flags/base.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- cmd/beacon-chain/flags/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 97dbfb612728..1fddf470960e 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -103,7 +103,7 @@ var ( // Deprecated: DeprecatedDisableGRPCGateway for JSON-HTTP requests to the beacon node. DeprecatedDisableGRPCGateway = &cli.BoolFlag{ Name: "disable-grpc-gateway", - Usage: "Disable the gRPC gateway for JSON-HTTP requests", + Usage: "Flag deprecated and unused", } // HTTPServerHost specifies a HTTP server host for the validator client. HTTPServerHost = &cli.StringFlag{ From 19f631af442a44e6a9ff5ef6d37d2481ff4d1df1 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 14 Jun 2024 13:35:44 -0500 Subject: [PATCH 21/58] addressing feedback --- api/server/http-rest/BUILD.bazel | 1 - api/server/http-rest/log.go | 2 +- api/server/http-rest/options.go | 16 ++++------------ api/server/http-rest/server.go | 19 ++++++------------- api/server/http-rest/server_test.go | 2 +- beacon-chain/node/node.go | 15 ++++++--------- validator/node/node.go | 21 +++++++-------------- 7 files changed, 25 insertions(+), 51 deletions(-) diff --git a/api/server/http-rest/BUILD.bazel b/api/server/http-rest/BUILD.bazel index 76b468532107..562ea71d9bdb 100644 --- a/api/server/http-rest/BUILD.bazel +++ b/api/server/http-rest/BUILD.bazel @@ -10,7 +10,6 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/v5/api/server/http-rest", visibility = ["//visibility:public"], deps = [ - "//api/server/middleware:go_default_library", "//runtime:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/api/server/http-rest/log.go b/api/server/http-rest/log.go index e94c0fc8c1a9..35e76f824c99 100644 --- a/api/server/http-rest/log.go +++ b/api/server/http-rest/log.go @@ -1,4 +1,4 @@ -package http_rest +package httprest import "github.com/sirupsen/logrus" diff --git a/api/server/http-rest/options.go b/api/server/http-rest/options.go index 335af24d41b3..97a22e01a268 100644 --- a/api/server/http-rest/options.go +++ b/api/server/http-rest/options.go @@ -1,4 +1,4 @@ -package http_rest +package httprest import ( "time" @@ -8,9 +8,9 @@ import ( type Option func(g *Server) error -func WithMuxHandler(m restHandler) Option { +func WithMuxHandler(m httpHandler) Option { return func(g *Server) error { - g.cfg.muxHandler = m + g.cfg.handler = m return nil } } @@ -22,7 +22,7 @@ func WithHTTPAddr(addr string) Option { } } -// WithRouter allows adding a custom mux router to the gateway. +// WithRouter --. func WithRouter(r *mux.Router) Option { return func(g *Server) error { g.cfg.router = r @@ -30,14 +30,6 @@ func WithRouter(r *mux.Router) Option { } } -// WithAllowedOrigins allows adding a set of allowed origins to the gateway. -func WithAllowedOrigins(origins []string) Option { - return func(g *Server) error { - g.cfg.allowedOrigins = origins - return nil - } -} - // WithTimeout allows changing the timeout value for API calls. func WithTimeout(seconds uint64) Option { return func(g *Server) error { diff --git a/api/server/http-rest/server.go b/api/server/http-rest/server.go index 45a973becfb1..b1e1e0808482 100644 --- a/api/server/http-rest/server.go +++ b/api/server/http-rest/server.go @@ -1,4 +1,4 @@ -package http_rest +package httprest import ( "context" @@ -7,14 +7,13 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/runtime" ) var _ runtime.Service = (*Server)(nil) -// restHandler is a functional interface that implements the rest handler functionality. -type restHandler func( +// httpHandler is a functional interface that implements the http handler functionality. +type httpHandler func( h http.HandlerFunc, w http.ResponseWriter, req *http.Request, @@ -24,12 +23,12 @@ type restHandler func( type config struct { httpAddr string allowedOrigins []string - muxHandler restHandler + handler httpHandler router *mux.Router timeout time.Duration } -// Server serves HTTP JSON traffic. +// Server serves HTTP traffic. type Server struct { cfg *config server *http.Server @@ -54,18 +53,12 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { return nil, errors.New("router option not configured") } - corsMux := middleware.CorsHandler(g.cfg.allowedOrigins).Middleware(g.cfg.router) // TODO: actually use the timeout config provided g.server = &http.Server{ Addr: g.cfg.httpAddr, - Handler: corsMux, + Handler: g.cfg.router, ReadHeaderTimeout: time.Second, } - if g.cfg.muxHandler != nil { // rest APIS and Web UI registration - g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - g.cfg.muxHandler(corsMux.ServeHTTP, w, r) - }) - } return g, nil } diff --git a/api/server/http-rest/server_test.go b/api/server/http-rest/server_test.go index d196f8c353f6..1e5756f098e4 100644 --- a/api/server/http-rest/server_test.go +++ b/api/server/http-rest/server_test.go @@ -1,4 +1,4 @@ -package http_rest +package httprest import ( "context" diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index ede4aa15d98c..c98994339e58 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" - http_rest "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" + "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" @@ -1049,16 +1049,13 @@ func (b *BeaconNode) registerHTTPService(router *mux.Router) error { host := b.cliCtx.String(flags.HTTPServerHost.Name) port := b.cliCtx.Int(flags.HTTPServerPort.Name) address := net.JoinHostPort(host, strconv.Itoa(port)) - allowedOrigins := strings.Split(b.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - - opts := []http_rest.Option{ - http_rest.WithRouter(router), - http_rest.WithHTTPAddr(address), - http_rest.WithAllowedOrigins(allowedOrigins), - http_rest.WithTimeout(uint64(timeout)), + opts := []httprest.Option{ + httprest.WithRouter(router), + httprest.WithHTTPAddr(address), + httprest.WithTimeout(uint64(timeout)), } - g, err := http_rest.New(b.ctx, opts...) + g, err := httprest.New(b.ctx, opts...) if err != nil { return err } diff --git a/validator/node/node.go b/validator/node/node.go index c7457133bb0d..10b733205e5e 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - http_rest "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" + "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" @@ -656,12 +656,6 @@ func (c *ValidatorClient) registerHTTPService(router *mux.Router) error { port := c.cliCtx.Int(flags.HTTPServerPort.Name) address := net.JoinHostPort(host, fmt.Sprintf("%d", port)) timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - var allowedOrigins []string - if c.cliCtx.IsSet(flags.HTTPServerCorsDomain.Name) { - allowedOrigins = strings.Split(c.cliCtx.String(flags.HTTPServerCorsDomain.Name), ",") - } else { - allowedOrigins = strings.Split(flags.HTTPServerCorsDomain.Value, ",") - } muxHandler := func(h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { // The validator api handler requires this special logic as it serves the web APIs and the web UI. @@ -674,14 +668,13 @@ func (c *ValidatorClient) registerHTTPService(router *mux.Router) error { } } - opts := []http_rest.Option{ - http_rest.WithMuxHandler(muxHandler), - http_rest.WithRouter(router), // note some routes are registered in server.go - http_rest.WithHTTPAddr(address), - http_rest.WithAllowedOrigins(allowedOrigins), - http_rest.WithTimeout(uint64(timeout)), + opts := []httprest.Option{ + httprest.WithMuxHandler(muxHandler), + httprest.WithRouter(router), // note some routes are registered in server.go + httprest.WithHTTPAddr(address), + httprest.WithTimeout(uint64(timeout)), } - gw, err := http_rest.New(c.cliCtx.Context, opts...) + gw, err := httprest.New(c.cliCtx.Context, opts...) if err != nil { return err } From 3116e95938998af95b7b826fb22f911bec6d2101 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 14 Jun 2024 13:47:33 -0500 Subject: [PATCH 22/58] missed lint --- api/server/http-rest/server.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/server/http-rest/server.go b/api/server/http-rest/server.go index b1e1e0808482..446b38ba4d12 100644 --- a/api/server/http-rest/server.go +++ b/api/server/http-rest/server.go @@ -21,11 +21,10 @@ type httpHandler func( // Config parameters for setting up the http-rest service. type config struct { - httpAddr string - allowedOrigins []string - handler httpHandler - router *mux.Router - timeout time.Duration + httpAddr string + handler httpHandler + router *mux.Router + timeout time.Duration } // Server serves HTTP traffic. From ca81e6b488945616ddbe78ad790bd2359295784c Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 14 Jun 2024 13:56:57 -0500 Subject: [PATCH 23/58] renaming import --- api/server/{http-rest => httprest}/BUILD.bazel | 2 +- api/server/{http-rest => httprest}/log.go | 0 api/server/{http-rest => httprest}/options.go | 0 api/server/{http-rest => httprest}/server.go | 0 api/server/{http-rest => httprest}/server_test.go | 0 beacon-chain/node/BUILD.bazel | 2 +- beacon-chain/node/node.go | 2 +- validator/node/BUILD.bazel | 2 +- validator/node/node.go | 2 +- 9 files changed, 5 insertions(+), 5 deletions(-) rename api/server/{http-rest => httprest}/BUILD.bazel (98%) rename api/server/{http-rest => httprest}/log.go (100%) rename api/server/{http-rest => httprest}/options.go (100%) rename api/server/{http-rest => httprest}/server.go (100%) rename api/server/{http-rest => httprest}/server_test.go (100%) diff --git a/api/server/http-rest/BUILD.bazel b/api/server/httprest/BUILD.bazel similarity index 98% rename from api/server/http-rest/BUILD.bazel rename to api/server/httprest/BUILD.bazel index 562ea71d9bdb..bef932abc364 100644 --- a/api/server/http-rest/BUILD.bazel +++ b/api/server/httprest/BUILD.bazel @@ -7,7 +7,7 @@ go_library( "options.go", "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/v5/api/server/http-rest", + importpath = "github.com/prysmaticlabs/prysm/v5/api/server/httprest", visibility = ["//visibility:public"], deps = [ "//runtime:go_default_library", diff --git a/api/server/http-rest/log.go b/api/server/httprest/log.go similarity index 100% rename from api/server/http-rest/log.go rename to api/server/httprest/log.go diff --git a/api/server/http-rest/options.go b/api/server/httprest/options.go similarity index 100% rename from api/server/http-rest/options.go rename to api/server/httprest/options.go diff --git a/api/server/http-rest/server.go b/api/server/httprest/server.go similarity index 100% rename from api/server/http-rest/server.go rename to api/server/httprest/server.go diff --git a/api/server/http-rest/server_test.go b/api/server/httprest/server_test.go similarity index 100% rename from api/server/http-rest/server_test.go rename to api/server/httprest/server_test.go diff --git a/beacon-chain/node/BUILD.bazel b/beacon-chain/node/BUILD.bazel index 21d2e3f7036a..af08d79a4da9 100644 --- a/beacon-chain/node/BUILD.bazel +++ b/beacon-chain/node/BUILD.bazel @@ -15,7 +15,7 @@ go_library( "//cmd/beacon-chain:__subpackages__", ], deps = [ - "//api/server/http-rest:go_default_library", + "//api/server/httprest:go_default_library", "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index c98994339e58..647cd7ed8025 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -19,7 +19,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/gorilla/mux" "github.com/pkg/errors" - "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" + "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain" diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 8524b5e8a866..49ab514224ca 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -36,7 +36,7 @@ go_library( ], deps = [ "//api:go_default_library", - "//api/server/http-rest:go_default_library", + "//api/server/httprest:go_default_library", "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index 10b733205e5e..5e0fac96d195 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" fastssz "github.com/prysmaticlabs/fastssz" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/server/http-rest" + "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" From 9789d90e1ac8f0cfbe497df373151db42a848ab7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 14 Jun 2024 16:23:02 -0500 Subject: [PATCH 24/58] reversal based on feedback --- testing/endtoend/helpers/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/endtoend/helpers/helpers.go b/testing/endtoend/helpers/helpers.go index 1c6fd3423e22..7f0ce6767abc 100644 --- a/testing/endtoend/helpers/helpers.go +++ b/testing/endtoend/helpers/helpers.go @@ -132,7 +132,7 @@ func WaitForTextInFile(src *os.File, match string) error { select { case <-ctx.Done(): - return fmt.Errorf("could not find requested text %s in %s before deadline", match, f.Name()) + return fmt.Errorf("could not find requested text \"%s\" in %s before deadline", match, f.Name()) case <-foundChan: return nil case err = <-errChan: From 3257fadb7071556abf1ca6157d84b34e3fe6c185 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 18 Jun 2024 13:55:47 -0500 Subject: [PATCH 25/58] fixing web ui registration --- api/server/httprest/server.go | 8 +++++++- validator/node/node.go | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 446b38ba4d12..42222248bc44 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -51,13 +51,19 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { if g.cfg.router == nil { return nil, errors.New("router option not configured") } - + if g.cfg.handler == nil { + return nil, errors.New("handler option not configured") + } // TODO: actually use the timeout config provided g.server = &http.Server{ Addr: g.cfg.httpAddr, Handler: g.cfg.router, ReadHeaderTimeout: time.Second, } + // wrap to handle web apis + g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + g.cfg.handler(g.cfg.router.ServeHTTP, w, r) + }) return g, nil } diff --git a/validator/node/node.go b/validator/node/node.go index 5e0fac96d195..cc77ef073846 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -667,7 +667,6 @@ func (c *ValidatorClient) registerHTTPService(router *mux.Router) error { web.Handler(w, req) } } - opts := []httprest.Option{ httprest.WithMuxHandler(muxHandler), httprest.WithRouter(router), // note some routes are registered in server.go From c3969107effa42b77ed160e9c16419ef1224dc84 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 18 Jun 2024 14:19:10 -0500 Subject: [PATCH 26/58] don't require mux handler --- api/server/httprest/server.go | 16 +++++++++------- validator/http/server.go | 7 +++++++ 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 validator/http/server.go diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 42222248bc44..ba8cb485825f 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -51,19 +51,21 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { if g.cfg.router == nil { return nil, errors.New("router option not configured") } - if g.cfg.handler == nil { - return nil, errors.New("handler option not configured") - } + // TODO: actually use the timeout config provided g.server = &http.Server{ Addr: g.cfg.httpAddr, Handler: g.cfg.router, ReadHeaderTimeout: time.Second, } - // wrap to handle web apis - g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - g.cfg.handler(g.cfg.router.ServeHTTP, w, r) - }) + + if g.cfg.handler != nil { + // wrap to handle web apis + g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + g.cfg.handler(g.cfg.router.ServeHTTP, w, r) + }) + } + return g, nil } diff --git a/validator/http/server.go b/validator/http/server.go new file mode 100644 index 000000000000..b0d0107f4954 --- /dev/null +++ b/validator/http/server.go @@ -0,0 +1,7 @@ +package http + +import "github.com/prysmaticlabs/prysm/v5/api/server/httprest" + +type Server struct { + httprest.Server +} From 48f00a187e21e9f9dfa416607db39bd551a468fb Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 20 Jun 2024 15:14:10 -0500 Subject: [PATCH 27/58] gaz --- validator/http/BUILD.bazel | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 validator/http/BUILD.bazel diff --git a/validator/http/BUILD.bazel b/validator/http/BUILD.bazel new file mode 100644 index 000000000000..1012d371b736 --- /dev/null +++ b/validator/http/BUILD.bazel @@ -0,0 +1,9 @@ +load("@prysm//tools/go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["server.go"], + importpath = "github.com/prysmaticlabs/prysm/v5/validator/http", + visibility = ["//visibility:public"], + deps = ["//api/server/httprest:go_default_library"], +) From 3734fbe6a151ed7fa032c57aea6f107cc8af9802 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 17:34:32 -0500 Subject: [PATCH 28/58] removing gRPC service from validator completely, merged with http service, renames are a work in progress --- validator/http/BUILD.bazel | 9 --- validator/http/server.go | 7 -- validator/node/BUILD.bazel | 2 - validator/node/node.go | 61 ++++-------------- validator/rpc/BUILD.bazel | 5 +- validator/rpc/auth_token.go | 2 +- validator/rpc/beacon.go | 2 +- validator/rpc/server.go | 125 +++++++++++++++++------------------- 8 files changed, 73 insertions(+), 140 deletions(-) delete mode 100644 validator/http/BUILD.bazel delete mode 100644 validator/http/server.go diff --git a/validator/http/BUILD.bazel b/validator/http/BUILD.bazel deleted file mode 100644 index 1012d371b736..000000000000 --- a/validator/http/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@prysm//tools/go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["server.go"], - importpath = "github.com/prysmaticlabs/prysm/v5/validator/http", - visibility = ["//visibility:public"], - deps = ["//api/server/httprest:go_default_library"], -) diff --git a/validator/http/server.go b/validator/http/server.go deleted file mode 100644 index b0d0107f4954..000000000000 --- a/validator/http/server.go +++ /dev/null @@ -1,7 +0,0 @@ -package http - -import "github.com/prysmaticlabs/prysm/v5/api/server/httprest" - -type Server struct { - httprest.Server -} diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 99837aedef7d..6d8500151dfc 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -36,7 +36,6 @@ go_library( ], deps = [ "//api:go_default_library", - "//api/server/httprest:go_default_library", "//api/server/middleware:go_default_library", "//async/event:go_default_library", "//cmd:go_default_library", @@ -65,7 +64,6 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/keymanager/remote-web3signer:go_default_library", "//validator/rpc:go_default_library", - "//validator/web:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/validator/node/node.go b/validator/node/node.go index 15eca033eedc..73d68ab9ad01 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -6,8 +6,6 @@ package node import ( "context" "fmt" - "net" - "net/http" "net/url" "os" "os/signal" @@ -22,7 +20,6 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" - "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/api/server/middleware" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/cmd" @@ -51,7 +48,6 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/keymanager/local" remoteweb3signer "github.com/prysmaticlabs/prysm/v5/validator/keymanager/remote-web3signer" "github.com/prysmaticlabs/prysm/v5/validator/rpc" - "github.com/prysmaticlabs/prysm/v5/validator/web" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" ) @@ -289,9 +285,6 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context, router *mux.Rou if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerHTTPService(router); err != nil { - return err - } } return nil } @@ -332,9 +325,7 @@ func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context, router *mux.Rout if err := c.registerRPCService(router); err != nil { return err } - if err := c.registerHTTPService(router); err != nil { - return err - } + host := cliCtx.String(flags.HTTPServerHost.Name) port := cliCtx.Int(flags.HTTPServerPort.Name) webAddress := fmt.Sprintf("http://%s:%d", host, port) @@ -618,11 +609,18 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { authTokenPath = filepath.Join(walletDir, api.AuthTokenFileName) } } + host := c.cliCtx.String(flags.HTTPServerHost.Name) + if host != flags.DefaultHTTPServerHost { + log.WithField("webHost", host).Warn( + "You are using a non-default web host. Web traffic is served by HTTP, so be wary of " + + "changing this parameter if you are exposing this host to the Internet!", + ) + } + port := c.cliCtx.Int(flags.HTTPServerPort.Name) + s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ - Host: c.cliCtx.String(flags.RPCHost.Name), - Port: fmt.Sprintf("%d", c.cliCtx.Int(flags.RPCPort.Name)), - HTTPHost: c.cliCtx.String(flags.HTTPServerHost.Name), - HTTPPort: c.cliCtx.Int(flags.HTTPServerPort.Name), + Host: host, + Port: port, GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), @@ -642,41 +640,6 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { return c.services.RegisterService(s) } -func (c *ValidatorClient) registerHTTPService(router *mux.Router) error { - host := c.cliCtx.String(flags.HTTPServerHost.Name) - if host != flags.DefaultHTTPServerHost { - log.WithField("webHost", host).Warn( - "You are using a non-default web host. Web traffic is served by HTTP, so be wary of " + - "changing this parameter if you are exposing this host to the Internet!", - ) - } - port := c.cliCtx.Int(flags.HTTPServerPort.Name) - address := net.JoinHostPort(host, fmt.Sprintf("%d", port)) - timeout := c.cliCtx.Int(cmd.ApiTimeoutFlag.Name) - - muxHandler := func(h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { - // The validator api handler requires this special logic as it serves the web APIs and the web UI. - if strings.HasPrefix(req.URL.Path, "/api") { - req.URL.Path = strings.Replace(req.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs - h(w, req) - } else { - // Finally, we handle with the web server. - web.Handler(w, req) - } - } - opts := []httprest.Option{ - httprest.WithMuxHandler(muxHandler), - httprest.WithRouter(router), // note some routes are registered in server.go - httprest.WithHTTPAddr(address), - httprest.WithTimeout(uint64(timeout)), - } - gw, err := httprest.New(c.cliCtx.Context, opts...) - if err != nil { - return err - } - return c.services.RegisterService(gw) -} - func setWalletPasswordFilePath(cliCtx *cli.Context) error { walletDir := cliCtx.String(flags.WalletDirFlag.Name) defaultWalletPasswordFilePath := filepath.Join(walletDir, wallet.DefaultWalletPasswordFile) diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 43a64fdb5ad9..fde388e4b39d 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -42,7 +42,6 @@ go_library( "//io/file:go_default_library", "//io/logs:go_default_library", "//io/prompt:go_default_library", - "//monitoring/tracing:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//runtime/version:go_default_library", @@ -62,13 +61,13 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/slashing-protection-history:go_default_library", "//validator/slashing-protection-history/format:go_default_library", + "//validator/web:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_fsnotify_fsnotify//:go_default_library", "@com_github_golang_jwt_jwt_v4//:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library", - "@com_github_grpc_ecosystem_go_grpc_middleware//recovery:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//retry:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//tracing/opentracing:go_default_library", "@com_github_grpc_ecosystem_go_grpc_prometheus//:go_default_library", @@ -77,12 +76,10 @@ go_library( "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_tyler_smith_go_bip39//wordlists:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", - "@io_opencensus_go//plugin/ocgrpc:go_default_library", "@io_opencensus_go//trace:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", - "@org_golang_google_grpc//reflection:go_default_library", "@org_golang_google_grpc//status:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", ], diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index df67fae07965..0f85ec970557 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -104,7 +104,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } - validatorWebAddr := fmt.Sprintf("%s:%d", s.httpHost, s.httpPort) + validatorWebAddr := fmt.Sprintf("%s:%d", s.host, s.port) logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) diff --git a/validator/rpc/beacon.go b/validator/rpc/beacon.go index d1635fe0f16e..b6ccd2f507f4 100644 --- a/validator/rpc/beacon.go +++ b/validator/rpc/beacon.go @@ -19,7 +19,7 @@ import ( "google.golang.org/grpc" ) -// Initialize a client connect to a beacon node gRPC endpoint. +// Initialize a client connect to a beacon node gRPC or HTTP endpoint. func (s *Server) registerBeaconClient() error { streamInterceptor := grpc.WithStreamInterceptor(middleware.ChainStreamClient( grpcopentracing.StreamClientInterceptor(), diff --git a/validator/rpc/server.go b/validator/rpc/server.go index f584cf58cddd..b56fb5ee896a 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -6,34 +6,26 @@ import ( "net" "net/http" "path/filepath" + "strings" "time" "github.com/gorilla/mux" - middleware "github.com/grpc-ecosystem/go-grpc-middleware" - recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" - grpcopentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" - grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/io/logs" - "github.com/prysmaticlabs/prysm/v5/monitoring/tracing" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" "github.com/prysmaticlabs/prysm/v5/validator/client" iface "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" - "go.opencensus.io/plugin/ocgrpc" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" + "github.com/prysmaticlabs/prysm/v5/validator/web" ) -// Config options for the gRPC server. +// Config options for the HTTP server. type Config struct { - Host string - Port string - HTTPHost string - HTTPPort int + Host string // http host, not grpc + Port int // http port, not grpc GRPCMaxCallRecvMsgSize int GRPCRetries uint GRPCRetryDelay time.Duration @@ -51,20 +43,18 @@ type Config struct { Router *mux.Router } -// Server defining a gRPC server for the remote signer API. +// Server defining a HTTP server for the remote signer API and registering clients type Server struct { ctx context.Context cancel context.CancelFunc - host string - port string - httpHost string - httpPort int + host string // http host, not grpc + port int // http port, not grpc + server *http.Server listener net.Listener grpcMaxCallRecvMsgSize int grpcRetries uint grpcRetryDelay time.Duration grpcHeaders []string - grpcServer *grpc.Server beaconNodeValidatorClient iface.ValidatorClient chainClient iface.ChainClient nodeClient iface.NodeClient @@ -85,9 +75,10 @@ type Server struct { router *mux.Router logStreamer logs.Streamer logStreamerBufferSize int + startFailure error } -// NewServer instantiates a new gRPC server. +// NewServer instantiates a new HTTP server. func NewServer(ctx context.Context, cfg *Config) *Server { ctx, cancel := context.WithCancel(ctx) server := &Server{ @@ -97,8 +88,6 @@ func NewServer(ctx context.Context, cfg *Config) *Server { logStreamerBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. host: cfg.Host, port: cfg.Port, - httpHost: cfg.HTTPHost, - httpPort: cfg.HTTPPort, grpcMaxCallRecvMsgSize: cfg.GRPCMaxCallRecvMsgSize, grpcRetries: cfg.GRPCRetries, grpcRetryDelay: cfg.GRPCRetryDelay, @@ -114,6 +103,10 @@ func NewServer(ctx context.Context, cfg *Config) *Server { beaconApiEndpoint: cfg.BeaconApiEndpoint, beaconNodeEndpoint: cfg.BeaconNodeGRPCEndpoint, router: cfg.Router, + server: &http.Server{ + Addr: net.JoinHostPort(cfg.Host, fmt.Sprintf("%d", cfg.Port)), + Handler: cfg.Router, + }, } if server.authTokenPath == "" && server.walletDir != "" { @@ -124,62 +117,37 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.initializeAuthToken(); err != nil { log.WithError(err).Error("Could not initialize web auth token") } - validatorWebAddr := fmt.Sprintf("%s:%d", server.httpHost, server.httpPort) + validatorWebAddr := fmt.Sprintf("%s:%d", server.host, server.port) logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) } + // Register a gRPC or HTTP client to the beacon node. + // Used for proxy calls to beacon node from validator REST handlers + if err := server.registerBeaconClient(); err != nil { + log.WithError(err).Fatal("Could not register beacon chain gRPC or HTTP client") + } // immediately register routes to override any catchalls if err := server.InitializeRoutes(); err != nil { log.WithError(err).Fatal("Could not initialize routes") } + return server } -// Start the gRPC server. +// Start the HTTP server and registers clients that can communicate via HTTP or gRPC. func (s *Server) Start() { - // Setup the gRPC server options and TLS configuration. - address := net.JoinHostPort(s.host, s.port) - lis, err := net.Listen("tcp", address) - if err != nil { - log.WithError(err).Errorf("Could not listen to port in Start() %s", address) - } - s.listener = lis - - // Register interceptors for metrics gathering as well as our - // own, custom JWT unary interceptor. - opts := []grpc.ServerOption{ - grpc.StatsHandler(&ocgrpc.ServerHandler{}), - grpc.UnaryInterceptor(middleware.ChainUnaryServer( - recovery.UnaryServerInterceptor( - recovery.WithRecoveryHandlerContext(tracing.RecoveryHandlerFunc), - ), - grpcprometheus.UnaryServerInterceptor, - grpcopentracing.UnaryServerInterceptor(), - s.AuthTokenInterceptor(), - )), - } - grpcprometheus.EnableHandlingTimeHistogram() - - s.grpcServer = grpc.NewServer(opts...) - - // Register a gRPC client to the beacon node. - if err := s.registerBeaconClient(); err != nil { - log.WithError(err).Fatal("Could not register beacon chain gRPC client") - } - - // Register services available for the gRPC server. - reflection.Register(s.grpcServer) + _, cancel := context.WithCancel(s.ctx) + s.cancel = cancel - // routes needs to be set before the server calls the server function go func() { - if s.listener != nil { - if err := s.grpcServer.Serve(s.listener); err != nil { - log.WithError(err).Error("Could not serve") - } + log.WithField("address", net.JoinHostPort(s.host, fmt.Sprintf("%d", s.port))).Info("Starting HTTP server") + if err := s.server.ListenAndServe(); err != http.ErrServerClosed { + log.WithError(err).Error("Failed to start HTTP server") + s.startFailure = err + return } }() - log.WithField("address", address).Info("gRPC server listening on address") } // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. @@ -233,21 +201,44 @@ func (s *Server) InitializeRoutes() error { // slashing protection endpoints s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/export", s.ExportSlashingProtection).Methods(http.MethodGet) s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/import", s.ImportSlashingProtection).Methods(http.MethodPost) + + s.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/api") { + r.URL.Path = strings.Replace(r.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs + s.router.ServeHTTP(w, r) + } else { + // Finally, we handle with the web server. + web.Handler(w, r) + } + }) + log.Info("Initialized REST API routes") return nil } -// Stop the gRPC server. +// Stop the HTTP server. func (s *Server) Stop() error { - s.cancel() - if s.listener != nil { - s.grpcServer.GracefulStop() - log.Debug("Initiated graceful stop of server") + if s.server != nil { + shutdownCtx, shutdownCancel := context.WithTimeout(s.ctx, 2*time.Second) + defer shutdownCancel() + if err := s.server.Shutdown(shutdownCtx); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + log.Warn("Existing connections terminated") + } else { + log.WithError(err).Error("Failed to gracefully shut down server") + } + } + } + if s.cancel != nil { + s.cancel() } return nil } // Status returns an error if the service is unhealthy. func (s *Server) Status() error { + if s.startFailure != nil { + return s.startFailure + } return nil } From 65ce6ff584d8afa6b2d2b39580ddde0fea4926b6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 17:37:19 -0500 Subject: [PATCH 29/58] updating go.sum --- go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/go.sum b/go.sum index 11618e441dc4..4b86e0cda35a 100644 --- a/go.sum +++ b/go.sum @@ -926,7 +926,6 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/prom2json v1.3.0 h1:BlqrtbT9lLH3ZsOVhXPsHzFrApCTKRifB7gjJuypu6Y= github.com/prometheus/prom2json v1.3.0/go.mod h1:rMN7m0ApCowcoDlypBHlkNbp5eJQf/+1isKykIP5ZnM= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3 h1:0LZAwwHnsZFfXm4IK4rzFV4N5IVSKZKLmuBMA4kAlFk= github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2OlIZD/M6wFvV3YMZbW16lFgh3Rsye00G44J2cwLyU= github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= From 3279e373b069ae02a203c4005cc079610757ce87 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 17:42:51 -0500 Subject: [PATCH 30/58] linting --- validator/rpc/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index b56fb5ee896a..cf6d61760e57 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -50,7 +50,6 @@ type Server struct { host string // http host, not grpc port int // http port, not grpc server *http.Server - listener net.Listener grpcMaxCallRecvMsgSize int grpcRetries uint grpcRetryDelay time.Duration From 4bb6182e7c99bf2d813fb51d5bb2c6585de8301f Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 17:49:44 -0500 Subject: [PATCH 31/58] trailing white space --- validator/rpc/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index cf6d61760e57..dcc55f95b1b1 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -146,7 +146,6 @@ func (s *Server) Start() { return } }() - } // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. From b94f21fcf8318fb4d2afb635bcb61fc57583867c Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 18:03:52 -0500 Subject: [PATCH 32/58] realized there was more cleanup i could do with code reuse --- api/server/httprest/server.go | 7 ------ validator/rpc/BUILD.bazel | 1 + validator/rpc/server.go | 46 ++++++++++++----------------------- 3 files changed, 16 insertions(+), 38 deletions(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index ba8cb485825f..0d130b97bb3e 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -59,13 +59,6 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { ReadHeaderTimeout: time.Second, } - if g.cfg.handler != nil { - // wrap to handle web apis - g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - g.cfg.handler(g.cfg.router.ServeHTTP, w, r) - }) - } - return g, nil } diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index fde388e4b39d..dfb1c523e7c5 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//api/grpc:go_default_library", "//api/pagination:go_default_library", "//api/server:go_default_library", + "//api/server/httprest:go_default_library", "//api/server/structs:go_default_library", "//async/event:go_default_library", "//beacon-chain/rpc/eth/shared:go_default_library", diff --git a/validator/rpc/server.go b/validator/rpc/server.go index dcc55f95b1b1..3a65791b51a4 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -12,6 +12,7 @@ import ( "github.com/gorilla/mux" "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/api" + "github.com/prysmaticlabs/prysm/v5/api/server/httprest" "github.com/prysmaticlabs/prysm/v5/async/event" "github.com/prysmaticlabs/prysm/v5/io/logs" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" @@ -49,7 +50,7 @@ type Server struct { cancel context.CancelFunc host string // http host, not grpc port int // http port, not grpc - server *http.Server + server *httprest.Server grpcMaxCallRecvMsgSize int grpcRetries uint grpcRetryDelay time.Duration @@ -102,10 +103,6 @@ func NewServer(ctx context.Context, cfg *Config) *Server { beaconApiEndpoint: cfg.BeaconApiEndpoint, beaconNodeEndpoint: cfg.BeaconNodeGRPCEndpoint, router: cfg.Router, - server: &http.Server{ - Addr: net.JoinHostPort(cfg.Host, fmt.Sprintf("%d", cfg.Port)), - Handler: cfg.Router, - }, } if server.authTokenPath == "" && server.walletDir != "" { @@ -130,22 +127,23 @@ func NewServer(ctx context.Context, cfg *Config) *Server { log.WithError(err).Fatal("Could not initialize routes") } + opts := []httprest.Option{ + httprest.WithRouter(cfg.Router), + httprest.WithHTTPAddr(net.JoinHostPort(server.host, fmt.Sprintf("%d", server.port))), + } + // create and set a new http server + s, err := httprest.New(server.ctx, opts...) + if err != nil { + log.WithError(err).Fatal("Failed to create HTTP server") + } + server.server = s + return server } // Start the HTTP server and registers clients that can communicate via HTTP or gRPC. func (s *Server) Start() { - _, cancel := context.WithCancel(s.ctx) - s.cancel = cancel - - go func() { - log.WithField("address", net.JoinHostPort(s.host, fmt.Sprintf("%d", s.port))).Info("Starting HTTP server") - if err := s.server.ListenAndServe(); err != http.ErrServerClosed { - log.WithError(err).Error("Failed to start HTTP server") - s.startFailure = err - return - } - }() + s.server.Start() } // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. @@ -216,21 +214,7 @@ func (s *Server) InitializeRoutes() error { // Stop the HTTP server. func (s *Server) Stop() error { - if s.server != nil { - shutdownCtx, shutdownCancel := context.WithTimeout(s.ctx, 2*time.Second) - defer shutdownCancel() - if err := s.server.Shutdown(shutdownCtx); err != nil { - if errors.Is(err, context.DeadlineExceeded) { - log.Warn("Existing connections terminated") - } else { - log.WithError(err).Error("Failed to gracefully shut down server") - } - } - } - if s.cancel != nil { - s.cancel() - } - return nil + return s.server.Stop() } // Status returns an error if the service is unhealthy. From 6d0fe18c9232072171c6c29949b89ab60b87b6f2 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 21 Jun 2024 21:25:43 -0500 Subject: [PATCH 33/58] adding wrapper for routes --- validator/rpc/server.go | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 3a65791b51a4..a51cf13c2177 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -122,9 +122,9 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.registerBeaconClient(); err != nil { log.WithError(err).Fatal("Could not register beacon chain gRPC or HTTP client") } - // immediately register routes to override any catchalls - if err := server.InitializeRoutes(); err != nil { - log.WithError(err).Fatal("Could not initialize routes") + + if err := server.InitializeRoutesWithWebHandler(); err != nil { + log.WithError(err).Fatal("Could not initialize routes with web handler") } opts := []httprest.Option{ @@ -146,6 +146,23 @@ func (s *Server) Start() { s.server.Start() } +// InitializeRoutesWithWebHandler adds a catchall wrapper for web handling +func (s *Server) InitializeRoutesWithWebHandler() error { + if err := s.InitializeRoutes(); err != nil { + return err + } + s.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/api") { + r.URL.Path = strings.Replace(r.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs + s.router.ServeHTTP(w, r) + } else { + // Finally, we handle with the web server. + web.Handler(w, r) + } + }) + return nil +} + // InitializeRoutes initializes pure HTTP REST endpoints for the validator client. // needs to be called before the Serve function func (s *Server) InitializeRoutes() error { @@ -198,16 +215,6 @@ func (s *Server) InitializeRoutes() error { s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/export", s.ExportSlashingProtection).Methods(http.MethodGet) s.router.HandleFunc(api.WebUrlPrefix+"slashing-protection/import", s.ImportSlashingProtection).Methods(http.MethodPost) - s.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if strings.HasPrefix(r.URL.Path, "/api") { - r.URL.Path = strings.Replace(r.URL.Path, "/api", "", 1) // used to redirect apis to standard rest APIs - s.router.ServeHTTP(w, r) - } else { - // Finally, we handle with the web server. - web.Handler(w, r) - } - }) - log.Info("Initialized REST API routes") return nil } From f689adce5a98cce402de38634bc49daf0adc57b0 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 27 Jun 2024 09:38:29 -0500 Subject: [PATCH 34/58] reverting version --- deps.bzl | 4 ++-- go.mod | 2 +- go.sum | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deps.bzl b/deps.bzl index 63bfe47075e9..8d354a14dfc9 100644 --- a/deps.bzl +++ b/deps.bzl @@ -1419,8 +1419,8 @@ def prysm_deps(): go_repository( name = "com_github_grpc_ecosystem_go_grpc_middleware", importpath = "github.com/grpc-ecosystem/go-grpc-middleware", - sum = "h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=", - version = "v1.0.1-0.20190118093823-f849b5445de4", + sum = "h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0=", + version = "v1.2.2", ) go_repository( name = "com_github_grpc_ecosystem_go_grpc_prometheus", diff --git a/go.mod b/go.mod index ae1e4c4b877b..88e14969a9f6 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 - github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 + github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/herumi/bls-eth-go-binary v0.0.0-20210917013441-d37c07cfda4e diff --git a/go.sum b/go.sum index 4b86e0cda35a..131c57777c24 100644 --- a/go.sum +++ b/go.sum @@ -471,6 +471,8 @@ github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:Fecb github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= @@ -1126,6 +1128,7 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= @@ -1192,6 +1195,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= @@ -1256,6 +1260,7 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -1366,6 +1371,7 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1599,6 +1605,7 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= From 86a56a3e90c9f1dd194acec97750f54dfbfc0be8 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 27 Jun 2024 10:39:00 -0500 Subject: [PATCH 35/58] fixing dependencies from merging develop --- deps.bzl | 56 ++++++++++++++--------- go.mod | 7 ++- go.sum | 14 +++--- validator/rpc/handlers_keymanager_test.go | 2 - 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/deps.bzl b/deps.bzl index 8d354a14dfc9..1c3e00b5f3a4 100644 --- a/deps.bzl +++ b/deps.bzl @@ -493,14 +493,14 @@ def prysm_deps(): go_repository( name = "com_github_cncf_udpa_go", importpath = "github.com/cncf/udpa/go", - sum = "h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=", - version = "v0.0.0-20220112060539-c52dc94e7fbe", + sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=", + version = "v0.0.0-20201120205902-5459f2c99403", ) go_repository( name = "com_github_cncf_xds_go", importpath = "github.com/cncf/xds/go", - sum = "h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=", - version = "v0.0.0-20230607035331-e9ce68804cb4", + sum = "h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc=", + version = "v0.0.0-20240318125728-8a4994d93e50", ) go_repository( name = "com_github_cockroachdb_datadriven", @@ -801,14 +801,14 @@ def prysm_deps(): go_repository( name = "com_github_envoyproxy_go_control_plane", importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA=", - version = "v0.11.1-0.20230524094728-9239064ad72f", + sum = "h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=", + version = "v0.12.0", ) go_repository( name = "com_github_envoyproxy_protoc_gen_validate", importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", - version = "v0.10.1", + sum = "h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=", + version = "v1.0.4", ) go_repository( name = "com_github_ethereum_c_kzg_4844", @@ -1215,8 +1215,8 @@ def prysm_deps(): go_repository( name = "com_github_golang_glog", importpath = "github.com/golang/glog", - sum = "h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=", - version = "v1.1.0", + sum = "h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=", + version = "v1.2.0", ) go_repository( name = "com_github_golang_groupcache", @@ -1331,8 +1331,8 @@ def prysm_deps(): go_repository( name = "com_github_google_uuid", importpath = "github.com/google/uuid", - sum = "h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=", - version = "v1.4.0", + sum = "h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=", + version = "v1.6.0", ) go_repository( name = "com_github_googleapis_gax_go", @@ -3753,14 +3753,14 @@ def prysm_deps(): go_repository( name = "com_google_cloud_go_compute", importpath = "cloud.google.com/go/compute", - sum = "h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=", - version = "v1.20.1", + sum = "h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU=", + version = "v1.25.1", ) go_repository( name = "com_google_cloud_go_compute_metadata", importpath = "cloud.google.com/go/compute/metadata", - sum = "h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=", - version = "v0.2.3", + sum = "h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=", + version = "v0.3.0", ) go_repository( name = "com_google_cloud_go_contactcenterinsights", @@ -4651,8 +4651,8 @@ def prysm_deps(): go_repository( name = "org_golang_google_appengine", importpath = "google.golang.org/appengine", - sum = "h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=", - version = "v1.6.7", + sum = "h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=", + version = "v1.6.8", ) go_repository( name = "org_golang_google_genproto", @@ -4660,12 +4660,24 @@ def prysm_deps(): sum = "h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=", version = "v0.0.0-20230410155749-daa745c078e1", ) + go_repository( + name = "org_golang_google_genproto_googleapis_api", + importpath = "google.golang.org/genproto/googleapis/api", + sum = "h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4=", + version = "v0.0.0-20240318140521-94a12d6c2237", + ) + go_repository( + name = "org_golang_google_genproto_googleapis_rpc", + importpath = "google.golang.org/genproto/googleapis/rpc", + sum = "h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=", + version = "v0.0.0-20240318140521-94a12d6c2237", + ) go_repository( name = "org_golang_google_grpc", build_file_proto_mode = "disable", importpath = "google.golang.org/grpc", - sum = "h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=", - version = "v1.56.3", + sum = "h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=", + version = "v1.64.0", ) go_repository( name = "org_golang_google_protobuf", @@ -4730,8 +4742,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_oauth2", importpath = "golang.org/x/oauth2", - sum = "h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=", - version = "v0.16.0", + sum = "h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=", + version = "v0.20.0", ) go_repository( name = "org_golang_x_perf", diff --git a/go.mod b/go.mod index 88e14969a9f6..a8ef5c1669d4 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 @@ -93,7 +93,7 @@ require ( golang.org/x/sync v0.7.0 golang.org/x/tools v0.21.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.56.3 + google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.1 gopkg.in/d4l3k/messagediff.v1 v1.2.1 gopkg.in/yaml.v2 v2.4.0 @@ -250,7 +250,7 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/oauth2 v0.20.0 // indirect golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect @@ -274,7 +274,6 @@ require ( github.com/prysmaticlabs/gohashtree v0.0.4-beta golang.org/x/sys v0.20.0 // indirect google.golang.org/api v0.44.0 // indirect - google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect ) diff --git a/go.sum b/go.sum index 131c57777c24..86e9c7c94586 100644 --- a/go.sum +++ b/go.sum @@ -445,8 +445,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -469,7 +469,6 @@ github.com/graph-gophers/graphql-go v1.3.0 h1:Eb9x/q6MFpCLz7jBCiP/WTxjSDrYLR1QY4 github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= @@ -1306,8 +1305,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1574,7 +1573,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170918111702-1e559d0a00ee/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1654,8 +1652,8 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 0b356eb85176..e55b5b94d992 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -17,8 +17,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/gorilla/mux" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prysmaticlabs/prysm/v5/cmd/validator/flags" fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams" "github.com/prysmaticlabs/prysm/v5/config/params" From 32e5886580c3a14eb22d0f860d6ec6e222a10488 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 27 Jun 2024 10:42:07 -0500 Subject: [PATCH 36/58] gaz --- validator/node/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/validator/node/BUILD.bazel b/validator/node/BUILD.bazel index 08ef21af9594..58c2016c79bd 100644 --- a/validator/node/BUILD.bazel +++ b/validator/node/BUILD.bazel @@ -60,7 +60,6 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/keymanager/remote-web3signer:go_default_library", "//validator/rpc:go_default_library", - "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", From ca7b10312f0de2be5f4ea28d629b2008131e5991 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 27 Jun 2024 12:04:58 -0500 Subject: [PATCH 37/58] fixing unit test --- beacon-chain/rpc/prysm/v1alpha1/node/server_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index 49dddfc94e54..fa1c6cf91b69 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -89,8 +89,8 @@ func TestNodeServer_GetImplementedServices(t *testing.T) { res, err := ns.ListImplementedServices(context.Background(), &emptypb.Empty{}) require.NoError(t, err) - // We verify the services include the node service + the registered reflection service. - assert.Equal(t, 2, len(res.Services)) + // We verify the services include the node service + the 2 registered reflection services. + assert.Equal(t, 3, len(res.Services)) } func TestNodeServer_GetHost(t *testing.T) { From ee8312611b6fe8404d113ee27f2dcd0d09f20ba7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 28 Jun 2024 10:40:47 -0500 Subject: [PATCH 38/58] fixing dependencies --- deps.bzl | 56 ++++++++++++++++++++++---------------------------------- go.mod | 7 ++++--- go.sum | 13 +++++++------ 3 files changed, 33 insertions(+), 43 deletions(-) diff --git a/deps.bzl b/deps.bzl index 1c3e00b5f3a4..8d354a14dfc9 100644 --- a/deps.bzl +++ b/deps.bzl @@ -493,14 +493,14 @@ def prysm_deps(): go_repository( name = "com_github_cncf_udpa_go", importpath = "github.com/cncf/udpa/go", - sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=", - version = "v0.0.0-20201120205902-5459f2c99403", + sum = "h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=", + version = "v0.0.0-20220112060539-c52dc94e7fbe", ) go_repository( name = "com_github_cncf_xds_go", importpath = "github.com/cncf/xds/go", - sum = "h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc=", - version = "v0.0.0-20240318125728-8a4994d93e50", + sum = "h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=", + version = "v0.0.0-20230607035331-e9ce68804cb4", ) go_repository( name = "com_github_cockroachdb_datadriven", @@ -801,14 +801,14 @@ def prysm_deps(): go_repository( name = "com_github_envoyproxy_go_control_plane", importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=", - version = "v0.12.0", + sum = "h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA=", + version = "v0.11.1-0.20230524094728-9239064ad72f", ) go_repository( name = "com_github_envoyproxy_protoc_gen_validate", importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=", - version = "v1.0.4", + sum = "h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=", + version = "v0.10.1", ) go_repository( name = "com_github_ethereum_c_kzg_4844", @@ -1215,8 +1215,8 @@ def prysm_deps(): go_repository( name = "com_github_golang_glog", importpath = "github.com/golang/glog", - sum = "h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=", - version = "v1.2.0", + sum = "h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=", + version = "v1.1.0", ) go_repository( name = "com_github_golang_groupcache", @@ -1331,8 +1331,8 @@ def prysm_deps(): go_repository( name = "com_github_google_uuid", importpath = "github.com/google/uuid", - sum = "h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=", - version = "v1.6.0", + sum = "h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=", + version = "v1.4.0", ) go_repository( name = "com_github_googleapis_gax_go", @@ -3753,14 +3753,14 @@ def prysm_deps(): go_repository( name = "com_google_cloud_go_compute", importpath = "cloud.google.com/go/compute", - sum = "h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU=", - version = "v1.25.1", + sum = "h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=", + version = "v1.20.1", ) go_repository( name = "com_google_cloud_go_compute_metadata", importpath = "cloud.google.com/go/compute/metadata", - sum = "h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=", - version = "v0.3.0", + sum = "h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=", + version = "v0.2.3", ) go_repository( name = "com_google_cloud_go_contactcenterinsights", @@ -4651,8 +4651,8 @@ def prysm_deps(): go_repository( name = "org_golang_google_appengine", importpath = "google.golang.org/appengine", - sum = "h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=", - version = "v1.6.8", + sum = "h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=", + version = "v1.6.7", ) go_repository( name = "org_golang_google_genproto", @@ -4660,24 +4660,12 @@ def prysm_deps(): sum = "h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=", version = "v0.0.0-20230410155749-daa745c078e1", ) - go_repository( - name = "org_golang_google_genproto_googleapis_api", - importpath = "google.golang.org/genproto/googleapis/api", - sum = "h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4=", - version = "v0.0.0-20240318140521-94a12d6c2237", - ) - go_repository( - name = "org_golang_google_genproto_googleapis_rpc", - importpath = "google.golang.org/genproto/googleapis/rpc", - sum = "h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=", - version = "v0.0.0-20240318140521-94a12d6c2237", - ) go_repository( name = "org_golang_google_grpc", build_file_proto_mode = "disable", importpath = "google.golang.org/grpc", - sum = "h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=", - version = "v1.64.0", + sum = "h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=", + version = "v1.56.3", ) go_repository( name = "org_golang_google_protobuf", @@ -4742,8 +4730,8 @@ def prysm_deps(): go_repository( name = "org_golang_x_oauth2", importpath = "golang.org/x/oauth2", - sum = "h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=", - version = "v0.20.0", + sum = "h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=", + version = "v0.16.0", ) go_repository( name = "org_golang_x_perf", diff --git a/go.mod b/go.mod index a8ef5c1669d4..88e14969a9f6 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.6.0 + github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.0 github.com/gostaticanalysis/comment v1.4.2 github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 @@ -93,7 +93,7 @@ require ( golang.org/x/sync v0.7.0 golang.org/x/tools v0.21.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.64.0 + google.golang.org/grpc v1.56.3 google.golang.org/protobuf v1.34.1 gopkg.in/d4l3k/messagediff.v1 v1.2.1 gopkg.in/yaml.v2 v2.4.0 @@ -250,7 +250,7 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect @@ -274,6 +274,7 @@ require ( github.com/prysmaticlabs/gohashtree v0.0.4-beta golang.org/x/sys v0.20.0 // indirect google.golang.org/api v0.44.0 // indirect + google.golang.org/appengine v1.6.7 // indirect k8s.io/klog/v2 v2.80.0 // indirect k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect ) diff --git a/go.sum b/go.sum index 86e9c7c94586..a0a0454d8b10 100644 --- a/go.sum +++ b/go.sum @@ -445,8 +445,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -1305,8 +1305,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20170517211232-f52d1811a629/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1573,6 +1573,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170918111702-1e559d0a00ee/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -1652,8 +1653,8 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From ae4dd2e36aa069141e9819ffe05760f3d847abb7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Mon, 1 Jul 2024 11:13:15 -0500 Subject: [PATCH 39/58] reverting unit test --- beacon-chain/rpc/prysm/v1alpha1/node/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go index fa1c6cf91b69..7d7be490b0e4 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go @@ -90,7 +90,7 @@ func TestNodeServer_GetImplementedServices(t *testing.T) { res, err := ns.ListImplementedServices(context.Background(), &emptypb.Empty{}) require.NoError(t, err) // We verify the services include the node service + the 2 registered reflection services. - assert.Equal(t, 3, len(res.Services)) + assert.Equal(t, 2, len(res.Services)) } func TestNodeServer_GetHost(t *testing.T) { From aa203995b30b486c8c382fb26364c3c2459bed25 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 2 Jul 2024 10:30:19 -0500 Subject: [PATCH 40/58] fixing conflict --- go.sum | 7 ------- 1 file changed, 7 deletions(-) diff --git a/go.sum b/go.sum index c8bba48c449e..95f963ce1b59 100644 --- a/go.sum +++ b/go.sum @@ -932,15 +932,8 @@ github.com/prysmaticlabs/fastssz v0.0.0-20240620202422-a981b8ef89d3/go.mod h1:h2 github.com/prysmaticlabs/go-bitfield v0.0.0-20210108222456-8e92c3709aa0/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e h1:ATgOe+abbzfx9kCPeXIW4fiWyDdxlwHw07j8UGhdTd4= github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4= -<<<<<<< gateway-removal -github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4= -github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs= -======= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1:VK7thFOnhxAZ/5aolr5Os4beiubuD08WiuiHyRqgwks= github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446 h1:4wctORg/1TkgLgXejv9yOSAm3cDBJxoTzl/RNuZmX28= -github.com/prysmaticlabs/grpc-gateway/v2 v2.3.1-0.20230315201114-09284ba20446/go.mod h1:IOyTYjcIO0rkmnGBfJTL0NJ11exy/Tc2QEuv7hCXp24= ->>>>>>> develop github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c h1:9PHRCuO/VN0s9k+RmLykho7AjDxblNYI5bYKed16NPU= github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c/go.mod h1:ZRws458tYHS/Zs936OQ6oCrL+Ict5O4Xpwve1UQ6C9M= github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU= From 4261decac2631db76b7450411d5e1a02f38975f0 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 28 Aug 2024 13:00:29 -0500 Subject: [PATCH 41/58] updating change log --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 939bfbd523e1..03d9990634ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,12 +23,15 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Electra: Updated block publishing beacon APIs to support Electra. - "Submitted builder validator registration settings for custom builders" log message moved to debug level. - config: Genesis validator root is now hardcoded in params.BeaconConfig() +- `grpc-gateway-host` is renamed to http-host. The old name can still be used as an alias. +- `grpc-gateway-port` is renamed to http-port. +- `grpc-gateway-corsdomain` is renamed to http-cors-domain. ### Deprecated - +- The `disable-grpc-gateway` flag. ### Removed - +- removed gRPC Gateway and gRPC versions of REST endpoints ( unused endpoints ) ### Fixed From afb9fb722d959827e26ebca888e4398dd6fac010 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:15:45 -0500 Subject: [PATCH 42/58] Update log.go Co-authored-by: Preston Van Loon --- api/server/httprest/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server/httprest/log.go b/api/server/httprest/log.go index 35e76f824c99..6208a403ea4d 100644 --- a/api/server/httprest/log.go +++ b/api/server/httprest/log.go @@ -2,4 +2,4 @@ package httprest import "github.com/sirupsen/logrus" -var log = logrus.WithField("prefix", "REST") +var log = logrus.WithField("prefix", "httprest") From ade93e273538cffbed9c57c062716313c8f986d6 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Wed, 28 Aug 2024 13:52:24 -0500 Subject: [PATCH 43/58] gaz --- validator/rpc/BUILD.bazel | 2 -- 1 file changed, 2 deletions(-) diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 80ef4c2d2510..999c04e854ab 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -43,7 +43,6 @@ go_library( "//io/file:go_default_library", "//io/logs:go_default_library", "//io/prompt:go_default_library", - "//monitoring/tracing:go_default_library", "//monitoring/tracing/trace:go_default_library", "//network/httputil:go_default_library", "//proto/prysm/v1alpha1:go_default_library", @@ -79,7 +78,6 @@ go_library( "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_tyler_smith_go_bip39//wordlists:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", - "@io_opencensus_go//plugin/ocgrpc:go_default_library", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//metadata:go_default_library", From 499144fbac4ac954680be1aca676c6c430db3af9 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:33:00 -0500 Subject: [PATCH 44/58] Update api/server/httprest/server.go Co-authored-by: Preston Van Loon --- api/server/httprest/server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 0d130b97bb3e..a70593defe20 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -64,8 +64,7 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { // Start the http rest service. func (g *Server) Start() { - _, cancel := context.WithCancel(g.ctx) - g.cancel = cancel + g.ctx, g.cancel := context.WithCancel(g.ctx) go func() { log.WithField("address", g.cfg.httpAddr).Info("Starting HTTP server") From 1810c0cdd076ef2f330478e9f2c93516a9c7c915 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 29 Aug 2024 17:38:48 -0500 Subject: [PATCH 45/58] addressing some feedback --- api/server/httprest/server.go | 2 +- api/server/httprest/server_test.go | 6 --- cmd/validator/flags/flags.go | 7 +--- cmd/validator/main.go | 1 - config/features/deprecated_flags.go | 12 +++++- ...ithub_grpc_ecosystem_grpc_gateway_v2.patch | 12 ------ ...cosystem_grpc_gateway_v2_fix_emptypb.patch | 22 ---------- ...c_ecosystem_grpc_gateway_v2_prysm_v5.patch | 40 ------------------- 8 files changed, 13 insertions(+), 89 deletions(-) delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch delete mode 100644 third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index a70593defe20..83ea4ed56cfb 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -64,7 +64,7 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { // Start the http rest service. func (g *Server) Start() { - g.ctx, g.cancel := context.WithCancel(g.ctx) + g.ctx, g.cancel = context.WithCancel(g.ctx) go func() { log.WithField("address", g.cfg.httpAddr).Info("Starting HTTP server") diff --git a/api/server/httprest/server_test.go b/api/server/httprest/server_test.go index 1e5756f098e4..9e9d90a89559 100644 --- a/api/server/httprest/server_test.go +++ b/api/server/httprest/server_test.go @@ -30,12 +30,6 @@ func TestServer_StartStop(t *testing.T) { opts := []Option{ WithHTTPAddr(address), - WithMuxHandler(func( - _ http.HandlerFunc, - _ http.ResponseWriter, - _ *http.Request, - ) { - }), WithRouter(mux.NewRouter()), } diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index 213d8edf2d62..fbacc9ca9752 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -35,12 +35,7 @@ var ( Usage: "Beacon node RPC provider endpoint.", Value: "127.0.0.1:4000", } - // Deprecated: DeprecatedBeaconRPCGatewayProviderFlag defines a beacon node JSON-RPC endpoint. - DeprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ - Name: "beacon-rpc-gateway-provider", - Usage: "Flag deprecated and unused", - Value: "127.0.0.1:3500", - } + // BeaconRESTApiProviderFlag defines a beacon node REST API endpoint. BeaconRESTApiProviderFlag = &cli.StringFlag{ Name: "beacon-rest-api-provider", diff --git a/cmd/validator/main.go b/cmd/validator/main.go index 139a97523b86..1177b960a1ea 100644 --- a/cmd/validator/main.go +++ b/cmd/validator/main.go @@ -50,7 +50,6 @@ func startNode(ctx *cli.Context) error { var appFlags = []cli.Flag{ flags.BeaconRPCProviderFlag, - flags.DeprecatedBeaconRPCGatewayProviderFlag, flags.BeaconRESTApiProviderFlag, flags.CertFlag, flags.GraffitiFlag, diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index ce04f877cff3..a3c4c05769e7 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -1,6 +1,8 @@ package features -import "github.com/urfave/cli/v2" +import ( + "github.com/urfave/cli/v2" +) // Deprecated flags list. const deprecatedUsage = "DEPRECATED. DO NOT USE." @@ -57,6 +59,13 @@ var ( Usage: deprecatedUsage, Hidden: true, } + + deprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ + Name: "beacon-rpc-gateway-provider", + Usage: "Flag deprecated and unused", + Value: "127.0.0.1:3500", + Hidden: true, + } ) // Deprecated flags for both the beacon node and validator client. @@ -71,6 +80,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedDisableEIP4881, deprecatedVerboseSigVerification, deprecatedEnableDebugRPCEndpoints, + deprecatedBeaconRPCGatewayProviderFlag, } // deprecatedBeaconFlags contains flags that are still used by other components diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch deleted file mode 100644 index e7b94f9794da..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2.patch +++ /dev/null @@ -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", - ], - ) - diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch deleted file mode 100644 index 707ee5da4b7c..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_fix_emptypb.patch +++ /dev/null @@ -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(` diff --git a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch b/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch deleted file mode 100644 index 8d568a4b1b26..000000000000 --- a/third_party/com_github_grpc_ecosystem_grpc_gateway_v2_prysm_v5.patch +++ /dev/null @@ -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{} - `)) - From fa7e259c7f7898ac521cef2cf3668e502e3d6498 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 29 Aug 2024 17:47:40 -0500 Subject: [PATCH 46/58] forgot to remove deprecated flag in usage --- cmd/validator/usage.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/validator/usage.go b/cmd/validator/usage.go index 2ba43a44736d..1341f797c037 100644 --- a/cmd/validator/usage.go +++ b/cmd/validator/usage.go @@ -157,12 +157,6 @@ var appHelpFlagGroups = []flagGroup{ flags.InteropStartIndex, }, }, - { - Name: "deprecated", - Flags: []cli.Flag{ - flags.DeprecatedBeaconRPCGatewayProviderFlag, - }, - }, } func init() { From 894ca7b72299a2e2d767dc7380af990b9e2cb628 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 29 Aug 2024 21:47:50 -0500 Subject: [PATCH 47/58] gofmt --- config/features/deprecated_flags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index 74accfe201e0..c8c6b04abced 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -64,8 +64,8 @@ var ( Name: "beacon-rpc-gateway-provider", Usage: "Flag deprecated and unused", Value: "127.0.0.1:3500", - Hidden: true, - } + Hidden: true, + } deprecatedEnableExperimentalState = &cli.BoolFlag{ Name: "enable-experimental-state", From 097bafb4824a5b481266e2ac9ecd8ddc9ae4ab24 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Thu, 29 Aug 2024 22:09:46 -0500 Subject: [PATCH 48/58] fixing test --- config/features/deprecated_flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index c8c6b04abced..3a1234572665 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -62,7 +62,7 @@ var ( deprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ Name: "beacon-rpc-gateway-provider", - Usage: "Flag deprecated and unused", + Usage: deprecatedUsage, Value: "127.0.0.1:3500", Hidden: true, } From 95c157028274636ee00f439e163c47c304bc7748 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 30 Aug 2024 10:01:52 -0500 Subject: [PATCH 49/58] fixing deepsource issue --- beacon-chain/node/node_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/node/node_test.go b/beacon-chain/node/node_test.go index 3cf022226a46..c27d0788e7d8 100644 --- a/beacon-chain/node/node_test.go +++ b/beacon-chain/node/node_test.go @@ -262,7 +262,7 @@ func TestCORS(t *testing.T) { router := newRouter(cliCtx) // Ensure a test route exists - router.HandleFunc("/some-path", func(w http.ResponseWriter, r *http.Request) { + router.HandleFunc("/some-path", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) }).Methods(http.MethodGet) From 3dac48b726ba2875f3a6b68aa6f1b5ecb4c84362 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 30 Aug 2024 16:11:14 -0500 Subject: [PATCH 50/58] moving deprecated flag and adding timeout handler --- api/server/httprest/server.go | 11 +++++++---- cmd/beacon-chain/flags/base.go | 6 +----- cmd/beacon-chain/usage.go | 1 - config/features/deprecated_flags.go | 7 +++++++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 83ea4ed56cfb..7ad28fe051e1 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -47,15 +47,18 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { return nil, err } } - if g.cfg.router == nil { return nil, errors.New("router option not configured") } - - // TODO: actually use the timeout config provided + var handler http.Handler + if g.cfg.timeout > 10 { + handler = http.TimeoutHandler(g.cfg.router, g.cfg.timeout, "request timed out") + } else { + handler = g.cfg.router + } g.server = &http.Server{ Addr: g.cfg.httpAddr, - Handler: g.cfg.router, + Handler: handler, ReadHeaderTimeout: time.Second, } diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 6349c509bc2d..43869416e3af 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -118,11 +118,7 @@ var ( Usage: "Comma-separated list of API module names. Possible values: `" + PrysmAPIModule + `,` + EthAPIModule + "`.", Value: PrysmAPIModule + `,` + EthAPIModule, } - // Deprecated: DeprecatedDisableGRPCGateway for JSON-HTTP requests to the beacon node. - DeprecatedDisableGRPCGateway = &cli.BoolFlag{ - Name: "disable-grpc-gateway", - Usage: "Flag deprecated and unused", - } + // HTTPServerHost specifies a HTTP server host for the validator client. HTTPServerHost = &cli.StringFlag{ Name: "http-host", diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index a20d85704a8b..5ac63e8f4baf 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -196,7 +196,6 @@ var appHelpFlagGroups = []flagGroup{ Name: "deprecated", Flags: []cli.Flag{ cmd.BackupWebhookOutputDir, - flags.DeprecatedDisableGRPCGateway, }, }, } diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index 3a1234572665..dd32ef79f1a6 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -67,6 +67,12 @@ var ( Hidden: true, } + deprecatedDisableGRPCGateway = &cli.BoolFlag{ + Name: "disable-grpc-gateway", + Usage: "Flag deprecated and unused", + Hidden: true, + } + deprecatedEnableExperimentalState = &cli.BoolFlag{ Name: "enable-experimental-state", Usage: deprecatedUsage, @@ -87,6 +93,7 @@ var deprecatedFlags = []cli.Flag{ deprecatedVerboseSigVerification, deprecatedEnableDebugRPCEndpoints, deprecatedBeaconRPCGatewayProviderFlag, + deprecatedDisableGRPCGateway, deprecatedEnableExperimentalState, } From 362f3f0514156433df91473cdd30b0db792e5db7 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 30 Aug 2024 16:19:07 -0500 Subject: [PATCH 51/58] missed removal of a flag --- cmd/beacon-chain/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index 97a6de90240c..57eb8928ac41 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -49,7 +49,6 @@ var appFlags = []cli.Flag{ flags.CertFlag, flags.KeyFlag, flags.HTTPModules, - flags.DeprecatedDisableGRPCGateway, flags.HTTPServerHost, flags.HTTPServerPort, flags.HTTPServerCorsDomain, From 1ba0ac903afb480ce0ae04217de673dd9155e9cc Mon Sep 17 00:00:00 2001 From: james-prysm Date: Fri, 30 Aug 2024 16:46:08 -0500 Subject: [PATCH 52/58] fixing test: --- config/features/deprecated_flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index dd32ef79f1a6..c5df002d9200 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -69,7 +69,7 @@ var ( deprecatedDisableGRPCGateway = &cli.BoolFlag{ Name: "disable-grpc-gateway", - Usage: "Flag deprecated and unused", + Usage: deprecatedUsage, Hidden: true, } From 0169f1f0af72f3f5a284a1a3de84f1beeafb05b5 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:36:33 -0500 Subject: [PATCH 53/58] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RadosÅ‚aw Kapka --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46addb79e5d2..5e796910688f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `--enable-experimental-state` flag is deprecated. This feature is now on by default. Opt-out with `--disable-experimental-state`. ### Removed -- removed gRPC Gateway and gRPC versions of REST endpoints ( unused endpoints ) +- removed gRPC Gateway ### Fixed From 24425894e848d046b5c32cc3aa2a6ce0ad10190d Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 3 Sep 2024 15:18:19 -0500 Subject: [PATCH 54/58] addressing feedback --- api/server/httprest/options.go | 3 +++ cmd/beacon-chain/flags/base.go | 15 ++++++++++++++- config/features/deprecated_flags.go | 1 - testing/validator-mock/validator_client_mock.go | 4 ++-- .../beacon-api/mock/json_rest_handler_mock.go | 4 ++-- validator/node/node.go | 4 ++-- validator/rpc/auth_token.go | 2 +- validator/rpc/server.go | 16 ++++++++-------- 8 files changed, 32 insertions(+), 17 deletions(-) diff --git a/api/server/httprest/options.go b/api/server/httprest/options.go index 97a22e01a268..9b5bb3157e10 100644 --- a/api/server/httprest/options.go +++ b/api/server/httprest/options.go @@ -6,8 +6,10 @@ import ( "github.com/gorilla/mux" ) +// Option --. type Option func(g *Server) error +// WithMuxHandler --. func WithMuxHandler(m httpHandler) Option { return func(g *Server) error { g.cfg.handler = m @@ -15,6 +17,7 @@ func WithMuxHandler(m httpHandler) Option { } } +// WithHTTPAddr --. func WithHTTPAddr(addr string) Option { return func(g *Server) error { g.cfg.httpAddr = addr diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 43869416e3af..70a851fc9669 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -3,11 +3,24 @@ package flags import ( + "strings" + "github.com/prysmaticlabs/prysm/v5/cmd" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/urfave/cli/v2" ) +var ( + DefaultWebDomains = []string{"http://localhost:4200", "http://127.0.0.1:4200", "http://0.0.0.0:4200"} + DefaultHTTPServerDomains = []string{"http://localhost:7500", "http://127.0.0.1:7500", "http://0.0.0.0:7500"} + DefaultHTTPCorsDomains = func() []string { + s := []string{"http://localhost:3000", "http://0.0.0.0:3000", "http://127.0.0.1:3000"} + s = append(s, DefaultWebDomains...) + s = append(s, DefaultHTTPServerDomains...) + return s + }() +) + var ( // MevRelayEndpoint provides an HTTP access endpoint to a MEV builder network. MevRelayEndpoint = &cli.StringFlag{ @@ -137,7 +150,7 @@ var ( HTTPServerCorsDomain = &cli.StringFlag{ Name: "http-cors-domain", Usage: "Comma separated list of domains from which to accept cross origin requests.", - Value: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000", + Value: strings.Join(DefaultHTTPCorsDomains, ", "), Aliases: []string{"grpc-gateway-corsdomain"}, } diff --git a/config/features/deprecated_flags.go b/config/features/deprecated_flags.go index c5df002d9200..d5754bcff61c 100644 --- a/config/features/deprecated_flags.go +++ b/config/features/deprecated_flags.go @@ -63,7 +63,6 @@ var ( deprecatedBeaconRPCGatewayProviderFlag = &cli.StringFlag{ Name: "beacon-rpc-gateway-provider", Usage: deprecatedUsage, - Value: "127.0.0.1:3500", Hidden: true, } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index cd4f21b5b044..afbe08b5e2a3 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -181,7 +181,7 @@ func (mr *MockValidatorClientMockRecorder) FeeRecipientByPubKey(arg0, arg1 any) // Host mocks base method. func (m *MockValidatorClient) Host() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Host") + ret := m.ctrl.Call(m, "HTTPHost") ret0, _ := ret[0].(string) return ret0 } @@ -189,7 +189,7 @@ func (m *MockValidatorClient) Host() string { // Host indicates an expected call of Host. func (mr *MockValidatorClientMockRecorder) Host() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockValidatorClient)(nil).Host)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HTTPHost", reflect.TypeOf((*MockValidatorClient)(nil).Host)) } // MultipleValidatorStatus mocks base method. diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index 1e2e98499cd3..33722c5bb9e5 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -58,7 +58,7 @@ func (mr *MockJsonRestHandlerMockRecorder) Get(ctx, endpoint, resp any) *gomock. // Host mocks base method. func (m *MockJsonRestHandler) Host() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Host") + ret := m.ctrl.Call(m, "HTTPHost") ret0, _ := ret[0].(string) return ret0 } @@ -66,7 +66,7 @@ func (m *MockJsonRestHandler) Host() string { // Host indicates an expected call of Host. func (mr *MockJsonRestHandlerMockRecorder) Host() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HTTPHost", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) } // HttpClient mocks base method. diff --git a/validator/node/node.go b/validator/node/node.go index 670d8ab5138f..7301057001d7 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -606,8 +606,8 @@ func (c *ValidatorClient) registerRPCService(router *mux.Router) error { port := c.cliCtx.Int(flags.HTTPServerPort.Name) s := rpc.NewServer(c.cliCtx.Context, &rpc.Config{ - Host: host, - Port: port, + HTTPHost: host, + HTTPPort: port, GRPCMaxCallRecvMsgSize: c.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name), GRPCRetries: c.cliCtx.Uint(flags.GRPCRetriesFlag.Name), GRPCRetryDelay: c.cliCtx.Duration(flags.GRPCRetryDelayFlag.Name), diff --git a/validator/rpc/auth_token.go b/validator/rpc/auth_token.go index 0f85ec970557..df67fae07965 100644 --- a/validator/rpc/auth_token.go +++ b/validator/rpc/auth_token.go @@ -104,7 +104,7 @@ func (s *Server) refreshAuthTokenFromFileChanges(ctx context.Context, authTokenP log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) continue } - validatorWebAddr := fmt.Sprintf("%s:%d", s.host, s.port) + validatorWebAddr := fmt.Sprintf("%s:%d", s.httpHost, s.httpPort) logValidatorWebAuth(validatorWebAddr, s.authToken, authTokenPath) case err := <-watcher.Errors: log.WithError(err).Errorf("Could not watch for file changes for: %s", authTokenPath) diff --git a/validator/rpc/server.go b/validator/rpc/server.go index a51cf13c2177..25ffe8c21a9e 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -25,8 +25,8 @@ import ( // Config options for the HTTP server. type Config struct { - Host string // http host, not grpc - Port int // http port, not grpc + HTTPHost string + HTTPPort int GRPCMaxCallRecvMsgSize int GRPCRetries uint GRPCRetryDelay time.Duration @@ -48,8 +48,8 @@ type Config struct { type Server struct { ctx context.Context cancel context.CancelFunc - host string // http host, not grpc - port int // http port, not grpc + httpHost string + httpPort int server *httprest.Server grpcMaxCallRecvMsgSize int grpcRetries uint @@ -86,8 +86,8 @@ func NewServer(ctx context.Context, cfg *Config) *Server { cancel: cancel, logStreamer: logs.NewStreamServer(), logStreamerBufferSize: 1000, // Enough to handle most bursts of logs in the validator client. - host: cfg.Host, - port: cfg.Port, + httpHost: cfg.HTTPHost, + httpPort: cfg.HTTPPort, grpcMaxCallRecvMsgSize: cfg.GRPCMaxCallRecvMsgSize, grpcRetries: cfg.GRPCRetries, grpcRetryDelay: cfg.GRPCRetryDelay, @@ -113,7 +113,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { if err := server.initializeAuthToken(); err != nil { log.WithError(err).Error("Could not initialize web auth token") } - validatorWebAddr := fmt.Sprintf("%s:%d", server.host, server.port) + validatorWebAddr := fmt.Sprintf("%s:%d", server.httpHost, server.httpPort) logValidatorWebAuth(validatorWebAddr, server.authToken, server.authTokenPath) go server.refreshAuthTokenFromFileChanges(server.ctx, server.authTokenPath) } @@ -129,7 +129,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { opts := []httprest.Option{ httprest.WithRouter(cfg.Router), - httprest.WithHTTPAddr(net.JoinHostPort(server.host, fmt.Sprintf("%d", server.port))), + httprest.WithHTTPAddr(net.JoinHostPort(server.httpHost, fmt.Sprintf("%d", server.httpPort))), } // create and set a new http server s, err := httprest.New(server.ctx, opts...) From 72dddf20dc000342e7c074eeeb97a1313eb73533 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 3 Sep 2024 16:15:18 -0500 Subject: [PATCH 55/58] updating comments based on feedback --- api/server/httprest/options.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/api/server/httprest/options.go b/api/server/httprest/options.go index 9b5bb3157e10..96548c28da46 100644 --- a/api/server/httprest/options.go +++ b/api/server/httprest/options.go @@ -6,18 +6,10 @@ import ( "github.com/gorilla/mux" ) -// Option --. +// Option is a http rest server functional parameter type. type Option func(g *Server) error -// WithMuxHandler --. -func WithMuxHandler(m httpHandler) Option { - return func(g *Server) error { - g.cfg.handler = m - return nil - } -} - -// WithHTTPAddr --. +// WithHTTPAddr sets the full address ( host and port ) of the server. func WithHTTPAddr(addr string) Option { return func(g *Server) error { g.cfg.httpAddr = addr @@ -25,7 +17,7 @@ func WithHTTPAddr(addr string) Option { } } -// WithRouter --. +// WithRouter sets the internal router of the server, this is required. func WithRouter(r *mux.Router) Option { return func(g *Server) error { g.cfg.router = r From 87aad1665cef806e268553178188e455a2f7690b Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 3 Sep 2024 16:19:49 -0500 Subject: [PATCH 56/58] removing unused field for now, we can add it back in if we need to use the option --- api/server/httprest/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 7ad28fe051e1..a242c1f96057 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -22,7 +22,6 @@ type httpHandler func( // Config parameters for setting up the http-rest service. type config struct { httpAddr string - handler httpHandler router *mux.Router timeout time.Duration } From 23493b706bba2aebc78d66c3e4ea14b247130c32 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 3 Sep 2024 16:20:16 -0500 Subject: [PATCH 57/58] removing unused struct --- api/server/httprest/server.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index a242c1f96057..455f016557aa 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -12,13 +12,6 @@ import ( var _ runtime.Service = (*Server)(nil) -// httpHandler is a functional interface that implements the http handler functionality. -type httpHandler func( - h http.HandlerFunc, - w http.ResponseWriter, - req *http.Request, -) - // Config parameters for setting up the http-rest service. type config struct { httpAddr string From e9d53cdc3898153b552c30c370d2f2d7796d4d28 Mon Sep 17 00:00:00 2001 From: james-prysm Date: Tue, 3 Sep 2024 17:16:33 -0500 Subject: [PATCH 58/58] changing api-timeout flag based on feedback --- CHANGELOG.md | 1 + api/server/httprest/options.go | 4 ++-- api/server/httprest/server.go | 6 ++++-- beacon-chain/node/node.go | 5 +++-- cmd/flags.go | 5 +++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 959c61a8a1f0..667ea9ce90ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - `grpc-gateway-host` is renamed to http-host. The old name can still be used as an alias. - `grpc-gateway-port` is renamed to http-port. - `grpc-gateway-corsdomain` is renamed to http-cors-domain. +- `api-timeout` is changed from int flag to duration flag, default value updated. ### Deprecated - `--disable-grpc-gateway` flag is deprecated due to grpc gateway removal. diff --git a/api/server/httprest/options.go b/api/server/httprest/options.go index 96548c28da46..87b4764ae7aa 100644 --- a/api/server/httprest/options.go +++ b/api/server/httprest/options.go @@ -26,9 +26,9 @@ func WithRouter(r *mux.Router) Option { } // WithTimeout allows changing the timeout value for API calls. -func WithTimeout(seconds uint64) Option { +func WithTimeout(duration time.Duration) Option { return func(g *Server) error { - g.cfg.timeout = time.Second * time.Duration(seconds) + g.cfg.timeout = duration return nil } } diff --git a/api/server/httprest/server.go b/api/server/httprest/server.go index 455f016557aa..2e8f907a6478 100644 --- a/api/server/httprest/server.go +++ b/api/server/httprest/server.go @@ -43,7 +43,9 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { return nil, errors.New("router option not configured") } var handler http.Handler - if g.cfg.timeout > 10 { + defaultReadHeaderTimeout := time.Second + if g.cfg.timeout > 0*time.Second { + defaultReadHeaderTimeout = g.cfg.timeout handler = http.TimeoutHandler(g.cfg.router, g.cfg.timeout, "request timed out") } else { handler = g.cfg.router @@ -51,7 +53,7 @@ func New(ctx context.Context, opts ...Option) (*Server, error) { g.server = &http.Server{ Addr: g.cfg.httpAddr, Handler: handler, - ReadHeaderTimeout: time.Second, + ReadHeaderTimeout: defaultReadHeaderTimeout, } return g, nil diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index 6add00617a79..be52d679a954 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -1047,11 +1047,12 @@ func (b *BeaconNode) registerHTTPService(router *mux.Router) error { host := b.cliCtx.String(flags.HTTPServerHost.Name) port := b.cliCtx.Int(flags.HTTPServerPort.Name) address := net.JoinHostPort(host, strconv.Itoa(port)) - timeout := b.cliCtx.Int(cmd.ApiTimeoutFlag.Name) opts := []httprest.Option{ httprest.WithRouter(router), httprest.WithHTTPAddr(address), - httprest.WithTimeout(uint64(timeout)), + } + if b.cliCtx.IsSet(cmd.ApiTimeoutFlag.Name) { + opts = append(opts, httprest.WithTimeout(b.cliCtx.Duration(cmd.ApiTimeoutFlag.Name))) } g, err := httprest.New(b.ctx, opts...) if err != nil { diff --git a/cmd/flags.go b/cmd/flags.go index bd7d135f6a0f..6c1c44e8d947 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -6,6 +6,7 @@ import ( "math" "slices" "strings" + "time" "github.com/prysmaticlabs/prysm/v5/config/params" "github.com/urfave/cli/v2" @@ -267,10 +268,10 @@ var ( Value: DefaultDataDir(), } // ApiTimeoutFlag specifies the timeout value for API requests in seconds. A timeout of zero means no timeout. - ApiTimeoutFlag = &cli.IntFlag{ + ApiTimeoutFlag = &cli.DurationFlag{ Name: "api-timeout", Usage: "Specifies the timeout value for API requests in seconds.", - Value: 120, + Value: 10 * time.Second, } // JwtOutputFileFlag specifies the JWT file path that gets generated into when invoked by generate-jwt-secret. JwtOutputFileFlag = &cli.StringFlag{