From 1edf1f4c87cd9b6d4d45cef7781b91f7bde90b3d Mon Sep 17 00:00:00 2001 From: terence tsao Date: Fri, 2 Jul 2021 08:54:52 -0700 Subject: [PATCH] Restructure RPC packages to be future compatible (#9136) Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/rpc/BUILD.bazel | 16 +++++----- beacon-chain/rpc/apimiddleware/BUILD.bazel | 4 +-- .../rpc/apimiddleware/custom_handlers.go | 14 ++++---- .../rpc/apimiddleware/custom_handlers_test.go | 4 +-- .../{beaconv1 => eth/v1/beacon}/BUILD.bazel | 2 +- .../rpc/{beaconv1 => eth/v1/beacon}/blocks.go | 2 +- .../v1/beacon}/blocks_test.go | 2 +- .../rpc/{beaconv1 => eth/v1/beacon}/config.go | 2 +- .../v1/beacon}/config_test.go | 2 +- .../rpc/{ => eth/v1}/beacon/init_test.go | 0 .../rpc/{beaconv1 => eth/v1/beacon}/log.go | 2 +- .../rpc/{beaconv1 => eth/v1/beacon}/pool.go | 2 +- .../{beaconv1 => eth/v1/beacon}/pool_test.go | 2 +- .../rpc/{beaconv1 => eth/v1/beacon}/server.go | 2 +- .../v1/beacon}/server_test.go | 2 +- .../rpc/{beaconv1 => eth/v1/beacon}/state.go | 2 +- .../{beaconv1 => eth/v1/beacon}/state_test.go | 2 +- .../{beaconv1 => eth/v1/beacon}/validator.go | 2 +- .../v1/beacon}/validator_test.go | 2 +- .../rpc/{debugv1 => eth/v1/debug}/BUILD.bazel | 2 +- .../rpc/{debugv1 => eth/v1/debug}/debug.go | 2 +- .../{debugv1 => eth/v1/debug}/debug_test.go | 2 +- .../rpc/{debugv1 => eth/v1/debug}/server.go | 2 +- .../{eventsv1 => eth/v1/events}/BUILD.bazel | 2 +- .../rpc/{eventsv1 => eth/v1/events}/events.go | 2 +- .../v1/events}/events_test.go | 2 +- .../rpc/{eventsv1 => eth/v1/events}/server.go | 2 +- .../rpc/{nodev1 => eth/v1/node}/BUILD.bazel | 2 +- .../rpc/{nodev1 => eth/v1/node}/node.go | 2 +- .../rpc/{nodev1 => eth/v1/node}/node_test.go | 2 +- .../rpc/{nodev1 => eth/v1/node}/server.go | 2 +- .../{nodev1 => eth/v1/node}/server_test.go | 2 +- .../{ => prysm/v1alpha1}/beacon/BUILD.bazel | 2 +- .../v1alpha1}/beacon/assignments.go | 0 .../v1alpha1}/beacon/assignments_test.go | 0 .../v1alpha1}/beacon/attestations.go | 0 .../v1alpha1}/beacon/attestations_test.go | 0 .../v1alpha1}/beacon/beacon_test.go | 0 .../rpc/{ => prysm/v1alpha1}/beacon/blocks.go | 0 .../v1alpha1}/beacon/blocks_test.go | 0 .../{ => prysm/v1alpha1}/beacon/committees.go | 0 .../v1alpha1}/beacon/committees_test.go | 0 .../rpc/{ => prysm/v1alpha1}/beacon/config.go | 0 .../v1alpha1}/beacon/config_test.go | 0 .../v1alpha1/beacon}/init_test.go | 2 +- .../rpc/{ => prysm/v1alpha1}/beacon/log.go | 0 .../rpc/{ => prysm/v1alpha1}/beacon/server.go | 0 .../{ => prysm/v1alpha1}/beacon/slashings.go | 0 .../v1alpha1}/beacon/slashings_test.go | 0 .../{ => prysm/v1alpha1}/beacon/validators.go | 0 .../v1alpha1}/beacon/validators_stream.go | 0 .../beacon/validators_stream_test.go | 0 .../v1alpha1}/beacon/validators_test.go | 0 .../{ => prysm/v1alpha1}/debug/BUILD.bazel | 2 +- .../rpc/{ => prysm/v1alpha1}/debug/block.go | 0 .../{ => prysm/v1alpha1}/debug/block_test.go | 0 .../{ => prysm/v1alpha1}/debug/forkchoice.go | 0 .../v1alpha1}/debug/forkchoice_test.go | 0 .../rpc/{ => prysm/v1alpha1}/debug/p2p.go | 0 .../{ => prysm/v1alpha1}/debug/p2p_test.go | 0 .../rpc/{ => prysm/v1alpha1}/debug/server.go | 0 .../rpc/{ => prysm/v1alpha1}/debug/state.go | 0 .../{ => prysm/v1alpha1}/debug/state_test.go | 0 .../rpc/{ => prysm/v1alpha1}/node/BUILD.bazel | 2 +- .../rpc/{ => prysm/v1alpha1}/node/server.go | 0 .../{ => prysm/v1alpha1}/node/server_test.go | 0 .../v1alpha1}/validator/BUILD.bazel | 2 +- .../v1alpha1}/validator/aggregator.go | 0 .../v1alpha1}/validator/aggregator_test.go | 0 .../v1alpha1}/validator/assignments.go | 0 .../v1alpha1}/validator/assignments_test.go | 0 .../v1alpha1}/validator/attester.go | 0 .../v1alpha1}/validator/attester_test.go | 0 .../{ => prysm/v1alpha1}/validator/exit.go | 0 .../v1alpha1}/validator/exit_test.go | 0 .../rpc/{ => prysm/v1alpha1}/validator/log.go | 0 .../v1alpha1}/validator/proposer.go | 0 .../validator/proposer_attestations.go | 0 .../validator/proposer_attestations_test.go | 0 .../validator/proposer_sync_aggregate.go | 0 .../validator/proposer_sync_aggregate_test.go | 0 .../v1alpha1}/validator/proposer_test.go | 0 .../validator/proposer_utils_bench_test.go | 0 .../{ => prysm/v1alpha1}/validator/server.go | 0 .../v1alpha1}/validator/server_test.go | 0 .../{ => prysm/v1alpha1}/validator/status.go | 0 .../v1alpha1}/validator/status_test.go | 0 .../v1alpha1}/validator/validator_test.go | 0 beacon-chain/rpc/service.go | 32 +++++++++---------- 89 files changed, 67 insertions(+), 67 deletions(-) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/BUILD.bazel (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/blocks.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/blocks_test.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/config.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/config_test.go (99%) rename beacon-chain/rpc/{ => eth/v1}/beacon/init_test.go (100%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/log.go (84%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/pool.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/pool_test.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/server.go (98%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/server_test.go (86%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/state.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/state_test.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/validator.go (99%) rename beacon-chain/rpc/{beaconv1 => eth/v1/beacon}/validator_test.go (99%) rename beacon-chain/rpc/{debugv1 => eth/v1/debug}/BUILD.bazel (98%) rename beacon-chain/rpc/{debugv1 => eth/v1/debug}/debug.go (99%) rename beacon-chain/rpc/{debugv1 => eth/v1/debug}/debug_test.go (99%) rename beacon-chain/rpc/{debugv1 => eth/v1/debug}/server.go (97%) rename beacon-chain/rpc/{eventsv1 => eth/v1/events}/BUILD.bazel (99%) rename beacon-chain/rpc/{eventsv1 => eth/v1/events}/events.go (99%) rename beacon-chain/rpc/{eventsv1 => eth/v1/events}/events_test.go (99%) rename beacon-chain/rpc/{eventsv1 => eth/v1/events}/server.go (97%) rename beacon-chain/rpc/{nodev1 => eth/v1/node}/BUILD.bazel (99%) rename beacon-chain/rpc/{nodev1 => eth/v1/node}/node.go (99%) rename beacon-chain/rpc/{nodev1 => eth/v1/node}/node_test.go (99%) rename beacon-chain/rpc/{nodev1 => eth/v1/node}/server.go (98%) rename beacon-chain/rpc/{nodev1 => eth/v1/node}/server_test.go (88%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/BUILD.bazel (99%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/assignments.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/assignments_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/attestations.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/attestations_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/beacon_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/blocks.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/blocks_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/committees.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/committees_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/config.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/config_test.go (100%) rename beacon-chain/rpc/{beaconv1 => prysm/v1alpha1/beacon}/init_test.go (93%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/log.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/server.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/slashings.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/slashings_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/validators.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/validators_stream.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/validators_stream_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/beacon/validators_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/BUILD.bazel (99%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/block.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/block_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/forkchoice.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/forkchoice_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/p2p.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/p2p_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/server.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/state.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/debug/state_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/node/BUILD.bazel (99%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/node/server.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/node/server_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/BUILD.bazel (99%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/aggregator.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/aggregator_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/assignments.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/assignments_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/attester.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/attester_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/exit.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/exit_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/log.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_attestations.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_attestations_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_sync_aggregate.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_sync_aggregate_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/proposer_utils_bench_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/server.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/server_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/status.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/status_test.go (100%) rename beacon-chain/rpc/{ => prysm/v1alpha1}/validator/validator_test.go (100%) diff --git a/beacon-chain/rpc/BUILD.bazel b/beacon-chain/rpc/BUILD.bazel index 2acc8008b..1cbf4a590 100644 --- a/beacon-chain/rpc/BUILD.bazel +++ b/beacon-chain/rpc/BUILD.bazel @@ -21,15 +21,15 @@ go_library( "//beacon-chain/operations/voluntaryexits:go_default_library", "//beacon-chain/p2p:go_default_library", "//beacon-chain/powchain:go_default_library", - "//beacon-chain/rpc/beacon:go_default_library", - "//beacon-chain/rpc/beaconv1:go_default_library", - "//beacon-chain/rpc/debug:go_default_library", - "//beacon-chain/rpc/debugv1:go_default_library", - "//beacon-chain/rpc/eventsv1:go_default_library", - "//beacon-chain/rpc/node:go_default_library", - "//beacon-chain/rpc/nodev1:go_default_library", + "//beacon-chain/rpc/eth/v1/beacon:go_default_library", + "//beacon-chain/rpc/eth/v1/debug:go_default_library", + "//beacon-chain/rpc/eth/v1/events:go_default_library", + "//beacon-chain/rpc/eth/v1/node:go_default_library", + "//beacon-chain/rpc/prysm/v1alpha1/beacon:go_default_library", + "//beacon-chain/rpc/prysm/v1alpha1/debug:go_default_library", + "//beacon-chain/rpc/prysm/v1alpha1/node:go_default_library", + "//beacon-chain/rpc/prysm/v1alpha1/validator:go_default_library", "//beacon-chain/rpc/statefetcher:go_default_library", - "//beacon-chain/rpc/validator:go_default_library", "//beacon-chain/state/stategen:go_default_library", "//beacon-chain/sync:go_default_library", "//proto/beacon/p2p/v1:go_default_library", diff --git a/beacon-chain/rpc/apimiddleware/BUILD.bazel b/beacon-chain/rpc/apimiddleware/BUILD.bazel index 66da9c866..05a939bff 100644 --- a/beacon-chain/rpc/apimiddleware/BUILD.bazel +++ b/beacon-chain/rpc/apimiddleware/BUILD.bazel @@ -11,7 +11,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/apimiddleware", visibility = ["//beacon-chain:__subpackages__"], deps = [ - "//beacon-chain/rpc/eventsv1:go_default_library", + "//beacon-chain/rpc/eth/v1/events:go_default_library", "//shared/bytesutil:go_default_library", "//shared/gateway:go_default_library", "//shared/grpcutils:go_default_library", @@ -29,7 +29,7 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//beacon-chain/rpc/eventsv1:go_default_library", + "//beacon-chain/rpc/eth/v1/events:go_default_library", "//shared/bytesutil:go_default_library", "//shared/gateway:go_default_library", "//shared/grpcutils:go_default_library", diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers.go b/beacon-chain/rpc/apimiddleware/custom_handlers.go index eb9e2a68b..bb301de8e 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eventsv1" + "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events" "github.com/prysmaticlabs/prysm/shared/gateway" "github.com/prysmaticlabs/prysm/shared/grpcutils" "github.com/r3labs/sse" @@ -187,11 +187,11 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http var data interface{} switch strings.TrimSpace(string(msg.Event)) { - case eventsv1.HeadTopic: + case events.HeadTopic: data = &eventHeadJson{} - case eventsv1.BlockTopic: + case events.BlockTopic: data = &receivedBlockDataJson{} - case eventsv1.AttestationTopic: + case events.AttestationTopic: data = &attestationJson{} // Data received in the event does not fit the expected event stream output. @@ -206,11 +206,11 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http return gateway.InternalServerError(err) } msg.Data = attData - case eventsv1.VoluntaryExitTopic: + case events.VoluntaryExitTopic: data = &signedVoluntaryExitJson{} - case eventsv1.FinalizedCheckpointTopic: + case events.FinalizedCheckpointTopic: data = &eventFinalizedCheckpointJson{} - case eventsv1.ChainReorgTopic: + case events.ChainReorgTopic: data = &eventChainReorgJson{} case "error": data = &eventErrorJson{} diff --git a/beacon-chain/rpc/apimiddleware/custom_handlers_test.go b/beacon-chain/rpc/apimiddleware/custom_handlers_test.go index cd7209a24..43a87b674 100644 --- a/beacon-chain/rpc/apimiddleware/custom_handlers_test.go +++ b/beacon-chain/rpc/apimiddleware/custom_handlers_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eventsv1" + "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events" "github.com/prysmaticlabs/prysm/shared/gateway" "github.com/prysmaticlabs/prysm/shared/grpcutils" "github.com/prysmaticlabs/prysm/shared/testutil/assert" @@ -161,7 +161,7 @@ func TestReceiveEvents(t *testing.T) { require.NoError(t, err) msg := &sse.Event{ Data: bData, - Event: []byte(eventsv1.FinalizedCheckpointTopic), + Event: []byte(events.FinalizedCheckpointTopic), } ch <- msg time.Sleep(time.Second) diff --git a/beacon-chain/rpc/beaconv1/BUILD.bazel b/beacon-chain/rpc/eth/v1/beacon/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/beaconv1/BUILD.bazel rename to beacon-chain/rpc/eth/v1/beacon/BUILD.bazel index b547890d7..0d840fea4 100644 --- a/beacon-chain/rpc/beaconv1/BUILD.bazel +++ b/beacon-chain/rpc/eth/v1/beacon/BUILD.bazel @@ -11,7 +11,7 @@ go_library( "state.go", "validator.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/beaconv1", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/beacon", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/beaconv1/blocks.go b/beacon-chain/rpc/eth/v1/beacon/blocks.go similarity index 99% rename from beacon-chain/rpc/beaconv1/blocks.go rename to beacon-chain/rpc/eth/v1/beacon/blocks.go index 0c58dfd0b..9d562a660 100644 --- a/beacon-chain/rpc/beaconv1/blocks.go +++ b/beacon-chain/rpc/eth/v1/beacon/blocks.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/blocks_test.go b/beacon-chain/rpc/eth/v1/beacon/blocks_test.go similarity index 99% rename from beacon-chain/rpc/beaconv1/blocks_test.go rename to beacon-chain/rpc/eth/v1/beacon/blocks_test.go index eca0eea8c..e1c686467 100644 --- a/beacon-chain/rpc/beaconv1/blocks_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/blocks_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/config.go b/beacon-chain/rpc/eth/v1/beacon/config.go similarity index 99% rename from beacon-chain/rpc/beaconv1/config.go rename to beacon-chain/rpc/eth/v1/beacon/config.go index 9a4cde83f..8d1b5f362 100644 --- a/beacon-chain/rpc/beaconv1/config.go +++ b/beacon-chain/rpc/eth/v1/beacon/config.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/config_test.go b/beacon-chain/rpc/eth/v1/beacon/config_test.go similarity index 99% rename from beacon-chain/rpc/beaconv1/config_test.go rename to beacon-chain/rpc/eth/v1/beacon/config_test.go index 1f66b480f..c0aa2d56a 100644 --- a/beacon-chain/rpc/beaconv1/config_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/config_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beacon/init_test.go b/beacon-chain/rpc/eth/v1/beacon/init_test.go similarity index 100% rename from beacon-chain/rpc/beacon/init_test.go rename to beacon-chain/rpc/eth/v1/beacon/init_test.go diff --git a/beacon-chain/rpc/beaconv1/log.go b/beacon-chain/rpc/eth/v1/beacon/log.go similarity index 84% rename from beacon-chain/rpc/beaconv1/log.go rename to beacon-chain/rpc/eth/v1/beacon/log.go index b772eed27..b13781302 100644 --- a/beacon-chain/rpc/beaconv1/log.go +++ b/beacon-chain/rpc/eth/v1/beacon/log.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import "github.com/sirupsen/logrus" diff --git a/beacon-chain/rpc/beaconv1/pool.go b/beacon-chain/rpc/eth/v1/beacon/pool.go similarity index 99% rename from beacon-chain/rpc/beaconv1/pool.go rename to beacon-chain/rpc/eth/v1/beacon/pool.go index 57e61d5b8..b47e0810e 100644 --- a/beacon-chain/rpc/beaconv1/pool.go +++ b/beacon-chain/rpc/eth/v1/beacon/pool.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/pool_test.go b/beacon-chain/rpc/eth/v1/beacon/pool_test.go similarity index 99% rename from beacon-chain/rpc/beaconv1/pool_test.go rename to beacon-chain/rpc/eth/v1/beacon/pool_test.go index c7e4603e4..f034e9519 100644 --- a/beacon-chain/rpc/beaconv1/pool_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/pool_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/server.go b/beacon-chain/rpc/eth/v1/beacon/server.go similarity index 98% rename from beacon-chain/rpc/beaconv1/server.go rename to beacon-chain/rpc/eth/v1/beacon/server.go index 10c147a79..d84e3375d 100644 --- a/beacon-chain/rpc/beaconv1/server.go +++ b/beacon-chain/rpc/eth/v1/beacon/server.go @@ -1,7 +1,7 @@ // Package beaconv1 defines a gRPC beacon service implementation, // following the official API standards https://ethereum.github.io/eth2.0-APIs/#/. // This package includes the beacon and config endpoints. -package beaconv1 +package beacon import ( "github.com/prysmaticlabs/prysm/beacon-chain/blockchain" diff --git a/beacon-chain/rpc/beaconv1/server_test.go b/beacon-chain/rpc/eth/v1/beacon/server_test.go similarity index 86% rename from beacon-chain/rpc/beaconv1/server_test.go rename to beacon-chain/rpc/eth/v1/beacon/server_test.go index 6fe8c6e7b..aeff72f1b 100644 --- a/beacon-chain/rpc/beaconv1/server_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/server_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1" diff --git a/beacon-chain/rpc/beaconv1/state.go b/beacon-chain/rpc/eth/v1/beacon/state.go similarity index 99% rename from beacon-chain/rpc/beaconv1/state.go rename to beacon-chain/rpc/eth/v1/beacon/state.go index 3c6416271..dca078469 100644 --- a/beacon-chain/rpc/beaconv1/state.go +++ b/beacon-chain/rpc/eth/v1/beacon/state.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "bytes" diff --git a/beacon-chain/rpc/beaconv1/state_test.go b/beacon-chain/rpc/eth/v1/beacon/state_test.go similarity index 99% rename from beacon-chain/rpc/beaconv1/state_test.go rename to beacon-chain/rpc/eth/v1/beacon/state_test.go index 434ada567..e9000197a 100644 --- a/beacon-chain/rpc/beaconv1/state_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/state_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/validator.go b/beacon-chain/rpc/eth/v1/beacon/validator.go similarity index 99% rename from beacon-chain/rpc/beaconv1/validator.go rename to beacon-chain/rpc/eth/v1/beacon/validator.go index a5d63b194..6b8ad7940 100644 --- a/beacon-chain/rpc/beaconv1/validator.go +++ b/beacon-chain/rpc/eth/v1/beacon/validator.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "context" diff --git a/beacon-chain/rpc/beaconv1/validator_test.go b/beacon-chain/rpc/eth/v1/beacon/validator_test.go similarity index 99% rename from beacon-chain/rpc/beaconv1/validator_test.go rename to beacon-chain/rpc/eth/v1/beacon/validator_test.go index e08edcc36..28824e777 100644 --- a/beacon-chain/rpc/beaconv1/validator_test.go +++ b/beacon-chain/rpc/eth/v1/beacon/validator_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "bytes" diff --git a/beacon-chain/rpc/debugv1/BUILD.bazel b/beacon-chain/rpc/eth/v1/debug/BUILD.bazel similarity index 98% rename from beacon-chain/rpc/debugv1/BUILD.bazel rename to beacon-chain/rpc/eth/v1/debug/BUILD.bazel index 7e4b1142f..c88c5b4cc 100644 --- a/beacon-chain/rpc/debugv1/BUILD.bazel +++ b/beacon-chain/rpc/eth/v1/debug/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "debug.go", "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/debugv1", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/debug", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/debugv1/debug.go b/beacon-chain/rpc/eth/v1/debug/debug.go similarity index 99% rename from beacon-chain/rpc/debugv1/debug.go rename to beacon-chain/rpc/eth/v1/debug/debug.go index 73b8fd2ff..5b80c1805 100644 --- a/beacon-chain/rpc/debugv1/debug.go +++ b/beacon-chain/rpc/eth/v1/debug/debug.go @@ -1,4 +1,4 @@ -package debugv1 +package debug import ( "context" diff --git a/beacon-chain/rpc/debugv1/debug_test.go b/beacon-chain/rpc/eth/v1/debug/debug_test.go similarity index 99% rename from beacon-chain/rpc/debugv1/debug_test.go rename to beacon-chain/rpc/eth/v1/debug/debug_test.go index f1dd6e81f..ddc70034b 100644 --- a/beacon-chain/rpc/debugv1/debug_test.go +++ b/beacon-chain/rpc/eth/v1/debug/debug_test.go @@ -1,4 +1,4 @@ -package debugv1 +package debug import ( "context" diff --git a/beacon-chain/rpc/debugv1/server.go b/beacon-chain/rpc/eth/v1/debug/server.go similarity index 97% rename from beacon-chain/rpc/debugv1/server.go rename to beacon-chain/rpc/eth/v1/debug/server.go index d93823e24..1014610fd 100644 --- a/beacon-chain/rpc/debugv1/server.go +++ b/beacon-chain/rpc/eth/v1/debug/server.go @@ -1,7 +1,7 @@ // Package debugv1 defines a gRPC beacon service implementation, // following the official API standards https://ethereum.github.io/eth2.0-APIs/#/. // This package includes the beacon and config endpoints. -package debugv1 +package debug import ( "github.com/prysmaticlabs/prysm/beacon-chain/blockchain" diff --git a/beacon-chain/rpc/eventsv1/BUILD.bazel b/beacon-chain/rpc/eth/v1/events/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/eventsv1/BUILD.bazel rename to beacon-chain/rpc/eth/v1/events/BUILD.bazel index fbb3a2cc9..f2d71bc31 100644 --- a/beacon-chain/rpc/eventsv1/BUILD.bazel +++ b/beacon-chain/rpc/eth/v1/events/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "events.go", "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eventsv1", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/core/feed:go_default_library", diff --git a/beacon-chain/rpc/eventsv1/events.go b/beacon-chain/rpc/eth/v1/events/events.go similarity index 99% rename from beacon-chain/rpc/eventsv1/events.go rename to beacon-chain/rpc/eth/v1/events/events.go index ead7a7451..21da44f63 100644 --- a/beacon-chain/rpc/eventsv1/events.go +++ b/beacon-chain/rpc/eth/v1/events/events.go @@ -1,4 +1,4 @@ -package eventsv1 +package events import ( gwpb "github.com/grpc-ecosystem/grpc-gateway/v2/proto/gateway" diff --git a/beacon-chain/rpc/eventsv1/events_test.go b/beacon-chain/rpc/eth/v1/events/events_test.go similarity index 99% rename from beacon-chain/rpc/eventsv1/events_test.go rename to beacon-chain/rpc/eth/v1/events/events_test.go index 865e792c3..b3e22fe1f 100644 --- a/beacon-chain/rpc/eventsv1/events_test.go +++ b/beacon-chain/rpc/eth/v1/events/events_test.go @@ -1,4 +1,4 @@ -package eventsv1 +package events import ( "context" diff --git a/beacon-chain/rpc/eventsv1/server.go b/beacon-chain/rpc/eth/v1/events/server.go similarity index 97% rename from beacon-chain/rpc/eventsv1/server.go rename to beacon-chain/rpc/eth/v1/events/server.go index 864b3c979..8a1ae3ca2 100644 --- a/beacon-chain/rpc/eventsv1/server.go +++ b/beacon-chain/rpc/eth/v1/events/server.go @@ -1,7 +1,7 @@ // Package eventsv1 defines a gRPC events service implementation, // following the official API standards https://ethereum.github.io/eth2.0-APIs/#/. // This package includes the events endpoint. -package eventsv1 +package events import ( "context" diff --git a/beacon-chain/rpc/nodev1/BUILD.bazel b/beacon-chain/rpc/eth/v1/node/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/nodev1/BUILD.bazel rename to beacon-chain/rpc/eth/v1/node/BUILD.bazel index 2bea71aa5..0907d9b9b 100644 --- a/beacon-chain/rpc/nodev1/BUILD.bazel +++ b/beacon-chain/rpc/eth/v1/node/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "node.go", "server.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/nodev1", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/node", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/nodev1/node.go b/beacon-chain/rpc/eth/v1/node/node.go similarity index 99% rename from beacon-chain/rpc/nodev1/node.go rename to beacon-chain/rpc/eth/v1/node/node.go index 34268ee40..1dbbacf1c 100644 --- a/beacon-chain/rpc/nodev1/node.go +++ b/beacon-chain/rpc/eth/v1/node/node.go @@ -1,4 +1,4 @@ -package nodev1 +package node import ( "context" diff --git a/beacon-chain/rpc/nodev1/node_test.go b/beacon-chain/rpc/eth/v1/node/node_test.go similarity index 99% rename from beacon-chain/rpc/nodev1/node_test.go rename to beacon-chain/rpc/eth/v1/node/node_test.go index b4a600329..88a6251eb 100644 --- a/beacon-chain/rpc/nodev1/node_test.go +++ b/beacon-chain/rpc/eth/v1/node/node_test.go @@ -1,4 +1,4 @@ -package nodev1 +package node import ( "context" diff --git a/beacon-chain/rpc/nodev1/server.go b/beacon-chain/rpc/eth/v1/node/server.go similarity index 98% rename from beacon-chain/rpc/nodev1/server.go rename to beacon-chain/rpc/eth/v1/node/server.go index c9fab9db3..5e7a29547 100644 --- a/beacon-chain/rpc/nodev1/server.go +++ b/beacon-chain/rpc/eth/v1/node/server.go @@ -1,7 +1,7 @@ // Package nodev1 defines a gRPC node service implementation, providing // useful endpoints for checking a node's sync status, peer info, // genesis data, and version information. -package nodev1 +package node import ( "github.com/prysmaticlabs/prysm/beacon-chain/blockchain" diff --git a/beacon-chain/rpc/nodev1/server_test.go b/beacon-chain/rpc/eth/v1/node/server_test.go similarity index 88% rename from beacon-chain/rpc/nodev1/server_test.go rename to beacon-chain/rpc/eth/v1/node/server_test.go index 8ce6177b8..78294d0ba 100644 --- a/beacon-chain/rpc/nodev1/server_test.go +++ b/beacon-chain/rpc/eth/v1/node/server_test.go @@ -1,4 +1,4 @@ -package nodev1 +package node import ( ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1" diff --git a/beacon-chain/rpc/beacon/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/beacon/BUILD.bazel rename to beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel index e2f41a498..ac13dfff8 100644 --- a/beacon-chain/rpc/beacon/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "validators.go", "validators_stream.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/beacon", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/beacon", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/beacon/assignments.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go similarity index 100% rename from beacon-chain/rpc/beacon/assignments.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go diff --git a/beacon-chain/rpc/beacon/assignments_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go similarity index 100% rename from beacon-chain/rpc/beacon/assignments_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/assignments_test.go diff --git a/beacon-chain/rpc/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go similarity index 100% rename from beacon-chain/rpc/beacon/attestations.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go diff --git a/beacon-chain/rpc/beacon/attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go similarity index 100% rename from beacon-chain/rpc/beacon/attestations_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/attestations_test.go diff --git a/beacon-chain/rpc/beacon/beacon_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/beacon_test.go similarity index 100% rename from beacon-chain/rpc/beacon/beacon_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/beacon_test.go diff --git a/beacon-chain/rpc/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go similarity index 100% rename from beacon-chain/rpc/beacon/blocks.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go diff --git a/beacon-chain/rpc/beacon/blocks_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go similarity index 100% rename from beacon-chain/rpc/beacon/blocks_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go diff --git a/beacon-chain/rpc/beacon/committees.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go similarity index 100% rename from beacon-chain/rpc/beacon/committees.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go diff --git a/beacon-chain/rpc/beacon/committees_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go similarity index 100% rename from beacon-chain/rpc/beacon/committees_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/committees_test.go diff --git a/beacon-chain/rpc/beacon/config.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go similarity index 100% rename from beacon-chain/rpc/beacon/config.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/config.go diff --git a/beacon-chain/rpc/beacon/config_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/config_test.go similarity index 100% rename from beacon-chain/rpc/beacon/config_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/config_test.go diff --git a/beacon-chain/rpc/beaconv1/init_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/init_test.go similarity index 93% rename from beacon-chain/rpc/beaconv1/init_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/init_test.go index 557fccd15..16571d1f0 100644 --- a/beacon-chain/rpc/beaconv1/init_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/init_test.go @@ -1,4 +1,4 @@ -package beaconv1 +package beacon import ( "github.com/prysmaticlabs/prysm/shared/params" diff --git a/beacon-chain/rpc/beacon/log.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/log.go similarity index 100% rename from beacon-chain/rpc/beacon/log.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/log.go diff --git a/beacon-chain/rpc/beacon/server.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go similarity index 100% rename from beacon-chain/rpc/beacon/server.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/server.go diff --git a/beacon-chain/rpc/beacon/slashings.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go similarity index 100% rename from beacon-chain/rpc/beacon/slashings.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go diff --git a/beacon-chain/rpc/beacon/slashings_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go similarity index 100% rename from beacon-chain/rpc/beacon/slashings_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/slashings_test.go diff --git a/beacon-chain/rpc/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go similarity index 100% rename from beacon-chain/rpc/beacon/validators.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go diff --git a/beacon-chain/rpc/beacon/validators_stream.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_stream.go similarity index 100% rename from beacon-chain/rpc/beacon/validators_stream.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/validators_stream.go diff --git a/beacon-chain/rpc/beacon/validators_stream_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_stream_test.go similarity index 100% rename from beacon-chain/rpc/beacon/validators_stream_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/validators_stream_test.go diff --git a/beacon-chain/rpc/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go similarity index 100% rename from beacon-chain/rpc/beacon/validators_test.go rename to beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go diff --git a/beacon-chain/rpc/debug/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/debug/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/debug/BUILD.bazel rename to beacon-chain/rpc/prysm/v1alpha1/debug/BUILD.bazel index 338dde995..73553eb2e 100644 --- a/beacon-chain/rpc/debug/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/BUILD.bazel @@ -9,7 +9,7 @@ go_library( "server.go", "state.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/debug", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/debug", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/debug/block.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go similarity index 100% rename from beacon-chain/rpc/debug/block.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/block.go diff --git a/beacon-chain/rpc/debug/block_test.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block_test.go similarity index 100% rename from beacon-chain/rpc/debug/block_test.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/block_test.go diff --git a/beacon-chain/rpc/debug/forkchoice.go b/beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice.go similarity index 100% rename from beacon-chain/rpc/debug/forkchoice.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice.go diff --git a/beacon-chain/rpc/debug/forkchoice_test.go b/beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice_test.go similarity index 100% rename from beacon-chain/rpc/debug/forkchoice_test.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/forkchoice_test.go diff --git a/beacon-chain/rpc/debug/p2p.go b/beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go similarity index 100% rename from beacon-chain/rpc/debug/p2p.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go diff --git a/beacon-chain/rpc/debug/p2p_test.go b/beacon-chain/rpc/prysm/v1alpha1/debug/p2p_test.go similarity index 100% rename from beacon-chain/rpc/debug/p2p_test.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/p2p_test.go diff --git a/beacon-chain/rpc/debug/server.go b/beacon-chain/rpc/prysm/v1alpha1/debug/server.go similarity index 100% rename from beacon-chain/rpc/debug/server.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/server.go diff --git a/beacon-chain/rpc/debug/state.go b/beacon-chain/rpc/prysm/v1alpha1/debug/state.go similarity index 100% rename from beacon-chain/rpc/debug/state.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/state.go diff --git a/beacon-chain/rpc/debug/state_test.go b/beacon-chain/rpc/prysm/v1alpha1/debug/state_test.go similarity index 100% rename from beacon-chain/rpc/debug/state_test.go rename to beacon-chain/rpc/prysm/v1alpha1/debug/state_test.go diff --git a/beacon-chain/rpc/node/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/node/BUILD.bazel rename to beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel index 59eee46bd..7953be67b 100644 --- a/beacon-chain/rpc/node/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/node/BUILD.bazel @@ -3,7 +3,7 @@ load("@prysm//tools/go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["server.go"], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/node", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/node", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/node/server.go b/beacon-chain/rpc/prysm/v1alpha1/node/server.go similarity index 100% rename from beacon-chain/rpc/node/server.go rename to beacon-chain/rpc/prysm/v1alpha1/node/server.go diff --git a/beacon-chain/rpc/node/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/node/server_test.go similarity index 100% rename from beacon-chain/rpc/node/server_test.go rename to beacon-chain/rpc/prysm/v1alpha1/node/server_test.go diff --git a/beacon-chain/rpc/validator/BUILD.bazel b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel similarity index 99% rename from beacon-chain/rpc/validator/BUILD.bazel rename to beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel index 03f5b42b3..abf007b79 100644 --- a/beacon-chain/rpc/validator/BUILD.bazel +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "server.go", "status.go", ], - importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/validator", + importpath = "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/validator", visibility = ["//beacon-chain:__subpackages__"], deps = [ "//beacon-chain/blockchain:go_default_library", diff --git a/beacon-chain/rpc/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go similarity index 100% rename from beacon-chain/rpc/validator/aggregator.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go diff --git a/beacon-chain/rpc/validator/aggregator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go similarity index 100% rename from beacon-chain/rpc/validator/aggregator_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/aggregator_test.go diff --git a/beacon-chain/rpc/validator/assignments.go b/beacon-chain/rpc/prysm/v1alpha1/validator/assignments.go similarity index 100% rename from beacon-chain/rpc/validator/assignments.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/assignments.go diff --git a/beacon-chain/rpc/validator/assignments_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/assignments_test.go similarity index 100% rename from beacon-chain/rpc/validator/assignments_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/assignments_test.go diff --git a/beacon-chain/rpc/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go similarity index 100% rename from beacon-chain/rpc/validator/attester.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/attester.go diff --git a/beacon-chain/rpc/validator/attester_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go similarity index 100% rename from beacon-chain/rpc/validator/attester_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go diff --git a/beacon-chain/rpc/validator/exit.go b/beacon-chain/rpc/prysm/v1alpha1/validator/exit.go similarity index 100% rename from beacon-chain/rpc/validator/exit.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/exit.go diff --git a/beacon-chain/rpc/validator/exit_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/exit_test.go similarity index 100% rename from beacon-chain/rpc/validator/exit_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/exit_test.go diff --git a/beacon-chain/rpc/validator/log.go b/beacon-chain/rpc/prysm/v1alpha1/validator/log.go similarity index 100% rename from beacon-chain/rpc/validator/log.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/log.go diff --git a/beacon-chain/rpc/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go similarity index 100% rename from beacon-chain/rpc/validator/proposer.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go diff --git a/beacon-chain/rpc/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_attestations.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go diff --git a/beacon-chain/rpc/validator/proposer_attestations_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_attestations_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_test.go diff --git a/beacon-chain/rpc/validator/proposer_sync_aggregate.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_sync_aggregate.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_sync_aggregate.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_sync_aggregate.go diff --git a/beacon-chain/rpc/validator/proposer_sync_aggregate_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_sync_aggregate_test.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_sync_aggregate_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_sync_aggregate_test.go diff --git a/beacon-chain/rpc/validator/proposer_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go diff --git a/beacon-chain/rpc/validator/proposer_utils_bench_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go similarity index 100% rename from beacon-chain/rpc/validator/proposer_utils_bench_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/proposer_utils_bench_test.go diff --git a/beacon-chain/rpc/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go similarity index 100% rename from beacon-chain/rpc/validator/server.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/server.go diff --git a/beacon-chain/rpc/validator/server_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go similarity index 100% rename from beacon-chain/rpc/validator/server_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/server_test.go diff --git a/beacon-chain/rpc/validator/status.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go similarity index 100% rename from beacon-chain/rpc/validator/status.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/status.go diff --git a/beacon-chain/rpc/validator/status_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go similarity index 100% rename from beacon-chain/rpc/validator/status_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/status_test.go diff --git a/beacon-chain/rpc/validator/validator_test.go b/beacon-chain/rpc/prysm/v1alpha1/validator/validator_test.go similarity index 100% rename from beacon-chain/rpc/validator/validator_test.go rename to beacon-chain/rpc/prysm/v1alpha1/validator/validator_test.go diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index e4c329d5e..5f9aab0d7 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -25,15 +25,15 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits" "github.com/prysmaticlabs/prysm/beacon-chain/p2p" "github.com/prysmaticlabs/prysm/beacon-chain/powchain" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/beacon" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/beaconv1" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/debug" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/debugv1" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eventsv1" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/node" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/nodev1" + "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/beacon" + "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/debug" + "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/events" + node "github.com/prysmaticlabs/prysm/beacon-chain/rpc/eth/v1/node" + beacon2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/beacon" + debug2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/debug" + node2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/node" + validator2 "github.com/prysmaticlabs/prysm/beacon-chain/rpc/prysm/v1alpha1/validator" "github.com/prysmaticlabs/prysm/beacon-chain/rpc/statefetcher" - "github.com/prysmaticlabs/prysm/beacon-chain/rpc/validator" "github.com/prysmaticlabs/prysm/beacon-chain/state/stategen" chainSync "github.com/prysmaticlabs/prysm/beacon-chain/sync" pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" @@ -165,7 +165,7 @@ func (s *Service) Start() { } s.grpcServer = grpc.NewServer(opts...) - validatorServer := &validator.Server{ + validatorServer := &validator2.Server{ Ctx: s.ctx, BeaconDB: s.cfg.BeaconDB, AttestationCache: cache.NewAttestationCache(), @@ -192,7 +192,7 @@ func (s *Service) Start() { SlashingsPool: s.cfg.SlashingsPool, StateGen: s.cfg.StateGen, } - nodeServer := &node.Server{ + nodeServer := &node2.Server{ LogsStreamer: logutil.NewStreamServer(), StreamLogsBufferSize: 1000, // Enough to handle bursts of beacon node logs for gRPC streaming. BeaconDB: s.cfg.BeaconDB, @@ -205,7 +205,7 @@ func (s *Service) Start() { BeaconMonitoringHost: s.cfg.BeaconMonitoringHost, BeaconMonitoringPort: s.cfg.BeaconMonitoringPort, } - nodeServerV1 := &nodev1.Server{ + nodeServerV1 := &node.Server{ BeaconDB: s.cfg.BeaconDB, Server: s.grpcServer, SyncChecker: s.cfg.SyncService, @@ -216,7 +216,7 @@ func (s *Service) Start() { HeadFetcher: s.cfg.HeadFetcher, } - beaconChainServer := &beacon.Server{ + beaconChainServer := &beacon2.Server{ Ctx: s.ctx, BeaconDB: s.cfg.BeaconDB, AttestationsPool: s.cfg.AttestationsPool, @@ -238,7 +238,7 @@ func (s *Service) Start() { ReceivedAttestationsBuffer: make(chan *ethpb.Attestation, attestationBufferSize), CollectedAttestationsBuffer: make(chan []*ethpb.Attestation, attestationBufferSize), } - beaconChainServerV1 := &beaconv1.Server{ + beaconChainServerV1 := &beacon.Server{ BeaconDB: s.cfg.BeaconDB, AttestationsPool: s.cfg.AttestationsPool, SlashingsPool: s.cfg.SlashingsPool, @@ -261,7 +261,7 @@ func (s *Service) Start() { pbrpc.RegisterHealthServer(s.grpcServer, nodeServer) ethpb.RegisterBeaconChainServer(s.grpcServer, beaconChainServer) ethpbv1.RegisterBeaconChainServer(s.grpcServer, beaconChainServerV1) - ethpbv1.RegisterEventsServer(s.grpcServer, &eventsv1.Server{ + ethpbv1.RegisterEventsServer(s.grpcServer, &events.Server{ Ctx: s.ctx, StateNotifier: s.cfg.StateNotifier, BlockNotifier: s.cfg.BlockNotifier, @@ -269,7 +269,7 @@ func (s *Service) Start() { }) if s.cfg.EnableDebugRPCEndpoints { log.Info("Enabled debug gRPC endpoints") - debugServer := &debug.Server{ + debugServer := &debug2.Server{ GenesisTimeFetcher: s.cfg.GenesisTimeFetcher, BeaconDB: s.cfg.BeaconDB, StateGen: s.cfg.StateGen, @@ -277,7 +277,7 @@ func (s *Service) Start() { PeerManager: s.cfg.PeerManager, PeersFetcher: s.cfg.PeersFetcher, } - debugServerV1 := &debugv1.Server{ + debugServerV1 := &debug.Server{ BeaconDB: s.cfg.BeaconDB, HeadFetcher: s.cfg.HeadFetcher, StateFetcher: &statefetcher.StateProvider{