// Copyright 2020 Prysmatic Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package ethereum.eth.v1; import "google/protobuf/descriptor.proto"; import "proto/eth/ext/options.proto"; import "proto/eth/v1/attestation.proto"; import "proto/eth/v1/beacon_block.proto"; import "proto/eth/v1/validator.proto"; option csharp_namespace = "Ethereum.Eth.v1"; option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1"; option java_multiple_files = true; option java_outer_classname = "BeaconStateProto"; option java_package = "org.ethereum.eth.v1"; option php_namespace = "Ethereum\\Eth\\v1"; message BeaconState { // Versioning uint64 genesis_time = 1; bytes genesis_validators_root = 2 [(ethereum.eth.ext.ssz_size) = "32"]; uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; Fork fork = 4; // History BeaconBlockHeader latest_block_header = 5; repeated bytes block_roots = 6 [(ethereum.eth.ext.ssz_size) = "8192"]; repeated bytes state_roots = 7 [(ethereum.eth.ext.ssz_size) = "8192"]; repeated bytes historical_roots = 8 [(ethereum.eth.ext.ssz_size) = "32", (ethereum.eth.ext.ssz_max) = "16777216"]; // Eth1 Eth1Data eth1_data = 9; repeated Eth1Data eth1_data_votes = 10 [(ethereum.eth.ext.ssz_max) = "1024"]; uint64 eth1_deposit_index = 11; // Registry repeated Validator validators = 12 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; repeated uint64 balances = 13 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // Randomness repeated bytes randao_mixes = 14 [(ethereum.eth.ext.ssz_size) = "65536"]; // Slashings repeated uint64 slashings = 15 [(ethereum.eth.ext.ssz_size) = "65536"]; // Attestations repeated PendingAttestation previous_epoch_attestations = 16 [(ethereum.eth.ext.ssz_max) = "4096"]; repeated PendingAttestation current_epoch_attestations = 17 [(ethereum.eth.ext.ssz_max) = "4096"]; // Finality // Spec type [4]Bitvector which means this would be a fixed size of 4 bits. bytes justification_bits = 18 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"]; Checkpoint previous_justified_checkpoint = 19; Checkpoint current_justified_checkpoint = 20; Checkpoint finalized_checkpoint = 21; } message PendingAttestation { // Bitfield representation of validator indices that have voted exactly // the same vote and have been aggregated into this attestation. bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"]; AttestationData data = 2; // The difference of when attestation gets created and get included on chain. uint64 inclusion_delay = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; // The proposer who included the attestation in the block. uint64 proposer_index = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; } message Committee { uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"]; uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; repeated uint64 validators = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; } // Fork structure used for indicating beacon chain versioning and forks. message Fork { bytes previous_version = 1 [(ethereum.eth.ext.ssz_size) = "4"]; bytes current_version = 2 [(ethereum.eth.ext.ssz_size) = "4"]; uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"]; }