github.com/prysmaticlabs/prysm@v1.4.4/proto/beacon/p2p/v1/types.proto (about) 1 syntax = "proto3"; 2 package ethereum.beacon.p2p.v1; 3 4 import "proto/eth/v1alpha1/attestation.proto"; 5 import "proto/eth/v1alpha1/beacon_block.proto"; 6 import "proto/eth/v1alpha1/validator.proto"; 7 import "proto/eth/ext/options.proto"; 8 9 message BeaconState { 10 // Versioning [1001-2000] 11 uint64 genesis_time = 1001; 12 bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"]; 13 uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 14 Fork fork = 1004; 15 16 // History [2001-3000] 17 ethereum.eth.v1alpha1.BeaconBlockHeader latest_block_header = 2001; 18 repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"]; 19 repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"]; 20 repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"]; 21 22 // Eth1 [3001-4000] 23 ethereum.eth.v1alpha1.Eth1Data eth1_data = 3001; 24 repeated ethereum.eth.v1alpha1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"]; 25 uint64 eth1_deposit_index = 3003; 26 27 // Registry [4001-5000] 28 repeated ethereum.eth.v1alpha1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; 29 repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; 30 31 // Randomness [5001-6000] 32 repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"]; 33 34 // Slashings [6001-7000] 35 repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"]; 36 37 // Attestations [7001-8000] 38 repeated PendingAttestation previous_epoch_attestations = 7001 [(ethereum.eth.ext.ssz_max) = "previous_epoch_attestations.max"]; 39 repeated PendingAttestation current_epoch_attestations = 7002 [(ethereum.eth.ext.ssz_max) = "current_epoch_attestations.max"]; 40 41 // Finality [8001-9000] 42 // Spec type [4]Bitvector which means this would be a fixed size of 4 bits. 43 bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"]; 44 ethereum.eth.v1alpha1.Checkpoint previous_justified_checkpoint = 8002; 45 ethereum.eth.v1alpha1.Checkpoint current_justified_checkpoint = 8003; 46 ethereum.eth.v1alpha1.Checkpoint finalized_checkpoint = 8004; 47 } 48 49 // The beacon state for Altair hard fork 1. 50 // Reference: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/beacon-chain.md#beaconstate 51 message BeaconStateAltair { 52 // Versioning [1001-2000] 53 uint64 genesis_time = 1001; 54 bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"]; 55 uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 56 Fork fork = 1004; 57 58 // History [2001-3000] 59 ethereum.eth.v1alpha1.BeaconBlockHeader latest_block_header = 2001; 60 repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"]; 61 repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"]; 62 repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"]; 63 64 // Eth1 [3001-4000] 65 ethereum.eth.v1alpha1.Eth1Data eth1_data = 3001; 66 repeated ethereum.eth.v1alpha1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"]; 67 uint64 eth1_deposit_index = 3003; 68 69 // Registry [4001-5000] 70 repeated ethereum.eth.v1alpha1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; 71 repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; 72 73 // Randomness [5001-6000] 74 repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"]; 75 76 // Slashings [6001-7000] 77 repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"]; 78 79 // Participation [7001-8000] 80 bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced previous_epoch_attestations] 81 bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced current_epoch_attestations] 82 83 // Finality [8001-9000] 84 // Spec type [4]Bitvector which means this would be a fixed size of 4 bits. 85 bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"]; 86 ethereum.eth.v1alpha1.Checkpoint previous_justified_checkpoint = 8002; 87 ethereum.eth.v1alpha1.Checkpoint current_justified_checkpoint = 8003; 88 ethereum.eth.v1alpha1.Checkpoint finalized_checkpoint = 8004; 89 90 // New Altair fields [9001-10000] 91 repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair] 92 SyncCommittee current_sync_committee = 9002; // [New in Altair] 93 SyncCommittee next_sync_committee = 9003; // [New in Altair] 94 } 95 96 message Fork { 97 bytes previous_version = 1 [(ethereum.eth.ext.ssz_size) = "4"]; 98 bytes current_version = 2 [(ethereum.eth.ext.ssz_size) = "4"]; 99 uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"]; 100 } 101 102 message PendingAttestation { 103 // Bitfield representation of validator indices that have voted exactly 104 // the same vote and have been aggregated into this attestation. 105 bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"]; 106 ethereum.eth.v1alpha1.AttestationData data = 2; 107 // The difference of when attestation gets created and get included on chain. 108 uint64 inclusion_delay = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 109 // The proposer who included the attestation in the block. 110 uint64 proposer_index = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; 111 } 112 113 message HistoricalBatch { 114 repeated bytes block_roots = 1 [(ethereum.eth.ext.ssz_size) = "block_roots.size"]; 115 repeated bytes state_roots = 2 [(ethereum.eth.ext.ssz_size) = "state_roots.size"]; 116 } 117 118 // The state summary object is defined for summarizing a state 119 // of a given slot. The summary facilitates regeneration of a 120 // specific state to allow easy playback using pre-saved state 121 // and blocks. 122 message StateSummary { 123 // The slot of the state. 124 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 125 // The block root of the state. 126 bytes root = 2; 127 } 128 129 message SigningData { 130 // The root of the object being signed. 131 bytes object_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; 132 // The domain for the particular object being signed. 133 bytes domain = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 134 } 135 136 message ForkData { 137 // The current version of the fork. 138 bytes current_version = 4 [(ethereum.eth.ext.ssz_size) = "4"]; 139 // The genesis validators root of the fork. 140 bytes genesis_validators_root = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 141 } 142 143 message CheckPtInfo { 144 // The randao seed which the check point refers to, this will be used to retrieve shuffled indices. 145 bytes seed = 1; 146 // The genesis root which the check point refers to. This ensures same seed can't happen on different chain. 147 bytes genesis_root = 2; 148 // Validators that were active at that check point. 149 repeated uint64 active_indices = 3; 150 // Validators public keys at that check point. 151 repeated bytes pub_keys = 4; 152 // The fork data at that check point. This will be used to verify signatures. 153 Fork fork = 5; 154 } 155 156 // DepositMessage serves as a subset of deposit data in order to derive the signing root. 157 message DepositMessage { 158 // 48 byte BLS public key of the validator. 159 bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"]; 160 161 // A 32 byte hash of the withdrawal address public key. 162 bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 163 164 // Deposit amount in gwei. 165 uint64 amount = 3; 166 } 167 168 // SyncCommittee serves as committees to facilitate light client syncing to beacon chain. 169 message SyncCommittee { 170 repeated bytes pubkeys = 1 [(ethereum.eth.ext.ssz_size) = "sync_committee_bits.size,48"]; 171 bytes aggregate_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"]; 172 } 173 174 // SyncAggregatorSelectionData is used to sign over and then check whether the aggregator is selected within a subcommittee. 175 message SyncAggregatorSelectionData { 176 // Slot of this signing data. 177 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 178 // Subcommittee index of this signing data. 179 uint64 subcommittee_index = 2; 180 }