github.com/prysmaticlabs/prysm@v1.4.4/proto/eth/v1alpha1/beacon_chain.proto (about)

     1  // Copyright 2020 Prysmatic Labs.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  syntax = "proto3";
    15  
    16  package ethereum.eth.v1alpha1;
    17  
    18  import "google/api/annotations.proto";
    19  import "google/protobuf/empty.proto";
    20  
    21  import "proto/eth/ext/options.proto";
    22  import "proto/eth/v1alpha1/attestation.proto";
    23  import "proto/eth/v1alpha1/beacon_block.proto";
    24  import "proto/eth/v1alpha1/validator.proto";
    25  
    26  option csharp_namespace = "Ethereum.Eth.v1alpha1";
    27  option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1;eth";
    28  option java_multiple_files = true;
    29  option java_outer_classname = "BeaconChainProto";
    30  option java_package = "org.ethereum.eth.v1alpha1";
    31  option php_namespace = "Ethereum\\Eth\\v1alpha1";
    32  
    33  // Beacon chain API
    34  //
    35  // The beacon chain API can be used to access data relevant to the Ethereum Beacon Chain.
    36  service BeaconChain {
    37      // TODO(preston): Batch requests?
    38  
    39      // Retrieve attestations by block root, slot, or epoch.
    40      //
    41      // The server may return an empty list when no attestations match the given
    42      // filter criteria. This RPC should not return NOT_FOUND. Only one filter
    43      // criteria should be used. This endpoint allows for retrieval of genesis
    44      // information via a boolean query filter.
    45      rpc ListAttestations(ListAttestationsRequest) returns (ListAttestationsResponse) {
    46          option (google.api.http) = {
    47              get: "/eth/v1alpha1/beacon/attestations"
    48          };
    49      }
    50  
    51      // Retrieve indexed attestations by block root, slot, or epoch.
    52      //
    53      // The server may return an empty list when no indexed attestations match the given
    54      // filter criteria. This RPC should not return NOT_FOUND. Only one filter
    55      // criteria should be used. This endpoint allows for retrieval of genesis
    56      // information via a boolean query filter.
    57      rpc ListIndexedAttestations(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsResponse) {
    58          option (google.api.http) = {
    59              get: "/eth/v1alpha1/beacon/attestations/indexed"
    60          };
    61      }
    62  
    63      // Server-side stream of attestations as they are received by
    64      // the beacon chain node.
    65      rpc StreamAttestations(google.protobuf.Empty) returns (stream Attestation) {
    66          option (google.api.http) = {
    67              get: "/eth/v1alpha1/beacon/attestations/stream"
    68          };
    69      }
    70  
    71      // Server-side stream of indexed attestations as they are received by
    72      // the beacon chain node.
    73      rpc StreamIndexedAttestations(google.protobuf.Empty) returns (stream IndexedAttestation) {
    74          option (google.api.http) = {
    75              get: "/eth/v1alpha1/beacon/attestations/indexed/stream"
    76          };
    77      }
    78  
    79      // Retrieve attestations from pool.
    80      //
    81      // The server returns a list of attestations that have been seen but not
    82      // yet processed. Pool attestations eventually expire as the slot
    83      // advances, so an attestation missing from this request does not imply
    84      // that it was included in a block. The attestation may have expired.
    85      // Refer to the Ethereum Beacon Chain specification for more details on how
    86      // attestations are processed and when they are no longer valid.
    87      // https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
    88      rpc AttestationPool(AttestationPoolRequest) returns (AttestationPoolResponse) {
    89          option (google.api.http) = {
    90              get: "/eth/v1alpha1/beacon/attestations/pool"
    91          };
    92      }
    93  
    94      // Retrieve blocks by root, slot, or epoch.
    95      //
    96      // The server may return multiple blocks in the case that a slot or epoch is
    97      // provided as the filter criteria. The server may return an empty list when
    98      // no blocks in their database match the filter criteria. This RPC should
    99      // not return NOT_FOUND. Only one filter criteria should be used. This endpoint
   100      // allows for retrieval of genesis information via a boolean query filter.
   101      rpc ListBlocks(ListBlocksRequest) returns (ListBlocksResponse) {
   102          option (google.api.http) = {
   103              get: "/eth/v1alpha1/beacon/blocks"
   104          };
   105      }
   106  
   107      // Server-side stream of all signed blocks as they are received by
   108      // the beacon chain node.
   109      rpc StreamBlocks(StreamBlocksRequest) returns (stream SignedBeaconBlock) {
   110          option (google.api.http) = {
   111              get: "/eth/v1alpha1/beacon/blocks/stream"
   112          };
   113      }
   114  
   115      // Server-side stream of information about the head of the beacon chain
   116      // from the view of the beacon chain node.
   117      //
   118      // This includes the head block slot and root as well as information about
   119      // the most recent finalized and justified slots.
   120      rpc StreamChainHead(google.protobuf.Empty) returns (stream ChainHead) {
   121          option (google.api.http) = {
   122              get: "/eth/v1alpha1/beacon/chainhead/stream"
   123          };
   124      }
   125  
   126      // Retrieve information about the head of the beacon chain from the view of
   127      // the beacon chain node.
   128      //
   129      // This includes the head block slot and root as well as information about
   130      // the most recent finalized and justified slots.
   131      rpc GetChainHead(google.protobuf.Empty) returns (ChainHead) {
   132          option (google.api.http) = {
   133              get: "/eth/v1alpha1/beacon/chainhead"
   134          };
   135      }
   136  
   137      // Retrieve information about the weak subjectivity of the beacon chain from the view of
   138      // the beacon chain node.
   139      //
   140      // This includes the weak subjectivity block root, state root and epoch number.
   141      rpc GetWeakSubjectivityCheckpoint(google.protobuf.Empty) returns (WeakSubjectivityCheckpoint) {
   142          option (google.api.http) = {
   143              get: "/eth/v1alpha1/beacon/weak_subjectivity_checkpoint"
   144          };
   145      }
   146  
   147      // Retrieve the beacon chain committees for a given epoch.
   148      //
   149      // If no filter criteria is specified, the response returns
   150      // all beacon committees for the current epoch. The results are paginated by default.
   151      // This endpoint allows for retrieval of genesis information via a boolean query filter.
   152      rpc ListBeaconCommittees(ListCommitteesRequest) returns (BeaconCommittees) {
   153          option (google.api.http) = {
   154              get: "/eth/v1alpha1/beacon/committees"
   155          };
   156      }
   157  
   158      // Retrieve validator balances for a given set of public keys at a specific
   159      // epoch in time. This endpoint allows for retrieval of genesis information
   160      // via a boolean query filter.
   161      rpc ListValidatorBalances(ListValidatorBalancesRequest) returns (ValidatorBalances) {
   162          option (google.api.http) = {
   163              get: "/eth/v1alpha1/validators/balances"
   164          };
   165      }
   166  
   167      // Retrieve the current validator registry.
   168      //
   169      // The request may include an optional historical epoch to retrieve a
   170      // specific validator set in time. This endpoint allows for retrieval of genesis
   171      // information via a boolean query filter.
   172      rpc ListValidators(ListValidatorsRequest) returns (Validators) {
   173          option (google.api.http) = {
   174              get: "/eth/v1alpha1/validators"
   175          };
   176      }
   177  
   178      // Retrieve information about a specific validator in the registry.
   179      //
   180      // This request may query by validator index or public key.
   181      rpc GetValidator(GetValidatorRequest) returns (Validator) {
   182          option (google.api.http) = {
   183              get: "/eth/v1alpha1/validator"
   184          };
   185      }
   186  
   187      // Retrieve the active set changes for a given epoch.
   188      //
   189      // This data includes any activations, voluntary exits, and involuntary
   190      // ejections. This endpoint allows for retrieval of genesis
   191      // information via a boolean query filter.
   192      rpc GetValidatorActiveSetChanges(GetValidatorActiveSetChangesRequest) returns (ActiveSetChanges) {
   193          option (google.api.http) = {
   194              get: "/eth/v1alpha1/validators/activesetchanges"
   195          };
   196      }
   197  
   198      // Retrieve the current validator queue information.
   199      rpc GetValidatorQueue(google.protobuf.Empty) returns (ValidatorQueue) {
   200          option (google.api.http) = {
   201              get: "/eth/v1alpha1/validators/queue"
   202          };
   203      }
   204  
   205      // GetValidatorPerformance reports a validator's latest balance along with other important
   206      // metrics on rewards and penalties throughout its lifecycle in the beacon chain.
   207      // The request takes in a list of validator public keys and returns a performance report
   208      // for all of them respectively.
   209      rpc GetValidatorPerformance(ValidatorPerformanceRequest) returns (ValidatorPerformanceResponse) {
   210          option (google.api.http) = {
   211              get: "/eth/v1alpha1/validators/performance"
   212          };
   213      }
   214  
   215      // Retrieve the validator assignments for a given epoch.
   216      //
   217      // This request may specify optional validator indices or public keys to
   218      // filter validator assignments. This endpoint allows for retrieval of genesis
   219      // information via a boolean query filter.
   220      rpc ListValidatorAssignments(ListValidatorAssignmentsRequest) returns (ValidatorAssignments) {
   221          option (google.api.http) = {
   222              get: "/eth/v1alpha1/validators/assignments"
   223          };
   224      }
   225  
   226      // Retrieve the validator participation information for a given epoch.
   227      //
   228      // This method returns information about the global participation of
   229      // validator attestations. This endpoint allows for retrieval of genesis
   230      // information via a boolean query filter.
   231      rpc GetValidatorParticipation(GetValidatorParticipationRequest) returns (ValidatorParticipationResponse) {
   232          option (google.api.http) = {
   233              get: "/eth/v1alpha1/validators/participation"
   234          };
   235      }
   236  
   237      // Retrieve the current configuration parameters of the beacon chain.
   238      rpc GetBeaconConfig(google.protobuf.Empty) returns (BeaconConfig) {
   239          option (google.api.http) = {
   240              get: "/eth/v1alpha1/beacon/config"
   241          };
   242      }
   243  
   244      // Server-side stream of validator information at each epoch.
   245      rpc StreamValidatorsInfo(stream ValidatorChangeSet) returns (stream ValidatorInfo) {
   246          option (google.api.http) = {
   247              get: "/eth/v1alpha1/beacon/validators/info/stream"
   248          };
   249      }
   250  
   251      // Submit an attester slashing object to the beacon node.
   252      rpc SubmitAttesterSlashing(AttesterSlashing) returns (SubmitSlashingResponse) {
   253          option (google.api.http) = {
   254              get: "/eth/v1alpha1/beacon/slashings/attester/submit"
   255          };
   256      }
   257  
   258      // Submit a proposer slashing object to the beacon node.
   259      rpc SubmitProposerSlashing(ProposerSlashing) returns (SubmitSlashingResponse) {
   260          option (google.api.http) = {
   261              get: "/eth/v1alpha1/beacon/slashings/proposer/submit"
   262          };
   263      }
   264  
   265      // Returns a list of validators individual vote status of a given epoch.
   266      rpc GetIndividualVotes(IndividualVotesRequest) returns (IndividualVotesRespond) {
   267          option (google.api.http) = {
   268              get: "/eth/v1alpha1/beacon/individual_votes"
   269          };
   270      }
   271  }
   272  
   273  // SetAction defines the type of action that should be applied to the keys in a validator change set.
   274  enum SetAction {
   275      // ADD_VALIDATOR_KEYS adds to the existing keys.
   276      ADD_VALIDATOR_KEYS = 0;
   277      // REMOVE_VALIDATOR_KEYS removes from the existing keys.
   278      REMOVE_VALIDATOR_KEYS = 1;
   279      // SET_VALIDATOR_KEYS overwrites the existing keys.
   280      SET_VALIDATOR_KEYS = 2;
   281  }
   282  
   283  // ValidatorChangeSet updates the server's list of keys on which to operate.
   284  message ValidatorChangeSet {
   285      // Action (add/remove/set).
   286      SetAction action = 1;
   287  
   288      // 48 byte BLS public keys of validators on which the operation occurs.
   289      repeated bytes public_keys = 2;
   290  }
   291  
   292  // Request for indexed attestations by target epoch.
   293  message ListIndexedAttestationsRequest {
   294      oneof query_filter {
   295          // Retrieve attestations by epoch processed.
   296          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   297  
   298          // Optional criteria to retrieve genesis epoch attestations.
   299          bool genesis_epoch = 2;
   300      }
   301  
   302      // The maximum number of IndexedAttestations to return in the response.
   303      // This field is optional.
   304      int32 page_size = 3;
   305  
   306      // A pagination token returned from a previous call to `ListIndexedAttestations`
   307      // that indicates where this listing should continue from.
   308      // This field is optional.
   309      string page_token = 4;
   310  }
   311  
   312  // Request for attestations.
   313  message ListAttestationsRequest {
   314      // TODO(preston): Test oneof with gRPC gateway.
   315  
   316      oneof query_filter {
   317          // Filter attestations by epoch processed.
   318          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   319  
   320          // Optional criteria to retrieve attestations from 0 epoch.
   321          bool genesis_epoch = 2;
   322      }
   323  
   324      // The maximum number of Attestations to return in the response.
   325      // This field is optional.
   326      int32 page_size = 3;
   327  
   328      // A pagination token returned from a previous call to `ListAttestations`
   329      // that indicates where this listing should continue from.
   330      // This field is optional.
   331      string page_token = 4;
   332  }
   333  
   334  message ListAttestationsResponse {
   335      repeated Attestation attestations = 1;
   336  
   337      // A pagination token returned from a previous call to `ListAttestations`
   338      // that indicates from where listing should continue.
   339      // This field is optional.
   340      string next_page_token = 2;
   341  
   342      // Total count of Attestations matching the request filter.
   343      int32 total_size = 3;
   344  }
   345  
   346  message ListIndexedAttestationsResponse {
   347      repeated IndexedAttestation indexed_attestations = 1;
   348  
   349      // A pagination token returned from a previous call to `ListIndexedAttestations`
   350      // that indicates from where listing should continue.
   351      // This field is optional.
   352      string next_page_token = 2;
   353  
   354      // Total count of Attestations matching the request filter.
   355      int32 total_size = 3;
   356  }
   357  
   358  message ListBlocksRequest {
   359      oneof query_filter {
   360          // Block root filter to return a single block.
   361          bytes root = 1;
   362  
   363          // Slot to lookup a block. If the slot is not yet finalized, this
   364          // criteria may yield multiple valid blocks if the node has seen blocks
   365          // from another fork.
   366          uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   367  
   368          // The epoch number for which to retrieve blocks. If specified, this
   369          // will return all blocks found within the span of the specified epoch.
   370          uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   371  
   372          // Optional criteria to retrieve genesis block.
   373          bool genesis = 4;
   374      }
   375  
   376      // The maximum number of Blocks to return in the response.
   377      // This field is optional.
   378      int32 page_size = 5;
   379  
   380      // A pagination token returned from a previous call to `ListBlocks`
   381      // that indicates where this listing should continue from.
   382      // This field is optional.
   383      string page_token = 6;
   384  }
   385  
   386  message ListBlocksResponse {
   387      repeated BeaconBlockContainer blockContainers = 1;
   388  
   389      // A pagination token returned from a previous call to `ListBlocks`
   390      // that indicates from where listing should continue.
   391      // This field is optional.
   392      string next_page_token = 2;
   393  
   394      // Total count of Blocks matching the request filter.
   395      int32 total_size = 3;
   396  }
   397  
   398  // Request to only return blocks that is verified by the beacon node.
   399  message StreamBlocksRequest {
   400      bool verified_only = 1;
   401  }
   402  
   403  // A container that contains both the beacon block
   404  // and its corresponding root.
   405  message BeaconBlockContainer {
   406      // The contained Ethereum beacon block.
   407      SignedBeaconBlock block = 1;
   408  
   409      // 32 byte merkle tree root of contained beacon block.
   410      bytes block_root = 2;
   411  
   412      // Boolean indicating whether the block is canonical.
   413      bool canonical = 3;
   414  }
   415  
   416  // Information about the head of the beacon chain.
   417  message ChainHead {
   418      // Slot of the head block.
   419      uint64 head_slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   420  
   421      // Epoch of the head block.
   422      uint64 head_epoch = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   423  
   424      // 32 byte merkle tree root of the canonical head block in the beacon node.
   425      bytes head_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
   426  
   427      // Most recent slot that contains the finalized block.
   428      uint64 finalized_slot = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   429  
   430      // Epoch of the finalized block.
   431      uint64 finalized_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   432  
   433      // Most recent 32 byte finalized block root.
   434      bytes finalized_block_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
   435  
   436      // Most recent slot that contains the justified block.
   437      uint64 justified_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   438  
   439      // Epoch of the justified block.
   440      uint64 justified_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   441  
   442      // Most recent 32 byte justified block root.
   443      bytes justified_block_root = 9 [(ethereum.eth.ext.ssz_size) = "32"];
   444  
   445      // Most recent slot that contains the previous justified block.
   446      uint64 previous_justified_slot = 10 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   447  
   448      // Epoch of the previous justified block.
   449      uint64 previous_justified_epoch = 11 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   450  
   451      // Previous 32 byte justified block root.
   452      bytes previous_justified_block_root = 12 [(ethereum.eth.ext.ssz_size) = "32"];
   453  }
   454  
   455  message ListCommitteesRequest {
   456      oneof query_filter {
   457          // Optional criteria to retrieve data at a specific epoch.
   458          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   459  
   460          // Optional criteria to retrieve genesis data.
   461          bool genesis = 2;
   462      }
   463  }
   464  
   465  message BeaconCommittees {
   466      message CommitteeItem {
   467          // A committee is a list of validator indices participating in consensus at a slot.
   468          repeated uint64 validator_indices = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   469      }
   470  
   471      message CommitteesList {
   472          // A list of committees.
   473          repeated CommitteeItem committees = 1;
   474      }
   475  
   476      // The epoch for which the committees in the response belong to.
   477      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   478  
   479      // A map of validator committees by slot.
   480      map<uint64, CommitteesList> committees = 2;
   481  
   482      // The number of active validators at the given epoch.
   483      uint64 active_validator_count = 3;
   484  }
   485  
   486  message ListValidatorBalancesRequest {
   487      oneof query_filter {
   488          // Optional criteria to retrieve balances at a specific epoch.
   489          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   490  
   491          // Optional criteria to retrieve the genesis list of balances.
   492          bool genesis = 2;
   493      }
   494  
   495      // Validator 48 byte BLS public keys to filter validators for the given
   496      // epoch.
   497      repeated bytes public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48"];
   498      // Validator indices to filter validators for the given epoch.
   499      repeated uint64 indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   500  
   501      // The maximum number of Validators to return in the response.
   502      // This field is optional.
   503      int32 page_size = 5;
   504  
   505      // A pagination token returned from a previous call to `GetValidators`
   506      // that indicates where this listing should continue from.
   507      // This field is optional.
   508      string page_token = 6;
   509  }
   510  
   511  message ValidatorBalances {
   512      // Epoch which the state was considered to determine the validator balances.
   513      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   514  
   515      message Balance {
   516          // Validator's 48 byte BLS public key.
   517          bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48"];
   518  
   519          // Validator's index in the validator set.
   520          uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   521  
   522          // Validator's balance in gwei.
   523          uint64 balance = 3;
   524  
   525          // Validator's status, UNKNOWN if not found.
   526          string status = 4;
   527      }
   528  
   529      repeated Balance balances = 2;
   530  
   531      // A pagination token returned from a previous call to `GetListValidatorBalances`
   532      // that indicates from where listing should continue.
   533      string next_page_token = 3;
   534  
   535      // Total count of items matching the request filter.
   536      int32 total_size = 4;
   537  }
   538  
   539  message ListValidatorsRequest {
   540      oneof query_filter {
   541          // Optional criteria to retrieve validators at a specific epoch.
   542          // Omitting this field or setting it to zero will retrieve a response
   543          // with the current active validator set.
   544          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   545  
   546          // Optional criteria to retrieve the genesis set of validators.
   547          bool genesis = 2;
   548      }
   549  
   550      // Specify whether or not you want to retrieve only active validators.
   551      bool active = 3;
   552  
   553      // The maximum number of Validators to return in the response.
   554      // This field is optional.
   555      int32 page_size = 4;
   556  
   557      // A pagination token returned from a previous call to `GetValidators`
   558      // that indicates where this listing should continue from.
   559      // This field is optional.
   560      string page_token = 5;
   561  
   562      // Specify which validators you would like to retrieve by their public keys.
   563      // This field is optional.
   564      repeated bytes public_keys = 6;
   565  
   566      // Specify which validators you would like to retrieve by their indices.
   567      // This field is optional.
   568      repeated uint64 indices = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   569  }
   570  
   571  message GetValidatorRequest {
   572      oneof query_filter {
   573          // Validator index in the registry.
   574          uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   575  
   576          // 48 byte validator public key.
   577          bytes public_key = 2 [(ethereum.eth.ext.ssz_size) = "48"];
   578      }
   579  }
   580  
   581  message Validators {
   582      // Epoch which the state was considered to determine the active validator
   583      // set. This field is not optional. Zero value epoch indicates the validator
   584      // set is from the Ethereum proof of stake genesis set.
   585      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   586  
   587      message ValidatorContainer {
   588          uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   589          Validator validator = 2;
   590      }
   591  
   592      repeated ValidatorContainer validator_list = 2;
   593  
   594      // A pagination token returned from a previous call to `GetValidators`
   595      // that indicates from where listing should continue.
   596      // This field is optional.
   597      string next_page_token = 3;
   598  
   599      // Total count of Validators matching the request filter.
   600      int32 total_size = 4;
   601  }
   602  
   603  message GetValidatorActiveSetChangesRequest {
   604      oneof query_filter {
   605          // Optional criteria to retrieve balances at a specific epoch.
   606          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   607  
   608          // Optional criteria to retrieve the genesis list of balances.
   609          bool genesis = 2;
   610      }
   611  }
   612  
   613  message ActiveSetChanges {
   614      // Epoch which the state was considered to determine the active validator
   615      // set.
   616      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   617  
   618      // 48 byte validator public keys that have been activated in the given epoch.
   619      repeated bytes activated_public_keys = 2 [(ethereum.eth.ext.ssz_size) = "?,48"];
   620  
   621      // Indices of validators activated in the given epoch.
   622      repeated uint64 activated_indices = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   623  
   624      // 48 byte validator public keys that have been voluntarily exited in the given epoch.
   625      repeated bytes exited_public_keys = 4 [(ethereum.eth.ext.ssz_size) = "?,48"];
   626  
   627      // Indices of validators exited in the given epoch.
   628      repeated uint64 exited_indices = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   629  
   630      // 48 byte validator public keys that have been slashed in the given epoch.
   631      repeated bytes slashed_public_keys = 6 [(ethereum.eth.ext.ssz_size) = "?,48"];
   632  
   633      // Indices of validators slashed in the given epoch.
   634      repeated uint64 slashed_indices = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   635  
   636      // 48 byte validator public keys that have been involuntarily ejected in this epoch.
   637      repeated bytes ejected_public_keys = 8 [(ethereum.eth.ext.ssz_size) = "?,48"];
   638  
   639      // Indices of validators ejected in the given epoch.
   640      repeated uint64 ejected_indices = 9 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   641  }
   642  
   643  message ValidatorPerformanceRequest {
   644      // A list of 48 byte validator public keys.
   645      repeated bytes public_keys = 1 [deprecated = true];
   646      // A list of validator indices to retrieve performance by their indices.
   647      repeated uint64 indices = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   648  }
   649  
   650  message ValidatorPerformanceResponse {
   651      // A list of validator effective balances mapped 1-to-1 with the request's
   652  	// public keys.
   653      repeated uint64 current_effective_balances = 1;
   654      // The slot of when validator's attestation got included in the chain at previous epoch, the slot
   655      // is mapped 1-to-1 with the request's public keys.
   656      repeated uint64 inclusion_slots = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   657      // The distance of when validator submitted and got included in the chain, the distance
   658      // is mapped 1-to-1 with the request's public keys.
   659      repeated uint64 inclusion_distances = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   660      // Whether the list of validator recently correctly voted for source at previous epoch, the result
   661      // is mapped 1-to-1 with the request's public keys.
   662      repeated bool correctly_voted_source = 4;
   663      // Whether the list of validator recently correctly voted for target at previous epoch, the result
   664      // is mapped 1-to-1 with the request's public keys.
   665      repeated bool correctly_voted_target = 5;
   666      // Whether the list of validator recently correctly voted for head at previous epoch, the result
   667      // is mapped 1-to-1 with the request's public keys.
   668      repeated bool correctly_voted_head = 6;
   669      // The balance of validators before epoch transition, the balance is mapped 1-to-1 with the requests's
   670      // public keys.
   671      repeated uint64 balances_before_epoch_transition = 7;
   672      // The balance of validators after epoch transition, the balance is mapped 1-to-1 with the requests's
   673      // public keys.
   674      repeated uint64 balances_after_epoch_transition = 8;
   675      // The total number of validators from the request not found in
   676      // in the beacon chain.
   677      repeated bytes missing_validators = 9;
   678  	// The average active validator balance in the beacon chain.
   679      float average_active_validator_balance = 10;
   680      // The public keys in the order they are in of the response.
   681      repeated bytes public_keys = 11 [(ethereum.eth.ext.ssz_size) = "?,48"];
   682  }
   683  
   684  message ValidatorQueue {
   685      // The amount of ether in gwei allowed to enter or exit the active
   686      // validator set.
   687      uint64 churn_limit = 1;
   688  
   689      // Ordered list of 48 byte public keys awaiting activation. 0th index is the
   690      // next key to be processed.
   691      repeated bytes activation_public_keys = 2 [(ethereum.eth.ext.ssz_size) = "?,48", deprecated = true];
   692  
   693      // Ordered list of public keys awaiting exit. 0th index is the next key to
   694      // be processed.
   695      repeated bytes exit_public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48", deprecated = true];
   696  
   697      // Ordered list of validator indices awaiting activation. 0th item in the list is the
   698      // next validator index to be processed.
   699      repeated uint64 activation_validator_indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   700  
   701      // Ordered list of validator indices awaiting exit. 0th item in the list is the
   702      // next validator index to be processed.
   703      repeated uint64 exit_validator_indices = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   704  }
   705  
   706  message ListValidatorAssignmentsRequest {
   707      oneof query_filter {
   708          // Epoch to validator assignments for.
   709          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   710  
   711          // Whether or not to query for the genesis information.
   712          bool genesis = 2;
   713      }
   714      // 48 byte validator public keys to filter assignments for the given epoch.
   715      repeated bytes public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48"];
   716      // Validator indicies to filter assignments for the given epoch.
   717      repeated uint64 indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   718  
   719      // The maximum number of ValidatorAssignments to return in the response.
   720      // This field is optional.
   721      int32 page_size = 5;
   722  
   723      // A pagination token returned from a previous call to `ListValidatorAssignments`
   724      // that indicates where this listing should continue from.
   725      // This field is optional.
   726      string page_token = 6;
   727  }
   728  
   729  message ValidatorAssignments {
   730      message CommitteeAssignment {
   731          // Beacon committees are responsible for crosslinking committee data back to the beacon chain,
   732          // they also attest and produce beacon chain blocks. This is a list of validator indices that
   733          // are in the same committee as requested validator, everyone in the committee is assigned to the
   734          // same slot and same committee.
   735          repeated uint64 beacon_committees = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   736  
   737          // Committee index represents the committee of validator that's in.
   738          uint64 committee_index = 2  [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
   739  
   740          // Beacon chain slot in which the validator must perform its assigned
   741          // duty as an attester.
   742          uint64 attester_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   743  
   744          // Beacon chain slots in which the validator must perform its assigned
   745          // duty as a proposer.
   746          repeated uint64 proposer_slots = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   747  
   748          // 48 byte BLS public key.
   749          bytes public_key = 5 [(ethereum.eth.ext.ssz_size) = "48", deprecated = true];
   750  
   751          // Validator index in the beacon state.
   752          uint64 validator_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   753      }
   754  
   755      // The epoch for which this set of validator assignments is valid.
   756      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   757  
   758      repeated CommitteeAssignment assignments = 2;
   759  
   760      // A pagination token returned from a previous call to `ListValidatorAssignmentsRequest`
   761      // that indicates where this listing should continue from.
   762      // This field is optional.
   763      string next_page_token = 3;
   764  
   765      // Total count of CommitteeAssignments matching the request filter.
   766      int32 total_size = 4;
   767  }
   768  
   769  message GetValidatorParticipationRequest {
   770      oneof query_filter {
   771          // Epoch to request participation information.
   772          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   773  
   774          // Whether or not to query for the genesis information.
   775          bool genesis = 2;
   776      }
   777  }
   778  
   779  message ValidatorParticipationResponse {
   780      // Epoch which this message is applicable.
   781      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   782  
   783      // Whether or not epoch has been finalized.
   784      bool finalized = 2;
   785  
   786      // The actual validator participation metrics.
   787      ValidatorParticipation participation = 3;
   788  }
   789  
   790  message AttestationPoolRequest {
   791      // The maximum number of objects to return in the response.
   792      // This field is optional.
   793      int32 page_size = 1;
   794  
   795      // A pagination token returned from a previous call
   796      // that indicates where this listing should continue from.
   797      // This field is optional.
   798      string page_token = 2;
   799  }
   800  
   801  message AttestationPoolResponse {
   802      // List of attestations currently in the pool of the beacon chain.
   803      repeated Attestation attestations = 1;
   804  
   805      // A pagination token returned from a previous call
   806      // that indicates where this listing should continue from.
   807      // This field is optional.
   808      string next_page_token = 2;
   809  
   810      // Total count of objects matching the request filter.
   811      int32 total_size = 3;
   812  }
   813  
   814  // Information about the configuration parameters of the beacon node, such
   815  // as the slots per epoch, slots per eth1 voting period, and more.
   816  message BeaconConfig {
   817      map<string, string> config = 1;
   818  }
   819  
   820  message SubmitSlashingResponse {
   821      // Indices of the validators to be slashed by the submitted
   822      // proposer/attester slashing object.
   823      repeated uint64 slashed_indices = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   824  }
   825  
   826  message IndividualVotesRequest {
   827      // Epoch of the request.
   828      uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   829      // Validator 48 byte BLS public keys to filter validators for the given epoch.
   830      repeated bytes public_keys = 2;
   831      // Validator indices to filter validators for the given epoch.
   832      repeated uint64 indices = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   833  }
   834  
   835  message IndividualVotesRespond {
   836      message IndividualVote {
   837          // The epoch of the vote status request.
   838          uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   839          // The public key of the vote status request.
   840          bytes public_key = 2;
   841          // The validator index of the request.
   842          uint64 validator_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
   843          // Has the validator been slashed.
   844          bool is_slashed = 4;
   845          // Is the validator withdrawable.
   846          bool is_withdrawable_in_current_epoch = 5;
   847          // Is the validator active in current epoch.
   848          bool is_active_in_current_epoch = 6;
   849          // Was the validator active in previous epoch.
   850          bool is_active_in_previous_epoch = 7;
   851          // Did validator attest for current epoch.
   852          bool is_current_epoch_attester = 8;
   853          // Did validator attest target for current epoch.
   854          bool is_current_epoch_target_attester = 9;
   855          // Did validator attest for previous epoch.
   856          bool is_previous_epoch_attester = 10;
   857          // Did validator attest target for previous epoch.
   858          bool is_previous_epoch_target_attester = 11;
   859          // Did validator attest head for previous epoch.
   860          bool is_previous_epoch_head_attester = 12;
   861          // The current effective balance of the validator.
   862          uint64 current_epoch_effective_balance_gwei = 13;
   863          // The slots of when the validator's attestation got included in the block.
   864          uint64 inclusion_slot = 14 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   865          // How many slots have passed until the validator's attestation got included in the block.
   866          uint64 inclusion_distance = 15 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
   867      }
   868  
   869      repeated IndividualVote individual_votes = 1;
   870  }
   871  
   872  message WeakSubjectivityCheckpoint {
   873      // The block root of weak subjectivity checkpoint.
   874      bytes block_root = 1;
   875      // The state root of weak subjectivity checkpoint.
   876      bytes state_root = 2;
   877      // The epoch of weak subjectivity checkpoint.
   878      uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
   879  }