// 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.v1alpha1;

import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/attestation.proto";
import "proto/prysm/v1alpha1/withdrawals.proto";
import "proto/prysm/v1alpha1/beacon_core_types.proto";
import "proto/prysm/v1alpha1/gloas.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/engine/v1/electra.proto";

option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "BeaconBlockProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";

// ----------------------------------------------------------------------------
// Generic
// ----------------------------------------------------------------------------

message GenericSignedBeaconBlock {
  option deprecated = true;

  oneof block {
    // Representing a signed, phase 0 beacon block.
    SignedBeaconBlock phase0 = 1;

    // Representing a signed, post-Altair fork beacon block.
    SignedBeaconBlockAltair altair = 2;

    // Representing a signed, post-Bellatrix fork beacon block.
    SignedBeaconBlockBellatrix bellatrix = 3;

    // Representing a signed, post-Bellatrix fork blinded beacon block.
    SignedBlindedBeaconBlockBellatrix blinded_bellatrix = 4;

    // Representing a signed, post-Capella fork beacon block.
    SignedBeaconBlockCapella capella = 5;

    // Representing a signed, post-Capella fork blinded beacon block.
    SignedBlindedBeaconBlockCapella blinded_capella = 6;

    // Representing a signed, post-Deneb fork beacon block content.
    SignedBeaconBlockContentsDeneb deneb = 7;

    // Representing a signed, post-Deneb fork blinded beacon block.
    SignedBlindedBeaconBlockDeneb blinded_deneb = 8;

    // Representing a signed, post-Electra fork beacon block content.
    SignedBeaconBlockContentsElectra electra = 9;

    // Representing a signed, post-Electra fork blinded beacon block.
    SignedBlindedBeaconBlockElectra blinded_electra = 10;

    // Representing a signed, post-Fulu fork beacon block content.
    SignedBeaconBlockContentsFulu fulu = 11;

    // Representing a signed, post-Fulu fork blinded beacon block.
    SignedBlindedBeaconBlockFulu blinded_fulu = 12;

    SignedBeaconBlockGloas gloas = 13;
  }
  bool is_blinded = 100;
  reserved 101; // Deprecated fields
}

message GenericBeaconBlock {
  option deprecated = true;

  oneof block {
    // Representing a phase 0 beacon block.
    BeaconBlock phase0 = 1;

    // Representing a post-Altair fork beacon block.
    BeaconBlockAltair altair = 2;

    // Representing a post-Bellatrix fork beacon block.
    BeaconBlockBellatrix bellatrix = 3;

    // Representing a post-Bellatrix fork blinded beacon block.
    BlindedBeaconBlockBellatrix blinded_bellatrix = 4;

    // Representing a post-Capella fork beacon block.
    BeaconBlockCapella capella = 5;

    // Representing a post-Capella fork blinded beacon block.
    BlindedBeaconBlockCapella blinded_capella = 6;

    // Representing a post-Deneb fork beacon block content.
    BeaconBlockContentsDeneb deneb = 7;

    // Representing a post-Deneb fork blinded beacon block.
    BlindedBeaconBlockDeneb blinded_deneb = 8;

    // Representing a post-Electra fork beacon block content.
    BeaconBlockContentsElectra electra = 9;

    // Representing a post-Electra fork blinded beacon block.
    BlindedBeaconBlockElectra blinded_electra = 10;

    // Representing a post-Fulu fork beacon block content.
    BeaconBlockContentsFulu fulu = 11;

    // Representing a post-Fulu fork blinded beacon block.
    BlindedBeaconBlockFulu blinded_fulu = 12;

    BeaconBlockGloas gloas = 13;
  }
  bool is_blinded = 100;
  string payload_value = 101;
}

// ----------------------------------------------------------------------------
// Phase 0
// ----------------------------------------------------------------------------

// The signed version of beacon block.
message SignedBeaconBlock {
  // The unsigned beacon block itself.
  BeaconBlock block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

// The Ethereum consensus beacon block. The message does not contain a validator
// signature.
message BeaconBlock {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The block body itself.
  BeaconBlockBody body = 5;
}

// The block body of an Ethereum consensus beacon block.
message BeaconBlockBody {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];
}


// Attestor slashings are proofs that a slashable offense has been committed by
// attesting to two conflicting pieces of information by the same validator.
message AttesterSlashing {
  // First conflicting attestation.
  IndexedAttestation attestation_1 = 1;

  // Second conflicting attestation.
  IndexedAttestation attestation_2 = 2;
}

message IndexedAttestation {
  repeated uint64 attesting_indices = 1 [ (ethereum.eth.ext.ssz_max) = "2048" ];

  AttestationData data = 2;

  // 96 bytes aggregate signature.
  bytes signature = 3 [ (ethereum.eth.ext.ssz_size) = "96" ];
}


message SignedValidatorRegistrationsV1 {
  option deprecated = true;

  repeated SignedValidatorRegistrationV1 messages = 1;
}

message SignedValidatorRegistrationV1 {
  ValidatorRegistrationV1 message = 1;
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message ValidatorRegistrationV1 {
  bytes fee_recipient = 1 [ (ethereum.eth.ext.ssz_size) = "20" ];
  uint64 gas_limit = 2;
  uint64 timestamp = 3;
  bytes pubkey = 4 [ (ethereum.eth.ext.ssz_size) = "48" ];
}

message SignedBuilderBid {
  BuilderBid message = 1;
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BuilderBid {
  ethereum.engine.v1.ExecutionPayloadHeader header = 1;
  bytes value = 2 [ (ethereum.eth.ext.ssz_size) = "32" ];
  bytes pubkey = 3 [ (ethereum.eth.ext.ssz_size) = "48" ];
}

// ----------------------------------------------------------------------------
// Altair
// ----------------------------------------------------------------------------

// The signed version of a (HF1) beacon block.
message SignedBeaconBlockAltair {
  // The unsigned beacon block itself.
  BeaconBlockAltair block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

// The unsigned version of a (HF1) beacon block. The message does not contain a
// validator signature.
message BeaconBlockAltair {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The  beacon block body.
  BeaconBlockBodyAltair body = 5;
}

// The block body of an (HF1) beacon block.
message BeaconBlockBodyAltair {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  // New in Altair network upgrade.
  SyncAggregate sync_aggregate = 9;
}


// ----------------------------------------------------------------------------
// Bellatrix
// ----------------------------------------------------------------------------

message SignedBeaconBlockBellatrix {
  // The unsigned beacon block itself.
  BeaconBlockBellatrix block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BeaconBlockBellatrix {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The beacon block body.
  BeaconBlockBodyBellatrix body = 5;
}

message BeaconBlockBodyBellatrix {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload from the execution chain. New in Bellatrix network
  // upgrade.
  ethereum.engine.v1.ExecutionPayload execution_payload = 10;
}

message SignedBlindedBeaconBlockBellatrix {
  // The unsigned blinded beacon block itself.
  BlindedBeaconBlockBellatrix block = 1;

  // 96 byte BLS signature from the validator that produced this blinded block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BlindedBeaconBlockBellatrix {
  // Beacon chain slot that this blinded block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this blinded block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The blinded beacon block body.
  BlindedBeaconBlockBodyBellatrix body = 5;
}

message BlindedBeaconBlockBodyBellatrix {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload header from the execution chain. New in Bellatrix network
  // upgrade.
  ethereum.engine.v1.ExecutionPayloadHeader execution_payload_header = 10;
}

// ----------------------------------------------------------------------------
// Capella
// ----------------------------------------------------------------------------

message SignedBeaconBlockCapella {
  // The unsigned beacon block itself.
  BeaconBlockCapella block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BeaconBlockCapella {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The beacon block body.
  BeaconBlockBodyCapella body = 5;
}

message BeaconBlockBodyCapella {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload from the execution chain.
  ethereum.engine.v1.ExecutionPayloadCapella execution_payload = 10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];
}

message SignedBlindedBeaconBlockCapella {
  // The unsigned blinded beacon block itself.
  BlindedBeaconBlockCapella block = 1;

  // 96 byte BLS signature from the validator that produced this blinded block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BlindedBeaconBlockCapella {
  // Beacon chain slot that this blinded block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this blinded block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The blinded beacon block body.
  BlindedBeaconBlockBodyCapella body = 5;
}

message BlindedBeaconBlockBodyCapella {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload header from the execution chain.
  ethereum.engine.v1.ExecutionPayloadHeaderCapella execution_payload_header =
      10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];
}

message SignedBuilderBidCapella {
  BuilderBidCapella message = 1;
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BuilderBidCapella {
  ethereum.engine.v1.ExecutionPayloadHeaderCapella header = 1;
  bytes value = 2 [ (ethereum.eth.ext.ssz_size) = "32" ];
  bytes pubkey = 3 [ (ethereum.eth.ext.ssz_size) = "48" ];
}

// ----------------------------------------------------------------------------
// Deneb
// ----------------------------------------------------------------------------

message SignedBeaconBlockContentsDeneb {
  SignedBeaconBlockDeneb block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
}

message SignedBeaconBlockDeneb {
  // The unsigned beacon block itself.
  BeaconBlockDeneb block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BeaconBlockContentsDeneb {
  BeaconBlockDeneb block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
}

message BeaconBlockDeneb {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The beacon block body.
  BeaconBlockBodyDeneb body = 5;
}

message BeaconBlockBodyDeneb {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/core/0_beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.-
  SyncAggregate sync_aggregate = 9;

  // Execution payload from the execution chain.
  ethereum.engine.v1.ExecutionPayloadDeneb execution_payload = 10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  repeated bytes blob_kzg_commitments = 12 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];
}

message SignedBlindedBeaconBlockDeneb {
  // The unsigned blinded beacon block itself.
  BlindedBeaconBlockDeneb message = 1;

  // 96 byte BLS signature from the validator that produced this blinded block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BlindedBeaconBlockDeneb {
  // Beacon chain slot that this blinded block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this blinded block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The blinded beacon block body.
  BlindedBeaconBlockBodyDeneb body = 5;
}

message BlindedBeaconBlockBodyDeneb {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS.
  repeated AttesterSlashing attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "2" ];

  // At most MAX_ATTESTATIONS.
  repeated Attestation attestations = 6 [ (ethereum.eth.ext.ssz_max) = "128" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload header from the execution chain.
  ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution_payload_header = 10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Blob KZG commitments. New in Deneb network upgrade.
  repeated bytes blob_kzg_commitments = 12 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];
}

message SignedBuilderBidDeneb {
  BuilderBidDeneb message = 1;
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BuilderBidDeneb {
  ethereum.engine.v1.ExecutionPayloadHeaderDeneb header = 1;
  repeated bytes blob_kzg_commitments = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ]; // new in deneb
  bytes value = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];
  bytes pubkey = 4 [ (ethereum.eth.ext.ssz_size) = "48" ];
}

message BuilderBidElectra {
    ethereum.engine.v1.ExecutionPayloadHeaderDeneb header = 1;
    repeated bytes blob_kzg_commitments = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max)  = "max_blob_commitments.size"];
    ethereum.engine.v1.ExecutionRequests execution_requests = 3;
    bytes value = 4 [(ethereum.eth.ext.ssz_size) = "32"];
    bytes pubkey = 5 [(ethereum.eth.ext.ssz_size) = "48"];
}

message SignedBuilderBidElectra {
    BuilderBidElectra message = 1 ;
    bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}

message BlobSidecars {
  repeated BlobSidecar sidecars = 1
      [ (ethereum.eth.ext.ssz_max) = "max_blobs_per_block.size" ];
}

message BlobSidecar {
  uint64 index = 1;
  bytes blob = 2 [ (ethereum.eth.ext.ssz_size) = "blob.size" ];
  bytes kzg_commitment = 3 [ (ethereum.eth.ext.ssz_size) = "48" ];
  bytes kzg_proof = 4 [ (ethereum.eth.ext.ssz_size) = "48" ];
  SignedBeaconBlockHeader signed_block_header = 5;
  repeated bytes commitment_inclusion_proof = 6
      [ (ethereum.eth.ext.ssz_size) =
            "kzg_commitment_inclusion_proof_depth.size,32" ];
}

// ----------------------------------------------------------------------------
// Electra
// ----------------------------------------------------------------------------

message SignedBeaconBlockContentsElectra {
  SignedBeaconBlockElectra block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
}

message SignedBeaconBlockElectra {
  // The unsigned beacon block itself.
  BeaconBlockElectra block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BeaconBlockContentsElectra {
  BeaconBlockElectra block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "4096"
  ];
}

message BeaconBlockElectra {
  // Beacon chain slot that this block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The beacon block body.
  BeaconBlockBodyElectra body = 5;
}

message BeaconBlockBodyElectra {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // Block operations
  // Refer to spec constants at
  // https://github.com/ethereum/consensus-specs/blob/master/specs/core/0_beacon-chain.md#max-operations-per-block

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS_ELECTRA.
  repeated AttesterSlashingElectra attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "1" ];

  // At most MAX_ATTESTATIONS_ELECTRA.
  repeated AttestationElectra attestations = 6
      [ (ethereum.eth.ext.ssz_max) = "8" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload from the execution chain. New in Bellatrix network
  // upgrade.
  ethereum.engine.v1.ExecutionPayloadDeneb execution_payload = 10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES. New in Capella network upgrade.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Blob KZG commitments.
  repeated bytes blob_kzg_commitments = 12 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];

  // Execution requests. New in Electra network upgrade.
  ethereum.engine.v1.ExecutionRequests execution_requests = 13;
}

message SignedBlindedBeaconBlockElectra {
  // The unsigned blinded beacon block itself.
  BlindedBeaconBlockElectra message = 1;

  // 96 byte BLS signature from the validator that produced this blinded block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BlindedBeaconBlockElectra {
  // Beacon chain slot that this blinded block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this blinded block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The blinded beacon block body.
  BlindedBeaconBlockBodyElectra body = 5;
}

message BlindedBeaconBlockBodyElectra {
  // The validators RANDAO reveal 96 byte value.
  bytes randao_reveal = 1 [ (ethereum.eth.ext.ssz_size) = "96" ];

  // A reference to the Ethereum 1.x chain.
  Eth1Data eth1_data = 2;

  // 32 byte field of arbitrary data. This field may contain any data and
  // is not used for anything other than a fun message.
  bytes graffiti = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // At most MAX_PROPOSER_SLASHINGS.
  repeated ProposerSlashing proposer_slashings = 4
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_ATTESTER_SLASHINGS_ELECTRA.
  repeated AttesterSlashingElectra attester_slashings = 5
      [ (ethereum.eth.ext.ssz_max) = "1" ];

  // At most MAX_ATTESTATIONS_ELECTRA.
  repeated AttestationElectra attestations = 6
      [ (ethereum.eth.ext.ssz_max) = "8" ];

  // At most MAX_DEPOSITS.
  repeated Deposit deposits = 7 [ (ethereum.eth.ext.ssz_max) = "16" ];

  // At most MAX_VOLUNTARY_EXITS.
  repeated SignedVoluntaryExit voluntary_exits = 8
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Sync aggregate object for the beacon chain to track sync committee votes.
  SyncAggregate sync_aggregate = 9;

  // Execution payload header from the execution chain.
  ethereum.engine.v1.ExecutionPayloadHeaderDeneb execution_payload_header = 10;

  // At most MAX_BLS_TO_EXECUTION_CHANGES.
  repeated SignedBLSToExecutionChange bls_to_execution_changes = 11
      [ (ethereum.eth.ext.ssz_max) = "16" ];

  // Blob KZG commitments.
  repeated bytes blob_kzg_commitments = 12 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];

  // Execution requests. New in Electra network upgrade.
  ethereum.engine.v1.ExecutionRequests execution_requests = 13;
}

// ----------------------------------------------------------------------------
// Fulu
// ----------------------------------------------------------------------------

message SignedBeaconBlockContentsFulu {
  SignedBeaconBlockFulu block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_cell_proofs_length.size"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];
}

message SignedBeaconBlockFulu {
  // The unsigned beacon block itself.
  BeaconBlockElectra block = 1;

  // 96 byte BLS signature from the validator that produced this block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BeaconBlockContentsFulu {
  BeaconBlockElectra block = 1;
  repeated bytes kzg_proofs = 2 [
    (ethereum.eth.ext.ssz_size) = "?,48",
    (ethereum.eth.ext.ssz_max) = "max_cell_proofs_length.size"
  ];
  repeated bytes blobs = 3 [
    (ethereum.eth.ext.ssz_size) = "?,blob.size",
    (ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
  ];
}

message SignedBlindedBeaconBlockFulu {
  // The unsigned blinded beacon block itself.
  BlindedBeaconBlockFulu message = 1;

  // 96 byte BLS signature from the validator that produced this blinded block.
  bytes signature = 2 [ (ethereum.eth.ext.ssz_size) = "96" ];
}

message BlindedBeaconBlockFulu {
  // Beacon chain slot that this blinded block represents.
  uint64 slot = 1 [
    (ethereum.eth.ext.cast_type) =
        "github.com/OffchainLabs/prysm/v7/consensus-types/primitives.Slot"
  ];

  // Validator index of the validator that proposed the block header.
  uint64 proposer_index = 2 [ (ethereum.eth.ext.cast_type) =
                                  "github.com/OffchainLabs/prysm/v7/"
                                  "consensus-types/primitives.ValidatorIndex" ];

  // 32 byte root of the parent block.
  bytes parent_root = 3 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // 32 byte root of the resulting state after processing this blinded block.
  bytes state_root = 4 [ (ethereum.eth.ext.ssz_size) = "32" ];

  // The blinded beacon block body.
  BlindedBeaconBlockBodyElectra body = 5;
}
