github.com/prysmaticlabs/prysm@v1.4.4/proto/eth/v1/beacon_block.proto (about) 1 // Copyright 2021 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 import "proto/eth/ext/options.proto"; 20 import "proto/eth/v1/attestation.proto"; 21 22 option csharp_namespace = "Ethereum.Eth.v1"; 23 option go_package = "github.com/prysmaticlabs/prysm/proto/eth/v1"; 24 option java_multiple_files = true; 25 option java_outer_classname = "BeaconBlockProto"; 26 option java_package = "org.ethereum.eth.v1"; 27 option php_namespace = "Ethereum\\Eth\\v1"; 28 29 // The Ethereum consensus beacon block. The message does not contain a validator signature. 30 message BeaconBlock { 31 // Beacon chain slot that this block represents. 32 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 33 34 // Validator index of the validator that proposed the block header. 35 uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; 36 37 // 32 byte root of the parent block. 38 bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 39 40 // 32 byte root of the resulting state after processing this block. 41 bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; 42 43 // The block body itself. 44 BeaconBlockBody body = 5; 45 } 46 47 // The Ethereum consensus beacon block for Hard Fork 1. The message does not contain a validator signature. 48 message BeaconBlockV1 { 49 // Beacon chain slot that this block represents. 50 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 51 52 // Validator index of the validator that proposed the block header. 53 uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; 54 55 // 32 byte root of the parent block. 56 bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 57 58 // 32 byte root of the resulting state after processing this block. 59 bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; 60 61 // The Hard Fork 1 block body itself. 62 BeaconBlockBodyV1 body = 5; 63 } 64 65 // The signed version of beacon block. 66 message SignedBeaconBlock { 67 // The unsigned beacon block itself. 68 BeaconBlock block = 1; 69 70 // 96 byte BLS signature from the validator that produced this block. 71 bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; 72 } 73 74 // The signed version of Hard Fork 1 beacon block. 75 message SignedBeaconBlockV1 { 76 // The unsigned beacon block itself. 77 BeaconBlockV1 block = 1; 78 79 // 96 byte BLS signature from the validator that produced this block. 80 bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; 81 } 82 83 // The block body of an Ethereum consensus beacon block. 84 message BeaconBlockBody { 85 // The validators RANDAO reveal 96 byte value. 86 bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"]; 87 88 // A reference to the Ethereum 1.x chain. 89 Eth1Data eth1_data = 2; 90 91 // 32 byte field of arbitrary data. This field may contain any data and 92 // is not used for anything other than a fun message. 93 bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 94 95 // Block operations 96 // Refer to spec constants at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block 97 98 // At most MAX_PROPOSER_SLASHINGS. 99 repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"]; 100 101 // At most MAX_ATTESTER_SLASHINGS. 102 repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"]; 103 104 // At most MAX_ATTESTATIONS. 105 repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"]; 106 107 // At most MAX_DEPOSITS. 108 repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"]; 109 110 // At most MAX_VOLUNTARY_EXITS. 111 repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"]; 112 } 113 114 // The block body of an Ethereum consensus beacon block for Hard Fork 1. 115 message BeaconBlockBodyV1 { 116 // The validators RANDAO reveal 96 byte value. 117 bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"]; 118 119 // A reference to the Ethereum 1.x chain. 120 Eth1Data eth1_data = 2; 121 122 // 32 byte field of arbitrary data. This field may contain any data and 123 // is not used for anything other than a fun message. 124 bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 125 126 // Block operations 127 // Refer to spec constants at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block 128 129 // At most MAX_PROPOSER_SLASHINGS. 130 repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"]; 131 132 // At most MAX_ATTESTER_SLASHINGS. 133 repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"]; 134 135 // At most MAX_ATTESTATIONS. 136 repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"]; 137 138 // At most MAX_DEPOSITS. 139 repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"]; 140 141 // At most MAX_VOLUNTARY_EXITS. 142 repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"]; 143 144 // Bitvector used to track sync committee voting bits. 145 bytes sync_committee_bits = 10 [(ethereum.eth.ext.ssz_size) = "64", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector512"]; 146 147 // BLS aggregated signature of the sync committee for the ones that voted. 148 bytes sync_committee_signature = 11 [(ethereum.eth.ext.ssz_size) = "96"]; 149 } 150 151 152 // Proposer slashings are proofs that a slashable offense has been committed by 153 // proposing two conflicting blocks from the same validator. 154 message ProposerSlashing { 155 // First conflicting signed block header. 156 SignedBeaconBlockHeader signed_header_1 = 2; 157 158 // Second conflicting signed block header. 159 SignedBeaconBlockHeader signed_header_2 = 3; 160 } 161 162 // Attestor slashings are proofs that a slashable offense has been committed by 163 // attestating to two conflicting pieces of information by the same validator. 164 message AttesterSlashing { 165 // First conflicting attestation. 166 IndexedAttestation attestation_1 = 1; 167 168 // Second conflicting attestation. 169 IndexedAttestation attestation_2 = 2; 170 } 171 172 // Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract. 173 message Deposit { 174 message Data { 175 // 48 byte BLS public key of the validator. 176 bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"]; 177 178 // A 32 byte hash of the withdrawal address public key. 179 bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"]; 180 181 // Deposit amount in gwei. 182 uint64 amount = 3; 183 184 // 96 byte signature from the validators public key. 185 bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"]; 186 } 187 188 // 32 byte roots in the deposit tree branch. 189 repeated bytes proof = 1 [(ethereum.eth.ext.ssz_size) = "33,32"]; 190 191 Data data = 2; 192 } 193 194 195 // A message that represents a validator signaling that they want to voluntarily 196 // withdraw from the active validator set. The message does not contain a 197 // validator signature. 198 message VoluntaryExit { 199 // The epoch on when exit request becomes valid. 200 uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"]; 201 202 // Index of the exiting validator. 203 uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; 204 } 205 206 // The signed version of voluntary exit. 207 message SignedVoluntaryExit { 208 // The unsigned voluntary exit itself. 209 VoluntaryExit message = 1; 210 211 // Validator's 96 byte signature 212 bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; 213 } 214 215 // Eth1Data represents references to the Ethereum 1.x deposit contract. 216 message Eth1Data { 217 // The 32 byte deposit tree root for the last deposit included in this 218 // block. 219 bytes deposit_root = 1 [(ethereum.eth.ext.ssz_size) = "32"]; 220 221 // The total number of deposits included in the beacon chain since genesis 222 // including the deposits in this block. 223 uint64 deposit_count = 2; 224 225 // The 32 byte block hash of the Ethereum 1.x block considered for deposit 226 // inclusion. 227 bytes block_hash = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 228 } 229 230 // A beacon block header is essentially a beacon block with only a reference to 231 // the beacon body as a 32 byte merkle tree root. This type of message is more 232 // lightweight than a full beacon block. The message does not contain 233 // a validator signature. 234 message BeaconBlockHeader { 235 // Beacon chain slot that this block represents. 236 uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"]; 237 238 // Validator index of the validator that proposed the block header. 239 uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"]; 240 241 // 32 byte merkle tree root of the parent ssz encoded block. 242 bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"]; 243 244 // 32 byte merkle tree root of the resulting ssz encoded state after processing this block. 245 bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"]; 246 247 // 32 byte merkle tree root of the ssz encoded block body. 248 bytes body_root = 5 [(ethereum.eth.ext.ssz_size) = "32"]; 249 } 250 251 message SignedBeaconBlockHeader { 252 // The unsigned beacon block header itself. 253 BeaconBlockHeader message = 1; 254 255 // 96 byte BLS signature from the validator that produced this block header. 256 bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"]; 257 } 258 259 message IndexedAttestation { 260 repeated uint64 attesting_indices = 1 [(ethereum.eth.ext.ssz_max) = "2048"]; 261 262 AttestationData data = 2; 263 264 // 96 bytes aggregate signature. 265 bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"]; 266 }