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