github.com/prysmaticlabs/prysm@v1.4.4/proto/eth/v1/beacon_state.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.v1;
    17  
    18  import "google/protobuf/descriptor.proto";
    19  
    20  import "proto/eth/ext/options.proto";
    21  import "proto/eth/v1/attestation.proto";
    22  import "proto/eth/v1/beacon_block.proto";
    23  import "proto/eth/v1/validator.proto";
    24  
    25  option csharp_namespace = "Ethereum.Eth.v1";
    26  option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1";
    27  option java_multiple_files = true;
    28  option java_outer_classname = "BeaconStateProto";
    29  option java_package = "org.ethereum.eth.v1";
    30  option php_namespace = "Ethereum\\Eth\\v1";
    31  
    32  message BeaconState {
    33    // Versioning
    34    uint64 genesis_time = 1;
    35    bytes genesis_validators_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
    36    uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
    37    Fork fork = 4;
    38  
    39    // History
    40    BeaconBlockHeader latest_block_header = 5;
    41    repeated bytes block_roots = 6 [(ethereum.eth.ext.ssz_size) = "8192"];
    42    repeated bytes state_roots = 7 [(ethereum.eth.ext.ssz_size) = "8192"];
    43    repeated bytes historical_roots = 8 [(ethereum.eth.ext.ssz_size) = "32", (ethereum.eth.ext.ssz_max) = "16777216"];
    44  
    45    // Eth1
    46    Eth1Data eth1_data = 9;
    47    repeated Eth1Data eth1_data_votes = 10 [(ethereum.eth.ext.ssz_max) = "1024"];
    48    uint64 eth1_deposit_index = 11;
    49  
    50    // Registry
    51    repeated Validator validators = 12 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
    52    repeated uint64 balances = 13 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
    53  
    54    // Randomness
    55    repeated bytes randao_mixes = 14 [(ethereum.eth.ext.ssz_size) = "65536"];
    56  
    57    // Slashings
    58    repeated uint64 slashings = 15 [(ethereum.eth.ext.ssz_size) = "65536"];
    59  
    60    // Attestations
    61    repeated PendingAttestation previous_epoch_attestations = 16 [(ethereum.eth.ext.ssz_max) = "4096"];
    62    repeated PendingAttestation current_epoch_attestations = 17 [(ethereum.eth.ext.ssz_max) = "4096"];
    63  
    64    // Finality
    65    // Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
    66    bytes justification_bits = 18 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
    67    Checkpoint previous_justified_checkpoint = 19;
    68    Checkpoint current_justified_checkpoint = 20;
    69    Checkpoint finalized_checkpoint = 21;
    70  }
    71  
    72  message PendingAttestation {
    73    // Bitfield representation of validator indices that have voted exactly
    74    // the same vote and have been aggregated into this attestation.
    75    bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
    76    AttestationData data = 2;
    77    // The difference of when attestation gets created and get included on chain.
    78    uint64 inclusion_delay = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
    79    // The proposer who included the attestation in the block.
    80    uint64 proposer_index = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
    81  }
    82  
    83  message Committee {
    84    uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
    85    uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
    86    repeated uint64 validators = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
    87  }
    88  
    89  // Fork structure used for indicating beacon chain versioning and forks.
    90  message Fork {
    91    bytes previous_version = 1 [(ethereum.eth.ext.ssz_size) = "4"];
    92    bytes current_version = 2 [(ethereum.eth.ext.ssz_size) = "4"];
    93    uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
    94  }