mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 09:14:28 +00:00
319daa7f6c
Co-authored-by: Nishant Das <nishdas93@gmail.com> Fix Migration Of State (#12423)
282 lines
13 KiB
Protocol Buffer
282 lines
13 KiB
Protocol Buffer
// Copyright 2021 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.v2;
|
|
|
|
import "proto/eth/ext/options.proto";
|
|
import "proto/eth/v1/attestation.proto";
|
|
import "proto/eth/v1/beacon_block.proto";
|
|
import "proto/eth/v1/beacon_state.proto";
|
|
import "proto/eth/v1/validator.proto";
|
|
import "proto/eth/v2/sync_committee.proto";
|
|
import "proto/eth/v2/version.proto";
|
|
import "proto/engine/v1/execution_engine.proto";
|
|
|
|
option csharp_namespace = "Ethereum.Eth.V2";
|
|
option go_package = "github.com/prysmaticlabs/prysm/v4/proto/eth/v2;eth";
|
|
option java_multiple_files = true;
|
|
option java_outer_classname = "SyncCommitteeProto";
|
|
option java_package = "org.ethereum.eth.v2";
|
|
option php_namespace = "Ethereum\\Eth\\v2";
|
|
|
|
message BeaconState {
|
|
// Versioning [1001-2000]
|
|
uint64 genesis_time = 1001;
|
|
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
|
v1.Fork fork = 1004;
|
|
|
|
// History [2001-3000]
|
|
v1.BeaconBlockHeader latest_block_header = 2001;
|
|
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
|
|
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
|
|
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
|
|
|
|
// Eth1 [3001-4000]
|
|
v1.Eth1Data eth1_data = 3001;
|
|
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
|
|
uint64 eth1_deposit_index = 3003;
|
|
|
|
// Registry [4001-5000]
|
|
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
|
|
// Randomness [5001-6000]
|
|
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
|
|
|
|
// Slashings [6001-7000]
|
|
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
|
|
|
|
// Participation [7001-8000]
|
|
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced previous_epoch_attestations]
|
|
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced current_epoch_attestations]
|
|
|
|
// Finality [8001-9000]
|
|
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
|
|
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
|
|
v1.Checkpoint previous_justified_checkpoint = 8002;
|
|
v1.Checkpoint current_justified_checkpoint = 8003;
|
|
v1.Checkpoint finalized_checkpoint = 8004;
|
|
|
|
// New Altair fields [9001-10000]
|
|
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair]
|
|
SyncCommittee current_sync_committee = 9002; // [New in Altair]
|
|
SyncCommittee next_sync_committee = 9003; // [New in Altair]
|
|
}
|
|
|
|
message BeaconStateBellatrix {
|
|
// Versioning [1001-2000]
|
|
uint64 genesis_time = 1001;
|
|
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
|
v1.Fork fork = 1004;
|
|
|
|
// History [2001-3000]
|
|
v1.BeaconBlockHeader latest_block_header = 2001;
|
|
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
|
|
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
|
|
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
|
|
|
|
// Eth1 [3001-4000]
|
|
v1.Eth1Data eth1_data = 3001;
|
|
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
|
|
uint64 eth1_deposit_index = 3003;
|
|
|
|
// Registry [4001-5000]
|
|
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
|
|
// Randomness [5001-6000]
|
|
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
|
|
|
|
// Slashings [6001-7000]
|
|
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
|
|
|
|
// Participation [7001-8000]
|
|
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
|
|
// Finality [8001-9000]
|
|
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
|
|
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
|
|
v1.Checkpoint previous_justified_checkpoint = 8002;
|
|
v1.Checkpoint current_justified_checkpoint = 8003;
|
|
v1.Checkpoint finalized_checkpoint = 8004;
|
|
|
|
// Altair fields [9001-10000]
|
|
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
SyncCommittee current_sync_committee = 9002; // [New in Altair]
|
|
SyncCommittee next_sync_committee = 9003; // [New in Altair]
|
|
|
|
// Bellatrix fields [10001-11000]
|
|
engine.v1.ExecutionPayloadHeader latest_execution_payload_header = 10001; // [New in Bellatrix]
|
|
}
|
|
|
|
message BeaconStateCapella {
|
|
// Versioning [1001-2000]
|
|
uint64 genesis_time = 1001;
|
|
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
|
v1.Fork fork = 1004;
|
|
|
|
// History [2001-3000]
|
|
v1.BeaconBlockHeader latest_block_header = 2001;
|
|
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
|
|
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
|
|
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
|
|
|
|
// Eth1 [3001-4000]
|
|
v1.Eth1Data eth1_data = 3001;
|
|
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
|
|
uint64 eth1_deposit_index = 3003;
|
|
|
|
// Registry [4001-5000]
|
|
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
|
|
// Randomness [5001-6000]
|
|
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
|
|
|
|
// Slashings [6001-7000]
|
|
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
|
|
|
|
// Participation [7001-8000]
|
|
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
|
|
// Finality [8001-9000]
|
|
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
|
|
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
|
|
v1.Checkpoint previous_justified_checkpoint = 8002;
|
|
v1.Checkpoint current_justified_checkpoint = 8003;
|
|
v1.Checkpoint finalized_checkpoint = 8004;
|
|
|
|
// Altair fields [9001-10000]
|
|
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
SyncCommittee current_sync_committee = 9002; // [New in Altair]
|
|
SyncCommittee next_sync_committee = 9003; // [New in Altair]
|
|
|
|
// Bellatrix fields [10001-11000]
|
|
ethereum.engine.v1.ExecutionPayloadHeaderCapella latest_execution_payload_header = 10001; // [New in Bellatrix]
|
|
|
|
// Capella fields [11001-12000]
|
|
uint64 next_withdrawal_index = 11001; // [New in Capella]
|
|
uint64 next_withdrawal_validator_index = 11002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"]; // [New in Capella]
|
|
|
|
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"]; // [New in Capella]
|
|
}
|
|
|
|
message BeaconStateDeneb {
|
|
// Versioning [1001-2000]
|
|
uint64 genesis_time = 1001;
|
|
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
|
v1.Fork fork = 1004;
|
|
// History [2001-3000]
|
|
v1.BeaconBlockHeader latest_block_header = 2001;
|
|
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
|
|
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
|
|
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
|
|
// Eth1 [3001-4000]
|
|
v1.Eth1Data eth1_data = 3001;
|
|
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
|
|
uint64 eth1_deposit_index = 3003;
|
|
// Registry [4001-5000]
|
|
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
// Randomness [5001-6000]
|
|
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
|
|
// Slashings [6001-7000]
|
|
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
|
|
// Participation [7001-8000]
|
|
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
// Finality [8001-9000]
|
|
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
|
|
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
|
|
v1.Checkpoint previous_justified_checkpoint = 8002;
|
|
v1.Checkpoint current_justified_checkpoint = 8003;
|
|
v1.Checkpoint finalized_checkpoint = 8004;
|
|
// Altair fields [9001-10000]
|
|
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
|
|
SyncCommittee current_sync_committee = 9002; // [New in Altair]
|
|
SyncCommittee next_sync_committee = 9003; // [New in Altair]
|
|
// Bellatrix fields [10001-11000]
|
|
ethereum.engine.v1.ExecutionPayloadHeaderDeneb latest_execution_payload_header = 10001; // [Updated in Deneb]
|
|
// Capella fields [11001-12000]
|
|
uint64 next_withdrawal_index = 11001; // [New in Capella]
|
|
uint64 next_withdrawal_validator_index = 11002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.ValidatorIndex"]; // [New in Capella]
|
|
|
|
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"]; // [New in Capella]
|
|
}
|
|
|
|
message HistoricalSummary {
|
|
bytes block_summary_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
bytes state_summary_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
}
|
|
|
|
message BeaconStateRequestV2 {
|
|
// The state id which can be any of: "head" (canonical head in node's view),
|
|
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
|
|
bytes state_id = 1;
|
|
}
|
|
|
|
message BeaconStateResponseV2 {
|
|
Version version = 1;
|
|
BeaconStateContainer data = 2;
|
|
bool execution_optimistic = 3;
|
|
bool finalized = 4;
|
|
}
|
|
|
|
message BeaconStateSSZResponseV2 {
|
|
v2.Version version = 1;
|
|
bytes data = 2;
|
|
}
|
|
|
|
message BeaconStateContainer {
|
|
oneof state {
|
|
v1.BeaconState phase0_state = 1;
|
|
BeaconState altair_state = 2;
|
|
BeaconStateBellatrix bellatrix_state = 3;
|
|
BeaconStateCapella capella_state = 4;
|
|
BeaconStateDeneb deneb_state = 5;
|
|
}
|
|
}
|
|
|
|
message ForkChoiceHeadsResponse {
|
|
repeated ForkChoiceHead data = 1;
|
|
}
|
|
|
|
message ForkChoiceHead {
|
|
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Slot"];
|
|
bool execution_optimistic = 3;
|
|
}
|
|
|
|
message RandaoRequest {
|
|
bytes state_id = 1;
|
|
optional uint64 epoch = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v4/consensus-types/primitives.Epoch"];
|
|
}
|
|
|
|
message RandaoResponse {
|
|
Randao data = 1;
|
|
bool execution_optimistic = 2;
|
|
bool finalized = 3;
|
|
|
|
message Randao {
|
|
bytes randao = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
}
|
|
}
|