Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rules_go and fix proto conflicts #8596

Merged
merged 6 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ bazel_skylib_workspace()

http_archive(
name = "bazel_gazelle",
sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
],
)

Expand All @@ -89,10 +89,10 @@ http_archive(
# nogo check fails for certain third_party dependencies.
"//third_party:io_bazel_rules_go.patch",
],
sha256 = "52d0a57ea12139d727883c2fef03597970b89f2cc2a05722c42d1d7d41ec065b",
sha256 = "7c10271940c6bce577d51a075ae77728964db285dac0a46614a7934dc34303e6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.0.tar.gz",
],
)

Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/state/stateutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ go_test(
name = "go_default_test",
size = "small",
srcs = ["validator_index_map_test.go"],
embed = [":go_default_library"],
deps = [
":go_default_library",
"//beacon-chain/state:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/bytesutil:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/p2p/peers/peerdata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ go_library(
go_test(
name = "go_default_test",
srcs = ["store_test.go"],
embed = [":go_default_library"],
deps = [
":go_default_library",
"//shared/testutil/assert:go_default_library",
"//shared/testutil/require:go_default_library",
"@com_github_libp2p_go_libp2p_core//peer:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/p2p/peers/scorers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ go_test(
"scorers_test.go",
"service_test.go",
],
embed = [":go_default_library"],
deps = [
":go_default_library",
"//beacon-chain/p2p/peers:go_default_library",
"//beacon-chain/p2p/peers/peerdata:go_default_library",
"//beacon-chain/p2p/types:go_default_library",
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/debug/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ go_library(
"//shared/bytesutil:go_default_library",
"//shared/params:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
"@com_github_gogo_protobuf//types:go_default_library",
"@com_github_ipfs_go_log_v2//:go_default_library",
"@com_github_libp2p_go_libp2p_core//network:go_default_library",
"@com_github_libp2p_go_libp2p_core//peer:go_default_library",
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
Expand All @@ -58,9 +58,9 @@ go_test(
"//shared/testutil:go_default_library",
"//shared/testutil/assert:go_default_library",
"//shared/testutil/require:go_default_library",
"@com_github_gogo_protobuf//types:go_default_library",
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
],
)
4 changes: 2 additions & 2 deletions beacon-chain/rpc/debug/forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"encoding/hex"

ptypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
pbrpc "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
)

// GetProtoArrayForkChoice returns proto array fork choice store.
func (ds *Server) GetProtoArrayForkChoice(_ context.Context, _ *ptypes.Empty) (*pbrpc.ProtoArrayForkChoiceResponse, error) {
func (ds *Server) GetProtoArrayForkChoice(_ context.Context, _ *empty.Empty) (*pbrpc.ProtoArrayForkChoiceResponse, error) {
store := ds.HeadFetcher.ProtoArrayStore()

nodes := store.Nodes()
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/debug/forkchoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

ptypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
mock "github.com/prysmaticlabs/prysm/beacon-chain/blockchain/testing"
"github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/protoarray"
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
Expand All @@ -14,7 +14,7 @@ import (
func TestServer_GetForkChoice(t *testing.T) {
store := &protoarray.Store{}
bs := &Server{HeadFetcher: &mock.ChainService{ForkChoiceStore: store}}
res, err := bs.GetProtoArrayForkChoice(context.Background(), &ptypes.Empty{})
res, err := bs.GetProtoArrayForkChoice(context.Background(), &empty.Empty{})
require.NoError(t, err)
assert.Equal(t, store.PruneThreshold(), res.PruneThreshold, "Did not get wanted prune threshold")
assert.Equal(t, store.JustifiedEpoch(), res.JustifiedEpoch, "Did not get wanted justified epoch")
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/debug/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package debug
import (
"context"

"github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
Expand All @@ -24,7 +24,7 @@ func (ds *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*pbrpc

// ListPeers returns all peers known to the host node, irregardless of if they are connected/
// disconnected.
func (ds *Server) ListPeers(_ context.Context, _ *types.Empty) (*pbrpc.DebugPeerResponses, error) {
func (ds *Server) ListPeers(_ context.Context, _ *empty.Empty) (*pbrpc.DebugPeerResponses, error) {
var responses []*pbrpc.DebugPeerResponse
for _, pid := range ds.PeersFetcher.Peers().All() {
resp, err := ds.getPeer(pid)
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/debug/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

ptypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
mockP2p "github.com/prysmaticlabs/prysm/beacon-chain/p2p/testing"
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
Expand Down Expand Up @@ -36,7 +36,7 @@ func TestDebugServer_ListPeers(t *testing.T) {
PeerManager: &mockP2p.MockPeerManager{BHost: mP2P.BHost},
}

res, err := ds.ListPeers(context.Background(), &ptypes.Empty{})
res, err := ds.ListPeers(context.Background(), &empty.Empty{})
require.NoError(t, err)
assert.Equal(t, 2, len(res.Responses))

Expand Down
6 changes: 3 additions & 3 deletions beacon-chain/rpc/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"

gethlog "github.com/ethereum/go-ethereum/log"
ptypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
golog "github.com/ipfs/go-log/v2"
"github.com/prysmaticlabs/prysm/beacon-chain/blockchain"
"github.com/prysmaticlabs/prysm/beacon-chain/db"
Expand All @@ -34,7 +34,7 @@ type Server struct {

// SetLoggingLevel of a beacon node according to a request type,
// either INFO, DEBUG, or TRACE.
func (ds *Server) SetLoggingLevel(_ context.Context, req *pbrpc.LoggingLevelRequest) (*ptypes.Empty, error) {
func (ds *Server) SetLoggingLevel(_ context.Context, req *pbrpc.LoggingLevelRequest) (*empty.Empty, error) {
var verbosity string
switch req.Level {
case pbrpc.LoggingLevelRequest_INFO:
Expand All @@ -59,5 +59,5 @@ func (ds *Server) SetLoggingLevel(_ context.Context, req *pbrpc.LoggingLevelRequ
glogger.Verbosity(gethlog.LvlTrace)
gethlog.Root().SetHandler(glogger)
}
return &ptypes.Empty{}, nil
return &empty.Empty{}, nil
}
1 change: 1 addition & 0 deletions beacon-chain/rpc/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ go_library(
"@com_github_libp2p_go_libp2p_core//network:go_default_library",
"@com_github_libp2p_go_libp2p_core//peer:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion beacon-chain/rpc/node/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

ptypes "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/ptypes/empty"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
Expand Down Expand Up @@ -222,7 +223,7 @@ func (ns *Server) ListPeers(ctx context.Context, _ *ptypes.Empty) (*ethpb.Peers,
}

// StreamBeaconLogs from the beacon node via a gRPC server-side stream.
func (ns *Server) StreamBeaconLogs(_ *ptypes.Empty, stream pb.Health_StreamBeaconLogsServer) error {
func (ns *Server) StreamBeaconLogs(_ *empty.Empty, stream pb.Health_StreamBeaconLogsServer) error {
ch := make(chan []byte, ns.StreamLogsBufferSize)
sub := ns.LogsStreamer.LogsFeed().Subscribe(ch)
defer func() {
Expand Down
2 changes: 1 addition & 1 deletion contracts/deposit-contract/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ go_test(
"depositContract_test.go",
"deposit_tree_test.go",
],
embed = [":go_default_library"],
deps = [
":go_default_library",
"//shared/interop:go_default_library",
"//shared/params:go_default_library",
"//shared/testutil/assert:go_default_library",
Expand Down
26 changes: 14 additions & 12 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ def prysm_deps():
go_repository(
name = "com_github_cncf_udpa_go",
importpath = "github.com/cncf/udpa/go",
sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=",
version = "v0.0.0-20191209042840-269d4d468f6f",
sum = "h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=",
version = "v0.0.0-20201120205902-5459f2c99403",
)
go_repository(
name = "com_github_cockroachdb_datadriven",
Expand Down Expand Up @@ -684,8 +684,8 @@ def prysm_deps():
go_repository(
name = "com_github_envoyproxy_go_control_plane",
importpath = "github.com/envoyproxy/go-control-plane",
sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=",
version = "v0.9.4",
sum = "h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE=",
version = "v0.9.9-0.20201210154907-fd9021fe5dad",
)
go_repository(
name = "com_github_envoyproxy_protoc_gen_validate",
Expand All @@ -698,7 +698,7 @@ def prysm_deps():
# Note: The keep directives help gazelle leave this alone.
go_repository(
name = "com_github_ethereum_go_ethereum",
commit = "71d15f72c132cfacad9df510f722e892c5263a1d", # keep
commit = "b9c0d847ae7b07a9a86b81aebacf986c8d310ae7", # keep
importpath = "github.com/ethereum/go-ethereum", # keep
# Note: go-ethereum is not bazel-friendly with regards to cgo. We have a
# a fork that has resolved these issues by disabling HID/USB support and
Expand Down Expand Up @@ -962,6 +962,8 @@ def prysm_deps():
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
patch_args = ["-p1"],
patches = ["@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch"],
sum = "h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=",
version = "v1.4.3",
)
Expand Down Expand Up @@ -1119,8 +1121,8 @@ def prysm_deps():
go_repository(
name = "com_github_grpc_ecosystem_grpc_gateway",
importpath = "github.com/grpc-ecosystem/grpc-gateway",
sum = "h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o=",
version = "v1.14.6",
sum = "h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=",
version = "v1.16.0",
)
go_repository(
name = "com_github_gxed_hashland_keccakpg",
Expand Down Expand Up @@ -2577,8 +2579,8 @@ def prysm_deps():
name = "com_github_prysmaticlabs_ethereumapis",
build_file_generation = "off",
importpath = "github.com/prysmaticlabs/ethereumapis",
sum = "h1:WbNiB9+NFslsXtM8mjOEjcsSbedl+06eGBkW7zvSynE=",
version = "v0.0.0-20210303155523-663cc605c7d9",
sum = "h1:6qCWUpx87Ahd+GqthQz4k1wLLI2K5yJQ7kwvrs1+zzg=",
version = "v0.0.0-20210311175904-cf9f64632dd4",
)
go_repository(
name = "com_github_prysmaticlabs_go_bitfield",
Expand Down Expand Up @@ -3507,10 +3509,10 @@ def prysm_deps():

go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable_global",
build_file_proto_mode = "disable",
importpath = "google.golang.org/grpc",
sum = "h1:DGeFlSan2f+WEtCERJ4J9GJWk15TxUi8QGagfI87Xyc=",
version = "v1.33.1",
sum = "h1:o1bcQ6imQMIOpdrO3SWf2z5RV72WbDwdXuK0MDlc8As=",
version = "v1.36.0",
)
go_repository(
name = "org_golang_google_protobuf",
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/graph-gophers/graphql-go v0.0.0-20200309224638-dae41bde9ef9 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.14.6
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/golang-lru v0.5.4
github.com/herumi/bls-eth-go-binary v0.0.0-20210130185500-57372fb27371
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20200424224625-be1b05b0b279
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/prometheus/procfs v0.3.0 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/prysmaticlabs/eth2-types v0.0.0-20210219172114-1da477c09a06
github.com/prysmaticlabs/ethereumapis v0.0.0-20210303155523-663cc605c7d9
github.com/prysmaticlabs/ethereumapis v0.0.0-20210311175904-cf9f64632dd4
github.com/prysmaticlabs/go-bitfield v0.0.0-20210202205921-7fcea7c45dc8
github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c
github.com/rs/cors v1.7.0
Expand Down Expand Up @@ -113,7 +113,7 @@ require (
google.golang.org/api v0.34.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20201026171402-d4b8fe4fd877
google.golang.org/grpc v1.33.1
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.0
gopkg.in/confluentinc/confluent-kafka-go.v1 v1.4.2
gopkg.in/d4l3k/messagediff.v1 v1.2.1
Expand All @@ -126,6 +126,6 @@ require (
k8s.io/utils v0.0.0-20200520001619-278ece378a50 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20210222122116-71d15f72c132
replace github.com/ethereum/go-ethereum => github.com/prysmaticlabs/bazel-go-ethereum v0.0.0-20210311182818-b9c0d847ae7b

replace github.com/json-iterator/go => github.com/prestonvanloon/go v1.1.7-0.20190722034630-4f2e55fcf87b
Loading