From c1dc944fd06b009e032d4a2a4a6ae379fa087c9a Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 15:07:00 +0100 Subject: [PATCH 1/6] proto definitions --- proto/prysm/v1alpha1/beacon_block.proto | 6 ++ proto/prysm/v1alpha1/beacon_chain.proto | 70 ++++++++++++++ proto/prysm/v1alpha1/debug.proto | 25 ++++- proto/prysm/v1alpha1/health.proto | 7 +- proto/prysm/v1alpha1/node.proto | 41 +++++++- proto/prysm/v1alpha1/sync_committee.proto | 2 + proto/prysm/v1alpha1/validator.proto | 111 +++++++++++++++++++++- 7 files changed, 253 insertions(+), 9 deletions(-) diff --git a/proto/prysm/v1alpha1/beacon_block.proto b/proto/prysm/v1alpha1/beacon_block.proto index 2fbee2024e57..cf3dbeea8cfa 100644 --- a/proto/prysm/v1alpha1/beacon_block.proto +++ b/proto/prysm/v1alpha1/beacon_block.proto @@ -33,6 +33,8 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1"; // ---------------------------------------------------------------------------- message GenericSignedBeaconBlock { + option deprecated = true; + oneof block { // Representing a signed, phase 0 beacon block. SignedBeaconBlock phase0 = 1; @@ -75,6 +77,8 @@ message GenericSignedBeaconBlock { } message GenericBeaconBlock { + option deprecated = true; + oneof block { // Representing a phase 0 beacon block. BeaconBlock phase0 = 1; @@ -319,6 +323,8 @@ message VoluntaryExit { } message SignedValidatorRegistrationsV1 { + option deprecated = true; + repeated SignedValidatorRegistrationV1 messages = 1; } diff --git a/proto/prysm/v1alpha1/beacon_chain.proto b/proto/prysm/v1alpha1/beacon_chain.proto index 47a1f1111aa9..4ece36983e83 100644 --- a/proto/prysm/v1alpha1/beacon_chain.proto +++ b/proto/prysm/v1alpha1/beacon_chain.proto @@ -44,6 +44,7 @@ service BeaconChain { // information via a boolean query filter. rpc ListAttestations(ListAttestationsRequest) returns (ListAttestationsResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations" }; @@ -57,6 +58,7 @@ service BeaconChain { // information via a boolean query filter. rpc ListAttestationsElectra(ListAttestationsRequest) returns (ListAttestationsElectraResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations_electra" }; @@ -70,6 +72,7 @@ service BeaconChain { // genesis information via a boolean query filter. rpc ListIndexedAttestations(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations/indexed" }; @@ -83,6 +86,7 @@ service BeaconChain { // genesis information via a boolean query filter. rpc ListIndexedAttestationsElectra(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsElectraResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations/indexed_electra" }; @@ -99,6 +103,7 @@ service BeaconChain { // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#attestations rpc AttestationPool(AttestationPoolRequest) returns (AttestationPoolResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations/pool" }; @@ -115,6 +120,7 @@ service BeaconChain { // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#attestations rpc AttestationPoolElectra(AttestationPoolRequest) returns (AttestationPoolElectraResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/attestations/pool_electra" }; @@ -129,6 +135,7 @@ service BeaconChain { // endpoint allows for retrieval of genesis information via a boolean query // filter. rpc ListBeaconBlocks(ListBlocksRequest) returns (ListBeaconBlocksResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha2/beacon/blocks" }; @@ -155,6 +162,7 @@ service BeaconChain { // default. This endpoint allows for retrieval of genesis information via a // boolean query filter. rpc ListBeaconCommittees(ListCommitteesRequest) returns (BeaconCommittees) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/committees" }; @@ -165,6 +173,7 @@ service BeaconChain { // via a boolean query filter. rpc ListValidatorBalances(ListValidatorBalancesRequest) returns (ValidatorBalances) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators/balances" }; @@ -176,6 +185,7 @@ service BeaconChain { // specific validator set in time. This endpoint allows for retrieval of // genesis information via a boolean query filter. rpc ListValidators(ListValidatorsRequest) returns (Validators) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators" }; @@ -185,6 +195,7 @@ service BeaconChain { // // This request may query by validator index or public key. rpc GetValidator(GetValidatorRequest) returns (Validator) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator" }; @@ -197,6 +208,7 @@ service BeaconChain { // information via a boolean query filter. rpc GetValidatorActiveSetChanges(GetValidatorActiveSetChangesRequest) returns (ActiveSetChanges) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators/activesetchanges" }; @@ -204,6 +216,7 @@ service BeaconChain { // Retrieve the current validator queue information. rpc GetValidatorQueue(google.protobuf.Empty) returns (ValidatorQueue) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators/queue" }; @@ -215,6 +228,7 @@ service BeaconChain { // and returns a performance report for all of them respectively. rpc GetValidatorPerformance(ValidatorPerformanceRequest) returns (ValidatorPerformanceResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators/performance" }; @@ -227,6 +241,7 @@ service BeaconChain { // information via a boolean query filter. rpc ListValidatorAssignments(ListValidatorAssignmentsRequest) returns (ValidatorAssignments) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validators/assignments" }; @@ -247,6 +262,7 @@ service BeaconChain { // Retrieve the current configuration parameters of the beacon chain. rpc GetBeaconConfig(google.protobuf.Empty) returns (BeaconConfig) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/config" }; @@ -255,6 +271,7 @@ service BeaconChain { // Submit an attester slashing object to the beacon node. rpc SubmitAttesterSlashing(AttesterSlashing) returns (SubmitSlashingResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/slashings/attester/submit" }; @@ -263,6 +280,7 @@ service BeaconChain { // Submit an attester slashing object to the beacon node. rpc SubmitAttesterSlashingElectra(AttesterSlashingElectra) returns (SubmitSlashingResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/slashings/attester/submit_electra" }; @@ -271,6 +289,7 @@ service BeaconChain { // Submit a proposer slashing object to the beacon node. rpc SubmitProposerSlashing(ProposerSlashing) returns (SubmitSlashingResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/slashings/proposer/submit" }; @@ -279,6 +298,7 @@ service BeaconChain { // Returns a list of validators individual vote status of a given epoch. rpc GetIndividualVotes(IndividualVotesRequest) returns (IndividualVotesRespond) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/beacon/individual_votes" }; @@ -287,6 +307,8 @@ service BeaconChain { // Request for indexed attestations by target epoch. message ListIndexedAttestationsRequest { + option deprecated = true; + oneof query_filter { // Retrieve attestations by epoch processed. uint64 epoch = 1 [ @@ -310,6 +332,7 @@ message ListIndexedAttestationsRequest { // Request for attestations. message ListAttestationsRequest { + option deprecated = true; oneof query_filter { // Filter attestations by epoch processed. @@ -333,6 +356,8 @@ message ListAttestationsRequest { } message ListAttestationsResponse { + option deprecated = true; + repeated Attestation attestations = 1; // A pagination token returned from a previous call to `ListAttestations` @@ -345,6 +370,8 @@ message ListAttestationsResponse { } message ListAttestationsElectraResponse { + option deprecated = true; + repeated AttestationElectra attestations = 1; // A pagination token returned from a previous call to `ListAttestations` @@ -357,6 +384,8 @@ message ListAttestationsElectraResponse { } message ListIndexedAttestationsResponse { + option deprecated = true; + repeated IndexedAttestation indexed_attestations = 1; // A pagination token returned from a previous call to @@ -369,6 +398,8 @@ message ListIndexedAttestationsResponse { } message ListIndexedAttestationsElectraResponse { + option deprecated = true; + repeated IndexedAttestationElectra indexed_attestations = 1; // A pagination token returned from a previous call to @@ -381,6 +412,8 @@ message ListIndexedAttestationsElectraResponse { } message ListBlocksRequest { + option deprecated = true; + oneof query_filter { // Block root filter to return a single block. bytes root = 1; @@ -415,6 +448,8 @@ message ListBlocksRequest { } message ListBeaconBlocksResponse { + option deprecated = true; + repeated BeaconBlockContainer block_containers = 1; // A pagination token returned from a previous call to `ListBeaconBlocks` @@ -478,6 +513,8 @@ message BeaconBlockContainer { // Information about the head of the beacon chain. message ChainHead { + option deprecated = true; + // Slot of the head block. uint64 head_slot = 1 [ (ethereum.eth.ext.cast_type) = @@ -544,6 +581,8 @@ message ChainHead { } message ListCommitteesRequest { + option deprecated = true; + oneof query_filter { // Optional criteria to retrieve data at a specific epoch. uint64 epoch = 1 [ @@ -557,6 +596,8 @@ message ListCommitteesRequest { } message BeaconCommittees { + option deprecated = true; + message CommitteeItem { // A committee is a list of validator indices participating in consensus at // a slot. @@ -585,6 +626,8 @@ message BeaconCommittees { } message ListValidatorBalancesRequest { + option deprecated = true; + oneof query_filter { // Optional criteria to retrieve balances at a specific epoch. uint64 epoch = 1 [ @@ -616,6 +659,8 @@ message ListValidatorBalancesRequest { } message ValidatorBalances { + option deprecated = true; + // Epoch which the state was considered to determine the validator balances. uint64 epoch = 1 [ (ethereum.eth.ext.cast_type) = @@ -650,6 +695,8 @@ message ValidatorBalances { } message ListValidatorsRequest { + option deprecated = true; + oneof query_filter { // Optional criteria to retrieve validators at a specific epoch. // Omitting this field or setting it to zero will retrieve a response @@ -688,6 +735,8 @@ message ListValidatorsRequest { } message GetValidatorRequest { + option deprecated = true; + oneof query_filter { // Validator index in the registry. uint64 index = 1 [ (ethereum.eth.ext.cast_type) = @@ -700,6 +749,8 @@ message GetValidatorRequest { } message Validators { + option deprecated = true; + // Epoch which the state was considered to determine the active validator // set. This field is not optional. Zero value epoch indicates the validator // set is from the Ethereum proof of stake genesis set. @@ -727,6 +778,8 @@ message Validators { } message GetValidatorActiveSetChangesRequest { + option deprecated = true; + oneof query_filter { // Optional criteria to retrieve balances at a specific epoch. uint64 epoch = 1 [ @@ -740,6 +793,8 @@ message GetValidatorActiveSetChangesRequest { } message ActiveSetChanges { + option deprecated = true; + // Epoch which the state was considered to determine the active validator // set. uint64 epoch = 1 [ @@ -791,6 +846,8 @@ message ActiveSetChanges { } message ValidatorPerformanceRequest { + option deprecated = true; + // A list of 48 byte validator public keys. repeated bytes public_keys = 1 [ deprecated = true ]; // A list of validator indices to retrieve performance by their indices. @@ -801,6 +858,8 @@ message ValidatorPerformanceRequest { } message ValidatorPerformanceResponse { + option deprecated = true; + // A list of validator effective balances mapped 1-to-1 with the request's // public keys. repeated uint64 current_effective_balances = 1; @@ -853,6 +912,7 @@ message ValidatorPerformanceResponse { // future hard fork. message ValidatorQueue { option deprecated = true; + // The amount of ether in gwei allowed to enter or exit the active // validator set. uint64 churn_limit = 1; @@ -883,6 +943,8 @@ message ValidatorQueue { } message ListValidatorAssignmentsRequest { + option deprecated = true; + oneof query_filter { // Epoch to validator assignments for. uint64 epoch = 1 [ @@ -912,6 +974,8 @@ message ListValidatorAssignmentsRequest { } message ValidatorAssignments { + option deprecated = true; + message CommitteeAssignment { // Beacon committees are responsible for crosslinking committee data back to // the beacon chain, they also attest and produce beacon chain blocks. This @@ -1003,6 +1067,8 @@ message ValidatorParticipationResponse { } message AttestationPoolRequest { + option deprecated = true; + // The maximum number of objects to return in the response. // This field is optional. int32 page_size = 1; @@ -1014,6 +1080,8 @@ message AttestationPoolRequest { } message AttestationPoolResponse { + option deprecated = true; + // List of attestations currently in the pool of the beacon chain. repeated Attestation attestations = 1; @@ -1027,6 +1095,8 @@ message AttestationPoolResponse { } message AttestationPoolElectraResponse { + option deprecated = true; + // List of attestations currently in the pool of the beacon chain. repeated AttestationElectra attestations = 1; diff --git a/proto/prysm/v1alpha1/debug.proto b/proto/prysm/v1alpha1/debug.proto index d46a46b630a3..7825c873e1aa 100644 --- a/proto/prysm/v1alpha1/debug.proto +++ b/proto/prysm/v1alpha1/debug.proto @@ -24,30 +24,35 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1"; service Debug { // Returns a beacon state by filter criteria from the beacon node. rpc GetBeaconState(BeaconStateRequest) returns (SSZResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/debug/state" }; } // Returns a beacon state by filter criteria from the beacon node. rpc GetBlock(BlockRequestByRoot) returns (SSZResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/debug/block" }; } // SetLoggingLevel sets the log-level of the beacon node programmatically. rpc SetLoggingLevel(LoggingLevelRequest) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/debug/logging" }; } // Returns all the related data for every peer tracked by the host node. rpc ListPeers(google.protobuf.Empty) returns (DebugPeerResponses) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/debug/peers" }; } // Returns requested peer with specified peer id if it exists. rpc GetPeer(ethereum.eth.v1alpha1.PeerRequest) returns (DebugPeerResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/debug/peer" }; @@ -70,6 +75,8 @@ message InclusionSlotResponse { } message BeaconStateRequest { + option deprecated = true; + oneof query_filter { // The slot corresponding to a desired beacon state. uint64 slot = 1 [ @@ -82,14 +89,22 @@ message BeaconStateRequest { } } -message BlockRequestByRoot { bytes block_root = 1; } +message BlockRequestByRoot { + option deprecated = true; + + bytes block_root = 1; +} message SSZResponse { + option deprecated = true; + // Returns an ssz-encoded byte slice as a response. bytes encoded = 1; } message LoggingLevelRequest { + option deprecated = true; + // The logging levels available in Prysm as an enum. enum Level { INFO = 0; @@ -99,9 +114,15 @@ message LoggingLevelRequest { Level level = 1; } -message DebugPeerResponses { repeated DebugPeerResponse responses = 1; } +message DebugPeerResponses { + option deprecated = true; + + repeated DebugPeerResponse responses = 1; +} message DebugPeerResponse { + option deprecated = true; + // Peer related metadata that is useful for debugging. message PeerInfo { // Metadata of the peer, containing their bitfield diff --git a/proto/prysm/v1alpha1/health.proto b/proto/prysm/v1alpha1/health.proto index d68bcd87e716..0b2912646e52 100644 --- a/proto/prysm/v1alpha1/health.proto +++ b/proto/prysm/v1alpha1/health.proto @@ -18,10 +18,15 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1"; // such being able to stream logs via gRPC. service Health { rpc StreamBeaconLogs(google.protobuf.Empty) returns (stream LogsResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/health/logs/stream" }; } } -message LogsResponse { repeated string logs = 1; } +message LogsResponse { + option deprecated = true; + + repeated string logs = 1; +} diff --git a/proto/prysm/v1alpha1/node.proto b/proto/prysm/v1alpha1/node.proto index 2ebca48c2c05..2f9709c34007 100644 --- a/proto/prysm/v1alpha1/node.proto +++ b/proto/prysm/v1alpha1/node.proto @@ -35,6 +35,7 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1"; service Node { // Retrieve the current network sync status of the node. rpc GetSyncStatus(google.protobuf.Empty) returns (SyncStatus) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/syncing" }; @@ -42,6 +43,7 @@ service Node { // Retrieve information about the genesis of Ethereum proof of stake. rpc GetGenesis(google.protobuf.Empty) returns (Genesis) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/genesis" }; @@ -49,6 +51,7 @@ service Node { // Retrieve information about the running Ethereum Beacon Node. rpc GetVersion(google.protobuf.Empty) returns (Version) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/version" }; @@ -56,6 +59,7 @@ service Node { // Retrieve the current health of the node. rpc GetHealth(HealthRequest) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/health" }; @@ -68,6 +72,7 @@ service Node { // reflection. rpc ListImplementedServices(google.protobuf.Empty) returns (ImplementedServices) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/services" }; @@ -75,6 +80,7 @@ service Node { // Retrieves the peer data of the local peer. rpc GetHost(google.protobuf.Empty) returns (HostData) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/p2p" }; @@ -82,6 +88,7 @@ service Node { // Retrieve the peer corresponding to the provided peer id. rpc GetPeer(PeerRequest) returns (Peer) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/peer" }; @@ -89,6 +96,7 @@ service Node { // Retrieve the list of peers currently connected to this node. rpc ListPeers(google.protobuf.Empty) returns (Peers) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/peers" }; @@ -97,22 +105,31 @@ service Node { // // Retrieve the status of the ETH1 connections. rpc GetETH1ConnectionStatus(google.protobuf.Empty) returns (ETH1ConnectionStatus) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/node/eth1/connections" }; } } -message HealthRequest { uint64 syncing_status = 1; } +message HealthRequest { + option deprecated = true; + + uint64 syncing_status = 1; +} // Information about the current network sync status of the node. message SyncStatus { + option deprecated = true; + // Whether or not the node is currently syncing. bool syncing = 1; } // Information about the genesis of Ethereum proof of stake. message Genesis { + option deprecated = true; + // UTC time specified in the chain start event in the deposit contract. google.protobuf.Timestamp genesis_time = 1; @@ -126,6 +143,8 @@ message Genesis { // Information about the node version. message Version { + option deprecated = true; + // A string that uniquely identifies the node and its version. string version = 1; @@ -134,18 +153,30 @@ message Version { string metadata = 2; } -message ImplementedServices { repeated string services = 1; } +message ImplementedServices { + option deprecated = true; + + repeated string services = 1; +} message PeerRequest { + option deprecated = true; + // Peer id of the peer requested. string peer_id = 1; } // Peers is a list of peer messages. -message Peers { repeated Peer peers = 1; } +message Peers { + option deprecated = true; + + repeated Peer peers = 1; +} // Peer provides details of a peer on the network. message Peer { + option deprecated = true; + // The address of the peer, as a full multiaddr, for example: // /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17 string address = 1; @@ -162,6 +193,8 @@ message Peer { // P2P Data on the local host. message HostData { + option deprecated = true; + // All the multiaddress of the peer, specified as a full multiaddr, for // example: // /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17 @@ -190,6 +223,8 @@ enum ConnectionState { // ETH1ConnectionStatus states the current address and error of the ETH1 API // endpoint. It also provides the addresses and errors for any fallback URLs. message ETH1ConnectionStatus { + option deprecated = true; + // Current ETH1 HTTP endpoint. string current_address = 1; diff --git a/proto/prysm/v1alpha1/sync_committee.proto b/proto/prysm/v1alpha1/sync_committee.proto index 0f09db806dd2..c63d4a7f779a 100644 --- a/proto/prysm/v1alpha1/sync_committee.proto +++ b/proto/prysm/v1alpha1/sync_committee.proto @@ -26,6 +26,8 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1"; // Sync committee object to support light client. message SyncCommitteeMessage { + option deprecated = true; + // Slot to which this contribution pertains. uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = diff --git a/proto/prysm/v1alpha1/validator.proto b/proto/prysm/v1alpha1/validator.proto index 5c5bb045e718..a64f803dbf48 100644 --- a/proto/prysm/v1alpha1/validator.proto +++ b/proto/prysm/v1alpha1/validator.proto @@ -52,6 +52,7 @@ service BeaconNodeValidator { // recommended to poll at every slot to ensure validator is fully aware of any // sudden chain reorg. rpc GetDuties(DutiesRequest) returns (DutiesResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/duties" }; @@ -61,6 +62,7 @@ service BeaconNodeValidator { // from the running beacon node's state. This information is used when // validators sign blocks and attestations appropriately based on their duty. rpc DomainData(DomainRequest) returns (DomainResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/domain" }; @@ -90,10 +92,10 @@ service BeaconNodeValidator { // validator to those keys is activated. rpc WaitForActivation(ValidatorActivationRequest) returns (stream ValidatorActivationResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/activation/stream" }; - option deprecated = true; } // ValidatorIndex retrieves a validator's index location in the beacon state's @@ -101,6 +103,7 @@ service BeaconNodeValidator { // public key. This method returns NOT_FOUND if no index is found for the // public key specified in the request. rpc ValidatorIndex(ValidatorIndexRequest) returns (ValidatorIndexResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/index" }; @@ -119,6 +122,7 @@ service BeaconNodeValidator { //validator does not have a known status in the network. rpc ValidatorStatus(ValidatorStatusRequest) returns (ValidatorStatusResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/status" }; @@ -130,6 +134,7 @@ service BeaconNodeValidator { // Returns a list of ValidatorStatusResponses. rpc MultipleValidatorStatus(MultipleValidatorStatusRequest) returns (MultipleValidatorStatusResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/statuses" }; @@ -141,6 +146,7 @@ service BeaconNodeValidator { // be proposed on the beacon chain. The block should be filled with all the // necessary data for proposer to sign. rpc GetBeaconBlock(BlockRequest) returns (GenericBeaconBlock) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha2/validator/block" }; @@ -152,6 +158,7 @@ service BeaconNodeValidator { // beacon block can be included in the beacon chain. The beacon node is // expected to validate and process the beacon block into its state. rpc ProposeBeaconBlock(GenericSignedBeaconBlock) returns (ProposeResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha2/validator/block" body : "*" @@ -162,6 +169,7 @@ service BeaconNodeValidator { // preparing block proposal execution payloads. rpc PrepareBeaconProposer(PrepareBeaconProposerRequest) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/prepare_beacon_proposer" body : "*" @@ -172,6 +180,7 @@ service BeaconNodeValidator { // settings or db based on a given public key rpc GetFeeRecipientByPubKey(FeeRecipientByPubKeyRequest) returns (FeeRecipientByPubKeyResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/fee_recipient_by_pub_key" body : "*" @@ -184,6 +193,7 @@ service BeaconNodeValidator { // The server returns the latest valid data which represents the correct vote // for the head of the beacon chain. rpc GetAttestationData(AttestationDataRequest) returns (AttestationData) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/attestation" }; @@ -195,6 +205,7 @@ service BeaconNodeValidator { // attestation to be included in the beacon chain. The beacon node is expected // to validate and publish attestation on appropriate committee subnet. rpc ProposeAttestation(Attestation) returns (AttestResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/attestation" body : "*" @@ -207,6 +218,7 @@ service BeaconNodeValidator { // attestation to be included in the beacon chain. The beacon node is expected // to validate and publish attestation on appropriate committee subnet. rpc ProposeAttestationElectra(SingleAttestation) returns (AttestResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/attestation_electra" body : "*" @@ -218,6 +230,7 @@ service BeaconNodeValidator { // aggregate and proof object back to validator to sign over. rpc SubmitAggregateSelectionProof(AggregateSelectionRequest) returns (AggregateSelectionResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/aggregate" body : "*" @@ -229,6 +242,7 @@ service BeaconNodeValidator { // aggregate and proof object back to validator to sign over. rpc SubmitAggregateSelectionProofElectra(AggregateSelectionRequest) returns (AggregateSelectionElectraResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/aggregate_electra" body : "*" @@ -239,6 +253,7 @@ service BeaconNodeValidator { // the signed aggregated attestation and proof object. rpc SubmitSignedAggregateSelectionProof(SignedAggregateSubmitRequest) returns (SignedAggregateSubmitResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/aggregate" body : "*" @@ -250,6 +265,7 @@ service BeaconNodeValidator { rpc SubmitSignedAggregateSelectionProofElectra( SignedAggregateSubmitElectraRequest) returns (SignedAggregateSubmitResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/aggregate_electra" body : "*" @@ -261,6 +277,7 @@ service BeaconNodeValidator { // The beacon node is expected to validate the request and make it available // for inclusion in the next proposed block. rpc ProposeExit(SignedVoluntaryExit) returns (ProposeExitResponse) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/exit" body : "*" @@ -275,6 +292,7 @@ service BeaconNodeValidator { // serving aggregator can join the subnet. rpc SubscribeCommitteeSubnets(CommitteeSubnetsSubscribeRequest) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/subnet/subscribe" body : "*" @@ -284,6 +302,7 @@ service BeaconNodeValidator { // Checks the beacon node if another instance of the provided validator keys // have been attesting/proposing for you. rpc CheckDoppelGanger(DoppelGangerRequest) returns (DoppelGangerResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/doppelganger" }; @@ -293,6 +312,7 @@ service BeaconNodeValidator { // sync committee duty. rpc GetSyncMessageBlockRoot(google.protobuf.Empty) returns (SyncMessageBlockRootResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/sync_message_block_root" }; @@ -301,6 +321,7 @@ service BeaconNodeValidator { // Submits a sync committee message to be broadcasted over network. This is // part of sync committee duty. rpc SubmitSyncMessage(SyncCommitteeMessage) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/sync_message" body : "*" @@ -315,6 +336,7 @@ service BeaconNodeValidator { // sync committee message. rpc GetSyncSubcommitteeIndex(SyncSubcommitteeIndexRequest) returns (SyncSubcommitteeIndexResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/sync_subcommittee_index" }; @@ -326,6 +348,7 @@ service BeaconNodeValidator { // to sign over. rpc GetSyncCommitteeContribution(SyncCommitteeContributionRequest) returns (SyncCommitteeContribution) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/contribution_and_proof" body : "*" @@ -336,6 +359,7 @@ service BeaconNodeValidator { // node will broadcast the signed contribution and proof object. rpc SubmitSignedContributionAndProof(SignedContributionAndProof) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/signed_contribution_and_proof" body : "*" @@ -347,10 +371,10 @@ service BeaconNodeValidator { // DEPRECATED: This endpoint is superseded by the /eth/v1/events Beacon API // endpoint rpc StreamSlots(StreamSlotsRequest) returns (stream StreamSlotsResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/blocks/stream_slots" }; - option deprecated = true; } // Server-side stream of all signed blocks as they are received by @@ -359,14 +383,15 @@ service BeaconNodeValidator { // endpoint rpc StreamBlocksAltair(StreamBlocksRequest) returns (stream StreamBlocksResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/blocks/stream" }; - option deprecated = true; } rpc SubmitValidatorRegistrations(SignedValidatorRegistrationsV1) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/registration" body : "*" @@ -375,6 +400,7 @@ service BeaconNodeValidator { rpc AssignValidatorToSubnet(AssignValidatorToSubnetRequest) returns (google.protobuf.Empty) { + option deprecated = true; option (google.api.http) = { post : "/eth/v1alpha1/validator/blocks/assign_validator_to_subnet" body : "*" @@ -383,6 +409,7 @@ service BeaconNodeValidator { rpc AggregatedSigAndAggregationBits(AggregatedSigAndAggregationBitsRequest) returns (AggregatedSigAndAggregationBitsResponse) { + option deprecated = true; option (google.api.http) = { get : "/eth/v1alpha1/validator/blocks/aggregated_sig_and_aggregation_bits" }; @@ -393,6 +420,8 @@ service BeaconNodeValidator { // to sign over the block root as part of sync committee duty to facilitate // light client. message SyncMessageBlockRootResponse { + option deprecated = true; + // The block root of the head block. bytes root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; } @@ -400,6 +429,8 @@ message SyncMessageBlockRootResponse { // SyncSubcommitteeIndexRequest requests sync subcommittee index given the // validator public key. message SyncSubcommitteeIndexRequest { + option deprecated = true; + // The validator's public key. bytes public_key = 1 [ (ethereum.eth.ext.ssz_size) = "48" ]; // The slot of validator's assignment. @@ -410,6 +441,8 @@ message SyncSubcommitteeIndexRequest { } message SyncCommitteeContributionRequest { + option deprecated = true; + // Slot for which the aggregation request applies. uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = @@ -427,6 +460,8 @@ message SyncCommitteeContributionRequest { // SyncSubcommitteeIndexResponse responds index of the sync subcommittee of a // given validator. message SyncSubcommitteeIndexResponse { + option deprecated = true; + // The subcommittee index itself. // If the total validator count is not sufficient, there could be more than // one index. @@ -440,6 +475,7 @@ message SyncSubcommitteeIndexResponse { // Beacon API endpoint message StreamSlotsResponse { option deprecated = true; + uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot" @@ -450,6 +486,7 @@ message StreamSlotsResponse { // Beacon API endpoint message StreamBlocksResponse { option deprecated = true; + oneof block { // Representing a phase 0 block. SignedBeaconBlock phase0_block = 1; @@ -475,6 +512,8 @@ message StreamBlocksResponse { } message DomainRequest { + option deprecated = true; + // The epoch for which the domain is being requested. uint64 epoch = 1 [ (ethereum.eth.ext.cast_type) = @@ -486,17 +525,23 @@ message DomainRequest { } message DomainResponse { + option deprecated = true; + // The signature domain is a byte array used by validators when // signing data related to block proposals and attestations. bytes signature_domain = 1; } message ValidatorActivationRequest { + option deprecated = true; + // A list of 48 byte validator public keys. repeated bytes public_keys = 1 [ (ethereum.eth.ext.ssz_size) = "?,48" ]; } message ValidatorActivationResponse { + option deprecated = true; + message Status { // A 48 byte validator public key. bytes public_key = 1; @@ -515,6 +560,8 @@ message ValidatorActivationResponse { } message ChainStartResponse { + option deprecated = true; + // A boolean specifying whether or not the chain has started. bool started = 1; @@ -535,11 +582,15 @@ message SyncedResponse { } message ValidatorIndexRequest { + option deprecated = true; + // A 48 byte validator public key. bytes public_key = 1 [ (ethereum.eth.ext.ssz_size) = "48" ]; } message ValidatorIndexResponse { + option deprecated = true; + // The validator's index in the beacon chain state's validator registry. uint64 index = 1 [ (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/" @@ -547,6 +598,8 @@ message ValidatorIndexResponse { } message ValidatorStatusRequest { + option deprecated = true; + // A 48 byte validator public key. bytes public_key = 1 [ (ethereum.eth.ext.ssz_size) = "48" ]; } @@ -564,6 +617,8 @@ enum ValidatorStatus { } message ValidatorStatusResponse { + option deprecated = true; + // The corresponding validator status. ValidatorStatus status = 1; @@ -590,6 +645,8 @@ message ValidatorStatusResponse { } message MultipleValidatorStatusRequest { + option deprecated = true; + // A list of 48 byte validator public keys. repeated bytes public_keys = 1 [ (ethereum.eth.ext.ssz_size) = "?,48" ]; // A list of validator indices. @@ -597,6 +654,8 @@ message MultipleValidatorStatusRequest { } message MultipleValidatorStatusResponse { + option deprecated = true; + // A list of 48 byte validator public keys. repeated bytes public_keys = 1 [ (ethereum.eth.ext.ssz_size) = "?,48" ]; // A list of ValidatorStatusResponses mapped 1-to-1 with the public keys. @@ -609,6 +668,8 @@ message MultipleValidatorStatusResponse { } message DutiesRequest { + option deprecated = true; + // Epoch at which validators should perform their duties. uint64 epoch = 1 [ (ethereum.eth.ext.cast_type) = @@ -620,6 +681,8 @@ message DutiesRequest { } message DutiesResponse { + option deprecated = true; + reserved 1; // Deprecated fields repeated Duty current_epoch_duties = 2; @@ -674,6 +737,8 @@ message DutiesResponse { } message BlockRequest { + option deprecated = true; + // Slot for which the block should be proposed. uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = @@ -696,16 +761,22 @@ message BlockRequest { } message ProposeResponse { + option deprecated = true; + // The block root of the successfully proposed beacon block. bytes block_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; } message ProposeExitResponse { + option deprecated = true; + // The root of the successfully proposed voluntary exit. bytes exit_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; } message AttestationDataRequest { + option deprecated = true; + // Slot for which the attestation should be created. uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = @@ -720,11 +791,15 @@ message AttestationDataRequest { } message AttestResponse { + option deprecated = true; + // The root of the attestation data successfully submitted to the beacon node. bytes attestation_data_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; } message AggregateSelectionRequest { + option deprecated = true; + // Slot for which the aggregation request applies. uint64 slot = 1 [ (ethereum.eth.ext.cast_type) = @@ -746,31 +821,43 @@ message AggregateSelectionRequest { } message AggregateSelectionResponse { + option deprecated = true; + // The aggregate and proof message without the signature. AggregateAttestationAndProof aggregate_and_proof = 1; } message AggregateSelectionElectraResponse { + option deprecated = true; + // The aggregate and proof message without the signature. AggregateAttestationAndProofElectra aggregate_and_proof = 1; } message SignedAggregateSubmitRequest { + option deprecated = true; + // The signed aggregate and proof message with the signature. SignedAggregateAttestationAndProof signed_aggregate_and_proof = 1; } message SignedAggregateSubmitElectraRequest { + option deprecated = true; + // The signed aggregate and proof message with the signature. SignedAggregateAttestationAndProofElectra signed_aggregate_and_proof = 1; } message SignedAggregateSubmitResponse { + option deprecated = true; + // The 32 byte hash tree root of the aggregated attestation data. bytes attestation_data_root = 1 [ (ethereum.eth.ext.ssz_size) = "32" ]; } message CommitteeSubnetsSubscribeRequest { + option deprecated = true; + // A list of intended slots to subscribe. repeated uint64 slots = 1 [ (ethereum.eth.ext.cast_type) = @@ -920,6 +1007,8 @@ message ValidatorInfo { // DoppelGangerRequest represents the request sent by the validator in order to // determine if there is any duplicate instance of it running in the network. message DoppelGangerRequest { + option deprecated = true; + repeated ValidatorRequest validator_requests = 1; // ValidatorRequest data type which represents a request for each validator. @@ -942,6 +1031,8 @@ message DoppelGangerRequest { // DoppelGangerResponse is the response payload sent by the beacon node // after it has checked for all duplicate keys in the network. message DoppelGangerResponse { + option deprecated = true; + message ValidatorResponse { // The validator's 48 byte BLS public key. bytes public_key = 1 [ @@ -959,6 +1050,7 @@ message DoppelGangerResponse { // /eth/v1/events Beacon API endpoint. message StreamSlotsRequest { option deprecated = true; + bool verified_only = 1; } @@ -967,10 +1059,13 @@ message StreamSlotsRequest { // Beacon API endpoint message StreamBlocksRequest { option deprecated = true; + bool verified_only = 1; } message PrepareBeaconProposerRequest { + option deprecated = true; + message FeeRecipientContainer { // The address of the fee recipient. bytes fee_recipient = 1 [ (ethereum.eth.ext.ssz_size) = "20" ]; @@ -985,6 +1080,8 @@ message PrepareBeaconProposerRequest { } message FeeRecipientByPubKeyRequest { + option deprecated = true; + bytes public_key = 1 [ (ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey" @@ -992,10 +1089,14 @@ message FeeRecipientByPubKeyRequest { } message FeeRecipientByPubKeyResponse { + option deprecated = true; + bytes fee_recipient = 1 [ (ethereum.eth.ext.ssz_size) = "20" ]; } message AssignValidatorToSubnetRequest { + option deprecated = true; + bytes public_key = 1 [ (ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey" @@ -1004,6 +1105,8 @@ message AssignValidatorToSubnetRequest { } message AggregatedSigAndAggregationBitsRequest { + option deprecated = true; + repeated SyncCommitteeMessage msgs = 1; uint64 slot = 2 [ (ethereum.eth.ext.cast_type) = @@ -1014,6 +1117,8 @@ message AggregatedSigAndAggregationBitsRequest { } message AggregatedSigAndAggregationBitsResponse { + option deprecated = true; + bytes aggregated_sig = 1; bytes bits = 2; } From a043aff5a4db4d4f20a1520613814236da5169f3 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 15:56:59 +0100 Subject: [PATCH 2/6] server methods --- .../rpc/prysm/v1alpha1/beacon/assignments.go | 2 ++ .../rpc/prysm/v1alpha1/beacon/attestations.go | 11 ++++++++++ .../rpc/prysm/v1alpha1/beacon/blocks.go | 5 ++++- .../rpc/prysm/v1alpha1/beacon/committees.go | 2 ++ .../rpc/prysm/v1alpha1/beacon/config.go | 2 ++ .../rpc/prysm/v1alpha1/beacon/slashings.go | 5 +++++ .../rpc/prysm/v1alpha1/beacon/validators.go | 16 +++++++++++++++ .../rpc/prysm/v1alpha1/debug/block.go | 4 ++++ beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go | 4 ++++ .../rpc/prysm/v1alpha1/debug/server.go | 2 ++ .../rpc/prysm/v1alpha1/debug/state.go | 2 ++ .../rpc/prysm/v1alpha1/node/server.go | 20 +++++++++++++++++++ .../prysm/v1alpha1/validator/aggregator.go | 8 ++++++++ .../rpc/prysm/v1alpha1/validator/attester.go | 8 ++++++++ .../rpc/prysm/v1alpha1/validator/blocks.go | 4 ++++ .../rpc/prysm/v1alpha1/validator/duties.go | 4 ++++ .../rpc/prysm/v1alpha1/validator/exit.go | 2 ++ .../rpc/prysm/v1alpha1/validator/proposer.go | 14 +++++++++++-- .../rpc/prysm/v1alpha1/validator/server.go | 8 ++++++++ .../rpc/prysm/v1alpha1/validator/status.go | 6 ++++++ .../v1alpha1/validator/sync_committee.go | 12 +++++++++++ 21 files changed, 138 insertions(+), 3 deletions(-) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go index ed1965710557..9b52e7be608d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/assignments.go @@ -18,6 +18,8 @@ import ( const errEpoch = "cannot retrieve information about an epoch in the future, current epoch %d, requesting %d" +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListValidatorAssignments retrieves the validator assignments for a given epoch, // optional validator indices or public keys may be included to filter validator assignments. func (bs *Server) ListValidatorAssignments( diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go index fd8a5eab147f..af0f2dcad08a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/attestations.go @@ -49,6 +49,8 @@ func mapAttestationsByTargetRoot(atts []ethpb.Att) map[[32]byte][]ethpb.Att { return attsMap } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListAttestations retrieves attestations by block root, slot, or epoch. // Attestations are sorted by data slot by default. // @@ -113,6 +115,8 @@ func (bs *Server) ListAttestations( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListAttestationsElectra retrieves attestations by block root, slot, or epoch. // Attestations are sorted by data slot by default. // @@ -176,6 +180,8 @@ func (bs *Server) ListAttestationsElectra(ctx context.Context, req *ethpb.ListAt }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListIndexedAttestations retrieves indexed attestations by block root. // IndexedAttestationsForEpoch are sorted by data slot by default. Start-end epoch // filter is used to retrieve blocks with. @@ -236,6 +242,8 @@ func (bs *Server) ListIndexedAttestations( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListIndexedAttestationsElectra retrieves indexed attestations by block root. // IndexedAttestationsForEpoch are sorted by data slot by default. Start-end epoch // filter is used to retrieve blocks with. @@ -297,6 +305,8 @@ func (bs *Server) ListIndexedAttestationsElectra( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // AttestationPool retrieves pending attestations. // // The server returns a list of attestations that have been seen but not @@ -340,6 +350,7 @@ func (bs *Server) AttestationPool(_ context.Context, req *ethpb.AttestationPoolR }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (bs *Server) AttestationPoolElectra(_ context.Context, req *ethpb.AttestationPoolRequest) (*ethpb.AttestationPoolElectraResponse, error) { var atts []*ethpb.AttestationElectra var err error diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go index f61c8db0a23c..9b2319beae7d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go @@ -26,6 +26,8 @@ type blockContainer struct { isCanonical bool } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListBeaconBlocks retrieves blocks by root, slot, or epoch. // // The server may return multiple blocks in the case that a slot or epoch is @@ -244,12 +246,13 @@ func (bs *Server) listBlocksForGenesis(ctx context.Context, _ *ethpb.ListBlocksR }}, 1, strconv.Itoa(0), nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetChainHead retrieves information about the head of the beacon chain from // the view of the beacon chain node. // // This includes the head block slot and root as well as information about // the most recent finalized and justified slots. -// DEPRECATED: This endpoint is superseded by the /eth/v1/beacon API endpoint func (bs *Server) GetChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { ch, err := bs.CoreService.ChainHead(ctx) if err != nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go index 44fb8a2b0de7..40610f57b8c5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/committees.go @@ -15,6 +15,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListBeaconCommittees for a given epoch. // // If no filter criteria is specified, the response returns diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go index d5c22bc78cc8..39dbce43fe55 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/config.go @@ -10,6 +10,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetBeaconConfig retrieves the current configuration parameters of the beacon chain. func (_ *Server) GetBeaconConfig(_ context.Context, _ *emptypb.Empty) (*ethpb.BeaconConfig, error) { conf := params.BeaconConfig() diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go index db019f9160ad..6d5923a6c814 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/slashings.go @@ -11,6 +11,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitProposerSlashing receives a proposer slashing object via // RPC and injects it into the beacon node's operations pool. // Submission into this pool does not guarantee inclusion into a beacon block. @@ -36,10 +38,13 @@ func (bs *Server) SubmitProposerSlashing( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpb.AttesterSlashing) (*ethpb.SubmitSlashingResponse, error) { return bs.submitAttesterSlashing(ctx, req) } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitAttesterSlashingElectra receives an attester slashing object via // RPC and injects it into the beacon node's operations pool. // Submission into this pool does not guarantee inclusion into a beacon block. diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index e1c77ce9f25f..4a97e3b195fa 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -24,6 +24,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListValidatorBalances retrieves the validator balances for a given set of public keys. // An optional Epoch parameter is provided to request historical validator balances from // archived, persistent data. @@ -180,6 +182,8 @@ func (bs *Server) ListValidatorBalances( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListValidators retrieves the current list of active validators with an optional historical epoch flag to // retrieve validator set in time. func (bs *Server) ListValidators( @@ -338,6 +342,8 @@ func (bs *Server) ListValidators( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetValidator information from any validator in the registry by index or public key. func (bs *Server) GetValidator( ctx context.Context, req *ethpb.GetValidatorRequest, @@ -382,6 +388,8 @@ func (bs *Server) GetValidator( return nil, status.Error(codes.NotFound, "No validator matched filter criteria") } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetValidatorActiveSetChanges retrieves the active set changes for a given epoch. // // This data includes any activations, voluntary exits, and involuntary @@ -408,6 +416,8 @@ func (bs *Server) GetValidatorActiveSetChanges( return as, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetValidatorParticipation retrieves the validator participation information for a given epoch, // it returns the information about validator's participation rate in voting on the proof of stake // rules based on their balance compared to the total active validator balance. @@ -433,6 +443,8 @@ func (bs *Server) GetValidatorParticipation( return vp, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetValidatorQueue retrieves the current validator queue information. func (bs *Server) GetValidatorQueue( ctx context.Context, _ *emptypb.Empty, @@ -524,6 +536,8 @@ func (bs *Server) GetValidatorQueue( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetValidatorPerformance reports the validator's latest balance along with other important metrics on // rewards and penalties throughout its lifecycle in the beacon chain. func (bs *Server) GetValidatorPerformance( @@ -536,6 +550,8 @@ func (bs *Server) GetValidatorPerformance( return response, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetIndividualVotes retrieves individual voting status of validators. func (bs *Server) GetIndividualVotes( ctx context.Context, diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go index 808d66b05e6d..f1b9c199ed9a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/block.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/block.go @@ -17,6 +17,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetBlock in an ssz-encoded format by block root. func (ds *Server) GetBlock( ctx context.Context, @@ -39,6 +41,8 @@ func (ds *Server) GetBlock( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetInclusionSlot of an attestation in block. func (ds *Server) GetInclusionSlot(ctx context.Context, req *pbrpc.InclusionSlotRequest) (*pbrpc.InclusionSlotResponse, error) { ds.GenesisTimeFetcher.CurrentSlot() diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go b/beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go index 386ef08427e9..1a49d9337a90 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/p2p.go @@ -13,6 +13,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetPeer returns the data known about the peer defined by the provided peer id. func (ds *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb.DebugPeerResponse, error) { pid, err := peer.Decode(peerReq.PeerId) @@ -22,6 +24,8 @@ func (ds *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb return ds.getPeer(pid) } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListPeers returns all peers known to the host node, regardless of if they are connected/ // disconnected. func (ds *Server) ListPeers(_ context.Context, _ *empty.Empty) (*ethpb.DebugPeerResponses, error) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/server.go b/beacon-chain/rpc/prysm/v1alpha1/debug/server.go index e565a645651a..24cc80ada3d6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/server.go @@ -33,6 +33,8 @@ type Server struct { ReplayerBuilder stategen.ReplayerBuilder } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SetLoggingLevel of a beacon node according to a request type, // either INFO, DEBUG, or TRACE. func (_ *Server) SetLoggingLevel(_ context.Context, req *pbrpc.LoggingLevelRequest) (*empty.Empty, error) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/state.go b/beacon-chain/rpc/prysm/v1alpha1/debug/state.go index 230f278e4d7a..f3b15b99df0a 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/state.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/state.go @@ -10,6 +10,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetBeaconState retrieves an ssz-encoded beacon state // from the beacon node by either a slot or block root. func (ds *Server) GetBeaconState( diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server.go b/beacon-chain/rpc/prysm/v1alpha1/node/server.go index 135d08ee37e2..2af6c029015e 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server.go @@ -49,6 +49,8 @@ type Server struct { BeaconMonitoringPort int } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetHealth checks the health of the node func (ns *Server) GetHealth(ctx context.Context, request *ethpb.HealthRequest) (*empty.Empty, error) { ctx, span := trace.StartSpan(ctx, "node.GetHealth") @@ -78,6 +80,8 @@ func (ns *Server) GetHealth(ctx context.Context, request *ethpb.HealthRequest) ( return &empty.Empty{}, status.Errorf(codes.Unavailable, "service unavailable") } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetSyncStatus checks the current network sync status of the node. func (ns *Server) GetSyncStatus(_ context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) { return ðpb.SyncStatus{ @@ -85,6 +89,8 @@ func (ns *Server) GetSyncStatus(_ context.Context, _ *empty.Empty) (*ethpb.SyncS }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetGenesis fetches genesis chain information of Ethereum. Returns unix timestamp 0 // if a genesis time has yet to be determined. func (ns *Server) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { @@ -109,6 +115,8 @@ func (ns *Server) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesi }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetVersion checks the version information of the beacon node. func (_ *Server) GetVersion(_ context.Context, _ *empty.Empty) (*ethpb.Version, error) { return ðpb.Version{ @@ -116,6 +124,8 @@ func (_ *Server) GetVersion(_ context.Context, _ *empty.Empty) (*ethpb.Version, }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListImplementedServices lists the services implemented and enabled by this node. // // Any service not present in this list may return UNIMPLEMENTED or @@ -133,6 +143,8 @@ func (ns *Server) ListImplementedServices(_ context.Context, _ *empty.Empty) (*e }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetHost returns the p2p data on the current local and host peer. func (ns *Server) GetHost(_ context.Context, _ *empty.Empty) (*ethpb.HostData, error) { var stringAddr []string @@ -156,6 +168,8 @@ func (ns *Server) GetHost(_ context.Context, _ *empty.Empty) (*ethpb.HostData, e }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetPeer returns the data known about the peer defined by the provided peer id. func (ns *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb.Peer, error) { pid, err := peer.Decode(peerReq.PeerId) @@ -201,6 +215,8 @@ func (ns *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ListPeers lists the peers connected to this node. func (ns *Server) ListPeers(ctx context.Context, _ *empty.Empty) (*ethpb.Peers, error) { peers := ns.PeersFetcher.Peers().Connected() @@ -254,6 +270,8 @@ func (ns *Server) ListPeers(ctx context.Context, _ *empty.Empty) (*ethpb.Peers, }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetETH1ConnectionStatus gets data about the ETH1 endpoints. func (ns *Server) GetETH1ConnectionStatus(_ context.Context, _ *empty.Empty) (*ethpb.ETH1ConnectionStatus, error) { var currErr string @@ -268,6 +286,8 @@ func (ns *Server) GetETH1ConnectionStatus(_ context.Context, _ *empty.Empty) (*e }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // StreamBeaconLogs from the beacon node via a gRPC server-side stream. // DEPRECATED: This endpoint doesn't appear to be used and have been marked for deprecation. func (ns *Server) StreamBeaconLogs(_ *empty.Empty, stream ethpb.Health_StreamBeaconLogsServer) error { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go index 77aa570af3de..541edcd39aac 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go @@ -17,6 +17,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitAggregateSelectionProof is called by a validator when its assigned to be an aggregator. // The aggregator submits the selection proof to obtain the aggregated attestation // object to sign over. @@ -53,6 +55,8 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb. return ðpb.AggregateSelectionResponse{AggregateAndProof: attAndProof}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitAggregateSelectionProofElectra is called by a validator when its assigned to be an aggregator. // The aggregator submits the selection proof to obtain the aggregated attestation // object to sign over. @@ -145,6 +149,8 @@ func (vs *Server) processAggregateSelection(ctx context.Context, req *ethpb.Aggr return indexInCommittee, validatorIndex, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitSignedAggregateSelectionProof is called by a validator to broadcast a signed // aggregated and proof object. func (vs *Server) SubmitSignedAggregateSelectionProof( @@ -157,6 +163,8 @@ func (vs *Server) SubmitSignedAggregateSelectionProof( return ðpb.SignedAggregateSubmitResponse{}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitSignedAggregateSelectionProofElectra is called by a validator to broadcast a signed // aggregated and proof object. func (vs *Server) SubmitSignedAggregateSelectionProofElectra( diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go index 342bac44e16c..f7d5fa68b064 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/attester.go @@ -19,6 +19,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetAttestationData requests that the beacon node produce an attestation data object, // which the validator acting as an attester will then sign. func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { @@ -39,6 +41,8 @@ func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.Attestation return res, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ProposeAttestation is a function called by an attester to vote // on a block via an attestation object as defined in the Ethereum specification. func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation) (*ethpb.AttestResponse, error) { @@ -67,6 +71,8 @@ func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation return resp, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ProposeAttestationElectra is a function called by an attester to vote // on a block via an attestation object as defined in the Ethereum specification. func (vs *Server) ProposeAttestationElectra(ctx context.Context, singleAtt *ethpb.SingleAttestation) (*ethpb.AttestResponse, error) { @@ -105,6 +111,8 @@ func (vs *Server) ProposeAttestationElectra(ctx context.Context, singleAtt *ethp return resp, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubscribeCommitteeSubnets subscribes to the committee ID subnet given subscribe request. func (vs *Server) SubscribeCommitteeSubnets(ctx context.Context, req *ethpb.CommitteeSubnetsSubscribeRequest) (*emptypb.Empty, error) { ctx, span := trace.StartSpan(ctx, "AttesterServer.SubscribeCommitteeSubnets") diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go index 7ac22d33395f..374492dcdaef 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/blocks.go @@ -14,6 +14,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // StreamBlocksAltair to clients every single time a block is received by the beacon node. func (vs *Server) StreamBlocksAltair(req *ethpb.StreamBlocksRequest, stream ethpb.BeaconNodeValidator_StreamBlocksAltairServer) error { blocksChannel := make(chan *feed.Event, 1) @@ -47,6 +49,8 @@ func (vs *Server) StreamBlocksAltair(req *ethpb.StreamBlocksRequest, stream ethp } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // StreamSlots sends a block's slot to clients every single time a block is received by the beacon node. func (vs *Server) StreamSlots(req *ethpb.StreamSlotsRequest, stream ethpb.BeaconNodeValidator_StreamSlotsServer) error { ch := make(chan *feed.Event, 1) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go b/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go index 4d4a6ad53b12..7a816bb36dd1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/duties.go @@ -16,6 +16,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetDuties returns the duties assigned to a list of validators specified // in the request object. func (vs *Server) GetDuties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { @@ -163,6 +165,8 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb. }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // AssignValidatorToSubnet checks the status and pubkey of a particular validator // to discern whether persistent subnets need to be registered for them. func (vs *Server) AssignValidatorToSubnet(_ context.Context, req *ethpb.AssignValidatorToSubnetRequest) (*emptypb.Empty, error) { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/exit.go b/beacon-chain/rpc/prysm/v1alpha1/validator/exit.go index 8dbfeddd8c55..3d6673b82878 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/exit.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/exit.go @@ -12,6 +12,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ProposeExit proposes an exit for a validator. func (vs *Server) ProposeExit(ctx context.Context, req *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { if req == nil { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index bfff7b947c96..89696bd561d3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -45,6 +45,8 @@ const ( defaultBuilderBoostFactor = primitives.Gwei(100) ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign // by passing in the slot and the signed randao reveal of the slot. func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { @@ -98,7 +100,7 @@ func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) ( builderBoostFactor = primitives.Gwei(req.BuilderBoostFactor.Value) } - resp, err := vs.BuildBlockParallel(ctx, sBlk, head, req.SkipMevBoost, builderBoostFactor) + resp, err := vs.buildBlockParallel(ctx, sBlk, head, req.SkipMevBoost, builderBoostFactor) log := log.WithFields(logrus.Fields{ "slot": req.Slot, "sinceSlotStartTime": time.Since(t), @@ -182,7 +184,7 @@ func (vs *Server) getParentState(ctx context.Context, slot primitives.Slot) (sta return head, parentRoot, err } -func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, skipMevBoost bool, builderBoostFactor primitives.Gwei) (*ethpb.GenericBeaconBlock, error) { +func (vs *Server) buildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, skipMevBoost bool, builderBoostFactor primitives.Gwei) (*ethpb.GenericBeaconBlock, error) { // Build consensus fields in background var wg sync.WaitGroup wg.Add(1) @@ -269,6 +271,8 @@ func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.Signed return vs.constructGenericBeaconBlock(sBlk, bundle, winningBid) } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ProposeBeaconBlock handles the proposal of beacon blocks. func (vs *Server) ProposeBeaconBlock(ctx context.Context, req *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { ctx, span := trace.StartSpan(ctx, "ProposerServer.ProposeBeaconBlock") @@ -408,6 +412,8 @@ func (vs *Server) broadcastAndReceiveBlobs(ctx context.Context, sidecars []*ethp return eg.Wait() } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // PrepareBeaconProposer caches and updates the fee recipient for the given proposer. func (vs *Server) PrepareBeaconProposer( _ context.Context, request *ethpb.PrepareBeaconProposerRequest, @@ -443,6 +449,8 @@ func (vs *Server) PrepareBeaconProposer( return &emptypb.Empty{}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetFeeRecipientByPubKey returns a fee recipient from the beacon node's settings or db based on a given public key func (vs *Server) GetFeeRecipientByPubKey(ctx context.Context, request *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { ctx, span := trace.StartSpan(ctx, "validator.GetFeeRecipientByPublicKey") @@ -498,6 +506,8 @@ func (vs *Server) computeStateRoot(ctx context.Context, block interfaces.ReadOnl return root[:], nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitValidatorRegistrations submits validator registrations. func (vs *Server) SubmitValidatorRegistrations(ctx context.Context, reg *ethpb.SignedValidatorRegistrationsV1) (*emptypb.Empty, error) { if vs.BlockBuilder == nil || !vs.BlockBuilder.Configured() { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index d125abfbd694..30225ace54a7 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -82,6 +82,8 @@ type Server struct { AttestationStateFetcher blockchain.AttestationStateFetcher } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WaitForActivation checks if a validator public key exists in the active validator registry of the current // beacon state, if not, then it creates a stream which listens for canonical states which contain // the validator with the public key as an active validator record. @@ -130,6 +132,8 @@ func (vs *Server) WaitForActivation(req *ethpb.ValidatorActivationRequest, strea } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ValidatorIndex is called by a validator to get its index location in the beacon state. func (vs *Server) ValidatorIndex(ctx context.Context, req *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { st, err := vs.HeadFetcher.HeadStateReadOnly(ctx) @@ -147,6 +151,8 @@ func (vs *Server) ValidatorIndex(ctx context.Context, req *ethpb.ValidatorIndexR return ðpb.ValidatorIndexResponse{Index: index}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // DomainData fetches the current domain version information from the beacon state. func (vs *Server) DomainData(ctx context.Context, request *ethpb.DomainRequest) (*ethpb.DomainResponse, error) { fork, err := forks.Fork(request.Epoch) @@ -177,6 +183,8 @@ func (vs *Server) DomainData(ctx context.Context, request *ethpb.DomainRequest) }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WaitForChainStart queries the logs of the Deposit Contract in order to verify the beacon chain // has started its runtime and validators begin their responsibilities. If it has not, it then // subscribes to an event stream triggered by the powchain service whenever the ChainStart log does diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go index d801c9baba75..50a7e2295349 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/status.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/status.go @@ -29,6 +29,8 @@ var nonExistentIndex = primitives.ValidatorIndex(^uint64(0)) var errParticipation = status.Errorf(codes.Internal, "Failed to obtain epoch participation") +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ValidatorStatus returns the validator status of the current epoch. // The status response can be one of the following: // @@ -52,6 +54,8 @@ func (vs *Server) ValidatorStatus( return vStatus, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // MultipleValidatorStatus is the same as ValidatorStatus. Supports retrieval of multiple // validator statuses. Takes a list of public keys or a list of validator indices. func (vs *Server) MultipleValidatorStatus( @@ -100,6 +104,8 @@ func (vs *Server) MultipleValidatorStatus( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // CheckDoppelGanger checks if the provided keys are currently active in the network. func (vs *Server) CheckDoppelGanger(ctx context.Context, req *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) { if vs.SyncChecker.Syncing() { diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/sync_committee.go b/beacon-chain/rpc/prysm/v1alpha1/validator/sync_committee.go index aa90df196d44..007c1e4b94bb 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/sync_committee.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/sync_committee.go @@ -12,6 +12,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetSyncMessageBlockRoot retrieves the sync committee block root of the beacon chain. func (vs *Server) GetSyncMessageBlockRoot( ctx context.Context, _ *emptypb.Empty, @@ -32,6 +34,8 @@ func (vs *Server) GetSyncMessageBlockRoot( }, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitSyncMessage submits the sync committee message to the network. // It also saves the sync committee message into the pending pool for block inclusion. func (vs *Server) SubmitSyncMessage(ctx context.Context, msg *ethpb.SyncCommitteeMessage) (*emptypb.Empty, error) { @@ -41,6 +45,8 @@ func (vs *Server) SubmitSyncMessage(ctx context.Context, msg *ethpb.SyncCommitte return &emptypb.Empty{}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetSyncSubcommitteeIndex is called by a sync committee participant to get // its subcommittee index for sync message aggregation duty. func (vs *Server) GetSyncSubcommitteeIndex( @@ -57,6 +63,8 @@ func (vs *Server) GetSyncSubcommitteeIndex( return ðpb.SyncSubcommitteeIndexResponse{Indices: indices}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // GetSyncCommitteeContribution is called by a sync committee aggregator // to retrieve sync committee contribution object. func (vs *Server) GetSyncCommitteeContribution( @@ -98,6 +106,8 @@ func (vs *Server) GetSyncCommitteeContribution( return contribution, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // SubmitSignedContributionAndProof is called by a sync committee aggregator // to submit signed contribution and proof object. func (vs *Server) SubmitSignedContributionAndProof( @@ -110,6 +120,8 @@ func (vs *Server) SubmitSignedContributionAndProof( return &emptypb.Empty{}, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // AggregatedSigAndAggregationBits returns the aggregated signature and aggregation bits // associated with a particular set of sync committee messages. func (vs *Server) AggregatedSigAndAggregationBits( From a5dc66a40e2561f02c811ad9f8f95a50339a6b6f Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 16:23:20 +0100 Subject: [PATCH 3/6] grpc validator --- .../grpc-api/grpc_beacon_chain_client.go | 7 ++++ validator/client/grpc-api/grpc_node_client.go | 7 ++++ .../grpc_prysm_beacon_chain_client.go | 2 + .../client/grpc-api/grpc_validator_client.go | 38 ++++++++++++++++++- 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/validator/client/grpc-api/grpc_beacon_chain_client.go b/validator/client/grpc-api/grpc_beacon_chain_client.go index 1d575d9e1a50..ef5bbf58fcb5 100644 --- a/validator/client/grpc-api/grpc_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_beacon_chain_client.go @@ -13,30 +13,37 @@ type grpcChainClient struct { beaconChainClient ethpb.BeaconChainClient } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) ChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { return c.beaconChainClient.GetChainHead(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { return c.beaconChainClient.ListValidatorBalances(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { return c.beaconChainClient.ListValidators(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { return c.beaconChainClient.GetValidatorQueue(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { return c.beaconChainClient.GetValidatorPerformance(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { return c.beaconChainClient.GetValidatorParticipation(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func NewGrpcChainClient(cc grpc.ClientConnInterface) iface.ChainClient { return &grpcChainClient{ethpb.NewBeaconChainClient(cc)} } diff --git a/validator/client/grpc-api/grpc_node_client.go b/validator/client/grpc-api/grpc_node_client.go index 54bf320a5087..40cdc1a68343 100644 --- a/validator/client/grpc-api/grpc_node_client.go +++ b/validator/client/grpc-api/grpc_node_client.go @@ -20,22 +20,27 @@ type grpcNodeClient struct { healthTracker *beacon.NodeHealthTracker } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) SyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) { return c.nodeClient.GetSyncStatus(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) Genesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) { return c.nodeClient.GetGenesis(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) Version(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) { return c.nodeClient.GetVersion(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { return c.nodeClient.ListPeers(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) IsHealthy(ctx context.Context) bool { _, err := c.nodeClient.GetHealth(ctx, ðpb.HealthRequest{}) if err != nil { @@ -45,10 +50,12 @@ func (c *grpcNodeClient) IsHealthy(ctx context.Context) bool { return true } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcNodeClient) HealthTracker() *beacon.NodeHealthTracker { return c.healthTracker } +// Deprecated: gRPC API is being deprecated in favour of REST API. func NewNodeClient(cc grpc.ClientConnInterface) iface.NodeClient { g := &grpcNodeClient{nodeClient: ethpb.NewNodeClient(cc)} g.healthTracker = beacon.NewNodeHealthTracker(g) diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index dac34f019dc6..5bda6532985d 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -21,6 +21,7 @@ type grpcPrysmChainClient struct { chainClient iface.ChainClient } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (g grpcPrysmChainClient) ValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { resp, err := g.chainClient.Validators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) if err != nil { @@ -91,6 +92,7 @@ func validatorCountByStatus(validators []*ethpb.Validator, statuses []validator. return resp, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. func NewGrpcPrysmChainClient(cc grpc.ClientConnInterface) iface.PrysmChainClient { return &grpcPrysmChainClient{chainClient: &grpcChainClient{ethpb.NewBeaconChainClient(cc)}} } diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index 4e9cdd4d3cd9..d97bf8b65bbd 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -23,111 +23,137 @@ type grpcValidatorClient struct { isEventStreamRunning bool } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { return c.beaconNodeValidatorClient.GetDuties(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) CheckDoppelGanger(ctx context.Context, in *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) { return c.beaconNodeValidatorClient.CheckDoppelGanger(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) DomainData(ctx context.Context, in *ethpb.DomainRequest) (*ethpb.DomainResponse, error) { return c.beaconNodeValidatorClient.DomainData(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { return c.beaconNodeValidatorClient.GetAttestationData(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { return c.beaconNodeValidatorClient.GetBeaconBlock(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { return c.beaconNodeValidatorClient.GetFeeRecipientByPubKey(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { return c.beaconNodeValidatorClient.GetSyncCommitteeContribution(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { return c.beaconNodeValidatorClient.GetSyncMessageBlockRoot(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { return c.beaconNodeValidatorClient.GetSyncSubcommitteeIndex(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) MultipleValidatorStatus(ctx context.Context, in *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error) { return c.beaconNodeValidatorClient.MultipleValidatorStatus(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) PrepareBeaconProposer(ctx context.Context, in *ethpb.PrepareBeaconProposerRequest) (*empty.Empty, error) { return c.beaconNodeValidatorClient.PrepareBeaconProposer(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ProposeAttestation(ctx context.Context, in *ethpb.Attestation) (*ethpb.AttestResponse, error) { return c.beaconNodeValidatorClient.ProposeAttestation(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ProposeAttestationElectra(ctx context.Context, in *ethpb.SingleAttestation) (*ethpb.AttestResponse, error) { return c.beaconNodeValidatorClient.ProposeAttestationElectra(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { return c.beaconNodeValidatorClient.ProposeBeaconBlock(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ProposeExit(ctx context.Context, in *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { return c.beaconNodeValidatorClient.ProposeExit(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) StreamBlocksAltair(ctx context.Context, in *ethpb.StreamBlocksRequest) (ethpb.BeaconNodeValidator_StreamBlocksAltairClient, error) { return c.beaconNodeValidatorClient.StreamBlocksAltair(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitAggregateSelectionProof(ctx context.Context, in *ethpb.AggregateSelectionRequest, _ primitives.ValidatorIndex, _ uint64) (*ethpb.AggregateSelectionResponse, error) { return c.beaconNodeValidatorClient.SubmitAggregateSelectionProof(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitAggregateSelectionProofElectra(ctx context.Context, in *ethpb.AggregateSelectionRequest, _ primitives.ValidatorIndex, _ uint64) (*ethpb.AggregateSelectionElectraResponse, error) { return c.beaconNodeValidatorClient.SubmitAggregateSelectionProofElectra(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) { return c.beaconNodeValidatorClient.SubmitSignedAggregateSelectionProof(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitSignedAggregateSelectionProofElectra(ctx context.Context, in *ethpb.SignedAggregateSubmitElectraRequest) (*ethpb.SignedAggregateSubmitResponse, error) { return c.beaconNodeValidatorClient.SubmitSignedAggregateSelectionProofElectra(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) { return c.beaconNodeValidatorClient.SubmitSignedContributionAndProof(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitSyncMessage(ctx context.Context, in *ethpb.SyncCommitteeMessage) (*empty.Empty, error) { return c.beaconNodeValidatorClient.SubmitSyncMessage(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubmitValidatorRegistrations(ctx context.Context, in *ethpb.SignedValidatorRegistrationsV1) (*empty.Empty, error) { return c.beaconNodeValidatorClient.SubmitValidatorRegistrations(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) SubscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, _ []*ethpb.DutiesResponse_Duty) (*empty.Empty, error) { return c.beaconNodeValidatorClient.SubscribeCommitteeSubnets(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ValidatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { return c.beaconNodeValidatorClient.ValidatorIndex(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) ValidatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) { return c.beaconNodeValidatorClient.ValidatorStatus(ctx, in) } -// Deprecated: Do not use. +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) WaitForChainStart(ctx context.Context, in *empty.Empty) (*ethpb.ChainStartResponse, error) { stream, err := c.beaconNodeValidatorClient.WaitForChainStart(ctx, in) if err != nil { @@ -140,9 +166,12 @@ func (c *grpcValidatorClient) WaitForChainStart(ctx context.Context, in *empty.E return stream.Recv() } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) AssignValidatorToSubnet(ctx context.Context, in *ethpb.AssignValidatorToSubnetRequest) (*empty.Empty, error) { return c.beaconNodeValidatorClient.AssignValidatorToSubnet(ctx, in) } + +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( ctx context.Context, in *ethpb.AggregatedSigAndAggregationBitsRequest, @@ -150,18 +179,22 @@ func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( return c.beaconNodeValidatorClient.AggregatedSigAndAggregationBits(ctx, in) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (*grpcValidatorClient) AggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return nil, iface.ErrNotSupported } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (*grpcValidatorClient) AggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return nil, iface.ErrNotSupported } +// Deprecated: gRPC API is being deprecated in favour of REST API. func NewGrpcValidatorClient(cc grpc.ClientConnInterface) iface.ValidatorClient { return &grpcValidatorClient{ethpb.NewBeaconNodeValidatorClient(cc), false} } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) StartEventStream(ctx context.Context, topics []string, eventsChannel chan<- *eventClient.Event) { ctx, span := trace.StartSpan(ctx, "validator.gRPCClient.StartEventStream") defer span.End() @@ -250,15 +283,18 @@ func (c *grpcValidatorClient) StartEventStream(ctx context.Context, topics []str } } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *grpcValidatorClient) EventStreamIsRunning() bool { return c.isEventStreamRunning } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (*grpcValidatorClient) Host() string { log.Warn(iface.ErrNotSupported) return "" } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (*grpcValidatorClient) SetHost(_ string) { log.Warn(iface.ErrNotSupported) } From 8e68cb5ac4a85e16d767217bef7965ad3b22eb88 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 16:40:35 +0100 Subject: [PATCH 4/6] server structs --- beacon-chain/rpc/prysm/v1alpha1/beacon/server.go | 2 ++ beacon-chain/rpc/prysm/v1alpha1/debug/server.go | 2 ++ beacon-chain/rpc/prysm/v1alpha1/node/server.go | 2 ++ beacon-chain/rpc/prysm/v1alpha1/validator/server.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go index a2b464105eca..cb4ed8a568ec 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go @@ -23,6 +23,8 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Server defines a server implementation of the gRPC Beacon Chain service, // providing RPC endpoints to access data relevant to the Ethereum beacon chain. type Server struct { diff --git a/beacon-chain/rpc/prysm/v1alpha1/debug/server.go b/beacon-chain/rpc/prysm/v1alpha1/debug/server.go index 24cc80ada3d6..eb070a214db1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/debug/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/debug/server.go @@ -20,6 +20,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Server defines a server implementation of the gRPC Debug service, // providing RPC endpoints for runtime debugging of a node, this server is // gated behind the feature flag --enable-debug-rpc-endpoints. diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server.go b/beacon-chain/rpc/prysm/v1alpha1/node/server.go index 2af6c029015e..bd6d77c1879c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server.go @@ -31,6 +31,8 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Server defines a server implementation of the gRPC Node service, // providing RPC endpoints for verifying a beacon node's sync status, genesis and // version information, and services the node implements and runs. diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go index 30225ace54a7..55a3ced92139 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/server.go @@ -37,6 +37,8 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Server defines a server implementation of the gRPC Validator service, // providing RPC endpoints for obtaining validator assignments per epoch, the slots // and committees in which particular validators need to perform their responsibilities, From 7582d2cba03b7ef280cf754bfdc177b23d4e393a Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 17:07:47 +0100 Subject: [PATCH 5/6] functions, types, fields etc --- api/grpc/grpcutils.go | 6 ++ api/grpc/parameters.go | 8 +++ beacon-chain/rpc/core/errors.go | 1 + .../rpc/eth/helpers/error_handling.go | 2 + beacon-chain/rpc/eth/node/server.go | 5 +- .../rpc/prysm/v1alpha1/node/server.go | 1 + beacon-chain/rpc/service.go | 46 +++++++----- cmd/flags.go | 3 +- cmd/validator/flags/flags.go | 18 +++-- config/features/config.go | 3 + config/features/flags.go | 5 +- validator/accounts/accounts_list_test.go | 9 +-- validator/accounts/cli_manager.go | 47 +++++++------ validator/accounts/cli_options.go | 6 ++ .../client/beacon-api/beacon_api_helpers.go | 1 + validator/client/beacon-api/stream_blocks.go | 1 + .../grpc-api/grpc_beacon_chain_client.go | 1 + validator/client/grpc-api/grpc_node_client.go | 1 + .../grpc_prysm_beacon_chain_client.go | 1 + .../client/grpc-api/grpc_validator_client.go | 1 + .../multiple_endpoints_grpc_resolver.go | 12 ++++ validator/client/service.go | 23 +++--- validator/helpers/node_connection.go | 3 + validator/rpc/intercepter.go | 2 + validator/rpc/server.go | 70 +++++++++++-------- 25 files changed, 182 insertions(+), 94 deletions(-) diff --git a/api/grpc/grpcutils.go b/api/grpc/grpcutils.go index d0dd8be5e484..55f98e6f9c23 100644 --- a/api/grpc/grpcutils.go +++ b/api/grpc/grpcutils.go @@ -10,6 +10,8 @@ import ( "google.golang.org/grpc/metadata" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // LogRequests logs the gRPC backend as well as request duration when the log level is set to debug // or higher. func LogRequests( @@ -38,6 +40,8 @@ func LogRequests( return err } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // LogStream prints the method at DEBUG level at the start of the stream. func LogStream( ctx context.Context, @@ -64,6 +68,8 @@ func LogStream( return strm, err } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // AppendHeaders parses the provided GRPC headers // and attaches them to the provided context. func AppendHeaders(parent context.Context, headers []string) context.Context { diff --git a/api/grpc/parameters.go b/api/grpc/parameters.go index 5f0b34be9156..4026411e3167 100644 --- a/api/grpc/parameters.go +++ b/api/grpc/parameters.go @@ -1,15 +1,23 @@ package grpc +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // CustomErrorMetadataKey is the name of the metadata key storing additional error information. // Metadata value is expected to be a byte-encoded JSON object. const CustomErrorMetadataKey = "Custom-Error" +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // HttpCodeMetadataKey is the key to use when setting custom HTTP status codes in gRPC metadata. const HttpCodeMetadataKey = "X-Http-Code" +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // MetadataPrefix is the prefix for grpc headers on metadata const MetadataPrefix = "Grpc-Metadata" +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WithPrefix creates a new string with grpc metadata prefix func WithPrefix(value string) string { return MetadataPrefix + "-" + value diff --git a/beacon-chain/rpc/core/errors.go b/beacon-chain/rpc/core/errors.go index 8181c85b87f5..d242f8c0863b 100644 --- a/beacon-chain/rpc/core/errors.go +++ b/beacon-chain/rpc/core/errors.go @@ -21,6 +21,7 @@ type RpcError struct { Reason ErrorReason } +// Deprecated: gRPC API is being deprecated in favour of REST API. func ErrorReasonToGRPC(reason ErrorReason) codes.Code { switch reason { case Internal: diff --git a/beacon-chain/rpc/eth/helpers/error_handling.go b/beacon-chain/rpc/eth/helpers/error_handling.go index 12561e13fa60..b2a00b1f435e 100644 --- a/beacon-chain/rpc/eth/helpers/error_handling.go +++ b/beacon-chain/rpc/eth/helpers/error_handling.go @@ -11,6 +11,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // PrepareStateFetchGRPCError returns an appropriate gRPC error based on the supplied argument. // The argument error should be a result of fetching state. func PrepareStateFetchGRPCError(err error) error { diff --git a/beacon-chain/rpc/eth/node/server.go b/beacon-chain/rpc/eth/node/server.go index 7aac16878aad..0c7b9135fed8 100644 --- a/beacon-chain/rpc/eth/node/server.go +++ b/beacon-chain/rpc/eth/node/server.go @@ -16,8 +16,9 @@ import ( // providing RPC endpoints for verifying a beacon node's sync status, genesis and // version information. type Server struct { - SyncChecker sync.Checker - OptimisticModeFetcher blockchain.OptimisticModeFetcher + SyncChecker sync.Checker + OptimisticModeFetcher blockchain.OptimisticModeFetcher + // Deprecated: gRPC API is being deprecated in favour of REST API. Server *grpc.Server BeaconDB db.ReadOnlyDatabase PeersFetcher p2p.PeersProvider diff --git a/beacon-chain/rpc/prysm/v1alpha1/node/server.go b/beacon-chain/rpc/prysm/v1alpha1/node/server.go index bd6d77c1879c..f01589fb39e5 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/node/server.go +++ b/beacon-chain/rpc/prysm/v1alpha1/node/server.go @@ -40,6 +40,7 @@ type Server struct { LogsStreamer logs.Streamer StreamLogsBufferSize int SyncChecker sync.Checker + // Deprecated: gRPC API is being deprecated in favour of REST API. Server *grpc.Server BeaconDB db.ReadOnlyDatabase PeersFetcher p2p.PeersProvider diff --git a/beacon-chain/rpc/service.go b/beacon-chain/rpc/service.go index 08585a2201bb..fc420e9d8352 100644 --- a/beacon-chain/rpc/service.go +++ b/beacon-chain/rpc/service.go @@ -57,16 +57,20 @@ const attestationBufferSize = 100 // Service defining an RPC server for a beacon node. type Service struct { - cfg *Config - ctx context.Context - cancel context.CancelFunc - listener net.Listener - grpcServer *grpc.Server - incomingAttestation chan *ethpbv1alpha1.Attestation - credentialError error - connectedRPCClients map[net.Addr]bool + cfg *Config + ctx context.Context + cancel context.CancelFunc + listener net.Listener + // Deprecated: gRPC API is being deprecated in favour of REST API. + grpcServer *grpc.Server + incomingAttestation chan *ethpbv1alpha1.Attestation + credentialError error + // Deprecated: gRPC API is being deprecated in favour of REST API. + connectedRPCClients map[net.Addr]bool + // Deprecated: gRPC API is being deprecated in favour of REST API. clientConnectionLock sync.Mutex - validatorServer *validatorv1alpha1.Server + // Deprecated: gRPC API is being deprecated in favour of REST API. + validatorServer *validatorv1alpha1.Server } // Config options for the beacon node RPC server. @@ -112,15 +116,16 @@ type Config struct { BlockNotifier blockfeed.Notifier OperationNotifier opfeed.Notifier StateGen *stategen.State - MaxMsgSize int - ExecutionEngineCaller execution.EngineCaller - OptimisticModeFetcher blockchain.OptimisticModeFetcher - BlockBuilder builder.BlockBuilder - Router *http.ServeMux - ClockWaiter startup.ClockWaiter - BlobStorage *filesystem.BlobStorage - TrackedValidatorsCache *cache.TrackedValidatorsCache - PayloadIDCache *cache.PayloadIDCache + // Deprecated: gRPC API is being deprecated in favour of REST API. + MaxMsgSize int + ExecutionEngineCaller execution.EngineCaller + OptimisticModeFetcher blockchain.OptimisticModeFetcher + BlockBuilder builder.BlockBuilder + Router *http.ServeMux + ClockWaiter startup.ClockWaiter + BlobStorage *filesystem.BlobStorage + TrackedValidatorsCache *cache.TrackedValidatorsCache + PayloadIDCache *cache.PayloadIDCache } // NewService instantiates a new RPC service instance that will @@ -369,6 +374,8 @@ func (s *Service) Status() error { return nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Stream interceptor for new validator client connections to the beacon node. func (s *Service) validatorStreamConnectionInterceptor( srv interface{}, @@ -380,6 +387,8 @@ func (s *Service) validatorStreamConnectionInterceptor( return handler(srv, ss) } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Unary interceptor for new validator client connections to the beacon node. func (s *Service) validatorUnaryConnectionInterceptor( ctx context.Context, @@ -391,6 +400,7 @@ func (s *Service) validatorUnaryConnectionInterceptor( return handler(ctx, req) } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (s *Service) logNewClientConnection(ctx context.Context) { if features.Get().DisableGRPCConnectionLogs { return diff --git a/cmd/flags.go b/cmd/flags.go index 6c1c44e8d947..26404484db06 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -236,7 +236,8 @@ var ( // GrpcMaxCallRecvMsgSizeFlag defines the max call message size for GRPC GrpcMaxCallRecvMsgSizeFlag = &cli.IntFlag{ Name: "grpc-max-msg-size", - Usage: `Integer to define max receive message call size (in bytes). + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Integer to define max receive message call size (in bytes). If serving a public gRPC server, set this to a more reasonable size to avoid resource exhaustion from large messages. Validators with as many as 10000 keys can be run with a max message size of less than diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index e873d16c3f20..e162478f9808 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -31,8 +31,9 @@ var ( } // BeaconRPCProviderFlag defines a beacon node RPC endpoint. BeaconRPCProviderFlag = &cli.StringFlag{ - Name: "beacon-rpc-provider", - Usage: "Beacon node RPC provider endpoint.", + Name: "beacon-rpc-provider", + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Beacon node RPC provider endpoint.`, Value: "127.0.0.1:4000", } @@ -88,20 +89,23 @@ var ( } // GRPCRetriesFlag defines the number of times to retry a failed gRPC request. GRPCRetriesFlag = &cli.UintFlag{ - Name: "grpc-retries", - Usage: "Number of attempts to retry gRPC requests.", + Name: "grpc-retries", + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Number of attempts to retry gRPC requests.`, Value: 5, } // GRPCRetryDelayFlag defines the interval to retry a failed gRPC request. GRPCRetryDelayFlag = &cli.DurationFlag{ - Name: "grpc-retry-delay", - Usage: "Amount of time between gRPC retry requests.", + Name: "grpc-retry-delay", + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Amount of time between gRPC retry requests.`, Value: 1 * time.Second, } // GRPCHeadersFlag defines a list of headers to send with all gRPC requests. GRPCHeadersFlag = &cli.StringFlag{ Name: "grpc-headers", - Usage: `Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls. + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Comma separated list of key value pairs to pass as gRPC headers for all gRPC calls. Example: --grpc-headers=key=value`, } // HTTPServerHost specifies a HTTP server host for the validator client. diff --git a/config/features/config.go b/config/features/config.go index 1ceb28edf7fc..27d0be1a71aa 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -50,7 +50,10 @@ type Flags struct { EnableBeaconRESTApi bool // EnableBeaconRESTApi enables experimental usage of the beacon REST API by the validator when querying a beacon node DisableCommitteeAwarePacking bool // DisableCommitteeAwarePacking changes the attestation packing algorithm to one that is not aware of attesting committees. EnableExperimentalAttestationPool bool // EnableExperimentalAttestationPool enables an experimental attestation pool design. + // Logging related toggles. + + // Deprecated: gRPC API is being deprecated in favour of REST API. DisableGRPCConnectionLogs bool // Disables logging when a new grpc client has connected. EnableFullSSZDataLogging bool // Enables logging for full ssz data on rejected gossip messages diff --git a/config/features/flags.go b/config/features/flags.go index d7a60a923f05..baee94324527 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -45,8 +45,9 @@ var ( Usage: "Writes invalid blobs to temp directory.", } disableGRPCConnectionLogging = &cli.BoolFlag{ - Name: "disable-grpc-connection-logging", - Usage: "Disables displaying logs for newly connected grpc clients.", + Name: "disable-grpc-connection-logging", + Usage: `WARNING: gRPC API is being deprecated in favour of REST API. + Disables displaying logs for newly connected grpc clients.`, } disablePeerScorer = &cli.BoolFlag{ Name: "disable-peer-scorer", diff --git a/validator/accounts/accounts_list_test.go b/validator/accounts/accounts_list_test.go index 7724df8626f5..7a32500fae7e 100644 --- a/validator/accounts/accounts_list_test.go +++ b/validator/accounts/accounts_list_test.go @@ -35,10 +35,11 @@ const ( ) type testWalletConfig struct { - exitAll bool - skipDepositConfirm bool - keymanagerKind keymanager.Kind - numAccounts int64 + exitAll bool + skipDepositConfirm bool + keymanagerKind keymanager.Kind + numAccounts int64 + // Deprecated: gRPC API is being deprecated in favour of REST API. grpcHeaders string privateKeyFile string accountPasswordFile string diff --git a/validator/accounts/cli_manager.go b/validator/accounts/cli_manager.go index 3f0116e3c65a..714d23b313d8 100644 --- a/validator/accounts/cli_manager.go +++ b/validator/accounts/cli_manager.go @@ -47,28 +47,31 @@ type CLIManager struct { importPrivateKeys bool readPasswordFile bool skipMnemonicConfirm bool - dialOpts []grpc.DialOption - grpcHeaders []string - beaconRPCProvider string - walletKeyCount int - privateKeyFile string - passwordFilePath string - keysDir string - mnemonicLanguage string - backupsDir string - backupsPassword string - filteredPubKeys []bls.PublicKey - rawPubKeys [][]byte - formattedPubKeys []string - exitJSONOutputPath string - walletDir string - walletPassword string - mnemonic string - numAccounts int - mnemonic25thWord string - beaconApiEndpoint string - beaconApiTimeout time.Duration - inputReader io.Reader + // Deprecated: gRPC API is being deprecated in favour of REST API. + dialOpts []grpc.DialOption + // Deprecated: gRPC API is being deprecated in favour of REST API. + grpcHeaders []string + // Deprecated: gRPC API is being deprecated in favour of REST API. + beaconRPCProvider string + walletKeyCount int + privateKeyFile string + passwordFilePath string + keysDir string + mnemonicLanguage string + backupsDir string + backupsPassword string + filteredPubKeys []bls.PublicKey + rawPubKeys [][]byte + formattedPubKeys []string + exitJSONOutputPath string + walletDir string + walletPassword string + mnemonic string + numAccounts int + mnemonic25thWord string + beaconApiEndpoint string + beaconApiTimeout time.Duration + inputReader io.Reader } func (acm *CLIManager) prepareBeaconClients(ctx context.Context) (*iface.ValidatorClient, *iface.NodeClient, error) { diff --git a/validator/accounts/cli_options.go b/validator/accounts/cli_options.go index 20943f6e9ce6..e01d7b52c364 100644 --- a/validator/accounts/cli_options.go +++ b/validator/accounts/cli_options.go @@ -53,6 +53,8 @@ func WithListValidatorIndices() Option { } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WithGRPCDialOpts adds grpc opts needed to connect to beacon nodes in the accounts cli manager. func WithGRPCDialOpts(opts []grpc.DialOption) Option { return func(acc *CLIManager) error { @@ -61,6 +63,8 @@ func WithGRPCDialOpts(opts []grpc.DialOption) Option { } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WithGRPCHeaders adds grpc headers used when connecting to beacon nodes in the accounts cli manager. func WithGRPCHeaders(headers []string) Option { return func(acc *CLIManager) error { @@ -69,6 +73,8 @@ func WithGRPCHeaders(headers []string) Option { } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // WithBeaconRPCProvider provides a beacon node endpoint to the accounts cli manager. func WithBeaconRPCProvider(provider string) Option { return func(acc *CLIManager) error { diff --git a/validator/client/beacon-api/beacon_api_helpers.go b/validator/client/beacon-api/beacon_api_helpers.go index ea82f84d6e9e..50bf7248c2fe 100644 --- a/validator/client/beacon-api/beacon_api_helpers.go +++ b/validator/client/beacon-api/beacon_api_helpers.go @@ -15,6 +15,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. var beaconAPITogRPCValidatorStatus = map[string]ethpb.ValidatorStatus{ "pending_initialized": ethpb.ValidatorStatus_DEPOSITED, "pending_queued": ethpb.ValidatorStatus_PENDING, diff --git a/validator/client/beacon-api/stream_blocks.go b/validator/client/beacon-api/stream_blocks.go index 06113065dce8..11991577f20e 100644 --- a/validator/client/beacon-api/stream_blocks.go +++ b/validator/client/beacon-api/stream_blocks.go @@ -22,6 +22,7 @@ type abstractSignedBlockResponseJson struct { } type streamBlocksAltairClient struct { + // Deprecated: gRPC API is being deprecated in favour of REST API. grpc.ClientStream ctx context.Context beaconApiClient *beaconApiValidatorClient diff --git a/validator/client/grpc-api/grpc_beacon_chain_client.go b/validator/client/grpc-api/grpc_beacon_chain_client.go index ef5bbf58fcb5..424c8efdd329 100644 --- a/validator/client/grpc-api/grpc_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_beacon_chain_client.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. type grpcChainClient struct { beaconChainClient ethpb.BeaconChainClient } diff --git a/validator/client/grpc-api/grpc_node_client.go b/validator/client/grpc-api/grpc_node_client.go index 40cdc1a68343..00c033a0b3ea 100644 --- a/validator/client/grpc-api/grpc_node_client.go +++ b/validator/client/grpc-api/grpc_node_client.go @@ -15,6 +15,7 @@ var ( _ = iface.NodeClient(&grpcNodeClient{}) ) +// Deprecated: gRPC API is being deprecated in favour of REST API. type grpcNodeClient struct { nodeClient ethpb.NodeClient healthTracker *beacon.NodeHealthTracker diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index 5bda6532985d..6f23d447f6cf 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -17,6 +17,7 @@ import ( "google.golang.org/grpc" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. type grpcPrysmChainClient struct { chainClient iface.ChainClient } diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index d97bf8b65bbd..1dda3f1d4b81 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -18,6 +18,7 @@ import ( "google.golang.org/grpc" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. type grpcValidatorClient struct { beaconNodeValidatorClient ethpb.BeaconNodeValidatorClient isEventStreamRunning bool diff --git a/validator/client/multiple_endpoints_grpc_resolver.go b/validator/client/multiple_endpoints_grpc_resolver.go index 9354928e3179..180b83395062 100644 --- a/validator/client/multiple_endpoints_grpc_resolver.go +++ b/validator/client/multiple_endpoints_grpc_resolver.go @@ -6,6 +6,8 @@ import ( "google.golang.org/grpc/resolver" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Modification of a default grpc passthrough resolver (google.golang.org/grpc/resolver/passthrough) allowing to use multiple addresses // in grpc endpoint. Example: // conn, err := grpc.DialContext(ctx, "127.0.0.1:4000,127.0.0.1:4001", grpc.WithInsecure(), grpc.WithResolvers(&multipleEndpointsGrpcResolverBuilder{})) @@ -14,6 +16,8 @@ import ( // grpc.WithDefaultServiceConfig("{\"loadBalancingConfig\":[{\"round_robin\":{}}]}") type multipleEndpointsGrpcResolverBuilder struct{} +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Build creates and starts multiple endpoints resolver. func (*multipleEndpointsGrpcResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error) { r := &multipleEndpointsGrpcResolver{ @@ -24,16 +28,20 @@ func (*multipleEndpointsGrpcResolverBuilder) Build(target resolver.Target, cc re return r, nil } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Scheme returns default scheme. func (*multipleEndpointsGrpcResolverBuilder) Scheme() string { return resolver.GetDefaultScheme() } +// Deprecated: gRPC API is being deprecated in favour of REST API. type multipleEndpointsGrpcResolver struct { target resolver.Target cc resolver.ClientConn } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (r *multipleEndpointsGrpcResolver) start() { ep := r.target.Endpoint() endpoints := strings.Split(ep, ",") @@ -46,8 +54,12 @@ func (r *multipleEndpointsGrpcResolver) start() { } } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ResolveNow -- func (*multipleEndpointsGrpcResolver) ResolveNow(_ resolver.ResolveNowOptions) {} +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // Close -- func (*multipleEndpointsGrpcResolver) Close() {} diff --git a/validator/client/service.go b/validator/client/service.go index 0997ea4b98f0..57025af00e35 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -61,14 +61,19 @@ type ValidatorService struct { // Config for the validator service. type Config struct { - Validator iface.Validator - DB db.Database - Wallet *wallet.Wallet - WalletInitializedFeed *event.Feed - GRPCMaxCallRecvMsgSize int - GRPCRetries uint - GRPCRetryDelay time.Duration - GRPCHeaders []string + Validator iface.Validator + DB db.Database + Wallet *wallet.Wallet + WalletInitializedFeed *event.Feed + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCMaxCallRecvMsgSize int + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCRetries uint + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCRetryDelay time.Duration + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCHeaders []string + // Deprecated: gRPC API is being deprecated in favour of REST API. BeaconNodeGRPCEndpoint string BeaconNodeCert string BeaconApiEndpoint string @@ -274,6 +279,8 @@ func (v *ValidatorService) SetProposerSettings(ctx context.Context, settings *pr return v.validator.SetProposerSettings(ctx, settings) } +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // ConstructDialOptions constructs a list of grpc dial options func ConstructDialOptions( maxCallRecvMsgSize int, diff --git a/validator/helpers/node_connection.go b/validator/helpers/node_connection.go index 8f2de45947d8..71afff3bfe05 100644 --- a/validator/helpers/node_connection.go +++ b/validator/helpers/node_connection.go @@ -8,6 +8,7 @@ import ( // Use an interface with a private dummy function to force all other packages to call NewNodeConnection type NodeConnection interface { + // Deprecated: gRPC API is being deprecated in favour of REST API. GetGrpcClientConn() *grpc.ClientConn GetBeaconApiUrl() string GetBeaconApiTimeout() time.Duration @@ -15,11 +16,13 @@ type NodeConnection interface { } type nodeConnection struct { + // Deprecated: gRPC API is being deprecated in favour of REST API. grpcClientConn *grpc.ClientConn beaconApiUrl string beaconApiTimeout time.Duration } +// Deprecated: gRPC API is being deprecated in favour of REST API. func (c *nodeConnection) GetGrpcClientConn() *grpc.ClientConn { return c.grpcClientConn } diff --git a/validator/rpc/intercepter.go b/validator/rpc/intercepter.go index eb42755237c0..802afdd89497 100644 --- a/validator/rpc/intercepter.go +++ b/validator/rpc/intercepter.go @@ -14,6 +14,8 @@ import ( "google.golang.org/grpc/status" ) +// Deprecated: gRPC API is being deprecated in favour of REST API. +// // AuthTokenInterceptor is a gRPC unary interceptor to authorize incoming requests. func (s *Server) AuthTokenInterceptor() grpc.UnaryServerInterceptor { return func( diff --git a/validator/rpc/server.go b/validator/rpc/server.go index f623faf06fb9..1173595102cf 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -25,12 +25,17 @@ import ( // Config options for the HTTP server. type Config struct { - HTTPHost string - HTTPPort int + HTTPHost string + HTTPPort int + // Deprecated: gRPC API is being deprecated in favour of REST API. GRPCMaxCallRecvMsgSize int - GRPCRetries uint - GRPCRetryDelay time.Duration - GRPCHeaders []string + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCRetries uint + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCRetryDelay time.Duration + // Deprecated: gRPC API is being deprecated in favour of REST API. + GRPCHeaders []string + // Deprecated: gRPC API is being deprecated in favour of REST API. BeaconNodeGRPCEndpoint string BeaconApiEndpoint string BeaconApiTimeout time.Duration @@ -47,36 +52,41 @@ type Config struct { // Server defining a HTTP server for the remote signer API and registering clients type Server struct { - ctx context.Context - cancel context.CancelFunc - httpHost string - httpPort int - server *httprest.Server - grpcMaxCallRecvMsgSize int - grpcRetries uint - grpcRetryDelay time.Duration + ctx context.Context + cancel context.CancelFunc + httpHost string + httpPort int + server *httprest.Server + // Deprecated: gRPC API is being deprecated in favour of REST API. + grpcMaxCallRecvMsgSize int + // Deprecated: gRPC API is being deprecated in favour of REST API. + grpcRetries uint + // Deprecated: gRPC API is being deprecated in favour of REST API. + grpcRetryDelay time.Duration + // Deprecated: gRPC API is being deprecated in favour of REST API. grpcHeaders []string beaconNodeValidatorClient iface.ValidatorClient chainClient iface.ChainClient nodeClient iface.NodeClient healthClient ethpb.HealthClient - beaconNodeEndpoint string - beaconApiEndpoint string - beaconApiTimeout time.Duration - beaconNodeCert string - jwtSecret []byte - authTokenPath string - authToken string - db db.Database - walletDir string - wallet *wallet.Wallet - walletInitializedFeed *event.Feed - walletInitialized bool - validatorService *client.ValidatorService - router *http.ServeMux - logStreamer logs.Streamer - logStreamerBufferSize int - startFailure error + // Deprecated: gRPC API is being deprecated in favour of REST API. + beaconNodeEndpoint string + beaconApiEndpoint string + beaconApiTimeout time.Duration + beaconNodeCert string + jwtSecret []byte + authTokenPath string + authToken string + db db.Database + walletDir string + wallet *wallet.Wallet + walletInitializedFeed *event.Feed + walletInitialized bool + validatorService *client.ValidatorService + router *http.ServeMux + logStreamer logs.Streamer + logStreamerBufferSize int + startFailure error } // NewServer instantiates a new HTTP server. From 3b297cda51b9987b1ccfffcfec81881727d4c7b9 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 17 Feb 2025 20:04:12 +0100 Subject: [PATCH 6/6] changelog <3 --- changelog/radek_deprecate_grpc.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/radek_deprecate_grpc.md diff --git a/changelog/radek_deprecate_grpc.md b/changelog/radek_deprecate_grpc.md new file mode 100644 index 000000000000..4aa449555e91 --- /dev/null +++ b/changelog/radek_deprecate_grpc.md @@ -0,0 +1,3 @@ +### Changed + +- Deprecated everything related with the gRPC API. \ No newline at end of file