Skip to content

Commit

Permalink
Pull in EIP-7251 protobuf changes
Browse files Browse the repository at this point in the history
From: #13903
  • Loading branch information
terencechain committed Apr 24, 2024
1 parent f33670c commit cf90924
Show file tree
Hide file tree
Showing 9 changed files with 3,207 additions and 1,871 deletions.
7 changes: 7 additions & 0 deletions proto/prysm/v1alpha1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ proto_library(
srcs = [
"beacon_chain.proto",
"debug.proto",
"eip_7251.proto",
"finalized_block_root_container.proto",
"health.proto",
"node.proto",
Expand Down Expand Up @@ -134,6 +135,12 @@ ssz_gen_marshal(
"BlobSidecars",
"BlobIdentifier",
"DepositSnapshot",
"PendingBalanceDeposit",
"PartialWithdrawal",
"ExecutionLayerWithdrawalRequest",
"Consolidation",
"SignedConsolidation",
"PendingConsolidation",
],
)

Expand Down
2,232 changes: 1,125 additions & 1,107 deletions proto/prysm/v1alpha1/beacon_block.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions proto/prysm/v1alpha1/beacon_block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/attestation.proto";
import "proto/prysm/v1alpha1/withdrawals.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/prysm/v1alpha1/eip_7251.proto";

option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
Expand Down Expand Up @@ -806,6 +807,8 @@ message BeaconBlockBodyElectra {
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"];

repeated Consolidation consolidations = 13 [(ethereum.eth.ext.ssz_max) = "1"]; // New in EIP-7251.
}

message SignedBlindedBeaconBlockElectra {
Expand Down
2,076 changes: 1,312 additions & 764 deletions proto/prysm/v1alpha1/beacon_state.pb.go

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions proto/prysm/v1alpha1/beacon_state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "proto/prysm/v1alpha1/beacon_block.proto";
import "proto/prysm/v1alpha1/validator.proto";
import "proto/engine/v1/execution_engine.proto";
import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/eip_7251.proto";

option csharp_namespace = "Ethereum.Eth.V1Alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
Expand Down Expand Up @@ -342,6 +343,69 @@ message BeaconStateDeneb {
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"];
}

message BeaconStateElectra {
// 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/v5/consensus-types/primitives.Slot"];
Fork fork = 1004;

// History [2001-3000]
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]
Eth1Data eth1_data = 3001;
repeated Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
uint64 eth1_deposit_index = 3003;

// Registry [4001-5000]
repeated 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"];
Checkpoint previous_justified_checkpoint = 8002;
Checkpoint current_justified_checkpoint = 8003;
Checkpoint finalized_checkpoint = 8004;

// Fields introduced in Altair fork [9001-10000]
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
SyncCommittee current_sync_committee = 9002;
SyncCommittee next_sync_committee = 9003;

// Fields introduced in Bellatrix fork [10001-11000]
ethereum.engine.v1.ExecutionPayloadHeaderDeneb latest_execution_payload_header = 10001; // [New in Deneb]

// Fields introduced in Capella fork [11001-12000]
uint64 next_withdrawal_index = 11001;
uint64 next_withdrawal_validator_index = 11002 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"];
repeated HistoricalSummary historical_summaries = 11003 [(ethereum.eth.ext.ssz_max) = "16777216"];

// Fields introduced in EIP-7251 fork [12001-13000]
uint64 deposit_balance_to_consume = 12001;
uint64 exit_balance_to_consume = 12002;
uint64 earliest_exit_epoch = 12003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
uint64 consolidation_balance_to_consume = 12004;
uint64 earliest_consolidation_epoch = 12005 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"];
repeated PendingBalanceDeposit pending_balance_deposits = 12006 [(ethereum.eth.ext.ssz_max) = "134217728"];
repeated PartialWithdrawal pending_partial_withdrawals = 12007 [(ethereum.eth.ext.ssz_max) = "134217728"];
repeated PendingConsolidation pending_consolidations = 12008 [(ethereum.eth.ext.ssz_max) = "262144"];
}

// PowBlock is a definition from Bellatrix fork choice spec to represent a block with total difficulty in the PoW chain.
// Spec:
// class PowBlock(Container):
Expand Down
Loading

0 comments on commit cf90924

Please sign in to comment.